From 5196c5a96de47f7e5eeff7e5f981bcf5868d6aa4 Mon Sep 17 00:00:00 2001 From: tercel Date: Sun, 29 Nov 2026 10:32:10 +0800 Subject: [PATCH] build: prepare Surfaces packages for Core beta.1 Signed-off-by: tercel --- .github/workflows/core-candidate.yml | 34 ++-- .github/workflows/python.yml | 4 +- .github/workflows/rust.yml | 34 ++-- .github/workflows/typescript.yml | 32 +--- a2a/docs/features/server-core.md | 2 + a2a/python/CHANGELOG.md | 14 ++ a2a/python/pyproject.toml | 2 +- a2a/rust/CHANGELOG.md | 10 ++ a2a/rust/Cargo.lock | 6 +- a2a/rust/Cargo.toml | 2 +- a2a/typescript/CHANGELOG.md | 11 ++ a2a/typescript/package.json | 2 +- a2a/typescript/pnpm-lock.yaml | 14 +- cli/python/CHANGELOG.md | 10 ++ cli/python/pyproject.toml | 2 +- cli/rust/CHANGELOG.md | 10 ++ cli/rust/Cargo.lock | 6 +- cli/rust/Cargo.toml | 2 +- cli/typescript/CHANGELOG.md | 6 + cli/typescript/package.json | 4 +- cli/typescript/pnpm-lock.yaml | 14 +- mcp/python/CHANGELOG.md | 11 ++ mcp/python/pyproject.toml | 2 +- mcp/rust/CHANGELOG.md | 11 ++ mcp/rust/Cargo.lock | 4 +- mcp/typescript/CHANGELOG.md | 11 ++ mcp/typescript/package.json | 2 +- mcp/typescript/pnpm-lock.yaml | 14 +- scripts/verify-rust-core-candidate.py | 163 +++++++------------ scripts/verify-rust-surface.py | 56 ++++++- scripts/verify-typescript-surface-package.sh | 47 ++++++ toolkit/python/CHANGELOG.md | 6 + toolkit/python/pyproject.toml | 2 +- toolkit/rust/CHANGELOG.md | 6 + toolkit/rust/Cargo.lock | 12 +- toolkit/typescript/CHANGELOG.md | 10 ++ toolkit/typescript/package.json | 2 +- toolkit/typescript/pnpm-lock.yaml | 17 +- 38 files changed, 361 insertions(+), 236 deletions(-) create mode 100644 scripts/verify-typescript-surface-package.sh diff --git a/.github/workflows/core-candidate.yml b/.github/workflows/core-candidate.yml index 5464363f..74bde6c2 100644 --- a/.github/workflows/core-candidate.yml +++ b/.github/workflows/core-candidate.yml @@ -169,21 +169,6 @@ jobs: exit 1 fi fi - if [[ "$CORE_MODE" == candidate ]]; then - # Test the candidate against this Surface release's source. The - # ordinary CI manifests remain pinned to their reviewed Core. - python - "$GITHUB_WORKSPACE" "$PWD" <<'PY' - import sys - from pathlib import Path - - root, component = (Path(value) for value in sys.argv[1:]) - for manifest in {component / "pyproject.toml", root / "toolkit/python/pyproject.toml"}: - text = manifest.read_text() - if text.count("1.0.0a5") != 1: - raise ValueError(f"Unexpected Core dependency in {manifest}") - manifest.write_text(text.replace("1.0.0a5", "1.0.0b1")) - PY - fi args=(-e '.[dev]') if [[ "$COMPONENT" != toolkit ]]; then args+=(-e "$GITHUB_WORKSPACE/toolkit/python[http-proxy]") @@ -318,21 +303,26 @@ jobs: roots+=("$PWD") fi for root in "${roots[@]}"; do - CORE_ROOT="$core_root" TOOLKIT_ROOT="$toolkit" ROOT="$root" node --input-type=module <<'JS' + ( + cd "$root" + saved=$(mktemp -d) + cp package.json pnpm-lock.yaml "$saved/" + trap 'cp "$saved/package.json" "$saved/pnpm-lock.yaml" .; rm -rf "$saved"' EXIT + CORE_ROOT="$core_root" TOOLKIT_ROOT="$toolkit" node --input-type=module <<'JS' import { readFileSync, writeFileSync } from 'node:fs'; - import { join } from 'node:path'; - const file = join(process.env.ROOT, 'package.json'); + const file = 'package.json'; const manifest = JSON.parse(readFileSync(file, 'utf8')); manifest.pnpm ??= {}; const overrides = manifest.pnpm.overrides ??= {}; overrides['apcore-js'] = 'link:' + process.env.CORE_ROOT; - if (process.env.ROOT !== process.env.TOOLKIT_ROOT) { + if (process.cwd() !== process.env.TOOLKIT_ROOT) { overrides['apcore-toolkit'] = 'link:' + process.env.TOOLKIT_ROOT; } writeFileSync(file, JSON.stringify(manifest, null, 2) + '\n'); JS - pnpm --dir "$root" install --no-frozen-lockfile + pnpm install --no-frozen-lockfile + ) pnpm --dir "$root" build done for root in "${roots[@]}"; do @@ -367,6 +357,10 @@ jobs: JS ) done + core_version=0.33.0 + if [[ "$CORE_MODE" == candidate ]]; then core_version=1.0.0-beta.1; fi + bash "$GITHUB_WORKSPACE/scripts/verify-typescript-surface-package.sh" \ + "$COMPONENT" "$core_package" "$core_version" - run: pnpm lint if: matrix.component != 'toolkit' - run: pnpm typecheck diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 580969fd..6c551330 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -15,7 +15,7 @@ permissions: contents: read env: - CORE_REF: e4e2329de4ce8fa45669572ef9bd81c48da0d746 + CORE_REF: dfc747852c4178f20ccc8d3b03933d28b8f89147 jobs: test: @@ -45,7 +45,7 @@ jobs: with: python-version: ${{ matrix.version }} - &build-core-wheel - name: Build the in-review Core wheel + name: Build the pinned Core wheel run: | python -m pip install build python -m build --wheel --outdir "$RUNNER_TEMP/core-wheel" "$GITHUB_WORKSPACE/.ci-apcore-core/python" diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index cec2a36a..25a03ade 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -20,15 +20,11 @@ permissions: contents: read env: - # The released lockfiles already reference these prereleases. Bootstrap CI - # from the reviewed Core commit while those versions are unpublished. - CORE_REF: e4e2329de4ce8fa45669572ef9bd81c48da0d746 - CORE_CRATE_VERSION: 1.0.0-alpha.5 - CORE_CRATE_SHA256: 1d19939071ba2c589815c061dfb1ff827862e5f1f52251e88297d49eec500a90 - # MCP uses the native Context interactions from the paired Core candidate. - MCP_CORE_REF: a3fe0245eecf65bb57c7cca324a7a7b29c6ff553 - MCP_CORE_CRATE_VERSION: 1.0.0-beta.1 - MCP_CORE_CRATE_SHA256: 3b92d75b37a1a8349d47c8aa32b452c67e92171e85391d6c24ce8b3e2bef22d4 + # Bootstrap the registry-shaped lockfiles from the reviewed Core commit + # while the matching prerelease is unpublished. + CORE_REF: dfc747852c4178f20ccc8d3b03933d28b8f89147 + CORE_CRATE_VERSION: 1.0.0-beta.1 + CORE_CRATE_SHA256: e7f98adc75722b5b39d6df501162fef2efe829a3e37e3a806368633b3e3c7279 jobs: source: @@ -52,7 +48,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: repository: aiperceivable/apcore - ref: ${{ matrix.component == 'mcp' && env.MCP_CORE_REF || env.CORE_REF }} + ref: ${{ env.CORE_REF }} path: .ci-apcore-core persist-credentials: false - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 @@ -95,7 +91,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: repository: aiperceivable/apcore - ref: ${{ matrix.component == 'mcp' && env.MCP_CORE_REF || env.CORE_REF }} + ref: ${{ env.CORE_REF }} path: .ci-apcore-core persist-credentials: false - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 @@ -107,18 +103,14 @@ jobs: shell: bash env: CARGO_TARGET_DIR: ${{ runner.temp }}/core-dependency-target - PINNED_CORE_VERSION: ${{ matrix.component == 'mcp' && env.MCP_CORE_CRATE_VERSION || env.CORE_CRATE_VERSION }} - PINNED_CORE_SHA256: ${{ matrix.component == 'mcp' && env.MCP_CORE_CRATE_SHA256 || env.CORE_CRATE_SHA256 }} + PINNED_CORE_VERSION: ${{ env.CORE_CRATE_VERSION }} + PINNED_CORE_SHA256: ${{ env.CORE_CRATE_SHA256 }} run: | git rev-parse HEAD - rustup toolchain install 1.86.0 --profile minimal - # Core was already verified upstream. Reproduce the same archive. - if [[ -f apcore-macros/Cargo.toml ]]; then - cargo +1.86.0 --config "patch.crates-io.apcore-macros.path='$PWD/apcore-macros'" \ - package --locked -p apcore --all-features --no-verify - else - cargo +1.86.0 package --locked --all-features --no-verify - fi + rustup toolchain install 1.100.0 --profile minimal + # Match Core's workspace packaging so its SDK lock records the + # packaged macro checksum and registry source. + cargo +1.100.0 package --locked --no-verify --all-features -p apcore -p apcore-macros archive="$CARGO_TARGET_DIR/package/apcore-$PINNED_CORE_VERSION.crate" printf '%s %s\n' "$PINNED_CORE_SHA256" "$archive" | sha256sum --check mkdir "$RUNNER_TEMP/core-dependency" diff --git a/.github/workflows/typescript.yml b/.github/workflows/typescript.yml index 66debac7..f41fdd23 100644 --- a/.github/workflows/typescript.yml +++ b/.github/workflows/typescript.yml @@ -7,6 +7,7 @@ on: - '*/typescript/**' - '*/conformance/**' - '.github/workflows/typescript.yml' + - 'scripts/verify-typescript-surface-package.sh' pull_request: paths: *typescript-paths workflow_dispatch: @@ -15,7 +16,7 @@ permissions: contents: read env: - CORE_REF: e4e2329de4ce8fa45669572ef9bd81c48da0d746 + CORE_REF: dfc747852c4178f20ccc8d3b03933d28b8f89147 jobs: test: @@ -44,7 +45,7 @@ jobs: with: version: '10.30.1' - &build-core-npm - name: Build the in-review Core npm distribution + name: Build the pinned Core npm distribution run: | core="$GITHUB_WORKSPACE/.ci-apcore-core/typescript" pnpm --dir "$core" install --frozen-lockfile @@ -134,27 +135,6 @@ jobs: env: COMPONENT: ${{ matrix.component }} run: | - temporary=$(mktemp -d) - pnpm pack --pack-destination "$temporary" - if [[ "$COMPONENT" != toolkit ]]; then - toolkit="$GITHUB_WORKSPACE/toolkit/typescript" - pnpm --dir "$toolkit" pack --pack-destination "$temporary" - fi - archives=( "$temporary"/*.tgz "$RUNNER_TEMP"/apcore-js-*.tgz ) - toolkit_archive=( "$temporary"/apcore-toolkit-*.tgz ) - cd "$temporary" - npm init -y - npm install "${archives[@]}" - node --input-type=module - "apcore-$COMPONENT" "${toolkit_archive[0]}" <<'JS' - import assert from 'node:assert/strict'; - import { readFileSync, realpathSync } from 'node:fs'; - import { resolve } from 'node:path'; - - const [, , name, toolkitArchive] = process.argv; - const lock = JSON.parse(readFileSync('package-lock.json', 'utf8')); - const lockedToolkit = lock.packages['node_modules/apcore-toolkit'].resolved; - assert.ok(lockedToolkit.startsWith('file:')); - assert.equal(realpathSync(resolve(lockedToolkit.slice('file:'.length))), realpathSync(toolkitArchive)); - await import(name); - if (name === 'apcore-toolkit') await import(name + '/browser'); - JS + archives=( "$RUNNER_TEMP"/apcore-js-*.tgz ) + bash "$GITHUB_WORKSPACE/scripts/verify-typescript-surface-package.sh" \ + "$COMPONENT" "${archives[0]}" 1.0.0-beta.1 diff --git a/a2a/docs/features/server-core.md b/a2a/docs/features/server-core.md index 620d83d3..d95a0e08 100644 --- a/a2a/docs/features/server-core.md +++ b/a2a/docs/features/server-core.md @@ -35,6 +35,8 @@ returns `-32009` with the request ID and does not dispatch the operation. `ListTasks` scopes results to the authenticated caller before applying filters and pagination. The last page includes an empty `nextPageToken`. +In TypeScript, the SDK in-memory store includes tasks whose status timestamp +equals `statusTimestampAfter`. Custom stores receive the original cutoff. The Rust A2A 1.0 interface advertises its implemented capabilities in the Agent Card. The modern streaming and push operations return their respective diff --git a/a2a/python/CHANGELOG.md b/a2a/python/CHANGELOG.md index dc6b2961..c46db0bd 100644 --- a/a2a/python/CHANGELOG.md +++ b/a2a/python/CHANGELOG.md @@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.8.8a2] - Unreleased + +### Added + +- Pilot opt-in hosted media links derived from the final validated A2A output. + +### Changed + +- Require Core `1.0.0b1`. + +### Fixed + +- Preserve legacy JSON-RPC requests with omitted or empty version headers. Reject unsupported explicit versions with `-32009` before dispatch and preserve the request identifier. [PR #132](https://github.com/aiperceivable/apcore-surfaces/pull/132) + ## [0.8.8a1] - Unreleased ### Added diff --git a/a2a/python/pyproject.toml b/a2a/python/pyproject.toml index 8070efa6..50bea4cc 100644 --- a/a2a/python/pyproject.toml +++ b/a2a/python/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ "Framework :: AsyncIO", ] dependencies = [ - "apcore[config,discovery]==1.0.0a5", + "apcore[config,discovery]==1.0.0b1", "apcore-toolkit==0.15.1a2", "a2a-sdk[http-server]>=1.1.2", "starlette>=0.40.0", diff --git a/a2a/rust/CHANGELOG.md b/a2a/rust/CHANGELOG.md index 801a322a..c838ff2a 100644 --- a/a2a/rust/CHANGELOG.md +++ b/a2a/rust/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.8.7-alpha.2] - Unreleased + +### Added + +- Implement versioned A2A 1.0 JSON-RPC task send, get, cancel, and scoped listing. Advertise the implemented capabilities in the Agent Card. A2A 1.0 streaming, push notifications, and task continuation remain unsupported. Legacy streaming remains available. [PR #132](https://github.com/aiperceivable/apcore-surfaces/pull/132) + +### Changed + +- Require Core `1.0.0-beta.1`. Published-package validation through APEXE remains pending. [Issue #119](https://github.com/aiperceivable/apcore-surfaces/issues/119) + ## [0.8.7-alpha.1] - Unreleased ### Added diff --git a/a2a/rust/Cargo.lock b/a2a/rust/Cargo.lock index 4f6c6456..81f182ca 100644 --- a/a2a/rust/Cargo.lock +++ b/a2a/rust/Cargo.lock @@ -92,9 +92,9 @@ dependencies = [ [[package]] name = "apcore" -version = "1.0.0-alpha.5" +version = "1.0.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d19939071ba2c589815c061dfb1ff827862e5f1f52251e88297d49eec500a90" +checksum = "e7f98adc75722b5b39d6df501162fef2efe829a3e37e3a806368633b3e3c7279" dependencies = [ "async-stream", "async-trait", @@ -155,7 +155,7 @@ dependencies = [ name = "apcore-toolkit" version = "0.15.1-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c073619a002dcf93c6391a22c537420b86f3863dd3eef7b6cc9ebbec712c146" +checksum = "b0a0f34d5b5fa6f1e3a9ca83e7ae05720e32860d6576215913658d5644272b02" dependencies = [ "apcore", "async-trait", diff --git a/a2a/rust/Cargo.toml b/a2a/rust/Cargo.toml index ebf91850..16781b6c 100644 --- a/a2a/rust/Cargo.toml +++ b/a2a/rust/Cargo.toml @@ -27,7 +27,7 @@ default = [] openapi = ["apcore-toolkit/http-proxy"] [dependencies] -apcore = { version = "=1.0.0-alpha.5", default-features = false, features = ["discovery", "sys-modules"] } +apcore = { version = "=1.0.0-beta.1", default-features = false, features = ["discovery", "sys-modules"] } # `default-features = false` so `http-proxy` — a *default* feature of the # toolkit — is reached through this crate's `openapi` feature instead of being # enabled unconditionally. The unconditional import (`deep_resolve_refs`) is diff --git a/a2a/typescript/CHANGELOG.md b/a2a/typescript/CHANGELOG.md index 00cac093..0605546f 100644 --- a/a2a/typescript/CHANGELOG.md +++ b/a2a/typescript/CHANGELOG.md @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.8.9-alpha.2] - Unreleased + +### Changed + +- Require `apcore-js@1.0.0-beta.1`. + +### Fixed + +- Preserve request ID `0` in unsupported-version errors. Keep omitted status filters unfiltered and include mandatory paging fields for empty and final pages. [PR #132](https://github.com/aiperceivable/apcore-surfaces/pull/132) +- Apply the inclusive `statusTimestampAfter` cutoff before counting and paging results in the SDK in-memory store. Compare sub-millisecond timestamps at nanosecond precision. [PR #133](https://github.com/aiperceivable/apcore-surfaces/pull/133) + ## [0.8.9-alpha.1] - Unreleased ### Added diff --git a/a2a/typescript/package.json b/a2a/typescript/package.json index ddcfd2d8..9b996ecc 100644 --- a/a2a/typescript/package.json +++ b/a2a/typescript/package.json @@ -33,7 +33,7 @@ }, "dependencies": { "@a2a-js/sdk": ">=1.0.1", - "apcore-js": "1.0.0-alpha.5", + "apcore-js": "1.0.0-beta.1", "apcore-toolkit": "0.15.1-alpha.2", "express": "^5.1.0", "jsonwebtoken": "^9.0.3", diff --git a/a2a/typescript/pnpm-lock.yaml b/a2a/typescript/pnpm-lock.yaml index a2dacd0e..50612892 100644 --- a/a2a/typescript/pnpm-lock.yaml +++ b/a2a/typescript/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: '>=1.0.1' version: 1.0.1(express@5.2.1) apcore-js: - specifier: 1.0.0-alpha.5 - version: 1.0.0-alpha.5(typescript@5.9.3) + specifier: 1.0.0-beta.1 + version: 1.0.0-beta.1(typescript@5.9.3) apcore-toolkit: specifier: 0.15.1-alpha.2 version: 0.15.1-alpha.2(@sinclair/typebox@0.34.48)(typescript@5.9.3) @@ -656,8 +656,8 @@ packages: ajv@8.20.0: resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==} - apcore-js@1.0.0-alpha.5: - resolution: {integrity: sha512-VmPRnT/S5O2N1nnMsoomOUFCf9kY4Jqe/UfyPCvh1xb8HccEshsQsvqReds652vMQCQ6i0xmcJZA4OKfWHRUJw==} + apcore-js@1.0.0-beta.1: + resolution: {integrity: sha512-kVIQE2QC6RyO++rnW69hYPhVOmqpN2DgkgOHXoUN/u011HiNGMCuvU6IRRFjjkXqYmnMgctCVJA3vvImGk0zTg==} engines: {node: '>=20.0.0'} peerDependencies: typescript: ^5.5.0 @@ -666,7 +666,7 @@ packages: optional: true apcore-toolkit@0.15.1-alpha.2: - resolution: {integrity: sha512-nBMk99wAGjSH/E3fCj4I5FsvlvYiVs+k+ARIGc6u+kkxiTvxoAlQNKAUviBYJBrmItwDVl+9EonaEO2qfiRQGg==} + resolution: {integrity: sha512-1ZzQb+2AT096KWTKw/+hR49EQQIGPNob9FjarZ8RmajyX8eU9p8AbKlzlGiO4wppdWEuKPIs5DjR/8qNndhQ5w==} engines: {node: '>=20.10.0'} peerDependencies: '@sinclair/typebox': '>=0.31.0' @@ -1951,7 +1951,7 @@ snapshots: json-schema-traverse: 1.0.0 require-from-string: 2.0.2 - apcore-js@1.0.0-alpha.5(typescript@5.9.3): + apcore-js@1.0.0-beta.1(typescript@5.9.3): dependencies: '@sinclair/typebox': 0.34.48 js-yaml: 4.3.2 @@ -1963,7 +1963,7 @@ snapshots: dependencies: '@sinclair/typebox': 0.34.48 ajv: 8.20.0 - apcore-js: 1.0.0-alpha.5(typescript@5.9.3) + apcore-js: 1.0.0-beta.1(typescript@5.9.3) js-yaml: 4.3.2 transitivePeerDependencies: - typescript diff --git a/cli/python/CHANGELOG.md b/cli/python/CHANGELOG.md index 15b4f567..0e79a858 100644 --- a/cli/python/CHANGELOG.md +++ b/cli/python/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to apcore-cli (Python SDK) will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.14.2a2] - Unreleased + +### Changed + +- Require Core `1.0.0b1`. + +### Fixed + +- Fail standalone startup when Toolkit reports registration errors for commands or binding files. Report the rejected modules instead of starting with a partial command set. [PR #131](https://github.com/aiperceivable/apcore-surfaces/pull/131) + ## [0.14.2a1] - Unreleased ### Fixed diff --git a/cli/python/pyproject.toml b/cli/python/pyproject.toml index 3cab4119..14abbca5 100644 --- a/cli/python/pyproject.toml +++ b/cli/python/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ "Environment :: Console", ] dependencies = [ - "apcore[config,discovery]==1.0.0a5", + "apcore[config,discovery]==1.0.0b1", "apcore-toolkit[http-proxy]==0.15.1a2", "click>=8.1", "jsonschema>=4.20", diff --git a/cli/rust/CHANGELOG.md b/cli/rust/CHANGELOG.md index 69b2a080..06515709 100644 --- a/cli/rust/CHANGELOG.md +++ b/cli/rust/CHANGELOG.md @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file. Format: [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [0.14.2-alpha.2] - Unreleased + +### Changed + +- Require Core `1.0.0-beta.1`. + +### Fixed + +- Warn when an explicitly configured extensions directory contains no executable modules. + ## [0.14.2-alpha.1] - Unreleased ### Fixed diff --git a/cli/rust/Cargo.lock b/cli/rust/Cargo.lock index 02bd27ea..799b972f 100644 --- a/cli/rust/Cargo.lock +++ b/cli/rust/Cargo.lock @@ -133,9 +133,9 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "apcore" -version = "1.0.0-alpha.5" +version = "1.0.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d19939071ba2c589815c061dfb1ff827862e5f1f52251e88297d49eec500a90" +checksum = "e7f98adc75722b5b39d6df501162fef2efe829a3e37e3a806368633b3e3c7279" dependencies = [ "async-stream", "async-trait", @@ -198,7 +198,7 @@ dependencies = [ name = "apcore-toolkit" version = "0.15.1-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c073619a002dcf93c6391a22c537420b86f3863dd3eef7b6cc9ebbec712c146" +checksum = "b0a0f34d5b5fa6f1e3a9ca83e7ae05720e32860d6576215913658d5644272b02" dependencies = [ "apcore", "async-trait", diff --git a/cli/rust/Cargo.toml b/cli/rust/Cargo.toml index 4ee2f6b5..58e2562c 100644 --- a/cli/rust/Cargo.toml +++ b/cli/rust/Cargo.toml @@ -21,7 +21,7 @@ name = "apcore_cli" path = "src/lib.rs" [dependencies] -apcore = { version = "=1.0.0-alpha.5", default-features = false, features = ["config"] } +apcore = { version = "=1.0.0-beta.1", default-features = false, features = ["config"] } async-trait = "0.1" clap = { version = "4", features = ["derive", "env", "string"] } serde = { version = "1", features = ["derive"] } diff --git a/cli/typescript/CHANGELOG.md b/cli/typescript/CHANGELOG.md index 7de9f8e7..a31127a8 100644 --- a/cli/typescript/CHANGELOG.md +++ b/cli/typescript/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to apcore-cli (TypeScript SDK) will be documented in this fi The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.14.2-alpha.2] - Unreleased + +### Changed + +- Require `apcore-js@1.0.0-beta.1` as the runtime peer and development dependency. + ## [0.14.2-alpha.1] - Unreleased ### Fixed diff --git a/cli/typescript/package.json b/cli/typescript/package.json index 3108795c..aefdda3d 100644 --- a/cli/typescript/package.json +++ b/cli/typescript/package.json @@ -30,7 +30,7 @@ "node": ">=20.0.0" }, "peerDependencies": { - "apcore-js": "1.0.0-alpha.5", + "apcore-js": "1.0.0-beta.1", "apcore-toolkit": "0.15.1-alpha.2" }, "dependencies": { @@ -47,7 +47,7 @@ "@typescript-eslint/eslint-plugin": "^8.59.0", "@typescript-eslint/parser": "^8.59.0", "@vitest/coverage-v8": "^5.1.0", - "apcore-js": "1.0.0-alpha.5", + "apcore-js": "1.0.0-beta.1", "apcore-toolkit": "0.15.1-alpha.2", "apdev-js": "^0.2.4", "eslint": "^10.2.1", diff --git a/cli/typescript/pnpm-lock.yaml b/cli/typescript/pnpm-lock.yaml index 3273dd2b..6bf8fea2 100644 --- a/cli/typescript/pnpm-lock.yaml +++ b/cli/typescript/pnpm-lock.yaml @@ -34,8 +34,8 @@ importers: specifier: ^5.1.0 version: 5.1.0(vitest@5.1.0) apcore-js: - specifier: 1.0.0-alpha.5 - version: 1.0.0-alpha.5(typescript@5.9.3) + specifier: 1.0.0-beta.1 + version: 1.0.0-beta.1(typescript@5.9.3) apcore-toolkit: specifier: 0.15.1-alpha.2 version: 0.15.1-alpha.2(@sinclair/typebox@0.34.48)(typescript@5.9.3) @@ -731,8 +731,8 @@ packages: any-promise@1.3.0: resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} - apcore-js@1.0.0-alpha.5: - resolution: {integrity: sha512-VmPRnT/S5O2N1nnMsoomOUFCf9kY4Jqe/UfyPCvh1xb8HccEshsQsvqReds652vMQCQ6i0xmcJZA4OKfWHRUJw==} + apcore-js@1.0.0-beta.1: + resolution: {integrity: sha512-kVIQE2QC6RyO++rnW69hYPhVOmqpN2DgkgOHXoUN/u011HiNGMCuvU6IRRFjjkXqYmnMgctCVJA3vvImGk0zTg==} engines: {node: '>=20.0.0'} peerDependencies: typescript: ^5.5.0 @@ -741,7 +741,7 @@ packages: optional: true apcore-toolkit@0.15.1-alpha.2: - resolution: {integrity: sha512-nBMk99wAGjSH/E3fCj4I5FsvlvYiVs+k+ARIGc6u+kkxiTvxoAlQNKAUviBYJBrmItwDVl+9EonaEO2qfiRQGg==} + resolution: {integrity: sha512-1ZzQb+2AT096KWTKw/+hR49EQQIGPNob9FjarZ8RmajyX8eU9p8AbKlzlGiO4wppdWEuKPIs5DjR/8qNndhQ5w==} engines: {node: '>=20.10.0'} peerDependencies: '@sinclair/typebox': '>=0.31.0' @@ -1944,7 +1944,7 @@ snapshots: any-promise@1.3.0: {} - apcore-js@1.0.0-alpha.5(typescript@5.9.3): + apcore-js@1.0.0-beta.1(typescript@5.9.3): dependencies: '@sinclair/typebox': 0.34.48 js-yaml: 4.3.2 @@ -1956,7 +1956,7 @@ snapshots: dependencies: '@sinclair/typebox': 0.34.48 ajv: 8.20.0 - apcore-js: 1.0.0-alpha.5(typescript@5.9.3) + apcore-js: 1.0.0-beta.1(typescript@5.9.3) js-yaml: 4.3.2 transitivePeerDependencies: - typescript diff --git a/mcp/python/CHANGELOG.md b/mcp/python/CHANGELOG.md index f9e4afac..19362554 100644 --- a/mcp/python/CHANGELOG.md +++ b/mcp/python/CHANGELOG.md @@ -6,6 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.23.5a2] - Unreleased + +### Added + +- Forward Core progress and form elicitation through negotiated MCP sessions. Existing helper-based clients remain supported. +- Add opt-in bounded media resource links with authenticated reads and sensitive-field filtering. + +### Changed + +- Require Core `1.0.0b1` and verify wire cancellation in the shared stdio and Streamable HTTP suite. [PR #133](https://github.com/aiperceivable/apcore-surfaces/pull/133) + ## [0.23.5a1] - Unreleased ### Fixed diff --git a/mcp/python/pyproject.toml b/mcp/python/pyproject.toml index b5d72ddc..4c878d39 100644 --- a/mcp/python/pyproject.toml +++ b/mcp/python/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ "Topic :: Scientific/Engineering :: Artificial Intelligence", ] dependencies = [ - "apcore[config,discovery]==1.0.0a5", + "apcore[config,discovery]==1.0.0b1", "mcp>=1.26,<2.0", "jsonschema>=4.20,<5", "referencing>=0.30,<1", diff --git a/mcp/rust/CHANGELOG.md b/mcp/rust/CHANGELOG.md index 75c6cf0c..b4f525c5 100644 --- a/mcp/rust/CHANGELOG.md +++ b/mcp/rust/CHANGELOG.md @@ -6,6 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.23.5-alpha.2] - Unreleased + +### Added + +- Forward Core progress and form elicitation through addressed stdio and SSE sessions. +- Add opt-in bounded media resource links with authenticated reads and sensitive-field filtering. + +### Changed + +- Require Core `1.0.0-beta.1` and verify wire cancellation in the shared stdio and Streamable HTTP suite. [PR #133](https://github.com/aiperceivable/apcore-surfaces/pull/133) + ## [0.23.5-alpha.1] - Unreleased ### Fixed diff --git a/mcp/rust/Cargo.lock b/mcp/rust/Cargo.lock index 5a247136..a192ae62 100644 --- a/mcp/rust/Cargo.lock +++ b/mcp/rust/Cargo.lock @@ -100,7 +100,7 @@ dependencies = [ name = "apcore" version = "1.0.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b92d75b37a1a8349d47c8aa32b452c67e92171e85391d6c24ce8b3e2bef22d4" +checksum = "e7f98adc75722b5b39d6df501162fef2efe829a3e37e3a806368633b3e3c7279" dependencies = [ "async-stream", "async-trait", @@ -166,7 +166,7 @@ dependencies = [ name = "apcore-toolkit" version = "0.15.1-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c073619a002dcf93c6391a22c537420b86f3863dd3eef7b6cc9ebbec712c146" +checksum = "b0a0f34d5b5fa6f1e3a9ca83e7ae05720e32860d6576215913658d5644272b02" dependencies = [ "apcore", "async-trait", diff --git a/mcp/typescript/CHANGELOG.md b/mcp/typescript/CHANGELOG.md index ec29c1ac..d7d13147 100644 --- a/mcp/typescript/CHANGELOG.md +++ b/mcp/typescript/CHANGELOG.md @@ -6,6 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.23.9-alpha.2] - Unreleased + +### Added + +- Forward Core progress and form elicitation through negotiated MCP sessions. Existing helper-based clients remain supported. +- Add opt-in bounded media resource links with authenticated reads and sensitive-field filtering. + +### Changed + +- Require `apcore-js@1.0.0-beta.1` and verify wire cancellation in the shared stdio and Streamable HTTP suite. [PR #133](https://github.com/aiperceivable/apcore-surfaces/pull/133) + ## [0.23.9-alpha.1] - Unreleased ### Fixed diff --git a/mcp/typescript/package.json b/mcp/typescript/package.json index cfcf95d5..cd2f26eb 100644 --- a/mcp/typescript/package.json +++ b/mcp/typescript/package.json @@ -51,7 +51,7 @@ "dependencies": { "@modelcontextprotocol/sdk": "1.32.0", "ajv": "^8.17.1", - "apcore-js": "1.0.0-alpha.5", + "apcore-js": "1.0.0-beta.1", "apcore-toolkit": "0.15.1-alpha.2", "jsonwebtoken": ">=9.0.3", "mcp-embedded-ui": ">=0.5.1" diff --git a/mcp/typescript/pnpm-lock.yaml b/mcp/typescript/pnpm-lock.yaml index 68367132..e9efbc5a 100644 --- a/mcp/typescript/pnpm-lock.yaml +++ b/mcp/typescript/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^8.17.1 version: 8.20.0 apcore-js: - specifier: 1.0.0-alpha.5 - version: 1.0.0-alpha.5(typescript@5.9.3) + specifier: 1.0.0-beta.1 + version: 1.0.0-beta.1(typescript@5.9.3) apcore-toolkit: specifier: 0.15.1-alpha.2 version: 0.15.1-alpha.2(@sinclair/typebox@0.34.48)(typescript@5.9.3) @@ -619,8 +619,8 @@ packages: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} - apcore-js@1.0.0-alpha.5: - resolution: {integrity: sha512-VmPRnT/S5O2N1nnMsoomOUFCf9kY4Jqe/UfyPCvh1xb8HccEshsQsvqReds652vMQCQ6i0xmcJZA4OKfWHRUJw==} + apcore-js@1.0.0-beta.1: + resolution: {integrity: sha512-kVIQE2QC6RyO++rnW69hYPhVOmqpN2DgkgOHXoUN/u011HiNGMCuvU6IRRFjjkXqYmnMgctCVJA3vvImGk0zTg==} engines: {node: '>=20.0.0'} peerDependencies: typescript: ^5.5.0 @@ -629,7 +629,7 @@ packages: optional: true apcore-toolkit@0.15.1-alpha.2: - resolution: {integrity: sha512-nBMk99wAGjSH/E3fCj4I5FsvlvYiVs+k+ARIGc6u+kkxiTvxoAlQNKAUviBYJBrmItwDVl+9EonaEO2qfiRQGg==} + resolution: {integrity: sha512-1ZzQb+2AT096KWTKw/+hR49EQQIGPNob9FjarZ8RmajyX8eU9p8AbKlzlGiO4wppdWEuKPIs5DjR/8qNndhQ5w==} engines: {node: '>=20.10.0'} peerDependencies: '@sinclair/typebox': '>=0.31.0' @@ -1938,7 +1938,7 @@ snapshots: dependencies: color-convert: 2.0.1 - apcore-js@1.0.0-alpha.5(typescript@5.9.3): + apcore-js@1.0.0-beta.1(typescript@5.9.3): dependencies: '@sinclair/typebox': 0.34.48 js-yaml: 4.3.2 @@ -1950,7 +1950,7 @@ snapshots: dependencies: '@sinclair/typebox': 0.34.48 ajv: 8.20.0 - apcore-js: 1.0.0-alpha.5(typescript@5.9.3) + apcore-js: 1.0.0-beta.1(typescript@5.9.3) js-yaml: 4.3.2 transitivePeerDependencies: - typescript diff --git a/scripts/verify-rust-core-candidate.py b/scripts/verify-rust-core-candidate.py index cc61102a..cb8c7551 100644 --- a/scripts/verify-rust-core-candidate.py +++ b/scripts/verify-rust-core-candidate.py @@ -6,46 +6,48 @@ import argparse import hashlib import json -import re import subprocess +import sys import tarfile import tempfile import tomllib from pathlib import Path -from shutil import copyfile -def package_name(manifest: Path) -> str: - return tomllib.loads(manifest.read_text())["package"]["name"] +def extract_package(archive: Path, root: Path, name: str, version: str) -> tuple[Path, str]: + digest = hashlib.sha256(archive.read_bytes()).hexdigest() + print(f"{name} crate SHA-256 {digest}", flush=True) + with tarfile.open(archive, "r:gz") as crate: + crate.extractall(root, filter="data") + package_dir = root / f"{name}-{version}" + package = tomllib.loads((package_dir / "Cargo.toml").read_text())["package"] + if (package["name"], package["version"]) != (name, version): + raise ValueError(f"Expected {name} {version} in {archive}") + return package_dir, digest -def pin_core(manifest: Path, version: str, *, macros: bool = False) -> None: - original = manifest.read_text() - dependency = tomllib.loads(original)["dependencies"]["apcore"] - if isinstance(dependency, str): - pattern = r'^(apcore\s*=\s*")[^"]+(")$' - else: - pattern = r'^(apcore\s*=\s*\{[^\n}]*\bversion\s*=\s*")[^"]+("[^\n}]*\})$' - text, count = re.subn( - pattern, - lambda match: f"{match[1]}={version}{match[2]}", - original, - count=1, - flags=re.MULTILINE, +def verify_toolkit_minimum(repo: Path, root: Path, version: str) -> None: + snapshot = root / "source.tar" + subprocess.run(["git", "archive", "--output", snapshot, "HEAD", "toolkit"], cwd=repo, check=True) + with tarfile.open(snapshot) as source: + source.extractall(root, filter="data") + toolkit = root / "toolkit" / "rust" + # The release lock tracks the beta. Only the minimum-version test resolves + # a different version, using the range declared in the real manifest. + subprocess.run(["cargo", "update", "-p", "apcore", "--precise", version], cwd=toolkit, check=True) + host = next( + line.removeprefix("host: ") + for line in subprocess.check_output(["rustc", "-vV"], text=True).splitlines() + if line.startswith("host: ") ) - if count != 1: - raise ValueError(f"Expected a versioned apcore dependency in {manifest}") - if macros: - text, count = re.subn( - r'^(apcore\s*=\s*\{[^\n}]*\bfeatures\s*=\s*\[[^\n\]]+)(\][^\n}]*\})$', - lambda match: f'{match[1]}, "macros"{match[2]}', - text, - count=1, - flags=re.MULTILINE, - ) - if count != 1: - raise ValueError(f"Expected declared apcore features in {manifest}") - manifest.write_text(text) + info = json.loads(subprocess.check_output([ + "cargo", "metadata", "--locked", "--format-version", "1", "--filter-platform", host, + ], cwd=toolkit)) + cores = [p for p in info["packages"] if p["name"] == "apcore"] + if len(cores) != 1 or cores[0]["version"] != version or not (cores[0]["source"] or "").startswith("registry+"): + raise ValueError(f"Expected one registry apcore {version}, resolved {[(p['version'], p['source']) for p in cores]}") + print(f"Resolved registry apcore {version} at {cores[0]['manifest_path']}", flush=True) + subprocess.run(["cargo", "test", "--all-features", "--locked"], cwd=toolkit, check=True) def verify( @@ -56,84 +58,31 @@ def verify( typed_example: Path | None, ) -> None: repo = Path(__file__).resolve().parents[1] - manifest = repo / component / "rust" / "Cargo.toml" - toolkit = repo / "toolkit" / "rust" / "Cargo.toml" - manifests = {manifest: manifest.read_bytes(), toolkit: toolkit.read_bytes()} - lock = manifest.with_name("Cargo.lock") - lock_contents = lock.read_bytes() if lock.exists() else None - test = manifest.parent / "tests" / "candidate_typed_module.rs" - if typed_example is not None and (component != "mcp" or macro_archive is None or test.exists()): - raise ValueError("A typed example requires an MCP checkout and a macro archive") - try: - if typed_example is not None: - copyfile(typed_example, test) - with tempfile.TemporaryDirectory(prefix="surface-core-") as temp: - patches = ["--config", f"patch.crates-io.apcore-toolkit.path={json.dumps(str(toolkit.parent))}"] - expected_core_path = None - if archive is not None: - print(f"Core crate SHA-256 {hashlib.sha256(archive.read_bytes()).hexdigest()}", flush=True) - with tarfile.open(archive, "r:gz") as crate: - crate.extractall(temp, filter="data") - expected_core_path = Path(temp) / f"apcore-{version}" / "Cargo.toml" - if package_name(expected_core_path) != "apcore": - raise ValueError("Candidate archive does not contain the apcore package") - patches += ["--config", f"patch.crates-io.apcore.path={json.dumps(str(expected_core_path.parent))}"] - - expected_macro = None - if macro_archive is not None: - if archive is None: - raise ValueError("A candidate macro archive requires a candidate Core archive") - print(f"Macro crate SHA-256 {hashlib.sha256(macro_archive.read_bytes()).hexdigest()}", flush=True) - with tarfile.open(macro_archive, "r:gz") as crate: - crate.extractall(temp, filter="data") - expected_macro = Path(temp) / f"apcore-macros-{version}" / "Cargo.toml" - if package_name(expected_macro) != "apcore-macros": - raise ValueError("Candidate archive does not contain the apcore-macros package") - patches += ["--config", f"patch.crates-io.apcore-macros.path={json.dumps(str(expected_macro.parent))}"] - - # Stable Cargo ranges exclude pre-releases. Pin the tested component - # and the checkout Toolkit together so both share one Core type identity. - for path in manifests: - pin_core(path, version, macros=path == manifest and typed_example is not None) - - command = ["cargo", *patches] - rust_host = next( - line.removeprefix("host: ") - for line in subprocess.check_output(["rustc", "-vV"], text=True).splitlines() - if line.startswith("host: ") - ) - info = json.loads(subprocess.check_output( - [*command, "metadata", "--format-version", "1", "--filter-platform", rust_host], - cwd=manifest.parent, - )) - cores = [p for p in info["packages"] if p["name"] == "apcore"] - if len(cores) != 1 or cores[0]["version"] != version: - raise ValueError(f"Expected one apcore {version}, resolved {[p['version'] for p in cores]}") - core = cores[0] - if expected_core_path is None: - if not (core["source"] or "").startswith("registry+"): - raise ValueError("Expected the minimum Core from the registry") - elif Path(core["manifest_path"]).resolve() != expected_core_path.resolve(): - raise ValueError("Consumer did not resolve the verified candidate archive") + if typed_example is not None and (component != "mcp" or macro_archive is None): + raise ValueError("The typed example requires the MCP candidate and its macro archive") + with tempfile.TemporaryDirectory(prefix="surface-core-") as temp: + root = Path(temp) + if archive is None: + if component != "toolkit" or macro_archive is not None: + raise ValueError("Only the Toolkit minimum may be tested without a candidate archive") + verify_toolkit_minimum(repo, root, version) + return + core, core_digest = extract_package(archive, root, "apcore", version) + lock_path = repo / component / "rust" / "Cargo.lock" + locked = tomllib.loads(lock_path.read_text())["package"] + core_entries = [entry for entry in locked if entry["name"] == "apcore"] + if len(core_entries) != 1 or core_entries[0].get("checksum") != core_digest: + raise ValueError(f"The Core candidate archive does not match {lock_path}") + args: list[str | Path] = [sys.executable, repo / "scripts" / "verify-rust-surface.py", component, "candidate", core] + if macro_archive is not None: + macro, macro_digest = extract_package(macro_archive, root, "apcore-macros", version) + core_lock = tomllib.loads((core / "Cargo.lock").read_text())["package"] + macro_entries = [entry for entry in core_lock if entry["name"] == "apcore-macros"] + if len(macro_entries) != 1 or macro_entries[0].get("checksum") != macro_digest: + raise ValueError("The macro candidate archive does not match the packaged Core lockfile") if typed_example is not None: - macros = [p for p in info["packages"] if p["name"] == "apcore-macros"] - if len(macros) != 1 or Path(macros[0]["manifest_path"]).resolve() != expected_macro.resolve(): - raise ValueError("Consumer did not resolve the verified candidate macro archive") - toolkits = [p for p in info["packages"] if p["name"] == "apcore-toolkit"] - if len(toolkits) != 1 or Path(toolkits[0]["manifest_path"]).resolve() != toolkit: - raise ValueError("Consumer did not resolve the Toolkit from this checkout") - print(f"Resolved apcore {version} at {core['manifest_path']}", flush=True) - print(f"Resolved apcore-toolkit {toolkits[0]['version']} at {toolkit}", flush=True) - subprocess.run([*command, "test", "--all-features", "--locked"], cwd=manifest.parent, check=True) - finally: - if typed_example is not None: - test.unlink(missing_ok=True) - for path, data in manifests.items(): - path.write_bytes(data) - if lock_contents is None: - lock.unlink(missing_ok=True) - else: - lock.write_bytes(lock_contents) + args.extend(["--macros", macro, "--typed-example", typed_example]) + subprocess.run(args, cwd=repo, check=True) if __name__ == "__main__": diff --git a/scripts/verify-rust-surface.py b/scripts/verify-rust-surface.py index 05ead0cd..516f673c 100644 --- a/scripts/verify-rust-surface.py +++ b/scripts/verify-rust-surface.py @@ -10,9 +10,19 @@ import tempfile import tomllib from pathlib import Path +from shutil import copyfile -def verify(component: str, mode: str, core: Path) -> None: +def verify( + component: str, + mode: str, + core: Path, + *, + macros: Path | None = None, + typed_example: Path | None = None, +) -> None: + if typed_example is not None and (component != "mcp" or mode != "candidate" or macros is None): + raise ValueError("The typed example requires the MCP candidate and its macro crate") repo = Path(__file__).resolve().parents[1] core = core.resolve(strict=True) with tempfile.TemporaryDirectory(prefix="surface-rust-ci-") as temporary: @@ -41,14 +51,18 @@ def verify(component: str, mode: str, core: Path) -> None: ) lockfile = crate / "Cargo.lock" locked = tomllib.loads(lockfile.read_text(encoding="utf-8"))["package"] - metadata = json.loads(subprocess.check_output( - ["cargo", "metadata", *patches, "--all-features", "--format-version", "1", "--filter-platform", host], - cwd=crate, - env=env, - )) + + def metadata(extra: list[str]) -> list[dict]: + return json.loads(subprocess.check_output( + ["cargo", "metadata", *patches, "--all-features", "--format-version", "1", "--filter-platform", host, *extra], + cwd=crate, + env=env, + ))["packages"] + + packages = metadata([]) for name, path in expected.items(): versions = [entry["version"] for entry in locked if entry["name"] == name] - matches = [entry for entry in metadata["packages"] if entry["name"] == name] + matches = [entry for entry in packages if entry["name"] == name] if ( len(versions) != 1 or len(matches) != 1 @@ -70,6 +84,28 @@ def verify(component: str, mode: str, core: Path) -> None: if mode == "package": subprocess.run(["cargo", "package", *patches, "--locked"], cwd=crate, env=env, check=True) return + if mode == "candidate": + subprocess.run(["cargo", "test", *patches, "--locked", "--all-features"], cwd=crate, env=env, check=True) + if typed_example is not None and macros is not None: + # The Golden Path uses Core's optional macro feature. Keep it + # out of the normal Surface dependency graph and run it only + # after verifying and testing that locked graph above. + macro = macros.resolve(strict=True) + patches.extend(["--config", f"patch.crates-io.apcore-macros.path={json.dumps(macro.as_posix())}"]) + test = crate / "tests" / "candidate_typed_module.rs" + if test.exists(): + raise ValueError(f"Golden Path test already exists at {test}") + copyfile(typed_example, test) + feature = ["--features", "apcore/macros"] + typed_packages = metadata(feature) + for name, path in {**expected, "apcore-macros": macro}.items(): + locations = [Path(entry["manifest_path"]).resolve() for entry in typed_packages if entry["name"] == name] + if locations != [path / "Cargo.toml"]: + raise ValueError(f"Golden Path did not resolve exactly one {name} at {path}") + subprocess.run([ + "cargo", "test", *patches, "--locked", "--all-features", *feature, "--test", "candidate_typed_module", + ], cwd=crate, env=env, check=True) + return commands = [ ["clippy", "--locked", "--all-targets", "--all-features", "--", "-D", "warnings"], ["test", "--locked", "--all-features"], @@ -85,7 +121,9 @@ def verify(component: str, mode: str, core: Path) -> None: if __name__ == "__main__": parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("component", choices=["toolkit", "mcp", "a2a", "cli"]) - parser.add_argument("mode", choices=["source", "package"]) + parser.add_argument("mode", choices=["source", "package", "candidate"]) parser.add_argument("core", type=Path) + parser.add_argument("--macros", type=Path) + parser.add_argument("--typed-example", type=Path) options = parser.parse_args() - verify(options.component, options.mode, options.core) + verify(options.component, options.mode, options.core, macros=options.macros, typed_example=options.typed_example) diff --git a/scripts/verify-typescript-surface-package.sh b/scripts/verify-typescript-surface-package.sh new file mode 100644 index 00000000..48624202 --- /dev/null +++ b/scripts/verify-typescript-surface-package.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +set -euo pipefail + +component=${1:?Surface component is required} +core=${2:?Core tarball path or registry spec is required} +core_version=${3:?Expected Core version is required} +root=$(cd "$(dirname "$0")/.." && pwd) +temporary=$(mktemp -d) +trap 'rm -rf "$temporary"' EXIT + +pnpm --dir "$root/$component/typescript" pack --pack-destination "$temporary" +if [[ "$component" != toolkit ]]; then + pnpm --dir "$root/toolkit/typescript" pack --pack-destination "$temporary" +fi +archives=("$temporary"/*.tgz) +toolkit_archive=("$temporary"/apcore-toolkit-*.tgz) +cd "$temporary" +npm init -y +npm install --no-audit --no-fund "$core" "${archives[@]}" + +node --input-type=module - "apcore-$component" "$core_version" "$core" "${toolkit_archive[0]}" <<'JS' +import assert from 'node:assert/strict'; +import { readFileSync, realpathSync } from 'node:fs'; +import { resolve } from 'node:path'; + +const [, , surface, coreVersion, coreSource, toolkitArchive] = process.argv; +const packages = JSON.parse(readFileSync('package-lock.json', 'utf8')).packages; + +function installedPackage(name) { + const top = `node_modules/${name}`; + const instances = Object.keys(packages).filter(path => path === top || path.endsWith(`/${top}`)); + assert.deepEqual(instances, [top], `Expected one copy of ${name}`); + return packages[top]; +} + +function assertArchive(metadata, archive) { + assert.ok(metadata.resolved.startsWith('file:')); + assert.equal(realpathSync(resolve(metadata.resolved.slice('file:'.length))), realpathSync(archive)); +} + +const core = installedPackage('apcore-js'); +assert.equal(core.version, coreVersion); +if (coreSource.endsWith('.tgz')) assertArchive(core, coreSource); +assertArchive(installedPackage('apcore-toolkit'), toolkitArchive); +await import(surface); +if (surface === 'apcore-toolkit') await import(`${surface}/browser`); +JS diff --git a/toolkit/python/CHANGELOG.md b/toolkit/python/CHANGELOG.md index 380a446c..3cfbc3ef 100644 --- a/toolkit/python/CHANGELOG.md +++ b/toolkit/python/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.15.1a2] - Unreleased + +### Changed + +- Extend the supported Core dependency range through `1.0.0b1`. The minimum remains `0.33.0`. + ## [0.15.1a1] - Unreleased ### Added diff --git a/toolkit/python/pyproject.toml b/toolkit/python/pyproject.toml index 8af01102..73f52a80 100644 --- a/toolkit/python/pyproject.toml +++ b/toolkit/python/pyproject.toml @@ -23,7 +23,7 @@ keywords = [ "toolkit", ] dependencies = [ - "apcore>=0.33.0,<=1.0.0a5", + "apcore>=0.33.0,<=1.0.0b1", "pydantic>=2.0", "PyYAML>=6.0", ] diff --git a/toolkit/rust/CHANGELOG.md b/toolkit/rust/CHANGELOG.md index 4167b629..7f2ed5ca 100644 --- a/toolkit/rust/CHANGELOG.md +++ b/toolkit/rust/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.15.1-alpha.2] - Unreleased + +### Changed + +- Resolve Core `1.0.0-beta.1` in the release lockfile. The manifest continues to support Core `0.33.0` through `1.0.0-beta.1`. + ## [0.15.1-alpha.1] - Unreleased ### Added diff --git a/toolkit/rust/Cargo.lock b/toolkit/rust/Cargo.lock index c1cab919..e317005a 100644 --- a/toolkit/rust/Cargo.lock +++ b/toolkit/rust/Cargo.lock @@ -48,9 +48,9 @@ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] name = "apcore" -version = "1.0.0-alpha.5" +version = "1.0.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d19939071ba2c589815c061dfb1ff827862e5f1f52251e88297d49eec500a90" +checksum = "e7f98adc75722b5b39d6df501162fef2efe829a3e37e3a806368633b3e3c7279" dependencies = [ "async-stream", "async-trait", @@ -414,7 +414,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -1491,7 +1491,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -1828,7 +1828,7 @@ dependencies = [ "getrandom 0.4.2", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2317,7 +2317,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] diff --git a/toolkit/typescript/CHANGELOG.md b/toolkit/typescript/CHANGELOG.md index 193193c1..5e930653 100644 --- a/toolkit/typescript/CHANGELOG.md +++ b/toolkit/typescript/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. +## [0.15.1-alpha.2] - Unreleased + +### Added + +- Export delegated JWT verification for host adapters that bind caller delegation to a verified transport identity. + +### Changed + +- Admit `apcore-js@1.0.0-beta.1` in the dependency range while preserving the `0.33.0` minimum. + ## [0.15.1-alpha.1] - Unreleased ### Added diff --git a/toolkit/typescript/package.json b/toolkit/typescript/package.json index d0fcb719..87168c4e 100644 --- a/toolkit/typescript/package.json +++ b/toolkit/typescript/package.json @@ -57,7 +57,7 @@ }, "dependencies": { "ajv": "^8.17.0", - "apcore-js": ">=0.33.0 <1.0.0 || 1.0.0-alpha.2 || 1.0.0-alpha.3 || 1.0.0-alpha.4 || 1.0.0-alpha.5", + "apcore-js": ">=0.33.0 <1.0.0 || 1.0.0-alpha.2 || 1.0.0-alpha.3 || 1.0.0-alpha.4 || 1.0.0-alpha.5 || 1.0.0-beta.1", "js-yaml": "^4.3.2" }, "peerDependencies": { diff --git a/toolkit/typescript/pnpm-lock.yaml b/toolkit/typescript/pnpm-lock.yaml index c7c00122..b7f7b08b 100644 --- a/toolkit/typescript/pnpm-lock.yaml +++ b/toolkit/typescript/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^8.17.0 version: 8.20.0 apcore-js: - specifier: '>=0.33.0 <1.0.0 || 1.0.0-alpha.2 || 1.0.0-alpha.3 || 1.0.0-alpha.4 || 1.0.0-alpha.5' - version: 0.33.0 + specifier: '>=0.33.0 <1.0.0 || 1.0.0-alpha.2 || 1.0.0-alpha.3 || 1.0.0-alpha.4 || 1.0.0-alpha.5 || 1.0.0-beta.1' + version: 1.0.0-beta.1(typescript@5.9.3) js-yaml: specifier: ^4.3.2 version: 4.3.2 @@ -565,9 +565,14 @@ packages: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} - apcore-js@0.33.0: - resolution: {integrity: sha512-+0UPovkB37qKy9kUwZmgSK6an+RqOUy+XOU9sEAauXStmQYIWmPBV7ACymQ9nwPI4RVAKiWbU4upMIqrCitxoQ==} + apcore-js@1.0.0-beta.1: + resolution: {integrity: sha512-kVIQE2QC6RyO++rnW69hYPhVOmqpN2DgkgOHXoUN/u011HiNGMCuvU6IRRFjjkXqYmnMgctCVJA3vvImGk0zTg==} engines: {node: '>=20.0.0'} + peerDependencies: + typescript: ^5.5.0 + peerDependenciesMeta: + typescript: + optional: true apdev-js@0.2.4: resolution: {integrity: sha512-3ntgqrMOnRqR/orgy4gzF1gp6DBe9I9xWi+EmsSYWVnNZzylESKQCtkedmeP6GOCYtck3prnUo7MQI8ITU6Xuw==} @@ -1492,11 +1497,13 @@ snapshots: dependencies: color-convert: 2.0.1 - apcore-js@0.33.0: + apcore-js@1.0.0-beta.1(typescript@5.9.3): dependencies: '@sinclair/typebox': 0.34.48 js-yaml: 4.3.2 uuid: 11.1.1 + optionalDependencies: + typescript: 5.9.3 apdev-js@0.2.4(typescript@5.9.3): dependencies: