@tisyn/code-agent
v0.3.1
Published
`@tisyn/code-agent` defines the portable agent contract for session-oriented coding agents.
Readme
@tisyn/code-agent
@tisyn/code-agent defines the portable agent contract for session-oriented coding agents.
It gives Tisyn workflows one stable capability surface for "open a coding session, send a prompt, fork it, resume it, close it" without baking any particular backend into the workflow. Concrete backends such as Claude Code or Codex implement this contract in separate packages.
Where It Fits
@tisyn/code-agent sits between authored workflows and backend-specific adapter packages.
@tisyn/agentprovides the typed declaration machinery used to define the contract.@tisyn/code-agentnames the portable operations and shared result types.@tisyn/claude-codeand@tisyn/codexadapt real coding-agent backends to this contract.@tisyn/transportinstalls those adapters as local or remote capabilities.
Use this package when workflow code should depend on a generic "coding agent" capability instead of a specific vendor.
What It Provides
The public surface exported from src/index.ts includes:
CodeAgent— the portable declared agent contract withnewSession,closeSession,prompt,fork, andopenForkSessionHandle— workflow-visible session identifierPromptResult— standard result for prompt operationsForkData— handle data needed to reopen a forked sessionNewSessionConfig— portable new-session input shapePromptArgs— portable prompt input shapecreateMockCodeAgentTransport— test helper for mocking a conforming code-agent transportMockCodeAgentConfig,MockOperationConfig— mock transport configuration types
Contract Shape
CodeAgent is declared as a normal Tisyn agent:
newSession(config)— create a backend session and return aSessionHandlecloseSession(handle)— close a sessionprompt(args)— send a prompt to an existing session and returnPromptResultfork(session)— fork an existing session and returnForkDataopenFork(data)— reopen a previously created fork and return a newSessionHandle
The types in this package are intentionally small and portable. Backend-specific extensions belong in adapter packages, not in the shared contract.
Relationship to Other Packages
@tisyn/agentsupplies the declaration and operation primitives.@tisyn/claude-codeimplements this contract for Claude Code.@tisyn/codeximplements this contract for Codex.@tisyn/transportcarries these declared operations across local or remote boundaries.
Boundaries
@tisyn/code-agent does not:
- spawn subprocesses
- speak vendor protocols
- manage stdio or SDK integration
- define vendor-specific result extensions
It only defines the shared coding-agent contract that adapters implement.
