Skip to content

feat: rename @adcp/client to @adcp/sdk + /client + /compliance subpaths + adcpVersion plumbing#1044

Merged
bokelley merged 8 commits intomainfrom
bokelley/sdk-versioning
Apr 28, 2026
Merged

feat: rename @adcp/client to @adcp/sdk + /client + /compliance subpaths + adcpVersion plumbing#1044
bokelley merged 8 commits intomainfrom
bokelley/sdk-versioning

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Summary

This PR delivers Stage 1 + Stage 2 of the multi-version SDK refactor. 5.22.0 minor in lockstep across both packages — fully backwards-compatible for existing consumers.

Stage 1 — package rename + subpath umbrella. Root package renamed @adcp/client@adcp/sdk. Old name continues publishing from packages/client-shim/ as a thin re-export of @adcp/sdk. Two new SDK subpath umbrellas added: @adcp/sdk/client (alias of root) and @adcp/sdk/compliance (testing + conformance + compliance-fixtures + signing/testing). Old @adcp/client imports keep resolving via the shim; npx @adcp/client@latest keeps working via a CLI delegator. Symbol.for('@adcp/client.*') global-registry keys preserved so instanceof survives mixed-version trees. npm deprecate wired into the release workflow so the rename pointer surfaces at install time.

Stage 2 — adcpVersion constructor option (plumbing only). SingleAgentClient, AgentClient, ADCPMultiAgentClient, and createAdcpServer accept adcpVersion?: AdcpVersion | (string & {}). Default = pinned ADCP_VERSION. Each surface exposes getAdcpVersion(). Construction-time validation rejects cross-major pins (throws ConfigurationError); within major 3 every accepted pin agrees with the wire — no silent drift. Stage 3 (per-instance schema/validator selection, lift the fence, plumb wire adcp_major_version per-instance) lands in a follow-up PR.

Test plan

  • npm run typecheck clean
  • npm run typecheck:examples clean
  • npm run build:lib clean
  • npm run format:check clean
  • npm run test:lib — 5355/5355 pass, 0 fail, 7 skipped
  • npx changeset status --verbose confirms both packages bump 5.21.1 → 5.22.0 minor in lockstep
  • node bin/adcp.js --version@adcp/sdk@5.21.1
  • ADCP_INVOKED_VIA_SHIM=1 node bin/adcp.js --version@adcp/sdk@5.21.1 (invoked via @adcp/client compat shim)
  • Workspace symlinks: node_modules/@adcp/sdk -> ../.., node_modules/@adcp/client -> ../../packages/client-shim
  • test/lib/adcp-version-option.test.js — 18 new tests pass (defaults, valid pins, cross-major rejection, unparseable strings, per-surface validation)
  • test/lib/compliance-umbrella.test.js — 4 new smoke tests pass (representative symbols re-export from each of the 4 source modules)

Reviewers

Run by code-reviewer + javascript-protocol-expert + dx-expert + ad-tech-protocol-expert (twice each, before and after the follow-up cleanup pass). All four cleared the change with no remaining blockers.

Migration story for downstream consumers

- npm install @adcp/client
+ npm install @adcp/sdk
- import { AdcpClient } from '@adcp/client';
+ import { AdcpClient } from '@adcp/sdk';

All subpaths (/server, /testing, /conformance, /signing, etc.) work under the new name with identical APIs. Mechanical s/@adcp\/client/@adcp\/sdk/g across imports plus the dependency swap = full migration.

🤖 Generated with Claude Code

@bokelley bokelley force-pushed the bokelley/sdk-versioning branch from 396272d to 857f3ab Compare April 28, 2026 16:43
Comment thread src/lib/core/TaskExecutor.ts Fixed
Comment thread src/lib/core/TaskExecutor.ts Fixed
@bokelley bokelley force-pushed the bokelley/sdk-versioning branch from adcb8fb to 0b8d6d7 Compare April 28, 2026 17:13
bokelley and others added 7 commits April 28, 2026 14:24
…subpaths + plumb adcpVersion

- Root package renamed `@adcp/client` → `@adcp/sdk`. Continues from 5.21.x version line; both packages bump together via changesets `linked` config.
- New `packages/client-shim/` publishes `@adcp/client` as a thin re-export of `@adcp/sdk` across all 17 subpaths plus a CLI delegator (`require.resolve('@adcp/sdk/package.json')` + `process.env.ADCP_INVOKED_VIA_SHIM`). Existing `npm install @adcp/client` and `npx @adcp/client@latest …` keep working unchanged.
- Two new SDK subpath umbrellas: `@adcp/sdk/client` (alias of root) and `@adcp/sdk/compliance` (re-exports testing + conformance + compliance-fixtures + signing/testing). TypeScript's TS2308 catches future re-export collisions at compile time; `test/lib/compliance-umbrella.test.js` smoke-tests representative symbols stay visible.
- Workspaces config: `["."`, `"packages/*"]`. The `"."` entry lets the shim resolve the root as a workspace member rather than reaching for the registry. `packageManager: "npm@10.9.7"` pinned + CONTRIBUTING.md notes the npm-only constraint.
- Mass rename of `@adcp/client` → `@adcp/sdk` across skills, docs, JSDoc, examples, test refs, tsconfig paths. `Symbol.for('@adcp/client.*')` global-registry keys deliberately preserved (renaming them would break `instanceof` / brand checks across mixed-version trees).
- README + docs/api badges, migration-doc broken import, and call-adcp-agent SKILL guidance all corrected.
- Release workflow runs `npm deprecate '@adcp/client@<v>' '...'` after each `changeset publish` — surfaces the rename pointer to anyone still installing under the old name. Plugin manifest (`.claude-plugin/plugin.json`) gains an explicit `npm: "@adcp/sdk"` field; the plugin name stays as `adcp-client` to avoid breaking saved user state.
- Shim README documents the deprecation timeline: through 5.x, hard-deprecate at 6.0, removal signal = sustained download-ratio crossover for 2 months + 90-day notice.

- `SingleAgentClient`, `AgentClient`, `ADCPMultiAgentClient`, and `createAdcpServer` accept `adcpVersion?: AdcpVersion | (string & {})`. Default = pinned `ADCP_VERSION`. Each surface exposes `getAdcpVersion()` returning the resolved value.
- `resolveAdcpVersion()` validates at construction: pins whose derived major differs from `ADCP_MAJOR_VERSION` throw `ConfigurationError` with a roadmap-aware message pointing at Stage 3. Within major 3 every accepted pin agrees with the wire's global `adcp_major_version` constant — no silent drift.
- New `parseAdcpMajorVersion(version)` helper handles semver and legacy aliases. Type union `AdcpVersion` derived from `COMPATIBLE_ADCP_VERSIONS` gives editor autocomplete; `(string & {})` preserves forward-compat escape hatch.
- `'3.0.1'` added to `COMPATIBLE_ADCP_VERSIONS`. 18 new tests in `test/lib/adcp-version-option.test.js`.

- CLI `--version` flag (`bin/adcp.js`) prints `@adcp/sdk@<v>` plain, with `(invoked via @adcp/client compat shim)` trailer when invoked through the shim's bin wrapper.
- Stage 3 (per-instance schema/validator selection, lift the cross-major fence, plumb wire `adcp_major_version` per-instance) lands in a follow-up PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Five clear-text logging alerts CodeQL re-flagged on the rebased PR head — all pre-existing on main but worth scrubbing while we're here:

- TaskExecutor.ts:1288, 1614 — log `error.name` instead of `error.message`. Class name is sufficient for triage; the message can carry agent / OAuth endpoint detail that flowed through transport helpers.
- SingleAgentClient.ts:2693 — drop `result.data` from the v2-fallback warning. Replaced with `hasError`/`hasData` booleans so the shape is still obvious without spilling OAuth metadata.
- bin/adcp-json-stdout.js:14 — `captureStdoutLogs` now redirects via `console.error.bind(console)` instead of a closure that re-emits args. Same observable behavior, but the bind form doesn't create a fresh log site that CodeQL traces from caller-side data.
- bin/adcp.js:3553 — print only the host of the discovered token endpoint, not the full URL. Operators can confirm the discovered realm from host alone; query/path components occasionally carry tenant identifiers.

No semantic regressions: all 5409 lib tests still pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bokelley bokelley force-pushed the bokelley/sdk-versioning branch from ecd9556 to fc9702f Compare April 28, 2026 18:33
@bokelley bokelley merged commit 88e3b02 into main Apr 28, 2026
10 checks passed
bokelley added a commit that referenced this pull request Apr 29, 2026
Pulls 86 commits from main, including the @adcp/client → @adcp/sdk rename
(PR #1044). Renamed all decisioning-branch imports / SKILL examples /
JSDoc references from @adcp/client/{server,types,testing,telemetry} to
@adcp/sdk/{server,types,testing,telemetry}. The @adcp/client compat shim
on main keeps existing installs working unchanged; new code uses the
canonical @adcp/sdk path.

Conflicts resolved:
  - tsconfig.examples.json: unioned the gcp-kms-signing-provider entry
    from main with the 5 decisioning-platform sample entries from the
    branch.
  - src/lib/types/{core,tools,schemas,enums,inline-enums}.generated.ts:
    took main's versions (3.0.1 schema cache + paired hand-authored
    inline-enums.aliases.ts file).
  - src/lib/server/decisioning/context.ts: FormatID renamed to
    FormatReferenceStructuredObject upstream (adcp 3.0.1 hoisted
    inline FormatID into FormatReferenceStructuredObject).

231/231 tests + clean build + sample typecheck CI green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants