Skip to content

Commit 35fb27e

Browse files
maxdubrinskydrew
andauthored
feat(sdk): add TypeScript SDK (@nvidia/openshell-sdk) (#2122)
* feat(sdk): add TypeScript SDK (@nvidia/openshell-sdk) First native, per-language SDK for the OpenShell gateway: a thin, idiomatic TypeScript client over proto-generated gRPC stubs (connect-es), no FFI. Covers the v0.1 surface — sandbox lifecycle (create/get/list/delete + waitReady/ waitDeleted), health, and streamed exec. - sdk/typescript/: package, client/transport/errors, protoc + protoc-gen-es codegen (gen/ gitignored, absorbed into dist/ at build), committed lockfile. - tasks/typescript.toml: sdk:ts install/proto/typecheck/build/ci/publish; sdk:ts:typecheck wired into `check`; sdk-typescript job in branch-checks (typecheck, build, and a --dry-run publish that validates the release path). - Enforce SPDX headers on .ts/.tsx/.mts/.cts (skip node_modules and gen/); back-fill docs/_components/jsx.d.ts and fern/components/CustomFooter.tsx. - release.py gains an npm version format; release-tag.yml publishes to GitHub Packages on tag, stamping the version (0.0.0 placeholder in git); prerelease builds publish under the `next` dist-tag, not `latest`. Ships as @nvidia/openshell-sdk on GitHub Packages pre-GA; public npm (@openshell/sdk) follows at GA with an unchanged public API. Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * chore(sdk): adopt TypeScript 6, tidy @types/node range - typescript ^5.7.2 -> ^6.0.3 (6.0 is now `latest`; the old caret capped at 5.x) - @types/node ^24.0.0 -> ^24 (same range, tidier) No source changes; codegen, typecheck, and build pass on 6.0.3. Verified the emitted d.ts still type-check for downstream consumers on TypeScript 5.0.4 through 5.9.3, so this does not raise the SDK's consumer TS floor. Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * refactor(sdk): group operations under a composable SandboxClient Reshape the client from flat methods (createSandbox, listSandboxes, exec) to a scoped SandboxClient reached as `client.sandbox.create/get/list/delete/exec` (+ waitReady/waitDeleted), mirroring the CLI's noun-verb model and the Python SDK's SandboxClient. SandboxClient is also usable standalone via SandboxClient.connect(); OpenShellClient composes it over a single shared transport, so future service/provider clients reuse one connection. health() stays top-level as a gateway call. No behavior change; types are unchanged. Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * chore(sdk): generate TypeScript SDK stubs with buf Replace the protoc gen.sh with `buf generate` + buf.gen.yaml. `buf` (@bufbuild/buf) is a package devDependency and self-compiles the protos, so the TS SDK no longer depends on the mise-pinned protoc; it drives the same connect-es plugin. Generation stays limited to the client-surface closure (openshell/sandbox/datamodel) via the input paths. Output is byte-identical to the previous protoc + protoc-gen-es pipeline. Lays the groundwork for a shared buf.yaml (lint/breaking/LSP) as a follow-up. Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * build(proto): add repo-level buf module with lint Declare proto/ as a single buf v2 module in a root buf.yaml so buf generate, lint, breaking, and the editor LSP resolve imports the same way. Lint uses STANDARD with six documented exceptions for deviations the current protos intentionally make: the flat proto/ layout with nested packages (DIRECTORY_SAME_PACKAGE, PACKAGE_DIRECTORY_MATCH) and the established API shape with unsuffixed services and reused request/response messages (RPC_REQUEST_RESPONSE_UNIQUE, RPC_REQUEST_STANDARD_NAME, RPC_RESPONSE_STANDARD_NAME, SERVICE_SUFFIX). Every other STANDARD rule now enforces on future protos. Breaking uses FILE. Code generation stays package-scoped in sdk/typescript/buf.gen.yaml since it binds to that package's connect-es plugin and output dir; its inputs are unchanged and regeneration is byte-identical. Wire the check in via a proto:lint mise task that runs buf from the SDK devDependencies. It is a dependency of both sdk:ts:ci (so the TypeScript SDK CI job enforces it) and the top-level lint aggregate (so local pre-commit covers it). Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * chore(sdk): publish as unscoped openshell-sdk on public npm Rename the package from @nvidia/openshell-sdk to the unscoped openshell-sdk and target public npm (registry.npmjs.org) instead of GitHub Packages. GitHub Packages requires a scope matching the owning org, and the @openshell scope is blocked by an unrelated existing package, so an unscoped name on public npm is the lowest-friction distribution path and needs no org approval. Rework the release-tag publish job to auth against registry.npmjs.org with NPM_TOKEN (the job now only needs packages: read to pull the CI image). Update the README install instructions and usage imports. Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * chore(sdk): publish @nvidia/openshell-sdk to GitHub Packages Revert the unscoped-name switch. GitHub Packages only accepts scoped names matching the owning org, so shipping there first (which needs no external npm org or NPM_TOKEN, just the repo's GITHUB_TOKEN) requires the @NVIDIA scope. Keeping the @nvidia/openshell-sdk name also lets a later public-npm release use the same install specifier, so adding public npm becomes a second publish step rather than a rename. Restore the GitHub Packages publish auth in the release-tag job and the scoped install instructions in the README (keeping the buf codegen note). Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * feat(sdk-ts): add streaming exec, forward, ssh, provider, and config methods Grow SandboxClient to the surface the first two consumers need. execStream yields stdout/stderr chunks as they arrive and exec now drains it, keeping its buffered ExecResult and signature unchanged. execInteractive is the TTY + stdin transport primitive (start-first framing, output/write/resize/close/done, no terminal glue). forward binds a local TCP listener that tunnels each accepted connection into the sandbox for the process lifetime, minting and revoking a per-socket SSH session token around a forwardTcp bidi. Adds createSshSession / revokeSshSession, attach/detach/listProviders, and getConfig / setPolicy / setSetting (sandbox-scoped, network-policy-only, with an optional wait poll). Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * build(sdk-ts): add Biome and Vitest tooling The TypeScript SDK had no formatter or linter and no test runner. Add Biome (format + lint, generated src/gen excluded) enforcing 2-space indent, single quotes, semicolons, and a 120-column width, and reformat the existing hand-written sources accordingly. Add Vitest for unit tests. Wire sdk:ts:format, sdk:ts:lint, and sdk:ts:test mise tasks into the fmt/lint aggregates, the root test suite, and sdk:ts:ci so they run in CI. Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * test(sdk-ts): cover the sandbox surface with in-memory transport tests Exercise SandboxClient against an in-memory OpenShell service built with createRouterTransport: request assembly and id resolution, u64/int64 rendered as strings, enum lowercasing, fromConnect code mapping, the exec/execStream drain plus a backward-compat check on exec, execInteractive start-first ordering and done resolution, and a forward() byte relay against a loopback echo with close() teardown. Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * docs(sdk-ts): document the new surface and connect/upload/download boundaries Document execStream, execInteractive, forward, ssh sessions, providers, and config/policy in the SDK README, and record the intentional boundaries: interactive connect / PTY ownership, upload/download (no file-transfer RPC), and detached forwards stay out of scope. Note the Biome/Vitest dev commands. Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * feat(sdk-ts): support mTLS client authentication Add clientCert and clientKey to ConnectOptions so the SDK can authenticate to the default local gateway, which uses mTLS user authentication. Without a client certificate and key the SDK could verify the server but never authenticate the caller, so it could not connect to the standard Docker, VM, Homebrew, or Linux-package gateway. Validate the pair as both-or-neither and pass cert and key through to the Node TLS options for https gateways. The h2c path is unchanged. Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * chore(sdk-ts): drop the demo script and its tsx dependency Remove src/demo.ts, the demo npm script, the tsx devDependency, and the tsconfig build exclude for the demo. The demo was never part of the published package, and dropping it also removes the only place that logged part of an SSH session token. Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * fix(sdk-ts)!: harden exec streaming, waits, SSH, and forwarding Address review feedback on the sandbox surface. - Make the streamed command exit code observable from idiomatic for-await: the terminal exit is now an in-band ExecStreamEvent ({ type: 'exit', exitCode }) rather than the async generator return value, which for-await discards. A stream that ends without an exit event now throws instead of reporting success. - Bound waitReady, waitDeleted, and the setPolicy wait by their timeout: each poll RPC carries a per-iteration deadline and the waits accept an AbortSignal, so a stalled call can no longer leave a wait pending forever. Add waitTimeoutSecs to SetPolicyOptions. - Validate the CreateSshSession response against the proto charset and range contract before returning it or using its token, since the values feed an OpenSSH ProxyCommand. - Respect socket backpressure when relaying forwarded responses: pause reading the gRPC stream when the local socket buffer is full and resume on drain so memory stays bounded. - Expose create-time sandbox policy: add policy and an advanced rawSpec passthrough to SandboxSpec so the safety boundary is expressible at creation and new spec fields do not require an SDK change. BREAKING CHANGE: execStream and the interactive exec output now yield a terminal { type: 'exit', exitCode } event; consumers iterating the stream must handle that arm. The exit code is no longer the async generator return value. Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * feat(sdk-ts): export error contract, enum unions, and caller cancellation Address Tier-1 review feedback on the TypeScript SDK public surface (PR #2122). - Errors: export SdkError and SdkErrorCode so callers can use instanceof and exhaustively switch on .code. fromConnect preserves the originating ConnectError as .cause and its status as .connectCode, maps Aborted to a new 'aborted' code for optimistic-concurrency conflicts, and maps Canceled and DeadlineExceeded to 'canceled'. errorCode() behavior is unchanged. - Enums: replace the string-typed phase, status, scope, and policySource fields with lowercase literal unions (SandboxPhaseName, HealthStatus, SettingScopeName, PolicySourceName) backed by exhaustive Record maps. The unions are a hand-maintained mirror of the generated proto enums; a new drift test pins each literal to its generated member name. - Cancellation: accept an optional AbortSignal on exec, execInteractive, and forward, threaded into both sandbox resolution and the streaming RPC. forward tears down its local listener on abort. Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * feat(sdk-ts): add raw escape hatch for uncurated gateway RPCs The curated sub-clients reduce proto messages to ergonomic subsets (for example get() drops created_at_ms, the full spec, conditions, runtime endpoints, and current_policy_version), and not every gateway RPC has a typed helper yet. Rather than ship methods that exist but throw, expose a generated client for the full surface. OpenShellClient.raw and SandboxClient.raw are generated clients covering every gateway RPC, returning the verbatim wire messages so proto distinctions the curated types smooth over are preserved. .transport exposes the shared connection for building extra clients over one socket. Generated request/response types are published at the new @nvidia/openshell-sdk/raw subpath. Curated methods stay the default; raw is the always-available floor. Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * fix(sdk-ts): address review feedback on exec, forward, and auth transport Settle exec's `done` promise before yielding the exit event so a consumer that breaks on exit no longer leaves it pending forever, and give it a lone rejection handler plus a finally-settle so a stream error or early abandon can never surface as an unhandled rejection or a hang. Attach an 'error' listener to each accepted forward socket synchronously, before forwardConnection awaits CreateSshSession; a peer reset in that window previously emitted an unhandled 'error' and crashed the process. Reject ambiguous or unsafe transport configs at buildTransport: oidcToken and edgeToken together (silently OIDC-only), and any auth token sent over plaintext http:// to a non-loopback host unless allowInsecureAuth is set. Wrap versionPin so a non-u64 expectedResourceVersion raises SdkError('invalid_config') instead of a raw BigInt SyntaxError, and raise the Node engine floor to >=20.3 for AbortSignal.any(). Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> * fix(sdk-ts): address review feedback Signed-off-by: Drew Newberry <anewberry@nvidia.com> * docs(sdk-ts): defer published sdk guide Signed-off-by: Drew Newberry <anewberry@nvidia.com> --------- Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com> Signed-off-by: Drew Newberry <anewberry@nvidia.com> Co-authored-by: Drew Newberry <anewberry@nvidia.com>
1 parent 496659c commit 35fb27e

32 files changed

Lines changed: 5372 additions & 6 deletions

‎.agents/skills/test-release-canary/SKILL.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ does not contribute to product usage metrics.
2323

2424
`install.sh` defaults to the *latest tagged* release — the canary is therefore checking that the most recent public release still installs, not the just-published `dev` build. The `kubernetes` job is the exception: it pins to `0.0.0-dev` chart + `:dev` images.
2525

26+
The canary does not install or import `@nvidia/openshell-sdk`. TypeScript SDK
27+
validation lives in the `TypeScript SDK` branch check, including a publish
28+
dry-run. The tagged release workflow publishes the package to GitHub Packages;
29+
verify that job directly when diagnosing SDK publication failures.
30+
2631
## Trigger paths
2732

2833
The workflow has two triggers:

‎.github/workflows/branch-checks.yml‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,3 +274,32 @@ jobs:
274274

275275
- name: Lint
276276
run: mise run markdown:lint
277+
278+
sdk-typescript:
279+
name: TypeScript SDK
280+
needs: pr_metadata
281+
if: needs.pr_metadata.outputs.should_run == 'true'
282+
runs-on: linux-amd64-cpu8
283+
container:
284+
image: ghcr.io/nvidia/openshell/ci:latest
285+
credentials:
286+
username: ${{ github.actor }}
287+
password: ${{ secrets.GITHUB_TOKEN }}
288+
steps:
289+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
290+
291+
- name: Install tools
292+
run: mise install --locked
293+
294+
- name: Check TypeScript SDK
295+
run: mise run sdk:ts:ci
296+
297+
# Exercise the full release publish path (version stamp, dist-tag,
298+
# prepublishOnly, tarball) without uploading. Uses the off-tag dev
299+
# version, which validates the prerelease dist-tag branch too.
300+
- name: Verify publishable artifact (dry-run)
301+
env:
302+
OPENSHELL_NPM_PUBLISH_ARGS: --dry-run
303+
run: |
304+
OPENSHELL_NPM_VERSION="$(uv run python tasks/scripts/release.py get-version --npm)" \
305+
mise run sdk:ts:publish

‎.github/workflows/release-tag.yml‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
outputs:
4141
python_version: ${{ steps.v.outputs.python }}
4242
cargo_version: ${{ steps.v.outputs.cargo }}
43+
npm_version: ${{ steps.v.outputs.npm }}
4344
deb_version: ${{ steps.v.outputs.deb }}
4445
rpm_version: ${{ steps.v.outputs.rpm_version }}
4546
rpm_release: ${{ steps.v.outputs.rpm_release }}
@@ -65,6 +66,7 @@ jobs:
6566
set -euo pipefail
6667
echo "python=$(uv run python tasks/scripts/release.py get-version --python)" >> "$GITHUB_OUTPUT"
6768
echo "cargo=$(uv run python tasks/scripts/release.py get-version --cargo)" >> "$GITHUB_OUTPUT"
69+
echo "npm=$(uv run python tasks/scripts/release.py get-version --npm)" >> "$GITHUB_OUTPUT"
6870
echo "deb=$(uv run python tasks/scripts/release.py get-version --deb)" >> "$GITHUB_OUTPUT"
6971
echo "rpm_version=$(uv run python tasks/scripts/release.py get-version --rpm-version)" >> "$GITHUB_OUTPUT"
7072
echo "rpm_release=$(uv run python tasks/scripts/release.py get-version --rpm-release)" >> "$GITHUB_OUTPUT"
@@ -1071,6 +1073,44 @@ jobs:
10711073
working-directory: ./fern
10721074
run: fern generate --docs
10731075

1076+
publish-sdk-typescript:
1077+
name: Publish TypeScript SDK
1078+
needs: [compute-versions, release]
1079+
runs-on: linux-amd64-cpu8
1080+
timeout-minutes: 15
1081+
permissions:
1082+
contents: read
1083+
packages: write
1084+
container:
1085+
image: ghcr.io/nvidia/openshell/ci:latest
1086+
credentials:
1087+
username: ${{ github.actor }}
1088+
password: ${{ secrets.GITHUB_TOKEN }}
1089+
steps:
1090+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
1091+
with:
1092+
ref: ${{ inputs.tag || github.ref }}
1093+
1094+
- name: Mark workspace safe for git
1095+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
1096+
1097+
- name: Install tools
1098+
run: mise install --locked
1099+
1100+
- name: Configure npm auth for GitHub Packages
1101+
working-directory: ./sdk/typescript
1102+
run: |
1103+
{
1104+
echo "@nvidia:registry=https://npm.pkg.github.com"
1105+
echo '//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}'
1106+
} > .npmrc
1107+
1108+
- name: Publish
1109+
env:
1110+
OPENSHELL_NPM_VERSION: ${{ needs.compute-versions.outputs.npm_version }}
1111+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1112+
run: mise run sdk:ts:publish
1113+
10741114
release-helm:
10751115
name: Release Helm Chart (OCI)
10761116
needs: [compute-versions, release, tag-ghcr-release]

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ pip-delete-this-directory.txt
6565

6666
# Unit test / coverage reports
6767
coverage.out
68+
coverage/
6869
htmlcov/
6970
.tox/
7071
.nox/

‎AGENTS.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ These pipelines connect skills into end-to-end workflows. Individual skill files
5656
| `crates/openshell-supervisor-process/` | Process supervisor | Process lifecycle, namespace, and bypass monitoring |
5757
| `crates/openshell-vfio/` | VFIO support | PCI and GPU passthrough preparation and lifecycle |
5858
| `python/openshell/` | Python SDK | Python bindings and CLI packaging |
59+
| `sdk/typescript/` | TypeScript SDK | Native Connect client, curated sandbox API, and generated protobuf types |
5960
| `proto/` | Protobuf definitions | gRPC service contracts |
6061
| `deploy/` | Docker, Helm, K8s | Dockerfiles, Helm chart, manifests |
6162
| `docs/` | Published docs | MDX pages, navigation, and content assets |
@@ -213,6 +214,14 @@ ocsf_emit!(event);
213214
- Converters in `sdk/go/openshell/v1/internal/converter/` deep-copy slices and maps at boundaries.
214215
- Tests use bufconn for in-process gRPC and testify for assertions.
215216

217+
## TypeScript SDK (`sdk/typescript/`)
218+
219+
- Run `mise run sdk:ts:ci` for codegen, proto lint, Biome lint, type checking, unit tests, coverage, and build validation.
220+
- Proto bindings are generated with `mise run sdk:ts:proto` from the files selected in `sdk/typescript/buf.gen.yaml`.
221+
- Generated files under `sdk/typescript/src/gen/` are build outputs and must not be committed.
222+
- Keep the curated API free of generated wire types; expose full generated messages and RPCs through `@nvidia/openshell-sdk/raw`.
223+
- The release workflow publishes the package to GitHub Packages. Branch checks exercise the publish path with `npm publish --dry-run`.
224+
216225
## Python
217226

218227
- Always use `uv` for Python commands (e.g., `uv pip install`, `uv run`, `uv venv`)

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ Bazel does not yet cover `mise run gateway`, `mise run sandbox`, `mise run e2e`,
451451
| `crates/` | Rust crates |
452452
| `python/` | Python SDK and bindings |
453453
| `sdk/go/` | Go SDK (types, gRPC clients, converters) |
454+
| `sdk/typescript/` | TypeScript SDK (Connect client and generated protobuf bindings) |
454455
| `proto/` | Protocol buffer definitions |
455456
| `tasks/` | `mise` task definitions and build scripts |
456457
| `deploy/` | Dockerfiles, Helm chart, Kubernetes manifests |

‎architecture/build.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ OpenShell builds these main artifacts:
1212
|---|---|
1313
| Gateway binary | `crates/openshell-server` |
1414
| CLI package and Python SDK | `python/openshell` plus Rust binaries where packaged |
15+
| TypeScript SDK package | `sdk/typescript` |
1516
| Gateway container image | `deploy/docker/Dockerfile.gateway` |
1617
| Supervisor container image | `deploy/docker/Dockerfile.supervisor` |
1718
| Helm chart | `deploy/helm/openshell` |
@@ -213,6 +214,20 @@ pins them back in with `[tool.maturin].include` globs. The release workflows
213214
install each Linux wheel in a clean image and import `openshell.sandbox` as a
214215
smoke check.
215216

217+
## TypeScript SDK Packaging
218+
219+
The native TypeScript SDK in `sdk/typescript` uses Connect over the generated
220+
OpenShell protobuf surface. `sdk/typescript/buf.gen.yaml` selects the client
221+
proto closure, and `mise run sdk:ts:proto` generates gitignored sources under
222+
`src/gen`. TypeScript compilation includes those sources in `dist`, so package
223+
consumers do not run code generation.
224+
225+
Branch checks run `mise run sdk:ts:ci`, enforce an 80% line-coverage floor, and
226+
exercise version stamping plus `npm publish --dry-run`. Tagged releases publish
227+
`@nvidia/openshell-sdk` to GitHub Packages. The repository keeps package version
228+
`0.0.0`; the release task derives and temporarily stamps the npm version from
229+
the release tag.
230+
216231
## CI and E2E
217232

218233
Required checks run on GitHub Actions. Workflows that use NVIDIA self-hosted runners trigger from copy-pr-bot mirror branches, so trusted PRs are mirrored into `pull-request/<N>` branches before those workflows run. `main` also uses GitHub merge queue so the final queued integration commit is validated before it merges.

‎docs/_components/jsx.d.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
declare const React: unknown;

‎fern/components/CustomFooter.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
/**
25
* Custom footer for NVIDIA docs (Fern native header/footer).
36
* Markup and class names match the original custom-app footer 1:1 so that

‎scripts/update_license_headers.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
".yaml": "#",
4444
".yml": "#",
4545
".rego": "#",
46+
".ts": "//",
47+
".tsx": "//",
48+
".mts": "//",
49+
".cts": "//",
4650
}
4751

4852
# Directories to skip entirely (relative to repo root).
@@ -55,6 +59,7 @@
5559
".git",
5660
".cache",
5761
"python/openshell/_proto",
62+
"sdk/typescript/src/gen",
5863
}
5964

6065
# Individual filenames to skip.
@@ -103,6 +108,10 @@ def is_excluded(rel: Path) -> bool:
103108
"""Return True if a path should be skipped."""
104109
rel_str = rel.as_posix()
105110

111+
# Vendored dependencies never carry our headers, at any depth.
112+
if "node_modules" in rel.parts:
113+
return True
114+
106115
# Exact filename exclusions.
107116
if rel.name in EXCLUDE_FILES:
108117
return True

0 commit comments

Comments
 (0)