Skip to content

TS: move _run-reference-agent.ts from client-sdk to agent-sdk (mirror Python layout) #53

@renerocksai

Description

@renerocksai

Background

PR #48 split the TypeScript SDK into @synadia-ai/agents (caller, in client-sdk/typescript/) and @synadia-ai/agent-service (host, in agent-sdk/typescript/). The ReferenceAgent class moved cleanly to agent-sdk/typescript/src/testing/reference-agent.ts — but the runnable wrapper script _run-reference-agent.ts stayed behind in client-sdk/typescript/examples/.

To keep that wrapper compiling, @synadia-ai/agent-service was added to client-sdk/typescript/devDependencies as a file:../../agent-sdk/typescript link. So the caller-side package has a build-time dependency on the host-side package — present only to support one demo wrapper.

The Python side already has the cleaner pattern:

TS (today) Python (today)
Reference agent class agent-sdk/typescript/src/testing/reference-agent.ts agent-sdk/python/src/...
Runnable wrapper client-sdk/typescript/examples/_run-reference-agent.ts agent-sdk/python/examples/_reference_agent.py
Cross-package devDep needed? Yes (@synadia-ai/agent-service in client-sdk's devDeps) No

client-sdk/python/examples/README.md just tells users to run the agent from the sibling directory (uv run --directory ../../agent-sdk/python python examples/_reference_agent.py …), with no Python-side dep on the agent-sdk package.

Now that the npm packages are actually published, this is a good moment to mirror that layout on TS.

Proposed change

  1. git mv client-sdk/typescript/examples/_run-reference-agent.ts agent-sdk/typescript/examples/_run-reference-agent.ts (creates the examples/ dir on agent-sdk, which doesn't exist yet).
  2. Drop @synadia-ai/agent-service from client-sdk/typescript/devDependencies and refresh client-sdk/typescript/bun.lock.
  3. Make sure agent-sdk/typescript/package.json has whatever it needs to run examples (probably @nats-io/transport-node is already there as a devDep — confirm).
  4. Update inline references to the old path:
    • client-sdk/typescript/examples/03-prompt-attachment.ts:14 (comment header points readers at bun run examples/_run-reference-agent.ts).
    • Other 01..05-*.ts example file headers — sweep for the same pattern.
    • client-sdk/typescript/README.md quickstart / examples section, if it shows the old path.
  5. Update top-level docs:
    • README.md:47 (TypeScript row of the "Reference agents and demo scripts" table — currently links to client-sdk/typescript/examples/_run-reference-agent.ts).
    • CLAUDE.md:35 (Reference agents — canonical implementations §, TypeScript bullet).
  6. Mirror the Python invocation pattern in the docs: from client-sdk/typescript/, running the demos becomes a two-terminal flow with the agent invoked as bun --cwd ../../agent-sdk/typescript examples/_run-reference-agent.ts (or whatever the cleanest Bun equivalent is — Mario knows the toolchain better).
  7. CI: confirm client-sdk-typescript.yml and agent-sdk-typescript.yml still pass — both already trigger on changes under either subtree, so the move shouldn't need workflow changes, but worth verifying.

Why now

  • @synadia-ai/agents@0.4.0 and @synadia-ai/agent-service@0.4.0 are now published, so any ^0.4.x consumers stay unaffected by an internal layout move (no new published exports, no breakage).
  • The current backward devDep (client-sdkagent-sdk via file: link) is the kind of pre-split inertia worth cleaning up before the next release goes out.

Out of scope

  • No changes to the public API of either package.
  • No changes to the ReferenceAgent class itself or the @synadia-ai/agent-service/testing subpath.
  • No CHANGELOG entry under @synadia-ai/agents (it's purely internal — caller-side consumers see no change). One-line under agent-sdk/typescript/CHANGELOG.md [Unreleased] noting the wrapper now ships alongside the host package.

Context for whoever picks this up

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions