@temporalio/agent-harness-client
v0.1.0
Published
A framework-independent client for temporal-agent-harness agents: a session over an agent's event stream, projected into messages and observable state.
Keywords
Readme
@temporalio/agent-harness-client
A framework-independent client for temporal-agent-harness agents. AgentSessionCore follows one
session's merged event stream — the root agent and every subagent it drives — and projects it
into messages and observable state for each agent, through a SessionState a framework binding
supplies (@temporalio/agent-harness-svelte, @temporalio/agent-harness-react, or
PlainSessionState for none).
import { AgentSessionCore, HttpTransport, PlainSessionState } from "@temporalio/agent-harness-client";
const state = new PlainSessionState<TicTacToeAgent>();
const session = new AgentSessionCore(
{ sessionId, transport: new HttpTransport({ baseUrl: "/api/" }) },
state
);
state.subscribe(() => render(state.messages, state.states.board));
session.start();
await session.sendMessage("play", { cell: 5 });src/protocol.ts is the event stream's wire types, generated from events.py:
npm run generate:protocol regenerates it (it needs packages/codegen and uv).
Development
npm ci
npm test # compiles src/ and test/ (including compile-time type checks), then runs node --test