Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
ci: run the TypeScript SDK checks and its real-server tests
AkitaOnRailsc7dccfe9ea41
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex eb8d575c..88cdbdc7 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -136,6 +136,20 @@ jobs:# `--workspace` reuses the test binaries built above instead of# re-resolving features for one package.run: cargo test --workspace --lib -- --ignored --exact commands::render_shared::tests::generated_capture_policy_v1_node_runtime_evidence+ # The optional TypeScript SDK (companions/ai-memory-ts) against the server+ # built above: integration tests, the MCP schema drift test and every+ # example. A pull request that changes an MCP tool schema fails here+ # until the SDK's schema snapshot is updated, even when it never touches+ # companions/. The harness gives the server a scratch data dir, a+ # loopback port and an environment without inherited AI_MEMORY_* values.+ - name: TypeScript SDK against the real server+ if: matrix.os == 'ubuntu-latest'+ working-directory: companions/ai-memory-ts+ env:+ AI_MEMORY_BIN: ${{ github.workspace }}/target/debug/ai-memory+ run: |+ npm ci --ignore-scripts+ npm run test:integration- name: Vendored tailwind.css is currentif: matrix.os == 'ubuntu-latest'run: git diff --exit-code -- crates/ai-memory-web/static/tailwind.css@@ -206,6 +220,59 @@ jobs:- run: cargo clippy --locked --manifest-path companions/${{ matrix.companion }}/Cargo.toml --all-targets -- -D warnings- run: cargo test --locked --manifest-path companions/${{ matrix.companion }}/Cargo.toml+ # The TypeScript SDK's checks that need no server. They run on a pull+ # request that touches the SDK or this workflow, and always on pushes and+ # dispatches. Its tests against a real server run in the `test` job above,+ # on every pull request.+ sdk-ts-changes:+ name: detect TypeScript SDK changes+ runs-on: ubuntu-latest+ permissions:+ # `dorny/paths-filter` lists a pull request's changed files through the+ # GitHub API; no checkout is needed.+ pull-requests: read+ outputs:+ sdk: ${{ steps.filter.outputs.sdk }}+ steps:+ - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3+ id: filter+ if: github.event_name == 'pull_request'+ with:+ filters: |+ sdk:+ - 'companions/ai-memory-ts/**'+ - '.github/workflows/ci.yml'++ sdk-ts:+ name: TypeScript SDK (node ${{ matrix.node }})+ needs: sdk-ts-changes+ if: github.event_name != 'pull_request' || needs.sdk-ts-changes.outputs.sdk == 'true'+ runs-on: ubuntu-latest+ strategy:+ fail-fast: false+ matrix:+ # Node 22 is the supported floor; 24 is the current LTS.+ node: ["22", "24"]+ defaults:+ run:+ working-directory: companions/ai-memory-ts+ steps:+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1+ - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0+ with:+ node-version: ${{ matrix.node }}+ # Install scripts stay off: the lockfile holds dev tooling only.+ - run: npm ci --ignore-scripts+ - run: npm run typecheck+ - run: npm run test:unit+ # Every wire argument a wrapper can send exists in schema/tools.json.+ - run: npm run schema:check+ # The README method table and docs/arguments.md match src/coverage.ts.+ - run: npm run docs:check+ # TypeDoc with warnings as errors: an undocumented export fails.+ - run: npm run docs:api+ - run: npm audit --audit-level=moderate+# Build the release binary on its own so a release-only failure# (LTO crash, codegen issue, dead-code-with-debug-assertions) doesn't# ship to Docker Hub silently.diff --git a/.github/workflows/sdk-ts-publish.yml b/.github/workflows/sdk-ts-publish.ymlnew file mode 100644index 00000000..a3f3f175--- /dev/null+++ b/.github/workflows/sdk-ts-publish.yml@@ -0,0 +1,83 @@+name: sdk-ts-publish++# Publishes the optional TypeScript SDK (companions/ai-memory-ts) to npm with+# trusted publishing (OIDC, no stored npm token) and a provenance statement.+#+# DISABLED until the maintainer approves publishing (decision D1 in+# docs/design-client-sdk.md): the npm package name and the account that owns+# it are not chosen yet. Until then:+#+# * the only trigger is a manual dispatch, and+# * package.json keeps `"private": true`, which the first step checks, so a+# dispatch fails before anything is built or uploaded.+#+# To enable it after D1: set the final name in package.json, remove+# `"private": true`, register this repository and workflow file as a trusted+# publisher for the package on npmjs.com, and add a tag trigger on the SDK's+# own prefix, for example:+#+# push:+# tags: ['sdk-ts-v*']+#+# This workflow is separate from release.yml: a server release never publishes+# the SDK, and the SDK never delays a server release.+on:+ workflow_dispatch:+ inputs:+ version:+ description: "SDK version to publish; must equal companions/ai-memory-ts/package.json"+ required: true+ type: string++permissions:+ contents: read++concurrency:+ group: sdk-ts-publish+ cancel-in-progress: false++jobs:+ publish:+ name: publish ai-memory-ts+ runs-on: ubuntu-latest+ # The `npm` environment is where required reviewers can gate a publish.+ environment: npm+ permissions:+ contents: read+ # npm trusted publishing exchanges this OIDC token for a short-lived+ # publish credential and signs the provenance statement with it.+ id-token: write+ defaults:+ run:+ working-directory: companions/ai-memory-ts+ steps:+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1+ - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0+ with:+ # Node 24 ships npm 11, which supports trusted publishing.+ node-version: "24"+ registry-url: "https://registry.npmjs.org"+ - name: Refuse while publishing is not approved+ env:+ REQUESTED: ${{ inputs.version }}+ run: |+ node -e '+ const pkg = require("./package.json");+ if (pkg.private === true) {+ console.error("package.json is private: publishing awaits decision D1 (docs/design-client-sdk.md)");+ process.exit(1);+ }+ if (pkg.version !== process.env.REQUESTED) {+ console.error(`requested ${process.env.REQUESTED}, package.json has ${pkg.version}`);+ process.exit(1);+ }+ '+ - run: npm ci --ignore-scripts+ - run: npm run typecheck+ - run: npm run test:unit+ - run: npm run schema:check+ - run: npm run docs:check+ - run: npm run docs:api+ - run: npm audit --audit-level=moderate+ - run: npm run build+ - run: npm publish --provenance --access public --ignore-scripts