Skip to content

Commit 5a92880

Browse files
committed
feat(sdk): replace the TypeScript SDK with an @ai-openshell/sdk stub
The TypeScript SDK now lives in ai-openshell/sdk-typescript and publishes @ai-openshell/sdk to npmjs.org. Replace sdk/typescript with a stub package that keeps the @nvidia/openshell-sdk name, depends on @ai-openshell/sdk, and re-exports its root and /raw entry points. Existing users on a 0.1.x range move to the new code without changing imports, and the README gives migration steps. The release publisher stamps the dependency to the release's minor line (^X.Y.0) and fails when npmjs.org has no matching @ai-openshell/sdk, so a stub is never published that npm cannot install. Rerun it with workflow_dispatch after the SDK release. The freeze check allows the stub's files. Remove the SDK sources, tooling, mise tasks, Windows helpers, CodeQL paths, and license sidecars, and point the docs at @ai-openshell/sdk. Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
1 parent 080f330 commit 5a92880

50 files changed

Lines changed: 89 additions & 9410 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/build-openshell-mxc-windows/SKILL.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,9 @@ compatibility under emulation is not part of these tasks. The aggregate
312312
commands above on an ARM64 host.
313313

314314
The repository-wide `mise run pre-commit` task is also supported on Windows.
315-
Run `rust:lockfiles:check` and `sdk:ts:ci` through the Windows-aware tasks
316-
when validating those surfaces. Do not count POSIX permission-bit skips as
317-
security coverage. SDK test dependencies must remain at their lockfile versions.
315+
Run `rust:lockfiles:check` through the Windows-aware task
316+
when validating that surface. Do not count POSIX permission-bit skips as
317+
security coverage.
318318
Its Rust check, Clippy, and test dependencies enter the same MSVC environment
319319
for the native host target and use an inherited compiler wrapper when it is
320320
available. Linux glibc

‎.agents/skills/watch-github-actions/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Monitor GitHub Actions workflow runs using the `gh` CLI.
1616

1717
## SDK migration failures
1818

19-
`TypeScript SDK Freeze` rejects additions and modifications under `sdk/typescript/` on PR mirrors. Move those changes to [ai-openshell/sdk-typescript](https://github.com/ai-openshell/sdk-typescript). Core proto changes need no regenerated TypeScript bindings. Deletions are allowed for removal. The job skips merge groups, matching `Python SDK Freeze`.
19+
`TypeScript SDK Freeze` rejects additions and modifications under `sdk/typescript/` on PR mirrors, except the re-export stub's files. Move those changes to [ai-openshell/sdk-typescript](https://github.com/ai-openshell/sdk-typescript). Core proto changes need no regenerated TypeScript bindings. Deletions are allowed for removal. The job skips merge groups, matching `Python SDK Freeze`.
2020

2121
## Quick Status Check
2222

‎.github/codeql/codeql-config.yml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ name: OpenShell Rust and SDKs
66
paths:
77
- crates
88
- examples
9-
- sdk/typescript/src
109
- python/openshell
1110

1211
paths-ignore:
1312
# Integration-test targets are not removed by the Rust cfg override.
1413
- crates/*/tests
1514
- python/openshell/_proto
16-
- sdk/typescript/src/gen

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,15 @@ jobs:
743743
BASE_SHA: ${{ needs.pr_metadata.outputs.base_sha }}
744744
run: |
745745
set -euo pipefail
746-
changed=$(git diff --no-renames --name-only --diff-filter=d "${BASE_SHA}...HEAD" -- sdk/typescript)
746+
# The package is a stub that re-exports @ai-openshell/sdk. Its files stay
747+
# editable so the stub and its moved notice can be maintained.
748+
changed=$(git diff --no-renames --name-only --diff-filter=d "${BASE_SHA}...HEAD" -- sdk/typescript \
749+
':(exclude)sdk/typescript/package.json' \
750+
':(exclude)sdk/typescript/README.md' \
751+
':(exclude)sdk/typescript/index.js' \
752+
':(exclude)sdk/typescript/index.d.ts' \
753+
':(exclude)sdk/typescript/raw.js' \
754+
':(exclude)sdk/typescript/raw.d.ts')
747755
if [ -z "$changed" ]; then
748756
echo "No added or changed TypeScript SDK files."
749757
exit 0

‎.github/workflows/sdk-typescript-publish.yml‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
required: true
1111
type: string
1212
source-ref:
13-
description: Commit to build the package from
13+
description: Commit to publish the package from
1414
required: true
1515
type: string
1616
npm-version:
@@ -57,10 +57,6 @@ jobs:
5757

5858
- uses: ./.github/actions/setup-nix
5959

60-
- name: Install TypeScript dependencies
61-
working-directory: ./sdk/typescript
62-
run: npm ci
63-
6460
- name: Configure npm auth for GitHub Packages
6561
working-directory: ./sdk/typescript
6662
run: |
@@ -94,7 +90,17 @@ jobs:
9490
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9591
run: |
9692
set -euo pipefail
93+
# The package is a stub that re-exports @ai-openshell/sdk from npmjs.org.
94+
# Depend on the same minor line, and refuse to publish a stub that
95+
# npm cannot install yet.
96+
IFS=. read -r major minor _ <<<"${OPENSHELL_NPM_VERSION}"
97+
sdk_range="^${major}.${minor}.0"
98+
if [[ -z "$(npm view "@ai-openshell/sdk@${sdk_range}" version --registry=https://registry.npmjs.org/)" ]]; then
99+
echo "::error title=@ai-openshell/sdk missing::No @ai-openshell/sdk version matches ${sdk_range} on npmjs.org. Release ai-openshell/sdk-typescript first, then rerun this workflow with workflow_dispatch."
100+
exit 1
101+
fi
97102
npm pkg set version="${OPENSHELL_NPM_VERSION}"
103+
npm pkg set "dependencies.@ai-openshell/sdk=${sdk_range}"
98104
package="$(npm pkg get name | tr -d '"')@${OPENSHELL_NPM_VERSION}"
99105
if npm view "${package}" version >/dev/null 2>&1; then
100106
echo "${package} is already published."

‎AGENTS.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Do not rely on this file for a full inventory. The detailed public and contribut
6262
| `crates/openshell-supervisor-process/` | Process supervisor | Process lifecycle, namespace, and bypass monitoring |
6363
| `crates/openshell-vfio/` | VFIO support | PCI and GPU passthrough preparation and lifecycle |
6464
| `python/openshell/` | Python SDK (frozen) | Moved to ai-openshell/sdk-python; kept until removal |
65-
| `sdk/typescript/` | TypeScript SDK (frozen) | Development moved to ai-openshell/sdk-typescript; kept until removal |
65+
| `sdk/typescript/` | TypeScript SDK stub (deprecated) | `@nvidia/openshell-sdk` re-exports `@ai-openshell/sdk` from ai-openshell/sdk-typescript |
6666
| `proto/` | Protobuf definitions | gRPC service contracts |
6767
| `tests/testkit/` | E2E testkit | Support library and `#[testkit::test]` attribute for SDK-driven E2E suites |
6868
| `tests/suites/` | E2E suites | One directory per test family, such as `conformance` |
@@ -208,9 +208,9 @@ Follow `CONTRIBUTING.md` and `create-github-pr`. Authors without target-reposito
208208
## TypeScript SDK (`sdk/typescript/`)
209209

210210
- Open TypeScript SDK changes in [ai-openshell/sdk-typescript](https://github.com/ai-openshell/sdk-typescript).
211-
- `sdk/typescript/` is frozen at core `v0.1.9`. Branch Checks rejects additions and modifications, including dependency updates. Deletions remain allowed for removal.
211+
- `sdk/typescript/` holds only the deprecated `@nvidia/openshell-sdk` stub, which depends on `@ai-openshell/sdk` and re-exports it. Branch Checks rejects other additions and modifications there. Deletions remain allowed for removal.
212212
- Core proto changes need no TypeScript bindings here. The standalone SDK generates bindings from its pinned core release.
213-
- Core retains the SDK files and release publisher until the separate publishing cutover.
213+
- Core releases publish the stub to GitHub Packages with a dependency on the same `@ai-openshell/sdk` minor line, so release `@ai-openshell/sdk` first.
214214

215215
## Python
216216

‎CI.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Merge queue validation is a second integration gate for `main`. After a PR has p
1919

2020
### TypeScript SDK freeze
2121

22-
The `TypeScript SDK Freeze` job rejects additions and modifications under `sdk/typescript/` on PR mirror pushes. It permits deletions for removal and skips merge groups, matching the Python freeze check. A failure blocks the required `OpenShell / Branch Checks` status and directs SDK PRs to [ai-openshell/sdk-typescript](https://github.com/ai-openshell/sdk-typescript). Core proto changes need no TypeScript bindings here.
22+
The `TypeScript SDK Freeze` job rejects additions and modifications under `sdk/typescript/` on PR mirror pushes, except the files of the `@nvidia/openshell-sdk` re-export stub. It permits deletions for removal and skips merge groups, matching the Python freeze check. A failure blocks the required `OpenShell / Branch Checks` status and directs SDK PRs to [ai-openshell/sdk-typescript](https://github.com/ai-openshell/sdk-typescript). Core proto changes need no TypeScript bindings here.
2323

2424
The freeze replaces the `TypeScript SDK` build and publish dry-run job. Core's aggregate checks no longer run SDK tasks, and `proto:lint` uses the core-owned Buf tool. Core retains release publication until the separate publishing cutover.
2525

‎CONTRIBUTING.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,9 @@ These are the primary `mise` tasks for day-to-day development:
424424

425425
## TypeScript SDK contributions
426426

427-
Open TypeScript SDK PRs in [ai-openshell/sdk-typescript](https://github.com/ai-openshell/sdk-typescript), including dependency and security updates. Core's `sdk/typescript/` is frozen at `v0.1.9`. Branch Checks rejects added or modified files there; deletions remain allowed for removal. Core proto changes need no TypeScript bindings here because the standalone SDK generates bindings from its pinned release.
427+
Open TypeScript SDK PRs in [ai-openshell/sdk-typescript](https://github.com/ai-openshell/sdk-typescript), including dependency and security updates. Core's `sdk/typescript/` holds only `@nvidia/openshell-sdk`, a deprecated stub that re-exports `@ai-openshell/sdk`. Branch Checks rejects added or modified files there other than the stub's own files; deletions remain allowed for removal. Core proto changes need no TypeScript bindings here because the standalone SDK generates bindings from its pinned release.
428428

429-
Core retains its TypeScript SDK files and release publisher until the publishing cutover. Core's aggregate checks no longer build, format, lint, or test the SDK. `proto:lint` uses the core-owned Buf tool.
429+
Core releases still publish the stub to GitHub Packages, and the publish fails until a matching `@ai-openshell/sdk` minor line is on npmjs.org. `proto:lint` uses the core-owned Buf tool.
430430

431431
## Project Structure
432432

@@ -436,7 +436,7 @@ Core retains its TypeScript SDK files and release publisher until the publishing
436436
| `crates/openshell-policy-schema/` | Canonical authored policy DTOs and bounded YAML/JSON parser |
437437
| `crates/openshell-prover-cli/` | Standalone local policy boundary checker |
438438
| `python/` | Python SDK (frozen, moved to ai-openshell/sdk-python) |
439-
| `sdk/typescript/` | TypeScript SDK (frozen, development moved to ai-openshell/sdk-typescript) |
439+
| `sdk/typescript/` | Deprecated `@nvidia/openshell-sdk` stub re-exporting `@ai-openshell/sdk` (moved to ai-openshell/sdk-typescript) |
440440
| `proto/` | Protocol buffer definitions and [public API conventions](proto/README.md) |
441441
| `tasks/` | `mise` task definitions and build scripts |
442442
| `tests/testkit/` | Support library for SDK-driven end-to-end suites |

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ SDKs connect applications to an OpenShell gateway. They do not install the CLI.
7373
| Language | Install | Docs |
7474
|---|---|---|
7575
| Python | `uv add openshell` | [README](python/openshell/) |
76-
| TypeScript | `npm install @nvidia/openshell-sdk` (GitHub Packages) | [README](sdk/typescript/README.md) |
76+
| TypeScript | `npm install @ai-openshell/sdk` | [ai-openshell/sdk-typescript](https://github.com/ai-openshell/sdk-typescript) |
7777
| Go | `go get github.com/ai-openshell/sdk-go@vX.Y.Z` | [ai-openshell/sdk-go](https://github.com/ai-openshell/sdk-go) |
7878
| Rust | `cargo add openshell-sdk --git https://github.com/NVIDIA/OpenShell --tag <release-tag>` | [Installation and usage](docs/sdk/rust.mdx) |
7979

‎TESTING.md‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,6 @@ Use `mise run --skip-tools pre-commit` with the existing Rust/MSVC toolchain.
118118
Windows now checks tracked Cargo lockfiles through PowerShell rather than
119119
skipping them.
120120

121-
`mise run --skip-tools sdk:ts:ci` selects the x64 Biome executable on Windows
122-
(including ARM64 hosts running it under emulation), resolves the protobuf
123-
plugin through its Windows `.cmd` launcher, and installs the matching locked
124-
ARM64 Rolldown binding when Node itself is ARM64. The helper preserves lockfile
125-
resolution; it must not upgrade unrelated test dependencies.
126-
127121
Windows token-file tests explicitly skip POSIX
128122
mode-bit assertions; those skips do not establish Windows ACL protection.
129123
Use a checkout with LF text files when running Unix-shell fixture checks.

0 commit comments

Comments
 (0)