Files
deepseek-harness/examples
Tianyi Cui 225ed051b1 Add branded ID types: CallId, SessionId, AgentId
Nominal string types via a unique-symbol brand (zero runtime cost):
an AgentId can no longer be passed where a CallId is expected. Each
core package brands the IDs it owns — CallId in dsh-llm (tool-call
correlation across blocks, chunks, session events, and execution
results), SessionId in dsh-session, AgentId in dsh-agent. Construction
goes through same-named factory functions; public string-in APIs
(sessions.create, agentLoop.create) keep accepting plain strings and
brand internally. Policy note in the brand module: brand IDs that
cross package boundaries, not every string.
2026-06-11 15:17:56 +08:00
..

Examples

Runnable demos (not workspaces) that showcase how the harness is wired.

echo-agent

A mock model + echo tool + stdio UI + JSONL persistence demo. Demonstrates:

  • Loading plugins from a cordis.yml via @cordisjs/plugin-loader + @cordisjs/plugin-include
  • Registering a mock LlmAdapter (streaming scripted responses)
  • Registering a tool via ctx.tools.register()
  • Persisting session events to JSONL via the session/event + session/flush pattern
  • A minimal stdio UI consuming agent/stream-chunk and session events

Run with: yarn demo (or node --expose-internals --import tsx examples/echo-agent/start.ts)

When prompted, type "echo " to trigger a tool call round-trip.