Skip to main content
A port is one capability of the runtime behind an interface the package defines. ports is the full set, AgentHarnessPorts version 2 of the contract, and it is the runtime plugged into the harness. The harness reaches the instance’s storage and scheduler only through it. The raw environment, the actor context and the actor storage never cross the boundary. On the Agent Runtime, the runtime adapter builds the ports from members of the Agent class.

Building Ports

createRuntimeAgentHarnessPorts(agent, { environmentKeys }) builds the ports from an instance of the Agent Runtime SDK’s Agent class, through a seam the runtime owns and without reflecting over the class. environmentKeys names the bindings that cross into environment, and none do unless named. For tests, createNodeAgentHarnessPorts(options) from @telnyx/agent-harness/node is a deterministic plain-Node implementation, in memory for the log, state, events and tasks, and file-backed through node:sqlite for SQL. defineAgentHarnessPortsContract(label, factory) from @telnyx/agent-harness/contract registers the shared contract suite against any adapter, so a host of the user’s own is checked against the same semantics as the runtime’s. The contract module imports vitest, an optional peer dependency, so vitest must be installed wherever the suite runs. The suite asserts fixed fixture values. The factory’s ports must report the identity id "contract-agent", a clock reading of 1_700_000_000_000 and the environment { MODEL: "deterministic-model" }.