Skip to content

Commit 46bf0f1

Browse files
Kowserclaude
andcommitted
Document the merged durable-agent layer
README: new Durable AI Agents section (subpath quickstart mirroring examples/agents/quickstart/01-basic-agent.ts, wrapper/testing subpaths, docs + examples pointers) and a Documentation-table row. AGENTS.md: src/agents feature area — repo layout additions (src/agents, e2e/, cli-bin/, examples/agents, docs/agents), the subpath-only export rule (root re-export ban and the OpenAPI Action collision that motivates it), colocated-test and e2e conventions, example run story, AGENTSPAN_* config surface, and the agent-e2e command. CHANGELOG: additive-minor entry with a migration note for @conductor-oss/conductor-agent-sdk users (specifier rewrite, /agents-prefixed wrapper subpaths, optional peers, dotenv/sideEffects behavior). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 00b3935 commit 46bf0f1

3 files changed

Lines changed: 86 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,51 @@ src/open-api/ # OpenAPI layer
4040
types.ts # Extended types - add custom fields here
4141
src/integration-tests/ # E2E tests against real Conductor server
4242
utils/ # waitForWorkflowStatus, executeWorkflowWithRetry, etc.
43+
src/agents/ # Durable agent layer (merged Agentspan TS SDK)
44+
index.ts # Agent, AgentRuntime, tool, guardrails, handoffs, ...
45+
frameworks/ # LangGraph/LangChain/generic serializers + detection
46+
testing/ # Agent testing toolkit (/agents/testing subpath)
47+
wrappers/ # Vercel AI / LangGraph / LangChain drop-in wrappers
48+
__tests__/ # Colocated jest unit tests (picked up by test:unit)
49+
e2e/ # Agent e2e suites vs live agentspan server (jest.e2e.config.mjs)
50+
cli-bin/ # agentspan CLI helper scripts (Go CLI walk-up probe target)
51+
examples/agents/ # Agent examples (own tsconfig; run via npx tsx)
52+
docs/agents/ # Agent layer documentation
4353
```
4454

55+
### The agent layer (`src/agents/`)
56+
57+
- **Subpath-only exports**: everything agent-flavored ships via `./agents`,
58+
`./agents/testing`, `./agents/vercel-ai`, `./agents/langgraph`,
59+
`./agents/langchain` (see `exports` in package.json + `tsup.config.ts`).
60+
**Never re-export agent symbols from the root** — the agent layer has an
61+
`Action` class that collides with the OpenAPI-generated `Action` type, and
62+
the root re-exports the whole generated surface, which changes with the
63+
server spec.
64+
- Source keeps upstream's ESM-style `.js`-suffixed relative imports (resolved
65+
by `nodenext` for tsc and a `moduleNameMapper` suffix-strip for jest).
66+
- The only coupling to the workflow layer is in `agent-client.ts` and
67+
`worker.ts` (imports from `../sdk` and `../open-api`) — keep it that way.
68+
- Unit tests are colocated in `src/agents/__tests__/` so the existing
69+
`test:unit` glob and per-PR CI matrix pick them up with zero workflow
70+
changes. Agent e2e lives in repo-root `e2e/` and runs only via
71+
`npm run test:agent-e2e` (its own `.github/workflows/agent-e2e.yml` boots a
72+
pinned release server JAR; needs `OPENAI_API_KEY`/`ANTHROPIC_API_KEY`
73+
secrets).
74+
- Agent examples resolve the package name straight to `src/agents` sources via
75+
`examples/agents/tsconfig.json` paths: `npx tsx examples/agents/<file>.ts`.
76+
Framework subdirs (adk/, langgraph/, openai/, vercel-ai/) install their own
77+
deps (`scripts/install-example-deps.sh`); `examples/agents` is excluded from
78+
the root tsconfig.
79+
- `AGENTSPAN_*` env vars (`AGENTSPAN_SERVER_URL`, default
80+
`http://localhost:6767/api`) are the agent layer's config surface — kept
81+
working as-is; `CONDUCTOR_*` aliases are a possible follow-up.
82+
4583
## Commands
4684

4785
```bash
4886
npm test # Unit tests (482+ tests)
49-
npm run build # tsup (ESM + CJS dual output)
87+
npm run build # tsup (root + 5 agent entries, ESM + CJS) + verify:dist
5088
npm run lint # ESLint
5189
npm run generate-openapi-layer # Regenerate from OpenAPI spec
5290

@@ -55,6 +93,10 @@ CONDUCTOR_SERVER_URL=http://localhost:8080 \
5593
CONDUCTOR_AUTH_KEY=key CONDUCTOR_AUTH_SECRET=secret \
5694
ORKES_BACKEND_VERSION=5 \
5795
npm run test:integration:orkes-v5
96+
97+
# Agent e2e (requires a running agentspan server + LLM keys; CI does this
98+
# against the pinned release JAR — see .github/workflows/agent-e2e.yml)
99+
AGENTSPAN_SERVER_URL=http://localhost:8080/api npm run test:agent-e2e
58100
```
59101

60102
## Post-Change Verification (Required)

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- **Durable AI agents** -- the Agentspan TypeScript SDK (`@conductor-oss/conductor-agent-sdk`) is merged into this package as new subpath exports: `@io-orkes/conductor-javascript/agents` (core: `Agent`, `AgentRuntime`, `tool`, guardrails, handoffs, memory, schedules, streaming, HITL), `/agents/testing`, and framework wrappers `/agents/vercel-ai`, `/agents/langgraph`, `/agents/langchain`. The root export surface is unchanged (additive minor). Docs at [docs/agents/](docs/agents/README.md); 60+ examples at [examples/agents/](examples/agents/).
13+
- **Migration for `@conductor-oss/conductor-agent-sdk` users:** install `@io-orkes/conductor-javascript` and rewrite import specifiers -- `@conductor-oss/conductor-agent-sdk` becomes `@io-orkes/conductor-javascript/agents`, and the wrapper subpaths gain the `/agents` prefix (e.g. `.../vercel-ai` becomes `.../agents/vercel-ai`). APIs, behavior, and `AGENTSPAN_*` env vars are unchanged.
14+
- New optional peer dependencies (all lazily resolved, install only what you use): `zod`, `zod-to-json-schema`, `ai`, `@langchain/core`, `@langchain/langgraph`. `dotenv` becomes a runtime dependency (the agent entry points load it at import time; the package `sideEffects` field allowlists `dist/agents/**` so bundlers keep that bootstrap).
1215
- **Canonical metrics** -- opt-in harmonized metric surface via `WORKER_CANONICAL_METRICS=true`. See [METRICS.md](METRICS.md) for the full catalog, configuration, and migration guide.
1316
- Bounded `uri` label on `http_api_client_request_seconds`: canonical mode uses path templates (e.g. `/workflow/{workflowId}`) instead of fully-resolved paths, preventing metric cardinality explosion from dynamic IDs.
1417
- `TaskPaused` event type and `PollerOptions.onPaused` callback: emitted when a poll cycle is skipped because the worker is paused. Canonical mode records `task_paused_total`; legacy mode does not (see Implementation Notes in METRICS.md).

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ If you find [Conductor](https://github.com/conductor-oss/conductor) useful, plea
2222
* [Examples](#examples)
2323
* [API Journey Examples](#api-journey-examples)
2424
* [AI & LLM Workflows](#ai--llm-workflows)
25+
* [Durable AI Agents](#durable-ai-agents)
2526
* [Documentation](#documentation)
2627
* [Support](#support)
2728
* [Frequently Asked Questions](#frequently-asked-questions)
@@ -537,11 +538,50 @@ See [examples/agentic-workflows/](examples/agentic-workflows/) for all examples.
537538
| [rag-workflow.ts](examples/advanced/rag-workflow.ts) | End-to-end RAG: document indexing → semantic search → LLM answer |
538539
| [vector-db.ts](examples/advanced/vector-db.ts) | Vector DB operations: embedding generation, storage, search |
539540
541+
## Durable AI Agents
542+
543+
The SDK also ships a durable agent authoring layer — long-running, plan-execute,
544+
and event-driven AI agents whose steps run as Conductor workflow tasks, so they
545+
survive restarts and are observable like any workflow. It lives under the
546+
`/agents` subpath export:
547+
548+
```typescript
549+
import { Agent, AgentRuntime } from "@io-orkes/conductor-javascript/agents";
550+
551+
const agent = new Agent({
552+
name: "greeter",
553+
model: "openai/gpt-4o-mini",
554+
instructions: "You are a friendly assistant. Keep responses brief.",
555+
});
556+
557+
const runtime = new AgentRuntime(); // AGENTSPAN_SERVER_URL, default http://localhost:6767/api
558+
try {
559+
const result = await runtime.run(agent, "Hello! What can you do?");
560+
result.printResult();
561+
} finally {
562+
await runtime.shutdown();
563+
}
564+
```
565+
566+
The layer includes tools (`tool()`, with optional Zod schemas), multi-agent
567+
strategies (sequential, parallel, handoffs, swarm), guardrails,
568+
human-in-the-loop, streaming, memory, schedules, and drop-in wrappers for
569+
agents written with the Vercel AI SDK, LangGraph, and LangChain
570+
(`/agents/vercel-ai`, `/agents/langgraph`, `/agents/langchain`), plus a
571+
testing toolkit (`/agents/testing`).
572+
573+
- **Docs:** [docs/agents/](docs/agents/README.md) — start with
574+
[getting-started.md](docs/agents/getting-started.md)
575+
- **Examples:** [examples/agents/](examples/agents/) — 60+ runnable examples,
576+
from a basic agent to the full [kitchen sink](examples/agents/kitchen-sink.ts);
577+
run them with `npx tsx examples/agents/01-basic-agent.ts`
578+
540579
## Documentation
541580
542581
| Document | Description |
543582
|----------|-------------|
544583
| [SDK Development Guide](SDK_DEVELOPMENT.md) | Architecture, patterns, pitfalls, testing |
584+
| [Durable AI Agents](docs/agents/README.md) | Agent authoring layer: tools, guardrails, multi-agent, HITL, framework wrappers |
545585
| [Metrics Reference](METRICS.md) | Legacy and canonical Prometheus metrics with migration guide |
546586
| [Breaking Changes](BREAKING_CHANGES.md) | v3.x migration guide |
547587
| [Workflow Management](docs/api-reference/workflow-executor.md) | Start, pause, resume, terminate, retry, search, signal |

0 commit comments

Comments
 (0)