-
Notifications
You must be signed in to change notification settings - Fork 9
Introduce extension SDK for TS #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
LucaButBoring
wants to merge
33
commits into
modelcontextprotocol:main
Choose a base branch
from
LucaButBoring:feat/ts-sdk-tasks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
600d148
feat: add scaffolding for TS Tasks SDK
LucaButBoring 75e56f9
feat(core): implement task protocol wire layers
LucaButBoring 088d7aa
feat(client): add task-enabled session foundation
LucaButBoring 2e60c06
chore: format ext-tasks with Prettier
LucaButBoring 5b181b9
feat(client): implement task execution lifecycle
LucaButBoring 7030cc9
chore: add ESLint checks
LucaButBoring ed3ef94
feat(client): implement task input exchange
LucaButBoring e15ec5d
feat(client): add task resume and Client adapter
LucaButBoring ca88862
refactor: modularize and harden ext-tasks SDK
LucaButBoring 241f27d
fix: prevent stale SDK artifacts in package
LucaButBoring 00e0fb7
fix: require built client artifact in tarball
LucaButBoring 8757d5f
refactor: consolidate codec helpers and require JSDoc
LucaButBoring 02ce4ce
refactor: consolidate complete codec helpers
LucaButBoring 2c7e9e6
feat: adopt Zod-first task schemas
LucaButBoring 8392dfb
chore: enable strict TypeScript linting
LucaButBoring 130318c
chore: validate all pushes and pull requests
LucaButBoring dc94c50
refactor: clarify task routing and lifecycle flows
LucaButBoring de04cd8
chore: clarify task execution state flows
LucaButBoring dc3ce0f
chore: simplify deferred value flows
LucaButBoring 00dde12
feat: harden task client integration
LucaButBoring 1c3da43
feat: add generation-neutral task sessions
LucaButBoring 0c239c0
feat: preserve request timeouts across task sessions
LucaButBoring fa6bad1
feat: simplify interfaces and add docs
LucaButBoring f0b8060
fix(ci): don't use offline install
LucaButBoring ece665a
fix: address Copilot comments
LucaButBoring 03e2089
fix: address Copilot comments
LucaButBoring 4216981
fix: address Copilot comments
LucaButBoring 5e8f02e
feat(ci): add publish workflow
LucaButBoring 6704c7b
fix: address Copilot comments
LucaButBoring b7a221e
fix: address Copilot comments
LucaButBoring 6930643
fix: address Copilot comments
LucaButBoring d46dd3e
fix: address Copilot comments
LucaButBoring 63e002f
fix: address Copilot concerns
LucaButBoring File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| # Publishes the @modelcontextprotocol/ext-tasks package to npm when a GitHub | ||
| # Release is published. Versioning is manual: bump packages/ext-tasks/package.json | ||
| # in the release commit, then cut the GitHub Release from that tag — this workflow | ||
| # picks it up from there. | ||
| name: Publish to npm | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| validate: | ||
| name: Validate before publishing | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "24" | ||
| cache: npm | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| # Full gate: schema provenance, format, lint, typecheck, tests, build, and | ||
| # the packed-consumer check. Runs again here rather than trusting CI, so a | ||
| # publish can never proceed from a commit CI hasn't fully validated. | ||
| - name: Check schemas, package, and packed consumers | ||
| run: npm run check | ||
| - name: Build documentation | ||
| run: npm run docs:build | ||
|
|
||
| publish: | ||
| name: Publish | ||
| needs: validate | ||
| runs-on: ubuntu-latest | ||
| environment: release | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "24" | ||
| cache: npm | ||
| registry-url: "https://registry.npmjs.org" | ||
| - name: Install dependencies | ||
| run: npm ci | ||
| # Node 24's bundled npm satisfies the >= 11.5.1 OIDC requirement only from | ||
| # ~24.6 onward; pin explicitly so the publish never depends on which Node | ||
| # patch the runner resolves. | ||
| - name: Ensure npm CLI supports OIDC trusted publishing | ||
| run: npm install -g npm@11.5.1 | ||
| # The tag is compared to the manifest before anything reaches npm, because | ||
| # a release cut from the wrong commit (or tagged with the wrong version) | ||
| # would otherwise publish a version that does not match its tag. | ||
| - name: Validate release tag against package.json | ||
| env: | ||
| # Passed through env rather than interpolated into the script, | ||
| # so a tag name can never be evaluated as shell syntax. | ||
| RELEASE_TAG: ${{ github.event.release.tag_name }} | ||
| run: | | ||
| VERSION=$(node -p "require('./packages/ext-tasks/package.json').version") | ||
| if [[ "${RELEASE_TAG#v}" != "$VERSION" ]]; then | ||
| echo "Release tag ${RELEASE_TAG} does not match package.json version ${VERSION}." | ||
| exit 1 | ||
| fi | ||
| - name: Determine npm dist-tag | ||
| id: npm-tag | ||
| run: | | ||
| VERSION=$(node -p "require('./packages/ext-tasks/package.json').version") | ||
| # Pre-release versions publish under the beta dist-tag. | ||
| if [[ "$VERSION" == *"-"* ]]; then | ||
| echo "tag=--tag beta" >> "$GITHUB_OUTPUT" | ||
| # Releases cut from a non-main branch (patch/maintenance lines) publish | ||
| # under release-X.Y so they never displace latest. | ||
| elif [[ "${{ github.event.release.target_commitish }}" != "main" ]]; then | ||
| MAJOR_MINOR=$(echo "$VERSION" | cut -d. -f1,2) | ||
| echo "tag=--tag release-${MAJOR_MINOR}" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "tag=" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| - name: Publish to npm | ||
| run: npm publish --provenance --access public ${{ steps.npm-tag.outputs.tag }} | ||
| working-directory: packages/ext-tasks | ||
| env: | ||
| NPM_CONFIG_PROVENANCE: "true" | ||
|
|
||
| verify: | ||
| name: Verify published package | ||
| needs: publish | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "24" | ||
| cache: npm | ||
| - name: Wait for npm to serve the version | ||
| run: | | ||
| VERSION=$(node -p "require('./packages/ext-tasks/package.json').version") | ||
| for i in $(seq 1 30); do | ||
| if npm view "@modelcontextprotocol/ext-tasks@${VERSION}" version >/dev/null 2>&1; then | ||
| echo "npm is serving ${VERSION}." | ||
| exit 0 | ||
| fi | ||
| echo "Not visible yet (attempt ${i}/30); waiting 10s..." | ||
| sleep 10 | ||
| done | ||
| echo "npm never served ${VERSION} within 5 minutes of publishing." | ||
| exit 1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ node_modules/ | |
| .claude/ | ||
| .jj/ | ||
| *.tsbuildinfo | ||
| *.tgz | ||
| dist/ | ||
| schema/**/generated/ | ||
| .vitepress/cache | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.