diff --git a/docs/api/README.md b/docs/api/README.md index 59f3df1..a9b0440 100644 --- a/docs/api/README.md +++ b/docs/api/README.md @@ -6,15 +6,15 @@ ## Modules -- [agent](agent/README.md) -- [analyst-loop](analyst-loop/README.md) -- [audit](audit/README.md) -- [improvement](improvement/README.md) -- [index](index/README.md) -- [intelligence](intelligence/README.md) -- [mcp](mcp/README.md) -- [platform](platform/README.md) -- [profiles](profiles/README.md) -- [runtime](runtime/README.md) -- [topology](topology/README.md) -- [workflow](workflow/README.md) +- [agent](agent.md) +- [analyst-loop](analyst-loop.md) +- [audit](audit.md) +- [improvement](improvement.md) +- [index](index.md) +- [intelligence](intelligence.md) +- [mcp](mcp.md) +- [platform](platform.md) +- [profiles](profiles.md) +- [runtime](runtime.md) +- [topology](topology.md) +- [workflow](workflow.md) diff --git a/docs/api/agent.md b/docs/api/agent.md new file mode 100644 index 0000000..876f575 --- /dev/null +++ b/docs/api/agent.md @@ -0,0 +1,1714 @@ +[**@tangle-network/agent-runtime**](README.md) + +*** + +[@tangle-network/agent-runtime](README.md) / agent + +# agent + +## Classes + +### AgentManifestError + +Defined in: [agent/define-agent.ts:272](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L272) + +#### Extends + +- `Error` + +#### Constructors + +##### Constructor + +> **new AgentManifestError**(`message`, `agentId`, `issues?`): [`AgentManifestError`](#agentmanifesterror) + +Defined in: [agent/define-agent.ts:273](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L273) + +###### Parameters + +###### message + +`string` + +###### agentId + +`string` + +###### issues? + +readonly `unknown`[] = `[]` + +###### Returns + +[`AgentManifestError`](#agentmanifesterror) + +###### Overrides + +`Error.constructor` + +#### Properties + +##### agentId + +> `readonly` **agentId**: `string` + +Defined in: [agent/define-agent.ts:275](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L275) + +##### issues + +> `readonly` **issues**: readonly `unknown`[] = `[]` + +Defined in: [agent/define-agent.ts:276](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L276) + +## Interfaces + +### AgentManifest + +Defined in: [agent/define-agent.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L35) + +The full agent manifest. Each agent ships ONE of these. + +Generics: + `TPersona` — the agent's persona shape (loaded from + `surfaces.personas`). Defaults to `unknown` so the substrate's + persona discovery (`loadPersonas`) can accept anything; per-agent + code re-narrows when it matters. + `TRunOutput` — the shape `runtime.act` returns. Used by the rubric + scorers and emitted into the trace. + +#### Type Parameters + +##### TPersona + +`TPersona` = `unknown` + +##### TRunOutput + +`TRunOutput` = `unknown` + +#### Properties + +##### id + +> **id**: `string` + +Defined in: [agent/define-agent.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L42) + +Stable identifier — used as `projectId` in traces, as the analyst +loop's `runId` prefix, and as the namespace under which findings +are persisted. MUST match the agent's repo name to keep +cross-repo telemetry joinable. + +##### repoRoot + +> **repoRoot**: `string` + +Defined in: [agent/define-agent.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L50) + +Filesystem root the substrate resolves surface paths against. +Typically `process.cwd()` or a fixed absolute path. Use an +absolute path when the agent's tests may run from subdirectories +(vitest sometimes shifts cwd). + +##### surfaces + +> **surfaces**: [`AgentSurfaces`](#agentsurfaces) + +Defined in: [agent/define-agent.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L61) + +Map of mutable surfaces the self-improvement loop can edit. See +`AgentSurfaces` — required: `systemPrompt`, `tools`, `rubric`, +`knowledge`, `personas`. Optional: `scaffolding`, `memory`, `rag`, +`outputSchema`. + +Every required path is validated at `defineAgent` time. Missing +paths throw with the full list of offenders. + +##### rubric + +> **rubric**: [`AgentRubric`](#agentrubric)\<`TRunOutput`\> + +Defined in: [agent/define-agent.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L68) + +Rubric the substrate uses to score each run. Dimensions × weights +× judges. The substrate computes the weighted composite and +stamps it into the RunRecord. + +##### runtime + +> **runtime**: [`AgentRuntime`](#agentruntime)\<`TPersona`, `TRunOutput`\> + +Defined in: [agent/define-agent.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L79) + +Runtime adapter — how the substrate INVOKES the agent against a +persona. The `act` function takes a persona + a context (with the +tracer the substrate threads through for span emission) and +returns the run output the rubric will score. + +The agent's existing production runtime goes in here; the +substrate is intentionally thin around it. + +##### personas + +> **personas**: () => `Promise`\ + +Defined in: [agent/define-agent.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L87) + +Persona discovery — the substrate loads personas via this function +at eval start. Can read from `surfaces.personas`, an API, or be +hardcoded. The substrate calls it once per `runAgentEval` call; +persona ordering is preserved. + +###### Returns + +`Promise`\ + +##### analystKinds + +> **analystKinds**: readonly `TraceAnalystKindSpec`[] + +Defined in: [agent/define-agent.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L97) + +Analyst kinds the substrate runs against each persona's trace. +Defaults to `DEFAULT_TRACE_ANALYST_KINDS` from agent-eval. Per-agent +authors can prune (e.g. skip `knowledge-poisoning` when there's no +knowledge base) or extend (custom domain kinds). + +Empty array disables the loop — useful for `pnpm eval --no-analyst`. + +##### analyst + +> **analyst**: [`AnalystConfig`](#analystconfig) + +Defined in: [agent/define-agent.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L103) + +Analyst LLM configuration. The substrate uses these for all four +kinds (override per-kind via `analystKinds` if needed). + +##### autoApply? + +> `optional` **autoApply?**: [`AutoApplyPolicy`](#autoapplypolicy) + +Defined in: [agent/define-agent.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L115) + +Auto-apply policy. Knowledge / improvement edits land only when +`enabled === true` AND the source finding's confidence meets the +threshold. `mode` controls how applies happen: `'write'` mutates +files in-place; `'open-pr'` writes to a branch and opens a PR. + +Default: knowledge auto-applies at confidence ≥0.85 in `'write'` +mode (wiki edits are git-reversible); improvement stays at +`enabled: false` until the agent author has measured precision. + +*** + +### AgentRubric + +Defined in: [agent/define-agent.ts:118](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L118) + +`@tangle-network/agent-runtime/agent` — declarative agent manifest + +substrate-default adapters. + +Every vertical agent (tax / legal / gtm / creative / N future +verticals) ships ONE `defineAgent({...})` call + a thin invocation +of `runAnalystLoop` wired through the substrate-default adapters. +No per-vertical glue. No fabricated paths. No theater. + +#### Type Parameters + +##### TRunOutput + +`TRunOutput` + +#### Properties + +##### dimensions + +> **dimensions**: readonly [`RubricDimension`](#rubricdimension)\<`TRunOutput`\>[] + +Defined in: [agent/define-agent.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L120) + +Dimensions composing the weighted score. Weights sum to 1.0 by convention. + +##### judges? + +> `optional` **judges?**: readonly [`JudgeConfig`](#judgeconfig)\<`TRunOutput`\>[] + +Defined in: [agent/define-agent.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L126) + +Optional judges layered on top of deterministic dimensions. Each +judge returns a score per dimension; the substrate averages judges +(mean by default) for the LLM contribution. + +*** + +### RubricDimension + +Defined in: [agent/define-agent.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L129) + +`@tangle-network/agent-runtime/agent` — declarative agent manifest + +substrate-default adapters. + +Every vertical agent (tax / legal / gtm / creative / N future +verticals) ships ONE `defineAgent({...})` call + a thin invocation +of `runAnalystLoop` wired through the substrate-default adapters. +No per-vertical glue. No fabricated paths. No theater. + +#### Type Parameters + +##### TRunOutput + +`TRunOutput` + +#### Properties + +##### id + +> **id**: `string` + +Defined in: [agent/define-agent.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L131) + +Unique identifier — appears in finding subjects (`rubric:`). + +##### weight + +> **weight**: `number` + +Defined in: [agent/define-agent.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L133) + +0..1 — weight in the composite. + +##### score + +> **score**: (`input`) => `number` + +Defined in: [agent/define-agent.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L139) + +Deterministic scorer: given the persona + run output, returns a +0..1 score. The substrate sums weight × score across dimensions +for the deterministic composite; judges supplement subjective dims. + +###### Parameters + +###### input + +###### persona + +`unknown` + +###### output + +`TRunOutput` + +###### Returns + +`number` + +##### label? + +> `optional` **label?**: `string` + +Defined in: [agent/define-agent.ts:141](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L141) + +Optional human-readable label for reports. + +*** + +### JudgeConfig + +Defined in: [agent/define-agent.ts:144](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L144) + +`@tangle-network/agent-runtime/agent` — declarative agent manifest + +substrate-default adapters. + +Every vertical agent (tax / legal / gtm / creative / N future +verticals) ships ONE `defineAgent({...})` call + a thin invocation +of `runAnalystLoop` wired through the substrate-default adapters. +No per-vertical glue. No fabricated paths. No theater. + +#### Type Parameters + +##### TRunOutput + +`TRunOutput` + +#### Properties + +##### id + +> **id**: `string` + +Defined in: [agent/define-agent.ts:146](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L146) + +Judge identifier — appears in trace spans + manifest. + +##### model + +> **model**: `string` + +Defined in: [agent/define-agent.ts:148](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L148) + +Model snapshot to invoke. Pin the snapshot (`claude-sonnet-4-6@2025-04-15`); the validator rejects bare aliases. + +##### dimensions + +> **dimensions**: readonly `string`[] + +Defined in: [agent/define-agent.ts:150](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L150) + +Dimensions this judge scores. + +##### anchors? + +> `optional` **anchors?**: readonly `object`[] + +Defined in: [agent/define-agent.ts:156](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L156) + +Optional rubric anchors — text examples the judge sees as a +few-shot prompt to calibrate. STRONGLY recommended for subjective +dimensions; required by the calibration gate (Pearson ≥0.7). + +*** + +### AgentRuntime + +Defined in: [agent/define-agent.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L159) + +`@tangle-network/agent-runtime/agent` — declarative agent manifest + +substrate-default adapters. + +Every vertical agent (tax / legal / gtm / creative / N future +verticals) ships ONE `defineAgent({...})` call + a thin invocation +of `runAnalystLoop` wired through the substrate-default adapters. +No per-vertical glue. No fabricated paths. No theater. + +#### Type Parameters + +##### TPersona + +`TPersona` + +##### TRunOutput + +`TRunOutput` + +#### Properties + +##### act + +> **act**: (`persona`, `ctx`) => [`AgentRunInvocation`](#agentruninvocation)\<`TRunOutput`\> + +Defined in: [agent/define-agent.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L184) + +Invoke the agent against one persona. Returns BOTH: + - `events`: an `AsyncIterable` the chat-centric + product consumes verbatim (SSE / WebSocket / inline render). + **Streaming is mandatory — never collapse this to a single Promise.** + The agent's existing `runChatTurn` (or equivalent async generator) + plugs in here directly. + - `output`: a `Promise` resolved AFTER the event stream + drains. The eval substrate awaits this for rubric scoring; chat + products usually ignore it (they already rendered incrementally). + +Implementation contract: + 1. `act` MUST return immediately (synchronous construction of the + `events` iterator + the `output` promise). + 2. Iterating `events` drives the underlying LLM/tool calls — the + caller chooses when to consume. + 3. `output` resolves only after the iterator yields its terminal + event (typically `task_end`); see `collectAgentRun` helper. + +`ctx.emitter` is the substrate-threaded `TraceEmitter` — runtimes +SHOULD record LLM/tool spans through it for capture integrity. +`ctx.deadlineMs` is wall-clock; the runtime SHOULD honour for graceful +cancel. `ctx.signal` is the standard abort signal. + +###### Parameters + +###### persona + +`TPersona` + +###### ctx + +[`AgentRunContext`](#agentruncontext) + +###### Returns + +[`AgentRunInvocation`](#agentruninvocation)\<`TRunOutput`\> + +*** + +### AgentRunInvocation + +Defined in: [agent/define-agent.ts:187](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L187) + +`@tangle-network/agent-runtime/agent` — declarative agent manifest + +substrate-default adapters. + +Every vertical agent (tax / legal / gtm / creative / N future +verticals) ships ONE `defineAgent({...})` call + a thin invocation +of `runAnalystLoop` wired through the substrate-default adapters. +No per-vertical glue. No fabricated paths. No theater. + +#### Type Parameters + +##### TRunOutput + +`TRunOutput` + +#### Properties + +##### events + +> **events**: `AsyncIterable`\<[`RuntimeStreamEvent`](index.md#runtimestreamevent)\> + +Defined in: [agent/define-agent.ts:189](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L189) + +Live stream of typed runtime events. Consumed by chat UX directly. + +##### output + +> **output**: `Promise`\<`TRunOutput`\> + +Defined in: [agent/define-agent.ts:191](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L191) + +Final structured output the rubric scores. Resolves after `events` drains. + +*** + +### AgentRunContext + +Defined in: [agent/define-agent.ts:231](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L231) + +`@tangle-network/agent-runtime/agent` — declarative agent manifest + +substrate-default adapters. + +Every vertical agent (tax / legal / gtm / creative / N future +verticals) ships ONE `defineAgent({...})` call + a thin invocation +of `runAnalystLoop` wired through the substrate-default adapters. +No per-vertical glue. No fabricated paths. No theater. + +#### Properties + +##### emitter + +> **emitter**: `TraceEmitter` + +Defined in: [agent/define-agent.ts:233](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L233) + +Substrate-managed trace emitter. + +##### runId + +> **runId**: `string` + +Defined in: [agent/define-agent.ts:235](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L235) + +Stable run id for this persona × variant cell. + +##### variantId? + +> `optional` **variantId?**: `string` + +Defined in: [agent/define-agent.ts:237](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L237) + +Variant the runtime is exercising (e.g. `'baseline'`, `'source-grounded'`). + +##### deadlineMs? + +> `optional` **deadlineMs?**: `number` + +Defined in: [agent/define-agent.ts:239](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L239) + +Wall-clock deadline (epoch ms). The runtime SHOULD honour for graceful cancel. + +##### signal? + +> `optional` **signal?**: `AbortSignal` + +Defined in: [agent/define-agent.ts:241](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L241) + +Optional abort signal. + +*** + +### AnalystConfig + +Defined in: [agent/define-agent.ts:244](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L244) + +`@tangle-network/agent-runtime/agent` — declarative agent manifest + +substrate-default adapters. + +Every vertical agent (tax / legal / gtm / creative / N future +verticals) ships ONE `defineAgent({...})` call + a thin invocation +of `runAnalystLoop` wired through the substrate-default adapters. +No per-vertical glue. No fabricated paths. No theater. + +#### Properties + +##### model + +> **model**: `string` + +Defined in: [agent/define-agent.ts:246](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L246) + +Model the analyst kinds use. Override per-kind via `analystKinds[i].cost.models`. + +##### budgetUsd? + +> `optional` **budgetUsd?**: `number` + +Defined in: [agent/define-agent.ts:248](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L248) + +Optional total budget across all kinds for one run. Substrate enforces via `BudgetGuard`. + +##### backend? + +> `optional` **backend?**: `object` + +Defined in: [agent/define-agent.ts:250](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L250) + +Backend hint for the AxAIService factory — same shape every kind uses. + +###### name? + +> `optional` **name?**: `"openai"` \| `"router"` + +###### apiKey? + +> `optional` **apiKey?**: `string` + +###### baseUrl? + +> `optional` **baseUrl?**: `string` + +*** + +### AutoApplyPolicy + +Defined in: [agent/define-agent.ts:257](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L257) + +`@tangle-network/agent-runtime/agent` — declarative agent manifest + +substrate-default adapters. + +Every vertical agent (tax / legal / gtm / creative / N future +verticals) ships ONE `defineAgent({...})` call + a thin invocation +of `runAnalystLoop` wired through the substrate-default adapters. +No per-vertical glue. No fabricated paths. No theater. + +#### Properties + +##### knowledge? + +> `optional` **knowledge?**: `object` + +Defined in: [agent/define-agent.ts:258](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L258) + +###### enabled + +> **enabled**: `boolean` + +###### confidenceThreshold? + +> `optional` **confidenceThreshold?**: `number` + +###### mode? + +> `optional` **mode?**: `"write"` \| `"open-pr"` + +##### improvement? + +> `optional` **improvement?**: `object` + +Defined in: [agent/define-agent.ts:263](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L263) + +###### enabled + +> **enabled**: `boolean` + +###### confidenceThreshold? + +> `optional` **confidenceThreshold?**: `number` + +###### mode? + +> `optional` **mode?**: `"write"` \| `"open-pr"` + +*** + +### SurfaceImprovementEdit + +Defined in: [agent/improvement-adapter.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L43) + +#### Properties + +##### id + +> **id**: `string` + +Defined in: [agent/improvement-adapter.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L45) + +Stable id derived from the source finding so re-proposals are idempotent. + +##### sourceFindingId + +> **sourceFindingId**: `string` + +Defined in: [agent/improvement-adapter.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L47) + +The finding that produced this edit — for revert + audit trail. + +##### subject + +> **subject**: `FindingSubject` + +Defined in: [agent/improvement-adapter.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L49) + +Parsed subject; included so the apply step doesn't re-parse. + +##### target + +> **target**: [`ResolvedSurface`](#resolvedsurface) + +Defined in: [agent/improvement-adapter.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L51) + +Resolved on-disk target. + +##### baseSha256 + +> **baseSha256**: `string` + +Defined in: [agent/improvement-adapter.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L53) + +SHA-256 of the current file content the patch was drafted against. + +##### patch + +> **patch**: `string` + +Defined in: [agent/improvement-adapter.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L55) + +Unified-diff patch the LLM drafted (relative to `target.absolutePath`). + +##### summary + +> **summary**: `string` + +Defined in: [agent/improvement-adapter.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L57) + +One-line summary the operator sees in the report / PR title. + +##### rationale + +> **rationale**: `string` + +Defined in: [agent/improvement-adapter.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L59) + +Multi-line rationale for the PR body — finding context + LLM reasoning. + +##### confidence + +> **confidence**: `number` + +Defined in: [agent/improvement-adapter.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L61) + +Carry-forward from the finding so the apply gate can check the threshold. + +##### severity + +> **severity**: `AnalystSeverity` + +Defined in: [agent/improvement-adapter.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L63) + +Carry-forward severity for prioritization. + +*** + +### CreateSurfaceImprovementAdapterOpts + +Defined in: [agent/improvement-adapter.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L66) + +#### Properties + +##### surfaces + +> **surfaces**: [`AgentSurfaces`](#agentsurfaces) + +Defined in: [agent/improvement-adapter.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L67) + +##### repoRoot + +> **repoRoot**: `string` + +Defined in: [agent/improvement-adapter.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L68) + +##### draftPatch + +> **draftPatch**: (`input`) => `Promise`\<[`DraftPatchOutput`](#draftpatchoutput)\> + +Defined in: [agent/improvement-adapter.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L77) + +LLM-draft callback. Given a finding + current file content + the +resolved target, returns a unified-diff patch + summary + rationale. + +Required — the substrate doesn't ship a hardcoded prompt; the agent +author picks the model (Haiku for cheap routine drafts, Sonnet for +substantive prompt rewrites, etc.) via this callback. + +###### Parameters + +###### input + +[`DraftPatchInput`](#draftpatchinput) + +###### Returns + +`Promise`\<[`DraftPatchOutput`](#draftpatchoutput)\> + +##### mode? + +> `optional` **mode?**: `"none"` \| `"write"` \| `"open-pr"` + +Defined in: [agent/improvement-adapter.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L88) + +Apply mode: + `write` — `git apply` in-place; operator reviews via `git diff` + `open-pr` — branch + commit + push + `gh pr create` + `none` — never apply; collect proposals for the report only + +The `apply` method honours this even when the loop calls it; the +effective behaviour is also gated on the per-finding confidence +threshold via `runAnalystLoop`'s `autoApply` policy. + +##### baseBranch? + +> `optional` **baseBranch?**: `string` + +Defined in: [agent/improvement-adapter.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L90) + +When `mode === 'open-pr'`, the base branch new PRs target. Default: `main`. + +##### ghRepo? + +> `optional` **ghRepo?**: `string` + +Defined in: [agent/improvement-adapter.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L92) + +Required for `mode === 'open-pr'` — the GH owner/repo (`tangle-network/tax-agent`). + +##### allowCreateForKinds? + +> `optional` **allowCreateForKinds?**: readonly (`"knowledge.wiki"` \| `"knowledge.claim"` \| `"knowledge.raw"` \| `"knowledge.stale"` \| `"system-prompt"` \| `"tool-doc"` \| `"new-tool"` \| `"rag"` \| `"memory"` \| `"scaffolding"` \| `"output-schema"` \| `"websearch.outdated"` \| `"prior-run-summary"` \| `"cluster"`)[] + +Defined in: [agent/improvement-adapter.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L100) + +When the resolved target doesn't exist, allow the substrate to +CREATE the file (for `knowledge.wiki`, `new-tool` subjects). Default +true for those kinds, false for `system-prompt` / `rubric` / etc. +(named sections that don't exist are a contract violation, not a +scaffolding opportunity). + +*** + +### DraftPatchInput + +Defined in: [agent/improvement-adapter.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L103) + +#### Properties + +##### finding + +> **finding**: `AnalystFinding` + +Defined in: [agent/improvement-adapter.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L104) + +##### subject + +> **subject**: `FindingSubject` + +Defined in: [agent/improvement-adapter.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L105) + +##### target + +> **target**: [`ResolvedSurface`](#resolvedsurface) + +Defined in: [agent/improvement-adapter.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L106) + +##### currentContent + +> **currentContent**: `string` + +Defined in: [agent/improvement-adapter.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L108) + +Current file content (empty string when `intent === 'create-new'`). + +*** + +### DraftPatchOutput + +Defined in: [agent/improvement-adapter.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L111) + +#### Properties + +##### patch + +> **patch**: `string` + +Defined in: [agent/improvement-adapter.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L113) + +Unified diff against the current file content. Empty string skips this finding. + +##### summary + +> **summary**: `string` + +Defined in: [agent/improvement-adapter.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L115) + +One-line summary for the operator. + +##### rationale + +> **rationale**: `string` + +Defined in: [agent/improvement-adapter.ts:117](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L117) + +Multi-line rationale for the PR body. + +*** + +### CreateSurfaceKnowledgeAdapterOpts + +Defined in: [agent/knowledge-adapter.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/knowledge-adapter.ts#L21) + +#### Properties + +##### knowledgeRoot + +> **knowledgeRoot**: `string` + +Defined in: [agent/knowledge-adapter.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/knowledge-adapter.ts#L23) + +`.agent-knowledge/` root (absolute path the substrate writes blocks against). + +*** + +### KnowledgeAdapterDeps + +Defined in: [agent/knowledge-adapter.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/knowledge-adapter.ts#L40) + +Build the adapter. We accept the agent-knowledge functions as DI so +the substrate stays decoupled from a specific agent-knowledge +version — the agent author imports them in their manifest module +and hands them to the factory. + +`proposeFromFindings(findings)` returns + `{ proposals: KnowledgeProposal[]; skipped: number; errors: ... }`. + +`applyKnowledgeWriteBlocks(root, content)` returns + `{ written: string[]; warnings: string[] }`. + +`lintKnowledgeIndex(index)` (optional) returns `KnowledgeLintFinding[]`. + +#### Type Parameters + +##### TProposal + +`TProposal` + +#### Properties + +##### proposeFromFindings + +> **proposeFromFindings**: (`findings`) => `object` + +Defined in: [agent/knowledge-adapter.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/knowledge-adapter.ts#L41) + +###### Parameters + +###### findings + +readonly `AnalystFinding`[] + +###### Returns + +`object` + +###### proposals + +> **proposals**: `TProposal`[] + +###### skipped + +> **skipped**: `number` + +###### errors + +> **errors**: `object`[] + +##### applyKnowledgeWriteBlocks + +> **applyKnowledgeWriteBlocks**: (`root`, `proposalText`) => `Promise`\<\{ `written`: `string`[]; `warnings`: `string`[]; \}\> + +Defined in: [agent/knowledge-adapter.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/knowledge-adapter.ts#L46) + +###### Parameters + +###### root + +`string` + +###### proposalText + +`string` + +###### Returns + +`Promise`\<\{ `written`: `string`[]; `warnings`: `string`[]; \}\> + +##### lintAfterApply? + +> `optional` **lintAfterApply?**: (`root`) => `Promise`\ + +Defined in: [agent/knowledge-adapter.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/knowledge-adapter.ts#L55) + +Optional post-apply lint hook. The substrate runs it after each +batch of writes; failures land in `warnings` (the apply is not +rolled back — lint signals drift to review, not block). + +###### Parameters + +###### root + +`string` + +###### Returns + +`Promise`\ + +*** + +### OutcomeMeasurement + +Defined in: [agent/outcome.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L23) + +#### Properties + +##### baselineComposite + +> **baselineComposite**: `number` + +Defined in: [agent/outcome.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L25) + +Baseline composite before applies — captured from the most-recent eval run. + +##### afterComposite + +> **afterComposite**: `number` + +Defined in: [agent/outcome.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L27) + +Composite after re-running the cohort with applied edits. + +##### delta + +> **delta**: `number` + +Defined in: [agent/outcome.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L29) + +`afterComposite - baselineComposite`. Positive = the loop improved the agent. + +##### perPersona + +> **perPersona**: readonly `object`[] + +Defined in: [agent/outcome.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L31) + +Per-persona deltas for finer-grained review. + +##### rolledBackPaths + +> **rolledBackPaths**: readonly `string`[] + +Defined in: [agent/outcome.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L33) + +When the substrate rolled back applies due to regression, the paths reverted. + +*** + +### OutcomeMeasurementOpts + +Defined in: [agent/outcome.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L36) + +#### Properties + +##### baseline + +> **baseline**: readonly `object`[] + +Defined in: [agent/outcome.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L38) + +Composite scores from the run that produced the findings. + +##### reRunCohort + +> **reRunCohort**: (`personaIds`) => `Promise`\ + +Defined in: [agent/outcome.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L47) + +Re-run callback — the substrate invokes this after applies. The +agent author provides their `runAgentEval`-equivalent so the +substrate can ask "score this persona slice now." + +The callback SHOULD reuse the same cohort + judges + variant as +the baseline run; only the agent's mutable surfaces have changed. + +###### Parameters + +###### personaIds + +readonly `string`[] + +###### Returns + +`Promise`\ + +##### rollbackOnRegression? + +> `optional` **rollbackOnRegression?**: `boolean` + +Defined in: [agent/outcome.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L51) + +When `true`, applied edits are reverted on negative delta. Default `false`. + +##### revert? + +> `optional` **revert?**: (`paths`) => `Promise`\<`void`\> + +Defined in: [agent/outcome.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L53) + +Callback to revert a list of paths (typically `git checkout HEAD --`). + +###### Parameters + +###### paths + +readonly `string`[] + +###### Returns + +`Promise`\<`void`\> + +*** + +### CreateSandboxActOptions + +Defined in: [agent/sandbox-act.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L28) + +#### Type Parameters + +##### TPersona + +`TPersona` + +##### TRunOutput + +`TRunOutput` + +#### Properties + +##### baseProfile + +> **baseProfile**: `AgentProfile` + +Defined in: [agent/sandbox-act.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L30) + +Canonical agent profile — the same one the prod chat turn composes from. + +##### sandboxClient + +> **sandboxClient**: [`SandboxClient`](runtime.md#sandboxclient-2) + +Defined in: [agent/sandbox-act.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L32) + +Sandbox client used to boot the per-run sandbox. + +##### buildPrompt + +> **buildPrompt**: (`persona`) => `string` + +Defined in: [agent/sandbox-act.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L34) + +Persona → prompt. Pure; the eval cell's input. + +###### Parameters + +###### persona + +`TPersona` + +###### Returns + +`string` + +##### output + +> **output**: [`OutputAdapter`](runtime.md#outputadapter)\<`TRunOutput`\> + +Defined in: [agent/sandbox-act.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L36) + +Sandbox event stream → typed output the rubric scores. + +##### compose? + +> `optional` **compose?**: (`persona`) => [`ComposeProductionAgentProfileOptions`](mcp.md#composeproductionagentprofileoptions) + +Defined in: [agent/sandbox-act.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L43) + +Per-persona composition overrides (workspace-augmented system prompt, +extra file mounts, sandbox key). Merged into +[composeProductionAgentProfile](mcp.md#composeproductionagentprofile); `env` here is overridden by the +top-level `env` option when both are set. + +###### Parameters + +###### persona + +`TPersona` + +###### Returns + +[`ComposeProductionAgentProfileOptions`](mcp.md#composeproductionagentprofileoptions) + +##### sandboxOverrides? + +> `optional` **sandboxOverrides?**: `Partial`\<`Omit`\<`CreateSandboxOptions`, `"backend"`\>\> & `object` + +Defined in: [agent/sandbox-act.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L45) + +Sandbox-SDK overrides forwarded to `createSandboxForSpec`. + +###### Type Declaration + +###### backend? + +> `optional` **backend?**: `Omit`\<`BackendConfig`, `"profile"`\> + +##### name? + +> `optional` **name?**: `string` + +Defined in: [agent/sandbox-act.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L47) + +Stable run name surfaced in mapped `llm_call` events. + +##### mapEvent? + +> `optional` **mapEvent?**: (`event`, `opts`) => [`RuntimeStreamEvent`](index.md#runtimestreamevent) \| `undefined` + +Defined in: [agent/sandbox-act.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L49) + +Override the `SandboxEvent → RuntimeStreamEvent` mapper. + +###### Parameters + +###### event + +`SandboxEvent` + +###### opts + +###### agentRunName? + +`string` + +###### Returns + +[`RuntimeStreamEvent`](index.md#runtimestreamevent) \| `undefined` + +##### env? + +> `optional` **env?**: `Record`\<`string`, `string` \| `undefined`\> + +Defined in: [agent/sandbox-act.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L54) + +Environment source for delegation-MCP composition. Defaults to `process.env`. + +*** + +### AgentSurfaces + +Defined in: [agent/surfaces.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L37) + +Surface declarations. Every path is repo-relative (or absolute) at +`defineAgent` time. At resolution time, paths are joined against the +agent's `repoRoot`. + +`systemPrompt`, `tools`, `personas` are DIRECTORIES; the loop appends +`
.md`, `/README.md`, `.yaml` etc. +`rubric`, `outputSchema` are SINGLE FILES; the loop edits them in +place. + +`knowledge` is the agent-knowledge root (typically `.agent-knowledge`); +`applyKnowledgeWriteBlocks` writes pages relative to it. + +Optional surfaces (`scaffolding`, `memory`, `rag`, `outputSchema`) +can be omitted — the loop will reject findings targeting them with a +clear log message instead of fabricating a path. + +#### Properties + +##### systemPrompt + +> **systemPrompt**: `string` + +Defined in: [agent/surfaces.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L39) + +Directory containing one markdown file per system-prompt section. + +##### tools + +> **tools**: `string` + +Defined in: [agent/surfaces.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L41) + +Directory containing one subdir per tool (`/README.md`). + +##### rubric + +> **rubric**: `string` + +Defined in: [agent/surfaces.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L43) + +Single file (TypeScript module) defining the rubric weights + dimensions. + +##### knowledge + +> **knowledge**: `string` + +Defined in: [agent/surfaces.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L45) + +Knowledge-base root; typically `.agent-knowledge`. + +##### personas + +> **personas**: `string` + +Defined in: [agent/surfaces.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L47) + +Directory containing one YAML/JSON file per persona. + +##### scaffolding? + +> `optional` **scaffolding?**: `string` + +Defined in: [agent/surfaces.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L49) + +Optional: directory containing scaffolding rules (precondition checks, retry policies). + +##### memory? + +> `optional` **memory?**: `string` + +Defined in: [agent/surfaces.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L51) + +Optional: memory store path (JSONL / SQLite / DB). + +##### rag? + +> `optional` **rag?**: `string` + +Defined in: [agent/surfaces.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L53) + +Optional: directory containing RAG corpora (`/.md`). + +##### outputSchema? + +> `optional` **outputSchema?**: `string` + +Defined in: [agent/surfaces.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L55) + +Optional: single file defining the output schema (Zod / JSON Schema). + +*** + +### ResolvedSurface + +Defined in: [agent/surfaces.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L58) + +#### Properties + +##### absolutePath + +> **absolutePath**: `string` + +Defined in: [agent/surfaces.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L60) + +Absolute filesystem path the operator can `cat` / `vim`. + +##### repoRelativePath + +> **repoRelativePath**: `string` + +Defined in: [agent/surfaces.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L62) + +Repo-relative path for PR descriptions, diffs, audit logs. + +##### exists + +> **exists**: `boolean` + +Defined in: [agent/surfaces.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L64) + +Whether the path currently exists on disk. + +##### intent + +> **intent**: `"edit-existing"` \| `"create-new"` + +Defined in: [agent/surfaces.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L66) + +The substrate's intent: edit an existing file or create a new one. + +*** + +### SurfaceValidationIssue + +Defined in: [agent/surfaces.ts:191](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L191) + +Validate that every declared surface exists on disk under `repoRoot`. + +Returns an array of `SurfaceValidationIssue` — empty when all required +surfaces resolve. `defineAgent` throws with the issues rendered, so +a misconfigured manifest fails at startup (not at the first finding +the loop produces 20 minutes later). + +#### Properties + +##### surface + +> **surface**: keyof [`AgentSurfaces`](#agentsurfaces) + +Defined in: [agent/surfaces.ts:192](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L192) + +##### path + +> **path**: `string` + +Defined in: [agent/surfaces.ts:193](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L193) + +##### reason + +> **reason**: `"missing"` \| `"not-directory"` \| `"not-file"` + +Defined in: [agent/surfaces.ts:194](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L194) + +## Functions + +### unimplementedAgentRun() + +> **unimplementedAgentRun**\<`TRunOutput`\>(`reason?`): [`AgentRunInvocation`](#agentruninvocation)\<`TRunOutput`\> + +Defined in: [agent/define-agent.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L203) + +Stub for agents whose `runtime.act` is not yet wired to the substrate's +eval path. Preserves the streaming contract (empty event stream + a +rejected `output` promise that tells the caller exactly what to fix). + +Per-vertical manifests usually start with this stub and replace it with +the agent's real streaming runtime (`runChatTurn` or equivalent) once +the eval path consumes the manifest end-to-end. + +#### Type Parameters + +##### TRunOutput + +`TRunOutput` = `unknown` + +#### Parameters + +##### reason? + +`string` = `'AgentRuntime.act is not yet wired for this manifest'` + +#### Returns + +[`AgentRunInvocation`](#agentruninvocation)\<`TRunOutput`\> + +*** + +### collectAgentRun() + +> **collectAgentRun**\<`TRunOutput`\>(`invocation`): `Promise`\<\{ `events`: readonly [`RuntimeStreamEvent`](index.md#runtimestreamevent)[]; `output`: `TRunOutput`; \}\> + +Defined in: [agent/define-agent.ts:222](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L222) + +Drain `act`'s `events` into an array AND await its `output`. Useful for +eval / outcome-measurement code paths that don't care about live +rendering. The events array is preserved so the substrate can inspect +tool calls / readiness / questions retrospectively. + +IMPORTANT: chat-centric UX MUST NOT call this — it defeats streaming +(no incremental render). Use `for await (const ev of invocation.events)` +directly in the chat surface. + +#### Type Parameters + +##### TRunOutput + +`TRunOutput` + +#### Parameters + +##### invocation + +[`AgentRunInvocation`](#agentruninvocation)\<`TRunOutput`\> + +#### Returns + +`Promise`\<\{ `events`: readonly [`RuntimeStreamEvent`](index.md#runtimestreamevent)[]; `output`: `TRunOutput`; \}\> + +*** + +### defineAgent() + +> **defineAgent**\<`TPersona`, `TRunOutput`\>(`manifest`): [`AgentManifest`](#agentmanifest)\<`TPersona`, `TRunOutput`\> + +Defined in: [agent/define-agent.ts:296](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L296) + +Construct a validated agent manifest. Throws `AgentManifestError` +if any required surface is missing on disk. + +Generics: pass your persona / output types if you want narrowed +`runtime.act` signatures: + `defineAgent({ ... })` + +Most callers don't need the generics — the substrate operates on +`unknown` payloads internally and the manifest's `score` / +`runtime.act` see the typed shapes via TypeScript inference at +the call site. + +#### Type Parameters + +##### TPersona + +`TPersona` = `unknown` + +##### TRunOutput + +`TRunOutput` = `unknown` + +#### Parameters + +##### manifest + +[`AgentManifest`](#agentmanifest)\<`TPersona`, `TRunOutput`\> + +#### Returns + +[`AgentManifest`](#agentmanifest)\<`TPersona`, `TRunOutput`\> + +*** + +### createSurfaceImprovementAdapter() + +> **createSurfaceImprovementAdapter**(`opts`): [`ImprovementAdapter`](analyst-loop.md#improvementadapter)\<[`SurfaceImprovementEdit`](#surfaceimprovementedit)\> + +Defined in: [agent/improvement-adapter.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L129) + +#### Parameters + +##### opts + +[`CreateSurfaceImprovementAdapterOpts`](#createsurfaceimprovementadapteropts) + +#### Returns + +[`ImprovementAdapter`](analyst-loop.md#improvementadapter)\<[`SurfaceImprovementEdit`](#surfaceimprovementedit)\> + +*** + +### createSurfaceKnowledgeAdapter() + +> **createSurfaceKnowledgeAdapter**\<`TProposal`\>(`opts`, `deps`): [`KnowledgeAdapter`](analyst-loop.md#knowledgeadapter)\<`TProposal`\> + +Defined in: [agent/knowledge-adapter.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/knowledge-adapter.ts#L58) + +#### Type Parameters + +##### TProposal + +`TProposal` + +#### Parameters + +##### opts + +[`CreateSurfaceKnowledgeAdapterOpts`](#createsurfaceknowledgeadapteropts) + +##### deps + +[`KnowledgeAdapterDeps`](#knowledgeadapterdeps)\<`TProposal`\> + +#### Returns + +[`KnowledgeAdapter`](analyst-loop.md#knowledgeadapter)\<`TProposal`\> + +*** + +### measureOutcome() + +> **measureOutcome**\<`TProposal`, `TEdit`\>(`result`, `opts`): `Promise`\<[`RunAnalystLoopResult`](analyst-loop.md#runanalystloopresult)\<`TProposal`, `TEdit`\> & `object`\> + +Defined in: [agent/outcome.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L65) + +Run `runAnalystLoop` and stamp an `OutcomeMeasurement` onto the +result. The substrate calls this after each canonical eval; the +delta lands in `loop-report.json` for cross-run trend analysis. + +The function returns the original `RunAnalystLoopResult` enriched +with `outcome` so callers stay backwards-compatible (the field is +optional on the type; missing means no measurement was wired). + +#### Type Parameters + +##### TProposal + +`TProposal` + +##### TEdit + +`TEdit` + +#### Parameters + +##### result + +[`RunAnalystLoopResult`](analyst-loop.md#runanalystloopresult)\<`TProposal`, `TEdit`\> + +##### opts + +[`OutcomeMeasurementOpts`](#outcomemeasurementopts) + +#### Returns + +`Promise`\<[`RunAnalystLoopResult`](analyst-loop.md#runanalystloopresult)\<`TProposal`, `TEdit`\> & `object`\> + +*** + +### createSandboxAct() + +> **createSandboxAct**\<`TPersona`, `TRunOutput`\>(`options`): (`persona`, `ctx`) => [`AgentRunInvocation`](#agentruninvocation)\<`TRunOutput`\> + +Defined in: [agent/sandbox-act.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L63) + +Build an `AgentRuntime.act` implementation backed by a single prod-profile +sandbox run. The returned function honours the `act` contract: it returns +synchronously with a live `events` iterator and an `output` promise that +resolves only after the iterator drains. + +#### Type Parameters + +##### TPersona + +`TPersona` + +##### TRunOutput + +`TRunOutput` + +#### Parameters + +##### options + +[`CreateSandboxActOptions`](#createsandboxactoptions)\<`TPersona`, `TRunOutput`\> + +#### Returns + +(`persona`, `ctx`) => [`AgentRunInvocation`](#agentruninvocation)\<`TRunOutput`\> + +*** + +### resolveSubjectPath() + +> **resolveSubjectPath**(`subject`, `surfaces`, `repoRoot`): [`ResolvedSurface`](#resolvedsurface) \| `null` + +Defined in: [agent/surfaces.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L86) + +Resolve a parsed `FindingSubject` to the file path the substrate +should edit (or create) on disk. + +Returns `null` when: + - the subject targets a surface the agent didn't declare + (e.g. `rag:*` when `surfaces.rag` is undefined), OR + - the subject is a `cluster` (failure-mode emits these as evidence, + not actionable mutations — they don't route to a file). + +Returns a `ResolvedSurface` with `intent: 'create-new'` when the +subject names a path that doesn't yet exist (e.g. a new wiki page). +The caller chooses whether to honour the create — for tightly-managed +surfaces like `systemPrompt` it's usually a contract violation +(the analyst named a section that doesn't exist); for `knowledge` +it's the whole point. + +#### Parameters + +##### subject + +`FindingSubject` + +##### surfaces + +[`AgentSurfaces`](#agentsurfaces) + +##### repoRoot + +`string` + +#### Returns + +[`ResolvedSurface`](#resolvedsurface) \| `null` + +*** + +### validateSurfaces() + +> **validateSurfaces**(`surfaces`, `repoRoot`): readonly [`SurfaceValidationIssue`](#surfacevalidationissue)[] + +Defined in: [agent/surfaces.ts:197](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L197) + +#### Parameters + +##### surfaces + +[`AgentSurfaces`](#agentsurfaces) + +##### repoRoot + +`string` + +#### Returns + +readonly [`SurfaceValidationIssue`](#surfacevalidationissue)[] + +*** + +### renderSurfaceIssues() + +> **renderSurfaceIssues**(`issues`, `repoRoot`): `string` + +Defined in: [agent/surfaces.ts:245](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L245) + +#### Parameters + +##### issues + +readonly [`SurfaceValidationIssue`](#surfacevalidationissue)[] + +##### repoRoot + +`string` + +#### Returns + +`string` diff --git a/docs/api/agent/README.md b/docs/api/agent/README.md deleted file mode 100644 index da4ce29..0000000 --- a/docs/api/agent/README.md +++ /dev/null @@ -1,48 +0,0 @@ -[**@tangle-network/agent-runtime**](../README.md) - -*** - -[@tangle-network/agent-runtime](../README.md) / agent - -# agent - -## Classes - -- [AgentManifestError](classes/AgentManifestError.md) - -## Interfaces - -- [AgentManifest](interfaces/AgentManifest.md) -- [AgentRubric](interfaces/AgentRubric.md) -- [RubricDimension](interfaces/RubricDimension.md) -- [JudgeConfig](interfaces/JudgeConfig.md) -- [AgentRuntime](interfaces/AgentRuntime.md) -- [AgentRunInvocation](interfaces/AgentRunInvocation.md) -- [AgentRunContext](interfaces/AgentRunContext.md) -- [AnalystConfig](interfaces/AnalystConfig.md) -- [AutoApplyPolicy](interfaces/AutoApplyPolicy.md) -- [SurfaceImprovementEdit](interfaces/SurfaceImprovementEdit.md) -- [CreateSurfaceImprovementAdapterOpts](interfaces/CreateSurfaceImprovementAdapterOpts.md) -- [DraftPatchInput](interfaces/DraftPatchInput.md) -- [DraftPatchOutput](interfaces/DraftPatchOutput.md) -- [CreateSurfaceKnowledgeAdapterOpts](interfaces/CreateSurfaceKnowledgeAdapterOpts.md) -- [KnowledgeAdapterDeps](interfaces/KnowledgeAdapterDeps.md) -- [OutcomeMeasurement](interfaces/OutcomeMeasurement.md) -- [OutcomeMeasurementOpts](interfaces/OutcomeMeasurementOpts.md) -- [CreateSandboxActOptions](interfaces/CreateSandboxActOptions.md) -- [AgentSurfaces](interfaces/AgentSurfaces.md) -- [ResolvedSurface](interfaces/ResolvedSurface.md) -- [SurfaceValidationIssue](interfaces/SurfaceValidationIssue.md) - -## Functions - -- [unimplementedAgentRun](functions/unimplementedAgentRun.md) -- [collectAgentRun](functions/collectAgentRun.md) -- [defineAgent](functions/defineAgent.md) -- [createSurfaceImprovementAdapter](functions/createSurfaceImprovementAdapter.md) -- [createSurfaceKnowledgeAdapter](functions/createSurfaceKnowledgeAdapter.md) -- [measureOutcome](functions/measureOutcome.md) -- [createSandboxAct](functions/createSandboxAct.md) -- [resolveSubjectPath](functions/resolveSubjectPath.md) -- [validateSurfaces](functions/validateSurfaces.md) -- [renderSurfaceIssues](functions/renderSurfaceIssues.md) diff --git a/docs/api/agent/classes/AgentManifestError.md b/docs/api/agent/classes/AgentManifestError.md deleted file mode 100644 index a808482..0000000 --- a/docs/api/agent/classes/AgentManifestError.md +++ /dev/null @@ -1,59 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / AgentManifestError - -# Class: AgentManifestError - -Defined in: [agent/define-agent.ts:272](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L272) - -## Extends - -- `Error` - -## Constructors - -### Constructor - -> **new AgentManifestError**(`message`, `agentId`, `issues?`): `AgentManifestError` - -Defined in: [agent/define-agent.ts:273](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L273) - -#### Parameters - -##### message - -`string` - -##### agentId - -`string` - -##### issues? - -readonly `unknown`[] = `[]` - -#### Returns - -`AgentManifestError` - -#### Overrides - -`Error.constructor` - -## Properties - -### agentId - -> `readonly` **agentId**: `string` - -Defined in: [agent/define-agent.ts:275](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L275) - -*** - -### issues - -> `readonly` **issues**: readonly `unknown`[] = `[]` - -Defined in: [agent/define-agent.ts:276](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L276) diff --git a/docs/api/agent/functions/collectAgentRun.md b/docs/api/agent/functions/collectAgentRun.md deleted file mode 100644 index 4904a7c..0000000 --- a/docs/api/agent/functions/collectAgentRun.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / collectAgentRun - -# Function: collectAgentRun() - -> **collectAgentRun**\<`TRunOutput`\>(`invocation`): `Promise`\<\{ `events`: readonly [`RuntimeStreamEvent`](../../index/type-aliases/RuntimeStreamEvent.md)[]; `output`: `TRunOutput`; \}\> - -Defined in: [agent/define-agent.ts:222](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L222) - -Drain `act`'s `events` into an array AND await its `output`. Useful for -eval / outcome-measurement code paths that don't care about live -rendering. The events array is preserved so the substrate can inspect -tool calls / readiness / questions retrospectively. - -IMPORTANT: chat-centric UX MUST NOT call this — it defeats streaming -(no incremental render). Use `for await (const ev of invocation.events)` -directly in the chat surface. - -## Type Parameters - -### TRunOutput - -`TRunOutput` - -## Parameters - -### invocation - -[`AgentRunInvocation`](../interfaces/AgentRunInvocation.md)\<`TRunOutput`\> - -## Returns - -`Promise`\<\{ `events`: readonly [`RuntimeStreamEvent`](../../index/type-aliases/RuntimeStreamEvent.md)[]; `output`: `TRunOutput`; \}\> diff --git a/docs/api/agent/functions/createSandboxAct.md b/docs/api/agent/functions/createSandboxAct.md deleted file mode 100644 index d186ea8..0000000 --- a/docs/api/agent/functions/createSandboxAct.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / createSandboxAct - -# Function: createSandboxAct() - -> **createSandboxAct**\<`TPersona`, `TRunOutput`\>(`options`): (`persona`, `ctx`) => [`AgentRunInvocation`](../interfaces/AgentRunInvocation.md)\<`TRunOutput`\> - -Defined in: [agent/sandbox-act.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L63) - -Build an `AgentRuntime.act` implementation backed by a single prod-profile -sandbox run. The returned function honours the `act` contract: it returns -synchronously with a live `events` iterator and an `output` promise that -resolves only after the iterator drains. - -## Type Parameters - -### TPersona - -`TPersona` - -### TRunOutput - -`TRunOutput` - -## Parameters - -### options - -[`CreateSandboxActOptions`](../interfaces/CreateSandboxActOptions.md)\<`TPersona`, `TRunOutput`\> - -## Returns - -(`persona`, `ctx`) => [`AgentRunInvocation`](../interfaces/AgentRunInvocation.md)\<`TRunOutput`\> diff --git a/docs/api/agent/functions/createSurfaceImprovementAdapter.md b/docs/api/agent/functions/createSurfaceImprovementAdapter.md deleted file mode 100644 index bacf540..0000000 --- a/docs/api/agent/functions/createSurfaceImprovementAdapter.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / createSurfaceImprovementAdapter - -# Function: createSurfaceImprovementAdapter() - -> **createSurfaceImprovementAdapter**(`opts`): [`ImprovementAdapter`](../../analyst-loop/interfaces/ImprovementAdapter.md)\<[`SurfaceImprovementEdit`](../interfaces/SurfaceImprovementEdit.md)\> - -Defined in: [agent/improvement-adapter.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L129) - -## Parameters - -### opts - -[`CreateSurfaceImprovementAdapterOpts`](../interfaces/CreateSurfaceImprovementAdapterOpts.md) - -## Returns - -[`ImprovementAdapter`](../../analyst-loop/interfaces/ImprovementAdapter.md)\<[`SurfaceImprovementEdit`](../interfaces/SurfaceImprovementEdit.md)\> diff --git a/docs/api/agent/functions/createSurfaceKnowledgeAdapter.md b/docs/api/agent/functions/createSurfaceKnowledgeAdapter.md deleted file mode 100644 index 975ffb1..0000000 --- a/docs/api/agent/functions/createSurfaceKnowledgeAdapter.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / createSurfaceKnowledgeAdapter - -# Function: createSurfaceKnowledgeAdapter() - -> **createSurfaceKnowledgeAdapter**\<`TProposal`\>(`opts`, `deps`): [`KnowledgeAdapter`](../../analyst-loop/interfaces/KnowledgeAdapter.md)\<`TProposal`\> - -Defined in: [agent/knowledge-adapter.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/knowledge-adapter.ts#L58) - -## Type Parameters - -### TProposal - -`TProposal` - -## Parameters - -### opts - -[`CreateSurfaceKnowledgeAdapterOpts`](../interfaces/CreateSurfaceKnowledgeAdapterOpts.md) - -### deps - -[`KnowledgeAdapterDeps`](../interfaces/KnowledgeAdapterDeps.md)\<`TProposal`\> - -## Returns - -[`KnowledgeAdapter`](../../analyst-loop/interfaces/KnowledgeAdapter.md)\<`TProposal`\> diff --git a/docs/api/agent/functions/defineAgent.md b/docs/api/agent/functions/defineAgent.md deleted file mode 100644 index 031aec9..0000000 --- a/docs/api/agent/functions/defineAgent.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / defineAgent - -# Function: defineAgent() - -> **defineAgent**\<`TPersona`, `TRunOutput`\>(`manifest`): [`AgentManifest`](../interfaces/AgentManifest.md)\<`TPersona`, `TRunOutput`\> - -Defined in: [agent/define-agent.ts:296](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L296) - -Construct a validated agent manifest. Throws `AgentManifestError` -if any required surface is missing on disk. - -Generics: pass your persona / output types if you want narrowed -`runtime.act` signatures: - `defineAgent({ ... })` - -Most callers don't need the generics — the substrate operates on -`unknown` payloads internally and the manifest's `score` / -`runtime.act` see the typed shapes via TypeScript inference at -the call site. - -## Type Parameters - -### TPersona - -`TPersona` = `unknown` - -### TRunOutput - -`TRunOutput` = `unknown` - -## Parameters - -### manifest - -[`AgentManifest`](../interfaces/AgentManifest.md)\<`TPersona`, `TRunOutput`\> - -## Returns - -[`AgentManifest`](../interfaces/AgentManifest.md)\<`TPersona`, `TRunOutput`\> diff --git a/docs/api/agent/functions/measureOutcome.md b/docs/api/agent/functions/measureOutcome.md deleted file mode 100644 index 64e0e3a..0000000 --- a/docs/api/agent/functions/measureOutcome.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / measureOutcome - -# Function: measureOutcome() - -> **measureOutcome**\<`TProposal`, `TEdit`\>(`result`, `opts`): `Promise`\<[`RunAnalystLoopResult`](../../analyst-loop/interfaces/RunAnalystLoopResult.md)\<`TProposal`, `TEdit`\> & `object`\> - -Defined in: [agent/outcome.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L65) - -Run `runAnalystLoop` and stamp an `OutcomeMeasurement` onto the -result. The substrate calls this after each canonical eval; the -delta lands in `loop-report.json` for cross-run trend analysis. - -The function returns the original `RunAnalystLoopResult` enriched -with `outcome` so callers stay backwards-compatible (the field is -optional on the type; missing means no measurement was wired). - -## Type Parameters - -### TProposal - -`TProposal` - -### TEdit - -`TEdit` - -## Parameters - -### result - -[`RunAnalystLoopResult`](../../analyst-loop/interfaces/RunAnalystLoopResult.md)\<`TProposal`, `TEdit`\> - -### opts - -[`OutcomeMeasurementOpts`](../interfaces/OutcomeMeasurementOpts.md) - -## Returns - -`Promise`\<[`RunAnalystLoopResult`](../../analyst-loop/interfaces/RunAnalystLoopResult.md)\<`TProposal`, `TEdit`\> & `object`\> diff --git a/docs/api/agent/functions/renderSurfaceIssues.md b/docs/api/agent/functions/renderSurfaceIssues.md deleted file mode 100644 index 0134432..0000000 --- a/docs/api/agent/functions/renderSurfaceIssues.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / renderSurfaceIssues - -# Function: renderSurfaceIssues() - -> **renderSurfaceIssues**(`issues`, `repoRoot`): `string` - -Defined in: [agent/surfaces.ts:245](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L245) - -## Parameters - -### issues - -readonly [`SurfaceValidationIssue`](../interfaces/SurfaceValidationIssue.md)[] - -### repoRoot - -`string` - -## Returns - -`string` diff --git a/docs/api/agent/functions/resolveSubjectPath.md b/docs/api/agent/functions/resolveSubjectPath.md deleted file mode 100644 index 56192a8..0000000 --- a/docs/api/agent/functions/resolveSubjectPath.md +++ /dev/null @@ -1,45 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / resolveSubjectPath - -# Function: resolveSubjectPath() - -> **resolveSubjectPath**(`subject`, `surfaces`, `repoRoot`): [`ResolvedSurface`](../interfaces/ResolvedSurface.md) \| `null` - -Defined in: [agent/surfaces.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L86) - -Resolve a parsed `FindingSubject` to the file path the substrate -should edit (or create) on disk. - -Returns `null` when: - - the subject targets a surface the agent didn't declare - (e.g. `rag:*` when `surfaces.rag` is undefined), OR - - the subject is a `cluster` (failure-mode emits these as evidence, - not actionable mutations — they don't route to a file). - -Returns a `ResolvedSurface` with `intent: 'create-new'` when the -subject names a path that doesn't yet exist (e.g. a new wiki page). -The caller chooses whether to honour the create — for tightly-managed -surfaces like `systemPrompt` it's usually a contract violation -(the analyst named a section that doesn't exist); for `knowledge` -it's the whole point. - -## Parameters - -### subject - -`FindingSubject` - -### surfaces - -[`AgentSurfaces`](../interfaces/AgentSurfaces.md) - -### repoRoot - -`string` - -## Returns - -[`ResolvedSurface`](../interfaces/ResolvedSurface.md) \| `null` diff --git a/docs/api/agent/functions/unimplementedAgentRun.md b/docs/api/agent/functions/unimplementedAgentRun.md deleted file mode 100644 index 0efe221..0000000 --- a/docs/api/agent/functions/unimplementedAgentRun.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / unimplementedAgentRun - -# Function: unimplementedAgentRun() - -> **unimplementedAgentRun**\<`TRunOutput`\>(`reason?`): [`AgentRunInvocation`](../interfaces/AgentRunInvocation.md)\<`TRunOutput`\> - -Defined in: [agent/define-agent.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L203) - -Stub for agents whose `runtime.act` is not yet wired to the substrate's -eval path. Preserves the streaming contract (empty event stream + a -rejected `output` promise that tells the caller exactly what to fix). - -Per-vertical manifests usually start with this stub and replace it with -the agent's real streaming runtime (`runChatTurn` or equivalent) once -the eval path consumes the manifest end-to-end. - -## Type Parameters - -### TRunOutput - -`TRunOutput` = `unknown` - -## Parameters - -### reason? - -`string` = `'AgentRuntime.act is not yet wired for this manifest'` - -## Returns - -[`AgentRunInvocation`](../interfaces/AgentRunInvocation.md)\<`TRunOutput`\> diff --git a/docs/api/agent/functions/validateSurfaces.md b/docs/api/agent/functions/validateSurfaces.md deleted file mode 100644 index fd8705c..0000000 --- a/docs/api/agent/functions/validateSurfaces.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / validateSurfaces - -# Function: validateSurfaces() - -> **validateSurfaces**(`surfaces`, `repoRoot`): readonly [`SurfaceValidationIssue`](../interfaces/SurfaceValidationIssue.md)[] - -Defined in: [agent/surfaces.ts:197](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L197) - -## Parameters - -### surfaces - -[`AgentSurfaces`](../interfaces/AgentSurfaces.md) - -### repoRoot - -`string` - -## Returns - -readonly [`SurfaceValidationIssue`](../interfaces/SurfaceValidationIssue.md)[] diff --git a/docs/api/agent/interfaces/AgentManifest.md b/docs/api/agent/interfaces/AgentManifest.md deleted file mode 100644 index 4b11fe3..0000000 --- a/docs/api/agent/interfaces/AgentManifest.md +++ /dev/null @@ -1,159 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / AgentManifest - -# Interface: AgentManifest\ - -Defined in: [agent/define-agent.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L35) - -The full agent manifest. Each agent ships ONE of these. - -Generics: - `TPersona` — the agent's persona shape (loaded from - `surfaces.personas`). Defaults to `unknown` so the substrate's - persona discovery (`loadPersonas`) can accept anything; per-agent - code re-narrows when it matters. - `TRunOutput` — the shape `runtime.act` returns. Used by the rubric - scorers and emitted into the trace. - -## Type Parameters - -### TPersona - -`TPersona` = `unknown` - -### TRunOutput - -`TRunOutput` = `unknown` - -## Properties - -### id - -> **id**: `string` - -Defined in: [agent/define-agent.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L42) - -Stable identifier — used as `projectId` in traces, as the analyst -loop's `runId` prefix, and as the namespace under which findings -are persisted. MUST match the agent's repo name to keep -cross-repo telemetry joinable. - -*** - -### repoRoot - -> **repoRoot**: `string` - -Defined in: [agent/define-agent.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L50) - -Filesystem root the substrate resolves surface paths against. -Typically `process.cwd()` or a fixed absolute path. Use an -absolute path when the agent's tests may run from subdirectories -(vitest sometimes shifts cwd). - -*** - -### surfaces - -> **surfaces**: [`AgentSurfaces`](AgentSurfaces.md) - -Defined in: [agent/define-agent.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L61) - -Map of mutable surfaces the self-improvement loop can edit. See -`AgentSurfaces` — required: `systemPrompt`, `tools`, `rubric`, -`knowledge`, `personas`. Optional: `scaffolding`, `memory`, `rag`, -`outputSchema`. - -Every required path is validated at `defineAgent` time. Missing -paths throw with the full list of offenders. - -*** - -### rubric - -> **rubric**: [`AgentRubric`](AgentRubric.md)\<`TRunOutput`\> - -Defined in: [agent/define-agent.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L68) - -Rubric the substrate uses to score each run. Dimensions × weights -× judges. The substrate computes the weighted composite and -stamps it into the RunRecord. - -*** - -### runtime - -> **runtime**: [`AgentRuntime`](AgentRuntime.md)\<`TPersona`, `TRunOutput`\> - -Defined in: [agent/define-agent.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L79) - -Runtime adapter — how the substrate INVOKES the agent against a -persona. The `act` function takes a persona + a context (with the -tracer the substrate threads through for span emission) and -returns the run output the rubric will score. - -The agent's existing production runtime goes in here; the -substrate is intentionally thin around it. - -*** - -### personas - -> **personas**: () => `Promise`\ - -Defined in: [agent/define-agent.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L87) - -Persona discovery — the substrate loads personas via this function -at eval start. Can read from `surfaces.personas`, an API, or be -hardcoded. The substrate calls it once per `runAgentEval` call; -persona ordering is preserved. - -#### Returns - -`Promise`\ - -*** - -### analystKinds - -> **analystKinds**: readonly `TraceAnalystKindSpec`[] - -Defined in: [agent/define-agent.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L97) - -Analyst kinds the substrate runs against each persona's trace. -Defaults to `DEFAULT_TRACE_ANALYST_KINDS` from agent-eval. Per-agent -authors can prune (e.g. skip `knowledge-poisoning` when there's no -knowledge base) or extend (custom domain kinds). - -Empty array disables the loop — useful for `pnpm eval --no-analyst`. - -*** - -### analyst - -> **analyst**: [`AnalystConfig`](AnalystConfig.md) - -Defined in: [agent/define-agent.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L103) - -Analyst LLM configuration. The substrate uses these for all four -kinds (override per-kind via `analystKinds` if needed). - -*** - -### autoApply? - -> `optional` **autoApply?**: [`AutoApplyPolicy`](AutoApplyPolicy.md) - -Defined in: [agent/define-agent.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L115) - -Auto-apply policy. Knowledge / improvement edits land only when -`enabled === true` AND the source finding's confidence meets the -threshold. `mode` controls how applies happen: `'write'` mutates -files in-place; `'open-pr'` writes to a branch and opens a PR. - -Default: knowledge auto-applies at confidence ≥0.85 in `'write'` -mode (wiki edits are git-reversible); improvement stays at -`enabled: false` until the agent author has measured precision. diff --git a/docs/api/agent/interfaces/AgentRubric.md b/docs/api/agent/interfaces/AgentRubric.md deleted file mode 100644 index f3a5272..0000000 --- a/docs/api/agent/interfaces/AgentRubric.md +++ /dev/null @@ -1,45 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / AgentRubric - -# Interface: AgentRubric\ - -Defined in: [agent/define-agent.ts:118](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L118) - -`@tangle-network/agent-runtime/agent` — declarative agent manifest + -substrate-default adapters. - -Every vertical agent (tax / legal / gtm / creative / N future -verticals) ships ONE `defineAgent({...})` call + a thin invocation -of `runAnalystLoop` wired through the substrate-default adapters. -No per-vertical glue. No fabricated paths. No theater. - -## Type Parameters - -### TRunOutput - -`TRunOutput` - -## Properties - -### dimensions - -> **dimensions**: readonly [`RubricDimension`](RubricDimension.md)\<`TRunOutput`\>[] - -Defined in: [agent/define-agent.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L120) - -Dimensions composing the weighted score. Weights sum to 1.0 by convention. - -*** - -### judges? - -> `optional` **judges?**: readonly [`JudgeConfig`](JudgeConfig.md)\<`TRunOutput`\>[] - -Defined in: [agent/define-agent.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L126) - -Optional judges layered on top of deterministic dimensions. Each -judge returns a score per dimension; the substrate averages judges -(mean by default) for the LLM contribution. diff --git a/docs/api/agent/interfaces/AgentRunContext.md b/docs/api/agent/interfaces/AgentRunContext.md deleted file mode 100644 index 577c988..0000000 --- a/docs/api/agent/interfaces/AgentRunContext.md +++ /dev/null @@ -1,67 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / AgentRunContext - -# Interface: AgentRunContext - -Defined in: [agent/define-agent.ts:231](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L231) - -`@tangle-network/agent-runtime/agent` — declarative agent manifest + -substrate-default adapters. - -Every vertical agent (tax / legal / gtm / creative / N future -verticals) ships ONE `defineAgent({...})` call + a thin invocation -of `runAnalystLoop` wired through the substrate-default adapters. -No per-vertical glue. No fabricated paths. No theater. - -## Properties - -### emitter - -> **emitter**: `TraceEmitter` - -Defined in: [agent/define-agent.ts:233](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L233) - -Substrate-managed trace emitter. - -*** - -### runId - -> **runId**: `string` - -Defined in: [agent/define-agent.ts:235](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L235) - -Stable run id for this persona × variant cell. - -*** - -### variantId? - -> `optional` **variantId?**: `string` - -Defined in: [agent/define-agent.ts:237](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L237) - -Variant the runtime is exercising (e.g. `'baseline'`, `'source-grounded'`). - -*** - -### deadlineMs? - -> `optional` **deadlineMs?**: `number` - -Defined in: [agent/define-agent.ts:239](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L239) - -Wall-clock deadline (epoch ms). The runtime SHOULD honour for graceful cancel. - -*** - -### signal? - -> `optional` **signal?**: `AbortSignal` - -Defined in: [agent/define-agent.ts:241](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L241) - -Optional abort signal. diff --git a/docs/api/agent/interfaces/AgentRunInvocation.md b/docs/api/agent/interfaces/AgentRunInvocation.md deleted file mode 100644 index 87fedc6..0000000 --- a/docs/api/agent/interfaces/AgentRunInvocation.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / AgentRunInvocation - -# Interface: AgentRunInvocation\ - -Defined in: [agent/define-agent.ts:187](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L187) - -`@tangle-network/agent-runtime/agent` — declarative agent manifest + -substrate-default adapters. - -Every vertical agent (tax / legal / gtm / creative / N future -verticals) ships ONE `defineAgent({...})` call + a thin invocation -of `runAnalystLoop` wired through the substrate-default adapters. -No per-vertical glue. No fabricated paths. No theater. - -## Type Parameters - -### TRunOutput - -`TRunOutput` - -## Properties - -### events - -> **events**: `AsyncIterable`\<[`RuntimeStreamEvent`](../../index/type-aliases/RuntimeStreamEvent.md)\> - -Defined in: [agent/define-agent.ts:189](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L189) - -Live stream of typed runtime events. Consumed by chat UX directly. - -*** - -### output - -> **output**: `Promise`\<`TRunOutput`\> - -Defined in: [agent/define-agent.ts:191](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L191) - -Final structured output the rubric scores. Resolves after `events` drains. diff --git a/docs/api/agent/interfaces/AgentRuntime.md b/docs/api/agent/interfaces/AgentRuntime.md deleted file mode 100644 index b39ff56..0000000 --- a/docs/api/agent/interfaces/AgentRuntime.md +++ /dev/null @@ -1,72 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / AgentRuntime - -# Interface: AgentRuntime\ - -Defined in: [agent/define-agent.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L159) - -`@tangle-network/agent-runtime/agent` — declarative agent manifest + -substrate-default adapters. - -Every vertical agent (tax / legal / gtm / creative / N future -verticals) ships ONE `defineAgent({...})` call + a thin invocation -of `runAnalystLoop` wired through the substrate-default adapters. -No per-vertical glue. No fabricated paths. No theater. - -## Type Parameters - -### TPersona - -`TPersona` - -### TRunOutput - -`TRunOutput` - -## Properties - -### act - -> **act**: (`persona`, `ctx`) => [`AgentRunInvocation`](AgentRunInvocation.md)\<`TRunOutput`\> - -Defined in: [agent/define-agent.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L184) - -Invoke the agent against one persona. Returns BOTH: - - `events`: an `AsyncIterable` the chat-centric - product consumes verbatim (SSE / WebSocket / inline render). - **Streaming is mandatory — never collapse this to a single Promise.** - The agent's existing `runChatTurn` (or equivalent async generator) - plugs in here directly. - - `output`: a `Promise` resolved AFTER the event stream - drains. The eval substrate awaits this for rubric scoring; chat - products usually ignore it (they already rendered incrementally). - -Implementation contract: - 1. `act` MUST return immediately (synchronous construction of the - `events` iterator + the `output` promise). - 2. Iterating `events` drives the underlying LLM/tool calls — the - caller chooses when to consume. - 3. `output` resolves only after the iterator yields its terminal - event (typically `task_end`); see `collectAgentRun` helper. - -`ctx.emitter` is the substrate-threaded `TraceEmitter` — runtimes -SHOULD record LLM/tool spans through it for capture integrity. -`ctx.deadlineMs` is wall-clock; the runtime SHOULD honour for graceful -cancel. `ctx.signal` is the standard abort signal. - -#### Parameters - -##### persona - -`TPersona` - -##### ctx - -[`AgentRunContext`](AgentRunContext.md) - -#### Returns - -[`AgentRunInvocation`](AgentRunInvocation.md)\<`TRunOutput`\> diff --git a/docs/api/agent/interfaces/AgentSurfaces.md b/docs/api/agent/interfaces/AgentSurfaces.md deleted file mode 100644 index 3c965f6..0000000 --- a/docs/api/agent/interfaces/AgentSurfaces.md +++ /dev/null @@ -1,115 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / AgentSurfaces - -# Interface: AgentSurfaces - -Defined in: [agent/surfaces.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L37) - -Surface declarations. Every path is repo-relative (or absolute) at -`defineAgent` time. At resolution time, paths are joined against the -agent's `repoRoot`. - -`systemPrompt`, `tools`, `personas` are DIRECTORIES; the loop appends -`
.md`, `/README.md`, `.yaml` etc. -`rubric`, `outputSchema` are SINGLE FILES; the loop edits them in -place. - -`knowledge` is the agent-knowledge root (typically `.agent-knowledge`); -`applyKnowledgeWriteBlocks` writes pages relative to it. - -Optional surfaces (`scaffolding`, `memory`, `rag`, `outputSchema`) -can be omitted — the loop will reject findings targeting them with a -clear log message instead of fabricating a path. - -## Properties - -### systemPrompt - -> **systemPrompt**: `string` - -Defined in: [agent/surfaces.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L39) - -Directory containing one markdown file per system-prompt section. - -*** - -### tools - -> **tools**: `string` - -Defined in: [agent/surfaces.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L41) - -Directory containing one subdir per tool (`/README.md`). - -*** - -### rubric - -> **rubric**: `string` - -Defined in: [agent/surfaces.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L43) - -Single file (TypeScript module) defining the rubric weights + dimensions. - -*** - -### knowledge - -> **knowledge**: `string` - -Defined in: [agent/surfaces.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L45) - -Knowledge-base root; typically `.agent-knowledge`. - -*** - -### personas - -> **personas**: `string` - -Defined in: [agent/surfaces.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L47) - -Directory containing one YAML/JSON file per persona. - -*** - -### scaffolding? - -> `optional` **scaffolding?**: `string` - -Defined in: [agent/surfaces.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L49) - -Optional: directory containing scaffolding rules (precondition checks, retry policies). - -*** - -### memory? - -> `optional` **memory?**: `string` - -Defined in: [agent/surfaces.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L51) - -Optional: memory store path (JSONL / SQLite / DB). - -*** - -### rag? - -> `optional` **rag?**: `string` - -Defined in: [agent/surfaces.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L53) - -Optional: directory containing RAG corpora (`/.md`). - -*** - -### outputSchema? - -> `optional` **outputSchema?**: `string` - -Defined in: [agent/surfaces.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L55) - -Optional: single file defining the output schema (Zod / JSON Schema). diff --git a/docs/api/agent/interfaces/AnalystConfig.md b/docs/api/agent/interfaces/AnalystConfig.md deleted file mode 100644 index 75bbac5..0000000 --- a/docs/api/agent/interfaces/AnalystConfig.md +++ /dev/null @@ -1,59 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / AnalystConfig - -# Interface: AnalystConfig - -Defined in: [agent/define-agent.ts:244](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L244) - -`@tangle-network/agent-runtime/agent` — declarative agent manifest + -substrate-default adapters. - -Every vertical agent (tax / legal / gtm / creative / N future -verticals) ships ONE `defineAgent({...})` call + a thin invocation -of `runAnalystLoop` wired through the substrate-default adapters. -No per-vertical glue. No fabricated paths. No theater. - -## Properties - -### model - -> **model**: `string` - -Defined in: [agent/define-agent.ts:246](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L246) - -Model the analyst kinds use. Override per-kind via `analystKinds[i].cost.models`. - -*** - -### budgetUsd? - -> `optional` **budgetUsd?**: `number` - -Defined in: [agent/define-agent.ts:248](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L248) - -Optional total budget across all kinds for one run. Substrate enforces via `BudgetGuard`. - -*** - -### backend? - -> `optional` **backend?**: `object` - -Defined in: [agent/define-agent.ts:250](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L250) - -Backend hint for the AxAIService factory — same shape every kind uses. - -#### name? - -> `optional` **name?**: `"openai"` \| `"router"` - -#### apiKey? - -> `optional` **apiKey?**: `string` - -#### baseUrl? - -> `optional` **baseUrl?**: `string` diff --git a/docs/api/agent/interfaces/AutoApplyPolicy.md b/docs/api/agent/interfaces/AutoApplyPolicy.md deleted file mode 100644 index d0b6996..0000000 --- a/docs/api/agent/interfaces/AutoApplyPolicy.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / AutoApplyPolicy - -# Interface: AutoApplyPolicy - -Defined in: [agent/define-agent.ts:257](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L257) - -`@tangle-network/agent-runtime/agent` — declarative agent manifest + -substrate-default adapters. - -Every vertical agent (tax / legal / gtm / creative / N future -verticals) ships ONE `defineAgent({...})` call + a thin invocation -of `runAnalystLoop` wired through the substrate-default adapters. -No per-vertical glue. No fabricated paths. No theater. - -## Properties - -### knowledge? - -> `optional` **knowledge?**: `object` - -Defined in: [agent/define-agent.ts:258](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L258) - -#### enabled - -> **enabled**: `boolean` - -#### confidenceThreshold? - -> `optional` **confidenceThreshold?**: `number` - -#### mode? - -> `optional` **mode?**: `"write"` \| `"open-pr"` - -*** - -### improvement? - -> `optional` **improvement?**: `object` - -Defined in: [agent/define-agent.ts:263](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L263) - -#### enabled - -> **enabled**: `boolean` - -#### confidenceThreshold? - -> `optional` **confidenceThreshold?**: `number` - -#### mode? - -> `optional` **mode?**: `"write"` \| `"open-pr"` diff --git a/docs/api/agent/interfaces/CreateSandboxActOptions.md b/docs/api/agent/interfaces/CreateSandboxActOptions.md deleted file mode 100644 index 2555715..0000000 --- a/docs/api/agent/interfaces/CreateSandboxActOptions.md +++ /dev/null @@ -1,154 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / CreateSandboxActOptions - -# Interface: CreateSandboxActOptions\ - -Defined in: [agent/sandbox-act.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L28) - -## Type Parameters - -### TPersona - -`TPersona` - -### TRunOutput - -`TRunOutput` - -## Properties - -### baseProfile - -> **baseProfile**: `AgentProfile` - -Defined in: [agent/sandbox-act.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L30) - -Canonical agent profile — the same one the prod chat turn composes from. - -*** - -### sandboxClient - -> **sandboxClient**: [`SandboxClient`](../../runtime/interfaces/SandboxClient.md) - -Defined in: [agent/sandbox-act.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L32) - -Sandbox client used to boot the per-run sandbox. - -*** - -### buildPrompt - -> **buildPrompt**: (`persona`) => `string` - -Defined in: [agent/sandbox-act.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L34) - -Persona → prompt. Pure; the eval cell's input. - -#### Parameters - -##### persona - -`TPersona` - -#### Returns - -`string` - -*** - -### output - -> **output**: [`OutputAdapter`](../../runtime/interfaces/OutputAdapter.md)\<`TRunOutput`\> - -Defined in: [agent/sandbox-act.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L36) - -Sandbox event stream → typed output the rubric scores. - -*** - -### compose? - -> `optional` **compose?**: (`persona`) => [`ComposeProductionAgentProfileOptions`](../../mcp/interfaces/ComposeProductionAgentProfileOptions.md) - -Defined in: [agent/sandbox-act.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L43) - -Per-persona composition overrides (workspace-augmented system prompt, -extra file mounts, sandbox key). Merged into -[composeProductionAgentProfile](../../mcp/functions/composeProductionAgentProfile.md); `env` here is overridden by the -top-level `env` option when both are set. - -#### Parameters - -##### persona - -`TPersona` - -#### Returns - -[`ComposeProductionAgentProfileOptions`](../../mcp/interfaces/ComposeProductionAgentProfileOptions.md) - -*** - -### sandboxOverrides? - -> `optional` **sandboxOverrides?**: `Partial`\<`Omit`\<`CreateSandboxOptions`, `"backend"`\>\> & `object` - -Defined in: [agent/sandbox-act.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L45) - -Sandbox-SDK overrides forwarded to `createSandboxForSpec`. - -#### Type Declaration - -##### backend? - -> `optional` **backend?**: `Omit`\<`BackendConfig`, `"profile"`\> - -*** - -### name? - -> `optional` **name?**: `string` - -Defined in: [agent/sandbox-act.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L47) - -Stable run name surfaced in mapped `llm_call` events. - -*** - -### mapEvent? - -> `optional` **mapEvent?**: (`event`, `opts`) => [`RuntimeStreamEvent`](../../index/type-aliases/RuntimeStreamEvent.md) \| `undefined` - -Defined in: [agent/sandbox-act.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L49) - -Override the `SandboxEvent → RuntimeStreamEvent` mapper. - -#### Parameters - -##### event - -`SandboxEvent` - -##### opts - -###### agentRunName? - -`string` - -#### Returns - -[`RuntimeStreamEvent`](../../index/type-aliases/RuntimeStreamEvent.md) \| `undefined` - -*** - -### env? - -> `optional` **env?**: `Record`\<`string`, `string` \| `undefined`\> - -Defined in: [agent/sandbox-act.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L54) - -Environment source for delegation-MCP composition. Defaults to `process.env`. diff --git a/docs/api/agent/interfaces/CreateSurfaceImprovementAdapterOpts.md b/docs/api/agent/interfaces/CreateSurfaceImprovementAdapterOpts.md deleted file mode 100644 index e31070e..0000000 --- a/docs/api/agent/interfaces/CreateSurfaceImprovementAdapterOpts.md +++ /dev/null @@ -1,101 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / CreateSurfaceImprovementAdapterOpts - -# Interface: CreateSurfaceImprovementAdapterOpts - -Defined in: [agent/improvement-adapter.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L66) - -## Properties - -### surfaces - -> **surfaces**: [`AgentSurfaces`](AgentSurfaces.md) - -Defined in: [agent/improvement-adapter.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L67) - -*** - -### repoRoot - -> **repoRoot**: `string` - -Defined in: [agent/improvement-adapter.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L68) - -*** - -### draftPatch - -> **draftPatch**: (`input`) => `Promise`\<[`DraftPatchOutput`](DraftPatchOutput.md)\> - -Defined in: [agent/improvement-adapter.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L77) - -LLM-draft callback. Given a finding + current file content + the -resolved target, returns a unified-diff patch + summary + rationale. - -Required — the substrate doesn't ship a hardcoded prompt; the agent -author picks the model (Haiku for cheap routine drafts, Sonnet for -substantive prompt rewrites, etc.) via this callback. - -#### Parameters - -##### input - -[`DraftPatchInput`](DraftPatchInput.md) - -#### Returns - -`Promise`\<[`DraftPatchOutput`](DraftPatchOutput.md)\> - -*** - -### mode? - -> `optional` **mode?**: `"none"` \| `"write"` \| `"open-pr"` - -Defined in: [agent/improvement-adapter.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L88) - -Apply mode: - `write` — `git apply` in-place; operator reviews via `git diff` - `open-pr` — branch + commit + push + `gh pr create` - `none` — never apply; collect proposals for the report only - -The `apply` method honours this even when the loop calls it; the -effective behaviour is also gated on the per-finding confidence -threshold via `runAnalystLoop`'s `autoApply` policy. - -*** - -### baseBranch? - -> `optional` **baseBranch?**: `string` - -Defined in: [agent/improvement-adapter.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L90) - -When `mode === 'open-pr'`, the base branch new PRs target. Default: `main`. - -*** - -### ghRepo? - -> `optional` **ghRepo?**: `string` - -Defined in: [agent/improvement-adapter.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L92) - -Required for `mode === 'open-pr'` — the GH owner/repo (`tangle-network/tax-agent`). - -*** - -### allowCreateForKinds? - -> `optional` **allowCreateForKinds?**: readonly (`"knowledge.wiki"` \| `"knowledge.claim"` \| `"knowledge.raw"` \| `"knowledge.stale"` \| `"system-prompt"` \| `"tool-doc"` \| `"new-tool"` \| `"rag"` \| `"memory"` \| `"scaffolding"` \| `"output-schema"` \| `"websearch.outdated"` \| `"prior-run-summary"` \| `"cluster"`)[] - -Defined in: [agent/improvement-adapter.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L100) - -When the resolved target doesn't exist, allow the substrate to -CREATE the file (for `knowledge.wiki`, `new-tool` subjects). Default -true for those kinds, false for `system-prompt` / `rubric` / etc. -(named sections that don't exist are a contract violation, not a -scaffolding opportunity). diff --git a/docs/api/agent/interfaces/CreateSurfaceKnowledgeAdapterOpts.md b/docs/api/agent/interfaces/CreateSurfaceKnowledgeAdapterOpts.md deleted file mode 100644 index 24ae446..0000000 --- a/docs/api/agent/interfaces/CreateSurfaceKnowledgeAdapterOpts.md +++ /dev/null @@ -1,19 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / CreateSurfaceKnowledgeAdapterOpts - -# Interface: CreateSurfaceKnowledgeAdapterOpts - -Defined in: [agent/knowledge-adapter.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/knowledge-adapter.ts#L21) - -## Properties - -### knowledgeRoot - -> **knowledgeRoot**: `string` - -Defined in: [agent/knowledge-adapter.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/knowledge-adapter.ts#L23) - -`.agent-knowledge/` root (absolute path the substrate writes blocks against). diff --git a/docs/api/agent/interfaces/DraftPatchInput.md b/docs/api/agent/interfaces/DraftPatchInput.md deleted file mode 100644 index 3c28feb..0000000 --- a/docs/api/agent/interfaces/DraftPatchInput.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / DraftPatchInput - -# Interface: DraftPatchInput - -Defined in: [agent/improvement-adapter.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L103) - -## Properties - -### finding - -> **finding**: `AnalystFinding` - -Defined in: [agent/improvement-adapter.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L104) - -*** - -### subject - -> **subject**: `FindingSubject` - -Defined in: [agent/improvement-adapter.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L105) - -*** - -### target - -> **target**: [`ResolvedSurface`](ResolvedSurface.md) - -Defined in: [agent/improvement-adapter.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L106) - -*** - -### currentContent - -> **currentContent**: `string` - -Defined in: [agent/improvement-adapter.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L108) - -Current file content (empty string when `intent === 'create-new'`). diff --git a/docs/api/agent/interfaces/DraftPatchOutput.md b/docs/api/agent/interfaces/DraftPatchOutput.md deleted file mode 100644 index 83c0fa7..0000000 --- a/docs/api/agent/interfaces/DraftPatchOutput.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / DraftPatchOutput - -# Interface: DraftPatchOutput - -Defined in: [agent/improvement-adapter.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L111) - -## Properties - -### patch - -> **patch**: `string` - -Defined in: [agent/improvement-adapter.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L113) - -Unified diff against the current file content. Empty string skips this finding. - -*** - -### summary - -> **summary**: `string` - -Defined in: [agent/improvement-adapter.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L115) - -One-line summary for the operator. - -*** - -### rationale - -> **rationale**: `string` - -Defined in: [agent/improvement-adapter.ts:117](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L117) - -Multi-line rationale for the PR body. diff --git a/docs/api/agent/interfaces/JudgeConfig.md b/docs/api/agent/interfaces/JudgeConfig.md deleted file mode 100644 index 51e8ef1..0000000 --- a/docs/api/agent/interfaces/JudgeConfig.md +++ /dev/null @@ -1,65 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / JudgeConfig - -# Interface: JudgeConfig\ - -Defined in: [agent/define-agent.ts:144](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L144) - -`@tangle-network/agent-runtime/agent` — declarative agent manifest + -substrate-default adapters. - -Every vertical agent (tax / legal / gtm / creative / N future -verticals) ships ONE `defineAgent({...})` call + a thin invocation -of `runAnalystLoop` wired through the substrate-default adapters. -No per-vertical glue. No fabricated paths. No theater. - -## Type Parameters - -### TRunOutput - -`TRunOutput` - -## Properties - -### id - -> **id**: `string` - -Defined in: [agent/define-agent.ts:146](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L146) - -Judge identifier — appears in trace spans + manifest. - -*** - -### model - -> **model**: `string` - -Defined in: [agent/define-agent.ts:148](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L148) - -Model snapshot to invoke. Pin the snapshot (`claude-sonnet-4-6@2025-04-15`); the validator rejects bare aliases. - -*** - -### dimensions - -> **dimensions**: readonly `string`[] - -Defined in: [agent/define-agent.ts:150](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L150) - -Dimensions this judge scores. - -*** - -### anchors? - -> `optional` **anchors?**: readonly `object`[] - -Defined in: [agent/define-agent.ts:156](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L156) - -Optional rubric anchors — text examples the judge sees as a -few-shot prompt to calibrate. STRONGLY recommended for subjective -dimensions; required by the calibration gate (Pearson ≥0.7). diff --git a/docs/api/agent/interfaces/KnowledgeAdapterDeps.md b/docs/api/agent/interfaces/KnowledgeAdapterDeps.md deleted file mode 100644 index 401f4de..0000000 --- a/docs/api/agent/interfaces/KnowledgeAdapterDeps.md +++ /dev/null @@ -1,102 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / KnowledgeAdapterDeps - -# Interface: KnowledgeAdapterDeps\ - -Defined in: [agent/knowledge-adapter.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/knowledge-adapter.ts#L40) - -Build the adapter. We accept the agent-knowledge functions as DI so -the substrate stays decoupled from a specific agent-knowledge -version — the agent author imports them in their manifest module -and hands them to the factory. - -`proposeFromFindings(findings)` returns - `{ proposals: KnowledgeProposal[]; skipped: number; errors: ... }`. - -`applyKnowledgeWriteBlocks(root, content)` returns - `{ written: string[]; warnings: string[] }`. - -`lintKnowledgeIndex(index)` (optional) returns `KnowledgeLintFinding[]`. - -## Type Parameters - -### TProposal - -`TProposal` - -## Properties - -### proposeFromFindings - -> **proposeFromFindings**: (`findings`) => `object` - -Defined in: [agent/knowledge-adapter.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/knowledge-adapter.ts#L41) - -#### Parameters - -##### findings - -readonly `AnalystFinding`[] - -#### Returns - -`object` - -##### proposals - -> **proposals**: `TProposal`[] - -##### skipped - -> **skipped**: `number` - -##### errors - -> **errors**: `object`[] - -*** - -### applyKnowledgeWriteBlocks - -> **applyKnowledgeWriteBlocks**: (`root`, `proposalText`) => `Promise`\<\{ `written`: `string`[]; `warnings`: `string`[]; \}\> - -Defined in: [agent/knowledge-adapter.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/knowledge-adapter.ts#L46) - -#### Parameters - -##### root - -`string` - -##### proposalText - -`string` - -#### Returns - -`Promise`\<\{ `written`: `string`[]; `warnings`: `string`[]; \}\> - -*** - -### lintAfterApply? - -> `optional` **lintAfterApply?**: (`root`) => `Promise`\ - -Defined in: [agent/knowledge-adapter.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/knowledge-adapter.ts#L55) - -Optional post-apply lint hook. The substrate runs it after each -batch of writes; failures land in `warnings` (the apply is not -rolled back — lint signals drift to review, not block). - -#### Parameters - -##### root - -`string` - -#### Returns - -`Promise`\ diff --git a/docs/api/agent/interfaces/OutcomeMeasurement.md b/docs/api/agent/interfaces/OutcomeMeasurement.md deleted file mode 100644 index a8df673..0000000 --- a/docs/api/agent/interfaces/OutcomeMeasurement.md +++ /dev/null @@ -1,59 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / OutcomeMeasurement - -# Interface: OutcomeMeasurement - -Defined in: [agent/outcome.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L23) - -## Properties - -### baselineComposite - -> **baselineComposite**: `number` - -Defined in: [agent/outcome.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L25) - -Baseline composite before applies — captured from the most-recent eval run. - -*** - -### afterComposite - -> **afterComposite**: `number` - -Defined in: [agent/outcome.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L27) - -Composite after re-running the cohort with applied edits. - -*** - -### delta - -> **delta**: `number` - -Defined in: [agent/outcome.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L29) - -`afterComposite - baselineComposite`. Positive = the loop improved the agent. - -*** - -### perPersona - -> **perPersona**: readonly `object`[] - -Defined in: [agent/outcome.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L31) - -Per-persona deltas for finer-grained review. - -*** - -### rolledBackPaths - -> **rolledBackPaths**: readonly `string`[] - -Defined in: [agent/outcome.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L33) - -When the substrate rolled back applies due to regression, the paths reverted. diff --git a/docs/api/agent/interfaces/OutcomeMeasurementOpts.md b/docs/api/agent/interfaces/OutcomeMeasurementOpts.md deleted file mode 100644 index f2f2b77..0000000 --- a/docs/api/agent/interfaces/OutcomeMeasurementOpts.md +++ /dev/null @@ -1,74 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / OutcomeMeasurementOpts - -# Interface: OutcomeMeasurementOpts - -Defined in: [agent/outcome.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L36) - -## Properties - -### baseline - -> **baseline**: readonly `object`[] - -Defined in: [agent/outcome.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L38) - -Composite scores from the run that produced the findings. - -*** - -### reRunCohort - -> **reRunCohort**: (`personaIds`) => `Promise`\ - -Defined in: [agent/outcome.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L47) - -Re-run callback — the substrate invokes this after applies. The -agent author provides their `runAgentEval`-equivalent so the -substrate can ask "score this persona slice now." - -The callback SHOULD reuse the same cohort + judges + variant as -the baseline run; only the agent's mutable surfaces have changed. - -#### Parameters - -##### personaIds - -readonly `string`[] - -#### Returns - -`Promise`\ - -*** - -### rollbackOnRegression? - -> `optional` **rollbackOnRegression?**: `boolean` - -Defined in: [agent/outcome.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L51) - -When `true`, applied edits are reverted on negative delta. Default `false`. - -*** - -### revert? - -> `optional` **revert?**: (`paths`) => `Promise`\<`void`\> - -Defined in: [agent/outcome.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/outcome.ts#L53) - -Callback to revert a list of paths (typically `git checkout HEAD --`). - -#### Parameters - -##### paths - -readonly `string`[] - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/agent/interfaces/ResolvedSurface.md b/docs/api/agent/interfaces/ResolvedSurface.md deleted file mode 100644 index 78c9b74..0000000 --- a/docs/api/agent/interfaces/ResolvedSurface.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / ResolvedSurface - -# Interface: ResolvedSurface - -Defined in: [agent/surfaces.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L58) - -## Properties - -### absolutePath - -> **absolutePath**: `string` - -Defined in: [agent/surfaces.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L60) - -Absolute filesystem path the operator can `cat` / `vim`. - -*** - -### repoRelativePath - -> **repoRelativePath**: `string` - -Defined in: [agent/surfaces.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L62) - -Repo-relative path for PR descriptions, diffs, audit logs. - -*** - -### exists - -> **exists**: `boolean` - -Defined in: [agent/surfaces.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L64) - -Whether the path currently exists on disk. - -*** - -### intent - -> **intent**: `"edit-existing"` \| `"create-new"` - -Defined in: [agent/surfaces.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L66) - -The substrate's intent: edit an existing file or create a new one. diff --git a/docs/api/agent/interfaces/RubricDimension.md b/docs/api/agent/interfaces/RubricDimension.md deleted file mode 100644 index 3abb5a0..0000000 --- a/docs/api/agent/interfaces/RubricDimension.md +++ /dev/null @@ -1,81 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / RubricDimension - -# Interface: RubricDimension\ - -Defined in: [agent/define-agent.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L129) - -`@tangle-network/agent-runtime/agent` — declarative agent manifest + -substrate-default adapters. - -Every vertical agent (tax / legal / gtm / creative / N future -verticals) ships ONE `defineAgent({...})` call + a thin invocation -of `runAnalystLoop` wired through the substrate-default adapters. -No per-vertical glue. No fabricated paths. No theater. - -## Type Parameters - -### TRunOutput - -`TRunOutput` - -## Properties - -### id - -> **id**: `string` - -Defined in: [agent/define-agent.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L131) - -Unique identifier — appears in finding subjects (`rubric:`). - -*** - -### weight - -> **weight**: `number` - -Defined in: [agent/define-agent.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L133) - -0..1 — weight in the composite. - -*** - -### score - -> **score**: (`input`) => `number` - -Defined in: [agent/define-agent.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L139) - -Deterministic scorer: given the persona + run output, returns a -0..1 score. The substrate sums weight × score across dimensions -for the deterministic composite; judges supplement subjective dims. - -#### Parameters - -##### input - -###### persona - -`unknown` - -###### output - -`TRunOutput` - -#### Returns - -`number` - -*** - -### label? - -> `optional` **label?**: `string` - -Defined in: [agent/define-agent.ts:141](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/define-agent.ts#L141) - -Optional human-readable label for reports. diff --git a/docs/api/agent/interfaces/SurfaceImprovementEdit.md b/docs/api/agent/interfaces/SurfaceImprovementEdit.md deleted file mode 100644 index 3bc31e4..0000000 --- a/docs/api/agent/interfaces/SurfaceImprovementEdit.md +++ /dev/null @@ -1,109 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / SurfaceImprovementEdit - -# Interface: SurfaceImprovementEdit - -Defined in: [agent/improvement-adapter.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L43) - -## Properties - -### id - -> **id**: `string` - -Defined in: [agent/improvement-adapter.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L45) - -Stable id derived from the source finding so re-proposals are idempotent. - -*** - -### sourceFindingId - -> **sourceFindingId**: `string` - -Defined in: [agent/improvement-adapter.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L47) - -The finding that produced this edit — for revert + audit trail. - -*** - -### subject - -> **subject**: `FindingSubject` - -Defined in: [agent/improvement-adapter.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L49) - -Parsed subject; included so the apply step doesn't re-parse. - -*** - -### target - -> **target**: [`ResolvedSurface`](ResolvedSurface.md) - -Defined in: [agent/improvement-adapter.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L51) - -Resolved on-disk target. - -*** - -### baseSha256 - -> **baseSha256**: `string` - -Defined in: [agent/improvement-adapter.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L53) - -SHA-256 of the current file content the patch was drafted against. - -*** - -### patch - -> **patch**: `string` - -Defined in: [agent/improvement-adapter.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L55) - -Unified-diff patch the LLM drafted (relative to `target.absolutePath`). - -*** - -### summary - -> **summary**: `string` - -Defined in: [agent/improvement-adapter.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L57) - -One-line summary the operator sees in the report / PR title. - -*** - -### rationale - -> **rationale**: `string` - -Defined in: [agent/improvement-adapter.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L59) - -Multi-line rationale for the PR body — finding context + LLM reasoning. - -*** - -### confidence - -> **confidence**: `number` - -Defined in: [agent/improvement-adapter.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L61) - -Carry-forward from the finding so the apply gate can check the threshold. - -*** - -### severity - -> **severity**: `AnalystSeverity` - -Defined in: [agent/improvement-adapter.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/improvement-adapter.ts#L63) - -Carry-forward severity for prioritization. diff --git a/docs/api/agent/interfaces/SurfaceValidationIssue.md b/docs/api/agent/interfaces/SurfaceValidationIssue.md deleted file mode 100644 index 082c166..0000000 --- a/docs/api/agent/interfaces/SurfaceValidationIssue.md +++ /dev/null @@ -1,40 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [agent](../README.md) / SurfaceValidationIssue - -# Interface: SurfaceValidationIssue - -Defined in: [agent/surfaces.ts:191](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L191) - -Validate that every declared surface exists on disk under `repoRoot`. - -Returns an array of `SurfaceValidationIssue` — empty when all required -surfaces resolve. `defineAgent` throws with the issues rendered, so -a misconfigured manifest fails at startup (not at the first finding -the loop produces 20 minutes later). - -## Properties - -### surface - -> **surface**: keyof [`AgentSurfaces`](AgentSurfaces.md) - -Defined in: [agent/surfaces.ts:192](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L192) - -*** - -### path - -> **path**: `string` - -Defined in: [agent/surfaces.ts:193](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L193) - -*** - -### reason - -> **reason**: `"missing"` \| `"not-directory"` \| `"not-file"` - -Defined in: [agent/surfaces.ts:194](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/surfaces.ts#L194) diff --git a/docs/api/analyst-loop.md b/docs/api/analyst-loop.md new file mode 100644 index 0000000..cb2dd56 --- /dev/null +++ b/docs/api/analyst-loop.md @@ -0,0 +1,887 @@ +[**@tangle-network/agent-runtime**](README.md) + +*** + +[@tangle-network/agent-runtime](README.md) / analyst-loop + +# analyst-loop + +## Interfaces + +### KnowledgeAdapter + +Defined in: [analyst-loop/types.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L25) + +Knowledge-side bridge — consumers wire `proposeFromFindings` from agent-knowledge. + +#### Type Parameters + +##### TProposal + +`TProposal` = `unknown` + +#### Methods + +##### proposeFromFindings() + +> **proposeFromFindings**(`findings`): [`KnowledgeProposalBatch`](#knowledgeproposalbatch)\<`TProposal`\> \| `Promise`\<[`KnowledgeProposalBatch`](#knowledgeproposalbatch)\<`TProposal`\>\> + +Defined in: [analyst-loop/types.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L32) + +Convert a findings batch into proposals. Returns the partitioned +result so the loop can report (and optionally fail on) malformed +findings. Implementations SHOULD honour the convention "non- +knowledge subjects return null and are counted in `skipped`." + +###### Parameters + +###### findings + +readonly `AnalystFinding`[] + +###### Returns + +[`KnowledgeProposalBatch`](#knowledgeproposalbatch)\<`TProposal`\> \| `Promise`\<[`KnowledgeProposalBatch`](#knowledgeproposalbatch)\<`TProposal`\>\> + +##### apply()? + +> `optional` **apply**(`proposals`): `Promise`\<\{ `written`: `string`[]; `warnings`: `string`[]; \}\> + +Defined in: [analyst-loop/types.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L41) + +Optional auto-apply. The loop calls this only when +`autoApply.knowledge` is true AND the proposal's source-finding +confidence ≥ `autoApply.knowledgeConfidenceThreshold`. Anything +below the threshold is returned in the report but never written. + +###### Parameters + +###### proposals + +readonly `TProposal`[] + +###### Returns + +`Promise`\<\{ `written`: `string`[]; `warnings`: `string`[]; \}\> + +*** + +### KnowledgeProposalBatch + +Defined in: [analyst-loop/types.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L44) + +#### Type Parameters + +##### TProposal + +`TProposal` = `unknown` + +#### Properties + +##### proposals + +> **proposals**: `TProposal`[] + +Defined in: [analyst-loop/types.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L45) + +##### skipped + +> **skipped**: `number` + +Defined in: [analyst-loop/types.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L46) + +##### errors + +> **errors**: `object`[] + +Defined in: [analyst-loop/types.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L47) + +###### findingId + +> **findingId**: `string` + +###### subject + +> **subject**: `string` + +###### message + +> **message**: `string` + +*** + +### ImprovementAdapter + +Defined in: [analyst-loop/types.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L51) + +Improvement-side bridge — proposes / applies prompt + tool + scaffolding edits. + +#### Type Parameters + +##### TEdit + +`TEdit` = `unknown` + +#### Methods + +##### proposeFromFindings() + +> **proposeFromFindings**(`findings`): [`ImprovementEditBatch`](#improvementeditbatch)\<`TEdit`\> \| `Promise`\<[`ImprovementEditBatch`](#improvementeditbatch)\<`TEdit`\>\> + +Defined in: [analyst-loop/types.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L52) + +###### Parameters + +###### findings + +readonly `AnalystFinding`[] + +###### Returns + +[`ImprovementEditBatch`](#improvementeditbatch)\<`TEdit`\> \| `Promise`\<[`ImprovementEditBatch`](#improvementeditbatch)\<`TEdit`\>\> + +##### apply()? + +> `optional` **apply**(`edits`): `Promise`\<\{ `applied`: `string`[]; `warnings`: `string`[]; \}\> + +Defined in: [analyst-loop/types.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L55) + +###### Parameters + +###### edits + +readonly `TEdit`[] + +###### Returns + +`Promise`\<\{ `applied`: `string`[]; `warnings`: `string`[]; \}\> + +*** + +### ImprovementEditBatch + +Defined in: [analyst-loop/types.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L58) + +#### Type Parameters + +##### TEdit + +`TEdit` = `unknown` + +#### Properties + +##### edits + +> **edits**: `TEdit`[] + +Defined in: [analyst-loop/types.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L59) + +##### skipped + +> **skipped**: `number` + +Defined in: [analyst-loop/types.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L60) + +##### errors + +> **errors**: `object`[] + +Defined in: [analyst-loop/types.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L61) + +###### findingId + +> **findingId**: `string` + +###### subject + +> **subject**: `string` + +###### message + +> **message**: `string` + +*** + +### AutoApplyPolicy + +Defined in: [analyst-loop/types.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L65) + +Tunable safety rails for auto-apply. + +#### Properties + +##### knowledge? + +> `optional` **knowledge?**: `boolean` + +Defined in: [analyst-loop/types.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L67) + +When true AND `knowledgeAdapter.apply` exists, write knowledge proposals. + +##### knowledgeConfidenceThreshold? + +> `optional` **knowledgeConfidenceThreshold?**: `number` + +Defined in: [analyst-loop/types.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L69) + +Minimum source-finding confidence required to auto-apply a knowledge proposal. + +##### improvement? + +> `optional` **improvement?**: `boolean` + +Defined in: [analyst-loop/types.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L71) + +When true AND `improvementAdapter.apply` exists, apply improvement edits. + +##### improvementConfidenceThreshold? + +> `optional` **improvementConfidenceThreshold?**: `number` + +Defined in: [analyst-loop/types.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L73) + +Minimum source-finding confidence required to auto-apply an improvement edit. + +*** + +### RunAnalystLoopOpts + +Defined in: [analyst-loop/types.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L76) + +#### Properties + +##### runId + +> **runId**: `string` + +Defined in: [analyst-loop/types.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L78) + +The run id of the work being analysed. + +##### registry + +> **registry**: [`AnalystRegistryLike`](#analystregistrylike) + +Defined in: [analyst-loop/types.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L80) + +The registry — pre-populated with the analyst kinds the consumer wants. + +##### inputs + +> **inputs**: `AnalystRunInputs` + +Defined in: [analyst-loop/types.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L82) + +Inputs forwarded to `registry.run` — typically `{ traceStore }`. + +##### findingsStore + +> **findingsStore**: [`FindingsStoreLike`](#findingsstorelike) \| `null` + +Defined in: [analyst-loop/types.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L88) + +Findings ledger. The loop appends the new run + diffs against the +baseline run before running adapters. Pass `null` to skip +persistence (useful for one-shot analyses). + +##### baselineRunId? + +> `optional` **baselineRunId?**: `string` \| `null` + +Defined in: [analyst-loop/types.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L95) + +Prior run id whose findings the loop reads + provides to analysts +as `priorFindings` AND diffs against. When omitted, the loop picks +the most recent run in the store (excluding `runId` itself); pass +`null` to explicitly start with an empty baseline. + +##### priorFindingsStrategy? + +> `optional` **priorFindingsStrategy?**: `"none"` \| `"per-kind"` \| `"wildcard"` + +Defined in: [analyst-loop/types.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L97) + +Strategy for forwarding prior findings into `ctx.priorFindings`. + +##### knowledgeAdapter? + +> `optional` **knowledgeAdapter?**: [`KnowledgeAdapter`](#knowledgeadapter)\<`unknown`\> + +Defined in: [analyst-loop/types.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L99) + +Knowledge-side bridge — usually `agent-knowledge`'s `proposeFromFindings`. + +##### improvementAdapter? + +> `optional` **improvementAdapter?**: [`ImprovementAdapter`](#improvementadapter)\<`unknown`\> + +Defined in: [analyst-loop/types.ts:101](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L101) + +Improvement-side bridge — usually a consumer-specific prompt/tool diff producer. + +##### autoApply? + +> `optional` **autoApply?**: [`AutoApplyPolicy`](#autoapplypolicy) + +Defined in: [analyst-loop/types.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L103) + +Auto-apply rails. Default off; review-then-apply is the safer default. + +##### log? + +> `optional` **log?**: (`msg`, `fields?`) => `void` + +Defined in: [analyst-loop/types.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L105) + +Optional logger. Defaults to `console.log` for `[analyst-loop]` lines. + +###### Parameters + +###### msg + +`string` + +###### fields? + +`Record`\<`string`, `unknown`\> + +###### Returns + +`void` + +##### onEvent? + +> `optional` **onEvent?**: (`event`) => `void` \| `Promise`\<`void`\> + +Defined in: [analyst-loop/types.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L116) + +Event sink for live progress. Called for every phase of the loop: +baseline resolution, registry events forwarded from `runStream`, +ledger persistence, diff, knowledge / improvement proposals + +apply outcomes, and the terminal `loop-completed`. Awaited so +slow sinks (SSE write, JSONL append) apply backpressure. + +The callback MUST NOT throw — exceptions propagate and abort the +loop. Catch + swallow internally if your sink is unreliable. + +###### Parameters + +###### event + +[`AnalystLoopEvent`](#analystloopevent) + +###### Returns + +`void` \| `Promise`\<`void`\> + +*** + +### RunAnalystLoopResult + +Defined in: [analyst-loop/types.ts:119](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L119) + +#### Type Parameters + +##### TProposal + +`TProposal` = `unknown` + +##### TEdit + +`TEdit` = `unknown` + +#### Properties + +##### runId + +> **runId**: `string` + +Defined in: [analyst-loop/types.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L120) + +##### baselineRunId + +> **baselineRunId**: `string` \| `null` + +Defined in: [analyst-loop/types.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L121) + +##### analystResult + +> **analystResult**: `AnalystRunResult` + +Defined in: [analyst-loop/types.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L122) + +##### diff + +> **diff**: `FindingsDiff` \| `null` + +Defined in: [analyst-loop/types.ts:123](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L123) + +##### knowledge + +> **knowledge**: [`KnowledgeReport`](#knowledgereport)\<`TProposal`\> \| `null` + +Defined in: [analyst-loop/types.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L124) + +##### improvement + +> **improvement**: [`ImprovementReport`](#improvementreport)\<`TEdit`\> \| `null` + +Defined in: [analyst-loop/types.ts:125](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L125) + +*** + +### KnowledgeReport + +Defined in: [analyst-loop/types.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L128) + +#### Type Parameters + +##### TProposal + +`TProposal` = `unknown` + +#### Properties + +##### proposals + +> **proposals**: `TProposal`[] + +Defined in: [analyst-loop/types.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L129) + +##### applied + +> **applied**: `string`[] + +Defined in: [analyst-loop/types.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L130) + +##### skipped + +> **skipped**: `number` + +Defined in: [analyst-loop/types.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L131) + +##### errors + +> **errors**: `object`[] + +Defined in: [analyst-loop/types.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L132) + +###### findingId + +> **findingId**: `string` + +###### subject + +> **subject**: `string` + +###### message + +> **message**: `string` + +##### withheld\_for\_review + +> **withheld\_for\_review**: `number` + +Defined in: [analyst-loop/types.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L133) + +*** + +### ImprovementReport + +Defined in: [analyst-loop/types.ts:136](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L136) + +#### Type Parameters + +##### TEdit + +`TEdit` = `unknown` + +#### Properties + +##### edits + +> **edits**: `TEdit`[] + +Defined in: [analyst-loop/types.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L137) + +##### applied + +> **applied**: `string`[] + +Defined in: [analyst-loop/types.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L138) + +##### skipped + +> **skipped**: `number` + +Defined in: [analyst-loop/types.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L139) + +##### errors + +> **errors**: `object`[] + +Defined in: [analyst-loop/types.ts:140](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L140) + +###### findingId + +> **findingId**: `string` + +###### subject + +> **subject**: `string` + +###### message + +> **message**: `string` + +##### withheld\_for\_review + +> **withheld\_for\_review**: `number` + +Defined in: [analyst-loop/types.ts:141](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L141) + +*** + +### AnalystRegistryLike + +Defined in: [analyst-loop/types.ts:149](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L149) + +Narrowed shape we accept for `AnalystRegistry` so the orchestrator +remains testable without instantiating the real class. The real +class satisfies this trivially. + +#### Extended by + +- [`AnalystRegistryStreamingLike`](#analystregistrystreaminglike) + +#### Methods + +##### list() + +> **list**(): readonly `object`[] + +Defined in: [analyst-loop/types.ts:150](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L150) + +###### Returns + +readonly `object`[] + +##### run() + +> **run**(`runId`, `inputs`, `opts?`): `Promise`\<`AnalystRunResult`\> + +Defined in: [analyst-loop/types.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L151) + +###### Parameters + +###### runId + +`string` + +###### inputs + +`AnalystRunInputs` + +###### opts? + +###### priorFindings? + +readonly `AnalystFinding`[] \| `Record`\<`string`, readonly `AnalystFinding`[]\> + +###### Returns + +`Promise`\<`AnalystRunResult`\> + +*** + +### FindingsStoreLike + +Defined in: [analyst-loop/types.ts:162](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L162) + +Narrowed shape we accept for `FindingsStore`. + +#### Methods + +##### loadAll() + +> **loadAll**(): readonly `AnalystFinding` & `object`[] + +Defined in: [analyst-loop/types.ts:163](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L163) + +###### Returns + +readonly `AnalystFinding` & `object`[] + +##### loadRun() + +> **loadRun**(`runId`): readonly `AnalystFinding` & `object`[] + +Defined in: [analyst-loop/types.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L164) + +###### Parameters + +###### runId + +`string` + +###### Returns + +readonly `AnalystFinding` & `object`[] + +##### append() + +> **append**(`runId`, `findings`): `Promise`\<`void`\> + +Defined in: [analyst-loop/types.ts:165](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L165) + +###### Parameters + +###### runId + +`string` + +###### findings + +readonly `AnalystFinding`[] + +###### Returns + +`Promise`\<`void`\> + +*** + +### AnalystRegistryStreamingLike + +Defined in: [analyst-loop/types.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L179) + +Narrow the `AnalystRegistryLike` further when we need streaming: the +loop checks if the registry exposes `runStream` and uses it when +present, falling back to `run()` otherwise. This keeps the type +surface backwards-compatible — older registry shims that only +implement `run` still work; they just don't forward per-analyst +events. + +#### Extends + +- [`AnalystRegistryLike`](#analystregistrylike) + +#### Methods + +##### list() + +> **list**(): readonly `object`[] + +Defined in: [analyst-loop/types.ts:150](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L150) + +###### Returns + +readonly `object`[] + +###### Inherited from + +[`AnalystRegistryLike`](#analystregistrylike).[`list`](#list) + +##### run() + +> **run**(`runId`, `inputs`, `opts?`): `Promise`\<`AnalystRunResult`\> + +Defined in: [analyst-loop/types.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L151) + +###### Parameters + +###### runId + +`string` + +###### inputs + +`AnalystRunInputs` + +###### opts? + +###### priorFindings? + +readonly `AnalystFinding`[] \| `Record`\<`string`, readonly `AnalystFinding`[]\> + +###### Returns + +`Promise`\<`AnalystRunResult`\> + +###### Inherited from + +[`AnalystRegistryLike`](#analystregistrylike).[`run`](#run) + +##### runStream()? + +> `optional` **runStream**(`runId`, `inputs`, `opts?`): `AsyncIterable`\<`AnalystRunEvent`\> + +Defined in: [analyst-loop/types.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L180) + +###### Parameters + +###### runId + +`string` + +###### inputs + +`AnalystRunInputs` + +###### opts? + +###### priorFindings? + +readonly `AnalystFinding`[] \| `Record`\<`string`, readonly `AnalystFinding`[]\> + +###### Returns + +`AsyncIterable`\<`AnalystRunEvent`\> + +## Type Aliases + +### AnalystLoopEvent + +> **AnalystLoopEvent** = \{ `type`: `"baseline-resolved"`; `runId`: `string`; `baselineRunId`: `string` \| `null`; `priorFindingCount`: `number`; \} \| \{ `type`: `"analyst"`; `runId`: `string`; `event`: `AnalystRunEvent`; \} \| \{ `type`: `"findings-persisted"`; `runId`: `string`; `count`: `number`; \} \| \{ `type`: `"diff-computed"`; `runId`: `string`; `baselineRunId`: `string`; `appeared`: `number`; `disappeared`: `number`; `persisted`: `number`; `changed`: `number`; \} \| \{ `type`: `"knowledge-proposed"`; `runId`: `string`; `proposalCount`: `number`; `skipped`: `number`; `errors`: `number`; \} \| \{ `type`: `"knowledge-applied"`; `runId`: `string`; `writtenCount`: `number`; `withheldForReview`: `number`; \} \| \{ `type`: `"improvement-proposed"`; `runId`: `string`; `editCount`: `number`; `skipped`: `number`; `errors`: `number`; \} \| \{ `type`: `"improvement-applied"`; `runId`: `string`; `appliedCount`: `number`; `withheldForReview`: `number`; \} \| \{ `type`: `"loop-completed"`; `runId`: `string`; `durationMs`: `number`; \} + +Defined in: [analyst-loop/types.ts:200](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L200) + +Events emitted by `runAnalystLoop` via `opts.onEvent`. UIs and +JSONL tail-sinks consume this stream. The loop awaits each +callback so a slow sink applies backpressure to the loop's phases +(e.g. an SSE write that takes 200ms delays the next phase by +200ms — the loop never out-paces its observer). + +Forwards registry events verbatim via `analyst` so consumers don't +have to wire two streams. + +#### Union Members + +##### Type Literal + +\{ `type`: `"baseline-resolved"`; `runId`: `string`; `baselineRunId`: `string` \| `null`; `priorFindingCount`: `number`; \} + +*** + +##### Type Literal + +\{ `type`: `"analyst"`; `runId`: `string`; `event`: `AnalystRunEvent`; \} + +###### type + +> **type**: `"analyst"` + +###### runId + +> **runId**: `string` + +###### event + +> **event**: `AnalystRunEvent` + +Forwarded verbatim from `AnalystRegistry.runStream`. + +*** + +##### Type Literal + +\{ `type`: `"findings-persisted"`; `runId`: `string`; `count`: `number`; \} + +*** + +##### Type Literal + +\{ `type`: `"diff-computed"`; `runId`: `string`; `baselineRunId`: `string`; `appeared`: `number`; `disappeared`: `number`; `persisted`: `number`; `changed`: `number`; \} + +*** + +##### Type Literal + +\{ `type`: `"knowledge-proposed"`; `runId`: `string`; `proposalCount`: `number`; `skipped`: `number`; `errors`: `number`; \} + +*** + +##### Type Literal + +\{ `type`: `"knowledge-applied"`; `runId`: `string`; `writtenCount`: `number`; `withheldForReview`: `number`; \} + +*** + +##### Type Literal + +\{ `type`: `"improvement-proposed"`; `runId`: `string`; `editCount`: `number`; `skipped`: `number`; `errors`: `number`; \} + +*** + +##### Type Literal + +\{ `type`: `"improvement-applied"`; `runId`: `string`; `appliedCount`: `number`; `withheldForReview`: `number`; \} + +*** + +##### Type Literal + +\{ `type`: `"loop-completed"`; `runId`: `string`; `durationMs`: `number`; \} + +## Functions + +### iterationsToTraceStore() + +> **iterationsToTraceStore**\<`Task`, `Output`\>(`iterations`, `budgets?`): `TraceAnalysisStore` + +Defined in: [analyst-loop/iterations-to-trace-store.ts:213](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/iterations-to-trace-store.ts#L213) + +Build an in-memory `TraceAnalysisStore` over a loop round's iterations. Fail-loud on an +empty round — there is nothing for an analyst to read, and a silent empty store would +mask a broken capture path. + +#### Type Parameters + +##### Task + +`Task` + +##### Output + +`Output` + +#### Parameters + +##### iterations + +readonly [`Iteration`](runtime.md#iteration-1)\<`Task`, `Output`\>[] + +##### budgets? + +`TraceAnalystByteBudgets` = `DEFAULT_TRACE_ANALYST_BUDGETS` + +#### Returns + +`TraceAnalysisStore` + +*** + +### runAnalystLoop() + +> **runAnalystLoop**\<`TProposal`, `TEdit`\>(`opts`): `Promise`\<[`RunAnalystLoopResult`](#runanalystloopresult)\<`TProposal`, `TEdit`\>\> + +Defined in: [analyst-loop/run-analyst-loop.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/run-analyst-loop.ts#L32) + +#### Type Parameters + +##### TProposal + +`TProposal` = `unknown` + +##### TEdit + +`TEdit` = `unknown` + +#### Parameters + +##### opts + +[`RunAnalystLoopOpts`](#runanalystloopopts) + +#### Returns + +`Promise`\<[`RunAnalystLoopResult`](#runanalystloopresult)\<`TProposal`, `TEdit`\>\> diff --git a/docs/api/analyst-loop/README.md b/docs/api/analyst-loop/README.md deleted file mode 100644 index 3a31235..0000000 --- a/docs/api/analyst-loop/README.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../README.md) - -*** - -[@tangle-network/agent-runtime](../README.md) / analyst-loop - -# analyst-loop - -## Interfaces - -- [KnowledgeAdapter](interfaces/KnowledgeAdapter.md) -- [KnowledgeProposalBatch](interfaces/KnowledgeProposalBatch.md) -- [ImprovementAdapter](interfaces/ImprovementAdapter.md) -- [ImprovementEditBatch](interfaces/ImprovementEditBatch.md) -- [AutoApplyPolicy](interfaces/AutoApplyPolicy.md) -- [RunAnalystLoopOpts](interfaces/RunAnalystLoopOpts.md) -- [RunAnalystLoopResult](interfaces/RunAnalystLoopResult.md) -- [KnowledgeReport](interfaces/KnowledgeReport.md) -- [ImprovementReport](interfaces/ImprovementReport.md) -- [AnalystRegistryLike](interfaces/AnalystRegistryLike.md) -- [FindingsStoreLike](interfaces/FindingsStoreLike.md) -- [AnalystRegistryStreamingLike](interfaces/AnalystRegistryStreamingLike.md) - -## Type Aliases - -- [AnalystLoopEvent](type-aliases/AnalystLoopEvent.md) - -## Functions - -- [iterationsToTraceStore](functions/iterationsToTraceStore.md) -- [runAnalystLoop](functions/runAnalystLoop.md) diff --git a/docs/api/analyst-loop/functions/iterationsToTraceStore.md b/docs/api/analyst-loop/functions/iterationsToTraceStore.md deleted file mode 100644 index f4dd174..0000000 --- a/docs/api/analyst-loop/functions/iterationsToTraceStore.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [analyst-loop](../README.md) / iterationsToTraceStore - -# Function: iterationsToTraceStore() - -> **iterationsToTraceStore**\<`Task`, `Output`\>(`iterations`, `budgets?`): `TraceAnalysisStore` - -Defined in: [analyst-loop/iterations-to-trace-store.ts:213](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/iterations-to-trace-store.ts#L213) - -Build an in-memory `TraceAnalysisStore` over a loop round's iterations. Fail-loud on an -empty round — there is nothing for an analyst to read, and a silent empty store would -mask a broken capture path. - -## Type Parameters - -### Task - -`Task` - -### Output - -`Output` - -## Parameters - -### iterations - -readonly [`Iteration`](../../runtime/interfaces/Iteration.md)\<`Task`, `Output`\>[] - -### budgets? - -`TraceAnalystByteBudgets` = `DEFAULT_TRACE_ANALYST_BUDGETS` - -## Returns - -`TraceAnalysisStore` diff --git a/docs/api/analyst-loop/functions/runAnalystLoop.md b/docs/api/analyst-loop/functions/runAnalystLoop.md deleted file mode 100644 index fef507f..0000000 --- a/docs/api/analyst-loop/functions/runAnalystLoop.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [analyst-loop](../README.md) / runAnalystLoop - -# Function: runAnalystLoop() - -> **runAnalystLoop**\<`TProposal`, `TEdit`\>(`opts`): `Promise`\<[`RunAnalystLoopResult`](../interfaces/RunAnalystLoopResult.md)\<`TProposal`, `TEdit`\>\> - -Defined in: [analyst-loop/run-analyst-loop.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/run-analyst-loop.ts#L32) - -## Type Parameters - -### TProposal - -`TProposal` = `unknown` - -### TEdit - -`TEdit` = `unknown` - -## Parameters - -### opts - -[`RunAnalystLoopOpts`](../interfaces/RunAnalystLoopOpts.md) - -## Returns - -`Promise`\<[`RunAnalystLoopResult`](../interfaces/RunAnalystLoopResult.md)\<`TProposal`, `TEdit`\>\> diff --git a/docs/api/analyst-loop/interfaces/AnalystRegistryLike.md b/docs/api/analyst-loop/interfaces/AnalystRegistryLike.md deleted file mode 100644 index cdf1ae7..0000000 --- a/docs/api/analyst-loop/interfaces/AnalystRegistryLike.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [analyst-loop](../README.md) / AnalystRegistryLike - -# Interface: AnalystRegistryLike - -Defined in: [analyst-loop/types.ts:149](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L149) - -Narrowed shape we accept for `AnalystRegistry` so the orchestrator -remains testable without instantiating the real class. The real -class satisfies this trivially. - -## Extended by - -- [`AnalystRegistryStreamingLike`](AnalystRegistryStreamingLike.md) - -## Methods - -### list() - -> **list**(): readonly `object`[] - -Defined in: [analyst-loop/types.ts:150](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L150) - -#### Returns - -readonly `object`[] - -*** - -### run() - -> **run**(`runId`, `inputs`, `opts?`): `Promise`\<`AnalystRunResult`\> - -Defined in: [analyst-loop/types.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L151) - -#### Parameters - -##### runId - -`string` - -##### inputs - -`AnalystRunInputs` - -##### opts? - -###### priorFindings? - -readonly `AnalystFinding`[] \| `Record`\<`string`, readonly `AnalystFinding`[]\> - -#### Returns - -`Promise`\<`AnalystRunResult`\> diff --git a/docs/api/analyst-loop/interfaces/AnalystRegistryStreamingLike.md b/docs/api/analyst-loop/interfaces/AnalystRegistryStreamingLike.md deleted file mode 100644 index e097b77..0000000 --- a/docs/api/analyst-loop/interfaces/AnalystRegistryStreamingLike.md +++ /dev/null @@ -1,96 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [analyst-loop](../README.md) / AnalystRegistryStreamingLike - -# Interface: AnalystRegistryStreamingLike - -Defined in: [analyst-loop/types.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L179) - -Narrow the `AnalystRegistryLike` further when we need streaming: the -loop checks if the registry exposes `runStream` and uses it when -present, falling back to `run()` otherwise. This keeps the type -surface backwards-compatible — older registry shims that only -implement `run` still work; they just don't forward per-analyst -events. - -## Extends - -- [`AnalystRegistryLike`](AnalystRegistryLike.md) - -## Methods - -### list() - -> **list**(): readonly `object`[] - -Defined in: [analyst-loop/types.ts:150](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L150) - -#### Returns - -readonly `object`[] - -#### Inherited from - -[`AnalystRegistryLike`](AnalystRegistryLike.md).[`list`](AnalystRegistryLike.md#list) - -*** - -### run() - -> **run**(`runId`, `inputs`, `opts?`): `Promise`\<`AnalystRunResult`\> - -Defined in: [analyst-loop/types.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L151) - -#### Parameters - -##### runId - -`string` - -##### inputs - -`AnalystRunInputs` - -##### opts? - -###### priorFindings? - -readonly `AnalystFinding`[] \| `Record`\<`string`, readonly `AnalystFinding`[]\> - -#### Returns - -`Promise`\<`AnalystRunResult`\> - -#### Inherited from - -[`AnalystRegistryLike`](AnalystRegistryLike.md).[`run`](AnalystRegistryLike.md#run) - -*** - -### runStream()? - -> `optional` **runStream**(`runId`, `inputs`, `opts?`): `AsyncIterable`\<`AnalystRunEvent`\> - -Defined in: [analyst-loop/types.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L180) - -#### Parameters - -##### runId - -`string` - -##### inputs - -`AnalystRunInputs` - -##### opts? - -###### priorFindings? - -readonly `AnalystFinding`[] \| `Record`\<`string`, readonly `AnalystFinding`[]\> - -#### Returns - -`AsyncIterable`\<`AnalystRunEvent`\> diff --git a/docs/api/analyst-loop/interfaces/AutoApplyPolicy.md b/docs/api/analyst-loop/interfaces/AutoApplyPolicy.md deleted file mode 100644 index 9599005..0000000 --- a/docs/api/analyst-loop/interfaces/AutoApplyPolicy.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [analyst-loop](../README.md) / AutoApplyPolicy - -# Interface: AutoApplyPolicy - -Defined in: [analyst-loop/types.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L65) - -Tunable safety rails for auto-apply. - -## Properties - -### knowledge? - -> `optional` **knowledge?**: `boolean` - -Defined in: [analyst-loop/types.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L67) - -When true AND `knowledgeAdapter.apply` exists, write knowledge proposals. - -*** - -### knowledgeConfidenceThreshold? - -> `optional` **knowledgeConfidenceThreshold?**: `number` - -Defined in: [analyst-loop/types.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L69) - -Minimum source-finding confidence required to auto-apply a knowledge proposal. - -*** - -### improvement? - -> `optional` **improvement?**: `boolean` - -Defined in: [analyst-loop/types.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L71) - -When true AND `improvementAdapter.apply` exists, apply improvement edits. - -*** - -### improvementConfidenceThreshold? - -> `optional` **improvementConfidenceThreshold?**: `number` - -Defined in: [analyst-loop/types.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L73) - -Minimum source-finding confidence required to auto-apply an improvement edit. diff --git a/docs/api/analyst-loop/interfaces/FindingsStoreLike.md b/docs/api/analyst-loop/interfaces/FindingsStoreLike.md deleted file mode 100644 index 2a4179c..0000000 --- a/docs/api/analyst-loop/interfaces/FindingsStoreLike.md +++ /dev/null @@ -1,63 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [analyst-loop](../README.md) / FindingsStoreLike - -# Interface: FindingsStoreLike - -Defined in: [analyst-loop/types.ts:162](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L162) - -Narrowed shape we accept for `FindingsStore`. - -## Methods - -### loadAll() - -> **loadAll**(): readonly `AnalystFinding` & `object`[] - -Defined in: [analyst-loop/types.ts:163](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L163) - -#### Returns - -readonly `AnalystFinding` & `object`[] - -*** - -### loadRun() - -> **loadRun**(`runId`): readonly `AnalystFinding` & `object`[] - -Defined in: [analyst-loop/types.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L164) - -#### Parameters - -##### runId - -`string` - -#### Returns - -readonly `AnalystFinding` & `object`[] - -*** - -### append() - -> **append**(`runId`, `findings`): `Promise`\<`void`\> - -Defined in: [analyst-loop/types.ts:165](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L165) - -#### Parameters - -##### runId - -`string` - -##### findings - -readonly `AnalystFinding`[] - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/analyst-loop/interfaces/ImprovementAdapter.md b/docs/api/analyst-loop/interfaces/ImprovementAdapter.md deleted file mode 100644 index 56fc7e5..0000000 --- a/docs/api/analyst-loop/interfaces/ImprovementAdapter.md +++ /dev/null @@ -1,53 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [analyst-loop](../README.md) / ImprovementAdapter - -# Interface: ImprovementAdapter\ - -Defined in: [analyst-loop/types.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L51) - -Improvement-side bridge — proposes / applies prompt + tool + scaffolding edits. - -## Type Parameters - -### TEdit - -`TEdit` = `unknown` - -## Methods - -### proposeFromFindings() - -> **proposeFromFindings**(`findings`): [`ImprovementEditBatch`](ImprovementEditBatch.md)\<`TEdit`\> \| `Promise`\<[`ImprovementEditBatch`](ImprovementEditBatch.md)\<`TEdit`\>\> - -Defined in: [analyst-loop/types.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L52) - -#### Parameters - -##### findings - -readonly `AnalystFinding`[] - -#### Returns - -[`ImprovementEditBatch`](ImprovementEditBatch.md)\<`TEdit`\> \| `Promise`\<[`ImprovementEditBatch`](ImprovementEditBatch.md)\<`TEdit`\>\> - -*** - -### apply()? - -> `optional` **apply**(`edits`): `Promise`\<\{ `applied`: `string`[]; `warnings`: `string`[]; \}\> - -Defined in: [analyst-loop/types.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L55) - -#### Parameters - -##### edits - -readonly `TEdit`[] - -#### Returns - -`Promise`\<\{ `applied`: `string`[]; `warnings`: `string`[]; \}\> diff --git a/docs/api/analyst-loop/interfaces/ImprovementEditBatch.md b/docs/api/analyst-loop/interfaces/ImprovementEditBatch.md deleted file mode 100644 index d6876bc..0000000 --- a/docs/api/analyst-loop/interfaces/ImprovementEditBatch.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [analyst-loop](../README.md) / ImprovementEditBatch - -# Interface: ImprovementEditBatch\ - -Defined in: [analyst-loop/types.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L58) - -## Type Parameters - -### TEdit - -`TEdit` = `unknown` - -## Properties - -### edits - -> **edits**: `TEdit`[] - -Defined in: [analyst-loop/types.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L59) - -*** - -### skipped - -> **skipped**: `number` - -Defined in: [analyst-loop/types.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L60) - -*** - -### errors - -> **errors**: `object`[] - -Defined in: [analyst-loop/types.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L61) - -#### findingId - -> **findingId**: `string` - -#### subject - -> **subject**: `string` - -#### message - -> **message**: `string` diff --git a/docs/api/analyst-loop/interfaces/ImprovementReport.md b/docs/api/analyst-loop/interfaces/ImprovementReport.md deleted file mode 100644 index d25dd76..0000000 --- a/docs/api/analyst-loop/interfaces/ImprovementReport.md +++ /dev/null @@ -1,67 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [analyst-loop](../README.md) / ImprovementReport - -# Interface: ImprovementReport\ - -Defined in: [analyst-loop/types.ts:136](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L136) - -## Type Parameters - -### TEdit - -`TEdit` = `unknown` - -## Properties - -### edits - -> **edits**: `TEdit`[] - -Defined in: [analyst-loop/types.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L137) - -*** - -### applied - -> **applied**: `string`[] - -Defined in: [analyst-loop/types.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L138) - -*** - -### skipped - -> **skipped**: `number` - -Defined in: [analyst-loop/types.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L139) - -*** - -### errors - -> **errors**: `object`[] - -Defined in: [analyst-loop/types.ts:140](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L140) - -#### findingId - -> **findingId**: `string` - -#### subject - -> **subject**: `string` - -#### message - -> **message**: `string` - -*** - -### withheld\_for\_review - -> **withheld\_for\_review**: `number` - -Defined in: [analyst-loop/types.ts:141](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L141) diff --git a/docs/api/analyst-loop/interfaces/KnowledgeAdapter.md b/docs/api/analyst-loop/interfaces/KnowledgeAdapter.md deleted file mode 100644 index 63328f4..0000000 --- a/docs/api/analyst-loop/interfaces/KnowledgeAdapter.md +++ /dev/null @@ -1,63 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [analyst-loop](../README.md) / KnowledgeAdapter - -# Interface: KnowledgeAdapter\ - -Defined in: [analyst-loop/types.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L25) - -Knowledge-side bridge — consumers wire `proposeFromFindings` from agent-knowledge. - -## Type Parameters - -### TProposal - -`TProposal` = `unknown` - -## Methods - -### proposeFromFindings() - -> **proposeFromFindings**(`findings`): [`KnowledgeProposalBatch`](KnowledgeProposalBatch.md)\<`TProposal`\> \| `Promise`\<[`KnowledgeProposalBatch`](KnowledgeProposalBatch.md)\<`TProposal`\>\> - -Defined in: [analyst-loop/types.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L32) - -Convert a findings batch into proposals. Returns the partitioned -result so the loop can report (and optionally fail on) malformed -findings. Implementations SHOULD honour the convention "non- -knowledge subjects return null and are counted in `skipped`." - -#### Parameters - -##### findings - -readonly `AnalystFinding`[] - -#### Returns - -[`KnowledgeProposalBatch`](KnowledgeProposalBatch.md)\<`TProposal`\> \| `Promise`\<[`KnowledgeProposalBatch`](KnowledgeProposalBatch.md)\<`TProposal`\>\> - -*** - -### apply()? - -> `optional` **apply**(`proposals`): `Promise`\<\{ `written`: `string`[]; `warnings`: `string`[]; \}\> - -Defined in: [analyst-loop/types.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L41) - -Optional auto-apply. The loop calls this only when -`autoApply.knowledge` is true AND the proposal's source-finding -confidence ≥ `autoApply.knowledgeConfidenceThreshold`. Anything -below the threshold is returned in the report but never written. - -#### Parameters - -##### proposals - -readonly `TProposal`[] - -#### Returns - -`Promise`\<\{ `written`: `string`[]; `warnings`: `string`[]; \}\> diff --git a/docs/api/analyst-loop/interfaces/KnowledgeProposalBatch.md b/docs/api/analyst-loop/interfaces/KnowledgeProposalBatch.md deleted file mode 100644 index a80df63..0000000 --- a/docs/api/analyst-loop/interfaces/KnowledgeProposalBatch.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [analyst-loop](../README.md) / KnowledgeProposalBatch - -# Interface: KnowledgeProposalBatch\ - -Defined in: [analyst-loop/types.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L44) - -## Type Parameters - -### TProposal - -`TProposal` = `unknown` - -## Properties - -### proposals - -> **proposals**: `TProposal`[] - -Defined in: [analyst-loop/types.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L45) - -*** - -### skipped - -> **skipped**: `number` - -Defined in: [analyst-loop/types.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L46) - -*** - -### errors - -> **errors**: `object`[] - -Defined in: [analyst-loop/types.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L47) - -#### findingId - -> **findingId**: `string` - -#### subject - -> **subject**: `string` - -#### message - -> **message**: `string` diff --git a/docs/api/analyst-loop/interfaces/KnowledgeReport.md b/docs/api/analyst-loop/interfaces/KnowledgeReport.md deleted file mode 100644 index 6b80469..0000000 --- a/docs/api/analyst-loop/interfaces/KnowledgeReport.md +++ /dev/null @@ -1,67 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [analyst-loop](../README.md) / KnowledgeReport - -# Interface: KnowledgeReport\ - -Defined in: [analyst-loop/types.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L128) - -## Type Parameters - -### TProposal - -`TProposal` = `unknown` - -## Properties - -### proposals - -> **proposals**: `TProposal`[] - -Defined in: [analyst-loop/types.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L129) - -*** - -### applied - -> **applied**: `string`[] - -Defined in: [analyst-loop/types.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L130) - -*** - -### skipped - -> **skipped**: `number` - -Defined in: [analyst-loop/types.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L131) - -*** - -### errors - -> **errors**: `object`[] - -Defined in: [analyst-loop/types.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L132) - -#### findingId - -> **findingId**: `string` - -#### subject - -> **subject**: `string` - -#### message - -> **message**: `string` - -*** - -### withheld\_for\_review - -> **withheld\_for\_review**: `number` - -Defined in: [analyst-loop/types.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L133) diff --git a/docs/api/analyst-loop/interfaces/RunAnalystLoopOpts.md b/docs/api/analyst-loop/interfaces/RunAnalystLoopOpts.md deleted file mode 100644 index f27e17a..0000000 --- a/docs/api/analyst-loop/interfaces/RunAnalystLoopOpts.md +++ /dev/null @@ -1,155 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [analyst-loop](../README.md) / RunAnalystLoopOpts - -# Interface: RunAnalystLoopOpts - -Defined in: [analyst-loop/types.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L76) - -## Properties - -### runId - -> **runId**: `string` - -Defined in: [analyst-loop/types.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L78) - -The run id of the work being analysed. - -*** - -### registry - -> **registry**: [`AnalystRegistryLike`](AnalystRegistryLike.md) - -Defined in: [analyst-loop/types.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L80) - -The registry — pre-populated with the analyst kinds the consumer wants. - -*** - -### inputs - -> **inputs**: `AnalystRunInputs` - -Defined in: [analyst-loop/types.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L82) - -Inputs forwarded to `registry.run` — typically `{ traceStore }`. - -*** - -### findingsStore - -> **findingsStore**: [`FindingsStoreLike`](FindingsStoreLike.md) \| `null` - -Defined in: [analyst-loop/types.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L88) - -Findings ledger. The loop appends the new run + diffs against the -baseline run before running adapters. Pass `null` to skip -persistence (useful for one-shot analyses). - -*** - -### baselineRunId? - -> `optional` **baselineRunId?**: `string` \| `null` - -Defined in: [analyst-loop/types.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L95) - -Prior run id whose findings the loop reads + provides to analysts -as `priorFindings` AND diffs against. When omitted, the loop picks -the most recent run in the store (excluding `runId` itself); pass -`null` to explicitly start with an empty baseline. - -*** - -### priorFindingsStrategy? - -> `optional` **priorFindingsStrategy?**: `"none"` \| `"per-kind"` \| `"wildcard"` - -Defined in: [analyst-loop/types.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L97) - -Strategy for forwarding prior findings into `ctx.priorFindings`. - -*** - -### knowledgeAdapter? - -> `optional` **knowledgeAdapter?**: [`KnowledgeAdapter`](KnowledgeAdapter.md)\<`unknown`\> - -Defined in: [analyst-loop/types.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L99) - -Knowledge-side bridge — usually `agent-knowledge`'s `proposeFromFindings`. - -*** - -### improvementAdapter? - -> `optional` **improvementAdapter?**: [`ImprovementAdapter`](ImprovementAdapter.md)\<`unknown`\> - -Defined in: [analyst-loop/types.ts:101](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L101) - -Improvement-side bridge — usually a consumer-specific prompt/tool diff producer. - -*** - -### autoApply? - -> `optional` **autoApply?**: [`AutoApplyPolicy`](AutoApplyPolicy.md) - -Defined in: [analyst-loop/types.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L103) - -Auto-apply rails. Default off; review-then-apply is the safer default. - -*** - -### log? - -> `optional` **log?**: (`msg`, `fields?`) => `void` - -Defined in: [analyst-loop/types.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L105) - -Optional logger. Defaults to `console.log` for `[analyst-loop]` lines. - -#### Parameters - -##### msg - -`string` - -##### fields? - -`Record`\<`string`, `unknown`\> - -#### Returns - -`void` - -*** - -### onEvent? - -> `optional` **onEvent?**: (`event`) => `void` \| `Promise`\<`void`\> - -Defined in: [analyst-loop/types.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L116) - -Event sink for live progress. Called for every phase of the loop: -baseline resolution, registry events forwarded from `runStream`, -ledger persistence, diff, knowledge / improvement proposals + -apply outcomes, and the terminal `loop-completed`. Awaited so -slow sinks (SSE write, JSONL append) apply backpressure. - -The callback MUST NOT throw — exceptions propagate and abort the -loop. Catch + swallow internally if your sink is unreliable. - -#### Parameters - -##### event - -[`AnalystLoopEvent`](../type-aliases/AnalystLoopEvent.md) - -#### Returns - -`void` \| `Promise`\<`void`\> diff --git a/docs/api/analyst-loop/interfaces/RunAnalystLoopResult.md b/docs/api/analyst-loop/interfaces/RunAnalystLoopResult.md deleted file mode 100644 index 452034c..0000000 --- a/docs/api/analyst-loop/interfaces/RunAnalystLoopResult.md +++ /dev/null @@ -1,67 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [analyst-loop](../README.md) / RunAnalystLoopResult - -# Interface: RunAnalystLoopResult\ - -Defined in: [analyst-loop/types.ts:119](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L119) - -## Type Parameters - -### TProposal - -`TProposal` = `unknown` - -### TEdit - -`TEdit` = `unknown` - -## Properties - -### runId - -> **runId**: `string` - -Defined in: [analyst-loop/types.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L120) - -*** - -### baselineRunId - -> **baselineRunId**: `string` \| `null` - -Defined in: [analyst-loop/types.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L121) - -*** - -### analystResult - -> **analystResult**: `AnalystRunResult` - -Defined in: [analyst-loop/types.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L122) - -*** - -### diff - -> **diff**: `FindingsDiff` \| `null` - -Defined in: [analyst-loop/types.ts:123](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L123) - -*** - -### knowledge - -> **knowledge**: [`KnowledgeReport`](KnowledgeReport.md)\<`TProposal`\> \| `null` - -Defined in: [analyst-loop/types.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L124) - -*** - -### improvement - -> **improvement**: [`ImprovementReport`](ImprovementReport.md)\<`TEdit`\> \| `null` - -Defined in: [analyst-loop/types.ts:125](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L125) diff --git a/docs/api/analyst-loop/type-aliases/AnalystLoopEvent.md b/docs/api/analyst-loop/type-aliases/AnalystLoopEvent.md deleted file mode 100644 index 5aa77fb..0000000 --- a/docs/api/analyst-loop/type-aliases/AnalystLoopEvent.md +++ /dev/null @@ -1,88 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [analyst-loop](../README.md) / AnalystLoopEvent - -# Type Alias: AnalystLoopEvent - -> **AnalystLoopEvent** = \{ `type`: `"baseline-resolved"`; `runId`: `string`; `baselineRunId`: `string` \| `null`; `priorFindingCount`: `number`; \} \| \{ `type`: `"analyst"`; `runId`: `string`; `event`: `AnalystRunEvent`; \} \| \{ `type`: `"findings-persisted"`; `runId`: `string`; `count`: `number`; \} \| \{ `type`: `"diff-computed"`; `runId`: `string`; `baselineRunId`: `string`; `appeared`: `number`; `disappeared`: `number`; `persisted`: `number`; `changed`: `number`; \} \| \{ `type`: `"knowledge-proposed"`; `runId`: `string`; `proposalCount`: `number`; `skipped`: `number`; `errors`: `number`; \} \| \{ `type`: `"knowledge-applied"`; `runId`: `string`; `writtenCount`: `number`; `withheldForReview`: `number`; \} \| \{ `type`: `"improvement-proposed"`; `runId`: `string`; `editCount`: `number`; `skipped`: `number`; `errors`: `number`; \} \| \{ `type`: `"improvement-applied"`; `runId`: `string`; `appliedCount`: `number`; `withheldForReview`: `number`; \} \| \{ `type`: `"loop-completed"`; `runId`: `string`; `durationMs`: `number`; \} - -Defined in: [analyst-loop/types.ts:200](https://github.com/tangle-network/agent-runtime/blob/main/src/analyst-loop/types.ts#L200) - -Events emitted by `runAnalystLoop` via `opts.onEvent`. UIs and -JSONL tail-sinks consume this stream. The loop awaits each -callback so a slow sink applies backpressure to the loop's phases -(e.g. an SSE write that takes 200ms delays the next phase by -200ms — the loop never out-paces its observer). - -Forwards registry events verbatim via `analyst` so consumers don't -have to wire two streams. - -## Union Members - -### Type Literal - -\{ `type`: `"baseline-resolved"`; `runId`: `string`; `baselineRunId`: `string` \| `null`; `priorFindingCount`: `number`; \} - -*** - -### Type Literal - -\{ `type`: `"analyst"`; `runId`: `string`; `event`: `AnalystRunEvent`; \} - -#### type - -> **type**: `"analyst"` - -#### runId - -> **runId**: `string` - -#### event - -> **event**: `AnalystRunEvent` - -Forwarded verbatim from `AnalystRegistry.runStream`. - -*** - -### Type Literal - -\{ `type`: `"findings-persisted"`; `runId`: `string`; `count`: `number`; \} - -*** - -### Type Literal - -\{ `type`: `"diff-computed"`; `runId`: `string`; `baselineRunId`: `string`; `appeared`: `number`; `disappeared`: `number`; `persisted`: `number`; `changed`: `number`; \} - -*** - -### Type Literal - -\{ `type`: `"knowledge-proposed"`; `runId`: `string`; `proposalCount`: `number`; `skipped`: `number`; `errors`: `number`; \} - -*** - -### Type Literal - -\{ `type`: `"knowledge-applied"`; `runId`: `string`; `writtenCount`: `number`; `withheldForReview`: `number`; \} - -*** - -### Type Literal - -\{ `type`: `"improvement-proposed"`; `runId`: `string`; `editCount`: `number`; `skipped`: `number`; `errors`: `number`; \} - -*** - -### Type Literal - -\{ `type`: `"improvement-applied"`; `runId`: `string`; `appliedCount`: `number`; `withheldForReview`: `number`; \} - -*** - -### Type Literal - -\{ `type`: `"loop-completed"`; `runId`: `string`; `durationMs`: `number`; \} diff --git a/docs/api/audit.md b/docs/api/audit.md new file mode 100644 index 0000000..5cfa276 --- /dev/null +++ b/docs/api/audit.md @@ -0,0 +1,343 @@ +[**@tangle-network/agent-runtime**](README.md) + +*** + +[@tangle-network/agent-runtime](README.md) / audit + +# audit + +## Interfaces + +### AuditRegistry + +Defined in: [audit/issue-writer.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L30) + +**`Experimental`** + +#### Properties + +##### schemaVersion + +> **schemaVersion**: `1` + +Defined in: [audit/issue-writer.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L31) + +**`Experimental`** + +##### findings + +> **findings**: [`UiFinding`](profiles.md#uifinding)[] + +Defined in: [audit/issue-writer.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L32) + +**`Experimental`** + +##### routes + +> **routes**: `Record`\<`string`, \{ `url?`: `string`; `captures`: [`AuditRegistryCapture`](#auditregistrycapture)[]; \}\> + +Defined in: [audit/issue-writer.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L34) + +**`Experimental`** + +Route → URL + captures sidecar; preserved across runs. + +*** + +### AuditRegistryCapture + +Defined in: [audit/issue-writer.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L38) + +**`Experimental`** + +#### Properties + +##### file + +> **file**: `string` + +Defined in: [audit/issue-writer.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L39) + +**`Experimental`** + +##### viewport? + +> `optional` **viewport?**: `string` + +Defined in: [audit/issue-writer.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L40) + +**`Experimental`** + +##### fullPage? + +> `optional` **fullPage?**: `boolean` + +Defined in: [audit/issue-writer.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L41) + +**`Experimental`** + +##### elementSelector? + +> `optional` **elementSelector?**: `string` + +Defined in: [audit/issue-writer.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L42) + +**`Experimental`** + +##### capturedAt + +> **capturedAt**: `string` + +Defined in: [audit/issue-writer.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L43) + +**`Experimental`** + +*** + +### AppendFindingsResult + +Defined in: [audit/issue-writer.ts:254](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L254) + +**`Experimental`** + +#### Properties + +##### written + +> **written**: [`UiFinding`](profiles.md#uifinding)[] + +Defined in: [audit/issue-writer.ts:256](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L256) + +**`Experimental`** + +Findings with id + createdAt assigned, in input order. + +##### files + +> **files**: `string`[] + +Defined in: [audit/issue-writer.ts:258](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L258) + +**`Experimental`** + +Workspace-relative path to each issue Markdown file, in input order. + +*** + +### RegisterCapturesOptions + +Defined in: [audit/issue-writer.ts:336](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L336) + +**`Experimental`** + +#### Properties + +##### route + +> **route**: `string` + +Defined in: [audit/issue-writer.ts:337](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L337) + +**`Experimental`** + +##### url? + +> `optional` **url?**: `string` + +Defined in: [audit/issue-writer.ts:338](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L338) + +**`Experimental`** + +##### captures + +> **captures**: readonly [`AuditRegistryCapture`](#auditregistrycapture)[] + +Defined in: [audit/issue-writer.ts:339](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L339) + +**`Experimental`** + +*** + +### AuditIndex + +Defined in: [audit/issue-writer.ts:369](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L369) + +**`Experimental`** + +#### Properties + +##### total + +> **total**: `number` + +Defined in: [audit/issue-writer.ts:371](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L371) + +**`Experimental`** + +Total findings in the workspace. + +##### bySeverity + +> **bySeverity**: `Record`\<[`UiFinding`](profiles.md#uifinding)\[`"severity"`\], `number`\> + +Defined in: [audit/issue-writer.ts:372](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L372) + +**`Experimental`** + +##### byLens + +> **byLens**: `Partial`\<`Record`\<[`UiLens`](profiles.md#uilens), `number`\>\> + +Defined in: [audit/issue-writer.ts:373](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L373) + +**`Experimental`** + +##### byRoute + +> **byRoute**: `Record`\<`string`, `number`\> + +Defined in: [audit/issue-writer.ts:374](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L374) + +**`Experimental`** + +## Functions + +### initAuditWorkspace() + +> **initAuditWorkspace**(`workspaceDir`): `Promise`\<`void`\> + +Defined in: [audit/issue-writer.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L78) + +**`Experimental`** + +#### Parameters + +##### workspaceDir + +`string` + +#### Returns + +`Promise`\<`void`\> + +*** + +### readAuditRegistry() + +> **readAuditRegistry**(`workspaceDir`): `Promise`\<[`AuditRegistry`](#auditregistry)\> + +Defined in: [audit/issue-writer.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L92) + +**`Experimental`** + +#### Parameters + +##### workspaceDir + +`string` + +#### Returns + +`Promise`\<[`AuditRegistry`](#auditregistry)\> + +*** + +### appendFindings() + +> **appendFindings**(`workspaceDir`, `findings`): `Promise`\<[`AppendFindingsResult`](#appendfindingsresult)\> + +Defined in: [audit/issue-writer.ts:272](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L272) + +**`Experimental`** + +Append findings to a workspace, writing one Markdown file per finding +and updating registry.json. Assigns monotonically increasing ids to +findings that arrived without one. + +Findings already carrying an id that collides with the registry are +rejected — callers must either freshly mint findings (id undefined) or +use a separate update path. This protects against accidental overwrite. + +#### Parameters + +##### workspaceDir + +`string` + +##### findings + +readonly [`UiFinding`](profiles.md#uifinding)[] + +#### Returns + +`Promise`\<[`AppendFindingsResult`](#appendfindingsresult)\> + +*** + +### registerCaptures() + +> **registerCaptures**(`workspaceDir`, `options`): `Promise`\<`void`\> + +Defined in: [audit/issue-writer.ts:349](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L349) + +**`Experimental`** + +Record screenshots taken for a route in the registry, without filing a +finding. Useful when the auditor wants to remember which captures +exist for resume / dedup purposes. + +#### Parameters + +##### workspaceDir + +`string` + +##### options + +[`RegisterCapturesOptions`](#registercapturesoptions) + +#### Returns + +`Promise`\<`void`\> + +*** + +### summarizeRegistry() + +> **summarizeRegistry**(`reg`): [`AuditIndex`](#auditindex) + +Defined in: [audit/issue-writer.ts:378](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L378) + +**`Experimental`** + +#### Parameters + +##### reg + +[`AuditRegistry`](#auditregistry) + +#### Returns + +[`AuditIndex`](#auditindex) + +*** + +### writeAuditIndex() + +> **writeAuditIndex**(`workspaceDir`): `Promise`\<`string`\> + +Defined in: [audit/issue-writer.ts:400](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L400) + +**`Experimental`** + +Regenerate `/index.md` from registry.json. + +#### Parameters + +##### workspaceDir + +`string` + +#### Returns + +`Promise`\<`string`\> diff --git a/docs/api/audit/README.md b/docs/api/audit/README.md deleted file mode 100644 index ab6dbf0..0000000 --- a/docs/api/audit/README.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@tangle-network/agent-runtime**](../README.md) - -*** - -[@tangle-network/agent-runtime](../README.md) / audit - -# audit - -## Interfaces - -- [AuditRegistry](interfaces/AuditRegistry.md) -- [AuditRegistryCapture](interfaces/AuditRegistryCapture.md) -- [AppendFindingsResult](interfaces/AppendFindingsResult.md) -- [RegisterCapturesOptions](interfaces/RegisterCapturesOptions.md) -- [AuditIndex](interfaces/AuditIndex.md) - -## Functions - -- [initAuditWorkspace](functions/initAuditWorkspace.md) -- [readAuditRegistry](functions/readAuditRegistry.md) -- [appendFindings](functions/appendFindings.md) -- [registerCaptures](functions/registerCaptures.md) -- [summarizeRegistry](functions/summarizeRegistry.md) -- [writeAuditIndex](functions/writeAuditIndex.md) diff --git a/docs/api/audit/functions/appendFindings.md b/docs/api/audit/functions/appendFindings.md deleted file mode 100644 index 6b6ae01..0000000 --- a/docs/api/audit/functions/appendFindings.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [audit](../README.md) / appendFindings - -# Function: appendFindings() - -> **appendFindings**(`workspaceDir`, `findings`): `Promise`\<[`AppendFindingsResult`](../interfaces/AppendFindingsResult.md)\> - -Defined in: [audit/issue-writer.ts:272](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L272) - -**`Experimental`** - -Append findings to a workspace, writing one Markdown file per finding -and updating registry.json. Assigns monotonically increasing ids to -findings that arrived without one. - -Findings already carrying an id that collides with the registry are -rejected — callers must either freshly mint findings (id undefined) or -use a separate update path. This protects against accidental overwrite. - -## Parameters - -### workspaceDir - -`string` - -### findings - -readonly [`UiFinding`](../../profiles/interfaces/UiFinding.md)[] - -## Returns - -`Promise`\<[`AppendFindingsResult`](../interfaces/AppendFindingsResult.md)\> diff --git a/docs/api/audit/functions/initAuditWorkspace.md b/docs/api/audit/functions/initAuditWorkspace.md deleted file mode 100644 index a3fb901..0000000 --- a/docs/api/audit/functions/initAuditWorkspace.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [audit](../README.md) / initAuditWorkspace - -# Function: initAuditWorkspace() - -> **initAuditWorkspace**(`workspaceDir`): `Promise`\<`void`\> - -Defined in: [audit/issue-writer.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L78) - -**`Experimental`** - -## Parameters - -### workspaceDir - -`string` - -## Returns - -`Promise`\<`void`\> diff --git a/docs/api/audit/functions/readAuditRegistry.md b/docs/api/audit/functions/readAuditRegistry.md deleted file mode 100644 index c4f18a3..0000000 --- a/docs/api/audit/functions/readAuditRegistry.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [audit](../README.md) / readAuditRegistry - -# Function: readAuditRegistry() - -> **readAuditRegistry**(`workspaceDir`): `Promise`\<[`AuditRegistry`](../interfaces/AuditRegistry.md)\> - -Defined in: [audit/issue-writer.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L92) - -**`Experimental`** - -## Parameters - -### workspaceDir - -`string` - -## Returns - -`Promise`\<[`AuditRegistry`](../interfaces/AuditRegistry.md)\> diff --git a/docs/api/audit/functions/registerCaptures.md b/docs/api/audit/functions/registerCaptures.md deleted file mode 100644 index bd21a08..0000000 --- a/docs/api/audit/functions/registerCaptures.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [audit](../README.md) / registerCaptures - -# Function: registerCaptures() - -> **registerCaptures**(`workspaceDir`, `options`): `Promise`\<`void`\> - -Defined in: [audit/issue-writer.ts:349](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L349) - -**`Experimental`** - -Record screenshots taken for a route in the registry, without filing a -finding. Useful when the auditor wants to remember which captures -exist for resume / dedup purposes. - -## Parameters - -### workspaceDir - -`string` - -### options - -[`RegisterCapturesOptions`](../interfaces/RegisterCapturesOptions.md) - -## Returns - -`Promise`\<`void`\> diff --git a/docs/api/audit/functions/summarizeRegistry.md b/docs/api/audit/functions/summarizeRegistry.md deleted file mode 100644 index 8e793cb..0000000 --- a/docs/api/audit/functions/summarizeRegistry.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [audit](../README.md) / summarizeRegistry - -# Function: summarizeRegistry() - -> **summarizeRegistry**(`reg`): [`AuditIndex`](../interfaces/AuditIndex.md) - -Defined in: [audit/issue-writer.ts:378](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L378) - -**`Experimental`** - -## Parameters - -### reg - -[`AuditRegistry`](../interfaces/AuditRegistry.md) - -## Returns - -[`AuditIndex`](../interfaces/AuditIndex.md) diff --git a/docs/api/audit/functions/writeAuditIndex.md b/docs/api/audit/functions/writeAuditIndex.md deleted file mode 100644 index f9dd14b..0000000 --- a/docs/api/audit/functions/writeAuditIndex.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [audit](../README.md) / writeAuditIndex - -# Function: writeAuditIndex() - -> **writeAuditIndex**(`workspaceDir`): `Promise`\<`string`\> - -Defined in: [audit/issue-writer.ts:400](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L400) - -**`Experimental`** - -Regenerate `/index.md` from registry.json. - -## Parameters - -### workspaceDir - -`string` - -## Returns - -`Promise`\<`string`\> diff --git a/docs/api/audit/interfaces/AppendFindingsResult.md b/docs/api/audit/interfaces/AppendFindingsResult.md deleted file mode 100644 index 2588081..0000000 --- a/docs/api/audit/interfaces/AppendFindingsResult.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [audit](../README.md) / AppendFindingsResult - -# Interface: AppendFindingsResult - -Defined in: [audit/issue-writer.ts:254](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L254) - -**`Experimental`** - -## Properties - -### written - -> **written**: [`UiFinding`](../../profiles/interfaces/UiFinding.md)[] - -Defined in: [audit/issue-writer.ts:256](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L256) - -**`Experimental`** - -Findings with id + createdAt assigned, in input order. - -*** - -### files - -> **files**: `string`[] - -Defined in: [audit/issue-writer.ts:258](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L258) - -**`Experimental`** - -Workspace-relative path to each issue Markdown file, in input order. diff --git a/docs/api/audit/interfaces/AuditIndex.md b/docs/api/audit/interfaces/AuditIndex.md deleted file mode 100644 index 463dae4..0000000 --- a/docs/api/audit/interfaces/AuditIndex.md +++ /dev/null @@ -1,53 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [audit](../README.md) / AuditIndex - -# Interface: AuditIndex - -Defined in: [audit/issue-writer.ts:369](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L369) - -**`Experimental`** - -## Properties - -### total - -> **total**: `number` - -Defined in: [audit/issue-writer.ts:371](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L371) - -**`Experimental`** - -Total findings in the workspace. - -*** - -### bySeverity - -> **bySeverity**: `Record`\<[`UiFinding`](../../profiles/interfaces/UiFinding.md)\[`"severity"`\], `number`\> - -Defined in: [audit/issue-writer.ts:372](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L372) - -**`Experimental`** - -*** - -### byLens - -> **byLens**: `Partial`\<`Record`\<[`UiLens`](../../profiles/type-aliases/UiLens.md), `number`\>\> - -Defined in: [audit/issue-writer.ts:373](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L373) - -**`Experimental`** - -*** - -### byRoute - -> **byRoute**: `Record`\<`string`, `number`\> - -Defined in: [audit/issue-writer.ts:374](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L374) - -**`Experimental`** diff --git a/docs/api/audit/interfaces/AuditRegistry.md b/docs/api/audit/interfaces/AuditRegistry.md deleted file mode 100644 index eb4aabf..0000000 --- a/docs/api/audit/interfaces/AuditRegistry.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [audit](../README.md) / AuditRegistry - -# Interface: AuditRegistry - -Defined in: [audit/issue-writer.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L30) - -**`Experimental`** - -## Properties - -### schemaVersion - -> **schemaVersion**: `1` - -Defined in: [audit/issue-writer.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L31) - -**`Experimental`** - -*** - -### findings - -> **findings**: [`UiFinding`](../../profiles/interfaces/UiFinding.md)[] - -Defined in: [audit/issue-writer.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L32) - -**`Experimental`** - -*** - -### routes - -> **routes**: `Record`\<`string`, \{ `url?`: `string`; `captures`: [`AuditRegistryCapture`](AuditRegistryCapture.md)[]; \}\> - -Defined in: [audit/issue-writer.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L34) - -**`Experimental`** - -Route → URL + captures sidecar; preserved across runs. diff --git a/docs/api/audit/interfaces/AuditRegistryCapture.md b/docs/api/audit/interfaces/AuditRegistryCapture.md deleted file mode 100644 index 1f3013e..0000000 --- a/docs/api/audit/interfaces/AuditRegistryCapture.md +++ /dev/null @@ -1,61 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [audit](../README.md) / AuditRegistryCapture - -# Interface: AuditRegistryCapture - -Defined in: [audit/issue-writer.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L38) - -**`Experimental`** - -## Properties - -### file - -> **file**: `string` - -Defined in: [audit/issue-writer.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L39) - -**`Experimental`** - -*** - -### viewport? - -> `optional` **viewport?**: `string` - -Defined in: [audit/issue-writer.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L40) - -**`Experimental`** - -*** - -### fullPage? - -> `optional` **fullPage?**: `boolean` - -Defined in: [audit/issue-writer.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L41) - -**`Experimental`** - -*** - -### elementSelector? - -> `optional` **elementSelector?**: `string` - -Defined in: [audit/issue-writer.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L42) - -**`Experimental`** - -*** - -### capturedAt - -> **capturedAt**: `string` - -Defined in: [audit/issue-writer.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L43) - -**`Experimental`** diff --git a/docs/api/audit/interfaces/RegisterCapturesOptions.md b/docs/api/audit/interfaces/RegisterCapturesOptions.md deleted file mode 100644 index a4e7a17..0000000 --- a/docs/api/audit/interfaces/RegisterCapturesOptions.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [audit](../README.md) / RegisterCapturesOptions - -# Interface: RegisterCapturesOptions - -Defined in: [audit/issue-writer.ts:336](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L336) - -**`Experimental`** - -## Properties - -### route - -> **route**: `string` - -Defined in: [audit/issue-writer.ts:337](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L337) - -**`Experimental`** - -*** - -### url? - -> `optional` **url?**: `string` - -Defined in: [audit/issue-writer.ts:338](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L338) - -**`Experimental`** - -*** - -### captures - -> **captures**: readonly [`AuditRegistryCapture`](AuditRegistryCapture.md)[] - -Defined in: [audit/issue-writer.ts:339](https://github.com/tangle-network/agent-runtime/blob/main/src/audit/issue-writer.ts#L339) - -**`Experimental`** diff --git a/docs/api/improvement.md b/docs/api/improvement.md new file mode 100644 index 0000000..7e9b494 --- /dev/null +++ b/docs/api/improvement.md @@ -0,0 +1,492 @@ +[**@tangle-network/agent-runtime**](README.md) + +*** + +[@tangle-network/agent-runtime](README.md) / improvement + +# improvement + +## Interfaces + +### VerifyResult + +Defined in: [improvement/agentic-generator.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L41) + +Outcome of verifying a candidate worktree. `feedback` (compiler errors, + failing test output) is fed into the next shot when `ok` is false. + +#### Properties + +##### ok + +> **ok**: `boolean` + +Defined in: [improvement/agentic-generator.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L42) + +##### feedback? + +> `optional` **feedback?**: `string` + +Defined in: [improvement/agentic-generator.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L43) + +*** + +### AgenticGeneratorOptions + +Defined in: [improvement/agentic-generator.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L51) + +`@tangle-network/agent-runtime` improvement — the CODE-surface driver for +agent-eval's improvement loop. + +The ONE entry point for optimization is agent-eval's `selfImprove` +(`@tangle-network/agent-eval/contract`) — text/config surfaces, held-out gated, +with `analyzeGeneration` for analyst-fed reflection and `analyzeRuns` / +`fromOtelSpans` / `partitionRunsByAuthoringModel` for production intake + +cohorting. This module supplies only the one genuinely runtime-specific piece: +a CODE-surface `ImprovementDriver` you pass to `selfImprove` as `driver`, which +mutates a git worktree via a pluggable `CandidateGenerator`: + - `reflectiveGenerator` — cheap, no sandbox, applies pre-drafted patches + - `agenticGenerator` — full coding harness in the worktree, multi-shot + +#### Properties + +##### harness? + +> `optional` **harness?**: [`LocalHarness`](mcp.md#localharness) + +Defined in: [improvement/agentic-generator.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L53) + +Local coding harness to run in the worktree. Default `claude`. + +##### timeoutMs? + +> `optional` **timeoutMs?**: `number` + +Defined in: [improvement/agentic-generator.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L55) + +Per-shot wall-clock timeout (ms). Default = `runLocalHarness` default (5m). + +##### buildPrompt? + +> `optional` **buildPrompt?**: (`args`) => `string` + +Defined in: [improvement/agentic-generator.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L58) + +Build the harness task prompt from the report + findings. Override for + domain phrasing; the default turns findings into a concrete coder task. + +###### Parameters + +###### args + +###### report + +`unknown` + +###### findings + +`AnalystFinding`[] + +###### Returns + +`string` + +##### verify? + +> `optional` **verify?**: [`Verifier`](#verifier) + +Defined in: [improvement/agentic-generator.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L64) + +Verify the worktree after each dirtying shot. When set, a candidate that + fails verification is NOT returned — the failure feeds the next shot + (verify-in-session), up to `maxShots`; a candidate that never verifies is + discarded (`applied:false`), never shipped. Omitted ⇒ legacy behavior: + the first dirty shot is the candidate. See `commandVerifier`. + +##### runHarness? + +> `optional` **runHarness?**: (`options`) => `Promise`\<[`LocalHarnessResult`](mcp.md#localharnessresult)\> + +Defined in: [improvement/agentic-generator.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L66) + +Test seam — inject the harness runner (defaults to `runLocalHarness`). + +**`Experimental`** + +Spawn a local coding harness CLI as a subprocess + collect its output. + +NOT responsible for parsing the harness's output or extracting a diff — +the in-process executor's `streamPrompt` orchestrates `git diff` against +the worktree after this resolves. This function is intentionally narrow: +spawn, wait, capture, return. + +Fails loud — throws when: + - `cwd` doesn't exist (subprocess emits ENOENT; surfaced as Error) + - the harness binary is not on PATH (ENOENT) + +Does NOT throw when: + - the subprocess exits non-zero (`result.exitCode` carries the code) + - the subprocess is aborted / timed out (`result.killedBySignal` / + `result.timedOut` carries the reason) + +###### Parameters + +###### options + +[`RunLocalHarnessOptions`](mcp.md#runlocalharnessoptions) + +###### Returns + +`Promise`\<[`LocalHarnessResult`](mcp.md#localharnessresult)\> + +##### isDirty? + +> `optional` **isDirty?**: (`worktreePath`) => `boolean` + +Defined in: [improvement/agentic-generator.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L68) + +Test seam — inject the worktree-dirty check (defaults to `git status`). + +###### Parameters + +###### worktreePath + +`string` + +###### Returns + +`boolean` + +*** + +### CandidateGenerator + +Defined in: [improvement/improvement-driver.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/improvement-driver.ts#L35) + +The byte-producing seam — the ONE thing that differs between the cheap + reflective path and the full agentic path. A generator makes (uncommitted) + changes inside `worktreePath`; the driver commits them via the worktree + adapter's `finalize`. + +#### Properties + +##### kind + +> **kind**: `string` + +Defined in: [improvement/improvement-driver.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/improvement-driver.ts#L36) + +#### Methods + +##### generate() + +> **generate**(`args`): `Promise`\<\{ `applied`: `boolean`; `summary`: `string`; \}\> + +Defined in: [improvement/improvement-driver.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/improvement-driver.ts#L37) + +###### Parameters + +###### args + +###### worktreePath + +`string` + +The candidate worktree — a fresh checkout of baseRef. Write changes here. + +###### report + +`unknown` + +Phase-2 research report (analyst findings + diff), opaque. + +###### findings + +`AnalystFinding`[] + +Findings resolved from the report or the loop context. + +###### dataset? + +`LabeledScenarioStore` + +Handle to all captured data, to ground the change. + +###### maxShots + +`number` + +DEPTH: max iterations the generator may take (agentic uses this; the + reflective generator ignores it). + +###### signal + +`AbortSignal` + +###### Returns + +`Promise`\<\{ `applied`: `boolean`; `summary`: `string`; \}\> + +*** + +### ImprovementDriverOptions + +Defined in: [improvement/improvement-driver.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/improvement-driver.ts#L53) + +#### Properties + +##### worktree + +> **worktree**: `WorktreeAdapter` + +Defined in: [improvement/improvement-driver.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/improvement-driver.ts#L54) + +##### generator + +> **generator**: [`CandidateGenerator`](#candidategenerator) + +Defined in: [improvement/improvement-driver.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/improvement-driver.ts#L55) + +##### baseRef? + +> `optional` **baseRef?**: `string` + +Defined in: [improvement/improvement-driver.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/improvement-driver.ts#L57) + +Base ref candidate worktrees fork from. Default `main`. + +*** + +### McpServeSpec + +Defined in: [improvement/mcp-serve-verifier.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/mcp-serve-verifier.ts#L24) + +#### Properties + +##### command + +> **command**: `string` + +Defined in: [improvement/mcp-serve-verifier.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/mcp-serve-verifier.ts#L26) + +Command that starts the built MCP server in the worktree (stdio transport). + +##### args? + +> `optional` **args?**: `string`[] + +Defined in: [improvement/mcp-serve-verifier.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/mcp-serve-verifier.ts#L27) + +##### env? + +> `optional` **env?**: `Record`\<`string`, `string`\> + +Defined in: [improvement/mcp-serve-verifier.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/mcp-serve-verifier.ts#L29) + +Extra env for the server process (merged over `process.env`). + +##### timeoutMs? + +> `optional` **timeoutMs?**: `number` + +Defined in: [improvement/mcp-serve-verifier.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/mcp-serve-verifier.ts#L31) + +Handshake timeout (ms). Default 30s. + +##### minTools? + +> `optional` **minTools?**: `number` + +Defined in: [improvement/mcp-serve-verifier.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/mcp-serve-verifier.ts#L33) + +Minimum tools the server must expose to pass. Default 1. + +*** + +### ReflectiveGeneratorOptions + +Defined in: [improvement/reflective-generator.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/reflective-generator.ts#L20) + +#### Properties + +##### improvementAdapter + +> **improvementAdapter**: [`ImprovementAdapter`](analyst-loop.md#improvementadapter)\<[`SurfaceImprovementEdit`](agent.md#surfaceimprovementedit)\> + +Defined in: [improvement/reflective-generator.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/reflective-generator.ts#L21) + +## Type Aliases + +### Verifier + +> **Verifier** = (`worktreePath`) => `Promise`\<[`VerifyResult`](#verifyresult)\> \| [`VerifyResult`](#verifyresult) + +Defined in: [improvement/agentic-generator.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L49) + +Verifies the edited worktree. Sync or async; throws only on a setup fault + (a candidate that fails verification returns `{ok:false}`, it does not + throw). + +#### Parameters + +##### worktreePath + +`string` + +#### Returns + +`Promise`\<[`VerifyResult`](#verifyresult)\> \| [`VerifyResult`](#verifyresult) + +## Functions + +### agenticGenerator() + +> **agenticGenerator**(`opts?`): [`CandidateGenerator`](#candidategenerator) + +Defined in: [improvement/agentic-generator.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L71) + +`@tangle-network/agent-runtime` improvement — the CODE-surface driver for +agent-eval's improvement loop. + +The ONE entry point for optimization is agent-eval's `selfImprove` +(`@tangle-network/agent-eval/contract`) — text/config surfaces, held-out gated, +with `analyzeGeneration` for analyst-fed reflection and `analyzeRuns` / +`fromOtelSpans` / `partitionRunsByAuthoringModel` for production intake + +cohorting. This module supplies only the one genuinely runtime-specific piece: +a CODE-surface `ImprovementDriver` you pass to `selfImprove` as `driver`, which +mutates a git worktree via a pluggable `CandidateGenerator`: + - `reflectiveGenerator` — cheap, no sandbox, applies pre-drafted patches + - `agenticGenerator` — full coding harness in the worktree, multi-shot + +#### Parameters + +##### opts? + +[`AgenticGeneratorOptions`](#agenticgeneratoroptions) = `{}` + +#### Returns + +[`CandidateGenerator`](#candidategenerator) + +*** + +### commandVerifier() + +> **commandVerifier**(`command`, `args?`, `timeoutMs?`): [`Verifier`](#verifier) + +Defined in: [improvement/agentic-generator.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L159) + +A `Verifier` that runs a command in the worktree: exit 0 ⇒ ok, any other + exit ⇒ failed with stdout+stderr as feedback. The common case — verify by + `tsc --noEmit`, `pnpm build`, or a test command. A timeout is treated as a + FAILED candidate (a change that hangs the build is a bad change); a missing + binary or spawn fault throws (a setup bug, not a failed candidate — no + silent fallback). + +#### Parameters + +##### command + +`string` + +##### args? + +`string`[] = `[]` + +##### timeoutMs? + +`number` = `300_000` + +#### Returns + +[`Verifier`](#verifier) + +*** + +### toolBuildPrompt() + +> **toolBuildPrompt**(`args`): `string` + +Defined in: [improvement/build-prompts.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/build-prompts.ts#L30) + +#### Parameters + +##### args + +`FindingsArg` + +#### Returns + +`string` + +*** + +### mcpBuildPrompt() + +> **mcpBuildPrompt**(`args`): `string` + +Defined in: [improvement/build-prompts.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/build-prompts.ts#L43) + +#### Parameters + +##### args + +`FindingsArg` + +#### Returns + +`string` + +*** + +### improvementDriver() + +> **improvementDriver**(`opts`): `ImprovementDriver`\<`AnalystFinding`\> + +Defined in: [improvement/improvement-driver.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/improvement-driver.ts#L60) + +#### Parameters + +##### opts + +[`ImprovementDriverOptions`](#improvementdriveroptions) + +#### Returns + +`ImprovementDriver`\<`AnalystFinding`\> + +*** + +### mcpServeVerifier() + +> **mcpServeVerifier**(`spec`): [`Verifier`](#verifier) + +Defined in: [improvement/mcp-serve-verifier.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/mcp-serve-verifier.ts#L43) + +#### Parameters + +##### spec + +[`McpServeSpec`](#mcpservespec) + +#### Returns + +[`Verifier`](#verifier) + +*** + +### reflectiveGenerator() + +> **reflectiveGenerator**(`opts`): [`CandidateGenerator`](#candidategenerator) + +Defined in: [improvement/reflective-generator.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/reflective-generator.ts#L24) + +#### Parameters + +##### opts + +[`ReflectiveGeneratorOptions`](#reflectivegeneratoroptions) + +#### Returns + +[`CandidateGenerator`](#candidategenerator) diff --git a/docs/api/improvement/README.md b/docs/api/improvement/README.md deleted file mode 100644 index d854713..0000000 --- a/docs/api/improvement/README.md +++ /dev/null @@ -1,30 +0,0 @@ -[**@tangle-network/agent-runtime**](../README.md) - -*** - -[@tangle-network/agent-runtime](../README.md) / improvement - -# improvement - -## Interfaces - -- [VerifyResult](interfaces/VerifyResult.md) -- [AgenticGeneratorOptions](interfaces/AgenticGeneratorOptions.md) -- [CandidateGenerator](interfaces/CandidateGenerator.md) -- [ImprovementDriverOptions](interfaces/ImprovementDriverOptions.md) -- [McpServeSpec](interfaces/McpServeSpec.md) -- [ReflectiveGeneratorOptions](interfaces/ReflectiveGeneratorOptions.md) - -## Type Aliases - -- [Verifier](type-aliases/Verifier.md) - -## Functions - -- [agenticGenerator](functions/agenticGenerator.md) -- [commandVerifier](functions/commandVerifier.md) -- [toolBuildPrompt](functions/toolBuildPrompt.md) -- [mcpBuildPrompt](functions/mcpBuildPrompt.md) -- [improvementDriver](functions/improvementDriver.md) -- [mcpServeVerifier](functions/mcpServeVerifier.md) -- [reflectiveGenerator](functions/reflectiveGenerator.md) diff --git a/docs/api/improvement/functions/agenticGenerator.md b/docs/api/improvement/functions/agenticGenerator.md deleted file mode 100644 index 87a2c04..0000000 --- a/docs/api/improvement/functions/agenticGenerator.md +++ /dev/null @@ -1,34 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [improvement](../README.md) / agenticGenerator - -# Function: agenticGenerator() - -> **agenticGenerator**(`opts?`): [`CandidateGenerator`](../interfaces/CandidateGenerator.md) - -Defined in: [improvement/agentic-generator.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L71) - -`@tangle-network/agent-runtime` improvement — the CODE-surface driver for -agent-eval's improvement loop. - -The ONE entry point for optimization is agent-eval's `selfImprove` -(`@tangle-network/agent-eval/contract`) — text/config surfaces, held-out gated, -with `analyzeGeneration` for analyst-fed reflection and `analyzeRuns` / -`fromOtelSpans` / `partitionRunsByAuthoringModel` for production intake + -cohorting. This module supplies only the one genuinely runtime-specific piece: -a CODE-surface `ImprovementDriver` you pass to `selfImprove` as `driver`, which -mutates a git worktree via a pluggable `CandidateGenerator`: - - `reflectiveGenerator` — cheap, no sandbox, applies pre-drafted patches - - `agenticGenerator` — full coding harness in the worktree, multi-shot - -## Parameters - -### opts? - -[`AgenticGeneratorOptions`](../interfaces/AgenticGeneratorOptions.md) = `{}` - -## Returns - -[`CandidateGenerator`](../interfaces/CandidateGenerator.md) diff --git a/docs/api/improvement/functions/commandVerifier.md b/docs/api/improvement/functions/commandVerifier.md deleted file mode 100644 index cc122d2..0000000 --- a/docs/api/improvement/functions/commandVerifier.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [improvement](../README.md) / commandVerifier - -# Function: commandVerifier() - -> **commandVerifier**(`command`, `args?`, `timeoutMs?`): [`Verifier`](../type-aliases/Verifier.md) - -Defined in: [improvement/agentic-generator.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L159) - -A `Verifier` that runs a command in the worktree: exit 0 ⇒ ok, any other - exit ⇒ failed with stdout+stderr as feedback. The common case — verify by - `tsc --noEmit`, `pnpm build`, or a test command. A timeout is treated as a - FAILED candidate (a change that hangs the build is a bad change); a missing - binary or spawn fault throws (a setup bug, not a failed candidate — no - silent fallback). - -## Parameters - -### command - -`string` - -### args? - -`string`[] = `[]` - -### timeoutMs? - -`number` = `300_000` - -## Returns - -[`Verifier`](../type-aliases/Verifier.md) diff --git a/docs/api/improvement/functions/improvementDriver.md b/docs/api/improvement/functions/improvementDriver.md deleted file mode 100644 index 938b95e..0000000 --- a/docs/api/improvement/functions/improvementDriver.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [improvement](../README.md) / improvementDriver - -# Function: improvementDriver() - -> **improvementDriver**(`opts`): `ImprovementDriver`\<`AnalystFinding`\> - -Defined in: [improvement/improvement-driver.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/improvement-driver.ts#L60) - -## Parameters - -### opts - -[`ImprovementDriverOptions`](../interfaces/ImprovementDriverOptions.md) - -## Returns - -`ImprovementDriver`\<`AnalystFinding`\> diff --git a/docs/api/improvement/functions/mcpBuildPrompt.md b/docs/api/improvement/functions/mcpBuildPrompt.md deleted file mode 100644 index 3f706a6..0000000 --- a/docs/api/improvement/functions/mcpBuildPrompt.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [improvement](../README.md) / mcpBuildPrompt - -# Function: mcpBuildPrompt() - -> **mcpBuildPrompt**(`args`): `string` - -Defined in: [improvement/build-prompts.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/build-prompts.ts#L43) - -## Parameters - -### args - -`FindingsArg` - -## Returns - -`string` diff --git a/docs/api/improvement/functions/mcpServeVerifier.md b/docs/api/improvement/functions/mcpServeVerifier.md deleted file mode 100644 index 2ac6e10..0000000 --- a/docs/api/improvement/functions/mcpServeVerifier.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [improvement](../README.md) / mcpServeVerifier - -# Function: mcpServeVerifier() - -> **mcpServeVerifier**(`spec`): [`Verifier`](../type-aliases/Verifier.md) - -Defined in: [improvement/mcp-serve-verifier.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/mcp-serve-verifier.ts#L43) - -## Parameters - -### spec - -[`McpServeSpec`](../interfaces/McpServeSpec.md) - -## Returns - -[`Verifier`](../type-aliases/Verifier.md) diff --git a/docs/api/improvement/functions/reflectiveGenerator.md b/docs/api/improvement/functions/reflectiveGenerator.md deleted file mode 100644 index 74011f9..0000000 --- a/docs/api/improvement/functions/reflectiveGenerator.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [improvement](../README.md) / reflectiveGenerator - -# Function: reflectiveGenerator() - -> **reflectiveGenerator**(`opts`): [`CandidateGenerator`](../interfaces/CandidateGenerator.md) - -Defined in: [improvement/reflective-generator.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/reflective-generator.ts#L24) - -## Parameters - -### opts - -[`ReflectiveGeneratorOptions`](../interfaces/ReflectiveGeneratorOptions.md) - -## Returns - -[`CandidateGenerator`](../interfaces/CandidateGenerator.md) diff --git a/docs/api/improvement/functions/toolBuildPrompt.md b/docs/api/improvement/functions/toolBuildPrompt.md deleted file mode 100644 index ef381a2..0000000 --- a/docs/api/improvement/functions/toolBuildPrompt.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [improvement](../README.md) / toolBuildPrompt - -# Function: toolBuildPrompt() - -> **toolBuildPrompt**(`args`): `string` - -Defined in: [improvement/build-prompts.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/build-prompts.ts#L30) - -## Parameters - -### args - -`FindingsArg` - -## Returns - -`string` diff --git a/docs/api/improvement/interfaces/AgenticGeneratorOptions.md b/docs/api/improvement/interfaces/AgenticGeneratorOptions.md deleted file mode 100644 index dc0982c..0000000 --- a/docs/api/improvement/interfaces/AgenticGeneratorOptions.md +++ /dev/null @@ -1,141 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [improvement](../README.md) / AgenticGeneratorOptions - -# Interface: AgenticGeneratorOptions - -Defined in: [improvement/agentic-generator.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L51) - -`@tangle-network/agent-runtime` improvement — the CODE-surface driver for -agent-eval's improvement loop. - -The ONE entry point for optimization is agent-eval's `selfImprove` -(`@tangle-network/agent-eval/contract`) — text/config surfaces, held-out gated, -with `analyzeGeneration` for analyst-fed reflection and `analyzeRuns` / -`fromOtelSpans` / `partitionRunsByAuthoringModel` for production intake + -cohorting. This module supplies only the one genuinely runtime-specific piece: -a CODE-surface `ImprovementDriver` you pass to `selfImprove` as `driver`, which -mutates a git worktree via a pluggable `CandidateGenerator`: - - `reflectiveGenerator` — cheap, no sandbox, applies pre-drafted patches - - `agenticGenerator` — full coding harness in the worktree, multi-shot - -## Properties - -### harness? - -> `optional` **harness?**: [`LocalHarness`](../../mcp/type-aliases/LocalHarness.md) - -Defined in: [improvement/agentic-generator.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L53) - -Local coding harness to run in the worktree. Default `claude`. - -*** - -### timeoutMs? - -> `optional` **timeoutMs?**: `number` - -Defined in: [improvement/agentic-generator.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L55) - -Per-shot wall-clock timeout (ms). Default = `runLocalHarness` default (5m). - -*** - -### buildPrompt? - -> `optional` **buildPrompt?**: (`args`) => `string` - -Defined in: [improvement/agentic-generator.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L58) - -Build the harness task prompt from the report + findings. Override for - domain phrasing; the default turns findings into a concrete coder task. - -#### Parameters - -##### args - -###### report - -`unknown` - -###### findings - -`AnalystFinding`[] - -#### Returns - -`string` - -*** - -### verify? - -> `optional` **verify?**: [`Verifier`](../type-aliases/Verifier.md) - -Defined in: [improvement/agentic-generator.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L64) - -Verify the worktree after each dirtying shot. When set, a candidate that - fails verification is NOT returned — the failure feeds the next shot - (verify-in-session), up to `maxShots`; a candidate that never verifies is - discarded (`applied:false`), never shipped. Omitted ⇒ legacy behavior: - the first dirty shot is the candidate. See `commandVerifier`. - -*** - -### runHarness? - -> `optional` **runHarness?**: (`options`) => `Promise`\<[`LocalHarnessResult`](../../mcp/interfaces/LocalHarnessResult.md)\> - -Defined in: [improvement/agentic-generator.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L66) - -Test seam — inject the harness runner (defaults to `runLocalHarness`). - -**`Experimental`** - -Spawn a local coding harness CLI as a subprocess + collect its output. - -NOT responsible for parsing the harness's output or extracting a diff — -the in-process executor's `streamPrompt` orchestrates `git diff` against -the worktree after this resolves. This function is intentionally narrow: -spawn, wait, capture, return. - -Fails loud — throws when: - - `cwd` doesn't exist (subprocess emits ENOENT; surfaced as Error) - - the harness binary is not on PATH (ENOENT) - -Does NOT throw when: - - the subprocess exits non-zero (`result.exitCode` carries the code) - - the subprocess is aborted / timed out (`result.killedBySignal` / - `result.timedOut` carries the reason) - -#### Parameters - -##### options - -[`RunLocalHarnessOptions`](../../mcp/interfaces/RunLocalHarnessOptions.md) - -#### Returns - -`Promise`\<[`LocalHarnessResult`](../../mcp/interfaces/LocalHarnessResult.md)\> - -*** - -### isDirty? - -> `optional` **isDirty?**: (`worktreePath`) => `boolean` - -Defined in: [improvement/agentic-generator.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L68) - -Test seam — inject the worktree-dirty check (defaults to `git status`). - -#### Parameters - -##### worktreePath - -`string` - -#### Returns - -`boolean` diff --git a/docs/api/improvement/interfaces/CandidateGenerator.md b/docs/api/improvement/interfaces/CandidateGenerator.md deleted file mode 100644 index 649cabe..0000000 --- a/docs/api/improvement/interfaces/CandidateGenerator.md +++ /dev/null @@ -1,73 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [improvement](../README.md) / CandidateGenerator - -# Interface: CandidateGenerator - -Defined in: [improvement/improvement-driver.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/improvement-driver.ts#L35) - -The byte-producing seam — the ONE thing that differs between the cheap - reflective path and the full agentic path. A generator makes (uncommitted) - changes inside `worktreePath`; the driver commits them via the worktree - adapter's `finalize`. - -## Properties - -### kind - -> **kind**: `string` - -Defined in: [improvement/improvement-driver.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/improvement-driver.ts#L36) - -## Methods - -### generate() - -> **generate**(`args`): `Promise`\<\{ `applied`: `boolean`; `summary`: `string`; \}\> - -Defined in: [improvement/improvement-driver.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/improvement-driver.ts#L37) - -#### Parameters - -##### args - -###### worktreePath - -`string` - -The candidate worktree — a fresh checkout of baseRef. Write changes here. - -###### report - -`unknown` - -Phase-2 research report (analyst findings + diff), opaque. - -###### findings - -`AnalystFinding`[] - -Findings resolved from the report or the loop context. - -###### dataset? - -`LabeledScenarioStore` - -Handle to all captured data, to ground the change. - -###### maxShots - -`number` - -DEPTH: max iterations the generator may take (agentic uses this; the - reflective generator ignores it). - -###### signal - -`AbortSignal` - -#### Returns - -`Promise`\<\{ `applied`: `boolean`; `summary`: `string`; \}\> diff --git a/docs/api/improvement/interfaces/ImprovementDriverOptions.md b/docs/api/improvement/interfaces/ImprovementDriverOptions.md deleted file mode 100644 index 7347039..0000000 --- a/docs/api/improvement/interfaces/ImprovementDriverOptions.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [improvement](../README.md) / ImprovementDriverOptions - -# Interface: ImprovementDriverOptions - -Defined in: [improvement/improvement-driver.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/improvement-driver.ts#L53) - -## Properties - -### worktree - -> **worktree**: `WorktreeAdapter` - -Defined in: [improvement/improvement-driver.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/improvement-driver.ts#L54) - -*** - -### generator - -> **generator**: [`CandidateGenerator`](CandidateGenerator.md) - -Defined in: [improvement/improvement-driver.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/improvement-driver.ts#L55) - -*** - -### baseRef? - -> `optional` **baseRef?**: `string` - -Defined in: [improvement/improvement-driver.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/improvement-driver.ts#L57) - -Base ref candidate worktrees fork from. Default `main`. diff --git a/docs/api/improvement/interfaces/McpServeSpec.md b/docs/api/improvement/interfaces/McpServeSpec.md deleted file mode 100644 index ca60bd5..0000000 --- a/docs/api/improvement/interfaces/McpServeSpec.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [improvement](../README.md) / McpServeSpec - -# Interface: McpServeSpec - -Defined in: [improvement/mcp-serve-verifier.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/mcp-serve-verifier.ts#L24) - -## Properties - -### command - -> **command**: `string` - -Defined in: [improvement/mcp-serve-verifier.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/mcp-serve-verifier.ts#L26) - -Command that starts the built MCP server in the worktree (stdio transport). - -*** - -### args? - -> `optional` **args?**: `string`[] - -Defined in: [improvement/mcp-serve-verifier.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/mcp-serve-verifier.ts#L27) - -*** - -### env? - -> `optional` **env?**: `Record`\<`string`, `string`\> - -Defined in: [improvement/mcp-serve-verifier.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/mcp-serve-verifier.ts#L29) - -Extra env for the server process (merged over `process.env`). - -*** - -### timeoutMs? - -> `optional` **timeoutMs?**: `number` - -Defined in: [improvement/mcp-serve-verifier.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/mcp-serve-verifier.ts#L31) - -Handshake timeout (ms). Default 30s. - -*** - -### minTools? - -> `optional` **minTools?**: `number` - -Defined in: [improvement/mcp-serve-verifier.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/mcp-serve-verifier.ts#L33) - -Minimum tools the server must expose to pass. Default 1. diff --git a/docs/api/improvement/interfaces/ReflectiveGeneratorOptions.md b/docs/api/improvement/interfaces/ReflectiveGeneratorOptions.md deleted file mode 100644 index dc309ef..0000000 --- a/docs/api/improvement/interfaces/ReflectiveGeneratorOptions.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [improvement](../README.md) / ReflectiveGeneratorOptions - -# Interface: ReflectiveGeneratorOptions - -Defined in: [improvement/reflective-generator.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/reflective-generator.ts#L20) - -## Properties - -### improvementAdapter - -> **improvementAdapter**: [`ImprovementAdapter`](../../analyst-loop/interfaces/ImprovementAdapter.md)\<[`SurfaceImprovementEdit`](../../agent/interfaces/SurfaceImprovementEdit.md)\> - -Defined in: [improvement/reflective-generator.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/reflective-generator.ts#L21) diff --git a/docs/api/improvement/interfaces/VerifyResult.md b/docs/api/improvement/interfaces/VerifyResult.md deleted file mode 100644 index 3171aa2..0000000 --- a/docs/api/improvement/interfaces/VerifyResult.md +++ /dev/null @@ -1,28 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [improvement](../README.md) / VerifyResult - -# Interface: VerifyResult - -Defined in: [improvement/agentic-generator.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L41) - -Outcome of verifying a candidate worktree. `feedback` (compiler errors, - failing test output) is fed into the next shot when `ok` is false. - -## Properties - -### ok - -> **ok**: `boolean` - -Defined in: [improvement/agentic-generator.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L42) - -*** - -### feedback? - -> `optional` **feedback?**: `string` - -Defined in: [improvement/agentic-generator.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L43) diff --git a/docs/api/improvement/type-aliases/Verifier.md b/docs/api/improvement/type-aliases/Verifier.md deleted file mode 100644 index 4249af8..0000000 --- a/docs/api/improvement/type-aliases/Verifier.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [improvement](../README.md) / Verifier - -# Type Alias: Verifier - -> **Verifier** = (`worktreePath`) => `Promise`\<[`VerifyResult`](../interfaces/VerifyResult.md)\> \| [`VerifyResult`](../interfaces/VerifyResult.md) - -Defined in: [improvement/agentic-generator.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/improvement/agentic-generator.ts#L49) - -Verifies the edited worktree. Sync or async; throws only on a setup fault - (a candidate that fails verification returns `{ok:false}`, it does not - throw). - -## Parameters - -### worktreePath - -`string` - -## Returns - -`Promise`\<[`VerifyResult`](../interfaces/VerifyResult.md)\> \| [`VerifyResult`](../interfaces/VerifyResult.md) diff --git a/docs/api/index.md b/docs/api/index.md new file mode 100644 index 0000000..3d89f64 --- /dev/null +++ b/docs/api/index.md @@ -0,0 +1,8094 @@ +[**@tangle-network/agent-runtime**](README.md) + +*** + +[@tangle-network/agent-runtime](README.md) / index + +# index + +## Classes + +### CircuitOpenError + +Defined in: [conversation/call-policy.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L41) + +#### Extends + +- `Error` + +#### Constructors + +##### Constructor + +> **new CircuitOpenError**(`participant`, `retryAfterMs`): [`CircuitOpenError`](#circuitopenerror) + +Defined in: [conversation/call-policy.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L42) + +###### Parameters + +###### participant + +`string` + +###### retryAfterMs + +`number` + +###### Returns + +[`CircuitOpenError`](#circuitopenerror) + +###### Overrides + +`Error.constructor` + +*** + +### DeadlineExceededError + +Defined in: [conversation/call-policy.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L50) + +#### Extends + +- `Error` + +#### Constructors + +##### Constructor + +> **new DeadlineExceededError**(`deadlineMs`): [`DeadlineExceededError`](#deadlineexceedederror) + +Defined in: [conversation/call-policy.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L51) + +###### Parameters + +###### deadlineMs + +`number` + +###### Returns + +[`DeadlineExceededError`](#deadlineexceedederror) + +###### Overrides + +`Error.constructor` + +*** + +### CircuitBreakerState + +Defined in: [conversation/call-policy.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L83) + +Live circuit-breaker state — one instance per (participant, conversation run). + +#### Constructors + +##### Constructor + +> **new CircuitBreakerState**(`config`): [`CircuitBreakerState`](#circuitbreakerstate) + +Defined in: [conversation/call-policy.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L87) + +###### Parameters + +###### config + +[`CircuitBreakerConfig`](#circuitbreakerconfig) \| `undefined` + +###### Returns + +[`CircuitBreakerState`](#circuitbreakerstate) + +#### Methods + +##### preflight() + +> **preflight**(`participant`, `now?`): `void` + +Defined in: [conversation/call-policy.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L93) + +Check whether the next call is allowed. Throws `CircuitOpenError` when +the breaker is open and the cooldown hasn't elapsed. + +###### Parameters + +###### participant + +`string` + +###### now? + +`number` = `...` + +###### Returns + +`void` + +##### recordSuccess() + +> **recordSuccess**(): `void` + +Defined in: [conversation/call-policy.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L103) + +###### Returns + +`void` + +##### recordFailure() + +> **recordFailure**(`now?`): `void` + +Defined in: [conversation/call-policy.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L108) + +###### Parameters + +###### now? + +`number` = `...` + +###### Returns + +`void` + +*** + +### SqlConversationJournal + +Defined in: [conversation/journal-sql.ts:119](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L119) + +SQL-backed ConversationJournal. Two tables — runs (one row per runId, holds +start/halt timestamps + halt reason) and turns (one row per committed turn, +payload is the ConversationTurn JSON). Replays the turns table on +`loadRun` and writes append-only per `appendTurn`. + +#### Implements + +- [`ConversationJournal`](#conversationjournal) + +#### Constructors + +##### Constructor + +> **new SqlConversationJournal**(`db`, `table?`): [`SqlConversationJournal`](#sqlconversationjournal) + +Defined in: [conversation/journal-sql.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L126) + +###### Parameters + +###### db + +[`SqlAdapter`](#sqladapter) + +SQL adapter (D1, postgres, sqlite, libSQL — all work) + +###### table? + +`string` = `'agent_runtime_journal'` + +Table-name prefix; the journal creates `${table}_runs` and + `${table}_turns`. Lets multiple journals share a database + without colliding (e.g. one per product surface). + +###### Returns + +[`SqlConversationJournal`](#sqlconversationjournal) + +#### Methods + +##### migrate() + +> **migrate**(): `Promise`\<`void`\> + +Defined in: [conversation/journal-sql.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L135) + +Create the journal's tables if absent. Idempotent. Call once at deploy +(or at app boot) — running on every request is harmless but adds latency. + +###### Returns + +`Promise`\<`void`\> + +##### loadRun() + +> **loadRun**(`runId`): `Promise`\<[`ConversationJournalEntry`](#conversationjournalentry) \| `undefined`\> + +Defined in: [conversation/journal-sql.ts:141](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L141) + +Load any prior state for `runId`. Returns `undefined` for a fresh run. +Implementations MUST NOT mutate the returned object — the runner clones +before continuing — but the runtime treats absence and emptiness +identically, so a journal with zero turns is equivalent to "fresh." + +###### Parameters + +###### runId + +`string` + +###### Returns + +`Promise`\<[`ConversationJournalEntry`](#conversationjournalentry) \| `undefined`\> + +###### Implementation of + +[`ConversationJournal`](#conversationjournal).[`loadRun`](#loadrun-1) + +##### beginRun() + +> **beginRun**(`runId`, `startedAt`): `Promise`\<`void`\> + +Defined in: [conversation/journal-sql.ts:167](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L167) + +Initialise journal state for a fresh run. Called once per run, before any +`appendTurn`. Idempotent: calling with an existing runId is a no-op if +the entry already exists with the same `startedAt`. + +###### Parameters + +###### runId + +`string` + +###### startedAt + +`string` + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`ConversationJournal`](#conversationjournal).[`beginRun`](#beginrun-1) + +##### appendTurn() + +> **appendTurn**(`runId`, `turn`): `Promise`\<`void`\> + +Defined in: [conversation/journal-sql.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L186) + +Append a committed turn. The runner only calls this AFTER the turn's +backend stream completed and the credit total has been updated, so an +appended turn is observed-committed and never speculative. + +###### Parameters + +###### runId + +`string` + +###### turn + +[`ConversationTurn`](#conversationturn) + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`ConversationJournal`](#conversationjournal).[`appendTurn`](#appendturn-1) + +##### recordHalt() + +> **recordHalt**(`runId`, `halt`, `endedAt`): `Promise`\<`void`\> + +Defined in: [conversation/journal-sql.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L207) + +Record the run's terminal halt reason + end time. Once called, the run +is observed-final; subsequent `loadRun` returns the same halt. + +###### Parameters + +###### runId + +`string` + +###### halt + +[`HaltReason`](#haltreason) + +###### endedAt + +`string` + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`ConversationJournal`](#conversationjournal).[`recordHalt`](#recordhalt-1) + +*** + +### InMemoryConversationJournal + +Defined in: [conversation/journal.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L58) + +#### Implements + +- [`ConversationJournal`](#conversationjournal) + +#### Constructors + +##### Constructor + +> **new InMemoryConversationJournal**(): [`InMemoryConversationJournal`](#inmemoryconversationjournal) + +###### Returns + +[`InMemoryConversationJournal`](#inmemoryconversationjournal) + +#### Methods + +##### loadRun() + +> **loadRun**(`runId`): `Promise`\<[`ConversationJournalEntry`](#conversationjournalentry) \| `undefined`\> + +Defined in: [conversation/journal.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L61) + +Load any prior state for `runId`. Returns `undefined` for a fresh run. +Implementations MUST NOT mutate the returned object — the runner clones +before continuing — but the runtime treats absence and emptiness +identically, so a journal with zero turns is equivalent to "fresh." + +###### Parameters + +###### runId + +`string` + +###### Returns + +`Promise`\<[`ConversationJournalEntry`](#conversationjournalentry) \| `undefined`\> + +###### Implementation of + +[`ConversationJournal`](#conversationjournal).[`loadRun`](#loadrun-1) + +##### beginRun() + +> **beginRun**(`runId`, `startedAt`): `Promise`\<`void`\> + +Defined in: [conversation/journal.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L74) + +Initialise journal state for a fresh run. Called once per run, before any +`appendTurn`. Idempotent: calling with an existing runId is a no-op if +the entry already exists with the same `startedAt`. + +###### Parameters + +###### runId + +`string` + +###### startedAt + +`string` + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`ConversationJournal`](#conversationjournal).[`beginRun`](#beginrun-1) + +##### appendTurn() + +> **appendTurn**(`runId`, `turn`): `Promise`\<`void`\> + +Defined in: [conversation/journal.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L87) + +Append a committed turn. The runner only calls this AFTER the turn's +backend stream completed and the credit total has been updated, so an +appended turn is observed-committed and never speculative. + +###### Parameters + +###### runId + +`string` + +###### turn + +[`ConversationTurn`](#conversationturn) + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`ConversationJournal`](#conversationjournal).[`appendTurn`](#appendturn-1) + +##### recordHalt() + +> **recordHalt**(`runId`, `halt`, `endedAt`): `Promise`\<`void`\> + +Defined in: [conversation/journal.ts:102](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L102) + +Record the run's terminal halt reason + end time. Once called, the run +is observed-final; subsequent `loadRun` returns the same halt. + +###### Parameters + +###### runId + +`string` + +###### halt + +[`HaltReason`](#haltreason) + +###### endedAt + +`string` + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`ConversationJournal`](#conversationjournal).[`recordHalt`](#recordhalt-1) + +*** + +### FileConversationJournal + +Defined in: [conversation/journal.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L122) + +JSONL on disk. One line per record; first line is the `begin`, subsequent +lines are `turn` records, terminal line is `halt`. Replays the whole file +on `loadRun` — cheap for the conversation sizes this is designed for +(thousands of turns, not millions). For huge runs, plug in a real DB +adapter; the interface is small. + +Each `appendTurn` / `recordHalt` calls `fsync` after the write so a +process crash between writes never loses an acknowledged turn. + +#### Implements + +- [`ConversationJournal`](#conversationjournal) + +#### Constructors + +##### Constructor + +> **new FileConversationJournal**(`path`): [`FileConversationJournal`](#fileconversationjournal) + +Defined in: [conversation/journal.ts:123](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L123) + +###### Parameters + +###### path + +`string` + +###### Returns + +[`FileConversationJournal`](#fileconversationjournal) + +#### Methods + +##### loadRun() + +> **loadRun**(`runId`): `Promise`\<[`ConversationJournalEntry`](#conversationjournalentry) \| `undefined`\> + +Defined in: [conversation/journal.ts:125](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L125) + +Load any prior state for `runId`. Returns `undefined` for a fresh run. +Implementations MUST NOT mutate the returned object — the runner clones +before continuing — but the runtime treats absence and emptiness +identically, so a journal with zero turns is equivalent to "fresh." + +###### Parameters + +###### runId + +`string` + +###### Returns + +`Promise`\<[`ConversationJournalEntry`](#conversationjournalentry) \| `undefined`\> + +###### Implementation of + +[`ConversationJournal`](#conversationjournal).[`loadRun`](#loadrun-1) + +##### beginRun() + +> **beginRun**(`runId`, `startedAt`): `Promise`\<`void`\> + +Defined in: [conversation/journal.ts:161](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L161) + +Initialise journal state for a fresh run. Called once per run, before any +`appendTurn`. Idempotent: calling with an existing runId is a no-op if +the entry already exists with the same `startedAt`. + +###### Parameters + +###### runId + +`string` + +###### startedAt + +`string` + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`ConversationJournal`](#conversationjournal).[`beginRun`](#beginrun-1) + +##### appendTurn() + +> **appendTurn**(`runId`, `turn`): `Promise`\<`void`\> + +Defined in: [conversation/journal.ts:174](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L174) + +Append a committed turn. The runner only calls this AFTER the turn's +backend stream completed and the credit total has been updated, so an +appended turn is observed-committed and never speculative. + +###### Parameters + +###### runId + +`string` + +###### turn + +[`ConversationTurn`](#conversationturn) + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`ConversationJournal`](#conversationjournal).[`appendTurn`](#appendturn-1) + +##### recordHalt() + +> **recordHalt**(`runId`, `halt`, `endedAt`): `Promise`\<`void`\> + +Defined in: [conversation/journal.ts:178](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L178) + +Record the run's terminal halt reason + end time. Once called, the run +is observed-final; subsequent `loadRun` returns the same halt. + +###### Parameters + +###### runId + +`string` + +###### halt + +[`HaltReason`](#haltreason) + +###### endedAt + +`string` + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`ConversationJournal`](#conversationjournal).[`recordHalt`](#recordhalt-1) + +*** + +### BackendTransportError + +Defined in: [errors.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L65) + +#### Stable + +A backend transport call (HTTP, gRPC, sidecar IPC) failed with a non-success +status. Distinct from `JudgeError` (which is structural / unrecoverable) +because backend failures are sometimes retryable and consumers may want to +branch on the upstream status code. + +#### Extends + +- `AgentEvalError` + +#### Constructors + +##### Constructor + +> **new BackendTransportError**(`backend`, `message`, `options?`): [`BackendTransportError`](#backendtransporterror) + +Defined in: [errors.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L76) + +###### Parameters + +###### backend + +`string` + +###### message + +`string` + +###### options? + +###### cause? + +`unknown` + +###### status? + +`number` + +###### body? + +`string` + +###### Returns + +[`BackendTransportError`](#backendtransporterror) + +###### Overrides + +`AgentEvalError.constructor` + +#### Properties + +##### backend + +> `readonly` **backend**: `string` + +Defined in: [errors.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L66) + +##### status? + +> `readonly` `optional` **status?**: `number` + +Defined in: [errors.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L67) + +##### body? + +> `readonly` `optional` **body?**: `string` + +Defined in: [errors.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L74) + +Truncated upstream response body (≤2 KiB) when available. Diagnostic +only — surfaces in `backend_error.error.body` and `final.error.body` +so operators can see "free_tier_limit", "invalid_api_key", etc. without +cracking the log line open. + +*** + +### RuntimeRunStateError + +Defined in: [errors.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L94) + +#### Stable + +A runtime-run lifecycle method was called in an order the state machine does +not allow: `persist()` before `complete()`, `complete()` twice, etc. + +#### Extends + +- `AgentEvalError` + +#### Constructors + +##### Constructor + +> **new RuntimeRunStateError**(`message`, `options?`): [`RuntimeRunStateError`](#runtimerunstateerror) + +Defined in: [errors.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L95) + +###### Parameters + +###### message + +`string` + +###### options? + +###### cause? + +`unknown` + +###### Returns + +[`RuntimeRunStateError`](#runtimerunstateerror) + +###### Overrides + +`AgentEvalError.constructor` + +*** + +### PlannerError + +Defined in: [errors.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L111) + +#### Stable + +The dynamic-loop planner returned an unusable topology move — the LLM emitted +no parseable envelope, an unknown `kind`, or a structurally-invalid move +(e.g. a fanout with zero tasks). This is a structural failure of the +agent-authored topology, not a config mistake: the planner ran but its output +cannot drive the kernel. Carries `validation` so cross-package handlers can +pattern-match without importing the runtime. Fail loud — never substitute a +default move, or the loop silently runs a topology nobody chose. + +#### Extends + +- `AgentEvalError` + +#### Constructors + +##### Constructor + +> **new PlannerError**(`message`, `options?`): [`PlannerError`](#plannererror) + +Defined in: [errors.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L112) + +###### Parameters + +###### message + +`string` + +###### options? + +###### cause? + +`unknown` + +###### Returns + +[`PlannerError`](#plannererror) + +###### Overrides + +`AgentEvalError.constructor` + +*** + +### InMemoryRuntimeSessionStore + +Defined in: [sessions.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/sessions.ts#L40) + +#### Stable + +#### Implements + +- [`RuntimeSessionStore`](#runtimesessionstore) + +#### Constructors + +##### Constructor + +> **new InMemoryRuntimeSessionStore**(): [`InMemoryRuntimeSessionStore`](#inmemoryruntimesessionstore) + +###### Returns + +[`InMemoryRuntimeSessionStore`](#inmemoryruntimesessionstore) + +#### Methods + +##### get() + +> **get**(`sessionId`): `RuntimeSession` \| `undefined` + +Defined in: [sessions.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/sessions.ts#L44) + +###### Parameters + +###### sessionId + +`string` + +###### Returns + +`RuntimeSession` \| `undefined` + +###### Implementation of + +[`RuntimeSessionStore`](#runtimesessionstore).[`get`](#get-1) + +##### put() + +> **put**(`session`): `void` + +Defined in: [sessions.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/sessions.ts#L48) + +###### Parameters + +###### session + +`RuntimeSession` + +###### Returns + +`void` + +###### Implementation of + +[`RuntimeSessionStore`](#runtimesessionstore).[`put`](#put-1) + +##### appendEvent() + +> **appendEvent**(`sessionId`, `event`): `void` + +Defined in: [sessions.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/sessions.ts#L52) + +###### Parameters + +###### sessionId + +`string` + +###### event + +[`RuntimeStreamEvent`](#runtimestreamevent) + +###### Returns + +`void` + +###### Implementation of + +[`RuntimeSessionStore`](#runtimesessionstore).[`appendEvent`](#appendevent-1) + +##### listEvents() + +> **listEvents**(`sessionId`): [`RuntimeStreamEvent`](#runtimestreamevent)[] + +Defined in: [sessions.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/sessions.ts#L58) + +###### Parameters + +###### sessionId + +`string` + +###### Returns + +[`RuntimeStreamEvent`](#runtimestreamevent)[] + +###### Implementation of + +[`RuntimeSessionStore`](#runtimesessionstore).[`listEvents`](#listevents-1) + +## Interfaces + +### CircuitBreakerConfig + +Defined in: [conversation/call-policy.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L23) + +Circuit-breaker tuning. `failuresToOpen` consecutive failures opens it; closed only after `cooldownMs`. + +#### Properties + +##### failuresToOpen + +> **failuresToOpen**: `number` + +Defined in: [conversation/call-policy.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L24) + +##### cooldownMs + +> **cooldownMs**: `number` + +Defined in: [conversation/call-policy.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L25) + +*** + +### BackendCallPolicy + +Defined in: [conversation/call-policy.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L28) + +#### Properties + +##### perAttemptDeadlineMs? + +> `optional` **perAttemptDeadlineMs?**: `number` + +Defined in: [conversation/call-policy.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L30) + +Per-attempt wall clock limit. Exceeding fires an AbortSignal and is treated as a retryable failure. + +##### maxRetries? + +> `optional` **maxRetries?**: `number` + +Defined in: [conversation/call-policy.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L32) + +Number of retries after the first attempt; total attempts = 1 + maxRetries. Default 0. + +##### retryBackoffMs? + +> `optional` **retryBackoffMs?**: [`RetryBackoff`](#retrybackoff) + +Defined in: [conversation/call-policy.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L34) + +Backoff between attempts. Default 250ms with jitter. + +##### isRetryable? + +> `optional` **isRetryable?**: [`RetryableErrorPredicate`](#retryableerrorpredicate) + +Defined in: [conversation/call-policy.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L36) + +Custom retry classifier. Defaults to [defaultIsRetryable](#defaultisretryable). + +##### circuitBreaker? + +> `optional` **circuitBreaker?**: [`CircuitBreakerConfig`](#circuitbreakerconfig) + +Defined in: [conversation/call-policy.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L38) + +Circuit breaker that opens after N consecutive failures per participant. + +*** + +### SqlAdapter + +Defined in: [conversation/journal-sql.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L48) + +Minimal SQL driver shape. Implementations forward to whichever client the +deployment already uses; agent-runtime takes no opinion on which. + +Parameter placeholders MUST be `?` (positional). All adapters listed in the +file header accept this convention. + +#### Methods + +##### exec() + +> **exec**(`sql`, `params?`): `Promise`\<\{ `rowsAffected`: `number`; \}\> + +Defined in: [conversation/journal-sql.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L50) + +Execute a write statement (INSERT/UPDATE/DELETE/DDL). + +###### Parameters + +###### sql + +`string` + +###### params? + +readonly `unknown`[] + +###### Returns + +`Promise`\<\{ `rowsAffected`: `number`; \}\> + +##### query() + +> **query**\<`TRow`\>(`sql`, `params?`): `Promise`\<`TRow`[]\> + +Defined in: [conversation/journal-sql.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L52) + +Execute a read statement (SELECT). Returns rows as plain objects. + +###### Type Parameters + +###### TRow + +`TRow` = `Record`\<`string`, `unknown`\> + +###### Parameters + +###### sql + +`string` + +###### params? + +readonly `unknown`[] + +###### Returns + +`Promise`\<`TRow`[]\> + +*** + +### D1DatabaseLike + +Defined in: [conversation/journal-sql.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L83) + +Structural type matching the surface of `D1Database` we depend on, so the +SDK never imports `@cloudflare/workers-types`. Consumers pass their real +`D1Database` from `env.DB` and TS structural compatibility lines it up. + +#### Methods + +##### prepare() + +> **prepare**(`sql`): [`D1StmtLike`](#d1stmtlike) + +Defined in: [conversation/journal-sql.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L84) + +###### Parameters + +###### sql + +`string` + +###### Returns + +[`D1StmtLike`](#d1stmtlike) + +*** + +### D1StmtLike + +Defined in: [conversation/journal-sql.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L86) + +#### Methods + +##### bind() + +> **bind**(...`params`): [`D1StmtLike`](#d1stmtlike) + +Defined in: [conversation/journal-sql.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L87) + +###### Parameters + +###### params + +...`unknown`[] + +###### Returns + +[`D1StmtLike`](#d1stmtlike) + +##### run() + +> **run**(): `Promise`\<`unknown`\> + +Defined in: [conversation/journal-sql.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L88) + +###### Returns + +`Promise`\<`unknown`\> + +##### all() + +> **all**\<`TRow`\>(): `Promise`\<\{ `results?`: `TRow`[]; \}\> + +Defined in: [conversation/journal-sql.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L89) + +###### Type Parameters + +###### TRow + +`TRow` = `unknown` + +###### Returns + +`Promise`\<\{ `results?`: `TRow`[]; \}\> + +*** + +### ConversationJournalEntry + +Defined in: [conversation/journal.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L19) + +#### Properties + +##### runId + +> **runId**: `string` + +Defined in: [conversation/journal.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L20) + +##### startedAt + +> **startedAt**: `string` + +Defined in: [conversation/journal.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L21) + +##### halted? + +> `optional` **halted?**: [`HaltReason`](#haltreason) + +Defined in: [conversation/journal.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L23) + +Set when the run reaches a terminal state. + +##### endedAt? + +> `optional` **endedAt?**: `string` + +Defined in: [conversation/journal.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L24) + +##### turns + +> **turns**: [`ConversationTurn`](#conversationturn)[] + +Defined in: [conversation/journal.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L25) + +*** + +### ConversationJournal + +Defined in: [conversation/journal.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L28) + +#### Methods + +##### loadRun() + +> **loadRun**(`runId`): `Promise`\<[`ConversationJournalEntry`](#conversationjournalentry) \| `undefined`\> + +Defined in: [conversation/journal.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L35) + +Load any prior state for `runId`. Returns `undefined` for a fresh run. +Implementations MUST NOT mutate the returned object — the runner clones +before continuing — but the runtime treats absence and emptiness +identically, so a journal with zero turns is equivalent to "fresh." + +###### Parameters + +###### runId + +`string` + +###### Returns + +`Promise`\<[`ConversationJournalEntry`](#conversationjournalentry) \| `undefined`\> + +##### beginRun() + +> **beginRun**(`runId`, `startedAt`): `Promise`\<`void`\> + +Defined in: [conversation/journal.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L42) + +Initialise journal state for a fresh run. Called once per run, before any +`appendTurn`. Idempotent: calling with an existing runId is a no-op if +the entry already exists with the same `startedAt`. + +###### Parameters + +###### runId + +`string` + +###### startedAt + +`string` + +###### Returns + +`Promise`\<`void`\> + +##### appendTurn() + +> **appendTurn**(`runId`, `turn`): `Promise`\<`void`\> + +Defined in: [conversation/journal.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L49) + +Append a committed turn. The runner only calls this AFTER the turn's +backend stream completed and the credit total has been updated, so an +appended turn is observed-committed and never speculative. + +###### Parameters + +###### runId + +`string` + +###### turn + +[`ConversationTurn`](#conversationturn) + +###### Returns + +`Promise`\<`void`\> + +##### recordHalt() + +> **recordHalt**(`runId`, `halt`, `endedAt`): `Promise`\<`void`\> + +Defined in: [conversation/journal.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L55) + +Record the run's terminal halt reason + end time. Once called, the run +is observed-final; subsequent `loadRun` returns the same halt. + +###### Parameters + +###### runId + +`string` + +###### halt + +[`HaltReason`](#haltreason) + +###### endedAt + +`string` + +###### Returns + +`Promise`\<`void`\> + +*** + +### RunPersonaConversationOptions + +Defined in: [conversation/run-persona.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L36) + +#### Properties + +##### worker + +> **worker**: `AgentProfile` + +Defined in: [conversation/run-persona.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L38) + +The agent under test. Metered; its rendered prompt leads its turns. + +##### persona + +> **persona**: [`PersonaDriver`](#personadriver) + +Defined in: [conversation/run-persona.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L40) + +The simulated user driving the dialogue. + +##### backendFor + +> **backendFor**: (`profile`, `role`) => [`AgentExecutionBackend`](#agentexecutionbackend) + +Defined in: [conversation/run-persona.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L43) + +Turn an `AgentProfile` into a runnable backend (router / sandbox / fake). + Applied to the worker and to a `profile`-kind persona. + +###### Parameters + +###### profile + +`AgentProfile` + +###### role + +`"worker"` \| `"persona"` + +###### Returns + +[`AgentExecutionBackend`](#agentexecutionbackend) + +##### systemPromptOf + +> **systemPromptOf**: (`profile`) => `string` + +Defined in: [conversation/run-persona.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L45) + +Render a profile's system prompt — prepended to that profile's messages. + +###### Parameters + +###### profile + +`AgentProfile` + +###### Returns + +`string` + +##### maxTurns? + +> `optional` **maxTurns?**: `number` + +Defined in: [conversation/run-persona.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L48) + +Speaker-turn cap. Default for a scripted persona = `2 * turns.length` + (worker answers each user turn). REQUIRED for a `profile` persona. + +##### seed? + +> `optional` **seed?**: `string` + +Defined in: [conversation/run-persona.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L50) + +Kickoff message routed to the first speaker (the persona). Default 'Begin.' + +##### signal? + +> `optional` **signal?**: `AbortSignal` + +Defined in: [conversation/run-persona.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L51) + +##### workerName? + +> `optional` **workerName?**: `string` + +Defined in: [conversation/run-persona.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L53) + +Worker participant / transcript speaker label. Default 'agent'. + +*** + +### PersonaConversationResult + +Defined in: [conversation/run-persona.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L56) + +#### Properties + +##### transcript + +> **transcript**: [`ConversationTurn`](#conversationturn)[] + +Defined in: [conversation/run-persona.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L57) + +##### turns + +> **turns**: `number` + +Defined in: [conversation/run-persona.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L58) + +##### halted + +> **halted**: [`HaltReason`](#haltreason) + +Defined in: [conversation/run-persona.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L59) + +##### costUsd + +> **costUsd**: `number` + +Defined in: [conversation/run-persona.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L61) + +Worker-only spend (the side under test). + +##### tokensIn + +> **tokensIn**: `number` + +Defined in: [conversation/run-persona.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L62) + +##### tokensOut + +> **tokensOut**: `number` + +Defined in: [conversation/run-persona.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L63) + +*** + +### RunPersonaConfig + +Defined in: [conversation/run-persona.ts:195](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L195) + +#### Type Parameters + +##### TScenario + +`TScenario` *extends* `Scenario` + +##### TArtifact + +`TArtifact` + +#### Properties + +##### backendFor + +> **backendFor**: (`profile`, `role`) => [`AgentExecutionBackend`](#agentexecutionbackend) + +Defined in: [conversation/run-persona.ts:197](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L197) + +Turn an `AgentProfile` into a runnable backend (router / sandbox / fake). + +###### Parameters + +###### profile + +`AgentProfile` + +###### role + +`"worker"` \| `"persona"` + +###### Returns + +[`AgentExecutionBackend`](#agentexecutionbackend) + +##### systemPromptOf + +> **systemPromptOf**: (`profile`) => `string` + +Defined in: [conversation/run-persona.ts:199](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L199) + +Render a profile's system prompt. + +###### Parameters + +###### profile + +`AgentProfile` + +###### Returns + +`string` + +##### personaOf + +> **personaOf**: (`scenario`) => [`PersonaDriver`](#personadriver) + +Defined in: [conversation/run-persona.ts:201](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L201) + +The persona driving each scenario — a driver profile or scripted turns. + +###### Parameters + +###### scenario + +`TScenario` + +###### Returns + +[`PersonaDriver`](#personadriver) + +##### artifactOf + +> **artifactOf**: (`transcript`, `scenario`) => `TArtifact` + +Defined in: [conversation/run-persona.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L203) + +Build the scored artifact from the finished transcript. + +###### Parameters + +###### transcript + +[`ConversationTurn`](#conversationturn)[] + +###### scenario + +`TScenario` + +###### Returns + +`TArtifact` + +##### maxTurns? + +> `optional` **maxTurns?**: (`scenario`) => `number` + +Defined in: [conversation/run-persona.ts:205](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L205) + +Speaker-turn cap (required when a persona is profile-driven). + +###### Parameters + +###### scenario + +`TScenario` + +###### Returns + +`number` + +##### seed? + +> `optional` **seed?**: (`scenario`) => `string` + +Defined in: [conversation/run-persona.ts:206](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L206) + +###### Parameters + +###### scenario + +`TScenario` + +###### Returns + +`string` + +##### workerName? + +> `optional` **workerName?**: `string` + +Defined in: [conversation/run-persona.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L207) + +*** + +### ConversationParticipant + +Defined in: [conversation/types.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L20) + +#### Stable + +#### Properties + +##### name + +> **name**: `string` + +Defined in: [conversation/types.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L25) + +Stable name used as the speaker label in the transcript. Must be unique +within a `Conversation`. + +##### backend + +> **backend**: [`AgentExecutionBackend`](#agentexecutionbackend) + +Defined in: [conversation/types.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L32) + +Backend that runs this participant's turn. Reuses the existing +`AgentExecutionBackend` contract from `runAgentTaskStream`, so any +registered backend (iterable, sandbox, OpenAI-compatible) works without +adaptation. + +##### label? + +> `optional` **label?**: `string` + +Defined in: [conversation/types.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L37) + +Optional human label for traces / dashboards. Distinct from `name`, which +is the addressing key. + +##### callPolicy? + +> `optional` **callPolicy?**: [`BackendCallPolicy`](#backendcallpolicy) + +Defined in: [conversation/types.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L43) + +Optional per-participant override of the conversation's default +`callPolicy`. Use to tighten the deadline or raise the retry budget for +a participant known to be slow or flaky. + +##### authSource? + +> `optional` **authSource?**: [`AuthSource`](#authsource-1) + +Defined in: [conversation/types.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L63) + +Who pays for THIS participant's outbound calls? + +- `'forward-user'` (default) — propagate the caller's + `X-Tangle-Forwarded-Authorization` so the downstream gateway bills the + original user. Right for pass-through agents that aggregate/route + without taking economic risk. +- `'agent-owned'` — DO NOT forward the user's auth; the participant's + backend uses its own credentials (typically a sk-tan-AGENT or x402 + wallet baked into the backend at construction). Downstream charges + land on the agent, not the user. Right for resold-bundle agents that + take margin between their inbound price and their sub-agent costs. +- `(state) => AuthSource` — per-turn / per-condition decision, e.g. base + sub-services are agent-owned but premium add-ons forward the user. + +The agent's own credentials live on the backend (set at construction +time, e.g. `createOpenAICompatibleBackend({ apiKey })`); this field is +purely about *whether to also forward the user's identity downstream*. + +*** + +### ConversationDriveState + +Defined in: [conversation/types.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L76) + +#### Stable + +#### Extended by + +- [`HaltContext`](#haltcontext) + +#### Properties + +##### transcript + +> **transcript**: readonly [`ConversationTurn`](#conversationturn)[] + +Defined in: [conversation/types.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L77) + +##### turnIndex + +> **turnIndex**: `number` + +Defined in: [conversation/types.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L78) + +##### spentCreditsCents + +> **spentCreditsCents**: `number` + +Defined in: [conversation/types.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L79) + +*** + +### HaltContext + +Defined in: [conversation/types.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L83) + +#### Stable + +#### Extends + +- [`ConversationDriveState`](#conversationdrivestate) + +#### Properties + +##### transcript + +> **transcript**: readonly [`ConversationTurn`](#conversationturn)[] + +Defined in: [conversation/types.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L77) + +###### Inherited from + +[`ConversationDriveState`](#conversationdrivestate).[`transcript`](#transcript-1) + +##### turnIndex + +> **turnIndex**: `number` + +Defined in: [conversation/types.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L78) + +###### Inherited from + +[`ConversationDriveState`](#conversationdrivestate).[`turnIndex`](#turnindex) + +##### spentCreditsCents + +> **spentCreditsCents**: `number` + +Defined in: [conversation/types.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L79) + +###### Inherited from + +[`ConversationDriveState`](#conversationdrivestate).[`spentCreditsCents`](#spentcreditscents) + +##### lastTurn + +> **lastTurn**: [`ConversationTurn`](#conversationturn) + +Defined in: [conversation/types.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L84) + +*** + +### HaltSignal + +Defined in: [conversation/types.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L88) + +#### Stable + +#### Properties + +##### halted + +> **halted**: `true` + +Defined in: [conversation/types.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L89) + +##### reason + +> **reason**: `string` + +Defined in: [conversation/types.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L90) + +*** + +### ConversationPolicy + +Defined in: [conversation/types.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L107) + +#### Stable + +#### Properties + +##### maxTurns + +> **maxTurns**: `number` + +Defined in: [conversation/types.ts:109](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L109) + +Hard cap on speaker-turns. Each call into a participant's backend counts as 1. + +##### maxCreditsCents? + +> `optional` **maxCreditsCents?**: `number` + +Defined in: [conversation/types.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L116) + +Hard cap on aggregate credit spend across all participants, in cents. +Computed by summing `llm_call.costUsd` from every participant's stream. +Unset (`undefined`) means no credit ceiling — the run is bounded only by +`maxTurns` and `haltOn`. + +##### turnOrder? + +> `optional` **turnOrder?**: [`TurnOrder`](#turnorder) + +Defined in: [conversation/types.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L121) + +Speaker selection. Defaults to `'alternate'` for two-participant +conversations and `'round-robin'` for any other arity. + +##### haltOn? + +> `optional` **haltOn?**: [`HaltPredicate`](#haltpredicate) + +Defined in: [conversation/types.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L126) + +Optional convergence / content-based halt. Called after every turn ends; +returning truthy stops the loop with `{ kind: 'predicate', ... }`. + +##### defaultCallPolicy? + +> `optional` **defaultCallPolicy?**: [`BackendCallPolicy`](#backendcallpolicy) + +Defined in: [conversation/types.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L132) + +Default per-turn resilience policy applied to every participant call +(deadline, retries, circuit breaker). Individual participants may +override via `ConversationParticipant.callPolicy`. + +*** + +### ConversationTurn + +Defined in: [conversation/types.ts:136](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L136) + +#### Stable + +#### Properties + +##### index + +> **index**: `number` + +Defined in: [conversation/types.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L137) + +##### speaker + +> **speaker**: `string` + +Defined in: [conversation/types.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L138) + +##### turnId + +> **turnId**: `string` + +Defined in: [conversation/types.ts:144](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L144) + +Deterministic turn identifier — stable across retries of the same logical +turn so caching gateways and trace backends can dedupe. Shape: +`${runId}.t${index}.${speakerSlug}`. + +##### text + +> **text**: `string` + +Defined in: [conversation/types.ts:145](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L145) + +##### usage? + +> `optional` **usage?**: `object` + +Defined in: [conversation/types.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L151) + +Aggregated backend usage for this turn alone. Populated from any +`llm_call` stream events the backend emitted; `undefined` when the +backend reports no usage. + +###### tokensIn? + +> `optional` **tokensIn?**: `number` + +###### tokensOut? + +> `optional` **tokensOut?**: `number` + +###### costUsd? + +> `optional` **costUsd?**: `number` + +###### latencyMs? + +> `optional` **latencyMs?**: `number` + +###### model? + +> `optional` **model?**: `string` + +##### attempts + +> **attempts**: `number` + +Defined in: [conversation/types.ts:163](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L163) + +Number of attempts that ran before this turn committed. `1` is the +common case; higher means the call policy retried after transient +failures. + +##### startedAt + +> **startedAt**: `string` + +Defined in: [conversation/types.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L164) + +##### endedAt + +> **endedAt**: `string` + +Defined in: [conversation/types.ts:165](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L165) + +*** + +### Conversation + +Defined in: [conversation/types.ts:169](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L169) + +#### Stable + +#### Properties + +##### participants + +> **participants**: readonly [`ConversationParticipant`](#conversationparticipant)[] + +Defined in: [conversation/types.ts:170](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L170) + +##### policy + +> **policy**: [`ConversationPolicy`](#conversationpolicy) + +Defined in: [conversation/types.ts:171](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L171) + +*** + +### RunConversationOptions + +Defined in: [conversation/types.ts:175](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L175) + +#### Stable + +#### Properties + +##### seed + +> **seed**: `string` + +Defined in: [conversation/types.ts:177](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L177) + +First message kicking off the conversation. Routes to the first speaker. + +##### runId? + +> `optional` **runId?**: `string` + +Defined in: [conversation/types.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L184) + +Optional run identifier for cross-participant trace correlation. Auto- +generated when omitted. Reusing a runId against the same `journal` +resumes the prior run — the runner replays the persisted transcript and +continues from the first un-recorded turn. + +##### signal? + +> `optional` **signal?**: `AbortSignal` + +Defined in: [conversation/types.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L186) + +Cancellation signal — aborts mid-stream and halts with `{ kind: 'abort' }`. + +##### onEvent? + +> `optional` **onEvent?**: (`event`) => `void` \| `Promise`\<`void`\> + +Defined in: [conversation/types.ts:193](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L193) + +Event sink for per-turn micro-events. Distinct from the result transcript: +the sink fires for every text-delta, every turn-start/end, and the +conversation-start/end markers. Used to drive SSE / dashboard updates +without waiting for the conversation to finish. + +###### Parameters + +###### event + +[`ConversationStreamEvent`](#conversationstreamevent) + +###### Returns + +`void` \| `Promise`\<`void`\> + +##### journal? + +> `optional` **journal?**: [`ConversationJournal`](#conversationjournal) + +Defined in: [conversation/types.ts:200](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L200) + +Optional durable transcript. When set, the runner persists every +committed turn before yielding `turn_end`. Reusing the same `runId` +against the same journal resumes from the last committed turn — so a +driver process crash mid-run loses zero acknowledged turns. + +##### propagatedHeaders? + +> `optional` **propagatedHeaders?**: `Readonly`\<`Record`\<`string`, `string`\>\> + +Defined in: [conversation/types.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L207) + +Headers to forward verbatim to every participant backend call (gateway +propagation: `X-Tangle-Forwarded-Authorization`, run/turn correlation, +depth counter). Backends opt in by reading `propagatedHeaders` from +their `AgentBackendContext`; backends that ignore the field still work. + +##### inboundDepth? + +> `optional` **inboundDepth?**: `number` + +Defined in: [conversation/types.ts:213](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L213) + +Inbound depth at the point this driver was invoked. The runner +increments it on every outbound participant call; gateways refuse at +`DEFAULT_MAX_DEPTH`. Default 0 (origin caller). + +##### parentTurnId? + +> `optional` **parentTurnId?**: `string` + +Defined in: [conversation/types.ts:220](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L220) + +Parent turn id when this conversation is *inside* another turn (i.e. the +driver is itself a participant via `createConversationBackend`). The +runner stamps each outbound call with this as `X-Tangle-Parent-TurnId` +so trace stitching survives nested orchestration. + +*** + +### ConversationResult + +Defined in: [conversation/types.ts:224](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L224) + +#### Stable + +#### Properties + +##### runId + +> **runId**: `string` + +Defined in: [conversation/types.ts:225](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L225) + +##### transcript + +> **transcript**: [`ConversationTurn`](#conversationturn)[] + +Defined in: [conversation/types.ts:226](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L226) + +##### turns + +> **turns**: `number` + +Defined in: [conversation/types.ts:227](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L227) + +##### spentCreditsCents + +> **spentCreditsCents**: `number` + +Defined in: [conversation/types.ts:228](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L228) + +##### halted + +> **halted**: [`HaltReason`](#haltreason) + +Defined in: [conversation/types.ts:229](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L229) + +##### durationMs + +> **durationMs**: `number` + +Defined in: [conversation/types.ts:230](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L230) + +##### startedAt + +> **startedAt**: `string` + +Defined in: [conversation/types.ts:231](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L231) + +##### endedAt + +> **endedAt**: `string` + +Defined in: [conversation/types.ts:232](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L232) + +*** + +### ChatStreamEvent + +Defined in: [durable/chat-engine.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L28) + +The NDJSON line protocol every product chat client already speaks. + +#### Properties + +##### type + +> **type**: `string` + +Defined in: [durable/chat-engine.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L29) + +##### data? + +> `optional` **data?**: `Record`\<`string`, `unknown`\> + +Defined in: [durable/chat-engine.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L30) + +*** + +### ChatTurnIdentity + +Defined in: [durable/chat-engine.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L35) + +Identity of a chat turn. `tenantId` is the workspace id for workspace- + scoped products and the user id for session-scoped products. + +#### Properties + +##### tenantId + +> **tenantId**: `string` + +Defined in: [durable/chat-engine.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L36) + +##### sessionId + +> **sessionId**: `string` + +Defined in: [durable/chat-engine.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L38) + +Thread / session id. + +##### userId + +> **userId**: `string` + +Defined in: [durable/chat-engine.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L39) + +##### turnIndex + +> **turnIndex**: `number` + +Defined in: [durable/chat-engine.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L41) + +Monotonic 0-based turn index within the session. + +*** + +### ChatTurnProducer + +Defined in: [durable/chat-engine.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L45) + +The live side of a turn — what the product's `produce` hook returns. + +#### Type Parameters + +##### TEvent + +`TEvent` *extends* [`ChatStreamEvent`](#chatstreamevent) = [`ChatStreamEvent`](#chatstreamevent) + +#### Properties + +##### stream + +> **stream**: `AsyncGenerator`\<`TEvent`, `void`, `unknown`\> + +Defined in: [durable/chat-engine.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L47) + +The turn's event stream. Forwarded verbatim to the caller. + +#### Methods + +##### finalText() + +> **finalText**(): `string` + +Defined in: [durable/chat-engine.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L49) + +The turn's final assistant text. Read once, after `stream` drains. + +###### Returns + +`string` + +*** + +### ChatTurnHooks + +Defined in: [durable/chat-engine.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L52) + +Turn-lifecycle helpers for `@tangle-network/agent-runtime`. + +Execution state — long-running execution, reconnect, replay, dedup — +lives in the substrate (`@tangle-network/sandbox` + orchestrator). +agent-runtime owns: + + - `handleChatTurn` — framework-neutral turn lifecycle: NDJSON framing, + `session.run.*` envelope, persist / post-process / trace-flush + hook ordering. + - `deriveExecutionId` — convention helper for the stable id products + persist so a retry of the same turn lands on the same execution. + +#### Methods + +##### produce() + +> **produce**(): [`ChatTurnProducer`](#chatturnproducer) + +Defined in: [durable/chat-engine.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L55) + +Build the backend stream. The engine forwards events verbatim and + reads `finalText()` once the stream drains. + +###### Returns + +[`ChatTurnProducer`](#chatturnproducer) + +##### persistAssistantMessage() + +> **persistAssistantMessage**(`input`): `Promise`\<`void`\> + +Defined in: [durable/chat-engine.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L58) + +Persist the assistant message to the product's own store. Called + once, after drain, with the assembled (transform-applied) text. + +###### Parameters + +###### input + +###### identity + +[`ChatTurnIdentity`](#chatturnidentity) + +###### finalText + +`string` + +###### Returns + +`Promise`\<`void`\> + +##### onTurnComplete()? + +> `optional` **onTurnComplete**(`input`): `Promise`\<`void`\> + +Defined in: [durable/chat-engine.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L62) + +Optional post-processing (proposals, citations, credit metering …). + Errors are swallowed + logged — post-process must never fail a turn + that already streamed successfully. + +###### Parameters + +###### input + +###### identity + +[`ChatTurnIdentity`](#chatturnidentity) + +###### finalText + +`string` + +###### Returns + +`Promise`\<`void`\> + +##### onEvent()? + +> `optional` **onEvent**(`event`): `void` \| `Promise`\<`void`\> + +Defined in: [durable/chat-engine.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L66) + +Optional per-event side channel (e.g. DO broadcast). Runs for every + emitted event, lifecycle envelope included. Errors swallowed — a + broadcast failure must not break the chat stream. + +###### Parameters + +###### event + +[`ChatStreamEvent`](#chatstreamevent) + +###### Returns + +`void` \| `Promise`\<`void`\> + +##### transformFinalText()? + +> `optional` **transformFinalText**(`text`): `string` \| `Promise`\<`string`\> + +Defined in: [durable/chat-engine.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L70) + +Optional pre-persist transform of the final text (e.g. PII + redaction). Affects only what is persisted; the live stream is + never altered. + +###### Parameters + +###### text + +`string` + +###### Returns + +`string` \| `Promise`\<`string`\> + +##### traceFlush()? + +> `optional` **traceFlush**(): `Promise`\<`void`\> + +Defined in: [durable/chat-engine.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L73) + +Optional trace flush — resolves when OTLP export completes. Handed + to `waitUntil` so the worker isolate stays alive for the POST. + +###### Returns + +`Promise`\<`void`\> + +*** + +### RunChatTurnInput + +Defined in: [durable/chat-engine.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L76) + +Turn-lifecycle helpers for `@tangle-network/agent-runtime`. + +Execution state — long-running execution, reconnect, replay, dedup — +lives in the substrate (`@tangle-network/sandbox` + orchestrator). +agent-runtime owns: + + - `handleChatTurn` — framework-neutral turn lifecycle: NDJSON framing, + `session.run.*` envelope, persist / post-process / trace-flush + hook ordering. + - `deriveExecutionId` — convention helper for the stable id products + persist so a retry of the same turn lands on the same execution. + +#### Properties + +##### identity + +> **identity**: [`ChatTurnIdentity`](#chatturnidentity) + +Defined in: [durable/chat-engine.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L77) + +##### hooks + +> **hooks**: [`ChatTurnHooks`](#chatturnhooks) + +Defined in: [durable/chat-engine.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L78) + +##### waitUntil? + +> `optional` **waitUntil?**: (`p`) => `void` + +Defined in: [durable/chat-engine.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L81) + +Worker liveness hook. When omitted, trace flush is awaited inline + before the stream closes. + +###### Parameters + +###### p + +`Promise`\<`unknown`\> + +###### Returns + +`void` + +##### log? + +> `optional` **log?**: (`message`, `meta?`) => `void` + +Defined in: [durable/chat-engine.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L84) + +Structured logger for swallowed hook errors. Defaults to + `console.error` so failures surface without product wiring. + +###### Parameters + +###### message + +`string` + +###### meta? + +`Record`\<`string`, `unknown`\> + +###### Returns + +`void` + +*** + +### ChatTurnResult + +Defined in: [durable/chat-engine.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L87) + +Turn-lifecycle helpers for `@tangle-network/agent-runtime`. + +Execution state — long-running execution, reconnect, replay, dedup — +lives in the substrate (`@tangle-network/sandbox` + orchestrator). +agent-runtime owns: + + - `handleChatTurn` — framework-neutral turn lifecycle: NDJSON framing, + `session.run.*` envelope, persist / post-process / trace-flush + hook ordering. + - `deriveExecutionId` — convention helper for the stable id products + persist so a retry of the same turn lands on the same execution. + +#### Properties + +##### body + +> **body**: `ReadableStream`\<`Uint8Array`\<`ArrayBufferLike`\>\> + +Defined in: [durable/chat-engine.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L89) + +NDJSON body — return this as the platform `Response` body. + +##### contentType + +> **contentType**: `"application/x-ndjson"` + +Defined in: [durable/chat-engine.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L91) + +Content type for the response. + +*** + +### DelegatedLoopResult + +Defined in: [loop-runner.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L75) + +**`Experimental`** + +Uniform result — never throws from a registered runner; a + thrown engine becomes `{ ok: false, error }` so a routine can record + move on. + +#### Type Parameters + +##### T + +`T` = `unknown` + +#### Properties + +##### mode + +> **mode**: `"code"` \| `"review"` \| `"research"` \| `"audit"` \| `"self-improve"` + +Defined in: [loop-runner.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L76) + +**`Experimental`** + +##### ok + +> **ok**: `boolean` + +Defined in: [loop-runner.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L77) + +**`Experimental`** + +##### output? + +> `optional` **output?**: `T` + +Defined in: [loop-runner.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L78) + +**`Experimental`** + +##### error? + +> `optional` **error?**: `string` + +Defined in: [loop-runner.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L79) + +**`Experimental`** + +##### durationMs + +> **durationMs**: `number` + +Defined in: [loop-runner.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L80) + +**`Experimental`** + +*** + +### RunDelegatedLoopOptions + +Defined in: [loop-runner.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L84) + +**`Experimental`** + +#### Properties + +##### signal? + +> `optional` **signal?**: `AbortSignal` + +Defined in: [loop-runner.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L85) + +**`Experimental`** + +##### now? + +> `optional` **now?**: () => `number` + +Defined in: [loop-runner.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L87) + +**`Experimental`** + +Clock override for deterministic tests. + +###### Returns + +`number` + +*** + +### CoderLoopRunnerOptions + +Defined in: [loop-runner.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L128) + +**`Experimental`** + +Options for the default `code`/`review` runner. + +#### Properties + +##### sandboxClient + +> **sandboxClient**: [`SandboxClient`](runtime.md#sandboxclient-2) + +Defined in: [loop-runner.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L129) + +**`Experimental`** + +##### args + +> **args**: [`DelegateCodeArgs`](mcp.md#delegatecodeargs) + +Defined in: [loop-runner.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L131) + +**`Experimental`** + +What to build — the delegate args (goal, repoRoot, variants, config, …). + +##### reviewer? + +> `optional` **reviewer?**: [`CoderReviewer`](mcp.md#coderreviewer) + +Defined in: [loop-runner.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L133) + +**`Experimental`** + +Adversarial reviewer. Pass one to run `review` mode (an approval gate over the candidate). + +##### winnerSelection? + +> `optional` **winnerSelection?**: [`DetachedWinnerSelection`](mcp.md#detachedwinnerselection) + +Defined in: [loop-runner.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L135) + +**`Experimental`** + +Winner-selection strategy. Default `highest-score`. + +##### fanoutHarnesses? + +> `optional` **fanoutHarnesses?**: `string`[] + +Defined in: [loop-runner.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L137) + +**`Experimental`** + +Harnesses for `variants > 1` fanout. + +*** + +### WorktreeLoopRunnerOptions + +Defined in: [loop-runner.ts:158](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L158) + +**`Experimental`** + +Options for the local-repo `code` runner over the GENERIC recursive path. + +#### Properties + +##### repoRoot + +> **repoRoot**: `string` + +Defined in: [loop-runner.ts:160](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L160) + +**`Experimental`** + +Absolute path to the local git checkout each worktree is cut from. + +##### taskPrompt + +> **taskPrompt**: `string` + +Defined in: [loop-runner.ts:162](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L162) + +**`Experimental`** + +The instruction handed to every authored harness (composed under each profile's systemPrompt). + +##### harnesses + +> **harnesses**: readonly [`AuthoredHarness`](runtime.md#authoredharness)[] + +Defined in: [loop-runner.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L164) + +**`Experimental`** + +The supervisor-authored harness profiles — one fanout item (one worktree-CLI leaf) each. + +##### budget + +> **budget**: [`Budget`](runtime.md#budget-8) + +Defined in: [loop-runner.ts:166](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L166) + +**`Experimental`** + +Conserved budget pool bounding the fanout (equal-k holds by construction). + +##### testCmd? + +> `optional` **testCmd?**: `string` + +Defined in: [loop-runner.ts:168](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L168) + +**`Experimental`** + +Shell command run in each worktree to derive the tests-PASS signal. + +##### typecheckCmd? + +> `optional` **typecheckCmd?**: `string` + +Defined in: [loop-runner.ts:170](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L170) + +**`Experimental`** + +Shell command run in each worktree to derive the typecheck-PASS signal. + +##### require? + +> `optional` **require?**: readonly (`"tests"` \| `"typecheck"`)[] + +Defined in: [loop-runner.ts:172](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L172) + +**`Experimental`** + +Which verification signals the deliverable REQUIRES present-and-passing (default none). + +##### maxDiffLines? + +> `optional` **maxDiffLines?**: `number` + +Defined in: [loop-runner.ts:174](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L174) + +**`Experimental`** + +Diff-size cap (lines). + +##### forbiddenPaths? + +> `optional` **forbiddenPaths?**: `string`[] + +Defined in: [loop-runner.ts:176](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L176) + +**`Experimental`** + +Literal path prefixes the patch must not touch (the secret-floor is always on regardless). + +##### winnerStrategy? + +> `optional` **winnerStrategy?**: [`WinnerStrategy`](runtime.md#winnerstrategy) + +Defined in: [loop-runner.ts:178](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L178) + +**`Experimental`** + +Winner-selection strategy among gated candidates. Default `highest-score`. + +##### runGit? + +> `optional` **runGit?**: [`GitRunner`](mcp.md#gitrunner) + +Defined in: [loop-runner.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L180) + +**`Experimental`** + +Test seams forwarded to the worktree-CLI leaves so the runner drives offline. + +##### runHarness? + +> `optional` **runHarness?**: (`options`) => `Promise`\<[`LocalHarnessResult`](mcp.md#localharnessresult)\> + +Defined in: [loop-runner.ts:181](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L181) + +**`Experimental`** + +**`Experimental`** + +Spawn a local coding harness CLI as a subprocess + collect its output. + +NOT responsible for parsing the harness's output or extracting a diff — +the in-process executor's `streamPrompt` orchestrates `git diff` against +the worktree after this resolves. This function is intentionally narrow: +spawn, wait, capture, return. + +Fails loud — throws when: + - `cwd` doesn't exist (subprocess emits ENOENT; surfaced as Error) + - the harness binary is not on PATH (ENOENT) + +Does NOT throw when: + - the subprocess exits non-zero (`result.exitCode` carries the code) + - the subprocess is aborted / timed out (`result.killedBySignal` / + `result.timedOut` carries the reason) + +###### Parameters + +###### options + +[`RunLocalHarnessOptions`](mcp.md#runlocalharnessoptions) + +###### Returns + +`Promise`\<[`LocalHarnessResult`](mcp.md#localharnessresult)\> + +##### runCommand? + +> `optional` **runCommand?**: `WorktreeCheckRunner` + +Defined in: [loop-runner.ts:182](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L182) + +**`Experimental`** + +*** + +### VetoedFact + +Defined in: [loop-runner.ts:243](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L243) + +**`Experimental`** + +A fact rejected at the KB gate — surfaced, never dropped. + +#### Properties + +##### candidate + +> **candidate**: [`FactCandidate`](mcp.md#factcandidate) + +Defined in: [loop-runner.ts:244](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L244) + +**`Experimental`** + +##### vetoedBy? + +> `optional` **vetoedBy?**: `string` + +Defined in: [loop-runner.ts:245](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L245) + +**`Experimental`** + +##### reason? + +> `optional` **reason?**: `string` + +Defined in: [loop-runner.ts:246](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L246) + +**`Experimental`** + +*** + +### ResearchLoopResult + +Defined in: [loop-runner.ts:250](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L250) + +**`Experimental`** + +#### Properties + +##### accepted + +> **accepted**: [`FactCandidate`](mcp.md#factcandidate)[] + +Defined in: [loop-runner.ts:252](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L252) + +**`Experimental`** + +Facts that passed the fail-closed gate — safe to write to the KB. + +##### vetoed + +> **vetoed**: [`VetoedFact`](#vetoedfact)[] + +Defined in: [loop-runner.ts:254](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L254) + +**`Experimental`** + +Facts the gate vetoed in the final round — escalate, do not silently drop. + +##### rounds + +> **rounds**: `number` + +Defined in: [loop-runner.ts:256](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L256) + +**`Experimental`** + +Research rounds actually run. + +*** + +### ResearchLoopRunnerOptions + +Defined in: [loop-runner.ts:260](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L260) + +**`Experimental`** + +Options for the default `research` runner. + +#### Properties + +##### research + +> **research**: (`round`, `vetoed`) => `Promise`\<[`FactCandidate`](mcp.md#factcandidate)[]\> + +Defined in: [loop-runner.ts:267](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L267) + +**`Experimental`** + +The research engine (the consumer's web/doc searcher + extractor). Called +each round with the prior round's vetoes so it can re-research the gaps. +Returns fact candidates carrying their grounding (`verbatimPassage` + +`sourceText`). + +###### Parameters + +###### round + +`number` + +###### vetoed + +[`VetoedFact`](#vetoedfact)[] + +###### Returns + +`Promise`\<[`FactCandidate`](mcp.md#factcandidate)[]\> + +##### gate? + +> `optional` **gate?**: [`CreateKbGateOptions`](mcp.md#createkbgateoptions) + +Defined in: [loop-runner.ts:269](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L269) + +**`Experimental`** + +Gate config (extra judges, self-artifact kinds, …). The floor is always on. + +##### maxRounds? + +> `optional` **maxRounds?**: `number` + +Defined in: [loop-runner.ts:271](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L271) + +**`Experimental`** + +Max research rounds (correct-on-veto remediation). Default 1. + +*** + +### ModelInfo + +Defined in: [model-resolution.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L21) + +A model entry as returned by the Tangle Router `/v1/models` endpoint. +Intentionally minimal — only the fields resolution + validation read. + +#### Properties + +##### id + +> **id**: `string` + +Defined in: [model-resolution.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L22) + +##### name? + +> `optional` **name?**: `string` + +Defined in: [model-resolution.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L23) + +##### description? + +> `optional` **description?**: `string` + +Defined in: [model-resolution.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L24) + +##### provider? + +> `optional` **provider?**: `string` + +Defined in: [model-resolution.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L26) + +Provider slug, when the router exposes it (`provider` or `_provider`). + +##### \_provider? + +> `optional` **\_provider?**: `string` + +Defined in: [model-resolution.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L27) + +##### architecture? + +> `optional` **architecture?**: `object` + +Defined in: [model-resolution.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L28) + +###### modality? + +> `optional` **modality?**: `string` + +###### input\_modalities? + +> `optional` **input\_modalities?**: `string`[] + +###### output\_modalities? + +> `optional` **output\_modalities?**: `string`[] + +*** + +### RouterEnv + +Defined in: [model-resolution.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L36) + +Env keys the router base URL is resolved from. + +#### Properties + +##### TANGLE\_ROUTER\_URL? + +> `optional` **TANGLE\_ROUTER\_URL?**: `string` + +Defined in: [model-resolution.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L37) + +##### TANGLE\_ROUTER\_BASE\_URL? + +> `optional` **TANGLE\_ROUTER\_BASE\_URL?**: `string` + +Defined in: [model-resolution.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L38) + +*** + +### ResolvedChatModel + +Defined in: [model-resolution.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L78) + +#### Properties + +##### source + +> **source**: `string` + +Defined in: [model-resolution.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L79) + +##### model + +> **model**: `string` + +Defined in: [model-resolution.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L80) + +*** + +### OtelExportConfig + +Defined in: [otel-export.ts:12](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L12) + +OTEL span exporter — streams LoopTraceEvents to an OTLP/HTTP collector. + +Reads OTEL_EXPORTER_OTLP_ENDPOINT + OTEL_EXPORTER_OTLP_HEADERS from env +when no explicit config is given. Keeps the runtime dep-free from +@opentelemetry/sdk-trace-base — minimal OTLP/JSON serializer. + +The exporter accepts both raw OtelSpan objects and LoopTraceEvents +(which get converted to OTLP spans automatically). + +#### Properties + +##### endpoint? + +> `optional` **endpoint?**: `string` + +Defined in: [otel-export.ts:14](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L14) + +OTLP endpoint. Reads OTEL_EXPORTER_OTLP_ENDPOINT env by default. + +##### headers? + +> `optional` **headers?**: `Record`\<`string`, `string`\> + +Defined in: [otel-export.ts:16](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L16) + +OTLP headers. Reads OTEL_EXPORTER_OTLP_HEADERS env by default. + +##### batchSize? + +> `optional` **batchSize?**: `number` + +Defined in: [otel-export.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L18) + +Batch size before flush. Default 64. + +##### flushIntervalMs? + +> `optional` **flushIntervalMs?**: `number` + +Defined in: [otel-export.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L20) + +Flush interval ms. Default 5000. + +##### resourceAttributes? + +> `optional` **resourceAttributes?**: `Record`\<`string`, `string` \| `number` \| `boolean`\> + +Defined in: [otel-export.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L22) + +Resource attributes stamped on every export. + +##### serviceName? + +> `optional` **serviceName?**: `string` + +Defined in: [otel-export.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L24) + +Service name. Default 'agent-runtime'. + +*** + +### OtelExporter + +Defined in: [otel-export.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L27) + +#### Methods + +##### exportSpan() + +> **exportSpan**(`span`): `void` + +Defined in: [otel-export.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L29) + +Export a span. + +###### Parameters + +###### span + +[`OtelSpan`](#otelspan) + +###### Returns + +`void` + +##### flush() + +> **flush**(): `Promise`\<`void`\> + +Defined in: [otel-export.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L31) + +Force flush pending spans. + +###### Returns + +`Promise`\<`void`\> + +##### shutdown() + +> **shutdown**(): `Promise`\<`void`\> + +Defined in: [otel-export.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L33) + +Shutdown cleanly. + +###### Returns + +`Promise`\<`void`\> + +*** + +### OtelSpan + +Defined in: [otel-export.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L36) + +#### Properties + +##### traceId + +> **traceId**: `string` + +Defined in: [otel-export.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L37) + +##### spanId + +> **spanId**: `string` + +Defined in: [otel-export.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L38) + +##### parentSpanId? + +> `optional` **parentSpanId?**: `string` + +Defined in: [otel-export.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L39) + +##### name + +> **name**: `string` + +Defined in: [otel-export.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L40) + +##### kind? + +> `optional` **kind?**: `number` + +Defined in: [otel-export.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L41) + +##### startTimeUnixNano + +> **startTimeUnixNano**: `string` + +Defined in: [otel-export.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L42) + +##### endTimeUnixNano + +> **endTimeUnixNano**: `string` + +Defined in: [otel-export.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L43) + +##### attributes? + +> `optional` **attributes?**: [`OtelAttribute`](#otelattribute)[] + +Defined in: [otel-export.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L44) + +##### status? + +> `optional` **status?**: `object` + +Defined in: [otel-export.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L45) + +###### code + +> **code**: `number` + +###### message? + +> `optional` **message?**: `string` + +*** + +### OtelAttribute + +Defined in: [otel-export.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L48) + +#### Properties + +##### key + +> **key**: `string` + +Defined in: [otel-export.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L49) + +##### value + +> **value**: `object` + +Defined in: [otel-export.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L50) + +###### stringValue? + +> `optional` **stringValue?**: `string` + +###### intValue? + +> `optional` **intValue?**: `string` + +###### doubleValue? + +> `optional` **doubleValue?**: `number` + +###### boolValue? + +> `optional` **boolValue?**: `boolean` + +*** + +### LoopSpanNode + +Defined in: [otel-export.ts:202](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L202) + +Sink-neutral node in a reconstructed loop span tree. The root node's +`parentSpanId` is `undefined` — sinks decide how to parent it (the OTEL +mapper attaches the inherited delegation span; the delegation journal +leaves it as the tree root). + +#### Properties + +##### spanId + +> **spanId**: `string` + +Defined in: [otel-export.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L203) + +##### parentSpanId? + +> `optional` **parentSpanId?**: `string` + +Defined in: [otel-export.ts:204](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L204) + +##### name + +> **name**: `string` + +Defined in: [otel-export.ts:206](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L206) + +`'loop'` | `'loop.round'` | `'loop.iteration'`. + +##### kind + +> **kind**: `"loop"` \| `"round"` \| `"branch"` + +Defined in: [otel-export.ts:208](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L208) + +Topology level: loop root, plan round, or iteration branch. + +##### startMs + +> **startMs**: `number` + +Defined in: [otel-export.ts:209](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L209) + +##### endMs + +> **endMs**: `number` + +Defined in: [otel-export.ts:210](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L210) + +##### attrs + +> **attrs**: `Record`\<`string`, `string` \| `number` \| `boolean`\> + +Defined in: [otel-export.ts:211](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L211) + +##### error + +> **error**: `boolean` + +Defined in: [otel-export.ts:213](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L213) + +True when the iteration carried an error — maps to OTEL status code 2. + +*** + +### EvalRunGeneration + +Defined in: [otel-export.ts:521](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L521) + +#### Properties + +##### index + +> **index**: `number` + +Defined in: [otel-export.ts:523](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L523) + +0-based ordinal of this generation within the run (required by ingest). + +##### surfaceHash + +> **surfaceHash**: `string` + +Defined in: [otel-export.ts:525](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L525) + +Identity of the proposed surface change (content-addressed hash). + +##### surface? + +> `optional` **surface?**: `unknown` + +Defined in: [otel-export.ts:527](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L527) + +Arbitrary provenance for this generation (rationale, evidence, source). + +##### cells? + +> `optional` **cells?**: `unknown`[] + +Defined in: [otel-export.ts:529](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L529) + +Per-scenario results; empty until the generation is measured. + +##### compositeMean + +> **compositeMean**: `number` + +Defined in: [otel-export.ts:531](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L531) + +Mean composite score (0 when unmeasured — pair with labels.measured). + +##### costUsd + +> **costUsd**: `number` + +Defined in: [otel-export.ts:532](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L532) + +##### durationMs + +> **durationMs**: `number` + +Defined in: [otel-export.ts:533](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L533) + +*** + +### EvalRunEvent + +Defined in: [otel-export.ts:536](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L536) + +#### Properties + +##### runId + +> **runId**: `string` + +Defined in: [otel-export.ts:537](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L537) + +##### runDir + +> **runDir**: `string` + +Defined in: [otel-export.ts:538](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L538) + +##### timestamp + +> **timestamp**: `string` + +Defined in: [otel-export.ts:540](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L540) + +ISO timestamp. + +##### status + +> **status**: `"started"` \| `"baseline-complete"` \| `"generation-complete"` \| `"gate-decided"` \| `"finished"` \| `"errored"` + +Defined in: [otel-export.ts:541](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L541) + +##### labels? + +> `optional` **labels?**: `Record`\<`string`, `string`\> + +Defined in: [otel-export.ts:548](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L548) + +##### baseline? + +> `optional` **baseline?**: [`EvalRunGeneration`](#evalrungeneration) + +Defined in: [otel-export.ts:549](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L549) + +##### generations? + +> `optional` **generations?**: [`EvalRunGeneration`](#evalrungeneration)[] + +Defined in: [otel-export.ts:550](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L550) + +##### gateDecision? + +> `optional` **gateDecision?**: `"ship"` \| `"hold"` \| `"need_more_work"` \| `"model_ceiling"` \| `"arch_ceiling"` + +Defined in: [otel-export.ts:551](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L551) + +##### holdoutLift? + +> `optional` **holdoutLift?**: `number` + +Defined in: [otel-export.ts:552](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L552) + +##### totalCostUsd + +> **totalCostUsd**: `number` + +Defined in: [otel-export.ts:553](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L553) + +##### totalDurationMs + +> **totalDurationMs**: `number` + +Defined in: [otel-export.ts:554](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L554) + +##### errorMessage? + +> `optional` **errorMessage?**: `string` + +Defined in: [otel-export.ts:555](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L555) + +*** + +### EvalRunsExportConfig + +Defined in: [otel-export.ts:558](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L558) + +#### Properties + +##### apiKey? + +> `optional` **apiKey?**: `string` + +Defined in: [otel-export.ts:560](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L560) + +Bearer key — tenant is resolved server-side from it. Reads TANGLE_API_KEY. + +##### base? + +> `optional` **base?**: `string` + +Defined in: [otel-export.ts:562](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L562) + +Intelligence base. Reads INTELLIGENCE_BASE env, else prod. + +##### idempotencyKey? + +> `optional` **idempotencyKey?**: `string` + +Defined in: [otel-export.ts:564](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L564) + +Idempotency-Key header (e.g. the runId) — safe retries + upsert. + +*** + +### EvalRunsExportResult + +Defined in: [otel-export.ts:567](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L567) + +#### Properties + +##### ok + +> **ok**: `boolean` + +Defined in: [otel-export.ts:568](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L568) + +##### status + +> **status**: `number` + +Defined in: [otel-export.ts:569](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L569) + +##### accepted + +> **accepted**: `number` + +Defined in: [otel-export.ts:570](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L570) + +##### rejected + +> **rejected**: `object`[] + +Defined in: [otel-export.ts:571](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L571) + +###### index + +> **index**: `number` + +###### reason + +> **reason**: `string` + +*** + +### RuntimeHookEvent + +Defined in: [runtime-hooks.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L35) + +#### Type Parameters + +##### Payload + +`Payload` = `unknown` + +#### Properties + +##### id + +> **id**: `string` + +Defined in: [runtime-hooks.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L36) + +##### runId + +> **runId**: `string` + +Defined in: [runtime-hooks.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L37) + +##### scenarioId? + +> `optional` **scenarioId?**: `string` + +Defined in: [runtime-hooks.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L38) + +##### target + +> **target**: [`RuntimeHookTarget`](#runtimehooktarget) + +Defined in: [runtime-hooks.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L39) + +##### phase + +> **phase**: [`RuntimeHookPhase`](#runtimehookphase) + +Defined in: [runtime-hooks.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L40) + +##### timestamp + +> **timestamp**: `number` + +Defined in: [runtime-hooks.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L41) + +##### stepIndex? + +> `optional` **stepIndex?**: `number` + +Defined in: [runtime-hooks.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L42) + +##### parentId? + +> `optional` **parentId?**: `string` + +Defined in: [runtime-hooks.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L43) + +##### payload? + +> `optional` **payload?**: `Payload` + +Defined in: [runtime-hooks.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L44) + +##### metadata? + +> `optional` **metadata?**: `Record`\<`string`, `unknown`\> + +Defined in: [runtime-hooks.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L45) + +*** + +### RuntimeHookContext + +Defined in: [runtime-hooks.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L48) + +#### Properties + +##### signal? + +> `optional` **signal?**: `AbortSignal` + +Defined in: [runtime-hooks.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L49) + +*** + +### RuntimeDecisionEvidenceRef + +Defined in: [runtime-hooks.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L52) + +#### Properties + +##### source + +> **source**: `string` + +Defined in: [runtime-hooks.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L53) + +##### id + +> **id**: `string` + +Defined in: [runtime-hooks.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L54) + +##### detail? + +> `optional` **detail?**: `string` + +Defined in: [runtime-hooks.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L55) + +##### metadata? + +> `optional` **metadata?**: `Record`\<`string`, `unknown`\> + +Defined in: [runtime-hooks.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L56) + +*** + +### RuntimeDecisionPoint + +Defined in: [runtime-hooks.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L59) + +#### Properties + +##### id + +> **id**: `string` + +Defined in: [runtime-hooks.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L60) + +##### runId + +> **runId**: `string` + +Defined in: [runtime-hooks.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L61) + +##### scenarioId? + +> `optional` **scenarioId?**: `string` + +Defined in: [runtime-hooks.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L62) + +##### stepIndex + +> **stepIndex**: `number` + +Defined in: [runtime-hooks.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L63) + +##### kind + +> **kind**: [`RuntimeDecisionKind`](#runtimedecisionkind) + +Defined in: [runtime-hooks.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L64) + +##### candidateActions + +> **candidateActions**: `string`[] + +Defined in: [runtime-hooks.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L65) + +##### context? + +> `optional` **context?**: `string` + +Defined in: [runtime-hooks.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L66) + +##### evidence + +> **evidence**: [`RuntimeDecisionEvidenceRef`](#runtimedecisionevidenceref)[] + +Defined in: [runtime-hooks.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L67) + +##### metadata? + +> `optional` **metadata?**: `Record`\<`string`, `unknown`\> + +Defined in: [runtime-hooks.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L68) + +*** + +### RuntimeHookErrorContext + +Defined in: [runtime-hooks.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L71) + +#### Properties + +##### hook + +> **hook**: `"onEvent"` \| `"onDecisionPoint"` + +Defined in: [runtime-hooks.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L72) + +##### eventId? + +> `optional` **eventId?**: `string` + +Defined in: [runtime-hooks.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L73) + +##### target? + +> `optional` **target?**: [`RuntimeHookTarget`](#runtimehooktarget) + +Defined in: [runtime-hooks.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L74) + +##### phase? + +> `optional` **phase?**: [`RuntimeHookPhase`](#runtimehookphase) + +Defined in: [runtime-hooks.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L75) + +##### decisionId? + +> `optional` **decisionId?**: `string` + +Defined in: [runtime-hooks.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L76) + +##### decisionKind? + +> `optional` **decisionKind?**: [`RuntimeDecisionKind`](#runtimedecisionkind) + +Defined in: [runtime-hooks.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L77) + +*** + +### RuntimeHooks + +Defined in: [runtime-hooks.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L87) + +The observation seam attached to a running loop (never to the portable genome). +Implement the optional hooks to receive lifecycle events, semantic decision points, +and hook errors. Author with [defineRuntimeHooks](#defineruntimehooks) for inference, and attach N +observers at once with [composeRuntimeHooks](#composeruntimehooks) — there is ONE event stream, not a +callback-prop zoo. + +#### Properties + +##### onEvent? + +> `optional` **onEvent?**: (`event`, `context`) => `void` \| `Promise`\<`void`\> + +Defined in: [runtime-hooks.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L93) + +General before/after/event hook. Use this for telemetry, memory capture, +policy wrapping, child lifecycle observers, or product-specific extension +points. + +###### Parameters + +###### event + +[`RuntimeHookEvent`](#runtimehookevent) + +###### context + +[`RuntimeHookContext`](#runtimehookcontext) + +###### Returns + +`void` \| `Promise`\<`void`\> + +##### onDecisionPoint? + +> `optional` **onDecisionPoint?**: (`point`, `context`) => `void` \| `Promise`\<`void`\> + +Defined in: [runtime-hooks.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L98) + +Semantic decision hook. Belief-state evaluation consumes this, but runtime +code should keep emitting ordinary lifecycle events as the base layer. + +###### Parameters + +###### point + +[`RuntimeDecisionPoint`](#runtimedecisionpoint) + +###### context + +[`RuntimeHookContext`](#runtimehookcontext) + +###### Returns + +`void` \| `Promise`\<`void`\> + +##### onHookError? + +> `optional` **onHookError?**: (`error`, `context`) => `void` \| `Promise`\<`void`\> + +Defined in: [runtime-hooks.ts:102](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L102) + +###### Parameters + +###### error + +`Error` + +###### context + +[`RuntimeHookErrorContext`](#runtimehookerrorcontext) + +###### Returns + +`void` \| `Promise`\<`void`\> + +*** + +### RuntimeRunRow + +Defined in: [runtime-run.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L60) + +#### Stable + +#### Properties + +##### id + +> **id**: `string` + +Defined in: [runtime-run.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L62) + +Stable runtime-side identifier. Adapters may translate to their own primary key. + +##### workspaceId + +> **workspaceId**: `string` + +Defined in: [runtime-run.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L63) + +##### sessionId? + +> `optional` **sessionId?**: `string` + +Defined in: [runtime-run.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L64) + +##### agentId? + +> `optional` **agentId?**: `string` + +Defined in: [runtime-run.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L65) + +##### domain? + +> `optional` **domain?**: `string` + +Defined in: [runtime-run.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L66) + +##### taskId + +> **taskId**: `string` + +Defined in: [runtime-run.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L67) + +##### scenarioId? + +> `optional` **scenarioId?**: `string` + +Defined in: [runtime-run.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L68) + +##### status + +> **status**: `RuntimeRunStatus` + +Defined in: [runtime-run.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L69) + +##### resultSummary? + +> `optional` **resultSummary?**: `string` + +Defined in: [runtime-run.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L70) + +##### error? + +> `optional` **error?**: `string` + +Defined in: [runtime-run.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L71) + +##### cost + +> **cost**: `RuntimeRunCost` + +Defined in: [runtime-run.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L72) + +##### startedAt + +> **startedAt**: `string` + +Defined in: [runtime-run.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L73) + +##### completedAt? + +> `optional` **completedAt?**: `string` + +Defined in: [runtime-run.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L74) + +##### metadata? + +> `optional` **metadata?**: `Record`\<`string`, `unknown`\> + +Defined in: [runtime-run.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L75) + +*** + +### RuntimeRunPersistenceAdapter + +Defined in: [runtime-run.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L79) + +#### Stable + +#### Methods + +##### upsert() + +> **upsert**(`row`): `void` \| `Promise`\<`void`\> + +Defined in: [runtime-run.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L87) + +Called once when `handle.persist()` runs. Implementations write `row` to +their durable store (D1, postgres, KV) and return whatever the consumer +wants the caller to see (often the storage-side row id). Errors thrown +here propagate out of `persist()` so the caller can decide whether to +retry or log-and-continue. + +###### Parameters + +###### row + +[`RuntimeRunRow`](#runtimerunrow) + +###### Returns + +`void` \| `Promise`\<`void`\> + +*** + +### RuntimeRunHandle + +Defined in: [runtime-run.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L106) + +#### Stable + +#### Properties + +##### id + +> `readonly` **id**: `string` + +Defined in: [runtime-run.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L108) + +Stable id assigned at start. + +##### workspaceId + +> `readonly` **workspaceId**: `string` + +Defined in: [runtime-run.ts:109](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L109) + +##### sessionId + +> `readonly` **sessionId**: `string` \| `undefined` + +Defined in: [runtime-run.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L110) + +##### taskSpec + +> `readonly` **taskSpec**: [`AgentTaskSpec`](#agenttaskspec) + +Defined in: [runtime-run.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L111) + +##### status + +> `readonly` **status**: `RuntimeRunStatus` + +Defined in: [runtime-run.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L112) + +#### Methods + +##### observe() + +> **observe**(`event`): `void` + +Defined in: [runtime-run.ts:119](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L119) + +Observe a single `RuntimeStreamEvent`. The handle ignores non-cost events +(text deltas, tool calls) silently so consumers can pipe the whole stream +through `handle.observe`. `llm_call` events update the ledger. + +###### Parameters + +###### event + +[`RuntimeStreamEvent`](#runtimestreamevent) + +###### Returns + +`void` + +##### cost() + +> **cost**(): `RuntimeRunCost` + +Defined in: [runtime-run.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L122) + +Snapshot of the current cost ledger. Safe to call at any time. + +###### Returns + +`RuntimeRunCost` + +##### complete() + +> **complete**(`input`): `void` + +Defined in: [runtime-run.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L129) + +Transition to a terminal state. Idempotent for the same status; throws +`RuntimeRunStateError` for a different terminal status (state machines +don't time-travel). + +###### Parameters + +###### input + +`RuntimeRunCompleteInput` + +###### Returns + +`void` + +##### toRow() + +> **toRow**(`metadata?`): [`RuntimeRunRow`](#runtimerunrow) + +Defined in: [runtime-run.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L132) + +Build the current row without writing it. Useful for tests + dry runs. + +###### Parameters + +###### metadata? + +`Record`\<`string`, `unknown`\> + +###### Returns + +[`RuntimeRunRow`](#runtimerunrow) + +##### persist() + +> **persist**(`metadata?`): `Promise`\<`void`\> + +Defined in: [runtime-run.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L139) + +Persist the current row via the configured adapter. Must be called after +`complete()`. Idempotent for the same terminal state (the adapter sees +the same row on retry). + +###### Parameters + +###### metadata? + +`Record`\<`string`, `unknown`\> + +###### Returns + +`Promise`\<`void`\> + +*** + +### RuntimeTelemetryOptions + +Defined in: [sanitize.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L29) + +#### Stable + +#### Properties + +##### includeInputs? + +> `optional` **includeInputs?**: `boolean` + +Defined in: [sanitize.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L34) + +Include raw task inputs. Off by default because task inputs often contain +customer facts, credentials, source text, or internal IDs. + +##### includeRequirementDescriptions? + +> `optional` **includeRequirementDescriptions?**: `boolean` + +Defined in: [sanitize.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L36) + +Include requirement descriptions. Secret requirements are always redacted. + +##### includeEvidenceIds? + +> `optional` **includeEvidenceIds?**: `boolean` + +Defined in: [sanitize.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L38) + +Include evidence IDs. Off by default; counts are safer for shared reports. + +##### includeUserAnswers? + +> `optional` **includeUserAnswers?**: `boolean` + +Defined in: [sanitize.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L40) + +Include user answers from question preflight. Off by default. + +##### includeControlPayloads? + +> `optional` **includeControlPayloads?**: `boolean` + +Defined in: [sanitize.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L42) + +Include action payloads and action results for control steps. Off by default. + +##### includeMetadata? + +> `optional` **includeMetadata?**: `boolean` + +Defined in: [sanitize.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L44) + +Include task metadata. Off by default because metadata may carry IDs or policy internals. + +##### includeEvalDetails? + +> `optional` **includeEvalDetails?**: `boolean` + +Defined in: [sanitize.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L46) + +Include eval detail/evidence strings. Off by default because validators may echo private input. + +*** + +### SanitizedKnowledgeReadinessReport + +Defined in: [sanitize.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L67) + +#### Stable + +#### Properties + +##### taskId + +> **taskId**: `string` + +Defined in: [sanitize.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L68) + +##### readinessScore + +> **readinessScore**: `number` + +Defined in: [sanitize.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L69) + +##### recommendedAction + +> **recommendedAction**: `KnowledgeRecommendedAction` + +Defined in: [sanitize.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L70) + +##### severity + +> **severity**: `ControlSeverity` + +Defined in: [sanitize.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L71) + +##### reason + +> **reason**: `string` + +Defined in: [sanitize.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L72) + +##### blockingMissingRequirements + +> **blockingMissingRequirements**: `SanitizedKnowledgeRequirement`[] + +Defined in: [sanitize.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L73) + +##### nonBlockingGaps + +> **nonBlockingGaps**: `SanitizedKnowledgeRequirement`[] + +Defined in: [sanitize.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L74) + +##### evidenceCount + +> **evidenceCount**: `number` + +Defined in: [sanitize.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L75) + +##### evidenceIds? + +> `optional` **evidenceIds?**: `string`[] + +Defined in: [sanitize.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L76) + +##### missingRequirementIds + +> **missingRequirementIds**: `string`[] + +Defined in: [sanitize.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L77) + +*** + +### RuntimeEventCollector + +Defined in: [sanitize.ts:492](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L492) + +#### Stable + +#### Type Parameters + +##### TState + +`TState` = `unknown` + +##### TAction + +`TAction` = `unknown` + +##### TActionResult + +`TActionResult` = `unknown` + +##### TEval + +`TEval` *extends* `ControlEvalResult` = `ControlEvalResult` + +#### Properties + +##### onEvent + +> **onEvent**: (`event`) => `void` + +Defined in: [sanitize.ts:498](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L498) + +###### Parameters + +###### event + +[`AgentRuntimeEvent`](#agentruntimeevent)\<`TState`, `TAction`, `TActionResult`, `TEval`\> + +###### Returns + +`void` + +##### events + +> **events**: `Record`\<`string`, `unknown`\>[] + +Defined in: [sanitize.ts:499](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L499) + +*** + +### RuntimeStreamEventCollector + +Defined in: [sanitize.ts:522](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L522) + +#### Stable + +#### Properties + +##### onEvent + +> **onEvent**: `RuntimeStreamEventSink` + +Defined in: [sanitize.ts:523](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L523) + +##### events + +> **events**: `Record`\<`string`, `unknown`\>[] + +Defined in: [sanitize.ts:524](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L524) + +#### Methods + +##### summary() + +> **summary**(): `RuntimeStreamEventSummary` + +Defined in: [sanitize.ts:526](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L526) + +Snapshot of a small streaming-flavored summary derived from collected events. + +###### Returns + +`RuntimeStreamEventSummary` + +*** + +### ToolLoopCall + +Defined in: [tool-loop.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L22) + +#### Properties + +##### toolCallId? + +> `optional` **toolCallId?**: `string` + +Defined in: [tool-loop.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L23) + +##### toolName + +> **toolName**: `string` + +Defined in: [tool-loop.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L24) + +##### args + +> **args**: `Record`\<`string`, `unknown`\> + +Defined in: [tool-loop.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L25) + +*** + +### ToolLoopAssistantToolCall + +Defined in: [tool-loop.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L45) + +One OpenAI-shaped tool-call entry carried on an assistant message. + +#### Properties + +##### id + +> **id**: `string` + +Defined in: [tool-loop.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L46) + +##### type + +> **type**: `"function"` + +Defined in: [tool-loop.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L47) + +##### function + +> **function**: `object` + +Defined in: [tool-loop.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L48) + +###### name + +> **name**: `string` + +###### arguments + +> **arguments**: `string` + +*** + +### ToolLoopResult + +Defined in: [tool-loop.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L120) + +#### Properties + +##### finalText + +> **finalText**: `string` + +Defined in: [tool-loop.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L121) + +##### toolResults + +> **toolResults**: `object`[] + +Defined in: [tool-loop.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L122) + +###### call + +> **call**: [`ToolLoopCall`](#toolloopcall) + +###### label + +> **label**: `string` + +###### outcome + +> **outcome**: [`ToolCallOutcome`](#toolcalloutcome) + +##### turns + +> **turns**: `number` + +Defined in: [tool-loop.ts:123](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L123) + +##### stopReason + +> **stopReason**: [`ToolLoopStopReason`](#toolloopstopreason) + +Defined in: [tool-loop.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L124) + +##### ~~cappedOut~~ + +> **cappedOut**: `boolean` + +Defined in: [tool-loop.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L126) + +###### Deprecated + +Use `stopReason !== 'completed'` instead. + +*** + +### RunToolLoopOptions + +Defined in: [tool-loop.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L129) + +#### Properties + +##### systemPrompt + +> **systemPrompt**: `string` + +Defined in: [tool-loop.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L130) + +##### userMessage + +> **userMessage**: `string` + +Defined in: [tool-loop.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L131) + +##### priorMessages? + +> `optional` **priorMessages?**: [`ToolLoopMessage`](#toolloopmessage)[] + +Defined in: [tool-loop.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L132) + +##### streamTurn + +> **streamTurn**: (`messages`) => `AsyncIterable`\<[`ToolLoopEvent`](#toolloopevent)\> + +Defined in: [tool-loop.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L133) + +###### Parameters + +###### messages + +[`ToolLoopMessage`](#toolloopmessage)[] + +###### Returns + +`AsyncIterable`\<[`ToolLoopEvent`](#toolloopevent)\> + +##### executeToolCall + +> **executeToolCall**: (`call`) => `Promise`\<[`ToolCallOutcome`](#toolcalloutcome)\> + +Defined in: [tool-loop.ts:134](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L134) + +###### Parameters + +###### call + +[`ToolLoopCall`](#toolloopcall) + +###### Returns + +`Promise`\<[`ToolCallOutcome`](#toolcalloutcome)\> + +##### isExecutableTool + +> **isExecutableTool**: (`toolName`) => `boolean` + +Defined in: [tool-loop.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L135) + +###### Parameters + +###### toolName + +`string` + +###### Returns + +`boolean` + +##### maxToolTurns? + +> `optional` **maxToolTurns?**: `number` + +Defined in: [tool-loop.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L138) + +Runaway-backstop cap. Default 200 — set far above any legitimate workflow. + For per-workflow limits, use `maxCostUsd` or `deadlineMs` instead. + +##### deadlineMs? + +> `optional` **deadlineMs?**: `number` + +Defined in: [tool-loop.ts:141](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L141) + +Wall-clock deadline in ms since epoch (Date.now()-based). When exceeded the + loop stops with stopReason `deadline`. + +##### maxCostUsd? + +> `optional` **maxCostUsd?**: `number` + +Defined in: [tool-loop.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L143) + +Maximum total cost in USD. Requires `costOf` to meter each tool call. + +##### costOf? + +> `optional` **costOf?**: (`call`, `outcome`) => `number` + +Defined in: [tool-loop.ts:145](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L145) + +Return the USD cost of one outcome. Required for `maxCostUsd` to work. + +###### Parameters + +###### call + +[`ToolLoopCall`](#toolloopcall) + +###### outcome + +[`ToolCallOutcome`](#toolcalloutcome) + +###### Returns + +`number` + +##### renderResult? + +> `optional` **renderResult?**: (`label`, `outcome`) => `string` + +Defined in: [tool-loop.ts:146](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L146) + +###### Parameters + +###### label + +`string` + +###### outcome + +[`ToolCallOutcome`](#toolcalloutcome) + +###### Returns + +`string` + +##### labelFor? + +> `optional` **labelFor?**: (`call`) => `string` + +Defined in: [tool-loop.ts:147](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L147) + +###### Parameters + +###### call + +[`ToolLoopCall`](#toolloopcall) + +###### Returns + +`string` + +##### runId? + +> `optional` **runId?**: `string` + +Defined in: [tool-loop.ts:148](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L148) + +##### scenarioId? + +> `optional` **scenarioId?**: `string` + +Defined in: [tool-loop.ts:149](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L149) + +##### hooks? + +> `optional` **hooks?**: [`RuntimeHooks`](#runtimehooks) + +Defined in: [tool-loop.ts:150](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L150) + +*** + +### StreamToolLoopOptions + +Defined in: [tool-loop.ts:309](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L309) + +#### Type Parameters + +##### Raw + +`Raw` + +#### Properties + +##### systemPrompt + +> **systemPrompt**: `string` + +Defined in: [tool-loop.ts:310](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L310) + +##### userMessage + +> **userMessage**: `string` + +Defined in: [tool-loop.ts:311](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L311) + +##### priorMessages? + +> `optional` **priorMessages?**: [`ToolLoopMessage`](#toolloopmessage)[] + +Defined in: [tool-loop.ts:312](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L312) + +##### streamTurn + +> **streamTurn**: (`messages`) => `AsyncIterable`\<`Raw`\> + +Defined in: [tool-loop.ts:313](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L313) + +###### Parameters + +###### messages + +[`ToolLoopMessage`](#toolloopmessage)[] + +###### Returns + +`AsyncIterable`\<`Raw`\> + +##### extractText + +> **extractText**: (`event`) => `string` + +Defined in: [tool-loop.ts:314](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L314) + +###### Parameters + +###### event + +`Raw` + +###### Returns + +`string` + +##### extractToolCall + +> **extractToolCall**: (`event`) => [`ToolLoopCall`](#toolloopcall) \| `null` + +Defined in: [tool-loop.ts:315](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L315) + +###### Parameters + +###### event + +`Raw` + +###### Returns + +[`ToolLoopCall`](#toolloopcall) \| `null` + +##### isExecutableTool + +> **isExecutableTool**: (`toolName`) => `boolean` + +Defined in: [tool-loop.ts:316](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L316) + +###### Parameters + +###### toolName + +`string` + +###### Returns + +`boolean` + +##### executeToolCall + +> **executeToolCall**: (`call`) => `Promise`\<[`ToolCallOutcome`](#toolcalloutcome)\> + +Defined in: [tool-loop.ts:317](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L317) + +###### Parameters + +###### call + +[`ToolLoopCall`](#toolloopcall) + +###### Returns + +`Promise`\<[`ToolCallOutcome`](#toolcalloutcome)\> + +##### maxToolTurns? + +> `optional` **maxToolTurns?**: `number` + +Defined in: [tool-loop.ts:319](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L319) + +Runaway-backstop cap. Default 200 — set far above any legitimate workflow. + +##### deadlineMs? + +> `optional` **deadlineMs?**: `number` + +Defined in: [tool-loop.ts:321](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L321) + +Wall-clock deadline in ms since epoch (Date.now()-based). + +##### maxCostUsd? + +> `optional` **maxCostUsd?**: `number` + +Defined in: [tool-loop.ts:323](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L323) + +Maximum total cost in USD. Requires `costOf` to meter each tool call. + +##### costOf? + +> `optional` **costOf?**: (`call`, `outcome`) => `number` + +Defined in: [tool-loop.ts:325](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L325) + +Return the USD cost of one outcome. Required for `maxCostUsd` to work. + +###### Parameters + +###### call + +[`ToolLoopCall`](#toolloopcall) + +###### outcome + +[`ToolCallOutcome`](#toolcalloutcome) + +###### Returns + +`number` + +##### renderResult? + +> `optional` **renderResult?**: (`label`, `outcome`) => `string` + +Defined in: [tool-loop.ts:326](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L326) + +###### Parameters + +###### label + +`string` + +###### outcome + +[`ToolCallOutcome`](#toolcalloutcome) + +###### Returns + +`string` + +##### labelFor? + +> `optional` **labelFor?**: (`call`) => `string` + +Defined in: [tool-loop.ts:327](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L327) + +###### Parameters + +###### call + +[`ToolLoopCall`](#toolloopcall) + +###### Returns + +`string` + +##### runId? + +> `optional` **runId?**: `string` + +Defined in: [tool-loop.ts:328](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L328) + +##### scenarioId? + +> `optional` **scenarioId?**: `string` + +Defined in: [tool-loop.ts:329](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L329) + +##### hooks? + +> `optional` **hooks?**: [`RuntimeHooks`](#runtimehooks) + +Defined in: [tool-loop.ts:330](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L330) + +*** + +### AgentTaskSpec + +Defined in: [types.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L26) + +#### Stable + +#### Properties + +##### id + +> **id**: `string` + +Defined in: [types.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L27) + +##### intent + +> **intent**: `string` + +Defined in: [types.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L28) + +##### domain? + +> `optional` **domain?**: `string` + +Defined in: [types.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L30) + +Domain is metadata, not an architectural boundary: tax, legal, gtm, creative, blueprint, redteam, etc. + +##### inputs? + +> `optional` **inputs?**: `Record`\<`string`, `unknown`\> + +Defined in: [types.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L31) + +##### requiredKnowledge? + +> `optional` **requiredKnowledge?**: `KnowledgeRequirement`[] + +Defined in: [types.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L32) + +##### budget? + +> `optional` **budget?**: `Partial`\<`ControlBudget`\> + +Defined in: [types.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L33) + +##### metadata? + +> `optional` **metadata?**: `Record`\<`string`, `unknown`\> + +Defined in: [types.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L34) + +*** + +### AgentKnowledgeProvider + +Defined in: [types.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L38) + +#### Stable + +#### Methods + +##### buildReadiness()? + +> `optional` **buildReadiness**(`task`): `KnowledgeReadinessReport` \| `Promise`\<`KnowledgeReadinessReport`\> + +Defined in: [types.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L39) + +###### Parameters + +###### task + +[`AgentTaskSpec`](#agenttaskspec) + +###### Returns + +`KnowledgeReadinessReport` \| `Promise`\<`KnowledgeReadinessReport`\> + +##### answerQuestions()? + +> `optional` **answerQuestions**(`questions`, `task`): `Record`\<`string`, `string`\> \| `Promise`\<`Record`\<`string`, `string`\>\> + +Defined in: [types.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L40) + +###### Parameters + +###### questions + +`UserQuestion`[] + +###### task + +[`AgentTaskSpec`](#agenttaskspec) + +###### Returns + +`Record`\<`string`, `string`\> \| `Promise`\<`Record`\<`string`, `string`\>\> + +##### executeAcquisitionPlans()? + +> `optional` **executeAcquisitionPlans**(`plans`, `task`): `string`[] \| `Promise`\<`string`[]\> + +Defined in: [types.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L44) + +###### Parameters + +###### plans + +`DataAcquisitionPlan`[] + +###### task + +[`AgentTaskSpec`](#agenttaskspec) + +###### Returns + +`string`[] \| `Promise`\<`string`[]\> + +##### refreshReadiness()? + +> `optional` **refreshReadiness**(`input`): `KnowledgeReadinessReport` \| `Promise`\<`KnowledgeReadinessReport`\> + +Defined in: [types.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L48) + +###### Parameters + +###### input + +###### task + +[`AgentTaskSpec`](#agenttaskspec) + +###### previous + +`KnowledgeReadinessReport` + +###### userAnswers + +`Record`\<`string`, `string`\> + +###### acquiredEvidenceIds + +`string`[] + +###### Returns + +`KnowledgeReadinessReport` \| `Promise`\<`KnowledgeReadinessReport`\> + +*** + +### AgentTaskContext + +Defined in: [types.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L57) + +#### Stable + +#### Type Parameters + +##### TState + +`TState` + +##### TAction + +`TAction` + +##### TActionResult + +`TActionResult` + +##### TEval + +`TEval` *extends* `ControlEvalResult` = `ControlEvalResult` + +#### Properties + +##### task + +> **task**: [`AgentTaskSpec`](#agenttaskspec) + +Defined in: [types.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L63) + +##### knowledge + +> **knowledge**: `KnowledgeReadinessReport` + +Defined in: [types.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L64) + +##### state + +> **state**: `TState` + +Defined in: [types.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L65) + +##### evals + +> **evals**: `TEval`[] + +Defined in: [types.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L66) + +##### history + +> **history**: `ControlStep`\<`TState`, `TAction`, `TActionResult`, `TEval`\>[] + +Defined in: [types.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L67) + +##### budget + +> **budget**: `ControlBudget` + +Defined in: [types.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L68) + +##### stepIndex + +> **stepIndex**: `number` + +Defined in: [types.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L69) + +##### wallMs + +> **wallMs**: `number` + +Defined in: [types.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L70) + +##### spentCostUsd + +> **spentCostUsd**: `number` + +Defined in: [types.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L71) + +##### remainingCostUsd? + +> `optional` **remainingCostUsd?**: `number` + +Defined in: [types.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L72) + +##### abortSignal + +> **abortSignal**: `AbortSignal` + +Defined in: [types.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L73) + +*** + +### AgentAdapter + +Defined in: [types.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L77) + +#### Stable + +#### Type Parameters + +##### TState + +`TState` + +##### TAction + +`TAction` + +##### TActionResult + +`TActionResult` + +##### TEval + +`TEval` *extends* `ControlEvalResult` = `ControlEvalResult` + +#### Methods + +##### observe() + +> **observe**(`ctx`): `TState` \| `Promise`\<`TState`\> + +Defined in: [types.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L83) + +###### Parameters + +###### ctx + +###### task + +[`AgentTaskSpec`](#agenttaskspec) + +###### knowledge + +`KnowledgeReadinessReport` + +###### history + +`ControlStep`\<`TState`, `TAction`, `TActionResult`, `TEval`\>[] + +###### abortSignal + +`AbortSignal` + +###### Returns + +`TState` \| `Promise`\<`TState`\> + +##### validate() + +> **validate**(`ctx`): `TEval`[] \| `Promise`\<`TEval`[]\> + +Defined in: [types.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L90) + +###### Parameters + +###### ctx + +###### task + +[`AgentTaskSpec`](#agenttaskspec) + +###### knowledge + +`KnowledgeReadinessReport` + +###### state + +`TState` + +###### history + +`ControlStep`\<`TState`, `TAction`, `TActionResult`, `TEval`\>[] + +###### abortSignal + +`AbortSignal` + +###### Returns + +`TEval`[] \| `Promise`\<`TEval`[]\> + +##### decide() + +> **decide**(`ctx`): `ControlDecision`\<`TAction`\> \| `Promise`\<`ControlDecision`\<`TAction`\>\> + +Defined in: [types.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L98) + +###### Parameters + +###### ctx + +[`AgentTaskContext`](#agenttaskcontext)\<`TState`, `TAction`, `TActionResult`, `TEval`\> + +###### Returns + +`ControlDecision`\<`TAction`\> \| `Promise`\<`ControlDecision`\<`TAction`\>\> + +##### act() + +> **act**(`action`, `ctx`): `TActionResult` \| `Promise`\<`TActionResult`\> + +Defined in: [types.ts:102](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L102) + +###### Parameters + +###### action + +`TAction` + +###### ctx + +[`AgentTaskContext`](#agenttaskcontext)\<`TState`, `TAction`, `TActionResult`, `TEval`\> + +###### Returns + +`TActionResult` \| `Promise`\<`TActionResult`\> + +##### shouldStop()? + +> `optional` **shouldStop**(`ctx`): `Promise`\<\{ `stop`: `boolean`; `pass`: `boolean`; `reason`: `string`; `score?`: `number`; \}\> \| \{ `stop`: `boolean`; `pass`: `boolean`; `reason`: `string`; `score?`: `number`; \} + +Defined in: [types.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L107) + +###### Parameters + +###### ctx + +[`AgentTaskContext`](#agenttaskcontext)\<`TState`, `TAction`, `TActionResult`, `TEval`\> + +###### Returns + +`Promise`\<\{ `stop`: `boolean`; `pass`: `boolean`; `reason`: `string`; `score?`: `number`; \}\> \| \{ `stop`: `boolean`; `pass`: `boolean`; `reason`: `string`; `score?`: `number`; \} + +##### onKnowledgeBlocked()? + +> `optional` **onKnowledgeBlocked**(`ctx`): `ControlDecision`\<`TAction`\> \| `Promise`\<`ControlDecision`\<`TAction`\>\> + +Defined in: [types.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L121) + +###### Parameters + +###### ctx + +###### task + +[`AgentTaskSpec`](#agenttaskspec) + +###### knowledge + +`KnowledgeReadinessReport` + +###### questions + +`UserQuestion`[] + +###### acquisitionPlans + +`DataAcquisitionPlan`[] + +###### Returns + +`ControlDecision`\<`TAction`\> \| `Promise`\<`ControlDecision`\<`TAction`\>\> + +##### getActionCostUsd()? + +> `optional` **getActionCostUsd**(`ctx`): `number` \| `undefined` + +Defined in: [types.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L128) + +###### Parameters + +###### ctx + +###### action + +`TAction` + +###### result + +`TActionResult` + +###### task + +[`AgentTaskSpec`](#agenttaskspec) + +###### state + +`TState` + +###### evals + +`TEval`[] + +###### history + +`ControlStep`\<`TState`, `TAction`, `TActionResult`, `TEval`\>[] + +###### Returns + +`number` \| `undefined` + +##### projectRunRecords()? + +> `optional` **projectRunRecords**(`result`, `task`): `RunRecord`[] + +Defined in: [types.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L137) + +###### Parameters + +###### result + +`ControlRunResult`\<`TState`, `TAction`, `TActionResult`, `TEval`\> + +###### task + +[`AgentTaskSpec`](#agenttaskspec) + +###### Returns + +`RunRecord`[] + +*** + +### BackendErrorDetail + +Defined in: [types.ts:210](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L210) + +#### Stable + +Typed transport / backend failure detail. Carried on `backend_error` and +`final` events when the backend's stream throws or the upstream HTTP call +returns a non-success status. Lets consumers (a) distinguish "stream +completed with no text" from "stream never reached the model" and +(b) reconstruct the precise upstream signal (status + truncated body) when +building a `RunRecord.error`. + +`body` is truncated to 2 KiB by the backend so an HTML error page from a +misconfigured proxy never bloats event payloads or logs. Consumers needing +the full body should inspect the underlying `BackendTransportError.body` +via a custom `mapEvent` or backend wrapper. + +#### Properties + +##### kind + +> **kind**: `"transport"` \| `"backend"` + +Defined in: [types.ts:216](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L216) + +`'transport'` — upstream HTTP / network failure with optional status code. +`'backend'` — the backend's `stream()` generator threw for a non-transport +reason (e.g. a custom adapter error, sandbox crash). + +##### message + +> **message**: `string` + +Defined in: [types.ts:217](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L217) + +##### status? + +> `optional` **status?**: `number` + +Defined in: [types.ts:219](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L219) + +Upstream HTTP status when known. `0` for connection / abort errors. + +##### body? + +> `optional` **body?**: `string` + +Defined in: [types.ts:221](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L221) + +Truncated response body (≤2 KiB). Diagnostic only — never machine-parsed. + +*** + +### OpenAIChatTool + +Defined in: [types.ts:239](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L239) + +#### Stable + +OpenAI Chat Completions tool descriptor. The shape mirrors the +`/v1/chat/completions` `tools[]` parameter so callers can pass tool +definitions through `createOpenAICompatibleBackend({ tools })` without any +runtime translation. The router proxies this shape verbatim to Anthropic +(translated server-side), DeepSeek, Groq, OpenAI, and Gemini — every model +that the eval surface targets. + +Callers that build their tool list from MCP servers should run a one-shot +MCP `tools/list` at config time and project the result into this shape. The +runtime intentionally does NOT depend on `@modelcontextprotocol/sdk` — +keeping the backend transport thin lets domain repos own MCP plumbing. + +#### Properties + +##### type + +> **type**: `"function"` + +Defined in: [types.ts:240](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L240) + +##### function + +> **function**: `object` + +Defined in: [types.ts:241](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L241) + +###### name + +> **name**: `string` + +###### description? + +> `optional` **description?**: `string` + +###### parameters? + +> `optional` **parameters?**: `Record`\<`string`, `unknown`\> + +*** + +### RuntimeSessionStore + +Defined in: [types.ts:444](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L444) + +#### Stable + +#### Methods + +##### get() + +> **get**(`sessionId`): `RuntimeSession` \| `Promise`\<`RuntimeSession` \| `undefined`\> \| `undefined` + +Defined in: [types.ts:445](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L445) + +###### Parameters + +###### sessionId + +`string` + +###### Returns + +`RuntimeSession` \| `Promise`\<`RuntimeSession` \| `undefined`\> \| `undefined` + +##### put() + +> **put**(`session`): `void` \| `Promise`\<`void`\> + +Defined in: [types.ts:446](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L446) + +###### Parameters + +###### session + +`RuntimeSession` + +###### Returns + +`void` \| `Promise`\<`void`\> + +##### appendEvent()? + +> `optional` **appendEvent**(`sessionId`, `event`): `void` \| `Promise`\<`void`\> + +Defined in: [types.ts:447](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L447) + +###### Parameters + +###### sessionId + +`string` + +###### event + +[`RuntimeStreamEvent`](#runtimestreamevent) + +###### Returns + +`void` \| `Promise`\<`void`\> + +##### listEvents()? + +> `optional` **listEvents**(`sessionId`): [`RuntimeStreamEvent`](#runtimestreamevent)[] \| `Promise`\<[`RuntimeStreamEvent`](#runtimestreamevent)[]\> + +Defined in: [types.ts:448](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L448) + +###### Parameters + +###### sessionId + +`string` + +###### Returns + +[`RuntimeStreamEvent`](#runtimestreamevent)[] \| `Promise`\<[`RuntimeStreamEvent`](#runtimestreamevent)[]\> + +*** + +### AgentBackendInput + +Defined in: [types.ts:452](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L452) + +#### Stable + +#### Properties + +##### task + +> **task**: [`AgentTaskSpec`](#agenttaskspec) + +Defined in: [types.ts:453](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L453) + +##### message? + +> `optional` **message?**: `string` + +Defined in: [types.ts:454](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L454) + +##### messages? + +> `optional` **messages?**: `object`[] + +Defined in: [types.ts:455](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L455) + +###### role + +> **role**: `string` + +###### content + +> **content**: `string` + +##### inputs? + +> `optional` **inputs?**: `Record`\<`string`, `unknown`\> + +Defined in: [types.ts:456](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L456) + +*** + +### AgentBackendContext + +Defined in: [types.ts:460](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L460) + +#### Stable + +#### Properties + +##### task + +> **task**: [`AgentTaskSpec`](#agenttaskspec) + +Defined in: [types.ts:461](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L461) + +##### knowledge + +> **knowledge**: `KnowledgeReadinessReport` + +Defined in: [types.ts:462](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L462) + +##### session + +> **session**: `RuntimeSession` + +Defined in: [types.ts:463](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L463) + +##### signal? + +> `optional` **signal?**: `AbortSignal` + +Defined in: [types.ts:464](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L464) + +##### runId? + +> `optional` **runId?**: `string` + +Defined in: [types.ts:470](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L470) + +Conversation/run identifier when this call is part of a multi-agent run. +Backends should stamp it into any trace/log emission so cross-participant +events correlate. Absent when the call is a stand-alone `runAgentTask`. + +##### turnId? + +> `optional` **turnId?**: `string` + +Defined in: [types.ts:475](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L475) + +Deterministic turn id for this single call. Stable across retries of the +same logical turn so a caching gateway / idempotent backend can dedupe. + +##### parentTurnId? + +> `optional` **parentTurnId?**: `string` + +Defined in: [types.ts:481](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L481) + +If this call is itself nested inside a higher-order conversation +(recursion via `createConversationBackend`), the enclosing turn's id. +Used for trace stitching across nested orchestration. + +##### propagatedHeaders? + +> `optional` **propagatedHeaders?**: `Readonly`\<`Record`\<`string`, `string`\>\> + +Defined in: [types.ts:488](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L488) + +Headers to forward verbatim to any outbound HTTP the backend issues: +`X-Tangle-Forwarded-Authorization`, `X-Tangle-Forwarded-Depth`, +run/turn correlation. Backends that issue HTTP MUST merge these into +the outbound request; backends that don't issue HTTP may ignore them. + +*** + +### AgentExecutionBackend + +Defined in: [types.ts:492](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L492) + +#### Stable + +#### Type Parameters + +##### TInput + +`TInput` *extends* [`AgentBackendInput`](#agentbackendinput) = [`AgentBackendInput`](#agentbackendinput) + +#### Properties + +##### kind + +> **kind**: `string` + +Defined in: [types.ts:493](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L493) + +#### Methods + +##### start()? + +> `optional` **start**(`input`, `context`): `RuntimeSession` \| `Promise`\<`RuntimeSession`\> + +Defined in: [types.ts:494](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L494) + +###### Parameters + +###### input + +`TInput` + +###### context + +`Omit`\<[`AgentBackendContext`](#agentbackendcontext), `"session"`\> & `object` + +###### Returns + +`RuntimeSession` \| `Promise`\<`RuntimeSession`\> + +##### resume()? + +> `optional` **resume**(`session`, `input`, `context`): `RuntimeSession` \| `Promise`\<`RuntimeSession`\> + +Defined in: [types.ts:498](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L498) + +###### Parameters + +###### session + +`RuntimeSession` + +###### input + +`TInput` + +###### context + +`Omit`\<[`AgentBackendContext`](#agentbackendcontext), `"session"`\> + +###### Returns + +`RuntimeSession` \| `Promise`\<`RuntimeSession`\> + +##### stream() + +> **stream**(`input`, `context`): `AsyncIterable`\<[`RuntimeStreamEvent`](#runtimestreamevent)\> + +Defined in: [types.ts:503](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L503) + +###### Parameters + +###### input + +`TInput` + +###### context + +[`AgentBackendContext`](#agentbackendcontext) + +###### Returns + +`AsyncIterable`\<[`RuntimeStreamEvent`](#runtimestreamevent)\> + +##### stop()? + +> `optional` **stop**(`session`, `reason`): `void` \| `Promise`\<`void`\> + +Defined in: [types.ts:504](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L504) + +###### Parameters + +###### session + +`RuntimeSession` + +###### reason + +`string` + +###### Returns + +`void` \| `Promise`\<`void`\> + +*** + +### AgentTaskRunResult + +Defined in: [types.ts:540](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L540) + +#### Stable + +#### Type Parameters + +##### TState + +`TState` + +##### TAction + +`TAction` + +##### TActionResult + +`TActionResult` + +##### TEval + +`TEval` *extends* `ControlEvalResult` = `ControlEvalResult` + +#### Properties + +##### task + +> **task**: [`AgentTaskSpec`](#agenttaskspec) + +Defined in: [types.ts:546](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L546) + +##### status + +> **status**: [`AgentTaskStatus`](#agenttaskstatus) + +Defined in: [types.ts:547](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L547) + +##### knowledge + +> **knowledge**: `KnowledgeReadinessReport` + +Defined in: [types.ts:548](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L548) + +##### questions + +> **questions**: `UserQuestion`[] + +Defined in: [types.ts:549](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L549) + +##### acquisitionPlans + +> **acquisitionPlans**: `DataAcquisitionPlan`[] + +Defined in: [types.ts:550](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L550) + +##### userAnswers + +> **userAnswers**: `Record`\<`string`, `string`\> + +Defined in: [types.ts:551](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L551) + +##### acquiredEvidenceIds + +> **acquiredEvidenceIds**: `string`[] + +Defined in: [types.ts:552](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L552) + +##### control + +> **control**: `ControlRunResult`\<`TState`, `TAction`, `TActionResult`, `TEval`\> + +Defined in: [types.ts:553](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L553) + +##### runRecords + +> **runRecords**: `RunRecord`[] + +Defined in: [types.ts:554](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L554) + +## Type Aliases + +### RetryableErrorPredicate + +> **RetryableErrorPredicate** = (`err`) => `boolean` + +Defined in: [conversation/call-policy.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L17) + +Pure judgment of whether an error is worth retrying. Defaults: TimeoutError, AbortError, fetch-level network errors. + +#### Parameters + +##### err + +`unknown` + +#### Returns + +`boolean` + +*** + +### RetryBackoff + +> **RetryBackoff** = `number` \| ((`attempt`) => `number`) + +Defined in: [conversation/call-policy.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L20) + +Backoff between attempts. Constant ms, or `(attempt: 1-indexed) => ms`. + +*** + +### ForwardHeaderName + +> **ForwardHeaderName** = *typeof* [`FORWARD_HEADERS`](#forward_headers)\[keyof *typeof* [`FORWARD_HEADERS`](#forward_headers)\] + +Defined in: [conversation/headers.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/headers.ts#L34) + +*** + +### PropagatedHeaders + +> **PropagatedHeaders** = `Readonly`\<`Record`\<`string`, `string`\>\> + +Defined in: [conversation/headers.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/headers.ts#L110) + +Header bag carried through `AgentBackendContext.propagatedHeaders` so +backends that opt in can merge them into their outbound HTTP requests. +Distinct from `buildForwardHeaders` so callers can attach extra +non-protocol headers (e.g. tracing) without colliding. + +*** + +### PersonaDriver + +> **PersonaDriver** = \{ `kind`: `"profile"`; `profile`: `AgentProfile`; \} \| \{ `kind`: `"scripted"`; `turns`: `string`[]; \} + +Defined in: [conversation/run-persona.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L32) + +A persona that drives the conversation: either a full driver `AgentProfile` + (an LLM user-sim) or a deterministic script of user turns (the fast-path). + +*** + +### AuthSource + +> **AuthSource** = `"forward-user"` \| `"agent-owned"` \| ((`state`) => `"forward-user"` \| `"agent-owned"`) + +Defined in: [conversation/types.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L67) + +#### Stable + +*** + +### TurnOrder + +> **TurnOrder** = `"alternate"` \| `"round-robin"` \| ((`state`) => `number`) + +Defined in: [conversation/types.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L73) + +#### Stable + +*** + +### HaltPredicate + +> **HaltPredicate** = (`ctx`) => `boolean` \| [`HaltSignal`](#haltsignal) \| `Promise`\<`boolean` \| [`HaltSignal`](#haltsignal)\> + +Defined in: [conversation/types.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L94) + +#### Parameters + +##### ctx + +[`HaltContext`](#haltcontext) + +#### Returns + +`boolean` \| [`HaltSignal`](#haltsignal) \| `Promise`\<`boolean` \| [`HaltSignal`](#haltsignal)\> + +#### Stable + +*** + +### HaltReason + +> **HaltReason** = \{ `kind`: `"max_turns"`; `turns`: `number`; \} \| \{ `kind`: `"max_credits"`; `spentCents`: `number`; `capCents`: `number`; \} \| \{ `kind`: `"predicate"`; `reason`: `string`; \} \| \{ `kind`: `"abort"`; \} \| \{ `kind`: `"participant_error"`; `participant`: `string`; `message`: `string`; \} + +Defined in: [conversation/types.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L99) + +#### Stable + +*** + +### ConversationStreamEvent + +> **ConversationStreamEvent** = \{ `type`: `"conversation_start"`; `runId`: `string`; `participants`: readonly `string`[]; `seed`: `string`; `timestamp`: `string`; \} \| \{ `type`: `"conversation_resumed"`; `runId`: `string`; `participants`: readonly `string`[]; `transcript`: readonly [`ConversationTurn`](#conversationturn)[]; `timestamp`: `string`; \} \| \{ `type`: `"turn_start"`; `runId`: `string`; `index`: `number`; `speaker`: `string`; `turnId`: `string`; `attempt`: `number`; `timestamp`: `string`; \} \| \{ `type`: `"turn_text_delta"`; `runId`: `string`; `index`: `number`; `speaker`: `string`; `turnId`: `string`; `text`: `string`; `timestamp?`: `string`; \} \| \{ `type`: `"turn_retry"`; `runId`: `string`; `index`: `number`; `speaker`: `string`; `turnId`: `string`; `attempt`: `number`; `reason`: `string`; `timestamp`: `string`; \} \| \{ `type`: `"turn_end"`; `runId`: `string`; `turn`: [`ConversationTurn`](#conversationturn); `timestamp`: `string`; \} \| \{ `type`: `"conversation_end"`; `runId`: `string`; `result`: [`ConversationResult`](#conversationresult); `timestamp`: `string`; \} + +Defined in: [conversation/types.ts:236](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L236) + +#### Stable + +*** + +### DelegatedLoopMode + +> **DelegatedLoopMode** = *typeof* [`DELEGATED_LOOP_MODES`](#delegated_loop_modes)\[`number`\] + +Defined in: [loop-runner.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L58) + +**`Experimental`** + +*** + +### DelegatedLoopRunner + +> **DelegatedLoopRunner**\<`T`\> = (`signal`) => `Promise`\<`T`\> + +Defined in: [loop-runner.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L67) + +**`Experimental`** + +A pre-configured loop for one mode. Returns the mode's raw + output; the dispatcher wraps it in a [DelegatedLoopResult](#delegatedloopresult). + +#### Type Parameters + +##### T + +`T` = `unknown` + +#### Parameters + +##### signal + +`AbortSignal` + +#### Returns + +`Promise`\<`T`\> + +*** + +### DelegatedLoopRegistry + +> **DelegatedLoopRegistry** = `Partial`\<`Record`\<[`DelegatedLoopMode`](#delegatedloopmode), [`DelegatedLoopRunner`](#delegatedlooprunner)\>\> + +Defined in: [loop-runner.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L71) + +**`Experimental`** + +Mode → configured runner. Partial: only register the modes a + given product/routine actually uses. + +*** + +### RuntimeHookPhase + +> **RuntimeHookPhase** = `"before"` \| `"after"` \| `"error"` \| `"event"` + +Defined in: [runtime-hooks.ts:9](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L9) + +**`Experimental`** + +Runtime hook contracts. Hooks are execution-scoped observers, not part of an +`AgentProfile`: profiles stay portable agent recipes; hooks attach to the +loop or product harness that is running the profile. + +*** + +### RuntimeHookTarget + +> **RuntimeHookTarget** = `"agent.run"` \| `"agent.turn"` \| `"agent.tool_call"` \| `"agent.spawn"` \| `"agent.child"` \| `"agent.plan"` \| `"agent.decision"` \| `string` & `object` + +Defined in: [runtime-hooks.ts:11](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L11) + +*** + +### RuntimeDecisionKind + +> **RuntimeDecisionKind** = `"continue"` \| `"verify"` \| `"ask"` \| `"retry"` \| `"stop"` \| `"memory-write"` \| `"memory-read"` \| `"tool-select"` \| `"skill-select"` \| `"workflow-select"` \| `"surface-promote"` \| `string` & `object` + +Defined in: [runtime-hooks.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L21) + +*** + +### ToolCallOutcome + +> **ToolCallOutcome** = \{ `ok`: `true`; `result`: `unknown`; \} \| \{ `ok`: `false`; `code`: `string`; `message`: `string`; `status?`: `number`; \} + +Defined in: [tool-loop.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L30) + +Outcome of one tool dispatch — structurally compatible with a hub/integration + tool-outcome union, so callers can fold either through the loop. + +*** + +### ToolLoopMessage + +> **ToolLoopMessage** = `object` + +Defined in: [tool-loop.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L68) + +A message in the running conversation the loop sends to `streamTurn`. + +The base `{ role, content }` covers `system` / `user` / plain `assistant` +turns. Two optional fields carry the OpenAI function-calling contract so a +strict model (Claude, and any OpenAI-compatible provider that validates tool +history) reads its own tool use back instead of re-issuing the same call: + + - an assistant turn that emitted tool calls carries `tool_calls`, and its + `content` is `null` when the turn was tool-only; + - each tool result is its own `{ role: 'tool', tool_call_id, content }` + message keyed to the call that produced it. + +Widening is additive: a `streamTurn` that reads only `role` + `content` still +works; one that forwards the whole message to an OpenAI-compatible endpoint +now sends correct tool history. + +#### Properties + +##### role + +> **role**: `string` + +Defined in: [tool-loop.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L69) + +##### content + +> **content**: `string` \| `null` + +Defined in: [tool-loop.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L70) + +##### tool\_calls? + +> `optional` **tool\_calls?**: [`ToolLoopAssistantToolCall`](#toolloopassistanttoolcall)[] + +Defined in: [tool-loop.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L71) + +##### tool\_call\_id? + +> `optional` **tool\_call\_id?**: `string` + +Defined in: [tool-loop.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L72) + +*** + +### ToolLoopEvent + +> **ToolLoopEvent** = \{ `type`: `"text"`; `text`: `string`; \} \| \{ `type`: `"tool_call"`; `call`: [`ToolLoopCall`](#toolloopcall); \} \| \{ `type`: `"other"`; `event`: `unknown`; \} + +Defined in: [tool-loop.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L108) + +*** + +### ToolLoopStopReason + +> **ToolLoopStopReason** = `"completed"` \| `"stuck-loop"` \| `"backstop"` \| `"deadline"` \| `"budget"` + +Defined in: [tool-loop.ts:118](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L118) + +Why the loop stopped. `completed` = model finished naturally; `stuck-loop` = + ≥3 consecutive identical tool calls (same tool + args); `backstop` = hit the + runaway-backstop cap (200 by default); `deadline` = wall-clock deadlineMs + exceeded; `budget` = maxCostUsd exhausted. Non-`completed` stops are infra / + resource outcomes — eval scoring must distinguish them from capability failure. + +*** + +### StreamToolLoopYield + +> **StreamToolLoopYield**\<`Raw`\> = \{ `kind`: `"event"`; `event`: `Raw`; \} \| \{ `kind`: `"tool_result"`; `toolName`: `string`; `toolCallId?`: `string`; `label`: `string`; `outcome`: [`ToolCallOutcome`](#toolcalloutcome); \} \| \{ `kind`: `"capped"`; `pending`: `number`; `stopReason`: `Exclude`\<[`ToolLoopStopReason`](#toolloopstopreason), `"completed"`\>; \} + +Defined in: [tool-loop.ts:298](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L298) + +#### Type Parameters + +##### Raw + +`Raw` + +*** + +### AgentTaskStatus + +> **AgentTaskStatus** = `"completed"` \| `"blocked"` \| `"failed"` \| `"aborted"` + +Defined in: [types.ts:144](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L144) + +#### Stable + +*** + +### AgentRuntimeEvent + +> **AgentRuntimeEvent**\<`TState`, `TAction`, `TActionResult`, `TEval`\> = \{ `type`: `"task_start"`; `task`: [`AgentTaskSpec`](#agenttaskspec); \} \| \{ `type`: `"readiness_start"`; `task`: [`AgentTaskSpec`](#agenttaskspec); \} \| \{ `type`: `"readiness_end"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `knowledge`: `KnowledgeReadinessReport`; \} \| \{ `type`: `"questions_start"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `questions`: `UserQuestion`[]; \} \| \{ `type`: `"questions_end"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `questions`: `UserQuestion`[]; `userAnswers`: `Record`\<`string`, `string`\>; \} \| \{ `type`: `"acquisition_start"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `acquisitionPlans`: `DataAcquisitionPlan`[]; \} \| \{ `type`: `"acquisition_end"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `acquisitionPlans`: `DataAcquisitionPlan`[]; `acquiredEvidenceIds`: `string`[]; \} \| \{ `type`: `"control_start"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `knowledge`: `KnowledgeReadinessReport`; \} \| \{ `type`: `"control_step"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `step`: `ControlStep`\<`TState`, `TAction`, `TActionResult`, `TEval`\>; \} \| \{ `type`: `"control_end"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `control`: `ControlRunResult`\<`TState`, `TAction`, `TActionResult`, `TEval`\>; \} \| \{ `type`: `"task_end"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `status`: [`AgentTaskStatus`](#agenttaskstatus); `reason`: `string`; \} + +Defined in: [types.ts:147](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L147) + +#### Type Parameters + +##### TState + +`TState` = `unknown` + +##### TAction + +`TAction` = `unknown` + +##### TActionResult + +`TActionResult` = `unknown` + +##### TEval + +`TEval` *extends* `ControlEvalResult` = `ControlEvalResult` + +#### Stable + +*** + +### AgentRuntimeEventSink + +> **AgentRuntimeEventSink**\<`TState`, `TAction`, `TActionResult`, `TEval`\> = (`event`) => `Promise`\<`void`\> \| `void` + +Defined in: [types.ts:188](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L188) + +#### Type Parameters + +##### TState + +`TState` = `unknown` + +##### TAction + +`TAction` = `unknown` + +##### TActionResult + +`TActionResult` = `unknown` + +##### TEval + +`TEval` *extends* `ControlEvalResult` = `ControlEvalResult` + +#### Parameters + +##### event + +[`AgentRuntimeEvent`](#agentruntimeevent)\<`TState`, `TAction`, `TActionResult`, `TEval`\> + +#### Returns + +`Promise`\<`void`\> \| `void` + +#### Stable + +*** + +### OpenAIChatToolChoice + +> **OpenAIChatToolChoice** = `"auto"` \| `"none"` \| `"required"` \| \{ `type`: `"function"`; `function`: \{ `name`: `string`; \}; \} + +Defined in: [types.ts:256](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L256) + +#### Stable + +`tool_choice` parameter for OpenAI-compat chat. Same shape as the OpenAI +spec: `'auto'` (default — model decides), `'none'` (disable tool calling +for this turn), `'required'` (force a tool call), or a specific function +pin `{ type: 'function', function: { name } }`. + +*** + +### RuntimeStreamEvent + +> **RuntimeStreamEvent** = \{ `type`: `"task_start"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `timestamp`: `string`; \} \| \{ `type`: `"readiness_start"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `timestamp`: `string`; \} \| \{ `type`: `"readiness_end"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `knowledge`: `KnowledgeReadinessReport`; `decision`: `KnowledgeReadinessDecision`; `timestamp`: `string`; \} \| \{ `type`: `"questions_start"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `questions`: `UserQuestion`[]; `timestamp`: `string`; \} \| \{ `type`: `"questions_end"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `questions`: `UserQuestion`[]; `userAnswers`: `Record`\<`string`, `string`\>; `timestamp`: `string`; \} \| \{ `type`: `"acquisition_start"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `acquisitionPlans`: `DataAcquisitionPlan`[]; `timestamp`: `string`; \} \| \{ `type`: `"acquisition_end"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `acquisitionPlans`: `DataAcquisitionPlan`[]; `acquiredEvidenceIds`: `string`[]; `timestamp`: `string`; \} \| \{ `type`: `"session_created"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `session`: `RuntimeSession`; `timestamp`: `string`; \} \| \{ `type`: `"session_resumed"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `session`: `RuntimeSession`; `timestamp`: `string`; \} \| \{ `type`: `"backend_start"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `session`: `RuntimeSession`; `backend`: `string`; `timestamp`: `string`; \} \| \{ `type`: `"text_delta"`; `task?`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `text`: `string`; `timestamp?`: `string`; \} \| \{ `type`: `"reasoning_delta"`; `task?`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `text`: `string`; `timestamp?`: `string`; \} \| \{ `type`: `"tool_call"`; `task?`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `toolName`: `string`; `toolCallId?`: `string`; `args?`: `unknown`; `timestamp?`: `string`; \} \| \{ `type`: `"tool_result"`; `task?`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `toolName`: `string`; `toolCallId?`: `string`; `result?`: `unknown`; `timestamp?`: `string`; \} \| \{ `type`: `"llm_call"`; `task?`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `model`: `string`; `tokensIn?`: `number`; `tokensOut?`: `number`; `costUsd?`: `number`; `latencyMs?`: `number`; `finishReason?`: `string`; `timestamp?`: `string`; \} \| \{ `type`: `"artifact"`; `task?`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `artifactId`: `string`; `name?`: `string`; `mimeType?`: `string`; `uri?`: `string`; `content?`: `string`; `metadata?`: `Record`\<`string`, `unknown`\>; `timestamp?`: `string`; \} \| \{ `type`: `"proposal_created"`; `task?`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `proposalId`: `string`; `title`: `string`; `status?`: `"pending"` \| `"approved"` \| `"rejected"`; `content?`: `string`; `timestamp?`: `string`; \} \| \{ `type`: `"backend_error"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `backend`: `string`; `message`: `string`; `recoverable`: `boolean`; `error?`: [`BackendErrorDetail`](#backenderrordetail); `timestamp`: `string`; \} \| \{ `type`: `"backend_end"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `session`: `RuntimeSession`; `backend`: `string`; `timestamp`: `string`; \} \| \{ `type`: `"task_end"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `status`: [`AgentTaskStatus`](#agenttaskstatus); `reason`: `string`; `timestamp`: `string`; \} \| \{ `type`: `"final"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `status`: [`AgentTaskStatus`](#agenttaskstatus); `reason`: `string`; `text?`: `string`; `metadata?`: `Record`\<`string`, `unknown`\>; `error?`: [`BackendErrorDetail`](#backenderrordetail); `timestamp`: `string`; \} + +Defined in: [types.ts:263](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L263) + +#### Union Members + +##### Type Literal + +\{ `type`: `"task_start"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `timestamp`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"readiness_start"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `timestamp`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"readiness_end"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `knowledge`: `KnowledgeReadinessReport`; `decision`: `KnowledgeReadinessDecision`; `timestamp`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"questions_start"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `questions`: `UserQuestion`[]; `timestamp`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"questions_end"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `questions`: `UserQuestion`[]; `userAnswers`: `Record`\<`string`, `string`\>; `timestamp`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"acquisition_start"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `acquisitionPlans`: `DataAcquisitionPlan`[]; `timestamp`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"acquisition_end"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `acquisitionPlans`: `DataAcquisitionPlan`[]; `acquiredEvidenceIds`: `string`[]; `timestamp`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"session_created"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `session`: `RuntimeSession`; `timestamp`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"session_resumed"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `session`: `RuntimeSession`; `timestamp`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"backend_start"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `session`: `RuntimeSession`; `backend`: `string`; `timestamp`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"text_delta"`; `task?`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `text`: `string`; `timestamp?`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"reasoning_delta"`; `task?`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `text`: `string`; `timestamp?`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"tool_call"`; `task?`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `toolName`: `string`; `toolCallId?`: `string`; `args?`: `unknown`; `timestamp?`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"tool_result"`; `task?`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `toolName`: `string`; `toolCallId?`: `string`; `result?`: `unknown`; `timestamp?`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"llm_call"`; `task?`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `model`: `string`; `tokensIn?`: `number`; `tokensOut?`: `number`; `costUsd?`: `number`; `latencyMs?`: `number`; `finishReason?`: `string`; `timestamp?`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"artifact"`; `task?`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `artifactId`: `string`; `name?`: `string`; `mimeType?`: `string`; `uri?`: `string`; `content?`: `string`; `metadata?`: `Record`\<`string`, `unknown`\>; `timestamp?`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"proposal_created"`; `task?`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `proposalId`: `string`; `title`: `string`; `status?`: `"pending"` \| `"approved"` \| `"rejected"`; `content?`: `string`; `timestamp?`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"backend_error"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `backend`: `string`; `message`: `string`; `recoverable`: `boolean`; `error?`: [`BackendErrorDetail`](#backenderrordetail); `timestamp`: `string`; \} + +###### type + +> **type**: `"backend_error"` + +###### task + +> **task**: [`AgentTaskSpec`](#agenttaskspec) + +###### session? + +> `optional` **session?**: `RuntimeSession` + +###### backend + +> **backend**: `string` + +###### message + +> **message**: `string` + +###### recoverable + +> **recoverable**: `boolean` + +###### error? + +> `optional` **error?**: [`BackendErrorDetail`](#backenderrordetail) + +Typed transport diagnostic. Present when the upstream returned a +non-success HTTP status or every retry attempt threw. Consumers MUST +surface this onto their `RunRecord.error` — silently treating a +`backend_error` as "no output" hides credit exhaustion, auth failure, +and upstream outages from operators. + - `kind: 'transport'` — HTTP / network failure with optional `status` + + truncated response `body`. + - `kind: 'backend'` — the backend's `stream()` generator threw for a + reason that isn't a recognized transport failure. + +###### timestamp + +> **timestamp**: `string` + +*** + +##### Type Literal + +\{ `type`: `"backend_end"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `session`: `RuntimeSession`; `backend`: `string`; `timestamp`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"task_end"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `status`: [`AgentTaskStatus`](#agenttaskstatus); `reason`: `string`; `timestamp`: `string`; \} + +*** + +##### Type Literal + +\{ `type`: `"final"`; `task`: [`AgentTaskSpec`](#agenttaskspec); `session?`: `RuntimeSession`; `status`: [`AgentTaskStatus`](#agenttaskstatus); `reason`: `string`; `text?`: `string`; `metadata?`: `Record`\<`string`, `unknown`\>; `error?`: [`BackendErrorDetail`](#backenderrordetail); `timestamp`: `string`; \} + +###### type + +> **type**: `"final"` + +###### task + +> **task**: [`AgentTaskSpec`](#agenttaskspec) + +###### session? + +> `optional` **session?**: `RuntimeSession` + +###### status + +> **status**: [`AgentTaskStatus`](#agenttaskstatus) + +###### reason + +> **reason**: `string` + +###### text? + +> `optional` **text?**: `string` + +###### metadata? + +> `optional` **metadata?**: `Record`\<`string`, `unknown`\> + +###### error? + +> `optional` **error?**: [`BackendErrorDetail`](#backenderrordetail) + +Typed terminal-error diagnostic. Mirrors the `backend_error.error` +shape so a consumer that only listens for `final` still receives a +loud, structured failure when the backend never produced output. Only +set when `status !== 'completed'`. Consumers building a `RunRecord` +MUST map this to `RunRecord.error` rather than recording silent +`error: null` with empty `finalText`. + +###### timestamp + +> **timestamp**: `string` + +#### Stable + +## Variables + +### defaultIsRetryable + +> `const` **defaultIsRetryable**: [`RetryableErrorPredicate`](#retryableerrorpredicate) + +Defined in: [conversation/call-policy.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L62) + +Default retryable classification — network/timeout class errors. Errors +a model deliberately throws (validation, refusal, 4xx) are not retried; +those represent real outcomes, not transient infrastructure faults. + +*** + +### FORWARD\_HEADERS + +> `const` **FORWARD\_HEADERS**: `object` + +Defined in: [conversation/headers.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/headers.ts#L19) + +Standard names — lowercased so Headers maps interop on every runtime. + +#### Type Declaration + +##### authorization + +> `readonly` **authorization**: `"x-tangle-forwarded-authorization"` = `'x-tangle-forwarded-authorization'` + +Forwarded original-user identity (`Bearer sk-tan-`); downstream gateways bill against this. + +##### depth + +> `readonly` **depth**: `"x-tangle-forwarded-depth"` = `'x-tangle-forwarded-depth'` + +Monotonically incremented on every gateway hop. Refused at MAX_DEPTH. + +##### runId + +> `readonly` **runId**: `"x-tangle-runid"` = `'x-tangle-runid'` + +Top-level conversation run identifier, propagated through every nested call. + +##### turnId + +> `readonly` **turnId**: `"x-tangle-turnid"` = `'x-tangle-turnid'` + +This call's turn within the run; deterministic + stable across retries. + +##### parentTurnId + +> `readonly` **parentTurnId**: `"x-tangle-parent-turnid"` = `'x-tangle-parent-turnid'` + +When the call is *inside* another turn (recursion), the parent turn's id. + +##### speaker + +> `readonly` **speaker**: `"x-tangle-speaker"` = `'x-tangle-speaker'` + +Logical conversation peer label at the sending side, for trace stitching. + +*** + +### DEFAULT\_MAX\_DEPTH + +> `const` **DEFAULT\_MAX\_DEPTH**: `4` = `4` + +Defined in: [conversation/headers.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/headers.ts#L37) + +Hard cap on chained gateway hops; refused beyond this. Default keeps recursion bounded. + +*** + +### DELEGATED\_LOOP\_MODES + +> `const` **DELEGATED\_LOOP\_MODES**: readonly \[`"code"`, `"review"`, `"research"`, `"audit"`, `"self-improve"`\] + +Defined in: [loop-runner.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L55) + +**`Experimental`** + +Every delegated-loop mode, for validation + CLI surfaces. + +*** + +### DEFAULT\_ROUTER\_BASE\_URL + +> `const` **DEFAULT\_ROUTER\_BASE\_URL**: `"https://router.tangle.tools"` = `'https://router.tangle.tools'` + +Defined in: [model-resolution.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L41) + +*** + +### INTELLIGENCE\_WIRE\_VERSION + +> `const` **INTELLIGENCE\_WIRE\_VERSION**: `"2026-05-26.v1"` = `'2026-05-26.v1'` + +Defined in: [otel-export.ts:519](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L519) + +Wire version the eval-runs ingest enforces (X-Tangle-Wire-Version + body). + +## Functions + +### createIterableBackend() + +> **createIterableBackend**\<`TInput`\>(`options`): [`AgentExecutionBackend`](#agentexecutionbackend)\<`TInput`\> + +Defined in: [backends.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/backends.ts#L28) + +#### Type Parameters + +##### TInput + +`TInput` *extends* [`AgentBackendInput`](#agentbackendinput) + +#### Parameters + +##### options + +###### kind + +`string` + +###### start? + +(`input`, `context`) => `RuntimeSession` \| `Promise`\<`RuntimeSession`\> + +###### resume? + +(`session`, `input`, `context`) => `RuntimeSession` \| `Promise`\<`RuntimeSession`\> + +###### stream + +(`input`, `context`) => `AsyncIterable`\<[`RuntimeStreamEvent`](#runtimestreamevent)\> + +###### stop? + +(`session`, `reason`) => `void` \| `Promise`\<`void`\> + +#### Returns + +[`AgentExecutionBackend`](#agentexecutionbackend)\<`TInput`\> + +#### Stable + +*** + +### createSandboxPromptBackend() + +> **createSandboxPromptBackend**\<`TBox`, `TInput`\>(`options`): [`AgentExecutionBackend`](#agentexecutionbackend)\<`TInput`\> + +Defined in: [backends.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/backends.ts#L39) + +#### Type Parameters + +##### TBox + +`TBox` + +##### TInput + +`TInput` *extends* [`AgentBackendInput`](#agentbackendinput) = [`AgentBackendInput`](#agentbackendinput) + +#### Parameters + +##### options + +###### kind? + +`string` + +###### getBox + +###### streamPrompt + +###### mapEvent? + +(`event`, `context`) => [`RuntimeStreamEvent`](#runtimestreamevent) \| `undefined` + +###### getSessionId? + +(`box`, `input`) => `string` \| `undefined` + +#### Returns + +[`AgentExecutionBackend`](#agentexecutionbackend)\<`TInput`\> + +#### Stable + +*** + +### createOpenAICompatibleBackend() + +> **createOpenAICompatibleBackend**\<`TInput`\>(`options`): [`AgentExecutionBackend`](#agentexecutionbackend)\<`TInput`\> + +Defined in: [backends.ts:205](https://github.com/tangle-network/agent-runtime/blob/main/src/backends.ts#L205) + +#### Type Parameters + +##### TInput + +`TInput` *extends* [`AgentBackendInput`](#agentbackendinput) = [`AgentBackendInput`](#agentbackendinput) + +#### Parameters + +##### options + +###### apiKey + +`string` + +###### baseUrl + +`string` + +###### model + +`string` + +###### kind? + +`string` + +###### tools? + +readonly [`OpenAIChatTool`](#openaichattool)[] + +OpenAI Chat Completions `tools[]` definitions surfaced to the model on +every request. Omit to send a tool-free request (existing behavior). +The runtime makes no assumption about the dispatcher — calls stream out +as `tool_call` events and the caller is responsible for executing them +and feeding `tool_result` messages back on a follow-up turn. + +###### toolChoice? + +[`OpenAIChatToolChoice`](#openaichattoolchoice) + +OpenAI Chat Completions `tool_choice`. Default `undefined` (request +omits the field; provider falls back to its own default — typically +`'auto'`). + +###### fetchImpl? + +(`input`, `init?`) => `Promise`\<`Response`\> + +###### retry? + +`BackendRetryPolicy` + +#### Returns + +[`AgentExecutionBackend`](#agentexecutionbackend)\<`TInput`\> + +#### Stable + +OpenAI-compat streaming backend. Routes `runAgentTaskStream` through any +`POST /chat/completions` endpoint that speaks OpenAI's SSE protocol — +Tangle Router, OpenAI direct, OpenRouter, Groq, DeepSeek, Together. The +router also fronts Anthropic models in Anthropic-native SSE shape; this +backend handles both. + +### Tool calls + +Pass `tools` (and optionally `toolChoice`) to forward an OpenAI Chat +Completions `tools[]` array on every request. Streamed `tool_call` chunks +are buffered until the model finalizes them (either `finish_reason: +'tool_calls'` for OpenAI shape or a `content_block_stop` for Anthropic +`tool_use` blocks proxied through the router), then emitted as a single +`tool_call` RuntimeStreamEvent with the assembled `args`. + +The backend does NOT execute tools — it surfaces calls for the caller's +own dispatcher (typically the product's MCP / sandbox runtime) to fulfill +and feed back as a subsequent `messages` turn. This keeps the transport +thin and lets the agent host own tool dispatch policy. + +### Fail-loud errors + +Non-success HTTP responses (4xx/5xx) and exhausted retry budgets throw +`BackendTransportError` from inside the `stream()` generator. The runtime +catches the throw, yields a `backend_error` with a typed `error` field +(`kind`, `status`, truncated `body`) and a terminal `final` event with +`status: 'failed'` carrying the same detail. Consumers MUST map +`final.error` onto their `RunRecord.error` — silently treating an empty +`finalText` as "agent produced nothing" hides credit exhaustion, auth +failure, and upstream outages. + +*** + +### makePerAttemptSignal() + +> **makePerAttemptSignal**(`parentSignal`, `deadlineMs`): `object` + +Defined in: [conversation/call-policy.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L126) + +Build a per-attempt AbortSignal linked to the parent signal AND fired when +the deadline elapses. The returned `dispose()` MUST be called in a +`finally` (clears the timer, detaches the listener) so we don't leak. + +When the deadline fires, the signal's `reason` is a `DeadlineExceededError` +— callers can detect timeout-vs-cancel by reading `signal.reason` after +the underlying operation throws. + +#### Parameters + +##### parentSignal + +`AbortSignal` \| `undefined` + +##### deadlineMs + +`number` \| `undefined` + +#### Returns + +`object` + +##### signal + +> **signal**: `AbortSignal` + +##### dispose + +> **dispose**: () => `void` + +###### Returns + +`void` + +##### getDeadlineError() + +> **getDeadlineError**(): [`DeadlineExceededError`](#deadlineexceedederror) \| `undefined` + +###### Returns + +[`DeadlineExceededError`](#deadlineexceedederror) \| `undefined` + +*** + +### computeBackoff() + +> **computeBackoff**(`spec`, `attempt`): `number` + +Defined in: [conversation/call-policy.ts:166](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L166) + +Compute the delay before the next attempt. Default: 250ms exponential with jitter. + +#### Parameters + +##### spec + +[`RetryBackoff`](#retrybackoff) \| `undefined` + +##### attempt + +`number` + +#### Returns + +`number` + +*** + +### sleep() + +> **sleep**(`ms`): `Promise`\<`void`\> + +Defined in: [conversation/call-policy.ts:176](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L176) + +#### Parameters + +##### ms + +`number` + +#### Returns + +`Promise`\<`void`\> + +*** + +### createConversationBackend() + +> **createConversationBackend**(`options`): [`AgentExecutionBackend`](#agentexecutionbackend) + +Defined in: [conversation/conversation-backend.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/conversation-backend.ts#L28) + +#### Parameters + +##### options + +###### conversation + +[`Conversation`](#conversation) + +###### kind? + +`string` + +Optional backend kind label. Defaults to `'conversation'`. + +#### Returns + +[`AgentExecutionBackend`](#agentexecutionbackend) + +*** + +### defineConversation() + +> **defineConversation**(`input`): [`Conversation`](#conversation) + +Defined in: [conversation/define-conversation.ts:13](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/define-conversation.ts#L13) + +#### Parameters + +##### input + +###### participants + +[`ConversationParticipant`](#conversationparticipant)[] + +###### policy + +[`ConversationPolicy`](#conversationpolicy) + +#### Returns + +[`Conversation`](#conversation) + +*** + +### readDepth() + +> **readDepth**(`headers`): `number` + +Defined in: [conversation/headers.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/headers.ts#L52) + +Read the depth counter off an inbound request. Missing → 0 (caller is the +origin). Non-integer → throws — silent coercion would let a bad caller +reset depth and bypass the limit. + +#### Parameters + +##### headers + +`Readonly`\<`Record`\<`string`, `string` \| `string`[] \| `undefined`\>\> + +#### Returns + +`number` + +*** + +### isDepthExceeded() + +> **isDepthExceeded**(`inboundDepth`, `max?`): `boolean` + +Defined in: [conversation/headers.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/headers.ts#L70) + +Refuse further forwarding when the inbound depth has reached the limit. +Callers (the gateway middleware) translate the boolean to an HTTP 413. + +#### Parameters + +##### inboundDepth + +`number` + +##### max? + +`number` = `DEFAULT_MAX_DEPTH` + +#### Returns + +`boolean` + +*** + +### buildForwardHeaders() + +> **buildForwardHeaders**(`input`): `Record`\<`string`, `string`\> + +Defined in: [conversation/headers.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/headers.ts#L81) + +Build the headers to emit on an outbound participant call, given the +conversation's propagation context. Depth is incremented from the inbound +value; runId / turnId / speaker stamp the current hop; the user's +`Authorization` is preserved verbatim so the downstream gateway bills the +right wallet. + +#### Parameters + +##### input + +###### inboundDepth + +`number` + +###### forwardedAuthorization? + +`string` + +###### runId + +`string` + +###### turnId + +`string` + +###### parentTurnId? + +`string` + +###### speaker + +`string` + +#### Returns + +`Record`\<`string`, `string`\> + +*** + +### d1ToSqlAdapter() + +> **d1ToSqlAdapter**(`db`): [`SqlAdapter`](#sqladapter) + +Defined in: [conversation/journal-sql.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L60) + +Adapt a Cloudflare D1 binding to the SqlAdapter shape. Lives here so D1 +consumers don't have to write the wrapper themselves; the runtime never +imports `@cloudflare/workers-types` directly (peer-style typing). + +#### Parameters + +##### db + +[`D1DatabaseLike`](#d1databaselike) + +#### Returns + +[`SqlAdapter`](#sqladapter) + +*** + +### runConversation() + +> **runConversation**(`conversation`, `options`): `Promise`\<[`ConversationResult`](#conversationresult)\> + +Defined in: [conversation/run-conversation.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-conversation.ts#L64) + +#### Parameters + +##### conversation + +[`Conversation`](#conversation) + +##### options + +[`RunConversationOptions`](#runconversationoptions) + +#### Returns + +`Promise`\<[`ConversationResult`](#conversationresult)\> + +*** + +### runConversationStream() + +> **runConversationStream**(`conversation`, `options`): `AsyncIterable`\<[`ConversationStreamEvent`](#conversationstreamevent)\> + +Defined in: [conversation/run-conversation.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-conversation.ts#L82) + +#### Parameters + +##### conversation + +[`Conversation`](#conversation) + +##### options + +[`RunConversationOptions`](#runconversationoptions) + +#### Returns + +`AsyncIterable`\<[`ConversationStreamEvent`](#conversationstreamevent)\> + +*** + +### runPersonaConversation() + +> **runPersonaConversation**(`opts`): `Promise`\<[`PersonaConversationResult`](#personaconversationresult)\> + +Defined in: [conversation/run-persona.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L130) + +Run one worker profile against one persona as a multi-round conversation. +The persona leads (participant 0): it speaks, the worker answers, repeat, +until `maxTurns`. Returns the persistent transcript + worker-only usage. + +#### Parameters + +##### opts + +[`RunPersonaConversationOptions`](#runpersonaconversationoptions) + +#### Returns + +`Promise`\<[`PersonaConversationResult`](#personaconversationresult)\> + +*** + +### runPersonaDispatch() + +> **runPersonaDispatch**\<`TScenario`, `TArtifact`\>(`config`): `ProfileDispatchFn`\<`TScenario`, `TArtifact`\> + +Defined in: [conversation/run-persona.ts:216](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L216) + +Wrap [runPersonaConversation](#runpersonaconversation) as a `ProfileDispatchFn` for +`runProfileMatrix`: the profile axis is the worker-under-test, the scenario +axis is the persona, and the runner is the cell. Meters the worker through +`ctx.cost` so the matrix's backend-integrity guard sees real usage. + +#### Type Parameters + +##### TScenario + +`TScenario` *extends* `Scenario` + +##### TArtifact + +`TArtifact` + +#### Parameters + +##### config + +[`RunPersonaConfig`](#runpersonaconfig)\<`TScenario`, `TArtifact`\> + +#### Returns + +`ProfileDispatchFn`\<`TScenario`, `TArtifact`\> + +*** + +### turnId() + +> **turnId**(`runId`, `index`, `speaker`): `string` + +Defined in: [conversation/turn-id.ts:14](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/turn-id.ts#L14) + +#### Parameters + +##### runId + +`string` + +##### index + +`number` + +##### speaker + +`string` + +#### Returns + +`string` + +#### Stable + +Deterministic turn identifier. Stable across retries of the same logical +turn so backends (and any caching gateway in between) can dedupe on it. +A retry triggered by a network blip or deadline timeout MUST produce the +same `turn_id`; only the underlying attempt count differs. + +Shape: `${runId}.t${index}.${speakerSlug}` — readable in logs, sortable by +turn index, attributable to a speaker. Slugify keeps the speaker portion +URL-safe so it can ride in HTTP headers without escaping. + +*** + +### slugifySpeaker() + +> **slugifySpeaker**(`speaker`): `string` + +Defined in: [conversation/turn-id.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/turn-id.ts#L24) + +Reduce a speaker name to ASCII alphanumerics + dashes. Preserves enough +substance to read in a log line; collisions between speakers within a +single Conversation are prevented by `defineConversation`'s +unique-name check, so the slug only needs to be deterministic, not unique. + +#### Parameters + +##### speaker + +`string` + +#### Returns + +`string` + +*** + +### handleChatTurn() + +> **handleChatTurn**(`input`): [`ChatTurnResult`](#chatturnresult) + +Defined in: [durable/chat-engine.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L110) + +Run one chat turn. Returns immediately with a `ReadableStream` body; +the turn executes as the body is pulled. Never rejects — backend +failures surface as `error` + `session.run.failed` events. + +#### Parameters + +##### input + +[`RunChatTurnInput`](#runchatturninput) + +#### Returns + +[`ChatTurnResult`](#chatturnresult) + +*** + +### deriveExecutionId() + +> **deriveExecutionId**(`input`): `string` + +Defined in: [durable/execution-handle.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/execution-handle.ts#L17) + +Derive a stable executionId from the run identity. The same +`(projectId, sessionId, turnIndex)` tuple yields the same id — so a +client retry of the same turn lands on the same substrate execution +and the orchestrator's buffer replays instead of starting a second +prompt. + +Format is readable, not hashed: operators grepping orchestrator logs +for `gtm-agent:thread-abc:3` find the run without translating an +opaque id. Substrate executionIds are not a secrecy boundary. + +Wire integration: + - Sandbox PromptOptions accepts `executionId` and `lastEventId`. + Products pass this id to make cross-process reconnect land on the + same substrate execution instead of spawning a duplicate run. + +#### Parameters + +##### input + +###### projectId + +`string` + +###### sessionId + +`string` + +###### turnIndex + +`number` + +#### Returns + +`string` + +*** + +### isDelegatedLoopMode() + +> **isDelegatedLoopMode**(`value`): value is "code" \| "review" \| "research" \| "audit" \| "self-improve" + +Defined in: [loop-runner.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L61) + +**`Experimental`** + +Type guard for an untrusted mode string (CLI / config input). + +#### Parameters + +##### value + +`unknown` + +#### Returns + +value is "code" \| "review" \| "research" \| "audit" \| "self-improve" + +*** + +### runDelegatedLoop() + +> **runDelegatedLoop**\<`T`\>(`mode`, `registry`, `options?`): `Promise`\<[`DelegatedLoopResult`](#delegatedloopresult)\<`T`\>\> + +Defined in: [loop-runner.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L98) + +**`Experimental`** + +Dispatch a configured loop by mode. Fails loud (throws `ConfigError`) when no +runner is registered for the mode — a routine pointed at an unwired mode is a +config bug, not a silent no-op. A runner that throws is captured as +`{ ok: false }` so unattended runs record the failure rather than crash. + +#### Type Parameters + +##### T + +`T` = `unknown` + +#### Parameters + +##### mode + +`"code"` \| `"review"` \| `"research"` \| `"audit"` \| `"self-improve"` + +##### registry + +[`DelegatedLoopRegistry`](#delegatedloopregistry) + +##### options? + +[`RunDelegatedLoopOptions`](#rundelegatedloopoptions) = `{}` + +#### Returns + +`Promise`\<[`DelegatedLoopResult`](#delegatedloopresult)\<`T`\>\> + +*** + +### coderLoopRunner() + +> **coderLoopRunner**(`options`): [`DelegatedLoopRunner`](#delegatedlooprunner)\<`CoderOutput`\> + +Defined in: [loop-runner.ts:144](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L144) + +**`Experimental`** + +Build a `code`/`review`-mode runner over the sandbox-session coder delegate. Pass a +`reviewer` to run `review` mode — an approval gate over the validated candidate. + +#### Parameters + +##### options + +[`CoderLoopRunnerOptions`](#coderlooprunneroptions) + +#### Returns + +[`DelegatedLoopRunner`](#delegatedlooprunner)\<`CoderOutput`\> + +*** + +### worktreeLoopRunner() + +> **worktreeLoopRunner**(`options`): [`DelegatedLoopRunner`](#delegatedlooprunner)\<`WorktreeHarnessResult`\> + +Defined in: [loop-runner.ts:197](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L197) + +**`Experimental`** + +`code` mode on the GENERIC recursive path: author one `AgentProfile` per harness, run them as a +`worktreeFanout` (N `createWorktreeCliExecutor` leaves, each `gateOnDeliverable`) through +`runPersonified` on the keystone Supervisor. This is the local-repo counterpart to +[coderLoopRunner](#coderlooprunner) (which drives the in-box harness over a `SandboxClient`): no `runLoop` +driver, no role-coupled delegate — the harness list is the fanout, the gate is `patchDelivered`, +the winner is the shared valid-only selector (NOT `defaultSelectWinner`, whose non-valid fallback +would surface an ungated patch). Equal-k holds by the conserved budget pool. Returns the winning +patch artifact, or throws when no candidate is delivered (fail loud, never a vacuous done). + +#### Parameters + +##### options + +[`WorktreeLoopRunnerOptions`](#worktreelooprunneroptions) + +#### Returns + +[`DelegatedLoopRunner`](#delegatedlooprunner)\<`WorktreeHarnessResult`\> + +*** + +### researchLoopRunner() + +> **researchLoopRunner**(`o`): [`DelegatedLoopRunner`](#delegatedlooprunner)\<[`ResearchLoopResult`](#researchloopresult)\> + +Defined in: [loop-runner.ts:282](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L282) + +**`Experimental`** + +`research` mode — research-in-a-loop with valid-only KB growth. + +Each round: research → gate every candidate (fail-closed; passage MUST be in +the source) → accept the clean ones → re-research the vetoed ones next round, +up to `maxRounds`. Vetoed facts in the final round are RETURNED (escalate, +never silently dropped) so the caller audits vs retries. + +#### Parameters + +##### o + +[`ResearchLoopRunnerOptions`](#researchlooprunneroptions) + +#### Returns + +[`DelegatedLoopRunner`](#delegatedlooprunner)\<[`ResearchLoopResult`](#researchloopresult)\> + +*** + +### selfImproveLoopRunner() + +> **selfImproveLoopRunner**\<`TScenario`, `TArtifact`\>(`options`): [`DelegatedLoopRunner`](#delegatedlooprunner)\<`SelfImproveResult`\<`TScenario`, `TArtifact`\>\> + +Defined in: [loop-runner.ts:309](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L309) + +**`Experimental`** + +`self-improve` mode — agent-eval's one-call closed loop (held-out gated). + +#### Type Parameters + +##### TScenario + +`TScenario` *extends* `Scenario` + +##### TArtifact + +`TArtifact` + +#### Parameters + +##### options + +`SelfImproveOptions`\<`TScenario`, `TArtifact`\> + +#### Returns + +[`DelegatedLoopRunner`](#delegatedlooprunner)\<`SelfImproveResult`\<`TScenario`, `TArtifact`\>\> + +*** + +### auditLoopRunner() + +> **auditLoopRunner**\<`TProposal`, `TEdit`\>(`options`): [`DelegatedLoopRunner`](#delegatedlooprunner)\<[`RunAnalystLoopResult`](analyst-loop.md#runanalystloopresult)\<`TProposal`, `TEdit`\>\> + +Defined in: [loop-runner.ts:316](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L316) + +**`Experimental`** + +`audit` mode — analyst loop over captured trace/run data. + +#### Type Parameters + +##### TProposal + +`TProposal` = `unknown` + +##### TEdit + +`TEdit` = `unknown` + +#### Parameters + +##### options + +[`RunAnalystLoopOpts`](analyst-loop.md#runanalystloopopts) + +#### Returns + +[`DelegatedLoopRunner`](#delegatedlooprunner)\<[`RunAnalystLoopResult`](analyst-loop.md#runanalystloopresult)\<`TProposal`, `TEdit`\>\> + +*** + +### mcpToolsForRuntimeMcp() + +> **mcpToolsForRuntimeMcp**(): [`OpenAIChatTool`](#openaichattool)[] + +Defined in: [mcp/openai-tools.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/openai-tools.ts#L74) + +**`Experimental`** + +Returns the 5 delegation tools projected into OpenAI Chat Completions +`tools[]` shape. The order is stable: `delegate_code`, +`delegate_research`, `delegate_feedback`, `delegation_status`, +`delegation_history`. + +#### Returns + +[`OpenAIChatTool`](#openaichattool)[] + +*** + +### mcpToolsForRuntimeMcpSubset() + +> **mcpToolsForRuntimeMcpSubset**(`names`): [`OpenAIChatTool`](#openaichattool)[] + +Defined in: [mcp/openai-tools.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/openai-tools.ts#L112) + +**`Experimental`** + +Subset filter — return only the projected tools whose `function.name` +appears in `names`. Useful for curated mounts (e.g. only the queue-bound +delegation tools, omitting `delegate_feedback`). Unknown names are +silently ignored; pass an empty array to get an empty result. + +#### Parameters + +##### names + +readonly `string`[] + +#### Returns + +[`OpenAIChatTool`](#openaichattool)[] + +*** + +### resolveRouterBaseUrl() + +> **resolveRouterBaseUrl**(`env?`): `string` + +Defined in: [model-resolution.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L44) + +Resolve the router base URL from env, normalised — no trailing `/v1` or `/`. + +#### Parameters + +##### env? + +[`RouterEnv`](#routerenv) = `{}` + +#### Returns + +`string` + +*** + +### getModels() + +> **getModels**(`routerBaseUrl?`): `Promise`\<[`ModelInfo`](#modelinfo)[]\> + +Defined in: [model-resolution.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L54) + +Fetch the model catalog from the router's `/v1/models`. Throws on a non-2xx +response — callers decide whether to fail open (empty catalog) or closed. + +#### Parameters + +##### routerBaseUrl? + +`string` = `DEFAULT_ROUTER_BASE_URL` + +#### Returns + +`Promise`\<[`ModelInfo`](#modelinfo)[]\> + +*** + +### cleanModelId() + +> **cleanModelId**(`value`): `string` \| `undefined` + +Defined in: [model-resolution.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L66) + +Trim a candidate model id; `undefined` for non-strings and blanks. + +#### Parameters + +##### value + +`unknown` + +#### Returns + +`string` \| `undefined` + +*** + +### resolveChatModel() + +> **resolveChatModel**(`candidates`, `fallback`): [`ResolvedChatModel`](#resolvedchatmodel) + +Defined in: [model-resolution.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L89) + +Resolve a chat model by precedence: the first candidate carrying a +non-blank model wins, else `fallback`. The caller owns the precedence +order, so each product keeps its own policy (request → workspace → env, +etc.) while the first-non-blank logic and the telemetry shape stay shared. + +#### Parameters + +##### candidates + +`ChatModelCandidate`[] + +##### fallback + +[`ResolvedChatModel`](#resolvedchatmodel) + +#### Returns + +[`ResolvedChatModel`](#resolvedchatmodel) + +*** + +### validateChatModelId() + +> **validateChatModelId**(`modelId`, `options?`): `Promise`\<`ChatModelValidation`\> + +Defined in: [model-resolution.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L129) + +Validate a caller-supplied chat-model id. Rejects non-strings, malformed +ids, and ids absent from both the caller's `allowlist` and the live router +catalog. Fails closed: when the catalog cannot be fetched, an unverifiable +id is rejected rather than admitted — a bad model never reaches the agent. + +#### Parameters + +##### modelId + +`unknown` + +##### options? + +###### allowlist? + +`string`[] + +Known-good ids that skip the catalog round trip — e.g. the product's +default model plus any env-configured ids. + +###### routerBaseUrl? + +`string` + +###### loadModels? + +(`routerBaseUrl`) => `Promise`\<[`ModelInfo`](#modelinfo)[]\> + +Injectable catalog loader — overridden in tests. + +#### Returns + +`Promise`\<`ChatModelValidation`\> + +*** + +### createOtelExporter() + +> **createOtelExporter**(`config?`): [`OtelExporter`](#otelexporter) \| `undefined` + +Defined in: [otel-export.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L81) + +Create an OTEL exporter. Returns undefined when no endpoint is configured. + +#### Parameters + +##### config? + +[`OtelExportConfig`](#otelexportconfig) + +#### Returns + +[`OtelExporter`](#otelexporter) \| `undefined` + +*** + +### loopEventToOtelSpan() + +> **loopEventToOtelSpan**(`event`, `traceId`, `parentSpanId?`): [`OtelSpan`](#otelspan) + +Defined in: [otel-export.ts:162](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L162) + +Convert a LoopTraceEvent into an OtelSpan for export. + +#### Parameters + +##### event + +###### kind + +`string` + +###### runId + +`string` + +###### timestamp + +`number` + +###### payload + +`object` + +##### traceId + +`string` + +##### parentSpanId? + +`string` + +#### Returns + +[`OtelSpan`](#otelspan) + +*** + +### buildLoopOtelSpans() + +> **buildLoopOtelSpans**(`events`, `traceId`, `rootParentSpanId?`): [`OtelSpan`](#otelspan)[] + +Defined in: [otel-export.ts:232](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L232) + +Build a nested, real-duration OTLP span tree for ONE loop run from its full +ordered `LoopTraceEvent` stream. Unlike `loopEventToOtelSpan` (one flat, +zero-duration span per event), this reconstructs the topology hierarchy a +GenAI trace viewer renders natively: + + loop (invoke_workflow) + └─ loop.round[k] (invoke_workflow) ← tangle.loop.move.{kind,width,rationale} + ├─ loop.iteration[i] (invoke_agent) ← gen_ai.agent.name + usage + verdict + placement + └─ … + +Attributes follow the current GenAI semconv (`gen_ai.*`) where they apply and +a namespaced `tangle.loop.*` / `tangle.cost.usd` extension for topology / +verdict / placement / cost (not yet standardized). Pure: feed it a buffered +per-runId event array (e.g. flushed on `loop.ended`) and export the result. + +#### Parameters + +##### events + +readonly `object`[] + +##### traceId + +`string` + +##### rootParentSpanId? + +`string` + +#### Returns + +[`OtelSpan`](#otelspan)[] + +*** + +### buildLoopSpanNodes() + +> **buildLoopSpanNodes**(`events`): [`LoopSpanNode`](#loopspannode)[] + +Defined in: [otel-export.ts:263](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L263) + +Sink-neutral core behind [buildLoopOtelSpans](#buildloopotelspans): reconstruct the +loop → round → branch span tree from one run's ordered `LoopTraceEvent` +stream. Consumed by the OTEL mapper above and by the MCP delegation +journal's compact trace tee — one topology reconstruction, two sinks. +Tolerates partial streams (a run that never reached `loop.ended` closes +at the last observed event's timestamp). + +#### Parameters + +##### events + +readonly `object`[] + +#### Returns + +[`LoopSpanNode`](#loopspannode)[] + +*** + +### exportEvalRuns() + +> **exportEvalRuns**(`events`, `config?`): `Promise`\<[`EvalRunsExportResult`](#evalrunsexportresult)\> + +Defined in: [otel-export.ts:582](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L582) + +Ship self-improvement eval-run events to Tangle Intelligence. Unlike the +best-effort span exporter, this RESOLVES with the ingest verdict (accepted / +rejected per event) so a consumer's loop can assert its provenance landed. +Throws only on a missing key or network failure. + +#### Parameters + +##### events + +[`EvalRunEvent`](#evalrunevent)[] + +##### config? + +[`EvalRunsExportConfig`](#evalrunsexportconfig) + +#### Returns + +`Promise`\<[`EvalRunsExportResult`](#evalrunsexportresult)\> + +*** + +### decideKnowledgeReadiness() + +> **decideKnowledgeReadiness**(`report`, `options?`): `KnowledgeReadinessDecision` + +Defined in: [readiness.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/readiness.ts#L22) + +#### Parameters + +##### report + +`KnowledgeReadinessReport` + +##### options? + +###### minimumScore? + +`number` + +#### Returns + +`KnowledgeReadinessDecision` + +#### Stable + +*** + +### applyRunRecordDefaults() + +> **applyRunRecordDefaults**(`records`, `scenarioId`, `controlFailureClass`): `RunRecord`[] + +Defined in: [run.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/run.ts#L48) + +Stamp cross-cutting defaults onto adapter-projected RunRecords without + overriding anything the adapter set explicitly: + - `scenarioId` — the run's scenario, when the record omits one. + - `failureClass` — the control layer's failure classification promoted + onto the canonical cross-agent key, but ONLY when it's a real taxonomy + class. This is what lets the substrate aggregate failures across every + agent in one vocabulary instead of per-agent ad-hoc strings. + +#### Parameters + +##### records + +`RunRecord`[] + +##### scenarioId + +`string` + +##### controlFailureClass + +`string` \| `undefined` + +#### Returns + +`RunRecord`[] + +*** + +### runAgentTask() + +> **runAgentTask**\<`TState`, `TAction`, `TActionResult`, `TEval`\>(`options`): `Promise`\<[`AgentTaskRunResult`](#agenttaskrunresult)\<`TState`, `TAction`, `TActionResult`, `TEval`\>\> + +Defined in: [run.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/run.ts#L83) + +#### Type Parameters + +##### TState + +`TState` + +##### TAction + +`TAction` + +##### TActionResult + +`TActionResult` + +##### TEval + +`TEval` *extends* `ControlEvalResult` = `ControlEvalResult` + +#### Parameters + +##### options + +`RunAgentTaskOptions`\<`TState`, `TAction`, `TActionResult`, `TEval`\> + +#### Returns + +`Promise`\<[`AgentTaskRunResult`](#agenttaskrunresult)\<`TState`, `TAction`, `TActionResult`, `TEval`\>\> + +#### Stable + +*** + +### runAgentTaskStream() + +> **runAgentTaskStream**\<`TInput`\>(`options`): `AsyncIterable`\<[`RuntimeStreamEvent`](#runtimestreamevent)\> + +Defined in: [run.ts:197](https://github.com/tangle-network/agent-runtime/blob/main/src/run.ts#L197) + +#### Type Parameters + +##### TInput + +`TInput` *extends* [`AgentBackendInput`](#agentbackendinput) = [`AgentBackendInput`](#agentbackendinput) + +#### Parameters + +##### options + +`RunAgentTaskStreamOptions`\<`TInput`\> + +#### Returns + +`AsyncIterable`\<[`RuntimeStreamEvent`](#runtimestreamevent)\> + +#### Stable + +*** + +### defineRuntimeHooks() + +> **defineRuntimeHooks**(`hooks`): [`RuntimeHooks`](#runtimehooks) + +Defined in: [runtime-hooks.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L106) + +Identity helper that types a [RuntimeHooks](#runtimehooks) literal so the fields are inferred. + +#### Parameters + +##### hooks + +[`RuntimeHooks`](#runtimehooks) + +#### Returns + +[`RuntimeHooks`](#runtimehooks) + +*** + +### composeRuntimeHooks() + +> **composeRuntimeHooks**(...`entries`): [`RuntimeHooks`](#runtimehooks) + +Defined in: [runtime-hooks.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L115) + +Merge several [RuntimeHooks](#runtimehooks) into one. Falsy entries are dropped (so you can +pass `flag && hooks`), and every observer's `onEvent`/`onDecisionPoint` fires for each +event. Use this to attach N observers to a loop instead of a second event bus. + +#### Parameters + +##### entries + +...(`false` \| [`RuntimeHooks`](#runtimehooks) \| `null` \| `undefined`)[] + +#### Returns + +[`RuntimeHooks`](#runtimehooks) + +*** + +### notifyRuntimeHookEvent() + +> **notifyRuntimeHookEvent**(`hooks`, `event`, `context?`): `void` + +Defined in: [runtime-hooks.ts:156](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L156) + +#### Parameters + +##### hooks + +[`RuntimeHooks`](#runtimehooks) \| `undefined` + +##### event + +[`RuntimeHookEvent`](#runtimehookevent) + +##### context? + +[`RuntimeHookContext`](#runtimehookcontext) = `{}` + +#### Returns + +`void` + +*** + +### notifyRuntimeDecisionPoint() + +> **notifyRuntimeDecisionPoint**(`hooks`, `point`, `context?`): `void` + +Defined in: [runtime-hooks.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L186) + +#### Parameters + +##### hooks + +[`RuntimeHooks`](#runtimehooks) \| `undefined` + +##### point + +[`RuntimeDecisionPoint`](#runtimedecisionpoint) + +##### context? + +[`RuntimeHookContext`](#runtimehookcontext) = `{}` + +#### Returns + +`void` + +*** + +### startRuntimeRun() + +> **startRuntimeRun**(`options`): [`RuntimeRunHandle`](#runtimerunhandle) + +Defined in: [runtime-run.ts:148](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L148) + +#### Parameters + +##### options + +`RuntimeRunOptions` + +#### Returns + +[`RuntimeRunHandle`](#runtimerunhandle) + +#### Stable + +Construct a runtime-run handle. The returned handle is mutable across its +lifetime; consumers should not share it across requests. + +*** + +### sanitizeKnowledgeReadinessReport() + +> **sanitizeKnowledgeReadinessReport**(`report`, `options?`): [`SanitizedKnowledgeReadinessReport`](#sanitizedknowledgereadinessreport) + +Defined in: [sanitize.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L81) + +#### Parameters + +##### report + +`KnowledgeReadinessReport` + +##### options? + +[`RuntimeTelemetryOptions`](#runtimetelemetryoptions) = `{}` + +#### Returns + +[`SanitizedKnowledgeReadinessReport`](#sanitizedknowledgereadinessreport) + +#### Stable + +*** + +### sanitizeAgentRuntimeEvent() + +> **sanitizeAgentRuntimeEvent**\<`TState`, `TAction`, `TActionResult`, `TEval`\>(`event`, `options?`): `Record`\<`string`, `unknown`\> + +Defined in: [sanitize.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L104) + +#### Type Parameters + +##### TState + +`TState` + +##### TAction + +`TAction` + +##### TActionResult + +`TActionResult` + +##### TEval + +`TEval` *extends* `ControlEvalResult` + +#### Parameters + +##### event + +[`AgentRuntimeEvent`](#agentruntimeevent)\<`TState`, `TAction`, `TActionResult`, `TEval`\> + +##### options? + +[`RuntimeTelemetryOptions`](#runtimetelemetryoptions) = `{}` + +#### Returns + +`Record`\<`string`, `unknown`\> + +#### Stable + +*** + +### sanitizeRuntimeStreamEvent() + +> **sanitizeRuntimeStreamEvent**(`event`, `options?`): `Record`\<`string`, `unknown`\> + +Defined in: [sanitize.ts:160](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L160) + +#### Parameters + +##### event + +[`RuntimeStreamEvent`](#runtimestreamevent) + +##### options? + +[`RuntimeTelemetryOptions`](#runtimetelemetryoptions) = `{}` + +#### Returns + +`Record`\<`string`, `unknown`\> + +#### Stable + +*** + +### createRuntimeEventCollector() + +> **createRuntimeEventCollector**\<`TState`, `TAction`, `TActionResult`, `TEval`\>(`options?`): [`RuntimeEventCollector`](#runtimeeventcollector)\<`TState`, `TAction`, `TActionResult`, `TEval`\> + +Defined in: [sanitize.ts:530](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L530) + +#### Type Parameters + +##### TState + +`TState` = `unknown` + +##### TAction + +`TAction` = `unknown` + +##### TActionResult + +`TActionResult` = `unknown` + +##### TEval + +`TEval` *extends* `ControlEvalResult` = `ControlEvalResult` + +#### Parameters + +##### options? + +[`RuntimeTelemetryOptions`](#runtimetelemetryoptions) = `{}` + +#### Returns + +[`RuntimeEventCollector`](#runtimeeventcollector)\<`TState`, `TAction`, `TActionResult`, `TEval`\> + +#### Stable + +*** + +### createRuntimeStreamEventCollector() + +> **createRuntimeStreamEventCollector**(`options?`): [`RuntimeStreamEventCollector`](#runtimestreameventcollector) + +Defined in: [sanitize.ts:557](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L557) + +#### Parameters + +##### options? + +[`RuntimeTelemetryOptions`](#runtimetelemetryoptions) = `{}` + +#### Returns + +[`RuntimeStreamEventCollector`](#runtimestreameventcollector) + +#### Stable + +Streaming-event counterpart of `createRuntimeEventCollector`. Pass each +event yielded by `runAgentTaskStream` through `onEvent` and read the +sanitized copies off `events`; the same `RuntimeTelemetryOptions` redaction +flags apply. Kept distinct from `createRuntimeEventCollector` because the +stream and non-stream event shapes overlap on `type` literals — dispatching +on `type` alone would misroute events. + +*** + +### readinessServerSentEvent() + +> **readinessServerSentEvent**(`report`, `options?`): `string` + +Defined in: [sse.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/sse.ts#L41) + +#### Parameters + +##### report + +`KnowledgeReadinessReport` + +##### options? + +[`RuntimeTelemetryOptions`](#runtimetelemetryoptions) & `ServerSentEventOptions` = `{}` + +#### Returns + +`string` + +#### Stable + +*** + +### runtimeStreamServerSentEvent() + +> **runtimeStreamServerSentEvent**(`event`, `options?`): `string` + +Defined in: [sse.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/sse.ts#L56) + +#### Parameters + +##### event + +[`RuntimeStreamEvent`](#runtimestreamevent) + +##### options? + +[`RuntimeTelemetryOptions`](#runtimetelemetryoptions) & `ServerSentEventOptions` = `{}` + +#### Returns + +`string` + +#### Stable + +*** + +### runToolLoop() + +> **runToolLoop**(`opts`): `Promise`\<[`ToolLoopResult`](#toolloopresult)\> + +Defined in: [tool-loop.ts:156](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L156) + +Run the bounded tool loop and return the final text + every executed tool + outcome. Awaitable — callers needing to stream events to a UI use + [streamToolLoop](#streamtoolloop). + +#### Parameters + +##### opts + +[`RunToolLoopOptions`](#runtoolloopoptions) + +#### Returns + +`Promise`\<[`ToolLoopResult`](#toolloopresult)\> + +*** + +### streamToolLoop() + +> **streamToolLoop**\<`Raw`\>(`opts`): `AsyncGenerator`\<[`StreamToolLoopYield`](#streamtoolloopyield)\<`Raw`\>, `void`, `unknown`\> + +Defined in: [tool-loop.ts:336](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L336) + +Streaming bounded tool loop: yields each raw turn event (the caller maps + + telemetries + re-emits it) and each executed `tool_result`; emits one + `capped` if it stops for any non-completed reason with calls still pending. + +#### Type Parameters + +##### Raw + +`Raw` + +#### Parameters + +##### opts + +[`StreamToolLoopOptions`](#streamtoolloopoptions)\<`Raw`\> + +#### Returns + +`AsyncGenerator`\<[`StreamToolLoopYield`](#streamtoolloopyield)\<`Raw`\>, `void`, `unknown`\> diff --git a/docs/api/index/README.md b/docs/api/index/README.md deleted file mode 100644 index 22c0f14..0000000 --- a/docs/api/index/README.md +++ /dev/null @@ -1,194 +0,0 @@ -[**@tangle-network/agent-runtime**](../README.md) - -*** - -[@tangle-network/agent-runtime](../README.md) / index - -# index - -## Classes - -- [CircuitOpenError](classes/CircuitOpenError.md) -- [DeadlineExceededError](classes/DeadlineExceededError.md) -- [CircuitBreakerState](classes/CircuitBreakerState.md) -- [SqlConversationJournal](classes/SqlConversationJournal.md) -- [InMemoryConversationJournal](classes/InMemoryConversationJournal.md) -- [FileConversationJournal](classes/FileConversationJournal.md) -- [BackendTransportError](classes/BackendTransportError.md) -- [RuntimeRunStateError](classes/RuntimeRunStateError.md) -- [PlannerError](classes/PlannerError.md) -- [InMemoryRuntimeSessionStore](classes/InMemoryRuntimeSessionStore.md) - -## Interfaces - -- [CircuitBreakerConfig](interfaces/CircuitBreakerConfig.md) -- [BackendCallPolicy](interfaces/BackendCallPolicy.md) -- [SqlAdapter](interfaces/SqlAdapter.md) -- [D1DatabaseLike](interfaces/D1DatabaseLike.md) -- [D1StmtLike](interfaces/D1StmtLike.md) -- [ConversationJournalEntry](interfaces/ConversationJournalEntry.md) -- [ConversationJournal](interfaces/ConversationJournal.md) -- [RunPersonaConversationOptions](interfaces/RunPersonaConversationOptions.md) -- [PersonaConversationResult](interfaces/PersonaConversationResult.md) -- [RunPersonaConfig](interfaces/RunPersonaConfig.md) -- [ConversationParticipant](interfaces/ConversationParticipant.md) -- [ConversationDriveState](interfaces/ConversationDriveState.md) -- [HaltContext](interfaces/HaltContext.md) -- [HaltSignal](interfaces/HaltSignal.md) -- [ConversationPolicy](interfaces/ConversationPolicy.md) -- [ConversationTurn](interfaces/ConversationTurn.md) -- [Conversation](interfaces/Conversation.md) -- [RunConversationOptions](interfaces/RunConversationOptions.md) -- [ConversationResult](interfaces/ConversationResult.md) -- [ChatStreamEvent](interfaces/ChatStreamEvent.md) -- [ChatTurnIdentity](interfaces/ChatTurnIdentity.md) -- [ChatTurnProducer](interfaces/ChatTurnProducer.md) -- [ChatTurnHooks](interfaces/ChatTurnHooks.md) -- [RunChatTurnInput](interfaces/RunChatTurnInput.md) -- [ChatTurnResult](interfaces/ChatTurnResult.md) -- [DelegatedLoopResult](interfaces/DelegatedLoopResult.md) -- [RunDelegatedLoopOptions](interfaces/RunDelegatedLoopOptions.md) -- [CoderLoopRunnerOptions](interfaces/CoderLoopRunnerOptions.md) -- [WorktreeLoopRunnerOptions](interfaces/WorktreeLoopRunnerOptions.md) -- [VetoedFact](interfaces/VetoedFact.md) -- [ResearchLoopResult](interfaces/ResearchLoopResult.md) -- [ResearchLoopRunnerOptions](interfaces/ResearchLoopRunnerOptions.md) -- [ModelInfo](interfaces/ModelInfo.md) -- [RouterEnv](interfaces/RouterEnv.md) -- [ResolvedChatModel](interfaces/ResolvedChatModel.md) -- [OtelExportConfig](interfaces/OtelExportConfig.md) -- [OtelExporter](interfaces/OtelExporter.md) -- [OtelSpan](interfaces/OtelSpan.md) -- [OtelAttribute](interfaces/OtelAttribute.md) -- [LoopSpanNode](interfaces/LoopSpanNode.md) -- [EvalRunGeneration](interfaces/EvalRunGeneration.md) -- [EvalRunEvent](interfaces/EvalRunEvent.md) -- [EvalRunsExportConfig](interfaces/EvalRunsExportConfig.md) -- [EvalRunsExportResult](interfaces/EvalRunsExportResult.md) -- [RuntimeHookEvent](interfaces/RuntimeHookEvent.md) -- [RuntimeHookContext](interfaces/RuntimeHookContext.md) -- [RuntimeDecisionEvidenceRef](interfaces/RuntimeDecisionEvidenceRef.md) -- [RuntimeDecisionPoint](interfaces/RuntimeDecisionPoint.md) -- [RuntimeHookErrorContext](interfaces/RuntimeHookErrorContext.md) -- [RuntimeHooks](interfaces/RuntimeHooks.md) -- [RuntimeRunRow](interfaces/RuntimeRunRow.md) -- [RuntimeRunPersistenceAdapter](interfaces/RuntimeRunPersistenceAdapter.md) -- [RuntimeRunHandle](interfaces/RuntimeRunHandle.md) -- [RuntimeTelemetryOptions](interfaces/RuntimeTelemetryOptions.md) -- [SanitizedKnowledgeReadinessReport](interfaces/SanitizedKnowledgeReadinessReport.md) -- [RuntimeEventCollector](interfaces/RuntimeEventCollector.md) -- [RuntimeStreamEventCollector](interfaces/RuntimeStreamEventCollector.md) -- [ToolLoopCall](interfaces/ToolLoopCall.md) -- [ToolLoopAssistantToolCall](interfaces/ToolLoopAssistantToolCall.md) -- [ToolLoopResult](interfaces/ToolLoopResult.md) -- [RunToolLoopOptions](interfaces/RunToolLoopOptions.md) -- [StreamToolLoopOptions](interfaces/StreamToolLoopOptions.md) -- [AgentTaskSpec](interfaces/AgentTaskSpec.md) -- [AgentKnowledgeProvider](interfaces/AgentKnowledgeProvider.md) -- [AgentTaskContext](interfaces/AgentTaskContext.md) -- [AgentAdapter](interfaces/AgentAdapter.md) -- [BackendErrorDetail](interfaces/BackendErrorDetail.md) -- [OpenAIChatTool](interfaces/OpenAIChatTool.md) -- [RuntimeSessionStore](interfaces/RuntimeSessionStore.md) -- [AgentBackendInput](interfaces/AgentBackendInput.md) -- [AgentBackendContext](interfaces/AgentBackendContext.md) -- [AgentExecutionBackend](interfaces/AgentExecutionBackend.md) -- [AgentTaskRunResult](interfaces/AgentTaskRunResult.md) - -## Type Aliases - -- [RetryableErrorPredicate](type-aliases/RetryableErrorPredicate.md) -- [RetryBackoff](type-aliases/RetryBackoff.md) -- [ForwardHeaderName](type-aliases/ForwardHeaderName.md) -- [PropagatedHeaders](type-aliases/PropagatedHeaders.md) -- [PersonaDriver](type-aliases/PersonaDriver.md) -- [AuthSource](type-aliases/AuthSource.md) -- [TurnOrder](type-aliases/TurnOrder.md) -- [HaltPredicate](type-aliases/HaltPredicate.md) -- [HaltReason](type-aliases/HaltReason.md) -- [ConversationStreamEvent](type-aliases/ConversationStreamEvent.md) -- [DelegatedLoopMode](type-aliases/DelegatedLoopMode.md) -- [DelegatedLoopRunner](type-aliases/DelegatedLoopRunner.md) -- [DelegatedLoopRegistry](type-aliases/DelegatedLoopRegistry.md) -- [RuntimeHookPhase](type-aliases/RuntimeHookPhase.md) -- [RuntimeHookTarget](type-aliases/RuntimeHookTarget.md) -- [RuntimeDecisionKind](type-aliases/RuntimeDecisionKind.md) -- [ToolCallOutcome](type-aliases/ToolCallOutcome.md) -- [ToolLoopMessage](type-aliases/ToolLoopMessage.md) -- [ToolLoopEvent](type-aliases/ToolLoopEvent.md) -- [ToolLoopStopReason](type-aliases/ToolLoopStopReason.md) -- [StreamToolLoopYield](type-aliases/StreamToolLoopYield.md) -- [AgentTaskStatus](type-aliases/AgentTaskStatus.md) -- [AgentRuntimeEvent](type-aliases/AgentRuntimeEvent.md) -- [AgentRuntimeEventSink](type-aliases/AgentRuntimeEventSink.md) -- [OpenAIChatToolChoice](type-aliases/OpenAIChatToolChoice.md) -- [RuntimeStreamEvent](type-aliases/RuntimeStreamEvent.md) - -## Variables - -- [defaultIsRetryable](variables/defaultIsRetryable.md) -- [FORWARD\_HEADERS](variables/FORWARD_HEADERS.md) -- [DEFAULT\_MAX\_DEPTH](variables/DEFAULT_MAX_DEPTH.md) -- [DELEGATED\_LOOP\_MODES](variables/DELEGATED_LOOP_MODES.md) -- [DEFAULT\_ROUTER\_BASE\_URL](variables/DEFAULT_ROUTER_BASE_URL.md) -- [INTELLIGENCE\_WIRE\_VERSION](variables/INTELLIGENCE_WIRE_VERSION.md) - -## Functions - -- [createIterableBackend](functions/createIterableBackend.md) -- [createSandboxPromptBackend](functions/createSandboxPromptBackend.md) -- [createOpenAICompatibleBackend](functions/createOpenAICompatibleBackend.md) -- [makePerAttemptSignal](functions/makePerAttemptSignal.md) -- [computeBackoff](functions/computeBackoff.md) -- [sleep](functions/sleep.md) -- [createConversationBackend](functions/createConversationBackend.md) -- [defineConversation](functions/defineConversation.md) -- [readDepth](functions/readDepth.md) -- [isDepthExceeded](functions/isDepthExceeded.md) -- [buildForwardHeaders](functions/buildForwardHeaders.md) -- [d1ToSqlAdapter](functions/d1ToSqlAdapter.md) -- [runConversation](functions/runConversation.md) -- [runConversationStream](functions/runConversationStream.md) -- [runPersonaConversation](functions/runPersonaConversation.md) -- [runPersonaDispatch](functions/runPersonaDispatch.md) -- [turnId](functions/turnId.md) -- [slugifySpeaker](functions/slugifySpeaker.md) -- [handleChatTurn](functions/handleChatTurn.md) -- [deriveExecutionId](functions/deriveExecutionId.md) -- [isDelegatedLoopMode](functions/isDelegatedLoopMode.md) -- [runDelegatedLoop](functions/runDelegatedLoop.md) -- [coderLoopRunner](functions/coderLoopRunner.md) -- [worktreeLoopRunner](functions/worktreeLoopRunner.md) -- [researchLoopRunner](functions/researchLoopRunner.md) -- [selfImproveLoopRunner](functions/selfImproveLoopRunner.md) -- [auditLoopRunner](functions/auditLoopRunner.md) -- [mcpToolsForRuntimeMcp](functions/mcpToolsForRuntimeMcp.md) -- [mcpToolsForRuntimeMcpSubset](functions/mcpToolsForRuntimeMcpSubset.md) -- [resolveRouterBaseUrl](functions/resolveRouterBaseUrl.md) -- [getModels](functions/getModels.md) -- [cleanModelId](functions/cleanModelId.md) -- [resolveChatModel](functions/resolveChatModel.md) -- [validateChatModelId](functions/validateChatModelId.md) -- [createOtelExporter](functions/createOtelExporter.md) -- [loopEventToOtelSpan](functions/loopEventToOtelSpan.md) -- [buildLoopOtelSpans](functions/buildLoopOtelSpans.md) -- [buildLoopSpanNodes](functions/buildLoopSpanNodes.md) -- [exportEvalRuns](functions/exportEvalRuns.md) -- [decideKnowledgeReadiness](functions/decideKnowledgeReadiness.md) -- [applyRunRecordDefaults](functions/applyRunRecordDefaults.md) -- [runAgentTask](functions/runAgentTask.md) -- [runAgentTaskStream](functions/runAgentTaskStream.md) -- [defineRuntimeHooks](functions/defineRuntimeHooks.md) -- [composeRuntimeHooks](functions/composeRuntimeHooks.md) -- [notifyRuntimeHookEvent](functions/notifyRuntimeHookEvent.md) -- [notifyRuntimeDecisionPoint](functions/notifyRuntimeDecisionPoint.md) -- [startRuntimeRun](functions/startRuntimeRun.md) -- [sanitizeKnowledgeReadinessReport](functions/sanitizeKnowledgeReadinessReport.md) -- [sanitizeAgentRuntimeEvent](functions/sanitizeAgentRuntimeEvent.md) -- [sanitizeRuntimeStreamEvent](functions/sanitizeRuntimeStreamEvent.md) -- [createRuntimeEventCollector](functions/createRuntimeEventCollector.md) -- [createRuntimeStreamEventCollector](functions/createRuntimeStreamEventCollector.md) -- [readinessServerSentEvent](functions/readinessServerSentEvent.md) -- [runtimeStreamServerSentEvent](functions/runtimeStreamServerSentEvent.md) -- [runToolLoop](functions/runToolLoop.md) -- [streamToolLoop](functions/streamToolLoop.md) diff --git a/docs/api/index/classes/BackendTransportError.md b/docs/api/index/classes/BackendTransportError.md deleted file mode 100644 index 5f5a1c4..0000000 --- a/docs/api/index/classes/BackendTransportError.md +++ /dev/null @@ -1,89 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / BackendTransportError - -# Class: BackendTransportError - -Defined in: [errors.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L65) - -## Stable - -A backend transport call (HTTP, gRPC, sidecar IPC) failed with a non-success -status. Distinct from `JudgeError` (which is structural / unrecoverable) -because backend failures are sometimes retryable and consumers may want to -branch on the upstream status code. - -## Extends - -- `AgentEvalError` - -## Constructors - -### Constructor - -> **new BackendTransportError**(`backend`, `message`, `options?`): `BackendTransportError` - -Defined in: [errors.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L76) - -#### Parameters - -##### backend - -`string` - -##### message - -`string` - -##### options? - -###### cause? - -`unknown` - -###### status? - -`number` - -###### body? - -`string` - -#### Returns - -`BackendTransportError` - -#### Overrides - -`AgentEvalError.constructor` - -## Properties - -### backend - -> `readonly` **backend**: `string` - -Defined in: [errors.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L66) - -*** - -### status? - -> `readonly` `optional` **status?**: `number` - -Defined in: [errors.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L67) - -*** - -### body? - -> `readonly` `optional` **body?**: `string` - -Defined in: [errors.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L74) - -Truncated upstream response body (≤2 KiB) when available. Diagnostic -only — surfaces in `backend_error.error.body` and `final.error.body` -so operators can see "free_tier_limit", "invalid_api_key", etc. without -cracking the log line open. diff --git a/docs/api/index/classes/CircuitBreakerState.md b/docs/api/index/classes/CircuitBreakerState.md deleted file mode 100644 index 87ce5de..0000000 --- a/docs/api/index/classes/CircuitBreakerState.md +++ /dev/null @@ -1,84 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / CircuitBreakerState - -# Class: CircuitBreakerState - -Defined in: [conversation/call-policy.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L83) - -Live circuit-breaker state — one instance per (participant, conversation run). - -## Constructors - -### Constructor - -> **new CircuitBreakerState**(`config`): `CircuitBreakerState` - -Defined in: [conversation/call-policy.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L87) - -#### Parameters - -##### config - -[`CircuitBreakerConfig`](../interfaces/CircuitBreakerConfig.md) \| `undefined` - -#### Returns - -`CircuitBreakerState` - -## Methods - -### preflight() - -> **preflight**(`participant`, `now?`): `void` - -Defined in: [conversation/call-policy.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L93) - -Check whether the next call is allowed. Throws `CircuitOpenError` when -the breaker is open and the cooldown hasn't elapsed. - -#### Parameters - -##### participant - -`string` - -##### now? - -`number` = `...` - -#### Returns - -`void` - -*** - -### recordSuccess() - -> **recordSuccess**(): `void` - -Defined in: [conversation/call-policy.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L103) - -#### Returns - -`void` - -*** - -### recordFailure() - -> **recordFailure**(`now?`): `void` - -Defined in: [conversation/call-policy.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L108) - -#### Parameters - -##### now? - -`number` = `...` - -#### Returns - -`void` diff --git a/docs/api/index/classes/CircuitOpenError.md b/docs/api/index/classes/CircuitOpenError.md deleted file mode 100644 index 9e35ca5..0000000 --- a/docs/api/index/classes/CircuitOpenError.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / CircuitOpenError - -# Class: CircuitOpenError - -Defined in: [conversation/call-policy.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L41) - -## Extends - -- `Error` - -## Constructors - -### Constructor - -> **new CircuitOpenError**(`participant`, `retryAfterMs`): `CircuitOpenError` - -Defined in: [conversation/call-policy.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L42) - -#### Parameters - -##### participant - -`string` - -##### retryAfterMs - -`number` - -#### Returns - -`CircuitOpenError` - -#### Overrides - -`Error.constructor` diff --git a/docs/api/index/classes/DeadlineExceededError.md b/docs/api/index/classes/DeadlineExceededError.md deleted file mode 100644 index d16b28c..0000000 --- a/docs/api/index/classes/DeadlineExceededError.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / DeadlineExceededError - -# Class: DeadlineExceededError - -Defined in: [conversation/call-policy.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L50) - -## Extends - -- `Error` - -## Constructors - -### Constructor - -> **new DeadlineExceededError**(`deadlineMs`): `DeadlineExceededError` - -Defined in: [conversation/call-policy.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L51) - -#### Parameters - -##### deadlineMs - -`number` - -#### Returns - -`DeadlineExceededError` - -#### Overrides - -`Error.constructor` diff --git a/docs/api/index/classes/FileConversationJournal.md b/docs/api/index/classes/FileConversationJournal.md deleted file mode 100644 index a44352a..0000000 --- a/docs/api/index/classes/FileConversationJournal.md +++ /dev/null @@ -1,160 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / FileConversationJournal - -# Class: FileConversationJournal - -Defined in: [conversation/journal.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L122) - -JSONL on disk. One line per record; first line is the `begin`, subsequent -lines are `turn` records, terminal line is `halt`. Replays the whole file -on `loadRun` — cheap for the conversation sizes this is designed for -(thousands of turns, not millions). For huge runs, plug in a real DB -adapter; the interface is small. - -Each `appendTurn` / `recordHalt` calls `fsync` after the write so a -process crash between writes never loses an acknowledged turn. - -## Implements - -- [`ConversationJournal`](../interfaces/ConversationJournal.md) - -## Constructors - -### Constructor - -> **new FileConversationJournal**(`path`): `FileConversationJournal` - -Defined in: [conversation/journal.ts:123](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L123) - -#### Parameters - -##### path - -`string` - -#### Returns - -`FileConversationJournal` - -## Methods - -### loadRun() - -> **loadRun**(`runId`): `Promise`\<[`ConversationJournalEntry`](../interfaces/ConversationJournalEntry.md) \| `undefined`\> - -Defined in: [conversation/journal.ts:125](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L125) - -Load any prior state for `runId`. Returns `undefined` for a fresh run. -Implementations MUST NOT mutate the returned object — the runner clones -before continuing — but the runtime treats absence and emptiness -identically, so a journal with zero turns is equivalent to "fresh." - -#### Parameters - -##### runId - -`string` - -#### Returns - -`Promise`\<[`ConversationJournalEntry`](../interfaces/ConversationJournalEntry.md) \| `undefined`\> - -#### Implementation of - -[`ConversationJournal`](../interfaces/ConversationJournal.md).[`loadRun`](../interfaces/ConversationJournal.md#loadrun) - -*** - -### beginRun() - -> **beginRun**(`runId`, `startedAt`): `Promise`\<`void`\> - -Defined in: [conversation/journal.ts:161](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L161) - -Initialise journal state for a fresh run. Called once per run, before any -`appendTurn`. Idempotent: calling with an existing runId is a no-op if -the entry already exists with the same `startedAt`. - -#### Parameters - -##### runId - -`string` - -##### startedAt - -`string` - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`ConversationJournal`](../interfaces/ConversationJournal.md).[`beginRun`](../interfaces/ConversationJournal.md#beginrun) - -*** - -### appendTurn() - -> **appendTurn**(`runId`, `turn`): `Promise`\<`void`\> - -Defined in: [conversation/journal.ts:174](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L174) - -Append a committed turn. The runner only calls this AFTER the turn's -backend stream completed and the credit total has been updated, so an -appended turn is observed-committed and never speculative. - -#### Parameters - -##### runId - -`string` - -##### turn - -[`ConversationTurn`](../interfaces/ConversationTurn.md) - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`ConversationJournal`](../interfaces/ConversationJournal.md).[`appendTurn`](../interfaces/ConversationJournal.md#appendturn) - -*** - -### recordHalt() - -> **recordHalt**(`runId`, `halt`, `endedAt`): `Promise`\<`void`\> - -Defined in: [conversation/journal.ts:178](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L178) - -Record the run's terminal halt reason + end time. Once called, the run -is observed-final; subsequent `loadRun` returns the same halt. - -#### Parameters - -##### runId - -`string` - -##### halt - -[`HaltReason`](../type-aliases/HaltReason.md) - -##### endedAt - -`string` - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`ConversationJournal`](../interfaces/ConversationJournal.md).[`recordHalt`](../interfaces/ConversationJournal.md#recordhalt) diff --git a/docs/api/index/classes/InMemoryConversationJournal.md b/docs/api/index/classes/InMemoryConversationJournal.md deleted file mode 100644 index c344fbc..0000000 --- a/docs/api/index/classes/InMemoryConversationJournal.md +++ /dev/null @@ -1,143 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / InMemoryConversationJournal - -# Class: InMemoryConversationJournal - -Defined in: [conversation/journal.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L58) - -## Implements - -- [`ConversationJournal`](../interfaces/ConversationJournal.md) - -## Constructors - -### Constructor - -> **new InMemoryConversationJournal**(): `InMemoryConversationJournal` - -#### Returns - -`InMemoryConversationJournal` - -## Methods - -### loadRun() - -> **loadRun**(`runId`): `Promise`\<[`ConversationJournalEntry`](../interfaces/ConversationJournalEntry.md) \| `undefined`\> - -Defined in: [conversation/journal.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L61) - -Load any prior state for `runId`. Returns `undefined` for a fresh run. -Implementations MUST NOT mutate the returned object — the runner clones -before continuing — but the runtime treats absence and emptiness -identically, so a journal with zero turns is equivalent to "fresh." - -#### Parameters - -##### runId - -`string` - -#### Returns - -`Promise`\<[`ConversationJournalEntry`](../interfaces/ConversationJournalEntry.md) \| `undefined`\> - -#### Implementation of - -[`ConversationJournal`](../interfaces/ConversationJournal.md).[`loadRun`](../interfaces/ConversationJournal.md#loadrun) - -*** - -### beginRun() - -> **beginRun**(`runId`, `startedAt`): `Promise`\<`void`\> - -Defined in: [conversation/journal.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L74) - -Initialise journal state for a fresh run. Called once per run, before any -`appendTurn`. Idempotent: calling with an existing runId is a no-op if -the entry already exists with the same `startedAt`. - -#### Parameters - -##### runId - -`string` - -##### startedAt - -`string` - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`ConversationJournal`](../interfaces/ConversationJournal.md).[`beginRun`](../interfaces/ConversationJournal.md#beginrun) - -*** - -### appendTurn() - -> **appendTurn**(`runId`, `turn`): `Promise`\<`void`\> - -Defined in: [conversation/journal.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L87) - -Append a committed turn. The runner only calls this AFTER the turn's -backend stream completed and the credit total has been updated, so an -appended turn is observed-committed and never speculative. - -#### Parameters - -##### runId - -`string` - -##### turn - -[`ConversationTurn`](../interfaces/ConversationTurn.md) - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`ConversationJournal`](../interfaces/ConversationJournal.md).[`appendTurn`](../interfaces/ConversationJournal.md#appendturn) - -*** - -### recordHalt() - -> **recordHalt**(`runId`, `halt`, `endedAt`): `Promise`\<`void`\> - -Defined in: [conversation/journal.ts:102](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L102) - -Record the run's terminal halt reason + end time. Once called, the run -is observed-final; subsequent `loadRun` returns the same halt. - -#### Parameters - -##### runId - -`string` - -##### halt - -[`HaltReason`](../type-aliases/HaltReason.md) - -##### endedAt - -`string` - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`ConversationJournal`](../interfaces/ConversationJournal.md).[`recordHalt`](../interfaces/ConversationJournal.md#recordhalt) diff --git a/docs/api/index/classes/InMemoryRuntimeSessionStore.md b/docs/api/index/classes/InMemoryRuntimeSessionStore.md deleted file mode 100644 index c48968a..0000000 --- a/docs/api/index/classes/InMemoryRuntimeSessionStore.md +++ /dev/null @@ -1,117 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / InMemoryRuntimeSessionStore - -# Class: InMemoryRuntimeSessionStore - -Defined in: [sessions.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/sessions.ts#L40) - -## Stable - -## Implements - -- [`RuntimeSessionStore`](../interfaces/RuntimeSessionStore.md) - -## Constructors - -### Constructor - -> **new InMemoryRuntimeSessionStore**(): `InMemoryRuntimeSessionStore` - -#### Returns - -`InMemoryRuntimeSessionStore` - -## Methods - -### get() - -> **get**(`sessionId`): `RuntimeSession` \| `undefined` - -Defined in: [sessions.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/sessions.ts#L44) - -#### Parameters - -##### sessionId - -`string` - -#### Returns - -`RuntimeSession` \| `undefined` - -#### Implementation of - -[`RuntimeSessionStore`](../interfaces/RuntimeSessionStore.md).[`get`](../interfaces/RuntimeSessionStore.md#get) - -*** - -### put() - -> **put**(`session`): `void` - -Defined in: [sessions.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/sessions.ts#L48) - -#### Parameters - -##### session - -`RuntimeSession` - -#### Returns - -`void` - -#### Implementation of - -[`RuntimeSessionStore`](../interfaces/RuntimeSessionStore.md).[`put`](../interfaces/RuntimeSessionStore.md#put) - -*** - -### appendEvent() - -> **appendEvent**(`sessionId`, `event`): `void` - -Defined in: [sessions.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/sessions.ts#L52) - -#### Parameters - -##### sessionId - -`string` - -##### event - -[`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md) - -#### Returns - -`void` - -#### Implementation of - -[`RuntimeSessionStore`](../interfaces/RuntimeSessionStore.md).[`appendEvent`](../interfaces/RuntimeSessionStore.md#appendevent) - -*** - -### listEvents() - -> **listEvents**(`sessionId`): [`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md)[] - -Defined in: [sessions.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/sessions.ts#L58) - -#### Parameters - -##### sessionId - -`string` - -#### Returns - -[`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md)[] - -#### Implementation of - -[`RuntimeSessionStore`](../interfaces/RuntimeSessionStore.md).[`listEvents`](../interfaces/RuntimeSessionStore.md#listevents) diff --git a/docs/api/index/classes/PlannerError.md b/docs/api/index/classes/PlannerError.md deleted file mode 100644 index 97b7d7d..0000000 --- a/docs/api/index/classes/PlannerError.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / PlannerError - -# Class: PlannerError - -Defined in: [errors.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L111) - -## Stable - -The dynamic-loop planner returned an unusable topology move — the LLM emitted -no parseable envelope, an unknown `kind`, or a structurally-invalid move -(e.g. a fanout with zero tasks). This is a structural failure of the -agent-authored topology, not a config mistake: the planner ran but its output -cannot drive the kernel. Carries `validation` so cross-package handlers can -pattern-match without importing the runtime. Fail loud — never substitute a -default move, or the loop silently runs a topology nobody chose. - -## Extends - -- `AgentEvalError` - -## Constructors - -### Constructor - -> **new PlannerError**(`message`, `options?`): `PlannerError` - -Defined in: [errors.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L112) - -#### Parameters - -##### message - -`string` - -##### options? - -###### cause? - -`unknown` - -#### Returns - -`PlannerError` - -#### Overrides - -`AgentEvalError.constructor` diff --git a/docs/api/index/classes/RuntimeRunStateError.md b/docs/api/index/classes/RuntimeRunStateError.md deleted file mode 100644 index 8cf5b0d..0000000 --- a/docs/api/index/classes/RuntimeRunStateError.md +++ /dev/null @@ -1,46 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeRunStateError - -# Class: RuntimeRunStateError - -Defined in: [errors.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L94) - -## Stable - -A runtime-run lifecycle method was called in an order the state machine does -not allow: `persist()` before `complete()`, `complete()` twice, etc. - -## Extends - -- `AgentEvalError` - -## Constructors - -### Constructor - -> **new RuntimeRunStateError**(`message`, `options?`): `RuntimeRunStateError` - -Defined in: [errors.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/errors.ts#L95) - -#### Parameters - -##### message - -`string` - -##### options? - -###### cause? - -`unknown` - -#### Returns - -`RuntimeRunStateError` - -#### Overrides - -`AgentEvalError.constructor` diff --git a/docs/api/index/classes/SqlConversationJournal.md b/docs/api/index/classes/SqlConversationJournal.md deleted file mode 100644 index 8664d9b..0000000 --- a/docs/api/index/classes/SqlConversationJournal.md +++ /dev/null @@ -1,181 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / SqlConversationJournal - -# Class: SqlConversationJournal - -Defined in: [conversation/journal-sql.ts:119](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L119) - -SQL-backed ConversationJournal. Two tables — runs (one row per runId, holds -start/halt timestamps + halt reason) and turns (one row per committed turn, -payload is the ConversationTurn JSON). Replays the turns table on -`loadRun` and writes append-only per `appendTurn`. - -## Implements - -- [`ConversationJournal`](../interfaces/ConversationJournal.md) - -## Constructors - -### Constructor - -> **new SqlConversationJournal**(`db`, `table?`): `SqlConversationJournal` - -Defined in: [conversation/journal-sql.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L126) - -#### Parameters - -##### db - -[`SqlAdapter`](../interfaces/SqlAdapter.md) - -SQL adapter (D1, postgres, sqlite, libSQL — all work) - -##### table? - -`string` = `'agent_runtime_journal'` - -Table-name prefix; the journal creates `${table}_runs` and - `${table}_turns`. Lets multiple journals share a database - without colliding (e.g. one per product surface). - -#### Returns - -`SqlConversationJournal` - -## Methods - -### migrate() - -> **migrate**(): `Promise`\<`void`\> - -Defined in: [conversation/journal-sql.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L135) - -Create the journal's tables if absent. Idempotent. Call once at deploy -(or at app boot) — running on every request is harmless but adds latency. - -#### Returns - -`Promise`\<`void`\> - -*** - -### loadRun() - -> **loadRun**(`runId`): `Promise`\<[`ConversationJournalEntry`](../interfaces/ConversationJournalEntry.md) \| `undefined`\> - -Defined in: [conversation/journal-sql.ts:141](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L141) - -Load any prior state for `runId`. Returns `undefined` for a fresh run. -Implementations MUST NOT mutate the returned object — the runner clones -before continuing — but the runtime treats absence and emptiness -identically, so a journal with zero turns is equivalent to "fresh." - -#### Parameters - -##### runId - -`string` - -#### Returns - -`Promise`\<[`ConversationJournalEntry`](../interfaces/ConversationJournalEntry.md) \| `undefined`\> - -#### Implementation of - -[`ConversationJournal`](../interfaces/ConversationJournal.md).[`loadRun`](../interfaces/ConversationJournal.md#loadrun) - -*** - -### beginRun() - -> **beginRun**(`runId`, `startedAt`): `Promise`\<`void`\> - -Defined in: [conversation/journal-sql.ts:167](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L167) - -Initialise journal state for a fresh run. Called once per run, before any -`appendTurn`. Idempotent: calling with an existing runId is a no-op if -the entry already exists with the same `startedAt`. - -#### Parameters - -##### runId - -`string` - -##### startedAt - -`string` - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`ConversationJournal`](../interfaces/ConversationJournal.md).[`beginRun`](../interfaces/ConversationJournal.md#beginrun) - -*** - -### appendTurn() - -> **appendTurn**(`runId`, `turn`): `Promise`\<`void`\> - -Defined in: [conversation/journal-sql.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L186) - -Append a committed turn. The runner only calls this AFTER the turn's -backend stream completed and the credit total has been updated, so an -appended turn is observed-committed and never speculative. - -#### Parameters - -##### runId - -`string` - -##### turn - -[`ConversationTurn`](../interfaces/ConversationTurn.md) - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`ConversationJournal`](../interfaces/ConversationJournal.md).[`appendTurn`](../interfaces/ConversationJournal.md#appendturn) - -*** - -### recordHalt() - -> **recordHalt**(`runId`, `halt`, `endedAt`): `Promise`\<`void`\> - -Defined in: [conversation/journal-sql.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L207) - -Record the run's terminal halt reason + end time. Once called, the run -is observed-final; subsequent `loadRun` returns the same halt. - -#### Parameters - -##### runId - -`string` - -##### halt - -[`HaltReason`](../type-aliases/HaltReason.md) - -##### endedAt - -`string` - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`ConversationJournal`](../interfaces/ConversationJournal.md).[`recordHalt`](../interfaces/ConversationJournal.md#recordhalt) diff --git a/docs/api/index/functions/applyRunRecordDefaults.md b/docs/api/index/functions/applyRunRecordDefaults.md deleted file mode 100644 index b446b45..0000000 --- a/docs/api/index/functions/applyRunRecordDefaults.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / applyRunRecordDefaults - -# Function: applyRunRecordDefaults() - -> **applyRunRecordDefaults**(`records`, `scenarioId`, `controlFailureClass`): `RunRecord`[] - -Defined in: [run.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/run.ts#L48) - -Stamp cross-cutting defaults onto adapter-projected RunRecords without - overriding anything the adapter set explicitly: - - `scenarioId` — the run's scenario, when the record omits one. - - `failureClass` — the control layer's failure classification promoted - onto the canonical cross-agent key, but ONLY when it's a real taxonomy - class. This is what lets the substrate aggregate failures across every - agent in one vocabulary instead of per-agent ad-hoc strings. - -## Parameters - -### records - -`RunRecord`[] - -### scenarioId - -`string` - -### controlFailureClass - -`string` \| `undefined` - -## Returns - -`RunRecord`[] diff --git a/docs/api/index/functions/auditLoopRunner.md b/docs/api/index/functions/auditLoopRunner.md deleted file mode 100644 index 8e43c6f..0000000 --- a/docs/api/index/functions/auditLoopRunner.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / auditLoopRunner - -# Function: auditLoopRunner() - -> **auditLoopRunner**\<`TProposal`, `TEdit`\>(`options`): [`DelegatedLoopRunner`](../type-aliases/DelegatedLoopRunner.md)\<[`RunAnalystLoopResult`](../../analyst-loop/interfaces/RunAnalystLoopResult.md)\<`TProposal`, `TEdit`\>\> - -Defined in: [loop-runner.ts:316](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L316) - -**`Experimental`** - -`audit` mode — analyst loop over captured trace/run data. - -## Type Parameters - -### TProposal - -`TProposal` = `unknown` - -### TEdit - -`TEdit` = `unknown` - -## Parameters - -### options - -[`RunAnalystLoopOpts`](../../analyst-loop/interfaces/RunAnalystLoopOpts.md) - -## Returns - -[`DelegatedLoopRunner`](../type-aliases/DelegatedLoopRunner.md)\<[`RunAnalystLoopResult`](../../analyst-loop/interfaces/RunAnalystLoopResult.md)\<`TProposal`, `TEdit`\>\> diff --git a/docs/api/index/functions/buildForwardHeaders.md b/docs/api/index/functions/buildForwardHeaders.md deleted file mode 100644 index fd3e5dd..0000000 --- a/docs/api/index/functions/buildForwardHeaders.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / buildForwardHeaders - -# Function: buildForwardHeaders() - -> **buildForwardHeaders**(`input`): `Record`\<`string`, `string`\> - -Defined in: [conversation/headers.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/headers.ts#L81) - -Build the headers to emit on an outbound participant call, given the -conversation's propagation context. Depth is incremented from the inbound -value; runId / turnId / speaker stamp the current hop; the user's -`Authorization` is preserved verbatim so the downstream gateway bills the -right wallet. - -## Parameters - -### input - -#### inboundDepth - -`number` - -#### forwardedAuthorization? - -`string` - -#### runId - -`string` - -#### turnId - -`string` - -#### parentTurnId? - -`string` - -#### speaker - -`string` - -## Returns - -`Record`\<`string`, `string`\> diff --git a/docs/api/index/functions/buildLoopOtelSpans.md b/docs/api/index/functions/buildLoopOtelSpans.md deleted file mode 100644 index 319ba1c..0000000 --- a/docs/api/index/functions/buildLoopOtelSpans.md +++ /dev/null @@ -1,44 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / buildLoopOtelSpans - -# Function: buildLoopOtelSpans() - -> **buildLoopOtelSpans**(`events`, `traceId`, `rootParentSpanId?`): [`OtelSpan`](../interfaces/OtelSpan.md)[] - -Defined in: [otel-export.ts:232](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L232) - -Build a nested, real-duration OTLP span tree for ONE loop run from its full -ordered `LoopTraceEvent` stream. Unlike `loopEventToOtelSpan` (one flat, -zero-duration span per event), this reconstructs the topology hierarchy a -GenAI trace viewer renders natively: - - loop (invoke_workflow) - └─ loop.round[k] (invoke_workflow) ← tangle.loop.move.{kind,width,rationale} - ├─ loop.iteration[i] (invoke_agent) ← gen_ai.agent.name + usage + verdict + placement - └─ … - -Attributes follow the current GenAI semconv (`gen_ai.*`) where they apply and -a namespaced `tangle.loop.*` / `tangle.cost.usd` extension for topology / -verdict / placement / cost (not yet standardized). Pure: feed it a buffered -per-runId event array (e.g. flushed on `loop.ended`) and export the result. - -## Parameters - -### events - -readonly `object`[] - -### traceId - -`string` - -### rootParentSpanId? - -`string` - -## Returns - -[`OtelSpan`](../interfaces/OtelSpan.md)[] diff --git a/docs/api/index/functions/buildLoopSpanNodes.md b/docs/api/index/functions/buildLoopSpanNodes.md deleted file mode 100644 index f06ffdb..0000000 --- a/docs/api/index/functions/buildLoopSpanNodes.md +++ /dev/null @@ -1,28 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / buildLoopSpanNodes - -# Function: buildLoopSpanNodes() - -> **buildLoopSpanNodes**(`events`): [`LoopSpanNode`](../interfaces/LoopSpanNode.md)[] - -Defined in: [otel-export.ts:263](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L263) - -Sink-neutral core behind [buildLoopOtelSpans](buildLoopOtelSpans.md): reconstruct the -loop → round → branch span tree from one run's ordered `LoopTraceEvent` -stream. Consumed by the OTEL mapper above and by the MCP delegation -journal's compact trace tee — one topology reconstruction, two sinks. -Tolerates partial streams (a run that never reached `loop.ended` closes -at the last observed event's timestamp). - -## Parameters - -### events - -readonly `object`[] - -## Returns - -[`LoopSpanNode`](../interfaces/LoopSpanNode.md)[] diff --git a/docs/api/index/functions/cleanModelId.md b/docs/api/index/functions/cleanModelId.md deleted file mode 100644 index dd9a33e..0000000 --- a/docs/api/index/functions/cleanModelId.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / cleanModelId - -# Function: cleanModelId() - -> **cleanModelId**(`value`): `string` \| `undefined` - -Defined in: [model-resolution.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L66) - -Trim a candidate model id; `undefined` for non-strings and blanks. - -## Parameters - -### value - -`unknown` - -## Returns - -`string` \| `undefined` diff --git a/docs/api/index/functions/coderLoopRunner.md b/docs/api/index/functions/coderLoopRunner.md deleted file mode 100644 index 200a169..0000000 --- a/docs/api/index/functions/coderLoopRunner.md +++ /dev/null @@ -1,26 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / coderLoopRunner - -# Function: coderLoopRunner() - -> **coderLoopRunner**(`options`): [`DelegatedLoopRunner`](../type-aliases/DelegatedLoopRunner.md)\<`CoderOutput`\> - -Defined in: [loop-runner.ts:144](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L144) - -**`Experimental`** - -Build a `code`/`review`-mode runner over the sandbox-session coder delegate. Pass a -`reviewer` to run `review` mode — an approval gate over the validated candidate. - -## Parameters - -### options - -[`CoderLoopRunnerOptions`](../interfaces/CoderLoopRunnerOptions.md) - -## Returns - -[`DelegatedLoopRunner`](../type-aliases/DelegatedLoopRunner.md)\<`CoderOutput`\> diff --git a/docs/api/index/functions/composeRuntimeHooks.md b/docs/api/index/functions/composeRuntimeHooks.md deleted file mode 100644 index 4affc6f..0000000 --- a/docs/api/index/functions/composeRuntimeHooks.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / composeRuntimeHooks - -# Function: composeRuntimeHooks() - -> **composeRuntimeHooks**(...`entries`): [`RuntimeHooks`](../interfaces/RuntimeHooks.md) - -Defined in: [runtime-hooks.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L115) - -Merge several [RuntimeHooks](../interfaces/RuntimeHooks.md) into one. Falsy entries are dropped (so you can -pass `flag && hooks`), and every observer's `onEvent`/`onDecisionPoint` fires for each -event. Use this to attach N observers to a loop instead of a second event bus. - -## Parameters - -### entries - -...(`false` \| [`RuntimeHooks`](../interfaces/RuntimeHooks.md) \| `null` \| `undefined`)[] - -## Returns - -[`RuntimeHooks`](../interfaces/RuntimeHooks.md) diff --git a/docs/api/index/functions/computeBackoff.md b/docs/api/index/functions/computeBackoff.md deleted file mode 100644 index 41302c1..0000000 --- a/docs/api/index/functions/computeBackoff.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / computeBackoff - -# Function: computeBackoff() - -> **computeBackoff**(`spec`, `attempt`): `number` - -Defined in: [conversation/call-policy.ts:166](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L166) - -Compute the delay before the next attempt. Default: 250ms exponential with jitter. - -## Parameters - -### spec - -[`RetryBackoff`](../type-aliases/RetryBackoff.md) \| `undefined` - -### attempt - -`number` - -## Returns - -`number` diff --git a/docs/api/index/functions/createConversationBackend.md b/docs/api/index/functions/createConversationBackend.md deleted file mode 100644 index 25c6657..0000000 --- a/docs/api/index/functions/createConversationBackend.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / createConversationBackend - -# Function: createConversationBackend() - -> **createConversationBackend**(`options`): [`AgentExecutionBackend`](../interfaces/AgentExecutionBackend.md) - -Defined in: [conversation/conversation-backend.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/conversation-backend.ts#L28) - -## Parameters - -### options - -#### conversation - -[`Conversation`](../interfaces/Conversation.md) - -#### kind? - -`string` - -Optional backend kind label. Defaults to `'conversation'`. - -## Returns - -[`AgentExecutionBackend`](../interfaces/AgentExecutionBackend.md) diff --git a/docs/api/index/functions/createIterableBackend.md b/docs/api/index/functions/createIterableBackend.md deleted file mode 100644 index 96862b0..0000000 --- a/docs/api/index/functions/createIterableBackend.md +++ /dev/null @@ -1,47 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / createIterableBackend - -# Function: createIterableBackend() - -> **createIterableBackend**\<`TInput`\>(`options`): [`AgentExecutionBackend`](../interfaces/AgentExecutionBackend.md)\<`TInput`\> - -Defined in: [backends.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/backends.ts#L28) - -## Type Parameters - -### TInput - -`TInput` *extends* [`AgentBackendInput`](../interfaces/AgentBackendInput.md) - -## Parameters - -### options - -#### kind - -`string` - -#### start? - -(`input`, `context`) => `RuntimeSession` \| `Promise`\<`RuntimeSession`\> - -#### resume? - -(`session`, `input`, `context`) => `RuntimeSession` \| `Promise`\<`RuntimeSession`\> - -#### stream - -(`input`, `context`) => `AsyncIterable`\<[`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md)\> - -#### stop? - -(`session`, `reason`) => `void` \| `Promise`\<`void`\> - -## Returns - -[`AgentExecutionBackend`](../interfaces/AgentExecutionBackend.md)\<`TInput`\> - -## Stable diff --git a/docs/api/index/functions/createOpenAICompatibleBackend.md b/docs/api/index/functions/createOpenAICompatibleBackend.md deleted file mode 100644 index c39f6fb..0000000 --- a/docs/api/index/functions/createOpenAICompatibleBackend.md +++ /dev/null @@ -1,100 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / createOpenAICompatibleBackend - -# Function: createOpenAICompatibleBackend() - -> **createOpenAICompatibleBackend**\<`TInput`\>(`options`): [`AgentExecutionBackend`](../interfaces/AgentExecutionBackend.md)\<`TInput`\> - -Defined in: [backends.ts:205](https://github.com/tangle-network/agent-runtime/blob/main/src/backends.ts#L205) - -## Type Parameters - -### TInput - -`TInput` *extends* [`AgentBackendInput`](../interfaces/AgentBackendInput.md) = [`AgentBackendInput`](../interfaces/AgentBackendInput.md) - -## Parameters - -### options - -#### apiKey - -`string` - -#### baseUrl - -`string` - -#### model - -`string` - -#### kind? - -`string` - -#### tools? - -readonly [`OpenAIChatTool`](../interfaces/OpenAIChatTool.md)[] - -OpenAI Chat Completions `tools[]` definitions surfaced to the model on -every request. Omit to send a tool-free request (existing behavior). -The runtime makes no assumption about the dispatcher — calls stream out -as `tool_call` events and the caller is responsible for executing them -and feeding `tool_result` messages back on a follow-up turn. - -#### toolChoice? - -[`OpenAIChatToolChoice`](../type-aliases/OpenAIChatToolChoice.md) - -OpenAI Chat Completions `tool_choice`. Default `undefined` (request -omits the field; provider falls back to its own default — typically -`'auto'`). - -#### fetchImpl? - -(`input`, `init?`) => `Promise`\<`Response`\> - -#### retry? - -`BackendRetryPolicy` - -## Returns - -[`AgentExecutionBackend`](../interfaces/AgentExecutionBackend.md)\<`TInput`\> - -## Stable - -OpenAI-compat streaming backend. Routes `runAgentTaskStream` through any -`POST /chat/completions` endpoint that speaks OpenAI's SSE protocol — -Tangle Router, OpenAI direct, OpenRouter, Groq, DeepSeek, Together. The -router also fronts Anthropic models in Anthropic-native SSE shape; this -backend handles both. - -### Tool calls - -Pass `tools` (and optionally `toolChoice`) to forward an OpenAI Chat -Completions `tools[]` array on every request. Streamed `tool_call` chunks -are buffered until the model finalizes them (either `finish_reason: -'tool_calls'` for OpenAI shape or a `content_block_stop` for Anthropic -`tool_use` blocks proxied through the router), then emitted as a single -`tool_call` RuntimeStreamEvent with the assembled `args`. - -The backend does NOT execute tools — it surfaces calls for the caller's -own dispatcher (typically the product's MCP / sandbox runtime) to fulfill -and feed back as a subsequent `messages` turn. This keeps the transport -thin and lets the agent host own tool dispatch policy. - -### Fail-loud errors - -Non-success HTTP responses (4xx/5xx) and exhausted retry budgets throw -`BackendTransportError` from inside the `stream()` generator. The runtime -catches the throw, yields a `backend_error` with a typed `error` field -(`kind`, `status`, truncated `body`) and a terminal `final` event with -`status: 'failed'` carrying the same detail. Consumers MUST map -`final.error` onto their `RunRecord.error` — silently treating an empty -`finalText` as "agent produced nothing" hides credit exhaustion, auth -failure, and upstream outages. diff --git a/docs/api/index/functions/createOtelExporter.md b/docs/api/index/functions/createOtelExporter.md deleted file mode 100644 index 7f93a45..0000000 --- a/docs/api/index/functions/createOtelExporter.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / createOtelExporter - -# Function: createOtelExporter() - -> **createOtelExporter**(`config?`): [`OtelExporter`](../interfaces/OtelExporter.md) \| `undefined` - -Defined in: [otel-export.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L81) - -Create an OTEL exporter. Returns undefined when no endpoint is configured. - -## Parameters - -### config? - -[`OtelExportConfig`](../interfaces/OtelExportConfig.md) - -## Returns - -[`OtelExporter`](../interfaces/OtelExporter.md) \| `undefined` diff --git a/docs/api/index/functions/createRuntimeEventCollector.md b/docs/api/index/functions/createRuntimeEventCollector.md deleted file mode 100644 index 04f5345..0000000 --- a/docs/api/index/functions/createRuntimeEventCollector.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / createRuntimeEventCollector - -# Function: createRuntimeEventCollector() - -> **createRuntimeEventCollector**\<`TState`, `TAction`, `TActionResult`, `TEval`\>(`options?`): [`RuntimeEventCollector`](../interfaces/RuntimeEventCollector.md)\<`TState`, `TAction`, `TActionResult`, `TEval`\> - -Defined in: [sanitize.ts:530](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L530) - -## Type Parameters - -### TState - -`TState` = `unknown` - -### TAction - -`TAction` = `unknown` - -### TActionResult - -`TActionResult` = `unknown` - -### TEval - -`TEval` *extends* `ControlEvalResult` = `ControlEvalResult` - -## Parameters - -### options? - -[`RuntimeTelemetryOptions`](../interfaces/RuntimeTelemetryOptions.md) = `{}` - -## Returns - -[`RuntimeEventCollector`](../interfaces/RuntimeEventCollector.md)\<`TState`, `TAction`, `TActionResult`, `TEval`\> - -## Stable diff --git a/docs/api/index/functions/createRuntimeStreamEventCollector.md b/docs/api/index/functions/createRuntimeStreamEventCollector.md deleted file mode 100644 index d21b607..0000000 --- a/docs/api/index/functions/createRuntimeStreamEventCollector.md +++ /dev/null @@ -1,30 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / createRuntimeStreamEventCollector - -# Function: createRuntimeStreamEventCollector() - -> **createRuntimeStreamEventCollector**(`options?`): [`RuntimeStreamEventCollector`](../interfaces/RuntimeStreamEventCollector.md) - -Defined in: [sanitize.ts:557](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L557) - -## Parameters - -### options? - -[`RuntimeTelemetryOptions`](../interfaces/RuntimeTelemetryOptions.md) = `{}` - -## Returns - -[`RuntimeStreamEventCollector`](../interfaces/RuntimeStreamEventCollector.md) - -## Stable - -Streaming-event counterpart of `createRuntimeEventCollector`. Pass each -event yielded by `runAgentTaskStream` through `onEvent` and read the -sanitized copies off `events`; the same `RuntimeTelemetryOptions` redaction -flags apply. Kept distinct from `createRuntimeEventCollector` because the -stream and non-stream event shapes overlap on `type` literals — dispatching -on `type` alone would misroute events. diff --git a/docs/api/index/functions/createSandboxPromptBackend.md b/docs/api/index/functions/createSandboxPromptBackend.md deleted file mode 100644 index 1129009..0000000 --- a/docs/api/index/functions/createSandboxPromptBackend.md +++ /dev/null @@ -1,47 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / createSandboxPromptBackend - -# Function: createSandboxPromptBackend() - -> **createSandboxPromptBackend**\<`TBox`, `TInput`\>(`options`): [`AgentExecutionBackend`](../interfaces/AgentExecutionBackend.md)\<`TInput`\> - -Defined in: [backends.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/backends.ts#L39) - -## Type Parameters - -### TBox - -`TBox` - -### TInput - -`TInput` *extends* [`AgentBackendInput`](../interfaces/AgentBackendInput.md) = [`AgentBackendInput`](../interfaces/AgentBackendInput.md) - -## Parameters - -### options - -#### kind? - -`string` - -#### getBox - -#### streamPrompt - -#### mapEvent? - -(`event`, `context`) => [`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md) \| `undefined` - -#### getSessionId? - -(`box`, `input`) => `string` \| `undefined` - -## Returns - -[`AgentExecutionBackend`](../interfaces/AgentExecutionBackend.md)\<`TInput`\> - -## Stable diff --git a/docs/api/index/functions/d1ToSqlAdapter.md b/docs/api/index/functions/d1ToSqlAdapter.md deleted file mode 100644 index 70ec9a4..0000000 --- a/docs/api/index/functions/d1ToSqlAdapter.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / d1ToSqlAdapter - -# Function: d1ToSqlAdapter() - -> **d1ToSqlAdapter**(`db`): [`SqlAdapter`](../interfaces/SqlAdapter.md) - -Defined in: [conversation/journal-sql.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L60) - -Adapt a Cloudflare D1 binding to the SqlAdapter shape. Lives here so D1 -consumers don't have to write the wrapper themselves; the runtime never -imports `@cloudflare/workers-types` directly (peer-style typing). - -## Parameters - -### db - -[`D1DatabaseLike`](../interfaces/D1DatabaseLike.md) - -## Returns - -[`SqlAdapter`](../interfaces/SqlAdapter.md) diff --git a/docs/api/index/functions/decideKnowledgeReadiness.md b/docs/api/index/functions/decideKnowledgeReadiness.md deleted file mode 100644 index c649740..0000000 --- a/docs/api/index/functions/decideKnowledgeReadiness.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / decideKnowledgeReadiness - -# Function: decideKnowledgeReadiness() - -> **decideKnowledgeReadiness**(`report`, `options?`): `KnowledgeReadinessDecision` - -Defined in: [readiness.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/readiness.ts#L22) - -## Parameters - -### report - -`KnowledgeReadinessReport` - -### options? - -#### minimumScore? - -`number` - -## Returns - -`KnowledgeReadinessDecision` - -## Stable diff --git a/docs/api/index/functions/defineConversation.md b/docs/api/index/functions/defineConversation.md deleted file mode 100644 index 8a3077d..0000000 --- a/docs/api/index/functions/defineConversation.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / defineConversation - -# Function: defineConversation() - -> **defineConversation**(`input`): [`Conversation`](../interfaces/Conversation.md) - -Defined in: [conversation/define-conversation.ts:13](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/define-conversation.ts#L13) - -## Parameters - -### input - -#### participants - -[`ConversationParticipant`](../interfaces/ConversationParticipant.md)[] - -#### policy - -[`ConversationPolicy`](../interfaces/ConversationPolicy.md) - -## Returns - -[`Conversation`](../interfaces/Conversation.md) diff --git a/docs/api/index/functions/defineRuntimeHooks.md b/docs/api/index/functions/defineRuntimeHooks.md deleted file mode 100644 index 86e546d..0000000 --- a/docs/api/index/functions/defineRuntimeHooks.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / defineRuntimeHooks - -# Function: defineRuntimeHooks() - -> **defineRuntimeHooks**(`hooks`): [`RuntimeHooks`](../interfaces/RuntimeHooks.md) - -Defined in: [runtime-hooks.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L106) - -Identity helper that types a [RuntimeHooks](../interfaces/RuntimeHooks.md) literal so the fields are inferred. - -## Parameters - -### hooks - -[`RuntimeHooks`](../interfaces/RuntimeHooks.md) - -## Returns - -[`RuntimeHooks`](../interfaces/RuntimeHooks.md) diff --git a/docs/api/index/functions/deriveExecutionId.md b/docs/api/index/functions/deriveExecutionId.md deleted file mode 100644 index a628a85..0000000 --- a/docs/api/index/functions/deriveExecutionId.md +++ /dev/null @@ -1,46 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / deriveExecutionId - -# Function: deriveExecutionId() - -> **deriveExecutionId**(`input`): `string` - -Defined in: [durable/execution-handle.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/execution-handle.ts#L17) - -Derive a stable executionId from the run identity. The same -`(projectId, sessionId, turnIndex)` tuple yields the same id — so a -client retry of the same turn lands on the same substrate execution -and the orchestrator's buffer replays instead of starting a second -prompt. - -Format is readable, not hashed: operators grepping orchestrator logs -for `gtm-agent:thread-abc:3` find the run without translating an -opaque id. Substrate executionIds are not a secrecy boundary. - -Wire integration: - - Sandbox PromptOptions accepts `executionId` and `lastEventId`. - Products pass this id to make cross-process reconnect land on the - same substrate execution instead of spawning a duplicate run. - -## Parameters - -### input - -#### projectId - -`string` - -#### sessionId - -`string` - -#### turnIndex - -`number` - -## Returns - -`string` diff --git a/docs/api/index/functions/exportEvalRuns.md b/docs/api/index/functions/exportEvalRuns.md deleted file mode 100644 index f74e745..0000000 --- a/docs/api/index/functions/exportEvalRuns.md +++ /dev/null @@ -1,30 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / exportEvalRuns - -# Function: exportEvalRuns() - -> **exportEvalRuns**(`events`, `config?`): `Promise`\<[`EvalRunsExportResult`](../interfaces/EvalRunsExportResult.md)\> - -Defined in: [otel-export.ts:582](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L582) - -Ship self-improvement eval-run events to Tangle Intelligence. Unlike the -best-effort span exporter, this RESOLVES with the ingest verdict (accepted / -rejected per event) so a consumer's loop can assert its provenance landed. -Throws only on a missing key or network failure. - -## Parameters - -### events - -[`EvalRunEvent`](../interfaces/EvalRunEvent.md)[] - -### config? - -[`EvalRunsExportConfig`](../interfaces/EvalRunsExportConfig.md) - -## Returns - -`Promise`\<[`EvalRunsExportResult`](../interfaces/EvalRunsExportResult.md)\> diff --git a/docs/api/index/functions/getModels.md b/docs/api/index/functions/getModels.md deleted file mode 100644 index e59ea62..0000000 --- a/docs/api/index/functions/getModels.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / getModels - -# Function: getModels() - -> **getModels**(`routerBaseUrl?`): `Promise`\<[`ModelInfo`](../interfaces/ModelInfo.md)[]\> - -Defined in: [model-resolution.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L54) - -Fetch the model catalog from the router's `/v1/models`. Throws on a non-2xx -response — callers decide whether to fail open (empty catalog) or closed. - -## Parameters - -### routerBaseUrl? - -`string` = `DEFAULT_ROUTER_BASE_URL` - -## Returns - -`Promise`\<[`ModelInfo`](../interfaces/ModelInfo.md)[]\> diff --git a/docs/api/index/functions/handleChatTurn.md b/docs/api/index/functions/handleChatTurn.md deleted file mode 100644 index 1bc0f36..0000000 --- a/docs/api/index/functions/handleChatTurn.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / handleChatTurn - -# Function: handleChatTurn() - -> **handleChatTurn**(`input`): [`ChatTurnResult`](../interfaces/ChatTurnResult.md) - -Defined in: [durable/chat-engine.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L110) - -Run one chat turn. Returns immediately with a `ReadableStream` body; -the turn executes as the body is pulled. Never rejects — backend -failures surface as `error` + `session.run.failed` events. - -## Parameters - -### input - -[`RunChatTurnInput`](../interfaces/RunChatTurnInput.md) - -## Returns - -[`ChatTurnResult`](../interfaces/ChatTurnResult.md) diff --git a/docs/api/index/functions/isDelegatedLoopMode.md b/docs/api/index/functions/isDelegatedLoopMode.md deleted file mode 100644 index 98539ec..0000000 --- a/docs/api/index/functions/isDelegatedLoopMode.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / isDelegatedLoopMode - -# Function: isDelegatedLoopMode() - -> **isDelegatedLoopMode**(`value`): value is "code" \| "review" \| "research" \| "audit" \| "self-improve" - -Defined in: [loop-runner.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L61) - -**`Experimental`** - -Type guard for an untrusted mode string (CLI / config input). - -## Parameters - -### value - -`unknown` - -## Returns - -value is "code" \| "review" \| "research" \| "audit" \| "self-improve" diff --git a/docs/api/index/functions/isDepthExceeded.md b/docs/api/index/functions/isDepthExceeded.md deleted file mode 100644 index 852b556..0000000 --- a/docs/api/index/functions/isDepthExceeded.md +++ /dev/null @@ -1,28 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / isDepthExceeded - -# Function: isDepthExceeded() - -> **isDepthExceeded**(`inboundDepth`, `max?`): `boolean` - -Defined in: [conversation/headers.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/headers.ts#L70) - -Refuse further forwarding when the inbound depth has reached the limit. -Callers (the gateway middleware) translate the boolean to an HTTP 413. - -## Parameters - -### inboundDepth - -`number` - -### max? - -`number` = `DEFAULT_MAX_DEPTH` - -## Returns - -`boolean` diff --git a/docs/api/index/functions/loopEventToOtelSpan.md b/docs/api/index/functions/loopEventToOtelSpan.md deleted file mode 100644 index 705edc0..0000000 --- a/docs/api/index/functions/loopEventToOtelSpan.md +++ /dev/null @@ -1,45 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / loopEventToOtelSpan - -# Function: loopEventToOtelSpan() - -> **loopEventToOtelSpan**(`event`, `traceId`, `parentSpanId?`): [`OtelSpan`](../interfaces/OtelSpan.md) - -Defined in: [otel-export.ts:162](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L162) - -Convert a LoopTraceEvent into an OtelSpan for export. - -## Parameters - -### event - -#### kind - -`string` - -#### runId - -`string` - -#### timestamp - -`number` - -#### payload - -`object` - -### traceId - -`string` - -### parentSpanId? - -`string` - -## Returns - -[`OtelSpan`](../interfaces/OtelSpan.md) diff --git a/docs/api/index/functions/makePerAttemptSignal.md b/docs/api/index/functions/makePerAttemptSignal.md deleted file mode 100644 index 7ec770b..0000000 --- a/docs/api/index/functions/makePerAttemptSignal.md +++ /dev/null @@ -1,53 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / makePerAttemptSignal - -# Function: makePerAttemptSignal() - -> **makePerAttemptSignal**(`parentSignal`, `deadlineMs`): `object` - -Defined in: [conversation/call-policy.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L126) - -Build a per-attempt AbortSignal linked to the parent signal AND fired when -the deadline elapses. The returned `dispose()` MUST be called in a -`finally` (clears the timer, detaches the listener) so we don't leak. - -When the deadline fires, the signal's `reason` is a `DeadlineExceededError` -— callers can detect timeout-vs-cancel by reading `signal.reason` after -the underlying operation throws. - -## Parameters - -### parentSignal - -`AbortSignal` \| `undefined` - -### deadlineMs - -`number` \| `undefined` - -## Returns - -`object` - -### signal - -> **signal**: `AbortSignal` - -### dispose - -> **dispose**: () => `void` - -#### Returns - -`void` - -### getDeadlineError() - -> **getDeadlineError**(): [`DeadlineExceededError`](../classes/DeadlineExceededError.md) \| `undefined` - -#### Returns - -[`DeadlineExceededError`](../classes/DeadlineExceededError.md) \| `undefined` diff --git a/docs/api/index/functions/mcpToolsForRuntimeMcp.md b/docs/api/index/functions/mcpToolsForRuntimeMcp.md deleted file mode 100644 index 14070ce..0000000 --- a/docs/api/index/functions/mcpToolsForRuntimeMcp.md +++ /dev/null @@ -1,22 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / mcpToolsForRuntimeMcp - -# Function: mcpToolsForRuntimeMcp() - -> **mcpToolsForRuntimeMcp**(): [`OpenAIChatTool`](../interfaces/OpenAIChatTool.md)[] - -Defined in: [mcp/openai-tools.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/openai-tools.ts#L74) - -**`Experimental`** - -Returns the 5 delegation tools projected into OpenAI Chat Completions -`tools[]` shape. The order is stable: `delegate_code`, -`delegate_research`, `delegate_feedback`, `delegation_status`, -`delegation_history`. - -## Returns - -[`OpenAIChatTool`](../interfaces/OpenAIChatTool.md)[] diff --git a/docs/api/index/functions/mcpToolsForRuntimeMcpSubset.md b/docs/api/index/functions/mcpToolsForRuntimeMcpSubset.md deleted file mode 100644 index 75420ae..0000000 --- a/docs/api/index/functions/mcpToolsForRuntimeMcpSubset.md +++ /dev/null @@ -1,28 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / mcpToolsForRuntimeMcpSubset - -# Function: mcpToolsForRuntimeMcpSubset() - -> **mcpToolsForRuntimeMcpSubset**(`names`): [`OpenAIChatTool`](../interfaces/OpenAIChatTool.md)[] - -Defined in: [mcp/openai-tools.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/openai-tools.ts#L112) - -**`Experimental`** - -Subset filter — return only the projected tools whose `function.name` -appears in `names`. Useful for curated mounts (e.g. only the queue-bound -delegation tools, omitting `delegate_feedback`). Unknown names are -silently ignored; pass an empty array to get an empty result. - -## Parameters - -### names - -readonly `string`[] - -## Returns - -[`OpenAIChatTool`](../interfaces/OpenAIChatTool.md)[] diff --git a/docs/api/index/functions/notifyRuntimeDecisionPoint.md b/docs/api/index/functions/notifyRuntimeDecisionPoint.md deleted file mode 100644 index fff71b9..0000000 --- a/docs/api/index/functions/notifyRuntimeDecisionPoint.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / notifyRuntimeDecisionPoint - -# Function: notifyRuntimeDecisionPoint() - -> **notifyRuntimeDecisionPoint**(`hooks`, `point`, `context?`): `void` - -Defined in: [runtime-hooks.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L186) - -## Parameters - -### hooks - -[`RuntimeHooks`](../interfaces/RuntimeHooks.md) \| `undefined` - -### point - -[`RuntimeDecisionPoint`](../interfaces/RuntimeDecisionPoint.md) - -### context? - -[`RuntimeHookContext`](../interfaces/RuntimeHookContext.md) = `{}` - -## Returns - -`void` diff --git a/docs/api/index/functions/notifyRuntimeHookEvent.md b/docs/api/index/functions/notifyRuntimeHookEvent.md deleted file mode 100644 index b294ee4..0000000 --- a/docs/api/index/functions/notifyRuntimeHookEvent.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / notifyRuntimeHookEvent - -# Function: notifyRuntimeHookEvent() - -> **notifyRuntimeHookEvent**(`hooks`, `event`, `context?`): `void` - -Defined in: [runtime-hooks.ts:156](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L156) - -## Parameters - -### hooks - -[`RuntimeHooks`](../interfaces/RuntimeHooks.md) \| `undefined` - -### event - -[`RuntimeHookEvent`](../interfaces/RuntimeHookEvent.md) - -### context? - -[`RuntimeHookContext`](../interfaces/RuntimeHookContext.md) = `{}` - -## Returns - -`void` diff --git a/docs/api/index/functions/readDepth.md b/docs/api/index/functions/readDepth.md deleted file mode 100644 index eaa6550..0000000 --- a/docs/api/index/functions/readDepth.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / readDepth - -# Function: readDepth() - -> **readDepth**(`headers`): `number` - -Defined in: [conversation/headers.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/headers.ts#L52) - -Read the depth counter off an inbound request. Missing → 0 (caller is the -origin). Non-integer → throws — silent coercion would let a bad caller -reset depth and bypass the limit. - -## Parameters - -### headers - -`Readonly`\<`Record`\<`string`, `string` \| `string`[] \| `undefined`\>\> - -## Returns - -`number` diff --git a/docs/api/index/functions/readinessServerSentEvent.md b/docs/api/index/functions/readinessServerSentEvent.md deleted file mode 100644 index 864c497..0000000 --- a/docs/api/index/functions/readinessServerSentEvent.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / readinessServerSentEvent - -# Function: readinessServerSentEvent() - -> **readinessServerSentEvent**(`report`, `options?`): `string` - -Defined in: [sse.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/sse.ts#L41) - -## Parameters - -### report - -`KnowledgeReadinessReport` - -### options? - -[`RuntimeTelemetryOptions`](../interfaces/RuntimeTelemetryOptions.md) & `ServerSentEventOptions` = `{}` - -## Returns - -`string` - -## Stable diff --git a/docs/api/index/functions/researchLoopRunner.md b/docs/api/index/functions/researchLoopRunner.md deleted file mode 100644 index df0cec8..0000000 --- a/docs/api/index/functions/researchLoopRunner.md +++ /dev/null @@ -1,30 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / researchLoopRunner - -# Function: researchLoopRunner() - -> **researchLoopRunner**(`o`): [`DelegatedLoopRunner`](../type-aliases/DelegatedLoopRunner.md)\<[`ResearchLoopResult`](../interfaces/ResearchLoopResult.md)\> - -Defined in: [loop-runner.ts:282](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L282) - -**`Experimental`** - -`research` mode — research-in-a-loop with valid-only KB growth. - -Each round: research → gate every candidate (fail-closed; passage MUST be in -the source) → accept the clean ones → re-research the vetoed ones next round, -up to `maxRounds`. Vetoed facts in the final round are RETURNED (escalate, -never silently dropped) so the caller audits vs retries. - -## Parameters - -### o - -[`ResearchLoopRunnerOptions`](../interfaces/ResearchLoopRunnerOptions.md) - -## Returns - -[`DelegatedLoopRunner`](../type-aliases/DelegatedLoopRunner.md)\<[`ResearchLoopResult`](../interfaces/ResearchLoopResult.md)\> diff --git a/docs/api/index/functions/resolveChatModel.md b/docs/api/index/functions/resolveChatModel.md deleted file mode 100644 index cebbd66..0000000 --- a/docs/api/index/functions/resolveChatModel.md +++ /dev/null @@ -1,30 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / resolveChatModel - -# Function: resolveChatModel() - -> **resolveChatModel**(`candidates`, `fallback`): [`ResolvedChatModel`](../interfaces/ResolvedChatModel.md) - -Defined in: [model-resolution.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L89) - -Resolve a chat model by precedence: the first candidate carrying a -non-blank model wins, else `fallback`. The caller owns the precedence -order, so each product keeps its own policy (request → workspace → env, -etc.) while the first-non-blank logic and the telemetry shape stay shared. - -## Parameters - -### candidates - -`ChatModelCandidate`[] - -### fallback - -[`ResolvedChatModel`](../interfaces/ResolvedChatModel.md) - -## Returns - -[`ResolvedChatModel`](../interfaces/ResolvedChatModel.md) diff --git a/docs/api/index/functions/resolveRouterBaseUrl.md b/docs/api/index/functions/resolveRouterBaseUrl.md deleted file mode 100644 index 3a7ba83..0000000 --- a/docs/api/index/functions/resolveRouterBaseUrl.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / resolveRouterBaseUrl - -# Function: resolveRouterBaseUrl() - -> **resolveRouterBaseUrl**(`env?`): `string` - -Defined in: [model-resolution.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L44) - -Resolve the router base URL from env, normalised — no trailing `/v1` or `/`. - -## Parameters - -### env? - -[`RouterEnv`](../interfaces/RouterEnv.md) = `{}` - -## Returns - -`string` diff --git a/docs/api/index/functions/runAgentTask.md b/docs/api/index/functions/runAgentTask.md deleted file mode 100644 index fc32b37..0000000 --- a/docs/api/index/functions/runAgentTask.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / runAgentTask - -# Function: runAgentTask() - -> **runAgentTask**\<`TState`, `TAction`, `TActionResult`, `TEval`\>(`options`): `Promise`\<[`AgentTaskRunResult`](../interfaces/AgentTaskRunResult.md)\<`TState`, `TAction`, `TActionResult`, `TEval`\>\> - -Defined in: [run.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/run.ts#L83) - -## Type Parameters - -### TState - -`TState` - -### TAction - -`TAction` - -### TActionResult - -`TActionResult` - -### TEval - -`TEval` *extends* `ControlEvalResult` = `ControlEvalResult` - -## Parameters - -### options - -`RunAgentTaskOptions`\<`TState`, `TAction`, `TActionResult`, `TEval`\> - -## Returns - -`Promise`\<[`AgentTaskRunResult`](../interfaces/AgentTaskRunResult.md)\<`TState`, `TAction`, `TActionResult`, `TEval`\>\> - -## Stable diff --git a/docs/api/index/functions/runAgentTaskStream.md b/docs/api/index/functions/runAgentTaskStream.md deleted file mode 100644 index b75d8b1..0000000 --- a/docs/api/index/functions/runAgentTaskStream.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / runAgentTaskStream - -# Function: runAgentTaskStream() - -> **runAgentTaskStream**\<`TInput`\>(`options`): `AsyncIterable`\<[`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md)\> - -Defined in: [run.ts:197](https://github.com/tangle-network/agent-runtime/blob/main/src/run.ts#L197) - -## Type Parameters - -### TInput - -`TInput` *extends* [`AgentBackendInput`](../interfaces/AgentBackendInput.md) = [`AgentBackendInput`](../interfaces/AgentBackendInput.md) - -## Parameters - -### options - -`RunAgentTaskStreamOptions`\<`TInput`\> - -## Returns - -`AsyncIterable`\<[`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md)\> - -## Stable diff --git a/docs/api/index/functions/runConversation.md b/docs/api/index/functions/runConversation.md deleted file mode 100644 index f757a3a..0000000 --- a/docs/api/index/functions/runConversation.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / runConversation - -# Function: runConversation() - -> **runConversation**(`conversation`, `options`): `Promise`\<[`ConversationResult`](../interfaces/ConversationResult.md)\> - -Defined in: [conversation/run-conversation.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-conversation.ts#L64) - -## Parameters - -### conversation - -[`Conversation`](../interfaces/Conversation.md) - -### options - -[`RunConversationOptions`](../interfaces/RunConversationOptions.md) - -## Returns - -`Promise`\<[`ConversationResult`](../interfaces/ConversationResult.md)\> diff --git a/docs/api/index/functions/runConversationStream.md b/docs/api/index/functions/runConversationStream.md deleted file mode 100644 index 675db3f..0000000 --- a/docs/api/index/functions/runConversationStream.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / runConversationStream - -# Function: runConversationStream() - -> **runConversationStream**(`conversation`, `options`): `AsyncIterable`\<[`ConversationStreamEvent`](../type-aliases/ConversationStreamEvent.md)\> - -Defined in: [conversation/run-conversation.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-conversation.ts#L82) - -## Parameters - -### conversation - -[`Conversation`](../interfaces/Conversation.md) - -### options - -[`RunConversationOptions`](../interfaces/RunConversationOptions.md) - -## Returns - -`AsyncIterable`\<[`ConversationStreamEvent`](../type-aliases/ConversationStreamEvent.md)\> diff --git a/docs/api/index/functions/runDelegatedLoop.md b/docs/api/index/functions/runDelegatedLoop.md deleted file mode 100644 index f1b3ca7..0000000 --- a/docs/api/index/functions/runDelegatedLoop.md +++ /dev/null @@ -1,42 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / runDelegatedLoop - -# Function: runDelegatedLoop() - -> **runDelegatedLoop**\<`T`\>(`mode`, `registry`, `options?`): `Promise`\<[`DelegatedLoopResult`](../interfaces/DelegatedLoopResult.md)\<`T`\>\> - -Defined in: [loop-runner.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L98) - -**`Experimental`** - -Dispatch a configured loop by mode. Fails loud (throws `ConfigError`) when no -runner is registered for the mode — a routine pointed at an unwired mode is a -config bug, not a silent no-op. A runner that throws is captured as -`{ ok: false }` so unattended runs record the failure rather than crash. - -## Type Parameters - -### T - -`T` = `unknown` - -## Parameters - -### mode - -`"code"` \| `"review"` \| `"research"` \| `"audit"` \| `"self-improve"` - -### registry - -[`DelegatedLoopRegistry`](../type-aliases/DelegatedLoopRegistry.md) - -### options? - -[`RunDelegatedLoopOptions`](../interfaces/RunDelegatedLoopOptions.md) = `{}` - -## Returns - -`Promise`\<[`DelegatedLoopResult`](../interfaces/DelegatedLoopResult.md)\<`T`\>\> diff --git a/docs/api/index/functions/runPersonaConversation.md b/docs/api/index/functions/runPersonaConversation.md deleted file mode 100644 index e740c8c..0000000 --- a/docs/api/index/functions/runPersonaConversation.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / runPersonaConversation - -# Function: runPersonaConversation() - -> **runPersonaConversation**(`opts`): `Promise`\<[`PersonaConversationResult`](../interfaces/PersonaConversationResult.md)\> - -Defined in: [conversation/run-persona.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L130) - -Run one worker profile against one persona as a multi-round conversation. -The persona leads (participant 0): it speaks, the worker answers, repeat, -until `maxTurns`. Returns the persistent transcript + worker-only usage. - -## Parameters - -### opts - -[`RunPersonaConversationOptions`](../interfaces/RunPersonaConversationOptions.md) - -## Returns - -`Promise`\<[`PersonaConversationResult`](../interfaces/PersonaConversationResult.md)\> diff --git a/docs/api/index/functions/runPersonaDispatch.md b/docs/api/index/functions/runPersonaDispatch.md deleted file mode 100644 index b5e8b4e..0000000 --- a/docs/api/index/functions/runPersonaDispatch.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / runPersonaDispatch - -# Function: runPersonaDispatch() - -> **runPersonaDispatch**\<`TScenario`, `TArtifact`\>(`config`): `ProfileDispatchFn`\<`TScenario`, `TArtifact`\> - -Defined in: [conversation/run-persona.ts:216](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L216) - -Wrap [runPersonaConversation](runPersonaConversation.md) as a `ProfileDispatchFn` for -`runProfileMatrix`: the profile axis is the worker-under-test, the scenario -axis is the persona, and the runner is the cell. Meters the worker through -`ctx.cost` so the matrix's backend-integrity guard sees real usage. - -## Type Parameters - -### TScenario - -`TScenario` *extends* `Scenario` - -### TArtifact - -`TArtifact` - -## Parameters - -### config - -[`RunPersonaConfig`](../interfaces/RunPersonaConfig.md)\<`TScenario`, `TArtifact`\> - -## Returns - -`ProfileDispatchFn`\<`TScenario`, `TArtifact`\> diff --git a/docs/api/index/functions/runToolLoop.md b/docs/api/index/functions/runToolLoop.md deleted file mode 100644 index 1f80776..0000000 --- a/docs/api/index/functions/runToolLoop.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / runToolLoop - -# Function: runToolLoop() - -> **runToolLoop**(`opts`): `Promise`\<[`ToolLoopResult`](../interfaces/ToolLoopResult.md)\> - -Defined in: [tool-loop.ts:156](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L156) - -Run the bounded tool loop and return the final text + every executed tool - outcome. Awaitable — callers needing to stream events to a UI use - [streamToolLoop](streamToolLoop.md). - -## Parameters - -### opts - -[`RunToolLoopOptions`](../interfaces/RunToolLoopOptions.md) - -## Returns - -`Promise`\<[`ToolLoopResult`](../interfaces/ToolLoopResult.md)\> diff --git a/docs/api/index/functions/runtimeStreamServerSentEvent.md b/docs/api/index/functions/runtimeStreamServerSentEvent.md deleted file mode 100644 index 2905f76..0000000 --- a/docs/api/index/functions/runtimeStreamServerSentEvent.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / runtimeStreamServerSentEvent - -# Function: runtimeStreamServerSentEvent() - -> **runtimeStreamServerSentEvent**(`event`, `options?`): `string` - -Defined in: [sse.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/sse.ts#L56) - -## Parameters - -### event - -[`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md) - -### options? - -[`RuntimeTelemetryOptions`](../interfaces/RuntimeTelemetryOptions.md) & `ServerSentEventOptions` = `{}` - -## Returns - -`string` - -## Stable diff --git a/docs/api/index/functions/sanitizeAgentRuntimeEvent.md b/docs/api/index/functions/sanitizeAgentRuntimeEvent.md deleted file mode 100644 index 01bc098..0000000 --- a/docs/api/index/functions/sanitizeAgentRuntimeEvent.md +++ /dev/null @@ -1,45 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / sanitizeAgentRuntimeEvent - -# Function: sanitizeAgentRuntimeEvent() - -> **sanitizeAgentRuntimeEvent**\<`TState`, `TAction`, `TActionResult`, `TEval`\>(`event`, `options?`): `Record`\<`string`, `unknown`\> - -Defined in: [sanitize.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L104) - -## Type Parameters - -### TState - -`TState` - -### TAction - -`TAction` - -### TActionResult - -`TActionResult` - -### TEval - -`TEval` *extends* `ControlEvalResult` - -## Parameters - -### event - -[`AgentRuntimeEvent`](../type-aliases/AgentRuntimeEvent.md)\<`TState`, `TAction`, `TActionResult`, `TEval`\> - -### options? - -[`RuntimeTelemetryOptions`](../interfaces/RuntimeTelemetryOptions.md) = `{}` - -## Returns - -`Record`\<`string`, `unknown`\> - -## Stable diff --git a/docs/api/index/functions/sanitizeKnowledgeReadinessReport.md b/docs/api/index/functions/sanitizeKnowledgeReadinessReport.md deleted file mode 100644 index d562286..0000000 --- a/docs/api/index/functions/sanitizeKnowledgeReadinessReport.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / sanitizeKnowledgeReadinessReport - -# Function: sanitizeKnowledgeReadinessReport() - -> **sanitizeKnowledgeReadinessReport**(`report`, `options?`): [`SanitizedKnowledgeReadinessReport`](../interfaces/SanitizedKnowledgeReadinessReport.md) - -Defined in: [sanitize.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L81) - -## Parameters - -### report - -`KnowledgeReadinessReport` - -### options? - -[`RuntimeTelemetryOptions`](../interfaces/RuntimeTelemetryOptions.md) = `{}` - -## Returns - -[`SanitizedKnowledgeReadinessReport`](../interfaces/SanitizedKnowledgeReadinessReport.md) - -## Stable diff --git a/docs/api/index/functions/sanitizeRuntimeStreamEvent.md b/docs/api/index/functions/sanitizeRuntimeStreamEvent.md deleted file mode 100644 index 4c542b1..0000000 --- a/docs/api/index/functions/sanitizeRuntimeStreamEvent.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / sanitizeRuntimeStreamEvent - -# Function: sanitizeRuntimeStreamEvent() - -> **sanitizeRuntimeStreamEvent**(`event`, `options?`): `Record`\<`string`, `unknown`\> - -Defined in: [sanitize.ts:160](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L160) - -## Parameters - -### event - -[`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md) - -### options? - -[`RuntimeTelemetryOptions`](../interfaces/RuntimeTelemetryOptions.md) = `{}` - -## Returns - -`Record`\<`string`, `unknown`\> - -## Stable diff --git a/docs/api/index/functions/selfImproveLoopRunner.md b/docs/api/index/functions/selfImproveLoopRunner.md deleted file mode 100644 index ab712df..0000000 --- a/docs/api/index/functions/selfImproveLoopRunner.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / selfImproveLoopRunner - -# Function: selfImproveLoopRunner() - -> **selfImproveLoopRunner**\<`TScenario`, `TArtifact`\>(`options`): [`DelegatedLoopRunner`](../type-aliases/DelegatedLoopRunner.md)\<`SelfImproveResult`\<`TScenario`, `TArtifact`\>\> - -Defined in: [loop-runner.ts:309](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L309) - -**`Experimental`** - -`self-improve` mode — agent-eval's one-call closed loop (held-out gated). - -## Type Parameters - -### TScenario - -`TScenario` *extends* `Scenario` - -### TArtifact - -`TArtifact` - -## Parameters - -### options - -`SelfImproveOptions`\<`TScenario`, `TArtifact`\> - -## Returns - -[`DelegatedLoopRunner`](../type-aliases/DelegatedLoopRunner.md)\<`SelfImproveResult`\<`TScenario`, `TArtifact`\>\> diff --git a/docs/api/index/functions/sleep.md b/docs/api/index/functions/sleep.md deleted file mode 100644 index 67f5ca9..0000000 --- a/docs/api/index/functions/sleep.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / sleep - -# Function: sleep() - -> **sleep**(`ms`): `Promise`\<`void`\> - -Defined in: [conversation/call-policy.ts:176](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L176) - -## Parameters - -### ms - -`number` - -## Returns - -`Promise`\<`void`\> diff --git a/docs/api/index/functions/slugifySpeaker.md b/docs/api/index/functions/slugifySpeaker.md deleted file mode 100644 index 153f61a..0000000 --- a/docs/api/index/functions/slugifySpeaker.md +++ /dev/null @@ -1,26 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / slugifySpeaker - -# Function: slugifySpeaker() - -> **slugifySpeaker**(`speaker`): `string` - -Defined in: [conversation/turn-id.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/turn-id.ts#L24) - -Reduce a speaker name to ASCII alphanumerics + dashes. Preserves enough -substance to read in a log line; collisions between speakers within a -single Conversation are prevented by `defineConversation`'s -unique-name check, so the slug only needs to be deterministic, not unique. - -## Parameters - -### speaker - -`string` - -## Returns - -`string` diff --git a/docs/api/index/functions/startRuntimeRun.md b/docs/api/index/functions/startRuntimeRun.md deleted file mode 100644 index 76c89e2..0000000 --- a/docs/api/index/functions/startRuntimeRun.md +++ /dev/null @@ -1,26 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / startRuntimeRun - -# Function: startRuntimeRun() - -> **startRuntimeRun**(`options`): [`RuntimeRunHandle`](../interfaces/RuntimeRunHandle.md) - -Defined in: [runtime-run.ts:148](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L148) - -## Parameters - -### options - -`RuntimeRunOptions` - -## Returns - -[`RuntimeRunHandle`](../interfaces/RuntimeRunHandle.md) - -## Stable - -Construct a runtime-run handle. The returned handle is mutable across its -lifetime; consumers should not share it across requests. diff --git a/docs/api/index/functions/streamToolLoop.md b/docs/api/index/functions/streamToolLoop.md deleted file mode 100644 index d049a12..0000000 --- a/docs/api/index/functions/streamToolLoop.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / streamToolLoop - -# Function: streamToolLoop() - -> **streamToolLoop**\<`Raw`\>(`opts`): `AsyncGenerator`\<[`StreamToolLoopYield`](../type-aliases/StreamToolLoopYield.md)\<`Raw`\>, `void`, `unknown`\> - -Defined in: [tool-loop.ts:336](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L336) - -Streaming bounded tool loop: yields each raw turn event (the caller maps + - telemetries + re-emits it) and each executed `tool_result`; emits one - `capped` if it stops for any non-completed reason with calls still pending. - -## Type Parameters - -### Raw - -`Raw` - -## Parameters - -### opts - -[`StreamToolLoopOptions`](../interfaces/StreamToolLoopOptions.md)\<`Raw`\> - -## Returns - -`AsyncGenerator`\<[`StreamToolLoopYield`](../type-aliases/StreamToolLoopYield.md)\<`Raw`\>, `void`, `unknown`\> diff --git a/docs/api/index/functions/turnId.md b/docs/api/index/functions/turnId.md deleted file mode 100644 index 252751f..0000000 --- a/docs/api/index/functions/turnId.md +++ /dev/null @@ -1,40 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / turnId - -# Function: turnId() - -> **turnId**(`runId`, `index`, `speaker`): `string` - -Defined in: [conversation/turn-id.ts:14](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/turn-id.ts#L14) - -## Parameters - -### runId - -`string` - -### index - -`number` - -### speaker - -`string` - -## Returns - -`string` - -## Stable - -Deterministic turn identifier. Stable across retries of the same logical -turn so backends (and any caching gateway in between) can dedupe on it. -A retry triggered by a network blip or deadline timeout MUST produce the -same `turn_id`; only the underlying attempt count differs. - -Shape: `${runId}.t${index}.${speakerSlug}` — readable in logs, sortable by -turn index, attributable to a speaker. Slugify keeps the speaker portion -URL-safe so it can ride in HTTP headers without escaping. diff --git a/docs/api/index/functions/validateChatModelId.md b/docs/api/index/functions/validateChatModelId.md deleted file mode 100644 index 14e759a..0000000 --- a/docs/api/index/functions/validateChatModelId.md +++ /dev/null @@ -1,45 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / validateChatModelId - -# Function: validateChatModelId() - -> **validateChatModelId**(`modelId`, `options?`): `Promise`\<`ChatModelValidation`\> - -Defined in: [model-resolution.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L129) - -Validate a caller-supplied chat-model id. Rejects non-strings, malformed -ids, and ids absent from both the caller's `allowlist` and the live router -catalog. Fails closed: when the catalog cannot be fetched, an unverifiable -id is rejected rather than admitted — a bad model never reaches the agent. - -## Parameters - -### modelId - -`unknown` - -### options? - -#### allowlist? - -`string`[] - -Known-good ids that skip the catalog round trip — e.g. the product's -default model plus any env-configured ids. - -#### routerBaseUrl? - -`string` - -#### loadModels? - -(`routerBaseUrl`) => `Promise`\<[`ModelInfo`](../interfaces/ModelInfo.md)[]\> - -Injectable catalog loader — overridden in tests. - -## Returns - -`Promise`\<`ChatModelValidation`\> diff --git a/docs/api/index/functions/worktreeLoopRunner.md b/docs/api/index/functions/worktreeLoopRunner.md deleted file mode 100644 index b947267..0000000 --- a/docs/api/index/functions/worktreeLoopRunner.md +++ /dev/null @@ -1,32 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / worktreeLoopRunner - -# Function: worktreeLoopRunner() - -> **worktreeLoopRunner**(`options`): [`DelegatedLoopRunner`](../type-aliases/DelegatedLoopRunner.md)\<`WorktreeHarnessResult`\> - -Defined in: [loop-runner.ts:197](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L197) - -**`Experimental`** - -`code` mode on the GENERIC recursive path: author one `AgentProfile` per harness, run them as a -`worktreeFanout` (N `createWorktreeCliExecutor` leaves, each `gateOnDeliverable`) through -`runPersonified` on the keystone Supervisor. This is the local-repo counterpart to -[coderLoopRunner](coderLoopRunner.md) (which drives the in-box harness over a `SandboxClient`): no `runLoop` -driver, no role-coupled delegate — the harness list is the fanout, the gate is `patchDelivered`, -the winner is the shared valid-only selector (NOT `defaultSelectWinner`, whose non-valid fallback -would surface an ungated patch). Equal-k holds by the conserved budget pool. Returns the winning -patch artifact, or throws when no candidate is delivered (fail loud, never a vacuous done). - -## Parameters - -### options - -[`WorktreeLoopRunnerOptions`](../interfaces/WorktreeLoopRunnerOptions.md) - -## Returns - -[`DelegatedLoopRunner`](../type-aliases/DelegatedLoopRunner.md)\<`WorktreeHarnessResult`\> diff --git a/docs/api/index/interfaces/AgentAdapter.md b/docs/api/index/interfaces/AgentAdapter.md deleted file mode 100644 index 8d30a8c..0000000 --- a/docs/api/index/interfaces/AgentAdapter.md +++ /dev/null @@ -1,249 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / AgentAdapter - -# Interface: AgentAdapter\ - -Defined in: [types.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L77) - -## Stable - -## Type Parameters - -### TState - -`TState` - -### TAction - -`TAction` - -### TActionResult - -`TActionResult` - -### TEval - -`TEval` *extends* `ControlEvalResult` = `ControlEvalResult` - -## Methods - -### observe() - -> **observe**(`ctx`): `TState` \| `Promise`\<`TState`\> - -Defined in: [types.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L83) - -#### Parameters - -##### ctx - -###### task - -[`AgentTaskSpec`](AgentTaskSpec.md) - -###### knowledge - -`KnowledgeReadinessReport` - -###### history - -`ControlStep`\<`TState`, `TAction`, `TActionResult`, `TEval`\>[] - -###### abortSignal - -`AbortSignal` - -#### Returns - -`TState` \| `Promise`\<`TState`\> - -*** - -### validate() - -> **validate**(`ctx`): `TEval`[] \| `Promise`\<`TEval`[]\> - -Defined in: [types.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L90) - -#### Parameters - -##### ctx - -###### task - -[`AgentTaskSpec`](AgentTaskSpec.md) - -###### knowledge - -`KnowledgeReadinessReport` - -###### state - -`TState` - -###### history - -`ControlStep`\<`TState`, `TAction`, `TActionResult`, `TEval`\>[] - -###### abortSignal - -`AbortSignal` - -#### Returns - -`TEval`[] \| `Promise`\<`TEval`[]\> - -*** - -### decide() - -> **decide**(`ctx`): `ControlDecision`\<`TAction`\> \| `Promise`\<`ControlDecision`\<`TAction`\>\> - -Defined in: [types.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L98) - -#### Parameters - -##### ctx - -[`AgentTaskContext`](AgentTaskContext.md)\<`TState`, `TAction`, `TActionResult`, `TEval`\> - -#### Returns - -`ControlDecision`\<`TAction`\> \| `Promise`\<`ControlDecision`\<`TAction`\>\> - -*** - -### act() - -> **act**(`action`, `ctx`): `TActionResult` \| `Promise`\<`TActionResult`\> - -Defined in: [types.ts:102](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L102) - -#### Parameters - -##### action - -`TAction` - -##### ctx - -[`AgentTaskContext`](AgentTaskContext.md)\<`TState`, `TAction`, `TActionResult`, `TEval`\> - -#### Returns - -`TActionResult` \| `Promise`\<`TActionResult`\> - -*** - -### shouldStop()? - -> `optional` **shouldStop**(`ctx`): `Promise`\<\{ `stop`: `boolean`; `pass`: `boolean`; `reason`: `string`; `score?`: `number`; \}\> \| \{ `stop`: `boolean`; `pass`: `boolean`; `reason`: `string`; `score?`: `number`; \} - -Defined in: [types.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L107) - -#### Parameters - -##### ctx - -[`AgentTaskContext`](AgentTaskContext.md)\<`TState`, `TAction`, `TActionResult`, `TEval`\> - -#### Returns - -`Promise`\<\{ `stop`: `boolean`; `pass`: `boolean`; `reason`: `string`; `score?`: `number`; \}\> \| \{ `stop`: `boolean`; `pass`: `boolean`; `reason`: `string`; `score?`: `number`; \} - -*** - -### onKnowledgeBlocked()? - -> `optional` **onKnowledgeBlocked**(`ctx`): `ControlDecision`\<`TAction`\> \| `Promise`\<`ControlDecision`\<`TAction`\>\> - -Defined in: [types.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L121) - -#### Parameters - -##### ctx - -###### task - -[`AgentTaskSpec`](AgentTaskSpec.md) - -###### knowledge - -`KnowledgeReadinessReport` - -###### questions - -`UserQuestion`[] - -###### acquisitionPlans - -`DataAcquisitionPlan`[] - -#### Returns - -`ControlDecision`\<`TAction`\> \| `Promise`\<`ControlDecision`\<`TAction`\>\> - -*** - -### getActionCostUsd()? - -> `optional` **getActionCostUsd**(`ctx`): `number` \| `undefined` - -Defined in: [types.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L128) - -#### Parameters - -##### ctx - -###### action - -`TAction` - -###### result - -`TActionResult` - -###### task - -[`AgentTaskSpec`](AgentTaskSpec.md) - -###### state - -`TState` - -###### evals - -`TEval`[] - -###### history - -`ControlStep`\<`TState`, `TAction`, `TActionResult`, `TEval`\>[] - -#### Returns - -`number` \| `undefined` - -*** - -### projectRunRecords()? - -> `optional` **projectRunRecords**(`result`, `task`): `RunRecord`[] - -Defined in: [types.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L137) - -#### Parameters - -##### result - -`ControlRunResult`\<`TState`, `TAction`, `TActionResult`, `TEval`\> - -##### task - -[`AgentTaskSpec`](AgentTaskSpec.md) - -#### Returns - -`RunRecord`[] diff --git a/docs/api/index/interfaces/AgentBackendContext.md b/docs/api/index/interfaces/AgentBackendContext.md deleted file mode 100644 index 0144648..0000000 --- a/docs/api/index/interfaces/AgentBackendContext.md +++ /dev/null @@ -1,91 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / AgentBackendContext - -# Interface: AgentBackendContext - -Defined in: [types.ts:460](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L460) - -## Stable - -## Properties - -### task - -> **task**: [`AgentTaskSpec`](AgentTaskSpec.md) - -Defined in: [types.ts:461](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L461) - -*** - -### knowledge - -> **knowledge**: `KnowledgeReadinessReport` - -Defined in: [types.ts:462](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L462) - -*** - -### session - -> **session**: `RuntimeSession` - -Defined in: [types.ts:463](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L463) - -*** - -### signal? - -> `optional` **signal?**: `AbortSignal` - -Defined in: [types.ts:464](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L464) - -*** - -### runId? - -> `optional` **runId?**: `string` - -Defined in: [types.ts:470](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L470) - -Conversation/run identifier when this call is part of a multi-agent run. -Backends should stamp it into any trace/log emission so cross-participant -events correlate. Absent when the call is a stand-alone `runAgentTask`. - -*** - -### turnId? - -> `optional` **turnId?**: `string` - -Defined in: [types.ts:475](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L475) - -Deterministic turn id for this single call. Stable across retries of the -same logical turn so a caching gateway / idempotent backend can dedupe. - -*** - -### parentTurnId? - -> `optional` **parentTurnId?**: `string` - -Defined in: [types.ts:481](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L481) - -If this call is itself nested inside a higher-order conversation -(recursion via `createConversationBackend`), the enclosing turn's id. -Used for trace stitching across nested orchestration. - -*** - -### propagatedHeaders? - -> `optional` **propagatedHeaders?**: `Readonly`\<`Record`\<`string`, `string`\>\> - -Defined in: [types.ts:488](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L488) - -Headers to forward verbatim to any outbound HTTP the backend issues: -`X-Tangle-Forwarded-Authorization`, `X-Tangle-Forwarded-Depth`, -run/turn correlation. Backends that issue HTTP MUST merge these into -the outbound request; backends that don't issue HTTP may ignore them. diff --git a/docs/api/index/interfaces/AgentBackendInput.md b/docs/api/index/interfaces/AgentBackendInput.md deleted file mode 100644 index fad6a9d..0000000 --- a/docs/api/index/interfaces/AgentBackendInput.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / AgentBackendInput - -# Interface: AgentBackendInput - -Defined in: [types.ts:452](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L452) - -## Stable - -## Properties - -### task - -> **task**: [`AgentTaskSpec`](AgentTaskSpec.md) - -Defined in: [types.ts:453](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L453) - -*** - -### message? - -> `optional` **message?**: `string` - -Defined in: [types.ts:454](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L454) - -*** - -### messages? - -> `optional` **messages?**: `object`[] - -Defined in: [types.ts:455](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L455) - -#### role - -> **role**: `string` - -#### content - -> **content**: `string` - -*** - -### inputs? - -> `optional` **inputs?**: `Record`\<`string`, `unknown`\> - -Defined in: [types.ts:456](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L456) diff --git a/docs/api/index/interfaces/AgentExecutionBackend.md b/docs/api/index/interfaces/AgentExecutionBackend.md deleted file mode 100644 index f02ac68..0000000 --- a/docs/api/index/interfaces/AgentExecutionBackend.md +++ /dev/null @@ -1,117 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / AgentExecutionBackend - -# Interface: AgentExecutionBackend\ - -Defined in: [types.ts:492](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L492) - -## Stable - -## Type Parameters - -### TInput - -`TInput` *extends* [`AgentBackendInput`](AgentBackendInput.md) = [`AgentBackendInput`](AgentBackendInput.md) - -## Properties - -### kind - -> **kind**: `string` - -Defined in: [types.ts:493](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L493) - -## Methods - -### start()? - -> `optional` **start**(`input`, `context`): `RuntimeSession` \| `Promise`\<`RuntimeSession`\> - -Defined in: [types.ts:494](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L494) - -#### Parameters - -##### input - -`TInput` - -##### context - -`Omit`\<[`AgentBackendContext`](AgentBackendContext.md), `"session"`\> & `object` - -#### Returns - -`RuntimeSession` \| `Promise`\<`RuntimeSession`\> - -*** - -### resume()? - -> `optional` **resume**(`session`, `input`, `context`): `RuntimeSession` \| `Promise`\<`RuntimeSession`\> - -Defined in: [types.ts:498](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L498) - -#### Parameters - -##### session - -`RuntimeSession` - -##### input - -`TInput` - -##### context - -`Omit`\<[`AgentBackendContext`](AgentBackendContext.md), `"session"`\> - -#### Returns - -`RuntimeSession` \| `Promise`\<`RuntimeSession`\> - -*** - -### stream() - -> **stream**(`input`, `context`): `AsyncIterable`\<[`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md)\> - -Defined in: [types.ts:503](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L503) - -#### Parameters - -##### input - -`TInput` - -##### context - -[`AgentBackendContext`](AgentBackendContext.md) - -#### Returns - -`AsyncIterable`\<[`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md)\> - -*** - -### stop()? - -> `optional` **stop**(`session`, `reason`): `void` \| `Promise`\<`void`\> - -Defined in: [types.ts:504](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L504) - -#### Parameters - -##### session - -`RuntimeSession` - -##### reason - -`string` - -#### Returns - -`void` \| `Promise`\<`void`\> diff --git a/docs/api/index/interfaces/AgentKnowledgeProvider.md b/docs/api/index/interfaces/AgentKnowledgeProvider.md deleted file mode 100644 index c7d0018..0000000 --- a/docs/api/index/interfaces/AgentKnowledgeProvider.md +++ /dev/null @@ -1,105 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / AgentKnowledgeProvider - -# Interface: AgentKnowledgeProvider - -Defined in: [types.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L38) - -## Stable - -## Methods - -### buildReadiness()? - -> `optional` **buildReadiness**(`task`): `KnowledgeReadinessReport` \| `Promise`\<`KnowledgeReadinessReport`\> - -Defined in: [types.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L39) - -#### Parameters - -##### task - -[`AgentTaskSpec`](AgentTaskSpec.md) - -#### Returns - -`KnowledgeReadinessReport` \| `Promise`\<`KnowledgeReadinessReport`\> - -*** - -### answerQuestions()? - -> `optional` **answerQuestions**(`questions`, `task`): `Record`\<`string`, `string`\> \| `Promise`\<`Record`\<`string`, `string`\>\> - -Defined in: [types.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L40) - -#### Parameters - -##### questions - -`UserQuestion`[] - -##### task - -[`AgentTaskSpec`](AgentTaskSpec.md) - -#### Returns - -`Record`\<`string`, `string`\> \| `Promise`\<`Record`\<`string`, `string`\>\> - -*** - -### executeAcquisitionPlans()? - -> `optional` **executeAcquisitionPlans**(`plans`, `task`): `string`[] \| `Promise`\<`string`[]\> - -Defined in: [types.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L44) - -#### Parameters - -##### plans - -`DataAcquisitionPlan`[] - -##### task - -[`AgentTaskSpec`](AgentTaskSpec.md) - -#### Returns - -`string`[] \| `Promise`\<`string`[]\> - -*** - -### refreshReadiness()? - -> `optional` **refreshReadiness**(`input`): `KnowledgeReadinessReport` \| `Promise`\<`KnowledgeReadinessReport`\> - -Defined in: [types.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L48) - -#### Parameters - -##### input - -###### task - -[`AgentTaskSpec`](AgentTaskSpec.md) - -###### previous - -`KnowledgeReadinessReport` - -###### userAnswers - -`Record`\<`string`, `string`\> - -###### acquiredEvidenceIds - -`string`[] - -#### Returns - -`KnowledgeReadinessReport` \| `Promise`\<`KnowledgeReadinessReport`\> diff --git a/docs/api/index/interfaces/AgentTaskContext.md b/docs/api/index/interfaces/AgentTaskContext.md deleted file mode 100644 index 7f58deb..0000000 --- a/docs/api/index/interfaces/AgentTaskContext.md +++ /dev/null @@ -1,117 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / AgentTaskContext - -# Interface: AgentTaskContext\ - -Defined in: [types.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L57) - -## Stable - -## Type Parameters - -### TState - -`TState` - -### TAction - -`TAction` - -### TActionResult - -`TActionResult` - -### TEval - -`TEval` *extends* `ControlEvalResult` = `ControlEvalResult` - -## Properties - -### task - -> **task**: [`AgentTaskSpec`](AgentTaskSpec.md) - -Defined in: [types.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L63) - -*** - -### knowledge - -> **knowledge**: `KnowledgeReadinessReport` - -Defined in: [types.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L64) - -*** - -### state - -> **state**: `TState` - -Defined in: [types.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L65) - -*** - -### evals - -> **evals**: `TEval`[] - -Defined in: [types.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L66) - -*** - -### history - -> **history**: `ControlStep`\<`TState`, `TAction`, `TActionResult`, `TEval`\>[] - -Defined in: [types.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L67) - -*** - -### budget - -> **budget**: `ControlBudget` - -Defined in: [types.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L68) - -*** - -### stepIndex - -> **stepIndex**: `number` - -Defined in: [types.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L69) - -*** - -### wallMs - -> **wallMs**: `number` - -Defined in: [types.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L70) - -*** - -### spentCostUsd - -> **spentCostUsd**: `number` - -Defined in: [types.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L71) - -*** - -### remainingCostUsd? - -> `optional` **remainingCostUsd?**: `number` - -Defined in: [types.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L72) - -*** - -### abortSignal - -> **abortSignal**: `AbortSignal` - -Defined in: [types.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L73) diff --git a/docs/api/index/interfaces/AgentTaskRunResult.md b/docs/api/index/interfaces/AgentTaskRunResult.md deleted file mode 100644 index fa45513..0000000 --- a/docs/api/index/interfaces/AgentTaskRunResult.md +++ /dev/null @@ -1,101 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / AgentTaskRunResult - -# Interface: AgentTaskRunResult\ - -Defined in: [types.ts:540](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L540) - -## Stable - -## Type Parameters - -### TState - -`TState` - -### TAction - -`TAction` - -### TActionResult - -`TActionResult` - -### TEval - -`TEval` *extends* `ControlEvalResult` = `ControlEvalResult` - -## Properties - -### task - -> **task**: [`AgentTaskSpec`](AgentTaskSpec.md) - -Defined in: [types.ts:546](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L546) - -*** - -### status - -> **status**: [`AgentTaskStatus`](../type-aliases/AgentTaskStatus.md) - -Defined in: [types.ts:547](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L547) - -*** - -### knowledge - -> **knowledge**: `KnowledgeReadinessReport` - -Defined in: [types.ts:548](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L548) - -*** - -### questions - -> **questions**: `UserQuestion`[] - -Defined in: [types.ts:549](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L549) - -*** - -### acquisitionPlans - -> **acquisitionPlans**: `DataAcquisitionPlan`[] - -Defined in: [types.ts:550](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L550) - -*** - -### userAnswers - -> **userAnswers**: `Record`\<`string`, `string`\> - -Defined in: [types.ts:551](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L551) - -*** - -### acquiredEvidenceIds - -> **acquiredEvidenceIds**: `string`[] - -Defined in: [types.ts:552](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L552) - -*** - -### control - -> **control**: `ControlRunResult`\<`TState`, `TAction`, `TActionResult`, `TEval`\> - -Defined in: [types.ts:553](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L553) - -*** - -### runRecords - -> **runRecords**: `RunRecord`[] - -Defined in: [types.ts:554](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L554) diff --git a/docs/api/index/interfaces/AgentTaskSpec.md b/docs/api/index/interfaces/AgentTaskSpec.md deleted file mode 100644 index 1be36d8..0000000 --- a/docs/api/index/interfaces/AgentTaskSpec.md +++ /dev/null @@ -1,69 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / AgentTaskSpec - -# Interface: AgentTaskSpec - -Defined in: [types.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L26) - -## Stable - -## Properties - -### id - -> **id**: `string` - -Defined in: [types.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L27) - -*** - -### intent - -> **intent**: `string` - -Defined in: [types.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L28) - -*** - -### domain? - -> `optional` **domain?**: `string` - -Defined in: [types.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L30) - -Domain is metadata, not an architectural boundary: tax, legal, gtm, creative, blueprint, redteam, etc. - -*** - -### inputs? - -> `optional` **inputs?**: `Record`\<`string`, `unknown`\> - -Defined in: [types.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L31) - -*** - -### requiredKnowledge? - -> `optional` **requiredKnowledge?**: `KnowledgeRequirement`[] - -Defined in: [types.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L32) - -*** - -### budget? - -> `optional` **budget?**: `Partial`\<`ControlBudget`\> - -Defined in: [types.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L33) - -*** - -### metadata? - -> `optional` **metadata?**: `Record`\<`string`, `unknown`\> - -Defined in: [types.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L34) diff --git a/docs/api/index/interfaces/BackendCallPolicy.md b/docs/api/index/interfaces/BackendCallPolicy.md deleted file mode 100644 index 76c12ce..0000000 --- a/docs/api/index/interfaces/BackendCallPolicy.md +++ /dev/null @@ -1,59 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / BackendCallPolicy - -# Interface: BackendCallPolicy - -Defined in: [conversation/call-policy.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L28) - -## Properties - -### perAttemptDeadlineMs? - -> `optional` **perAttemptDeadlineMs?**: `number` - -Defined in: [conversation/call-policy.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L30) - -Per-attempt wall clock limit. Exceeding fires an AbortSignal and is treated as a retryable failure. - -*** - -### maxRetries? - -> `optional` **maxRetries?**: `number` - -Defined in: [conversation/call-policy.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L32) - -Number of retries after the first attempt; total attempts = 1 + maxRetries. Default 0. - -*** - -### retryBackoffMs? - -> `optional` **retryBackoffMs?**: [`RetryBackoff`](../type-aliases/RetryBackoff.md) - -Defined in: [conversation/call-policy.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L34) - -Backoff between attempts. Default 250ms with jitter. - -*** - -### isRetryable? - -> `optional` **isRetryable?**: [`RetryableErrorPredicate`](../type-aliases/RetryableErrorPredicate.md) - -Defined in: [conversation/call-policy.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L36) - -Custom retry classifier. Defaults to [defaultIsRetryable](../variables/defaultIsRetryable.md). - -*** - -### circuitBreaker? - -> `optional` **circuitBreaker?**: [`CircuitBreakerConfig`](CircuitBreakerConfig.md) - -Defined in: [conversation/call-policy.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L38) - -Circuit breaker that opens after N consecutive failures per participant. diff --git a/docs/api/index/interfaces/BackendErrorDetail.md b/docs/api/index/interfaces/BackendErrorDetail.md deleted file mode 100644 index 3918e02..0000000 --- a/docs/api/index/interfaces/BackendErrorDetail.md +++ /dev/null @@ -1,63 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / BackendErrorDetail - -# Interface: BackendErrorDetail - -Defined in: [types.ts:210](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L210) - -## Stable - -Typed transport / backend failure detail. Carried on `backend_error` and -`final` events when the backend's stream throws or the upstream HTTP call -returns a non-success status. Lets consumers (a) distinguish "stream -completed with no text" from "stream never reached the model" and -(b) reconstruct the precise upstream signal (status + truncated body) when -building a `RunRecord.error`. - -`body` is truncated to 2 KiB by the backend so an HTML error page from a -misconfigured proxy never bloats event payloads or logs. Consumers needing -the full body should inspect the underlying `BackendTransportError.body` -via a custom `mapEvent` or backend wrapper. - -## Properties - -### kind - -> **kind**: `"transport"` \| `"backend"` - -Defined in: [types.ts:216](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L216) - -`'transport'` — upstream HTTP / network failure with optional status code. -`'backend'` — the backend's `stream()` generator threw for a non-transport -reason (e.g. a custom adapter error, sandbox crash). - -*** - -### message - -> **message**: `string` - -Defined in: [types.ts:217](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L217) - -*** - -### status? - -> `optional` **status?**: `number` - -Defined in: [types.ts:219](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L219) - -Upstream HTTP status when known. `0` for connection / abort errors. - -*** - -### body? - -> `optional` **body?**: `string` - -Defined in: [types.ts:221](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L221) - -Truncated response body (≤2 KiB). Diagnostic only — never machine-parsed. diff --git a/docs/api/index/interfaces/ChatStreamEvent.md b/docs/api/index/interfaces/ChatStreamEvent.md deleted file mode 100644 index 37672c8..0000000 --- a/docs/api/index/interfaces/ChatStreamEvent.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ChatStreamEvent - -# Interface: ChatStreamEvent - -Defined in: [durable/chat-engine.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L28) - -The NDJSON line protocol every product chat client already speaks. - -## Properties - -### type - -> **type**: `string` - -Defined in: [durable/chat-engine.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L29) - -*** - -### data? - -> `optional` **data?**: `Record`\<`string`, `unknown`\> - -Defined in: [durable/chat-engine.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L30) diff --git a/docs/api/index/interfaces/ChatTurnHooks.md b/docs/api/index/interfaces/ChatTurnHooks.md deleted file mode 100644 index ca012d2..0000000 --- a/docs/api/index/interfaces/ChatTurnHooks.md +++ /dev/null @@ -1,150 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ChatTurnHooks - -# Interface: ChatTurnHooks - -Defined in: [durable/chat-engine.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L52) - -Turn-lifecycle helpers for `@tangle-network/agent-runtime`. - -Execution state — long-running execution, reconnect, replay, dedup — -lives in the substrate (`@tangle-network/sandbox` + orchestrator). -agent-runtime owns: - - - `handleChatTurn` — framework-neutral turn lifecycle: NDJSON framing, - `session.run.*` envelope, persist / post-process / trace-flush - hook ordering. - - `deriveExecutionId` — convention helper for the stable id products - persist so a retry of the same turn lands on the same execution. - -## Methods - -### produce() - -> **produce**(): [`ChatTurnProducer`](ChatTurnProducer.md) - -Defined in: [durable/chat-engine.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L55) - -Build the backend stream. The engine forwards events verbatim and - reads `finalText()` once the stream drains. - -#### Returns - -[`ChatTurnProducer`](ChatTurnProducer.md) - -*** - -### persistAssistantMessage() - -> **persistAssistantMessage**(`input`): `Promise`\<`void`\> - -Defined in: [durable/chat-engine.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L58) - -Persist the assistant message to the product's own store. Called - once, after drain, with the assembled (transform-applied) text. - -#### Parameters - -##### input - -###### identity - -[`ChatTurnIdentity`](ChatTurnIdentity.md) - -###### finalText - -`string` - -#### Returns - -`Promise`\<`void`\> - -*** - -### onTurnComplete()? - -> `optional` **onTurnComplete**(`input`): `Promise`\<`void`\> - -Defined in: [durable/chat-engine.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L62) - -Optional post-processing (proposals, citations, credit metering …). - Errors are swallowed + logged — post-process must never fail a turn - that already streamed successfully. - -#### Parameters - -##### input - -###### identity - -[`ChatTurnIdentity`](ChatTurnIdentity.md) - -###### finalText - -`string` - -#### Returns - -`Promise`\<`void`\> - -*** - -### onEvent()? - -> `optional` **onEvent**(`event`): `void` \| `Promise`\<`void`\> - -Defined in: [durable/chat-engine.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L66) - -Optional per-event side channel (e.g. DO broadcast). Runs for every - emitted event, lifecycle envelope included. Errors swallowed — a - broadcast failure must not break the chat stream. - -#### Parameters - -##### event - -[`ChatStreamEvent`](ChatStreamEvent.md) - -#### Returns - -`void` \| `Promise`\<`void`\> - -*** - -### transformFinalText()? - -> `optional` **transformFinalText**(`text`): `string` \| `Promise`\<`string`\> - -Defined in: [durable/chat-engine.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L70) - -Optional pre-persist transform of the final text (e.g. PII - redaction). Affects only what is persisted; the live stream is - never altered. - -#### Parameters - -##### text - -`string` - -#### Returns - -`string` \| `Promise`\<`string`\> - -*** - -### traceFlush()? - -> `optional` **traceFlush**(): `Promise`\<`void`\> - -Defined in: [durable/chat-engine.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L73) - -Optional trace flush — resolves when OTLP export completes. Handed - to `waitUntil` so the worker isolate stays alive for the POST. - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/index/interfaces/ChatTurnIdentity.md b/docs/api/index/interfaces/ChatTurnIdentity.md deleted file mode 100644 index 1fb2288..0000000 --- a/docs/api/index/interfaces/ChatTurnIdentity.md +++ /dev/null @@ -1,48 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ChatTurnIdentity - -# Interface: ChatTurnIdentity - -Defined in: [durable/chat-engine.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L35) - -Identity of a chat turn. `tenantId` is the workspace id for workspace- - scoped products and the user id for session-scoped products. - -## Properties - -### tenantId - -> **tenantId**: `string` - -Defined in: [durable/chat-engine.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L36) - -*** - -### sessionId - -> **sessionId**: `string` - -Defined in: [durable/chat-engine.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L38) - -Thread / session id. - -*** - -### userId - -> **userId**: `string` - -Defined in: [durable/chat-engine.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L39) - -*** - -### turnIndex - -> **turnIndex**: `number` - -Defined in: [durable/chat-engine.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L41) - -Monotonic 0-based turn index within the session. diff --git a/docs/api/index/interfaces/ChatTurnProducer.md b/docs/api/index/interfaces/ChatTurnProducer.md deleted file mode 100644 index ff342df..0000000 --- a/docs/api/index/interfaces/ChatTurnProducer.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ChatTurnProducer - -# Interface: ChatTurnProducer\ - -Defined in: [durable/chat-engine.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L45) - -The live side of a turn — what the product's `produce` hook returns. - -## Type Parameters - -### TEvent - -`TEvent` *extends* [`ChatStreamEvent`](ChatStreamEvent.md) = [`ChatStreamEvent`](ChatStreamEvent.md) - -## Properties - -### stream - -> **stream**: `AsyncGenerator`\<`TEvent`, `void`, `unknown`\> - -Defined in: [durable/chat-engine.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L47) - -The turn's event stream. Forwarded verbatim to the caller. - -## Methods - -### finalText() - -> **finalText**(): `string` - -Defined in: [durable/chat-engine.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L49) - -The turn's final assistant text. Read once, after `stream` drains. - -#### Returns - -`string` diff --git a/docs/api/index/interfaces/ChatTurnResult.md b/docs/api/index/interfaces/ChatTurnResult.md deleted file mode 100644 index cb19c84..0000000 --- a/docs/api/index/interfaces/ChatTurnResult.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ChatTurnResult - -# Interface: ChatTurnResult - -Defined in: [durable/chat-engine.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L87) - -Turn-lifecycle helpers for `@tangle-network/agent-runtime`. - -Execution state — long-running execution, reconnect, replay, dedup — -lives in the substrate (`@tangle-network/sandbox` + orchestrator). -agent-runtime owns: - - - `handleChatTurn` — framework-neutral turn lifecycle: NDJSON framing, - `session.run.*` envelope, persist / post-process / trace-flush - hook ordering. - - `deriveExecutionId` — convention helper for the stable id products - persist so a retry of the same turn lands on the same execution. - -## Properties - -### body - -> **body**: `ReadableStream`\<`Uint8Array`\<`ArrayBufferLike`\>\> - -Defined in: [durable/chat-engine.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L89) - -NDJSON body — return this as the platform `Response` body. - -*** - -### contentType - -> **contentType**: `"application/x-ndjson"` - -Defined in: [durable/chat-engine.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L91) - -Content type for the response. diff --git a/docs/api/index/interfaces/CircuitBreakerConfig.md b/docs/api/index/interfaces/CircuitBreakerConfig.md deleted file mode 100644 index e88ed4c..0000000 --- a/docs/api/index/interfaces/CircuitBreakerConfig.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / CircuitBreakerConfig - -# Interface: CircuitBreakerConfig - -Defined in: [conversation/call-policy.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L23) - -Circuit-breaker tuning. `failuresToOpen` consecutive failures opens it; closed only after `cooldownMs`. - -## Properties - -### failuresToOpen - -> **failuresToOpen**: `number` - -Defined in: [conversation/call-policy.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L24) - -*** - -### cooldownMs - -> **cooldownMs**: `number` - -Defined in: [conversation/call-policy.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L25) diff --git a/docs/api/index/interfaces/CoderLoopRunnerOptions.md b/docs/api/index/interfaces/CoderLoopRunnerOptions.md deleted file mode 100644 index d4c0019..0000000 --- a/docs/api/index/interfaces/CoderLoopRunnerOptions.md +++ /dev/null @@ -1,71 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / CoderLoopRunnerOptions - -# Interface: CoderLoopRunnerOptions - -Defined in: [loop-runner.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L128) - -**`Experimental`** - -Options for the default `code`/`review` runner. - -## Properties - -### sandboxClient - -> **sandboxClient**: [`SandboxClient`](../../runtime/interfaces/SandboxClient.md) - -Defined in: [loop-runner.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L129) - -**`Experimental`** - -*** - -### args - -> **args**: [`DelegateCodeArgs`](../../mcp/interfaces/DelegateCodeArgs.md) - -Defined in: [loop-runner.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L131) - -**`Experimental`** - -What to build — the delegate args (goal, repoRoot, variants, config, …). - -*** - -### reviewer? - -> `optional` **reviewer?**: [`CoderReviewer`](../../mcp/type-aliases/CoderReviewer.md) - -Defined in: [loop-runner.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L133) - -**`Experimental`** - -Adversarial reviewer. Pass one to run `review` mode (an approval gate over the candidate). - -*** - -### winnerSelection? - -> `optional` **winnerSelection?**: [`DetachedWinnerSelection`](../../mcp/type-aliases/DetachedWinnerSelection.md) - -Defined in: [loop-runner.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L135) - -**`Experimental`** - -Winner-selection strategy. Default `highest-score`. - -*** - -### fanoutHarnesses? - -> `optional` **fanoutHarnesses?**: `string`[] - -Defined in: [loop-runner.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L137) - -**`Experimental`** - -Harnesses for `variants > 1` fanout. diff --git a/docs/api/index/interfaces/Conversation.md b/docs/api/index/interfaces/Conversation.md deleted file mode 100644 index 9b585a5..0000000 --- a/docs/api/index/interfaces/Conversation.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / Conversation - -# Interface: Conversation - -Defined in: [conversation/types.ts:169](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L169) - -## Stable - -## Properties - -### participants - -> **participants**: readonly [`ConversationParticipant`](ConversationParticipant.md)[] - -Defined in: [conversation/types.ts:170](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L170) - -*** - -### policy - -> **policy**: [`ConversationPolicy`](ConversationPolicy.md) - -Defined in: [conversation/types.ts:171](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L171) diff --git a/docs/api/index/interfaces/ConversationDriveState.md b/docs/api/index/interfaces/ConversationDriveState.md deleted file mode 100644 index dfa7f8b..0000000 --- a/docs/api/index/interfaces/ConversationDriveState.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ConversationDriveState - -# Interface: ConversationDriveState - -Defined in: [conversation/types.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L76) - -## Stable - -## Extended by - -- [`HaltContext`](HaltContext.md) - -## Properties - -### transcript - -> **transcript**: readonly [`ConversationTurn`](ConversationTurn.md)[] - -Defined in: [conversation/types.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L77) - -*** - -### turnIndex - -> **turnIndex**: `number` - -Defined in: [conversation/types.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L78) - -*** - -### spentCreditsCents - -> **spentCreditsCents**: `number` - -Defined in: [conversation/types.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L79) diff --git a/docs/api/index/interfaces/ConversationJournal.md b/docs/api/index/interfaces/ConversationJournal.md deleted file mode 100644 index 50a4b72..0000000 --- a/docs/api/index/interfaces/ConversationJournal.md +++ /dev/null @@ -1,113 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ConversationJournal - -# Interface: ConversationJournal - -Defined in: [conversation/journal.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L28) - -## Methods - -### loadRun() - -> **loadRun**(`runId`): `Promise`\<[`ConversationJournalEntry`](ConversationJournalEntry.md) \| `undefined`\> - -Defined in: [conversation/journal.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L35) - -Load any prior state for `runId`. Returns `undefined` for a fresh run. -Implementations MUST NOT mutate the returned object — the runner clones -before continuing — but the runtime treats absence and emptiness -identically, so a journal with zero turns is equivalent to "fresh." - -#### Parameters - -##### runId - -`string` - -#### Returns - -`Promise`\<[`ConversationJournalEntry`](ConversationJournalEntry.md) \| `undefined`\> - -*** - -### beginRun() - -> **beginRun**(`runId`, `startedAt`): `Promise`\<`void`\> - -Defined in: [conversation/journal.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L42) - -Initialise journal state for a fresh run. Called once per run, before any -`appendTurn`. Idempotent: calling with an existing runId is a no-op if -the entry already exists with the same `startedAt`. - -#### Parameters - -##### runId - -`string` - -##### startedAt - -`string` - -#### Returns - -`Promise`\<`void`\> - -*** - -### appendTurn() - -> **appendTurn**(`runId`, `turn`): `Promise`\<`void`\> - -Defined in: [conversation/journal.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L49) - -Append a committed turn. The runner only calls this AFTER the turn's -backend stream completed and the credit total has been updated, so an -appended turn is observed-committed and never speculative. - -#### Parameters - -##### runId - -`string` - -##### turn - -[`ConversationTurn`](ConversationTurn.md) - -#### Returns - -`Promise`\<`void`\> - -*** - -### recordHalt() - -> **recordHalt**(`runId`, `halt`, `endedAt`): `Promise`\<`void`\> - -Defined in: [conversation/journal.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L55) - -Record the run's terminal halt reason + end time. Once called, the run -is observed-final; subsequent `loadRun` returns the same halt. - -#### Parameters - -##### runId - -`string` - -##### halt - -[`HaltReason`](../type-aliases/HaltReason.md) - -##### endedAt - -`string` - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/index/interfaces/ConversationJournalEntry.md b/docs/api/index/interfaces/ConversationJournalEntry.md deleted file mode 100644 index aa46823..0000000 --- a/docs/api/index/interfaces/ConversationJournalEntry.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ConversationJournalEntry - -# Interface: ConversationJournalEntry - -Defined in: [conversation/journal.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L19) - -## Properties - -### runId - -> **runId**: `string` - -Defined in: [conversation/journal.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L20) - -*** - -### startedAt - -> **startedAt**: `string` - -Defined in: [conversation/journal.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L21) - -*** - -### halted? - -> `optional` **halted?**: [`HaltReason`](../type-aliases/HaltReason.md) - -Defined in: [conversation/journal.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L23) - -Set when the run reaches a terminal state. - -*** - -### endedAt? - -> `optional` **endedAt?**: `string` - -Defined in: [conversation/journal.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L24) - -*** - -### turns - -> **turns**: [`ConversationTurn`](ConversationTurn.md)[] - -Defined in: [conversation/journal.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal.ts#L25) diff --git a/docs/api/index/interfaces/ConversationParticipant.md b/docs/api/index/interfaces/ConversationParticipant.md deleted file mode 100644 index 0f6b1aa..0000000 --- a/docs/api/index/interfaces/ConversationParticipant.md +++ /dev/null @@ -1,84 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ConversationParticipant - -# Interface: ConversationParticipant - -Defined in: [conversation/types.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L20) - -## Stable - -## Properties - -### name - -> **name**: `string` - -Defined in: [conversation/types.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L25) - -Stable name used as the speaker label in the transcript. Must be unique -within a `Conversation`. - -*** - -### backend - -> **backend**: [`AgentExecutionBackend`](AgentExecutionBackend.md) - -Defined in: [conversation/types.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L32) - -Backend that runs this participant's turn. Reuses the existing -`AgentExecutionBackend` contract from `runAgentTaskStream`, so any -registered backend (iterable, sandbox, OpenAI-compatible) works without -adaptation. - -*** - -### label? - -> `optional` **label?**: `string` - -Defined in: [conversation/types.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L37) - -Optional human label for traces / dashboards. Distinct from `name`, which -is the addressing key. - -*** - -### callPolicy? - -> `optional` **callPolicy?**: [`BackendCallPolicy`](BackendCallPolicy.md) - -Defined in: [conversation/types.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L43) - -Optional per-participant override of the conversation's default -`callPolicy`. Use to tighten the deadline or raise the retry budget for -a participant known to be slow or flaky. - -*** - -### authSource? - -> `optional` **authSource?**: [`AuthSource`](../type-aliases/AuthSource.md) - -Defined in: [conversation/types.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L63) - -Who pays for THIS participant's outbound calls? - -- `'forward-user'` (default) — propagate the caller's - `X-Tangle-Forwarded-Authorization` so the downstream gateway bills the - original user. Right for pass-through agents that aggregate/route - without taking economic risk. -- `'agent-owned'` — DO NOT forward the user's auth; the participant's - backend uses its own credentials (typically a sk-tan-AGENT or x402 - wallet baked into the backend at construction). Downstream charges - land on the agent, not the user. Right for resold-bundle agents that - take margin between their inbound price and their sub-agent costs. -- `(state) => AuthSource` — per-turn / per-condition decision, e.g. base - sub-services are agent-owned but premium add-ons forward the user. - -The agent's own credentials live on the backend (set at construction -time, e.g. `createOpenAICompatibleBackend({ apiKey })`); this field is -purely about *whether to also forward the user's identity downstream*. diff --git a/docs/api/index/interfaces/ConversationPolicy.md b/docs/api/index/interfaces/ConversationPolicy.md deleted file mode 100644 index f937a17..0000000 --- a/docs/api/index/interfaces/ConversationPolicy.md +++ /dev/null @@ -1,68 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ConversationPolicy - -# Interface: ConversationPolicy - -Defined in: [conversation/types.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L107) - -## Stable - -## Properties - -### maxTurns - -> **maxTurns**: `number` - -Defined in: [conversation/types.ts:109](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L109) - -Hard cap on speaker-turns. Each call into a participant's backend counts as 1. - -*** - -### maxCreditsCents? - -> `optional` **maxCreditsCents?**: `number` - -Defined in: [conversation/types.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L116) - -Hard cap on aggregate credit spend across all participants, in cents. -Computed by summing `llm_call.costUsd` from every participant's stream. -Unset (`undefined`) means no credit ceiling — the run is bounded only by -`maxTurns` and `haltOn`. - -*** - -### turnOrder? - -> `optional` **turnOrder?**: [`TurnOrder`](../type-aliases/TurnOrder.md) - -Defined in: [conversation/types.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L121) - -Speaker selection. Defaults to `'alternate'` for two-participant -conversations and `'round-robin'` for any other arity. - -*** - -### haltOn? - -> `optional` **haltOn?**: [`HaltPredicate`](../type-aliases/HaltPredicate.md) - -Defined in: [conversation/types.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L126) - -Optional convergence / content-based halt. Called after every turn ends; -returning truthy stops the loop with `{ kind: 'predicate', ... }`. - -*** - -### defaultCallPolicy? - -> `optional` **defaultCallPolicy?**: [`BackendCallPolicy`](BackendCallPolicy.md) - -Defined in: [conversation/types.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L132) - -Default per-turn resilience policy applied to every participant call -(deadline, retries, circuit breaker). Individual participants may -override via `ConversationParticipant.callPolicy`. diff --git a/docs/api/index/interfaces/ConversationResult.md b/docs/api/index/interfaces/ConversationResult.md deleted file mode 100644 index 2432232..0000000 --- a/docs/api/index/interfaces/ConversationResult.md +++ /dev/null @@ -1,75 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ConversationResult - -# Interface: ConversationResult - -Defined in: [conversation/types.ts:224](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L224) - -## Stable - -## Properties - -### runId - -> **runId**: `string` - -Defined in: [conversation/types.ts:225](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L225) - -*** - -### transcript - -> **transcript**: [`ConversationTurn`](ConversationTurn.md)[] - -Defined in: [conversation/types.ts:226](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L226) - -*** - -### turns - -> **turns**: `number` - -Defined in: [conversation/types.ts:227](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L227) - -*** - -### spentCreditsCents - -> **spentCreditsCents**: `number` - -Defined in: [conversation/types.ts:228](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L228) - -*** - -### halted - -> **halted**: [`HaltReason`](../type-aliases/HaltReason.md) - -Defined in: [conversation/types.ts:229](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L229) - -*** - -### durationMs - -> **durationMs**: `number` - -Defined in: [conversation/types.ts:230](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L230) - -*** - -### startedAt - -> **startedAt**: `string` - -Defined in: [conversation/types.ts:231](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L231) - -*** - -### endedAt - -> **endedAt**: `string` - -Defined in: [conversation/types.ts:232](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L232) diff --git a/docs/api/index/interfaces/ConversationTurn.md b/docs/api/index/interfaces/ConversationTurn.md deleted file mode 100644 index b0bb987..0000000 --- a/docs/api/index/interfaces/ConversationTurn.md +++ /dev/null @@ -1,107 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ConversationTurn - -# Interface: ConversationTurn - -Defined in: [conversation/types.ts:136](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L136) - -## Stable - -## Properties - -### index - -> **index**: `number` - -Defined in: [conversation/types.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L137) - -*** - -### speaker - -> **speaker**: `string` - -Defined in: [conversation/types.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L138) - -*** - -### turnId - -> **turnId**: `string` - -Defined in: [conversation/types.ts:144](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L144) - -Deterministic turn identifier — stable across retries of the same logical -turn so caching gateways and trace backends can dedupe. Shape: -`${runId}.t${index}.${speakerSlug}`. - -*** - -### text - -> **text**: `string` - -Defined in: [conversation/types.ts:145](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L145) - -*** - -### usage? - -> `optional` **usage?**: `object` - -Defined in: [conversation/types.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L151) - -Aggregated backend usage for this turn alone. Populated from any -`llm_call` stream events the backend emitted; `undefined` when the -backend reports no usage. - -#### tokensIn? - -> `optional` **tokensIn?**: `number` - -#### tokensOut? - -> `optional` **tokensOut?**: `number` - -#### costUsd? - -> `optional` **costUsd?**: `number` - -#### latencyMs? - -> `optional` **latencyMs?**: `number` - -#### model? - -> `optional` **model?**: `string` - -*** - -### attempts - -> **attempts**: `number` - -Defined in: [conversation/types.ts:163](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L163) - -Number of attempts that ran before this turn committed. `1` is the -common case; higher means the call policy retried after transient -failures. - -*** - -### startedAt - -> **startedAt**: `string` - -Defined in: [conversation/types.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L164) - -*** - -### endedAt - -> **endedAt**: `string` - -Defined in: [conversation/types.ts:165](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L165) diff --git a/docs/api/index/interfaces/D1DatabaseLike.md b/docs/api/index/interfaces/D1DatabaseLike.md deleted file mode 100644 index 25591e9..0000000 --- a/docs/api/index/interfaces/D1DatabaseLike.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / D1DatabaseLike - -# Interface: D1DatabaseLike - -Defined in: [conversation/journal-sql.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L83) - -Structural type matching the surface of `D1Database` we depend on, so the -SDK never imports `@cloudflare/workers-types`. Consumers pass their real -`D1Database` from `env.DB` and TS structural compatibility lines it up. - -## Methods - -### prepare() - -> **prepare**(`sql`): [`D1StmtLike`](D1StmtLike.md) - -Defined in: [conversation/journal-sql.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L84) - -#### Parameters - -##### sql - -`string` - -#### Returns - -[`D1StmtLike`](D1StmtLike.md) diff --git a/docs/api/index/interfaces/D1StmtLike.md b/docs/api/index/interfaces/D1StmtLike.md deleted file mode 100644 index 0ea7f27..0000000 --- a/docs/api/index/interfaces/D1StmtLike.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / D1StmtLike - -# Interface: D1StmtLike - -Defined in: [conversation/journal-sql.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L86) - -## Methods - -### bind() - -> **bind**(...`params`): `D1StmtLike` - -Defined in: [conversation/journal-sql.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L87) - -#### Parameters - -##### params - -...`unknown`[] - -#### Returns - -`D1StmtLike` - -*** - -### run() - -> **run**(): `Promise`\<`unknown`\> - -Defined in: [conversation/journal-sql.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L88) - -#### Returns - -`Promise`\<`unknown`\> - -*** - -### all() - -> **all**\<`TRow`\>(): `Promise`\<\{ `results?`: `TRow`[]; \}\> - -Defined in: [conversation/journal-sql.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L89) - -#### Type Parameters - -##### TRow - -`TRow` = `unknown` - -#### Returns - -`Promise`\<\{ `results?`: `TRow`[]; \}\> diff --git a/docs/api/index/interfaces/DelegatedLoopResult.md b/docs/api/index/interfaces/DelegatedLoopResult.md deleted file mode 100644 index 55aa1fc..0000000 --- a/docs/api/index/interfaces/DelegatedLoopResult.md +++ /dev/null @@ -1,70 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / DelegatedLoopResult - -# Interface: DelegatedLoopResult\ - -Defined in: [loop-runner.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L75) - -**`Experimental`** - -Uniform result — never throws from a registered runner; a - thrown engine becomes `{ ok: false, error }` so a routine can record + move on. - -## Type Parameters - -### T - -`T` = `unknown` - -## Properties - -### mode - -> **mode**: `"code"` \| `"review"` \| `"research"` \| `"audit"` \| `"self-improve"` - -Defined in: [loop-runner.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L76) - -**`Experimental`** - -*** - -### ok - -> **ok**: `boolean` - -Defined in: [loop-runner.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L77) - -**`Experimental`** - -*** - -### output? - -> `optional` **output?**: `T` - -Defined in: [loop-runner.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L78) - -**`Experimental`** - -*** - -### error? - -> `optional` **error?**: `string` - -Defined in: [loop-runner.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L79) - -**`Experimental`** - -*** - -### durationMs - -> **durationMs**: `number` - -Defined in: [loop-runner.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L80) - -**`Experimental`** diff --git a/docs/api/index/interfaces/EvalRunEvent.md b/docs/api/index/interfaces/EvalRunEvent.md deleted file mode 100644 index c73f9ad..0000000 --- a/docs/api/index/interfaces/EvalRunEvent.md +++ /dev/null @@ -1,107 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / EvalRunEvent - -# Interface: EvalRunEvent - -Defined in: [otel-export.ts:536](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L536) - -## Properties - -### runId - -> **runId**: `string` - -Defined in: [otel-export.ts:537](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L537) - -*** - -### runDir - -> **runDir**: `string` - -Defined in: [otel-export.ts:538](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L538) - -*** - -### timestamp - -> **timestamp**: `string` - -Defined in: [otel-export.ts:540](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L540) - -ISO timestamp. - -*** - -### status - -> **status**: `"started"` \| `"baseline-complete"` \| `"generation-complete"` \| `"gate-decided"` \| `"finished"` \| `"errored"` - -Defined in: [otel-export.ts:541](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L541) - -*** - -### labels? - -> `optional` **labels?**: `Record`\<`string`, `string`\> - -Defined in: [otel-export.ts:548](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L548) - -*** - -### baseline? - -> `optional` **baseline?**: [`EvalRunGeneration`](EvalRunGeneration.md) - -Defined in: [otel-export.ts:549](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L549) - -*** - -### generations? - -> `optional` **generations?**: [`EvalRunGeneration`](EvalRunGeneration.md)[] - -Defined in: [otel-export.ts:550](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L550) - -*** - -### gateDecision? - -> `optional` **gateDecision?**: `"ship"` \| `"hold"` \| `"need_more_work"` \| `"model_ceiling"` \| `"arch_ceiling"` - -Defined in: [otel-export.ts:551](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L551) - -*** - -### holdoutLift? - -> `optional` **holdoutLift?**: `number` - -Defined in: [otel-export.ts:552](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L552) - -*** - -### totalCostUsd - -> **totalCostUsd**: `number` - -Defined in: [otel-export.ts:553](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L553) - -*** - -### totalDurationMs - -> **totalDurationMs**: `number` - -Defined in: [otel-export.ts:554](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L554) - -*** - -### errorMessage? - -> `optional` **errorMessage?**: `string` - -Defined in: [otel-export.ts:555](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L555) diff --git a/docs/api/index/interfaces/EvalRunGeneration.md b/docs/api/index/interfaces/EvalRunGeneration.md deleted file mode 100644 index 6d3e1a7..0000000 --- a/docs/api/index/interfaces/EvalRunGeneration.md +++ /dev/null @@ -1,75 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / EvalRunGeneration - -# Interface: EvalRunGeneration - -Defined in: [otel-export.ts:521](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L521) - -## Properties - -### index - -> **index**: `number` - -Defined in: [otel-export.ts:523](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L523) - -0-based ordinal of this generation within the run (required by ingest). - -*** - -### surfaceHash - -> **surfaceHash**: `string` - -Defined in: [otel-export.ts:525](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L525) - -Identity of the proposed surface change (content-addressed hash). - -*** - -### surface? - -> `optional` **surface?**: `unknown` - -Defined in: [otel-export.ts:527](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L527) - -Arbitrary provenance for this generation (rationale, evidence, source). - -*** - -### cells? - -> `optional` **cells?**: `unknown`[] - -Defined in: [otel-export.ts:529](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L529) - -Per-scenario results; empty until the generation is measured. - -*** - -### compositeMean - -> **compositeMean**: `number` - -Defined in: [otel-export.ts:531](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L531) - -Mean composite score (0 when unmeasured — pair with labels.measured). - -*** - -### costUsd - -> **costUsd**: `number` - -Defined in: [otel-export.ts:532](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L532) - -*** - -### durationMs - -> **durationMs**: `number` - -Defined in: [otel-export.ts:533](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L533) diff --git a/docs/api/index/interfaces/EvalRunsExportConfig.md b/docs/api/index/interfaces/EvalRunsExportConfig.md deleted file mode 100644 index cb14ba0..0000000 --- a/docs/api/index/interfaces/EvalRunsExportConfig.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / EvalRunsExportConfig - -# Interface: EvalRunsExportConfig - -Defined in: [otel-export.ts:558](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L558) - -## Properties - -### apiKey? - -> `optional` **apiKey?**: `string` - -Defined in: [otel-export.ts:560](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L560) - -Bearer key — tenant is resolved server-side from it. Reads TANGLE_API_KEY. - -*** - -### base? - -> `optional` **base?**: `string` - -Defined in: [otel-export.ts:562](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L562) - -Intelligence base. Reads INTELLIGENCE_BASE env, else prod. - -*** - -### idempotencyKey? - -> `optional` **idempotencyKey?**: `string` - -Defined in: [otel-export.ts:564](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L564) - -Idempotency-Key header (e.g. the runId) — safe retries + upsert. diff --git a/docs/api/index/interfaces/EvalRunsExportResult.md b/docs/api/index/interfaces/EvalRunsExportResult.md deleted file mode 100644 index 1f98159..0000000 --- a/docs/api/index/interfaces/EvalRunsExportResult.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / EvalRunsExportResult - -# Interface: EvalRunsExportResult - -Defined in: [otel-export.ts:567](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L567) - -## Properties - -### ok - -> **ok**: `boolean` - -Defined in: [otel-export.ts:568](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L568) - -*** - -### status - -> **status**: `number` - -Defined in: [otel-export.ts:569](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L569) - -*** - -### accepted - -> **accepted**: `number` - -Defined in: [otel-export.ts:570](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L570) - -*** - -### rejected - -> **rejected**: `object`[] - -Defined in: [otel-export.ts:571](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L571) - -#### index - -> **index**: `number` - -#### reason - -> **reason**: `string` diff --git a/docs/api/index/interfaces/HaltContext.md b/docs/api/index/interfaces/HaltContext.md deleted file mode 100644 index eeea260..0000000 --- a/docs/api/index/interfaces/HaltContext.md +++ /dev/null @@ -1,59 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / HaltContext - -# Interface: HaltContext - -Defined in: [conversation/types.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L83) - -## Stable - -## Extends - -- [`ConversationDriveState`](ConversationDriveState.md) - -## Properties - -### transcript - -> **transcript**: readonly [`ConversationTurn`](ConversationTurn.md)[] - -Defined in: [conversation/types.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L77) - -#### Inherited from - -[`ConversationDriveState`](ConversationDriveState.md).[`transcript`](ConversationDriveState.md#transcript) - -*** - -### turnIndex - -> **turnIndex**: `number` - -Defined in: [conversation/types.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L78) - -#### Inherited from - -[`ConversationDriveState`](ConversationDriveState.md).[`turnIndex`](ConversationDriveState.md#turnindex) - -*** - -### spentCreditsCents - -> **spentCreditsCents**: `number` - -Defined in: [conversation/types.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L79) - -#### Inherited from - -[`ConversationDriveState`](ConversationDriveState.md).[`spentCreditsCents`](ConversationDriveState.md#spentcreditscents) - -*** - -### lastTurn - -> **lastTurn**: [`ConversationTurn`](ConversationTurn.md) - -Defined in: [conversation/types.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L84) diff --git a/docs/api/index/interfaces/HaltSignal.md b/docs/api/index/interfaces/HaltSignal.md deleted file mode 100644 index 6ef4167..0000000 --- a/docs/api/index/interfaces/HaltSignal.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / HaltSignal - -# Interface: HaltSignal - -Defined in: [conversation/types.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L88) - -## Stable - -## Properties - -### halted - -> **halted**: `true` - -Defined in: [conversation/types.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L89) - -*** - -### reason - -> **reason**: `string` - -Defined in: [conversation/types.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L90) diff --git a/docs/api/index/interfaces/LoopSpanNode.md b/docs/api/index/interfaces/LoopSpanNode.md deleted file mode 100644 index e43a596..0000000 --- a/docs/api/index/interfaces/LoopSpanNode.md +++ /dev/null @@ -1,84 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / LoopSpanNode - -# Interface: LoopSpanNode - -Defined in: [otel-export.ts:202](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L202) - -Sink-neutral node in a reconstructed loop span tree. The root node's -`parentSpanId` is `undefined` — sinks decide how to parent it (the OTEL -mapper attaches the inherited delegation span; the delegation journal -leaves it as the tree root). - -## Properties - -### spanId - -> **spanId**: `string` - -Defined in: [otel-export.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L203) - -*** - -### parentSpanId? - -> `optional` **parentSpanId?**: `string` - -Defined in: [otel-export.ts:204](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L204) - -*** - -### name - -> **name**: `string` - -Defined in: [otel-export.ts:206](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L206) - -`'loop'` | `'loop.round'` | `'loop.iteration'`. - -*** - -### kind - -> **kind**: `"loop"` \| `"round"` \| `"branch"` - -Defined in: [otel-export.ts:208](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L208) - -Topology level: loop root, plan round, or iteration branch. - -*** - -### startMs - -> **startMs**: `number` - -Defined in: [otel-export.ts:209](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L209) - -*** - -### endMs - -> **endMs**: `number` - -Defined in: [otel-export.ts:210](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L210) - -*** - -### attrs - -> **attrs**: `Record`\<`string`, `string` \| `number` \| `boolean`\> - -Defined in: [otel-export.ts:211](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L211) - -*** - -### error - -> **error**: `boolean` - -Defined in: [otel-export.ts:213](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L213) - -True when the iteration carried an error — maps to OTEL status code 2. diff --git a/docs/api/index/interfaces/ModelInfo.md b/docs/api/index/interfaces/ModelInfo.md deleted file mode 100644 index b6a1c34..0000000 --- a/docs/api/index/interfaces/ModelInfo.md +++ /dev/null @@ -1,74 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ModelInfo - -# Interface: ModelInfo - -Defined in: [model-resolution.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L21) - -A model entry as returned by the Tangle Router `/v1/models` endpoint. -Intentionally minimal — only the fields resolution + validation read. - -## Properties - -### id - -> **id**: `string` - -Defined in: [model-resolution.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L22) - -*** - -### name? - -> `optional` **name?**: `string` - -Defined in: [model-resolution.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L23) - -*** - -### description? - -> `optional` **description?**: `string` - -Defined in: [model-resolution.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L24) - -*** - -### provider? - -> `optional` **provider?**: `string` - -Defined in: [model-resolution.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L26) - -Provider slug, when the router exposes it (`provider` or `_provider`). - -*** - -### \_provider? - -> `optional` **\_provider?**: `string` - -Defined in: [model-resolution.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L27) - -*** - -### architecture? - -> `optional` **architecture?**: `object` - -Defined in: [model-resolution.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L28) - -#### modality? - -> `optional` **modality?**: `string` - -#### input\_modalities? - -> `optional` **input\_modalities?**: `string`[] - -#### output\_modalities? - -> `optional` **output\_modalities?**: `string`[] diff --git a/docs/api/index/interfaces/OpenAIChatTool.md b/docs/api/index/interfaces/OpenAIChatTool.md deleted file mode 100644 index af19135..0000000 --- a/docs/api/index/interfaces/OpenAIChatTool.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / OpenAIChatTool - -# Interface: OpenAIChatTool - -Defined in: [types.ts:239](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L239) - -## Stable - -OpenAI Chat Completions tool descriptor. The shape mirrors the -`/v1/chat/completions` `tools[]` parameter so callers can pass tool -definitions through `createOpenAICompatibleBackend({ tools })` without any -runtime translation. The router proxies this shape verbatim to Anthropic -(translated server-side), DeepSeek, Groq, OpenAI, and Gemini — every model -that the eval surface targets. - -Callers that build their tool list from MCP servers should run a one-shot -MCP `tools/list` at config time and project the result into this shape. The -runtime intentionally does NOT depend on `@modelcontextprotocol/sdk` — -keeping the backend transport thin lets domain repos own MCP plumbing. - -## Properties - -### type - -> **type**: `"function"` - -Defined in: [types.ts:240](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L240) - -*** - -### function - -> **function**: `object` - -Defined in: [types.ts:241](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L241) - -#### name - -> **name**: `string` - -#### description? - -> `optional` **description?**: `string` - -#### parameters? - -> `optional` **parameters?**: `Record`\<`string`, `unknown`\> diff --git a/docs/api/index/interfaces/OtelAttribute.md b/docs/api/index/interfaces/OtelAttribute.md deleted file mode 100644 index 0d33e7e..0000000 --- a/docs/api/index/interfaces/OtelAttribute.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / OtelAttribute - -# Interface: OtelAttribute - -Defined in: [otel-export.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L48) - -## Properties - -### key - -> **key**: `string` - -Defined in: [otel-export.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L49) - -*** - -### value - -> **value**: `object` - -Defined in: [otel-export.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L50) - -#### stringValue? - -> `optional` **stringValue?**: `string` - -#### intValue? - -> `optional` **intValue?**: `string` - -#### doubleValue? - -> `optional` **doubleValue?**: `number` - -#### boolValue? - -> `optional` **boolValue?**: `boolean` diff --git a/docs/api/index/interfaces/OtelExportConfig.md b/docs/api/index/interfaces/OtelExportConfig.md deleted file mode 100644 index e48a560..0000000 --- a/docs/api/index/interfaces/OtelExportConfig.md +++ /dev/null @@ -1,78 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / OtelExportConfig - -# Interface: OtelExportConfig - -Defined in: [otel-export.ts:12](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L12) - -OTEL span exporter — streams LoopTraceEvents to an OTLP/HTTP collector. - -Reads OTEL_EXPORTER_OTLP_ENDPOINT + OTEL_EXPORTER_OTLP_HEADERS from env -when no explicit config is given. Keeps the runtime dep-free from -@opentelemetry/sdk-trace-base — minimal OTLP/JSON serializer. - -The exporter accepts both raw OtelSpan objects and LoopTraceEvents -(which get converted to OTLP spans automatically). - -## Properties - -### endpoint? - -> `optional` **endpoint?**: `string` - -Defined in: [otel-export.ts:14](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L14) - -OTLP endpoint. Reads OTEL_EXPORTER_OTLP_ENDPOINT env by default. - -*** - -### headers? - -> `optional` **headers?**: `Record`\<`string`, `string`\> - -Defined in: [otel-export.ts:16](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L16) - -OTLP headers. Reads OTEL_EXPORTER_OTLP_HEADERS env by default. - -*** - -### batchSize? - -> `optional` **batchSize?**: `number` - -Defined in: [otel-export.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L18) - -Batch size before flush. Default 64. - -*** - -### flushIntervalMs? - -> `optional` **flushIntervalMs?**: `number` - -Defined in: [otel-export.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L20) - -Flush interval ms. Default 5000. - -*** - -### resourceAttributes? - -> `optional` **resourceAttributes?**: `Record`\<`string`, `string` \| `number` \| `boolean`\> - -Defined in: [otel-export.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L22) - -Resource attributes stamped on every export. - -*** - -### serviceName? - -> `optional` **serviceName?**: `string` - -Defined in: [otel-export.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L24) - -Service name. Default 'agent-runtime'. diff --git a/docs/api/index/interfaces/OtelExporter.md b/docs/api/index/interfaces/OtelExporter.md deleted file mode 100644 index 69ef1be..0000000 --- a/docs/api/index/interfaces/OtelExporter.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / OtelExporter - -# Interface: OtelExporter - -Defined in: [otel-export.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L27) - -## Methods - -### exportSpan() - -> **exportSpan**(`span`): `void` - -Defined in: [otel-export.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L29) - -Export a span. - -#### Parameters - -##### span - -[`OtelSpan`](OtelSpan.md) - -#### Returns - -`void` - -*** - -### flush() - -> **flush**(): `Promise`\<`void`\> - -Defined in: [otel-export.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L31) - -Force flush pending spans. - -#### Returns - -`Promise`\<`void`\> - -*** - -### shutdown() - -> **shutdown**(): `Promise`\<`void`\> - -Defined in: [otel-export.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L33) - -Shutdown cleanly. - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/index/interfaces/OtelSpan.md b/docs/api/index/interfaces/OtelSpan.md deleted file mode 100644 index 6c51e75..0000000 --- a/docs/api/index/interfaces/OtelSpan.md +++ /dev/null @@ -1,89 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / OtelSpan - -# Interface: OtelSpan - -Defined in: [otel-export.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L36) - -## Properties - -### traceId - -> **traceId**: `string` - -Defined in: [otel-export.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L37) - -*** - -### spanId - -> **spanId**: `string` - -Defined in: [otel-export.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L38) - -*** - -### parentSpanId? - -> `optional` **parentSpanId?**: `string` - -Defined in: [otel-export.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L39) - -*** - -### name - -> **name**: `string` - -Defined in: [otel-export.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L40) - -*** - -### kind? - -> `optional` **kind?**: `number` - -Defined in: [otel-export.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L41) - -*** - -### startTimeUnixNano - -> **startTimeUnixNano**: `string` - -Defined in: [otel-export.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L42) - -*** - -### endTimeUnixNano - -> **endTimeUnixNano**: `string` - -Defined in: [otel-export.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L43) - -*** - -### attributes? - -> `optional` **attributes?**: [`OtelAttribute`](OtelAttribute.md)[] - -Defined in: [otel-export.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L44) - -*** - -### status? - -> `optional` **status?**: `object` - -Defined in: [otel-export.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L45) - -#### code - -> **code**: `number` - -#### message? - -> `optional` **message?**: `string` diff --git a/docs/api/index/interfaces/PersonaConversationResult.md b/docs/api/index/interfaces/PersonaConversationResult.md deleted file mode 100644 index e06844d..0000000 --- a/docs/api/index/interfaces/PersonaConversationResult.md +++ /dev/null @@ -1,59 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / PersonaConversationResult - -# Interface: PersonaConversationResult - -Defined in: [conversation/run-persona.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L56) - -## Properties - -### transcript - -> **transcript**: [`ConversationTurn`](ConversationTurn.md)[] - -Defined in: [conversation/run-persona.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L57) - -*** - -### turns - -> **turns**: `number` - -Defined in: [conversation/run-persona.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L58) - -*** - -### halted - -> **halted**: [`HaltReason`](../type-aliases/HaltReason.md) - -Defined in: [conversation/run-persona.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L59) - -*** - -### costUsd - -> **costUsd**: `number` - -Defined in: [conversation/run-persona.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L61) - -Worker-only spend (the side under test). - -*** - -### tokensIn - -> **tokensIn**: `number` - -Defined in: [conversation/run-persona.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L62) - -*** - -### tokensOut - -> **tokensOut**: `number` - -Defined in: [conversation/run-persona.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L63) diff --git a/docs/api/index/interfaces/ResearchLoopResult.md b/docs/api/index/interfaces/ResearchLoopResult.md deleted file mode 100644 index 47b86f7..0000000 --- a/docs/api/index/interfaces/ResearchLoopResult.md +++ /dev/null @@ -1,47 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ResearchLoopResult - -# Interface: ResearchLoopResult - -Defined in: [loop-runner.ts:250](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L250) - -**`Experimental`** - -## Properties - -### accepted - -> **accepted**: [`FactCandidate`](../../mcp/interfaces/FactCandidate.md)[] - -Defined in: [loop-runner.ts:252](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L252) - -**`Experimental`** - -Facts that passed the fail-closed gate — safe to write to the KB. - -*** - -### vetoed - -> **vetoed**: [`VetoedFact`](VetoedFact.md)[] - -Defined in: [loop-runner.ts:254](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L254) - -**`Experimental`** - -Facts the gate vetoed in the final round — escalate, do not silently drop. - -*** - -### rounds - -> **rounds**: `number` - -Defined in: [loop-runner.ts:256](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L256) - -**`Experimental`** - -Research rounds actually run. diff --git a/docs/api/index/interfaces/ResearchLoopRunnerOptions.md b/docs/api/index/interfaces/ResearchLoopRunnerOptions.md deleted file mode 100644 index 6360418..0000000 --- a/docs/api/index/interfaces/ResearchLoopRunnerOptions.md +++ /dev/null @@ -1,66 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ResearchLoopRunnerOptions - -# Interface: ResearchLoopRunnerOptions - -Defined in: [loop-runner.ts:260](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L260) - -**`Experimental`** - -Options for the default `research` runner. - -## Properties - -### research - -> **research**: (`round`, `vetoed`) => `Promise`\<[`FactCandidate`](../../mcp/interfaces/FactCandidate.md)[]\> - -Defined in: [loop-runner.ts:267](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L267) - -**`Experimental`** - -The research engine (the consumer's web/doc searcher + extractor). Called -each round with the prior round's vetoes so it can re-research the gaps. -Returns fact candidates carrying their grounding (`verbatimPassage` + -`sourceText`). - -#### Parameters - -##### round - -`number` - -##### vetoed - -[`VetoedFact`](VetoedFact.md)[] - -#### Returns - -`Promise`\<[`FactCandidate`](../../mcp/interfaces/FactCandidate.md)[]\> - -*** - -### gate? - -> `optional` **gate?**: [`CreateKbGateOptions`](../../mcp/interfaces/CreateKbGateOptions.md) - -Defined in: [loop-runner.ts:269](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L269) - -**`Experimental`** - -Gate config (extra judges, self-artifact kinds, …). The floor is always on. - -*** - -### maxRounds? - -> `optional` **maxRounds?**: `number` - -Defined in: [loop-runner.ts:271](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L271) - -**`Experimental`** - -Max research rounds (correct-on-veto remediation). Default 1. diff --git a/docs/api/index/interfaces/ResolvedChatModel.md b/docs/api/index/interfaces/ResolvedChatModel.md deleted file mode 100644 index 840ab83..0000000 --- a/docs/api/index/interfaces/ResolvedChatModel.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ResolvedChatModel - -# Interface: ResolvedChatModel - -Defined in: [model-resolution.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L78) - -## Properties - -### source - -> **source**: `string` - -Defined in: [model-resolution.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L79) - -*** - -### model - -> **model**: `string` - -Defined in: [model-resolution.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L80) diff --git a/docs/api/index/interfaces/RouterEnv.md b/docs/api/index/interfaces/RouterEnv.md deleted file mode 100644 index 50519de..0000000 --- a/docs/api/index/interfaces/RouterEnv.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RouterEnv - -# Interface: RouterEnv - -Defined in: [model-resolution.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L36) - -Env keys the router base URL is resolved from. - -## Properties - -### TANGLE\_ROUTER\_URL? - -> `optional` **TANGLE\_ROUTER\_URL?**: `string` - -Defined in: [model-resolution.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L37) - -*** - -### TANGLE\_ROUTER\_BASE\_URL? - -> `optional` **TANGLE\_ROUTER\_BASE\_URL?**: `string` - -Defined in: [model-resolution.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L38) diff --git a/docs/api/index/interfaces/RunChatTurnInput.md b/docs/api/index/interfaces/RunChatTurnInput.md deleted file mode 100644 index 17038d4..0000000 --- a/docs/api/index/interfaces/RunChatTurnInput.md +++ /dev/null @@ -1,83 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RunChatTurnInput - -# Interface: RunChatTurnInput - -Defined in: [durable/chat-engine.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L76) - -Turn-lifecycle helpers for `@tangle-network/agent-runtime`. - -Execution state — long-running execution, reconnect, replay, dedup — -lives in the substrate (`@tangle-network/sandbox` + orchestrator). -agent-runtime owns: - - - `handleChatTurn` — framework-neutral turn lifecycle: NDJSON framing, - `session.run.*` envelope, persist / post-process / trace-flush - hook ordering. - - `deriveExecutionId` — convention helper for the stable id products - persist so a retry of the same turn lands on the same execution. - -## Properties - -### identity - -> **identity**: [`ChatTurnIdentity`](ChatTurnIdentity.md) - -Defined in: [durable/chat-engine.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L77) - -*** - -### hooks - -> **hooks**: [`ChatTurnHooks`](ChatTurnHooks.md) - -Defined in: [durable/chat-engine.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L78) - -*** - -### waitUntil? - -> `optional` **waitUntil?**: (`p`) => `void` - -Defined in: [durable/chat-engine.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L81) - -Worker liveness hook. When omitted, trace flush is awaited inline - before the stream closes. - -#### Parameters - -##### p - -`Promise`\<`unknown`\> - -#### Returns - -`void` - -*** - -### log? - -> `optional` **log?**: (`message`, `meta?`) => `void` - -Defined in: [durable/chat-engine.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/chat-engine.ts#L84) - -Structured logger for swallowed hook errors. Defaults to - `console.error` so failures surface without product wiring. - -#### Parameters - -##### message - -`string` - -##### meta? - -`Record`\<`string`, `unknown`\> - -#### Returns - -`void` diff --git a/docs/api/index/interfaces/RunConversationOptions.md b/docs/api/index/interfaces/RunConversationOptions.md deleted file mode 100644 index 1cccfeb..0000000 --- a/docs/api/index/interfaces/RunConversationOptions.md +++ /dev/null @@ -1,118 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RunConversationOptions - -# Interface: RunConversationOptions - -Defined in: [conversation/types.ts:175](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L175) - -## Stable - -## Properties - -### seed - -> **seed**: `string` - -Defined in: [conversation/types.ts:177](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L177) - -First message kicking off the conversation. Routes to the first speaker. - -*** - -### runId? - -> `optional` **runId?**: `string` - -Defined in: [conversation/types.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L184) - -Optional run identifier for cross-participant trace correlation. Auto- -generated when omitted. Reusing a runId against the same `journal` -resumes the prior run — the runner replays the persisted transcript and -continues from the first un-recorded turn. - -*** - -### signal? - -> `optional` **signal?**: `AbortSignal` - -Defined in: [conversation/types.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L186) - -Cancellation signal — aborts mid-stream and halts with `{ kind: 'abort' }`. - -*** - -### onEvent? - -> `optional` **onEvent?**: (`event`) => `void` \| `Promise`\<`void`\> - -Defined in: [conversation/types.ts:193](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L193) - -Event sink for per-turn micro-events. Distinct from the result transcript: -the sink fires for every text-delta, every turn-start/end, and the -conversation-start/end markers. Used to drive SSE / dashboard updates -without waiting for the conversation to finish. - -#### Parameters - -##### event - -[`ConversationStreamEvent`](../type-aliases/ConversationStreamEvent.md) - -#### Returns - -`void` \| `Promise`\<`void`\> - -*** - -### journal? - -> `optional` **journal?**: [`ConversationJournal`](ConversationJournal.md) - -Defined in: [conversation/types.ts:200](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L200) - -Optional durable transcript. When set, the runner persists every -committed turn before yielding `turn_end`. Reusing the same `runId` -against the same journal resumes from the last committed turn — so a -driver process crash mid-run loses zero acknowledged turns. - -*** - -### propagatedHeaders? - -> `optional` **propagatedHeaders?**: `Readonly`\<`Record`\<`string`, `string`\>\> - -Defined in: [conversation/types.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L207) - -Headers to forward verbatim to every participant backend call (gateway -propagation: `X-Tangle-Forwarded-Authorization`, run/turn correlation, -depth counter). Backends opt in by reading `propagatedHeaders` from -their `AgentBackendContext`; backends that ignore the field still work. - -*** - -### inboundDepth? - -> `optional` **inboundDepth?**: `number` - -Defined in: [conversation/types.ts:213](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L213) - -Inbound depth at the point this driver was invoked. The runner -increments it on every outbound participant call; gateways refuse at -`DEFAULT_MAX_DEPTH`. Default 0 (origin caller). - -*** - -### parentTurnId? - -> `optional` **parentTurnId?**: `string` - -Defined in: [conversation/types.ts:220](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L220) - -Parent turn id when this conversation is *inside* another turn (i.e. the -driver is itself a participant via `createConversationBackend`). The -runner stamps each outbound call with this as `X-Tangle-Parent-TurnId` -so trace stitching survives nested orchestration. diff --git a/docs/api/index/interfaces/RunDelegatedLoopOptions.md b/docs/api/index/interfaces/RunDelegatedLoopOptions.md deleted file mode 100644 index 276de95..0000000 --- a/docs/api/index/interfaces/RunDelegatedLoopOptions.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RunDelegatedLoopOptions - -# Interface: RunDelegatedLoopOptions - -Defined in: [loop-runner.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L84) - -**`Experimental`** - -## Properties - -### signal? - -> `optional` **signal?**: `AbortSignal` - -Defined in: [loop-runner.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L85) - -**`Experimental`** - -*** - -### now? - -> `optional` **now?**: () => `number` - -Defined in: [loop-runner.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L87) - -**`Experimental`** - -Clock override for deterministic tests. - -#### Returns - -`number` diff --git a/docs/api/index/interfaces/RunPersonaConfig.md b/docs/api/index/interfaces/RunPersonaConfig.md deleted file mode 100644 index c83ede4..0000000 --- a/docs/api/index/interfaces/RunPersonaConfig.md +++ /dev/null @@ -1,153 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RunPersonaConfig - -# Interface: RunPersonaConfig\ - -Defined in: [conversation/run-persona.ts:195](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L195) - -## Type Parameters - -### TScenario - -`TScenario` *extends* `Scenario` - -### TArtifact - -`TArtifact` - -## Properties - -### backendFor - -> **backendFor**: (`profile`, `role`) => [`AgentExecutionBackend`](AgentExecutionBackend.md) - -Defined in: [conversation/run-persona.ts:197](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L197) - -Turn an `AgentProfile` into a runnable backend (router / sandbox / fake). - -#### Parameters - -##### profile - -`AgentProfile` - -##### role - -`"worker"` \| `"persona"` - -#### Returns - -[`AgentExecutionBackend`](AgentExecutionBackend.md) - -*** - -### systemPromptOf - -> **systemPromptOf**: (`profile`) => `string` - -Defined in: [conversation/run-persona.ts:199](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L199) - -Render a profile's system prompt. - -#### Parameters - -##### profile - -`AgentProfile` - -#### Returns - -`string` - -*** - -### personaOf - -> **personaOf**: (`scenario`) => [`PersonaDriver`](../type-aliases/PersonaDriver.md) - -Defined in: [conversation/run-persona.ts:201](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L201) - -The persona driving each scenario — a driver profile or scripted turns. - -#### Parameters - -##### scenario - -`TScenario` - -#### Returns - -[`PersonaDriver`](../type-aliases/PersonaDriver.md) - -*** - -### artifactOf - -> **artifactOf**: (`transcript`, `scenario`) => `TArtifact` - -Defined in: [conversation/run-persona.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L203) - -Build the scored artifact from the finished transcript. - -#### Parameters - -##### transcript - -[`ConversationTurn`](ConversationTurn.md)[] - -##### scenario - -`TScenario` - -#### Returns - -`TArtifact` - -*** - -### maxTurns? - -> `optional` **maxTurns?**: (`scenario`) => `number` - -Defined in: [conversation/run-persona.ts:205](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L205) - -Speaker-turn cap (required when a persona is profile-driven). - -#### Parameters - -##### scenario - -`TScenario` - -#### Returns - -`number` - -*** - -### seed? - -> `optional` **seed?**: (`scenario`) => `string` - -Defined in: [conversation/run-persona.ts:206](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L206) - -#### Parameters - -##### scenario - -`TScenario` - -#### Returns - -`string` - -*** - -### workerName? - -> `optional` **workerName?**: `string` - -Defined in: [conversation/run-persona.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L207) diff --git a/docs/api/index/interfaces/RunPersonaConversationOptions.md b/docs/api/index/interfaces/RunPersonaConversationOptions.md deleted file mode 100644 index 76201d6..0000000 --- a/docs/api/index/interfaces/RunPersonaConversationOptions.md +++ /dev/null @@ -1,113 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RunPersonaConversationOptions - -# Interface: RunPersonaConversationOptions - -Defined in: [conversation/run-persona.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L36) - -## Properties - -### worker - -> **worker**: `AgentProfile` - -Defined in: [conversation/run-persona.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L38) - -The agent under test. Metered; its rendered prompt leads its turns. - -*** - -### persona - -> **persona**: [`PersonaDriver`](../type-aliases/PersonaDriver.md) - -Defined in: [conversation/run-persona.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L40) - -The simulated user driving the dialogue. - -*** - -### backendFor - -> **backendFor**: (`profile`, `role`) => [`AgentExecutionBackend`](AgentExecutionBackend.md) - -Defined in: [conversation/run-persona.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L43) - -Turn an `AgentProfile` into a runnable backend (router / sandbox / fake). - Applied to the worker and to a `profile`-kind persona. - -#### Parameters - -##### profile - -`AgentProfile` - -##### role - -`"worker"` \| `"persona"` - -#### Returns - -[`AgentExecutionBackend`](AgentExecutionBackend.md) - -*** - -### systemPromptOf - -> **systemPromptOf**: (`profile`) => `string` - -Defined in: [conversation/run-persona.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L45) - -Render a profile's system prompt — prepended to that profile's messages. - -#### Parameters - -##### profile - -`AgentProfile` - -#### Returns - -`string` - -*** - -### maxTurns? - -> `optional` **maxTurns?**: `number` - -Defined in: [conversation/run-persona.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L48) - -Speaker-turn cap. Default for a scripted persona = `2 * turns.length` - (worker answers each user turn). REQUIRED for a `profile` persona. - -*** - -### seed? - -> `optional` **seed?**: `string` - -Defined in: [conversation/run-persona.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L50) - -Kickoff message routed to the first speaker (the persona). Default 'Begin.' - -*** - -### signal? - -> `optional` **signal?**: `AbortSignal` - -Defined in: [conversation/run-persona.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L51) - -*** - -### workerName? - -> `optional` **workerName?**: `string` - -Defined in: [conversation/run-persona.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L53) - -Worker participant / transcript speaker label. Default 'agent'. diff --git a/docs/api/index/interfaces/RunToolLoopOptions.md b/docs/api/index/interfaces/RunToolLoopOptions.md deleted file mode 100644 index 5cc0a43..0000000 --- a/docs/api/index/interfaces/RunToolLoopOptions.md +++ /dev/null @@ -1,207 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RunToolLoopOptions - -# Interface: RunToolLoopOptions - -Defined in: [tool-loop.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L129) - -## Properties - -### systemPrompt - -> **systemPrompt**: `string` - -Defined in: [tool-loop.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L130) - -*** - -### userMessage - -> **userMessage**: `string` - -Defined in: [tool-loop.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L131) - -*** - -### priorMessages? - -> `optional` **priorMessages?**: [`ToolLoopMessage`](../type-aliases/ToolLoopMessage.md)[] - -Defined in: [tool-loop.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L132) - -*** - -### streamTurn - -> **streamTurn**: (`messages`) => `AsyncIterable`\<[`ToolLoopEvent`](../type-aliases/ToolLoopEvent.md)\> - -Defined in: [tool-loop.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L133) - -#### Parameters - -##### messages - -[`ToolLoopMessage`](../type-aliases/ToolLoopMessage.md)[] - -#### Returns - -`AsyncIterable`\<[`ToolLoopEvent`](../type-aliases/ToolLoopEvent.md)\> - -*** - -### executeToolCall - -> **executeToolCall**: (`call`) => `Promise`\<[`ToolCallOutcome`](../type-aliases/ToolCallOutcome.md)\> - -Defined in: [tool-loop.ts:134](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L134) - -#### Parameters - -##### call - -[`ToolLoopCall`](ToolLoopCall.md) - -#### Returns - -`Promise`\<[`ToolCallOutcome`](../type-aliases/ToolCallOutcome.md)\> - -*** - -### isExecutableTool - -> **isExecutableTool**: (`toolName`) => `boolean` - -Defined in: [tool-loop.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L135) - -#### Parameters - -##### toolName - -`string` - -#### Returns - -`boolean` - -*** - -### maxToolTurns? - -> `optional` **maxToolTurns?**: `number` - -Defined in: [tool-loop.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L138) - -Runaway-backstop cap. Default 200 — set far above any legitimate workflow. - For per-workflow limits, use `maxCostUsd` or `deadlineMs` instead. - -*** - -### deadlineMs? - -> `optional` **deadlineMs?**: `number` - -Defined in: [tool-loop.ts:141](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L141) - -Wall-clock deadline in ms since epoch (Date.now()-based). When exceeded the - loop stops with stopReason `deadline`. - -*** - -### maxCostUsd? - -> `optional` **maxCostUsd?**: `number` - -Defined in: [tool-loop.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L143) - -Maximum total cost in USD. Requires `costOf` to meter each tool call. - -*** - -### costOf? - -> `optional` **costOf?**: (`call`, `outcome`) => `number` - -Defined in: [tool-loop.ts:145](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L145) - -Return the USD cost of one outcome. Required for `maxCostUsd` to work. - -#### Parameters - -##### call - -[`ToolLoopCall`](ToolLoopCall.md) - -##### outcome - -[`ToolCallOutcome`](../type-aliases/ToolCallOutcome.md) - -#### Returns - -`number` - -*** - -### renderResult? - -> `optional` **renderResult?**: (`label`, `outcome`) => `string` - -Defined in: [tool-loop.ts:146](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L146) - -#### Parameters - -##### label - -`string` - -##### outcome - -[`ToolCallOutcome`](../type-aliases/ToolCallOutcome.md) - -#### Returns - -`string` - -*** - -### labelFor? - -> `optional` **labelFor?**: (`call`) => `string` - -Defined in: [tool-loop.ts:147](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L147) - -#### Parameters - -##### call - -[`ToolLoopCall`](ToolLoopCall.md) - -#### Returns - -`string` - -*** - -### runId? - -> `optional` **runId?**: `string` - -Defined in: [tool-loop.ts:148](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L148) - -*** - -### scenarioId? - -> `optional` **scenarioId?**: `string` - -Defined in: [tool-loop.ts:149](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L149) - -*** - -### hooks? - -> `optional` **hooks?**: [`RuntimeHooks`](RuntimeHooks.md) - -Defined in: [tool-loop.ts:150](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L150) diff --git a/docs/api/index/interfaces/RuntimeDecisionEvidenceRef.md b/docs/api/index/interfaces/RuntimeDecisionEvidenceRef.md deleted file mode 100644 index fbc3a15..0000000 --- a/docs/api/index/interfaces/RuntimeDecisionEvidenceRef.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeDecisionEvidenceRef - -# Interface: RuntimeDecisionEvidenceRef - -Defined in: [runtime-hooks.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L52) - -## Properties - -### source - -> **source**: `string` - -Defined in: [runtime-hooks.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L53) - -*** - -### id - -> **id**: `string` - -Defined in: [runtime-hooks.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L54) - -*** - -### detail? - -> `optional` **detail?**: `string` - -Defined in: [runtime-hooks.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L55) - -*** - -### metadata? - -> `optional` **metadata?**: `Record`\<`string`, `unknown`\> - -Defined in: [runtime-hooks.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L56) diff --git a/docs/api/index/interfaces/RuntimeDecisionPoint.md b/docs/api/index/interfaces/RuntimeDecisionPoint.md deleted file mode 100644 index 31acb6c..0000000 --- a/docs/api/index/interfaces/RuntimeDecisionPoint.md +++ /dev/null @@ -1,81 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeDecisionPoint - -# Interface: RuntimeDecisionPoint - -Defined in: [runtime-hooks.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L59) - -## Properties - -### id - -> **id**: `string` - -Defined in: [runtime-hooks.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L60) - -*** - -### runId - -> **runId**: `string` - -Defined in: [runtime-hooks.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L61) - -*** - -### scenarioId? - -> `optional` **scenarioId?**: `string` - -Defined in: [runtime-hooks.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L62) - -*** - -### stepIndex - -> **stepIndex**: `number` - -Defined in: [runtime-hooks.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L63) - -*** - -### kind - -> **kind**: [`RuntimeDecisionKind`](../type-aliases/RuntimeDecisionKind.md) - -Defined in: [runtime-hooks.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L64) - -*** - -### candidateActions - -> **candidateActions**: `string`[] - -Defined in: [runtime-hooks.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L65) - -*** - -### context? - -> `optional` **context?**: `string` - -Defined in: [runtime-hooks.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L66) - -*** - -### evidence - -> **evidence**: [`RuntimeDecisionEvidenceRef`](RuntimeDecisionEvidenceRef.md)[] - -Defined in: [runtime-hooks.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L67) - -*** - -### metadata? - -> `optional` **metadata?**: `Record`\<`string`, `unknown`\> - -Defined in: [runtime-hooks.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L68) diff --git a/docs/api/index/interfaces/RuntimeEventCollector.md b/docs/api/index/interfaces/RuntimeEventCollector.md deleted file mode 100644 index 94c78fc..0000000 --- a/docs/api/index/interfaces/RuntimeEventCollector.md +++ /dev/null @@ -1,55 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeEventCollector - -# Interface: RuntimeEventCollector\ - -Defined in: [sanitize.ts:492](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L492) - -## Stable - -## Type Parameters - -### TState - -`TState` = `unknown` - -### TAction - -`TAction` = `unknown` - -### TActionResult - -`TActionResult` = `unknown` - -### TEval - -`TEval` *extends* `ControlEvalResult` = `ControlEvalResult` - -## Properties - -### onEvent - -> **onEvent**: (`event`) => `void` - -Defined in: [sanitize.ts:498](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L498) - -#### Parameters - -##### event - -[`AgentRuntimeEvent`](../type-aliases/AgentRuntimeEvent.md)\<`TState`, `TAction`, `TActionResult`, `TEval`\> - -#### Returns - -`void` - -*** - -### events - -> **events**: `Record`\<`string`, `unknown`\>[] - -Defined in: [sanitize.ts:499](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L499) diff --git a/docs/api/index/interfaces/RuntimeHookContext.md b/docs/api/index/interfaces/RuntimeHookContext.md deleted file mode 100644 index f4ed227..0000000 --- a/docs/api/index/interfaces/RuntimeHookContext.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeHookContext - -# Interface: RuntimeHookContext - -Defined in: [runtime-hooks.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L48) - -## Properties - -### signal? - -> `optional` **signal?**: `AbortSignal` - -Defined in: [runtime-hooks.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L49) diff --git a/docs/api/index/interfaces/RuntimeHookErrorContext.md b/docs/api/index/interfaces/RuntimeHookErrorContext.md deleted file mode 100644 index 7deb1f1..0000000 --- a/docs/api/index/interfaces/RuntimeHookErrorContext.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeHookErrorContext - -# Interface: RuntimeHookErrorContext - -Defined in: [runtime-hooks.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L71) - -## Properties - -### hook - -> **hook**: `"onEvent"` \| `"onDecisionPoint"` - -Defined in: [runtime-hooks.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L72) - -*** - -### eventId? - -> `optional` **eventId?**: `string` - -Defined in: [runtime-hooks.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L73) - -*** - -### target? - -> `optional` **target?**: [`RuntimeHookTarget`](../type-aliases/RuntimeHookTarget.md) - -Defined in: [runtime-hooks.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L74) - -*** - -### phase? - -> `optional` **phase?**: [`RuntimeHookPhase`](../type-aliases/RuntimeHookPhase.md) - -Defined in: [runtime-hooks.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L75) - -*** - -### decisionId? - -> `optional` **decisionId?**: `string` - -Defined in: [runtime-hooks.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L76) - -*** - -### decisionKind? - -> `optional` **decisionKind?**: [`RuntimeDecisionKind`](../type-aliases/RuntimeDecisionKind.md) - -Defined in: [runtime-hooks.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L77) diff --git a/docs/api/index/interfaces/RuntimeHookEvent.md b/docs/api/index/interfaces/RuntimeHookEvent.md deleted file mode 100644 index b466d88..0000000 --- a/docs/api/index/interfaces/RuntimeHookEvent.md +++ /dev/null @@ -1,95 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeHookEvent - -# Interface: RuntimeHookEvent\ - -Defined in: [runtime-hooks.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L35) - -## Type Parameters - -### Payload - -`Payload` = `unknown` - -## Properties - -### id - -> **id**: `string` - -Defined in: [runtime-hooks.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L36) - -*** - -### runId - -> **runId**: `string` - -Defined in: [runtime-hooks.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L37) - -*** - -### scenarioId? - -> `optional` **scenarioId?**: `string` - -Defined in: [runtime-hooks.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L38) - -*** - -### target - -> **target**: [`RuntimeHookTarget`](../type-aliases/RuntimeHookTarget.md) - -Defined in: [runtime-hooks.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L39) - -*** - -### phase - -> **phase**: [`RuntimeHookPhase`](../type-aliases/RuntimeHookPhase.md) - -Defined in: [runtime-hooks.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L40) - -*** - -### timestamp - -> **timestamp**: `number` - -Defined in: [runtime-hooks.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L41) - -*** - -### stepIndex? - -> `optional` **stepIndex?**: `number` - -Defined in: [runtime-hooks.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L42) - -*** - -### parentId? - -> `optional` **parentId?**: `string` - -Defined in: [runtime-hooks.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L43) - -*** - -### payload? - -> `optional` **payload?**: `Payload` - -Defined in: [runtime-hooks.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L44) - -*** - -### metadata? - -> `optional` **metadata?**: `Record`\<`string`, `unknown`\> - -Defined in: [runtime-hooks.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L45) diff --git a/docs/api/index/interfaces/RuntimeHooks.md b/docs/api/index/interfaces/RuntimeHooks.md deleted file mode 100644 index 847fe5b..0000000 --- a/docs/api/index/interfaces/RuntimeHooks.md +++ /dev/null @@ -1,88 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeHooks - -# Interface: RuntimeHooks - -Defined in: [runtime-hooks.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L87) - -The observation seam attached to a running loop (never to the portable genome). -Implement the optional hooks to receive lifecycle events, semantic decision points, -and hook errors. Author with [defineRuntimeHooks](../functions/defineRuntimeHooks.md) for inference, and attach N -observers at once with [composeRuntimeHooks](../functions/composeRuntimeHooks.md) — there is ONE event stream, not a -callback-prop zoo. - -## Properties - -### onEvent? - -> `optional` **onEvent?**: (`event`, `context`) => `void` \| `Promise`\<`void`\> - -Defined in: [runtime-hooks.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L93) - -General before/after/event hook. Use this for telemetry, memory capture, -policy wrapping, child lifecycle observers, or product-specific extension -points. - -#### Parameters - -##### event - -[`RuntimeHookEvent`](RuntimeHookEvent.md) - -##### context - -[`RuntimeHookContext`](RuntimeHookContext.md) - -#### Returns - -`void` \| `Promise`\<`void`\> - -*** - -### onDecisionPoint? - -> `optional` **onDecisionPoint?**: (`point`, `context`) => `void` \| `Promise`\<`void`\> - -Defined in: [runtime-hooks.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L98) - -Semantic decision hook. Belief-state evaluation consumes this, but runtime -code should keep emitting ordinary lifecycle events as the base layer. - -#### Parameters - -##### point - -[`RuntimeDecisionPoint`](RuntimeDecisionPoint.md) - -##### context - -[`RuntimeHookContext`](RuntimeHookContext.md) - -#### Returns - -`void` \| `Promise`\<`void`\> - -*** - -### onHookError? - -> `optional` **onHookError?**: (`error`, `context`) => `void` \| `Promise`\<`void`\> - -Defined in: [runtime-hooks.ts:102](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L102) - -#### Parameters - -##### error - -`Error` - -##### context - -[`RuntimeHookErrorContext`](RuntimeHookErrorContext.md) - -#### Returns - -`void` \| `Promise`\<`void`\> diff --git a/docs/api/index/interfaces/RuntimeRunHandle.md b/docs/api/index/interfaces/RuntimeRunHandle.md deleted file mode 100644 index 6550661..0000000 --- a/docs/api/index/interfaces/RuntimeRunHandle.md +++ /dev/null @@ -1,153 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeRunHandle - -# Interface: RuntimeRunHandle - -Defined in: [runtime-run.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L106) - -## Stable - -## Properties - -### id - -> `readonly` **id**: `string` - -Defined in: [runtime-run.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L108) - -Stable id assigned at start. - -*** - -### workspaceId - -> `readonly` **workspaceId**: `string` - -Defined in: [runtime-run.ts:109](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L109) - -*** - -### sessionId - -> `readonly` **sessionId**: `string` \| `undefined` - -Defined in: [runtime-run.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L110) - -*** - -### taskSpec - -> `readonly` **taskSpec**: [`AgentTaskSpec`](AgentTaskSpec.md) - -Defined in: [runtime-run.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L111) - -*** - -### status - -> `readonly` **status**: `RuntimeRunStatus` - -Defined in: [runtime-run.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L112) - -## Methods - -### observe() - -> **observe**(`event`): `void` - -Defined in: [runtime-run.ts:119](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L119) - -Observe a single `RuntimeStreamEvent`. The handle ignores non-cost events -(text deltas, tool calls) silently so consumers can pipe the whole stream -through `handle.observe`. `llm_call` events update the ledger. - -#### Parameters - -##### event - -[`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md) - -#### Returns - -`void` - -*** - -### cost() - -> **cost**(): `RuntimeRunCost` - -Defined in: [runtime-run.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L122) - -Snapshot of the current cost ledger. Safe to call at any time. - -#### Returns - -`RuntimeRunCost` - -*** - -### complete() - -> **complete**(`input`): `void` - -Defined in: [runtime-run.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L129) - -Transition to a terminal state. Idempotent for the same status; throws -`RuntimeRunStateError` for a different terminal status (state machines -don't time-travel). - -#### Parameters - -##### input - -`RuntimeRunCompleteInput` - -#### Returns - -`void` - -*** - -### toRow() - -> **toRow**(`metadata?`): [`RuntimeRunRow`](RuntimeRunRow.md) - -Defined in: [runtime-run.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L132) - -Build the current row without writing it. Useful for tests + dry runs. - -#### Parameters - -##### metadata? - -`Record`\<`string`, `unknown`\> - -#### Returns - -[`RuntimeRunRow`](RuntimeRunRow.md) - -*** - -### persist() - -> **persist**(`metadata?`): `Promise`\<`void`\> - -Defined in: [runtime-run.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L139) - -Persist the current row via the configured adapter. Must be called after -`complete()`. Idempotent for the same terminal state (the adapter sees -the same row on retry). - -#### Parameters - -##### metadata? - -`Record`\<`string`, `unknown`\> - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/index/interfaces/RuntimeRunPersistenceAdapter.md b/docs/api/index/interfaces/RuntimeRunPersistenceAdapter.md deleted file mode 100644 index 0b49683..0000000 --- a/docs/api/index/interfaces/RuntimeRunPersistenceAdapter.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeRunPersistenceAdapter - -# Interface: RuntimeRunPersistenceAdapter - -Defined in: [runtime-run.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L79) - -## Stable - -## Methods - -### upsert() - -> **upsert**(`row`): `void` \| `Promise`\<`void`\> - -Defined in: [runtime-run.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L87) - -Called once when `handle.persist()` runs. Implementations write `row` to -their durable store (D1, postgres, KV) and return whatever the consumer -wants the caller to see (often the storage-side row id). Errors thrown -here propagate out of `persist()` so the caller can decide whether to -retry or log-and-continue. - -#### Parameters - -##### row - -[`RuntimeRunRow`](RuntimeRunRow.md) - -#### Returns - -`void` \| `Promise`\<`void`\> diff --git a/docs/api/index/interfaces/RuntimeRunRow.md b/docs/api/index/interfaces/RuntimeRunRow.md deleted file mode 100644 index 84872ff..0000000 --- a/docs/api/index/interfaces/RuntimeRunRow.md +++ /dev/null @@ -1,125 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeRunRow - -# Interface: RuntimeRunRow - -Defined in: [runtime-run.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L60) - -## Stable - -## Properties - -### id - -> **id**: `string` - -Defined in: [runtime-run.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L62) - -Stable runtime-side identifier. Adapters may translate to their own primary key. - -*** - -### workspaceId - -> **workspaceId**: `string` - -Defined in: [runtime-run.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L63) - -*** - -### sessionId? - -> `optional` **sessionId?**: `string` - -Defined in: [runtime-run.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L64) - -*** - -### agentId? - -> `optional` **agentId?**: `string` - -Defined in: [runtime-run.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L65) - -*** - -### domain? - -> `optional` **domain?**: `string` - -Defined in: [runtime-run.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L66) - -*** - -### taskId - -> **taskId**: `string` - -Defined in: [runtime-run.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L67) - -*** - -### scenarioId? - -> `optional` **scenarioId?**: `string` - -Defined in: [runtime-run.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L68) - -*** - -### status - -> **status**: `RuntimeRunStatus` - -Defined in: [runtime-run.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L69) - -*** - -### resultSummary? - -> `optional` **resultSummary?**: `string` - -Defined in: [runtime-run.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L70) - -*** - -### error? - -> `optional` **error?**: `string` - -Defined in: [runtime-run.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L71) - -*** - -### cost - -> **cost**: `RuntimeRunCost` - -Defined in: [runtime-run.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L72) - -*** - -### startedAt - -> **startedAt**: `string` - -Defined in: [runtime-run.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L73) - -*** - -### completedAt? - -> `optional` **completedAt?**: `string` - -Defined in: [runtime-run.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L74) - -*** - -### metadata? - -> `optional` **metadata?**: `Record`\<`string`, `unknown`\> - -Defined in: [runtime-run.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-run.ts#L75) diff --git a/docs/api/index/interfaces/RuntimeSessionStore.md b/docs/api/index/interfaces/RuntimeSessionStore.md deleted file mode 100644 index d26f899..0000000 --- a/docs/api/index/interfaces/RuntimeSessionStore.md +++ /dev/null @@ -1,87 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeSessionStore - -# Interface: RuntimeSessionStore - -Defined in: [types.ts:444](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L444) - -## Stable - -## Methods - -### get() - -> **get**(`sessionId`): `RuntimeSession` \| `Promise`\<`RuntimeSession` \| `undefined`\> \| `undefined` - -Defined in: [types.ts:445](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L445) - -#### Parameters - -##### sessionId - -`string` - -#### Returns - -`RuntimeSession` \| `Promise`\<`RuntimeSession` \| `undefined`\> \| `undefined` - -*** - -### put() - -> **put**(`session`): `void` \| `Promise`\<`void`\> - -Defined in: [types.ts:446](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L446) - -#### Parameters - -##### session - -`RuntimeSession` - -#### Returns - -`void` \| `Promise`\<`void`\> - -*** - -### appendEvent()? - -> `optional` **appendEvent**(`sessionId`, `event`): `void` \| `Promise`\<`void`\> - -Defined in: [types.ts:447](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L447) - -#### Parameters - -##### sessionId - -`string` - -##### event - -[`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md) - -#### Returns - -`void` \| `Promise`\<`void`\> - -*** - -### listEvents()? - -> `optional` **listEvents**(`sessionId`): [`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md)[] \| `Promise`\<[`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md)[]\> - -Defined in: [types.ts:448](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L448) - -#### Parameters - -##### sessionId - -`string` - -#### Returns - -[`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md)[] \| `Promise`\<[`RuntimeStreamEvent`](../type-aliases/RuntimeStreamEvent.md)[]\> diff --git a/docs/api/index/interfaces/RuntimeStreamEventCollector.md b/docs/api/index/interfaces/RuntimeStreamEventCollector.md deleted file mode 100644 index 4801299..0000000 --- a/docs/api/index/interfaces/RuntimeStreamEventCollector.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeStreamEventCollector - -# Interface: RuntimeStreamEventCollector - -Defined in: [sanitize.ts:522](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L522) - -## Stable - -## Properties - -### onEvent - -> **onEvent**: `RuntimeStreamEventSink` - -Defined in: [sanitize.ts:523](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L523) - -*** - -### events - -> **events**: `Record`\<`string`, `unknown`\>[] - -Defined in: [sanitize.ts:524](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L524) - -## Methods - -### summary() - -> **summary**(): `RuntimeStreamEventSummary` - -Defined in: [sanitize.ts:526](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L526) - -Snapshot of a small streaming-flavored summary derived from collected events. - -#### Returns - -`RuntimeStreamEventSummary` diff --git a/docs/api/index/interfaces/RuntimeTelemetryOptions.md b/docs/api/index/interfaces/RuntimeTelemetryOptions.md deleted file mode 100644 index 357f24e..0000000 --- a/docs/api/index/interfaces/RuntimeTelemetryOptions.md +++ /dev/null @@ -1,82 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeTelemetryOptions - -# Interface: RuntimeTelemetryOptions - -Defined in: [sanitize.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L29) - -## Stable - -## Properties - -### includeInputs? - -> `optional` **includeInputs?**: `boolean` - -Defined in: [sanitize.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L34) - -Include raw task inputs. Off by default because task inputs often contain -customer facts, credentials, source text, or internal IDs. - -*** - -### includeRequirementDescriptions? - -> `optional` **includeRequirementDescriptions?**: `boolean` - -Defined in: [sanitize.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L36) - -Include requirement descriptions. Secret requirements are always redacted. - -*** - -### includeEvidenceIds? - -> `optional` **includeEvidenceIds?**: `boolean` - -Defined in: [sanitize.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L38) - -Include evidence IDs. Off by default; counts are safer for shared reports. - -*** - -### includeUserAnswers? - -> `optional` **includeUserAnswers?**: `boolean` - -Defined in: [sanitize.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L40) - -Include user answers from question preflight. Off by default. - -*** - -### includeControlPayloads? - -> `optional` **includeControlPayloads?**: `boolean` - -Defined in: [sanitize.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L42) - -Include action payloads and action results for control steps. Off by default. - -*** - -### includeMetadata? - -> `optional` **includeMetadata?**: `boolean` - -Defined in: [sanitize.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L44) - -Include task metadata. Off by default because metadata may carry IDs or policy internals. - -*** - -### includeEvalDetails? - -> `optional` **includeEvalDetails?**: `boolean` - -Defined in: [sanitize.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L46) - -Include eval detail/evidence strings. Off by default because validators may echo private input. diff --git a/docs/api/index/interfaces/SanitizedKnowledgeReadinessReport.md b/docs/api/index/interfaces/SanitizedKnowledgeReadinessReport.md deleted file mode 100644 index c4b3335..0000000 --- a/docs/api/index/interfaces/SanitizedKnowledgeReadinessReport.md +++ /dev/null @@ -1,91 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / SanitizedKnowledgeReadinessReport - -# Interface: SanitizedKnowledgeReadinessReport - -Defined in: [sanitize.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L67) - -## Stable - -## Properties - -### taskId - -> **taskId**: `string` - -Defined in: [sanitize.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L68) - -*** - -### readinessScore - -> **readinessScore**: `number` - -Defined in: [sanitize.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L69) - -*** - -### recommendedAction - -> **recommendedAction**: `KnowledgeRecommendedAction` - -Defined in: [sanitize.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L70) - -*** - -### severity - -> **severity**: `ControlSeverity` - -Defined in: [sanitize.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L71) - -*** - -### reason - -> **reason**: `string` - -Defined in: [sanitize.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L72) - -*** - -### blockingMissingRequirements - -> **blockingMissingRequirements**: `SanitizedKnowledgeRequirement`[] - -Defined in: [sanitize.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L73) - -*** - -### nonBlockingGaps - -> **nonBlockingGaps**: `SanitizedKnowledgeRequirement`[] - -Defined in: [sanitize.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L74) - -*** - -### evidenceCount - -> **evidenceCount**: `number` - -Defined in: [sanitize.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L75) - -*** - -### evidenceIds? - -> `optional` **evidenceIds?**: `string`[] - -Defined in: [sanitize.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L76) - -*** - -### missingRequirementIds - -> **missingRequirementIds**: `string`[] - -Defined in: [sanitize.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/sanitize.ts#L77) diff --git a/docs/api/index/interfaces/SqlAdapter.md b/docs/api/index/interfaces/SqlAdapter.md deleted file mode 100644 index 2fa614c..0000000 --- a/docs/api/index/interfaces/SqlAdapter.md +++ /dev/null @@ -1,69 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / SqlAdapter - -# Interface: SqlAdapter - -Defined in: [conversation/journal-sql.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L48) - -Minimal SQL driver shape. Implementations forward to whichever client the -deployment already uses; agent-runtime takes no opinion on which. - -Parameter placeholders MUST be `?` (positional). All adapters listed in the -file header accept this convention. - -## Methods - -### exec() - -> **exec**(`sql`, `params?`): `Promise`\<\{ `rowsAffected`: `number`; \}\> - -Defined in: [conversation/journal-sql.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L50) - -Execute a write statement (INSERT/UPDATE/DELETE/DDL). - -#### Parameters - -##### sql - -`string` - -##### params? - -readonly `unknown`[] - -#### Returns - -`Promise`\<\{ `rowsAffected`: `number`; \}\> - -*** - -### query() - -> **query**\<`TRow`\>(`sql`, `params?`): `Promise`\<`TRow`[]\> - -Defined in: [conversation/journal-sql.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/journal-sql.ts#L52) - -Execute a read statement (SELECT). Returns rows as plain objects. - -#### Type Parameters - -##### TRow - -`TRow` = `Record`\<`string`, `unknown`\> - -#### Parameters - -##### sql - -`string` - -##### params? - -readonly `unknown`[] - -#### Returns - -`Promise`\<`TRow`[]\> diff --git a/docs/api/index/interfaces/StreamToolLoopOptions.md b/docs/api/index/interfaces/StreamToolLoopOptions.md deleted file mode 100644 index 360817d..0000000 --- a/docs/api/index/interfaces/StreamToolLoopOptions.md +++ /dev/null @@ -1,247 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / StreamToolLoopOptions - -# Interface: StreamToolLoopOptions\ - -Defined in: [tool-loop.ts:309](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L309) - -## Type Parameters - -### Raw - -`Raw` - -## Properties - -### systemPrompt - -> **systemPrompt**: `string` - -Defined in: [tool-loop.ts:310](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L310) - -*** - -### userMessage - -> **userMessage**: `string` - -Defined in: [tool-loop.ts:311](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L311) - -*** - -### priorMessages? - -> `optional` **priorMessages?**: [`ToolLoopMessage`](../type-aliases/ToolLoopMessage.md)[] - -Defined in: [tool-loop.ts:312](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L312) - -*** - -### streamTurn - -> **streamTurn**: (`messages`) => `AsyncIterable`\<`Raw`\> - -Defined in: [tool-loop.ts:313](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L313) - -#### Parameters - -##### messages - -[`ToolLoopMessage`](../type-aliases/ToolLoopMessage.md)[] - -#### Returns - -`AsyncIterable`\<`Raw`\> - -*** - -### extractText - -> **extractText**: (`event`) => `string` - -Defined in: [tool-loop.ts:314](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L314) - -#### Parameters - -##### event - -`Raw` - -#### Returns - -`string` - -*** - -### extractToolCall - -> **extractToolCall**: (`event`) => [`ToolLoopCall`](ToolLoopCall.md) \| `null` - -Defined in: [tool-loop.ts:315](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L315) - -#### Parameters - -##### event - -`Raw` - -#### Returns - -[`ToolLoopCall`](ToolLoopCall.md) \| `null` - -*** - -### isExecutableTool - -> **isExecutableTool**: (`toolName`) => `boolean` - -Defined in: [tool-loop.ts:316](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L316) - -#### Parameters - -##### toolName - -`string` - -#### Returns - -`boolean` - -*** - -### executeToolCall - -> **executeToolCall**: (`call`) => `Promise`\<[`ToolCallOutcome`](../type-aliases/ToolCallOutcome.md)\> - -Defined in: [tool-loop.ts:317](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L317) - -#### Parameters - -##### call - -[`ToolLoopCall`](ToolLoopCall.md) - -#### Returns - -`Promise`\<[`ToolCallOutcome`](../type-aliases/ToolCallOutcome.md)\> - -*** - -### maxToolTurns? - -> `optional` **maxToolTurns?**: `number` - -Defined in: [tool-loop.ts:319](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L319) - -Runaway-backstop cap. Default 200 — set far above any legitimate workflow. - -*** - -### deadlineMs? - -> `optional` **deadlineMs?**: `number` - -Defined in: [tool-loop.ts:321](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L321) - -Wall-clock deadline in ms since epoch (Date.now()-based). - -*** - -### maxCostUsd? - -> `optional` **maxCostUsd?**: `number` - -Defined in: [tool-loop.ts:323](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L323) - -Maximum total cost in USD. Requires `costOf` to meter each tool call. - -*** - -### costOf? - -> `optional` **costOf?**: (`call`, `outcome`) => `number` - -Defined in: [tool-loop.ts:325](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L325) - -Return the USD cost of one outcome. Required for `maxCostUsd` to work. - -#### Parameters - -##### call - -[`ToolLoopCall`](ToolLoopCall.md) - -##### outcome - -[`ToolCallOutcome`](../type-aliases/ToolCallOutcome.md) - -#### Returns - -`number` - -*** - -### renderResult? - -> `optional` **renderResult?**: (`label`, `outcome`) => `string` - -Defined in: [tool-loop.ts:326](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L326) - -#### Parameters - -##### label - -`string` - -##### outcome - -[`ToolCallOutcome`](../type-aliases/ToolCallOutcome.md) - -#### Returns - -`string` - -*** - -### labelFor? - -> `optional` **labelFor?**: (`call`) => `string` - -Defined in: [tool-loop.ts:327](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L327) - -#### Parameters - -##### call - -[`ToolLoopCall`](ToolLoopCall.md) - -#### Returns - -`string` - -*** - -### runId? - -> `optional` **runId?**: `string` - -Defined in: [tool-loop.ts:328](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L328) - -*** - -### scenarioId? - -> `optional` **scenarioId?**: `string` - -Defined in: [tool-loop.ts:329](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L329) - -*** - -### hooks? - -> `optional` **hooks?**: [`RuntimeHooks`](RuntimeHooks.md) - -Defined in: [tool-loop.ts:330](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L330) diff --git a/docs/api/index/interfaces/ToolLoopAssistantToolCall.md b/docs/api/index/interfaces/ToolLoopAssistantToolCall.md deleted file mode 100644 index 1e88ce3..0000000 --- a/docs/api/index/interfaces/ToolLoopAssistantToolCall.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ToolLoopAssistantToolCall - -# Interface: ToolLoopAssistantToolCall - -Defined in: [tool-loop.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L45) - -One OpenAI-shaped tool-call entry carried on an assistant message. - -## Properties - -### id - -> **id**: `string` - -Defined in: [tool-loop.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L46) - -*** - -### type - -> **type**: `"function"` - -Defined in: [tool-loop.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L47) - -*** - -### function - -> **function**: `object` - -Defined in: [tool-loop.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L48) - -#### name - -> **name**: `string` - -#### arguments - -> **arguments**: `string` diff --git a/docs/api/index/interfaces/ToolLoopCall.md b/docs/api/index/interfaces/ToolLoopCall.md deleted file mode 100644 index 28c44cb..0000000 --- a/docs/api/index/interfaces/ToolLoopCall.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ToolLoopCall - -# Interface: ToolLoopCall - -Defined in: [tool-loop.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L22) - -## Properties - -### toolCallId? - -> `optional` **toolCallId?**: `string` - -Defined in: [tool-loop.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L23) - -*** - -### toolName - -> **toolName**: `string` - -Defined in: [tool-loop.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L24) - -*** - -### args - -> **args**: `Record`\<`string`, `unknown`\> - -Defined in: [tool-loop.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L25) diff --git a/docs/api/index/interfaces/ToolLoopResult.md b/docs/api/index/interfaces/ToolLoopResult.md deleted file mode 100644 index 9718cb2..0000000 --- a/docs/api/index/interfaces/ToolLoopResult.md +++ /dev/null @@ -1,65 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ToolLoopResult - -# Interface: ToolLoopResult - -Defined in: [tool-loop.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L120) - -## Properties - -### finalText - -> **finalText**: `string` - -Defined in: [tool-loop.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L121) - -*** - -### toolResults - -> **toolResults**: `object`[] - -Defined in: [tool-loop.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L122) - -#### call - -> **call**: [`ToolLoopCall`](ToolLoopCall.md) - -#### label - -> **label**: `string` - -#### outcome - -> **outcome**: [`ToolCallOutcome`](../type-aliases/ToolCallOutcome.md) - -*** - -### turns - -> **turns**: `number` - -Defined in: [tool-loop.ts:123](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L123) - -*** - -### stopReason - -> **stopReason**: [`ToolLoopStopReason`](../type-aliases/ToolLoopStopReason.md) - -Defined in: [tool-loop.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L124) - -*** - -### ~~cappedOut~~ - -> **cappedOut**: `boolean` - -Defined in: [tool-loop.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L126) - -#### Deprecated - -Use `stopReason !== 'completed'` instead. diff --git a/docs/api/index/interfaces/VetoedFact.md b/docs/api/index/interfaces/VetoedFact.md deleted file mode 100644 index 8e18563..0000000 --- a/docs/api/index/interfaces/VetoedFact.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / VetoedFact - -# Interface: VetoedFact - -Defined in: [loop-runner.ts:243](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L243) - -**`Experimental`** - -A fact rejected at the KB gate — surfaced, never dropped. - -## Properties - -### candidate - -> **candidate**: [`FactCandidate`](../../mcp/interfaces/FactCandidate.md) - -Defined in: [loop-runner.ts:244](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L244) - -**`Experimental`** - -*** - -### vetoedBy? - -> `optional` **vetoedBy?**: `string` - -Defined in: [loop-runner.ts:245](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L245) - -**`Experimental`** - -*** - -### reason? - -> `optional` **reason?**: `string` - -Defined in: [loop-runner.ts:246](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L246) - -**`Experimental`** diff --git a/docs/api/index/interfaces/WorktreeLoopRunnerOptions.md b/docs/api/index/interfaces/WorktreeLoopRunnerOptions.md deleted file mode 100644 index 4e4cf72..0000000 --- a/docs/api/index/interfaces/WorktreeLoopRunnerOptions.md +++ /dev/null @@ -1,193 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / WorktreeLoopRunnerOptions - -# Interface: WorktreeLoopRunnerOptions - -Defined in: [loop-runner.ts:158](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L158) - -**`Experimental`** - -Options for the local-repo `code` runner over the GENERIC recursive path. - -## Properties - -### repoRoot - -> **repoRoot**: `string` - -Defined in: [loop-runner.ts:160](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L160) - -**`Experimental`** - -Absolute path to the local git checkout each worktree is cut from. - -*** - -### taskPrompt - -> **taskPrompt**: `string` - -Defined in: [loop-runner.ts:162](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L162) - -**`Experimental`** - -The instruction handed to every authored harness (composed under each profile's systemPrompt). - -*** - -### harnesses - -> **harnesses**: readonly [`AuthoredHarness`](../../runtime/interfaces/AuthoredHarness.md)[] - -Defined in: [loop-runner.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L164) - -**`Experimental`** - -The supervisor-authored harness profiles — one fanout item (one worktree-CLI leaf) each. - -*** - -### budget - -> **budget**: [`Budget`](../../runtime/interfaces/Budget.md) - -Defined in: [loop-runner.ts:166](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L166) - -**`Experimental`** - -Conserved budget pool bounding the fanout (equal-k holds by construction). - -*** - -### testCmd? - -> `optional` **testCmd?**: `string` - -Defined in: [loop-runner.ts:168](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L168) - -**`Experimental`** - -Shell command run in each worktree to derive the tests-PASS signal. - -*** - -### typecheckCmd? - -> `optional` **typecheckCmd?**: `string` - -Defined in: [loop-runner.ts:170](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L170) - -**`Experimental`** - -Shell command run in each worktree to derive the typecheck-PASS signal. - -*** - -### require? - -> `optional` **require?**: readonly (`"tests"` \| `"typecheck"`)[] - -Defined in: [loop-runner.ts:172](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L172) - -**`Experimental`** - -Which verification signals the deliverable REQUIRES present-and-passing (default none). - -*** - -### maxDiffLines? - -> `optional` **maxDiffLines?**: `number` - -Defined in: [loop-runner.ts:174](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L174) - -**`Experimental`** - -Diff-size cap (lines). - -*** - -### forbiddenPaths? - -> `optional` **forbiddenPaths?**: `string`[] - -Defined in: [loop-runner.ts:176](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L176) - -**`Experimental`** - -Literal path prefixes the patch must not touch (the secret-floor is always on regardless). - -*** - -### winnerStrategy? - -> `optional` **winnerStrategy?**: [`WinnerStrategy`](../../runtime/type-aliases/WinnerStrategy.md) - -Defined in: [loop-runner.ts:178](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L178) - -**`Experimental`** - -Winner-selection strategy among gated candidates. Default `highest-score`. - -*** - -### runGit? - -> `optional` **runGit?**: [`GitRunner`](../../mcp/type-aliases/GitRunner.md) - -Defined in: [loop-runner.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L180) - -**`Experimental`** - -Test seams forwarded to the worktree-CLI leaves so the runner drives offline. - -*** - -### runHarness? - -> `optional` **runHarness?**: (`options`) => `Promise`\<[`LocalHarnessResult`](../../mcp/interfaces/LocalHarnessResult.md)\> - -Defined in: [loop-runner.ts:181](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L181) - -**`Experimental`** - -**`Experimental`** - -Spawn a local coding harness CLI as a subprocess + collect its output. - -NOT responsible for parsing the harness's output or extracting a diff — -the in-process executor's `streamPrompt` orchestrates `git diff` against -the worktree after this resolves. This function is intentionally narrow: -spawn, wait, capture, return. - -Fails loud — throws when: - - `cwd` doesn't exist (subprocess emits ENOENT; surfaced as Error) - - the harness binary is not on PATH (ENOENT) - -Does NOT throw when: - - the subprocess exits non-zero (`result.exitCode` carries the code) - - the subprocess is aborted / timed out (`result.killedBySignal` / - `result.timedOut` carries the reason) - -#### Parameters - -##### options - -[`RunLocalHarnessOptions`](../../mcp/interfaces/RunLocalHarnessOptions.md) - -#### Returns - -`Promise`\<[`LocalHarnessResult`](../../mcp/interfaces/LocalHarnessResult.md)\> - -*** - -### runCommand? - -> `optional` **runCommand?**: `WorktreeCheckRunner` - -Defined in: [loop-runner.ts:182](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L182) - -**`Experimental`** diff --git a/docs/api/index/type-aliases/AgentRuntimeEvent.md b/docs/api/index/type-aliases/AgentRuntimeEvent.md deleted file mode 100644 index 06672ef..0000000 --- a/docs/api/index/type-aliases/AgentRuntimeEvent.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / AgentRuntimeEvent - -# Type Alias: AgentRuntimeEvent\ - -> **AgentRuntimeEvent**\<`TState`, `TAction`, `TActionResult`, `TEval`\> = \{ `type`: `"task_start"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); \} \| \{ `type`: `"readiness_start"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); \} \| \{ `type`: `"readiness_end"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `knowledge`: `KnowledgeReadinessReport`; \} \| \{ `type`: `"questions_start"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `questions`: `UserQuestion`[]; \} \| \{ `type`: `"questions_end"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `questions`: `UserQuestion`[]; `userAnswers`: `Record`\<`string`, `string`\>; \} \| \{ `type`: `"acquisition_start"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `acquisitionPlans`: `DataAcquisitionPlan`[]; \} \| \{ `type`: `"acquisition_end"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `acquisitionPlans`: `DataAcquisitionPlan`[]; `acquiredEvidenceIds`: `string`[]; \} \| \{ `type`: `"control_start"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `knowledge`: `KnowledgeReadinessReport`; \} \| \{ `type`: `"control_step"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `step`: `ControlStep`\<`TState`, `TAction`, `TActionResult`, `TEval`\>; \} \| \{ `type`: `"control_end"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `control`: `ControlRunResult`\<`TState`, `TAction`, `TActionResult`, `TEval`\>; \} \| \{ `type`: `"task_end"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `status`: [`AgentTaskStatus`](AgentTaskStatus.md); `reason`: `string`; \} - -Defined in: [types.ts:147](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L147) - -## Type Parameters - -### TState - -`TState` = `unknown` - -### TAction - -`TAction` = `unknown` - -### TActionResult - -`TActionResult` = `unknown` - -### TEval - -`TEval` *extends* `ControlEvalResult` = `ControlEvalResult` - -## Stable diff --git a/docs/api/index/type-aliases/AgentRuntimeEventSink.md b/docs/api/index/type-aliases/AgentRuntimeEventSink.md deleted file mode 100644 index 3242de5..0000000 --- a/docs/api/index/type-aliases/AgentRuntimeEventSink.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / AgentRuntimeEventSink - -# Type Alias: AgentRuntimeEventSink\ - -> **AgentRuntimeEventSink**\<`TState`, `TAction`, `TActionResult`, `TEval`\> = (`event`) => `Promise`\<`void`\> \| `void` - -Defined in: [types.ts:188](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L188) - -## Type Parameters - -### TState - -`TState` = `unknown` - -### TAction - -`TAction` = `unknown` - -### TActionResult - -`TActionResult` = `unknown` - -### TEval - -`TEval` *extends* `ControlEvalResult` = `ControlEvalResult` - -## Parameters - -### event - -[`AgentRuntimeEvent`](AgentRuntimeEvent.md)\<`TState`, `TAction`, `TActionResult`, `TEval`\> - -## Returns - -`Promise`\<`void`\> \| `void` - -## Stable diff --git a/docs/api/index/type-aliases/AgentTaskStatus.md b/docs/api/index/type-aliases/AgentTaskStatus.md deleted file mode 100644 index ce5d1bb..0000000 --- a/docs/api/index/type-aliases/AgentTaskStatus.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / AgentTaskStatus - -# Type Alias: AgentTaskStatus - -> **AgentTaskStatus** = `"completed"` \| `"blocked"` \| `"failed"` \| `"aborted"` - -Defined in: [types.ts:144](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L144) - -## Stable diff --git a/docs/api/index/type-aliases/AuthSource.md b/docs/api/index/type-aliases/AuthSource.md deleted file mode 100644 index 6509fbf..0000000 --- a/docs/api/index/type-aliases/AuthSource.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / AuthSource - -# Type Alias: AuthSource - -> **AuthSource** = `"forward-user"` \| `"agent-owned"` \| ((`state`) => `"forward-user"` \| `"agent-owned"`) - -Defined in: [conversation/types.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L67) - -## Stable diff --git a/docs/api/index/type-aliases/ConversationStreamEvent.md b/docs/api/index/type-aliases/ConversationStreamEvent.md deleted file mode 100644 index ddc07da..0000000 --- a/docs/api/index/type-aliases/ConversationStreamEvent.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ConversationStreamEvent - -# Type Alias: ConversationStreamEvent - -> **ConversationStreamEvent** = \{ `type`: `"conversation_start"`; `runId`: `string`; `participants`: readonly `string`[]; `seed`: `string`; `timestamp`: `string`; \} \| \{ `type`: `"conversation_resumed"`; `runId`: `string`; `participants`: readonly `string`[]; `transcript`: readonly [`ConversationTurn`](../interfaces/ConversationTurn.md)[]; `timestamp`: `string`; \} \| \{ `type`: `"turn_start"`; `runId`: `string`; `index`: `number`; `speaker`: `string`; `turnId`: `string`; `attempt`: `number`; `timestamp`: `string`; \} \| \{ `type`: `"turn_text_delta"`; `runId`: `string`; `index`: `number`; `speaker`: `string`; `turnId`: `string`; `text`: `string`; `timestamp?`: `string`; \} \| \{ `type`: `"turn_retry"`; `runId`: `string`; `index`: `number`; `speaker`: `string`; `turnId`: `string`; `attempt`: `number`; `reason`: `string`; `timestamp`: `string`; \} \| \{ `type`: `"turn_end"`; `runId`: `string`; `turn`: [`ConversationTurn`](../interfaces/ConversationTurn.md); `timestamp`: `string`; \} \| \{ `type`: `"conversation_end"`; `runId`: `string`; `result`: [`ConversationResult`](../interfaces/ConversationResult.md); `timestamp`: `string`; \} - -Defined in: [conversation/types.ts:236](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L236) - -## Stable diff --git a/docs/api/index/type-aliases/DelegatedLoopMode.md b/docs/api/index/type-aliases/DelegatedLoopMode.md deleted file mode 100644 index 4766b79..0000000 --- a/docs/api/index/type-aliases/DelegatedLoopMode.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / DelegatedLoopMode - -# Type Alias: DelegatedLoopMode - -> **DelegatedLoopMode** = *typeof* [`DELEGATED_LOOP_MODES`](../variables/DELEGATED_LOOP_MODES.md)\[`number`\] - -Defined in: [loop-runner.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L58) - -**`Experimental`** diff --git a/docs/api/index/type-aliases/DelegatedLoopRegistry.md b/docs/api/index/type-aliases/DelegatedLoopRegistry.md deleted file mode 100644 index a090d0b..0000000 --- a/docs/api/index/type-aliases/DelegatedLoopRegistry.md +++ /dev/null @@ -1,16 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / DelegatedLoopRegistry - -# Type Alias: DelegatedLoopRegistry - -> **DelegatedLoopRegistry** = `Partial`\<`Record`\<[`DelegatedLoopMode`](DelegatedLoopMode.md), [`DelegatedLoopRunner`](DelegatedLoopRunner.md)\>\> - -Defined in: [loop-runner.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L71) - -**`Experimental`** - -Mode → configured runner. Partial: only register the modes a - given product/routine actually uses. diff --git a/docs/api/index/type-aliases/DelegatedLoopRunner.md b/docs/api/index/type-aliases/DelegatedLoopRunner.md deleted file mode 100644 index 0ed9e33..0000000 --- a/docs/api/index/type-aliases/DelegatedLoopRunner.md +++ /dev/null @@ -1,32 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / DelegatedLoopRunner - -# Type Alias: DelegatedLoopRunner\ - -> **DelegatedLoopRunner**\<`T`\> = (`signal`) => `Promise`\<`T`\> - -Defined in: [loop-runner.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L67) - -**`Experimental`** - -A pre-configured loop for one mode. Returns the mode's raw - output; the dispatcher wraps it in a [DelegatedLoopResult](../interfaces/DelegatedLoopResult.md). - -## Type Parameters - -### T - -`T` = `unknown` - -## Parameters - -### signal - -`AbortSignal` - -## Returns - -`Promise`\<`T`\> diff --git a/docs/api/index/type-aliases/ForwardHeaderName.md b/docs/api/index/type-aliases/ForwardHeaderName.md deleted file mode 100644 index 9fc6fa6..0000000 --- a/docs/api/index/type-aliases/ForwardHeaderName.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ForwardHeaderName - -# Type Alias: ForwardHeaderName - -> **ForwardHeaderName** = *typeof* [`FORWARD_HEADERS`](../variables/FORWARD_HEADERS.md)\[keyof *typeof* [`FORWARD_HEADERS`](../variables/FORWARD_HEADERS.md)\] - -Defined in: [conversation/headers.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/headers.ts#L34) diff --git a/docs/api/index/type-aliases/HaltPredicate.md b/docs/api/index/type-aliases/HaltPredicate.md deleted file mode 100644 index 2dbaeb1..0000000 --- a/docs/api/index/type-aliases/HaltPredicate.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / HaltPredicate - -# Type Alias: HaltPredicate - -> **HaltPredicate** = (`ctx`) => `boolean` \| [`HaltSignal`](../interfaces/HaltSignal.md) \| `Promise`\<`boolean` \| [`HaltSignal`](../interfaces/HaltSignal.md)\> - -Defined in: [conversation/types.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L94) - -## Parameters - -### ctx - -[`HaltContext`](../interfaces/HaltContext.md) - -## Returns - -`boolean` \| [`HaltSignal`](../interfaces/HaltSignal.md) \| `Promise`\<`boolean` \| [`HaltSignal`](../interfaces/HaltSignal.md)\> - -## Stable diff --git a/docs/api/index/type-aliases/HaltReason.md b/docs/api/index/type-aliases/HaltReason.md deleted file mode 100644 index 2628cac..0000000 --- a/docs/api/index/type-aliases/HaltReason.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / HaltReason - -# Type Alias: HaltReason - -> **HaltReason** = \{ `kind`: `"max_turns"`; `turns`: `number`; \} \| \{ `kind`: `"max_credits"`; `spentCents`: `number`; `capCents`: `number`; \} \| \{ `kind`: `"predicate"`; `reason`: `string`; \} \| \{ `kind`: `"abort"`; \} \| \{ `kind`: `"participant_error"`; `participant`: `string`; `message`: `string`; \} - -Defined in: [conversation/types.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L99) - -## Stable diff --git a/docs/api/index/type-aliases/OpenAIChatToolChoice.md b/docs/api/index/type-aliases/OpenAIChatToolChoice.md deleted file mode 100644 index d0609f7..0000000 --- a/docs/api/index/type-aliases/OpenAIChatToolChoice.md +++ /dev/null @@ -1,18 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / OpenAIChatToolChoice - -# Type Alias: OpenAIChatToolChoice - -> **OpenAIChatToolChoice** = `"auto"` \| `"none"` \| `"required"` \| \{ `type`: `"function"`; `function`: \{ `name`: `string`; \}; \} - -Defined in: [types.ts:256](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L256) - -## Stable - -`tool_choice` parameter for OpenAI-compat chat. Same shape as the OpenAI -spec: `'auto'` (default — model decides), `'none'` (disable tool calling -for this turn), `'required'` (force a tool call), or a specific function -pin `{ type: 'function', function: { name } }`. diff --git a/docs/api/index/type-aliases/PersonaDriver.md b/docs/api/index/type-aliases/PersonaDriver.md deleted file mode 100644 index c4004be..0000000 --- a/docs/api/index/type-aliases/PersonaDriver.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / PersonaDriver - -# Type Alias: PersonaDriver - -> **PersonaDriver** = \{ `kind`: `"profile"`; `profile`: `AgentProfile`; \} \| \{ `kind`: `"scripted"`; `turns`: `string`[]; \} - -Defined in: [conversation/run-persona.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/run-persona.ts#L32) - -A persona that drives the conversation: either a full driver `AgentProfile` - (an LLM user-sim) or a deterministic script of user turns (the fast-path). diff --git a/docs/api/index/type-aliases/PropagatedHeaders.md b/docs/api/index/type-aliases/PropagatedHeaders.md deleted file mode 100644 index c3d2656..0000000 --- a/docs/api/index/type-aliases/PropagatedHeaders.md +++ /dev/null @@ -1,16 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / PropagatedHeaders - -# Type Alias: PropagatedHeaders - -> **PropagatedHeaders** = `Readonly`\<`Record`\<`string`, `string`\>\> - -Defined in: [conversation/headers.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/headers.ts#L110) - -Header bag carried through `AgentBackendContext.propagatedHeaders` so -backends that opt in can merge them into their outbound HTTP requests. -Distinct from `buildForwardHeaders` so callers can attach extra -non-protocol headers (e.g. tracing) without colliding. diff --git a/docs/api/index/type-aliases/RetryBackoff.md b/docs/api/index/type-aliases/RetryBackoff.md deleted file mode 100644 index 66c399e..0000000 --- a/docs/api/index/type-aliases/RetryBackoff.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RetryBackoff - -# Type Alias: RetryBackoff - -> **RetryBackoff** = `number` \| ((`attempt`) => `number`) - -Defined in: [conversation/call-policy.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L20) - -Backoff between attempts. Constant ms, or `(attempt: 1-indexed) => ms`. diff --git a/docs/api/index/type-aliases/RetryableErrorPredicate.md b/docs/api/index/type-aliases/RetryableErrorPredicate.md deleted file mode 100644 index 7e53a3c..0000000 --- a/docs/api/index/type-aliases/RetryableErrorPredicate.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RetryableErrorPredicate - -# Type Alias: RetryableErrorPredicate - -> **RetryableErrorPredicate** = (`err`) => `boolean` - -Defined in: [conversation/call-policy.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L17) - -Pure judgment of whether an error is worth retrying. Defaults: TimeoutError, AbortError, fetch-level network errors. - -## Parameters - -### err - -`unknown` - -## Returns - -`boolean` diff --git a/docs/api/index/type-aliases/RuntimeDecisionKind.md b/docs/api/index/type-aliases/RuntimeDecisionKind.md deleted file mode 100644 index fb2b4cc..0000000 --- a/docs/api/index/type-aliases/RuntimeDecisionKind.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeDecisionKind - -# Type Alias: RuntimeDecisionKind - -> **RuntimeDecisionKind** = `"continue"` \| `"verify"` \| `"ask"` \| `"retry"` \| `"stop"` \| `"memory-write"` \| `"memory-read"` \| `"tool-select"` \| `"skill-select"` \| `"workflow-select"` \| `"surface-promote"` \| `string` & `object` - -Defined in: [runtime-hooks.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L21) diff --git a/docs/api/index/type-aliases/RuntimeHookPhase.md b/docs/api/index/type-aliases/RuntimeHookPhase.md deleted file mode 100644 index 8948e0b..0000000 --- a/docs/api/index/type-aliases/RuntimeHookPhase.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeHookPhase - -# Type Alias: RuntimeHookPhase - -> **RuntimeHookPhase** = `"before"` \| `"after"` \| `"error"` \| `"event"` - -Defined in: [runtime-hooks.ts:9](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L9) - -**`Experimental`** - -Runtime hook contracts. Hooks are execution-scoped observers, not part of an -`AgentProfile`: profiles stay portable agent recipes; hooks attach to the -loop or product harness that is running the profile. diff --git a/docs/api/index/type-aliases/RuntimeHookTarget.md b/docs/api/index/type-aliases/RuntimeHookTarget.md deleted file mode 100644 index 559db2e..0000000 --- a/docs/api/index/type-aliases/RuntimeHookTarget.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeHookTarget - -# Type Alias: RuntimeHookTarget - -> **RuntimeHookTarget** = `"agent.run"` \| `"agent.turn"` \| `"agent.tool_call"` \| `"agent.spawn"` \| `"agent.child"` \| `"agent.plan"` \| `"agent.decision"` \| `string` & `object` - -Defined in: [runtime-hooks.ts:11](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime-hooks.ts#L11) diff --git a/docs/api/index/type-aliases/RuntimeStreamEvent.md b/docs/api/index/type-aliases/RuntimeStreamEvent.md deleted file mode 100644 index a1202dd..0000000 --- a/docs/api/index/type-aliases/RuntimeStreamEvent.md +++ /dev/null @@ -1,224 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / RuntimeStreamEvent - -# Type Alias: RuntimeStreamEvent - -> **RuntimeStreamEvent** = \{ `type`: `"task_start"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `timestamp`: `string`; \} \| \{ `type`: `"readiness_start"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `timestamp`: `string`; \} \| \{ `type`: `"readiness_end"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `knowledge`: `KnowledgeReadinessReport`; `decision`: `KnowledgeReadinessDecision`; `timestamp`: `string`; \} \| \{ `type`: `"questions_start"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `questions`: `UserQuestion`[]; `timestamp`: `string`; \} \| \{ `type`: `"questions_end"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `questions`: `UserQuestion`[]; `userAnswers`: `Record`\<`string`, `string`\>; `timestamp`: `string`; \} \| \{ `type`: `"acquisition_start"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `acquisitionPlans`: `DataAcquisitionPlan`[]; `timestamp`: `string`; \} \| \{ `type`: `"acquisition_end"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `acquisitionPlans`: `DataAcquisitionPlan`[]; `acquiredEvidenceIds`: `string`[]; `timestamp`: `string`; \} \| \{ `type`: `"session_created"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session`: `RuntimeSession`; `timestamp`: `string`; \} \| \{ `type`: `"session_resumed"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session`: `RuntimeSession`; `timestamp`: `string`; \} \| \{ `type`: `"backend_start"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session`: `RuntimeSession`; `backend`: `string`; `timestamp`: `string`; \} \| \{ `type`: `"text_delta"`; `task?`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `text`: `string`; `timestamp?`: `string`; \} \| \{ `type`: `"reasoning_delta"`; `task?`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `text`: `string`; `timestamp?`: `string`; \} \| \{ `type`: `"tool_call"`; `task?`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `toolName`: `string`; `toolCallId?`: `string`; `args?`: `unknown`; `timestamp?`: `string`; \} \| \{ `type`: `"tool_result"`; `task?`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `toolName`: `string`; `toolCallId?`: `string`; `result?`: `unknown`; `timestamp?`: `string`; \} \| \{ `type`: `"llm_call"`; `task?`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `model`: `string`; `tokensIn?`: `number`; `tokensOut?`: `number`; `costUsd?`: `number`; `latencyMs?`: `number`; `finishReason?`: `string`; `timestamp?`: `string`; \} \| \{ `type`: `"artifact"`; `task?`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `artifactId`: `string`; `name?`: `string`; `mimeType?`: `string`; `uri?`: `string`; `content?`: `string`; `metadata?`: `Record`\<`string`, `unknown`\>; `timestamp?`: `string`; \} \| \{ `type`: `"proposal_created"`; `task?`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `proposalId`: `string`; `title`: `string`; `status?`: `"pending"` \| `"approved"` \| `"rejected"`; `content?`: `string`; `timestamp?`: `string`; \} \| \{ `type`: `"backend_error"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `backend`: `string`; `message`: `string`; `recoverable`: `boolean`; `error?`: [`BackendErrorDetail`](../interfaces/BackendErrorDetail.md); `timestamp`: `string`; \} \| \{ `type`: `"backend_end"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session`: `RuntimeSession`; `backend`: `string`; `timestamp`: `string`; \} \| \{ `type`: `"task_end"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `status`: [`AgentTaskStatus`](AgentTaskStatus.md); `reason`: `string`; `timestamp`: `string`; \} \| \{ `type`: `"final"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `status`: [`AgentTaskStatus`](AgentTaskStatus.md); `reason`: `string`; `text?`: `string`; `metadata?`: `Record`\<`string`, `unknown`\>; `error?`: [`BackendErrorDetail`](../interfaces/BackendErrorDetail.md); `timestamp`: `string`; \} - -Defined in: [types.ts:263](https://github.com/tangle-network/agent-runtime/blob/main/src/types.ts#L263) - -## Union Members - -### Type Literal - -\{ `type`: `"task_start"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `timestamp`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"readiness_start"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `timestamp`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"readiness_end"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `knowledge`: `KnowledgeReadinessReport`; `decision`: `KnowledgeReadinessDecision`; `timestamp`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"questions_start"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `questions`: `UserQuestion`[]; `timestamp`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"questions_end"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `questions`: `UserQuestion`[]; `userAnswers`: `Record`\<`string`, `string`\>; `timestamp`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"acquisition_start"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `acquisitionPlans`: `DataAcquisitionPlan`[]; `timestamp`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"acquisition_end"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `acquisitionPlans`: `DataAcquisitionPlan`[]; `acquiredEvidenceIds`: `string`[]; `timestamp`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"session_created"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session`: `RuntimeSession`; `timestamp`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"session_resumed"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session`: `RuntimeSession`; `timestamp`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"backend_start"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session`: `RuntimeSession`; `backend`: `string`; `timestamp`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"text_delta"`; `task?`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `text`: `string`; `timestamp?`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"reasoning_delta"`; `task?`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `text`: `string`; `timestamp?`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"tool_call"`; `task?`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `toolName`: `string`; `toolCallId?`: `string`; `args?`: `unknown`; `timestamp?`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"tool_result"`; `task?`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `toolName`: `string`; `toolCallId?`: `string`; `result?`: `unknown`; `timestamp?`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"llm_call"`; `task?`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `model`: `string`; `tokensIn?`: `number`; `tokensOut?`: `number`; `costUsd?`: `number`; `latencyMs?`: `number`; `finishReason?`: `string`; `timestamp?`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"artifact"`; `task?`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `artifactId`: `string`; `name?`: `string`; `mimeType?`: `string`; `uri?`: `string`; `content?`: `string`; `metadata?`: `Record`\<`string`, `unknown`\>; `timestamp?`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"proposal_created"`; `task?`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `proposalId`: `string`; `title`: `string`; `status?`: `"pending"` \| `"approved"` \| `"rejected"`; `content?`: `string`; `timestamp?`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"backend_error"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `backend`: `string`; `message`: `string`; `recoverable`: `boolean`; `error?`: [`BackendErrorDetail`](../interfaces/BackendErrorDetail.md); `timestamp`: `string`; \} - -#### type - -> **type**: `"backend_error"` - -#### task - -> **task**: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md) - -#### session? - -> `optional` **session?**: `RuntimeSession` - -#### backend - -> **backend**: `string` - -#### message - -> **message**: `string` - -#### recoverable - -> **recoverable**: `boolean` - -#### error? - -> `optional` **error?**: [`BackendErrorDetail`](../interfaces/BackendErrorDetail.md) - -Typed transport diagnostic. Present when the upstream returned a -non-success HTTP status or every retry attempt threw. Consumers MUST -surface this onto their `RunRecord.error` — silently treating a -`backend_error` as "no output" hides credit exhaustion, auth failure, -and upstream outages from operators. - - `kind: 'transport'` — HTTP / network failure with optional `status` - + truncated response `body`. - - `kind: 'backend'` — the backend's `stream()` generator threw for a - reason that isn't a recognized transport failure. - -#### timestamp - -> **timestamp**: `string` - -*** - -### Type Literal - -\{ `type`: `"backend_end"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session`: `RuntimeSession`; `backend`: `string`; `timestamp`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"task_end"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `status`: [`AgentTaskStatus`](AgentTaskStatus.md); `reason`: `string`; `timestamp`: `string`; \} - -*** - -### Type Literal - -\{ `type`: `"final"`; `task`: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md); `session?`: `RuntimeSession`; `status`: [`AgentTaskStatus`](AgentTaskStatus.md); `reason`: `string`; `text?`: `string`; `metadata?`: `Record`\<`string`, `unknown`\>; `error?`: [`BackendErrorDetail`](../interfaces/BackendErrorDetail.md); `timestamp`: `string`; \} - -#### type - -> **type**: `"final"` - -#### task - -> **task**: [`AgentTaskSpec`](../interfaces/AgentTaskSpec.md) - -#### session? - -> `optional` **session?**: `RuntimeSession` - -#### status - -> **status**: [`AgentTaskStatus`](AgentTaskStatus.md) - -#### reason - -> **reason**: `string` - -#### text? - -> `optional` **text?**: `string` - -#### metadata? - -> `optional` **metadata?**: `Record`\<`string`, `unknown`\> - -#### error? - -> `optional` **error?**: [`BackendErrorDetail`](../interfaces/BackendErrorDetail.md) - -Typed terminal-error diagnostic. Mirrors the `backend_error.error` -shape so a consumer that only listens for `final` still receives a -loud, structured failure when the backend never produced output. Only -set when `status !== 'completed'`. Consumers building a `RunRecord` -MUST map this to `RunRecord.error` rather than recording silent -`error: null` with empty `finalText`. - -#### timestamp - -> **timestamp**: `string` - -## Stable diff --git a/docs/api/index/type-aliases/StreamToolLoopYield.md b/docs/api/index/type-aliases/StreamToolLoopYield.md deleted file mode 100644 index 560244e..0000000 --- a/docs/api/index/type-aliases/StreamToolLoopYield.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / StreamToolLoopYield - -# Type Alias: StreamToolLoopYield\ - -> **StreamToolLoopYield**\<`Raw`\> = \{ `kind`: `"event"`; `event`: `Raw`; \} \| \{ `kind`: `"tool_result"`; `toolName`: `string`; `toolCallId?`: `string`; `label`: `string`; `outcome`: [`ToolCallOutcome`](ToolCallOutcome.md); \} \| \{ `kind`: `"capped"`; `pending`: `number`; `stopReason`: `Exclude`\<[`ToolLoopStopReason`](ToolLoopStopReason.md), `"completed"`\>; \} - -Defined in: [tool-loop.ts:298](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L298) - -## Type Parameters - -### Raw - -`Raw` diff --git a/docs/api/index/type-aliases/ToolCallOutcome.md b/docs/api/index/type-aliases/ToolCallOutcome.md deleted file mode 100644 index afa49de..0000000 --- a/docs/api/index/type-aliases/ToolCallOutcome.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ToolCallOutcome - -# Type Alias: ToolCallOutcome - -> **ToolCallOutcome** = \{ `ok`: `true`; `result`: `unknown`; \} \| \{ `ok`: `false`; `code`: `string`; `message`: `string`; `status?`: `number`; \} - -Defined in: [tool-loop.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L30) - -Outcome of one tool dispatch — structurally compatible with a hub/integration - tool-outcome union, so callers can fold either through the loop. diff --git a/docs/api/index/type-aliases/ToolLoopEvent.md b/docs/api/index/type-aliases/ToolLoopEvent.md deleted file mode 100644 index 3968810..0000000 --- a/docs/api/index/type-aliases/ToolLoopEvent.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ToolLoopEvent - -# Type Alias: ToolLoopEvent - -> **ToolLoopEvent** = \{ `type`: `"text"`; `text`: `string`; \} \| \{ `type`: `"tool_call"`; `call`: [`ToolLoopCall`](../interfaces/ToolLoopCall.md); \} \| \{ `type`: `"other"`; `event`: `unknown`; \} - -Defined in: [tool-loop.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L108) diff --git a/docs/api/index/type-aliases/ToolLoopMessage.md b/docs/api/index/type-aliases/ToolLoopMessage.md deleted file mode 100644 index 162abd5..0000000 --- a/docs/api/index/type-aliases/ToolLoopMessage.md +++ /dev/null @@ -1,59 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ToolLoopMessage - -# Type Alias: ToolLoopMessage - -> **ToolLoopMessage** = `object` - -Defined in: [tool-loop.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L68) - -A message in the running conversation the loop sends to `streamTurn`. - -The base `{ role, content }` covers `system` / `user` / plain `assistant` -turns. Two optional fields carry the OpenAI function-calling contract so a -strict model (Claude, and any OpenAI-compatible provider that validates tool -history) reads its own tool use back instead of re-issuing the same call: - - - an assistant turn that emitted tool calls carries `tool_calls`, and its - `content` is `null` when the turn was tool-only; - - each tool result is its own `{ role: 'tool', tool_call_id, content }` - message keyed to the call that produced it. - -Widening is additive: a `streamTurn` that reads only `role` + `content` still -works; one that forwards the whole message to an OpenAI-compatible endpoint -now sends correct tool history. - -## Properties - -### role - -> **role**: `string` - -Defined in: [tool-loop.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L69) - -*** - -### content - -> **content**: `string` \| `null` - -Defined in: [tool-loop.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L70) - -*** - -### tool\_calls? - -> `optional` **tool\_calls?**: [`ToolLoopAssistantToolCall`](../interfaces/ToolLoopAssistantToolCall.md)[] - -Defined in: [tool-loop.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L71) - -*** - -### tool\_call\_id? - -> `optional` **tool\_call\_id?**: `string` - -Defined in: [tool-loop.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L72) diff --git a/docs/api/index/type-aliases/ToolLoopStopReason.md b/docs/api/index/type-aliases/ToolLoopStopReason.md deleted file mode 100644 index 58e47b6..0000000 --- a/docs/api/index/type-aliases/ToolLoopStopReason.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / ToolLoopStopReason - -# Type Alias: ToolLoopStopReason - -> **ToolLoopStopReason** = `"completed"` \| `"stuck-loop"` \| `"backstop"` \| `"deadline"` \| `"budget"` - -Defined in: [tool-loop.ts:118](https://github.com/tangle-network/agent-runtime/blob/main/src/tool-loop.ts#L118) - -Why the loop stopped. `completed` = model finished naturally; `stuck-loop` = - ≥3 consecutive identical tool calls (same tool + args); `backstop` = hit the - runaway-backstop cap (200 by default); `deadline` = wall-clock deadlineMs - exceeded; `budget` = maxCostUsd exhausted. Non-`completed` stops are infra / - resource outcomes — eval scoring must distinguish them from capability failure. diff --git a/docs/api/index/type-aliases/TurnOrder.md b/docs/api/index/type-aliases/TurnOrder.md deleted file mode 100644 index e985ff8..0000000 --- a/docs/api/index/type-aliases/TurnOrder.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / TurnOrder - -# Type Alias: TurnOrder - -> **TurnOrder** = `"alternate"` \| `"round-robin"` \| ((`state`) => `number`) - -Defined in: [conversation/types.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/types.ts#L73) - -## Stable diff --git a/docs/api/index/variables/DEFAULT_MAX_DEPTH.md b/docs/api/index/variables/DEFAULT_MAX_DEPTH.md deleted file mode 100644 index 10697d1..0000000 --- a/docs/api/index/variables/DEFAULT_MAX_DEPTH.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / DEFAULT\_MAX\_DEPTH - -# Variable: DEFAULT\_MAX\_DEPTH - -> `const` **DEFAULT\_MAX\_DEPTH**: `4` = `4` - -Defined in: [conversation/headers.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/headers.ts#L37) - -Hard cap on chained gateway hops; refused beyond this. Default keeps recursion bounded. diff --git a/docs/api/index/variables/DEFAULT_ROUTER_BASE_URL.md b/docs/api/index/variables/DEFAULT_ROUTER_BASE_URL.md deleted file mode 100644 index 3004789..0000000 --- a/docs/api/index/variables/DEFAULT_ROUTER_BASE_URL.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / DEFAULT\_ROUTER\_BASE\_URL - -# Variable: DEFAULT\_ROUTER\_BASE\_URL - -> `const` **DEFAULT\_ROUTER\_BASE\_URL**: `"https://router.tangle.tools"` = `'https://router.tangle.tools'` - -Defined in: [model-resolution.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/model-resolution.ts#L41) diff --git a/docs/api/index/variables/DELEGATED_LOOP_MODES.md b/docs/api/index/variables/DELEGATED_LOOP_MODES.md deleted file mode 100644 index 4917f60..0000000 --- a/docs/api/index/variables/DELEGATED_LOOP_MODES.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / DELEGATED\_LOOP\_MODES - -# Variable: DELEGATED\_LOOP\_MODES - -> `const` **DELEGATED\_LOOP\_MODES**: readonly \[`"code"`, `"review"`, `"research"`, `"audit"`, `"self-improve"`\] - -Defined in: [loop-runner.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/loop-runner.ts#L55) - -**`Experimental`** - -Every delegated-loop mode, for validation + CLI surfaces. diff --git a/docs/api/index/variables/FORWARD_HEADERS.md b/docs/api/index/variables/FORWARD_HEADERS.md deleted file mode 100644 index bc59908..0000000 --- a/docs/api/index/variables/FORWARD_HEADERS.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / FORWARD\_HEADERS - -# Variable: FORWARD\_HEADERS - -> `const` **FORWARD\_HEADERS**: `object` - -Defined in: [conversation/headers.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/headers.ts#L19) - -Standard names — lowercased so Headers maps interop on every runtime. - -## Type Declaration - -### authorization - -> `readonly` **authorization**: `"x-tangle-forwarded-authorization"` = `'x-tangle-forwarded-authorization'` - -Forwarded original-user identity (`Bearer sk-tan-`); downstream gateways bill against this. - -### depth - -> `readonly` **depth**: `"x-tangle-forwarded-depth"` = `'x-tangle-forwarded-depth'` - -Monotonically incremented on every gateway hop. Refused at MAX_DEPTH. - -### runId - -> `readonly` **runId**: `"x-tangle-runid"` = `'x-tangle-runid'` - -Top-level conversation run identifier, propagated through every nested call. - -### turnId - -> `readonly` **turnId**: `"x-tangle-turnid"` = `'x-tangle-turnid'` - -This call's turn within the run; deterministic + stable across retries. - -### parentTurnId - -> `readonly` **parentTurnId**: `"x-tangle-parent-turnid"` = `'x-tangle-parent-turnid'` - -When the call is *inside* another turn (recursion), the parent turn's id. - -### speaker - -> `readonly` **speaker**: `"x-tangle-speaker"` = `'x-tangle-speaker'` - -Logical conversation peer label at the sending side, for trace stitching. diff --git a/docs/api/index/variables/INTELLIGENCE_WIRE_VERSION.md b/docs/api/index/variables/INTELLIGENCE_WIRE_VERSION.md deleted file mode 100644 index e808362..0000000 --- a/docs/api/index/variables/INTELLIGENCE_WIRE_VERSION.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / INTELLIGENCE\_WIRE\_VERSION - -# Variable: INTELLIGENCE\_WIRE\_VERSION - -> `const` **INTELLIGENCE\_WIRE\_VERSION**: `"2026-05-26.v1"` = `'2026-05-26.v1'` - -Defined in: [otel-export.ts:519](https://github.com/tangle-network/agent-runtime/blob/main/src/otel-export.ts#L519) - -Wire version the eval-runs ingest enforces (X-Tangle-Wire-Version + body). diff --git a/docs/api/index/variables/defaultIsRetryable.md b/docs/api/index/variables/defaultIsRetryable.md deleted file mode 100644 index 36472cf..0000000 --- a/docs/api/index/variables/defaultIsRetryable.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [index](../README.md) / defaultIsRetryable - -# Variable: defaultIsRetryable - -> `const` **defaultIsRetryable**: [`RetryableErrorPredicate`](../type-aliases/RetryableErrorPredicate.md) - -Defined in: [conversation/call-policy.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/conversation/call-policy.ts#L62) - -Default retryable classification — network/timeout class errors. Errors -a model deliberately throws (validation, refusal, 4xx) are not retried; -those represent real outcomes, not transient infrastructure faults. diff --git a/docs/api/intelligence.md b/docs/api/intelligence.md new file mode 100644 index 0000000..69b8db6 --- /dev/null +++ b/docs/api/intelligence.md @@ -0,0 +1,2360 @@ +[**@tangle-network/agent-runtime**](README.md) + +*** + +[@tangle-network/agent-runtime](README.md) / intelligence + +# intelligence + +## Classes + +### CapabilityNotAdmittedError + +Defined in: [intelligence/capability.ts:245](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L245) + +A binding kind whose resolver case is typed but not yet admitted (rag-index, +memory-store, wasm, a2a). Thrown by the resolver — NEVER faked into a working +surface. The TYPE arms exist so the union is closed against the spec; the +resolver grows them later behind their lifecycle + admission gate. + +#### Extends + +- `Error` + +#### Constructors + +##### Constructor + +> **new CapabilityNotAdmittedError**(`kind`, `capabilityId`, `reason`): [`CapabilityNotAdmittedError`](#capabilitynotadmittederror) + +Defined in: [intelligence/capability.ts:248](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L248) + +###### Parameters + +###### kind + +`"inline"` \| `"file"` \| `"http"` \| `"sandbox-code"` \| `"mcp-stdio"` \| `"mcp-remote"` \| `"process-on-infra"` \| `"rag-index"` \| `"memory-store"` \| `"wasm"` \| `"a2a"` + +###### capabilityId + +`string` + +###### reason + +`string` + +###### Returns + +[`CapabilityNotAdmittedError`](#capabilitynotadmittederror) + +###### Overrides + +`Error.constructor` + +#### Properties + +##### kind + +> `readonly` **kind**: `"inline"` \| `"file"` \| `"http"` \| `"sandbox-code"` \| `"mcp-stdio"` \| `"mcp-remote"` \| `"process-on-infra"` \| `"rag-index"` \| `"memory-store"` \| `"wasm"` \| `"a2a"` + +Defined in: [intelligence/capability.ts:246](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L246) + +##### capabilityId + +> `readonly` **capabilityId**: `string` + +Defined in: [intelligence/capability.ts:247](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L247) + +## Interfaces + +### CredentialRef + +Defined in: [intelligence/capability.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L71) + +A named secret a binding requires — declared, never carried. + +#### Properties + +##### key + +> **key**: `string` + +Defined in: [intelligence/capability.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L72) + +*** + +### HostSpec + +Defined in: [intelligence/capability.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L94) + +The host a `process-on-infra` binding provisions before its inner binding. +Reuses `createExecutor`'s backend-as-data vocabulary — no new runtime invented. +`image` is the sandbox image tag; `warm`/`idleTtlMs`/`costTag` meter standing +cost; `ports` are the inner server's listen ports the host must expose. + +#### Properties + +##### backend + +> **backend**: `"router"` \| `"sandbox"` \| `"cli"` + +Defined in: [intelligence/capability.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L95) + +##### image? + +> `optional` **image?**: `string` + +Defined in: [intelligence/capability.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L96) + +##### ports? + +> `optional` **ports?**: `number`[] + +Defined in: [intelligence/capability.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L97) + +##### warm? + +> `optional` **warm?**: `boolean` + +Defined in: [intelligence/capability.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L98) + +##### idleTtlMs? + +> `optional` **idleTtlMs?**: `number` + +Defined in: [intelligence/capability.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L99) + +##### costTag? + +> `optional` **costTag?**: `string` + +Defined in: [intelligence/capability.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L100) + +*** + +### CertProvenance + +Defined in: [intelligence/capability.ts:154](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L154) + +The certify lane's held-out lift travelling WITH delivery. The shipped +`CertifiedArtifact` envelope minus its content (which moves into the binding +arm): `version`/`contentHash`/`lift` are stamped by the promote step, never +the author. + +`sourcePath` is the artifact's ORIGINAL path (including `null`). It is the +byte-stable fold sort key — the resolver folds context artifacts in +`composeCertifiedPrompt` order, which sorts by `path ?? ''`, so a `null` path +is load-bearing and MUST round-trip exactly. It is distinct from a context +`iface.name` (display only): collapsing the two flips the fold order for a +mix of null-path and non-null-path artifacts. + +#### Properties + +##### contentHash + +> **contentHash**: `string` + +Defined in: [intelligence/capability.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L155) + +##### version + +> **version**: `number` \| `null` + +Defined in: [intelligence/capability.ts:156](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L156) + +##### lift + +> **lift**: `string` \| `null` + +Defined in: [intelligence/capability.ts:157](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L157) + +##### promotedAt + +> **promotedAt**: `string` + +Defined in: [intelligence/capability.ts:158](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L158) + +##### sourcePath + +> **sourcePath**: `string` \| `null` + +Defined in: [intelligence/capability.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L159) + +*** + +### CertifiedCapability + +Defined in: [intelligence/capability.ts:163](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L163) + +One certified unit of agent power. + +#### Properties + +##### id + +> **id**: `string` + +Defined in: [intelligence/capability.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L164) + +##### iface + +> **iface**: [`CapabilityInterface`](#capabilityinterface) + +Defined in: [intelligence/capability.ts:165](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L165) + +##### binding + +> **binding**: [`DeliveryBinding`](#deliverybinding) + +Defined in: [intelligence/capability.ts:166](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L166) + +##### auth + +> **auth**: [`CapabilityAuth`](#capabilityauth) + +Defined in: [intelligence/capability.ts:167](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L167) + +##### provenance + +> **provenance**: [`CertProvenance`](#certprovenance) + +Defined in: [intelligence/capability.ts:168](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L168) + +*** + +### CapabilityManifest + +Defined in: [intelligence/capability.ts:176](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L176) + +The strict generalization of `CertifiedProfile`. `promptSurface` is kept +during the migration window (the shipped pull lane still emits it); new +capabilities live in `capabilities`. + +#### Properties + +##### target + +> **target**: `string` + +Defined in: [intelligence/capability.ts:177](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L177) + +##### generatedAt + +> **generatedAt**: `string` + +Defined in: [intelligence/capability.ts:178](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L178) + +##### promptSurface + +> **promptSurface**: [`CertifiedPromptSurface`](#certifiedpromptsurface) \| `null` + +Defined in: [intelligence/capability.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L179) + +##### capabilities + +> **capabilities**: [`CertifiedCapability`](#certifiedcapability)[] + +Defined in: [intelligence/capability.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L180) + +*** + +### ResolvedRetrieval + +Defined in: [intelligence/capability.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L186) + +One retrieval handle. The agent never learns vector vs graph vs index. + +#### Properties + +##### name + +> **name**: `string` + +Defined in: [intelligence/capability.ts:187](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L187) + +#### Methods + +##### retrieve() + +> **retrieve**(`query`, `k?`): `Promise`\<`object`[]\> + +Defined in: [intelligence/capability.ts:188](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L188) + +###### Parameters + +###### query + +`string` + +###### k? + +`number` + +###### Returns + +`Promise`\<`object`[]\> + +*** + +### ResolvedHook + +Defined in: [intelligence/capability.ts:193](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L193) + +One resolved hook — event + the command/matcher the seam folds into + `AgentProfile.hooks`. + +#### Properties + +##### event + +> **event**: `string` + +Defined in: [intelligence/capability.ts:194](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L194) + +##### command + +> **command**: `string` + +Defined in: [intelligence/capability.ts:195](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L195) + +##### matcher? + +> `optional` **matcher?**: `string` + +Defined in: [intelligence/capability.ts:196](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L196) + +*** + +### ResolvedSubagent + +Defined in: [intelligence/capability.ts:200](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L200) + +One resolved subagent — folded into `AgentProfile.subagents`. + +#### Properties + +##### name + +> **name**: `string` + +Defined in: [intelligence/capability.ts:201](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L201) + +##### description? + +> `optional` **description?**: `string` + +Defined in: [intelligence/capability.ts:202](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L202) + +##### prompt? + +> `optional` **prompt?**: `string` + +Defined in: [intelligence/capability.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L203) + +*** + +### ResolvedSurface + +Defined in: [intelligence/capability.ts:212](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L212) + +What `composeCertifiedProfile` produces. Every binding fans into the same +slots, consumed identically by the in-process seam (`RouterToolsSeam.{tools, +executeToolCall}` + folded prompt) and the sandbox seam (`AgentProfile`). +`dispose()` tears provisioned hosts down in REVERSE dependency order. + +#### Properties + +##### tools + +> **tools**: [`ToolSpec`](runtime.md#toolspec)[] + +Defined in: [intelligence/capability.ts:214](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L214) + +Host-side tool defs → `RouterToolsSeam.tools` / agent-app `extraTools`. + +##### mcpConnections + +> **mcpConnections**: `Record`\<`string`, `AgentProfileMcpServer`\> + +Defined in: [intelligence/capability.ts:219](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L219) + +Sandbox-side tool delivery → `AgentProfile.mcp` / in-proc `createMcpEnvironment`. + +##### promptAdditions + +> **promptAdditions**: `string`[] + +Defined in: [intelligence/capability.ts:221](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L221) + +Prompt-context additions, byte-stable-ordered → folded system prompt. + +##### files + +> **files**: `object`[] + +Defined in: [intelligence/capability.ts:223](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L223) + +Workspace files → `AgentProfile.resources.files`. + +###### path + +> **path**: `string` + +###### content + +> **content**: `string` + +###### executable? + +> `optional` **executable?**: `boolean` + +##### retrieval + +> **retrieval**: [`ResolvedRetrieval`](#resolvedretrieval)[] + +Defined in: [intelligence/capability.ts:225](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L225) + +Uniform retrieval handles. + +##### hooks + +> **hooks**: [`ResolvedHook`](#resolvedhook)[] + +Defined in: [intelligence/capability.ts:227](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L227) + +Hooks → `AgentProfile.hooks`. + +##### subagents + +> **subagents**: [`ResolvedSubagent`](#resolvedsubagent)[] + +Defined in: [intelligence/capability.ts:229](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L229) + +Subagents → `AgentProfile.subagents`. + +##### systemPrompt + +> **systemPrompt**: `string` + +Defined in: [intelligence/capability.ts:232](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L232) + +The folded system prompt — base + the byte-stable prompt additions, exactly + as `composeCertifiedPrompt` renders the inline/context capabilities. + +#### Methods + +##### execute() + +> **execute**(`name`, `args`, `task`): `Promise`\<`string`\> + +Defined in: [intelligence/capability.ts:217](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L217) + +Host-side dispatch for a resolved tool. Throws when `name` is unknown so a + mis-dispatch is loud, never a silent empty string. + +###### Parameters + +###### name + +`string` + +###### args + +`Record`\<`string`, `unknown`\> + +###### task + +`unknown` + +###### Returns + +`Promise`\<`string`\> + +##### dispose() + +> **dispose**(): `Promise`\<`void`\> + +Defined in: [intelligence/capability.ts:234](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L234) + +Tear down provisioned hosts (reverse dependency order). + +###### Returns + +`Promise`\<`void`\> + +*** + +### CertifiedArtifact + +Defined in: [intelligence/delivery.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L33) + +A promoted, certified artifact (one entry in the composed profile). + +#### Properties + +##### path + +> **path**: `string` \| `null` + +Defined in: [intelligence/delivery.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L34) + +##### content + +> **content**: `string` + +Defined in: [intelligence/delivery.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L35) + +##### contentHash + +> **contentHash**: `string` + +Defined in: [intelligence/delivery.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L36) + +##### version + +> **version**: `number` \| `null` + +Defined in: [intelligence/delivery.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L37) + +##### lift + +> **lift**: `string` \| `null` + +Defined in: [intelligence/delivery.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L40) + +Held-out gate lift attached at certification, e.g. "+3.1pp" — never a + within-run claim. `null` when the promotion carried no lift record. + +##### promotedAt + +> **promotedAt**: `string` + +Defined in: [intelligence/delivery.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L41) + +*** + +### CertifiedPromptSurface + +Defined in: [intelligence/delivery.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L45) + +The active promoted prompt surface for a target. + +#### Properties + +##### surface + +> **surface**: `string` + +Defined in: [intelligence/delivery.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L46) + +##### surfaceHash + +> **surfaceHash**: `string` + +Defined in: [intelligence/delivery.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L47) + +##### version + +> **version**: `number` \| `null` + +Defined in: [intelligence/delivery.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L48) + +##### lift + +> **lift**: `string` \| `null` + +Defined in: [intelligence/delivery.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L49) + +*** + +### CertifiedProfile + +Defined in: [intelligence/delivery.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L54) + +The composed certified profile — exactly the shape the plane's + `GET /v1/profiles/:target/composed` returns. + +#### Properties + +##### target + +> **target**: `string` + +Defined in: [intelligence/delivery.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L55) + +##### generatedAt + +> **generatedAt**: `string` + +Defined in: [intelligence/delivery.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L56) + +##### promptSurface + +> **promptSurface**: [`CertifiedPromptSurface`](#certifiedpromptsurface) \| `null` + +Defined in: [intelligence/delivery.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L57) + +##### artifacts + +> **artifacts**: `Record`\<`string`, [`CertifiedArtifact`](#certifiedartifact)[]\> + +Defined in: [intelligence/delivery.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L58) + +*** + +### PullCertifiedOptions + +Defined in: [intelligence/delivery.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L67) + +#### Properties + +##### target + +> **target**: `string` + +Defined in: [intelligence/delivery.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L69) + +The agent target certified artifacts are promoted under. + +##### apiKey? + +> `optional` **apiKey?**: `string` + +Defined in: [intelligence/delivery.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L71) + +Bearer key. Defaults to `process.env.TANGLE_API_KEY`. + +##### baseUrl? + +> `optional` **baseUrl?**: `string` + +Defined in: [intelligence/delivery.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L74) + +Plane base URL. Defaults to `process.env.TANGLE_INTELLIGENCE_URL` then + `https://intelligence.tangle.tools`. + +##### fetchImpl? + +> `optional` **fetchImpl?**: (`input`, `init?`) => `Promise`\<`Response`\> + +Defined in: [intelligence/delivery.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L76) + +fetch impl (tests / non-global-fetch runtimes). Defaults to global fetch. + +###### Parameters + +###### input + +`string` \| `URL` \| `Request` + +###### init? + +`RequestInit` + +###### Returns + +`Promise`\<`Response`\> + +##### timeoutMs? + +> `optional` **timeoutMs?**: `number` + +Defined in: [intelligence/delivery.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L80) + +Abort the pull after this many ms so a hung plane never blocks the caller. + Default 10000. The timeout surfaces as a normal fail-closed `succeeded: + false` (the agent runs on its base surface). + +*** + +### AppliedIntelligence + +Defined in: [intelligence/delivery.ts:181](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L181) + +What the delivery wrapper hands the agent each run. + +#### Properties + +##### certified + +> **certified**: [`CertifiedProfile`](#certifiedprofile) \| `null` + +Defined in: [intelligence/delivery.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L184) + +The certified profile in effect (null when none promoted / pull failed — + fail-closed: the agent runs on its base surface). + +#### Methods + +##### composePrompt() + +> **composePrompt**(`base`): `string` + +Defined in: [intelligence/delivery.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L186) + +Fold the certified prompt surface into a base system prompt. + +###### Parameters + +###### base + +`string` + +###### Returns + +`string` + +*** + +### DeliveryConfig + +Defined in: [intelligence/delivery.ts:194](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L194) + +Delivery config = the Observe config plus the pull target + refresh cadence. + +#### Extends + +- [`IntelligenceConfig`](#intelligenceconfig) + +#### Properties + +##### target? + +> `optional` **target?**: `string` + +Defined in: [intelligence/delivery.ts:196](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L196) + +Pull target. Defaults to `project`. + +##### baseUrl? + +> `optional` **baseUrl?**: `string` + +Defined in: [intelligence/delivery.ts:199](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L199) + +Plane base URL for the pull (NOT the OTLP `endpoint`). Defaults to + `TANGLE_INTELLIGENCE_URL` then `https://intelligence.tangle.tools`. + +##### refreshMs? + +> `optional` **refreshMs?**: `number` + +Defined in: [intelligence/delivery.ts:201](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L201) + +Min interval between certified-profile pulls. Default 5m. + +##### timeoutMs? + +> `optional` **timeoutMs?**: `number` + +Defined in: [intelligence/delivery.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L203) + +Per-pull timeout in ms (fail-closed on a hung plane). Default 10000. + +##### fetchImpl? + +> `optional` **fetchImpl?**: (`input`, `init?`) => `Promise`\<`Response`\> + +Defined in: [intelligence/delivery.ts:205](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L205) + +fetch impl for the pull (tests). Defaults to global fetch. + +###### Parameters + +###### input + +`string` \| `URL` \| `Request` + +###### init? + +`RequestInit` + +###### Returns + +`Promise`\<`Response`\> + +##### project + +> **project**: `string` + +Defined in: [intelligence/index.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L124) + +Stable project id — the tenant dimension every trace is tagged with. + +###### Inherited from + +[`IntelligenceConfig`](#intelligenceconfig).[`project`](#project-1) + +##### apiKey? + +> `optional` **apiKey?**: `string` + +Defined in: [intelligence/index.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L126) + +Bearer key for the Intelligence ingest. Reads `TANGLE_API_KEY` when omitted. + +###### Inherited from + +[`IntelligenceConfig`](#intelligenceconfig).[`apiKey`](#apikey-2) + +##### effort? + +> `optional` **effort?**: [`EffortTier`](#efforttier) \| \{ `tier`: [`EffortTier`](#efforttier); `overrides?`: `Partial`\<[`EffortSettings`](#effortsettings)\>; \} + +Defined in: [intelligence/index.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L128) + +Effort tier (default `'standard'`) plus optional per-field overrides. + +###### Inherited from + +[`IntelligenceConfig`](#intelligenceconfig).[`effort`](#effort-1) + +##### endpoint? + +> `optional` **endpoint?**: `string` + +Defined in: [intelligence/index.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L135) + +OTLP ingest base. The underlying exporter appends `/v1/traces`, so point +this at the OTLP route (e.g. `https://intelligence.tangle.tools/v1/otlp`). +Reads `INTELLIGENCE_OTLP_ENDPOINT` then `OTEL_EXPORTER_OTLP_ENDPOINT` when +omitted; absent all three, export is a no-op (best-effort by construction). + +###### Inherited from + +[`IntelligenceConfig`](#intelligenceconfig).[`endpoint`](#endpoint-1) + +##### redact? + +> `optional` **redact?**: `false` \| [`Redactor`](#redactor) + +Defined in: [intelligence/index.ts:141](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L141) + +Redaction hook run over every exported input/output. A function replaces +the default scrubber; `false` opts out entirely (raw fidelity, caller has +sanitized upstream); omitted ⇒ the built-in `defaultRedactor`. + +###### Inherited from + +[`IntelligenceConfig`](#intelligenceconfig).[`redact`](#redact-1) + +##### surfaces? + +> `optional` **surfaces?**: `string`[] + +Defined in: [intelligence/index.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L143) + +Mutable surfaces a later PR mode would edit. Recorded for `doctor()` only. + +###### Inherited from + +[`IntelligenceConfig`](#intelligenceconfig).[`surfaces`](#surfaces-1) + +##### checks? + +> `optional` **checks?**: `string`[] + +Defined in: [intelligence/index.ts:145](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L145) + +Verification checks a later PR mode would gate on. Recorded for `doctor()` only. + +###### Inherited from + +[`IntelligenceConfig`](#intelligenceconfig).[`checks`](#checks-1) + +##### repo? + +> `optional` **repo?**: [`RepoConfig`](#repoconfig) + +Defined in: [intelligence/index.ts:147](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L147) + +Repo access a later PR mode would need. Recorded for `doctor()` only. + +###### Inherited from + +[`IntelligenceConfig`](#intelligenceconfig).[`repo`](#repo-1) + +*** + +### EffortSettings + +Defined in: [intelligence/effort.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L31) + +The flat, resolved settings a tier compiles to. Every field is individually +overridable through `resolveEffort`. Pure data — read by the wrapper, never +self-executing. + +#### Properties + +##### analysts + +> **analysts**: `boolean` + +Defined in: [intelligence/effort.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L33) + +Whether trace-derived analyst diagnosis may spawn. `false` ⇒ no analyst. + +##### corpus + +> **corpus**: [`CorpusAccess`](#corpusaccess) + +Defined in: [intelligence/effort.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L35) + +Cross-run corpus access this tier permits. + +##### fanout + +> **fanout**: `number` + +Defined in: [intelligence/effort.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L37) + +Parallel candidate width. `1` ⇒ single-shot, no breadth. + +##### loops + +> **loops**: `boolean` + +Defined in: [intelligence/effort.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L39) + +Whether multi-step improvement loops (refine / fanout-vote) may run. + +##### intelligenceBudgetUsd + +> **intelligenceBudgetUsd**: `number` \| `null` + +Defined in: [intelligence/effort.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L46) + +Ceiling, in USD, for INTELLIGENCE-class spawns only (analysts, corpus, +loops) — NOT base inference. `0` refuses every intelligence spawn; `null` +means uncapped (the spend lands on the Pareto receipt). Base-stream +inference is billed on its own channel and is never constrained here. + +*** + +### EffortOverridesCompiled + +Defined in: [intelligence/effort.ts:156](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L156) + +The run-config overrides an `EffortSettings` compiles to — the bridge between the +pure effort policy and the orchestration entrypoints (`runPersonified` / the +improvement cycle). This is ONLY data: it never constructs an analyst or runs a +loop. The caller reads these flags to decide WHAT to pass: + + - `withAnalyst: false` ⇒ DO NOT construct/pass a `ScopeAnalyst` to `runPersonified` + (the dormant empty-findings path runs; the base agent still works). This is the + PRODUCT fail-closed at `off`/`eco` — "don't construct the analyst" — distinct from + the EXPERIMENT fail-closed inside `createScopeAnalyst` ("hard abort"), which stays + untouched. Degrade, never throw. + - `fanout` ⇒ the `ShapeBudget.fanout` width to pass (`1` at `off`, the tier's breadth + otherwise). Overrides the personify default fanout. + - `withLoops: false` ⇒ the improvement cycle is a no-op for this run (no refine / + fanout-vote multi-step loop spawns). + - `intelligenceBudgetUsd` ⇒ the intelligence-class spend ceiling carried through for + the billing clamp (passed verbatim; `0` refuses every intelligence spawn). + +#### Properties + +##### withAnalyst + +> **withAnalyst**: `boolean` + +Defined in: [intelligence/effort.ts:158](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L158) + +Construct + pass a `ScopeAnalyst`? `false` ⇒ omit it (degrade to the base agent). + +##### fanout + +> **fanout**: `number` + +Defined in: [intelligence/effort.ts:160](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L160) + +`ShapeBudget.fanout` width to pass to `runPersonified`. + +##### withLoops + +> **withLoops**: `boolean` + +Defined in: [intelligence/effort.ts:162](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L162) + +Run the multi-step improvement cycle, or no-op it for this run? + +##### intelligenceBudgetUsd + +> **intelligenceBudgetUsd**: `number` \| `null` + +Defined in: [intelligence/effort.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L164) + +Intelligence-class spend ceiling. `0` refuses every intelligence spawn; `null` uncapped. + +*** + +### UsageSplit + +Defined in: [intelligence/index.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L103) + +The per-class cost split carried by every trace and outcome. `off` ⇒ +`intelligenceUsd: 0` by construction — there is no intelligence spawn to +bill. This is a classification on the trace, NOT a budget-pool split. + +#### Properties + +##### inferenceUsd + +> **inferenceUsd**: `number` + +Defined in: [intelligence/index.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L105) + +Base-stream (model) spend in USD. + +##### intelligenceUsd + +> **intelligenceUsd**: `number` + +Defined in: [intelligence/index.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L107) + +Intelligence-spawn spend in USD. Provably `0` at the OFF tier. + +*** + +### RepoConfig + +Defined in: [intelligence/index.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L113) + +Repo coordinates a product may declare for the (later) Gated-PR mode. The + Observe slice only records their PRESENCE for `doctor()`; it never touches + the repo. + +#### Properties + +##### owner + +> **owner**: `string` + +Defined in: [intelligence/index.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L114) + +##### name + +> **name**: `string` + +Defined in: [intelligence/index.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L115) + +##### baseBranch + +> **baseBranch**: `string` + +Defined in: [intelligence/index.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L116) + +*** + +### IntelligenceConfig + +Defined in: [intelligence/index.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L122) + +Client configuration. `project` + `apiKey` are the Observe minimum; the + rest tune effort, endpoint, redaction, and (for `doctor()` readiness) + declare the surfaces/checks/repo a later PR mode would need. + +#### Extended by + +- [`DeliveryConfig`](#deliveryconfig) + +#### Properties + +##### project + +> **project**: `string` + +Defined in: [intelligence/index.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L124) + +Stable project id — the tenant dimension every trace is tagged with. + +##### apiKey? + +> `optional` **apiKey?**: `string` + +Defined in: [intelligence/index.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L126) + +Bearer key for the Intelligence ingest. Reads `TANGLE_API_KEY` when omitted. + +##### effort? + +> `optional` **effort?**: [`EffortTier`](#efforttier) \| \{ `tier`: [`EffortTier`](#efforttier); `overrides?`: `Partial`\<[`EffortSettings`](#effortsettings)\>; \} + +Defined in: [intelligence/index.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L128) + +Effort tier (default `'standard'`) plus optional per-field overrides. + +##### endpoint? + +> `optional` **endpoint?**: `string` + +Defined in: [intelligence/index.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L135) + +OTLP ingest base. The underlying exporter appends `/v1/traces`, so point +this at the OTLP route (e.g. `https://intelligence.tangle.tools/v1/otlp`). +Reads `INTELLIGENCE_OTLP_ENDPOINT` then `OTEL_EXPORTER_OTLP_ENDPOINT` when +omitted; absent all three, export is a no-op (best-effort by construction). + +##### redact? + +> `optional` **redact?**: `false` \| [`Redactor`](#redactor) + +Defined in: [intelligence/index.ts:141](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L141) + +Redaction hook run over every exported input/output. A function replaces +the default scrubber; `false` opts out entirely (raw fidelity, caller has +sanitized upstream); omitted ⇒ the built-in `defaultRedactor`. + +##### surfaces? + +> `optional` **surfaces?**: `string`[] + +Defined in: [intelligence/index.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L143) + +Mutable surfaces a later PR mode would edit. Recorded for `doctor()` only. + +##### checks? + +> `optional` **checks?**: `string`[] + +Defined in: [intelligence/index.ts:145](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L145) + +Verification checks a later PR mode would gate on. Recorded for `doctor()` only. + +##### repo? + +> `optional` **repo?**: [`RepoConfig`](#repoconfig) + +Defined in: [intelligence/index.ts:147](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L147) + +Repo access a later PR mode would need. Recorded for `doctor()` only. + +*** + +### TraceMeta + +Defined in: [intelligence/index.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L151) + +Metadata describing one traced run. `runId`/`traceId` default to fresh ids. + +#### Properties + +##### input? + +> `optional` **input?**: `unknown` + +Defined in: [intelligence/index.ts:153](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L153) + +The run's input — exported through the redactor. + +##### runId? + +> `optional` **runId?**: `string` + +Defined in: [intelligence/index.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L155) + +Stable run id. Defaults to a fresh id. + +##### traceId? + +> `optional` **traceId?**: `string` + +Defined in: [intelligence/index.ts:157](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L157) + +32-hex trace id. Defaults to a fresh id. + +##### model? + +> `optional` **model?**: `string` + +Defined in: [intelligence/index.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L159) + +Model id, when known — stamped on the span. + +##### provider? + +> `optional` **provider?**: `string` + +Defined in: [intelligence/index.ts:161](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L161) + +Provider name, when known — stamped on the span. + +##### labels? + +> `optional` **labels?**: `Record`\<`string`, `string` \| `number` \| `boolean`\> + +Defined in: [intelligence/index.ts:163](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L163) + +Arbitrary extra labels (string/number/boolean) stamped on the span. + +*** + +### TraceHandle + +Defined in: [intelligence/index.ts:172](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L172) + +The trace handle a `traceRun` body records into. `recordOutput` captures the +agent's result (redacted on export); `recordOutcome` captures the scored +outcome + the `{ inferenceUsd, intelligenceUsd }` split. Both are optional — +an un-recorded run still exports a span with whatever was set. + +#### Methods + +##### recordOutput() + +> **recordOutput**(`output`): `void` + +Defined in: [intelligence/index.ts:174](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L174) + +Capture the run's output. Exported through the redactor. + +###### Parameters + +###### output + +`unknown` + +###### Returns + +`void` + +##### recordOutcome() + +> **recordOutcome**(`outcome`): `void` + +Defined in: [intelligence/index.ts:181](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L181) + +Capture the run's outcome. `usage` defaults to inference-only +(`intelligenceUsd: 0`) — the OFF baseline; an intelligence-enabled run +fills `intelligenceUsd` itself. `costUsd`, when given without a split, is +treated as pure inference. + +###### Parameters + +###### outcome + +###### success? + +`boolean` + +###### score? + +`number` + +###### costUsd? + +`number` + +###### usage? + +`Partial`\<[`UsageSplit`](#usagesplit)\> + +###### Returns + +`void` + +*** + +### RecordTraceMeta + +Defined in: [intelligence/index.ts:190](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L190) + +Metadata for [IntelligenceClient.recordTrace](#recordtrace). + +#### Properties + +##### traceId? + +> `optional` **traceId?**: `string` + +Defined in: [intelligence/index.ts:192](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L192) + +32-hex trace id to anchor every span to. Defaults to a fresh id. + +##### rootParentSpanId? + +> `optional` **rootParentSpanId?**: `string` + +Defined in: [intelligence/index.ts:195](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L195) + +Span id of an enclosing span the loop root should parent under (e.g. a + `traceRun` span). Omitted ⇒ the loop root is the trace root. + +*** + +### TraceOutcome + +Defined in: [intelligence/index.ts:200](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L200) + +The resolved outcome of one traced run, surfaced on the export span and + available to the caller for downstream billing assertions. + +#### Properties + +##### runId + +> **runId**: `string` + +Defined in: [intelligence/index.ts:201](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L201) + +##### traceId + +> **traceId**: `string` + +Defined in: [intelligence/index.ts:202](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L202) + +##### project + +> **project**: `string` + +Defined in: [intelligence/index.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L203) + +##### effort + +> **effort**: [`EffortSettings`](#effortsettings) + +Defined in: [intelligence/index.ts:205](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L205) + +The resolved effort settings this run executed under. + +##### intelligenceOff + +> **intelligenceOff**: `boolean` + +Defined in: [intelligence/index.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L207) + +True when this run ran as pure passthrough (the OFF floor). + +##### success? + +> `optional` **success?**: `boolean` + +Defined in: [intelligence/index.ts:208](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L208) + +##### score? + +> `optional` **score?**: `number` + +Defined in: [intelligence/index.ts:209](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L209) + +##### usage + +> **usage**: [`UsageSplit`](#usagesplit) + +Defined in: [intelligence/index.ts:211](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L211) + +Per-class billing split. `intelligenceUsd` is `0` at the OFF tier. + +*** + +### IntelligenceClient + +Defined in: [intelligence/index.ts:215](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L215) + +The Observe-mode Intelligence client. + +#### Properties + +##### project + +> `readonly` **project**: `string` + +Defined in: [intelligence/index.ts:217](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L217) + +The resolved project id. + +##### effort + +> `readonly` **effort**: [`EffortSettings`](#effortsettings) + +Defined in: [intelligence/index.ts:219](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L219) + +The resolved effort settings. + +#### Methods + +##### traceRun() + +> **traceRun**\<`T`\>(`meta`, `fn`): `Promise`\<`T`\> + +Defined in: [intelligence/index.ts:225](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L225) + +Run `fn` under a trace, export one span best-effort, and return whatever +`fn` returns. Telemetry-export failures are swallowed; an error THROWN by +`fn` propagates to the caller (the agent's own failures are not masked). + +###### Type Parameters + +###### T + +`T` + +###### Parameters + +###### meta + +[`TraceMeta`](#tracemeta) + +###### fn + +(`trace`) => `Promise`\<`T`\> + +###### Returns + +`Promise`\<`T`\> + +##### recordTrace() + +> **recordTrace**(`events`, `meta?`): `string` + +Defined in: [intelligence/index.ts:235](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L235) + +Export a run's full loop topology — the ordered `LoopTraceEvent` stream a +`runLoop`/`Supervisor` run emits — as a nested OTLP span tree (loop → round → +iteration) into ONE trace. Reuses the shipped `buildLoopOtelSpans` builder +(NO second span builder), so the topology a viewer renders matches the +kernel's. `traceId` defaults to a fresh id; `rootParentSpanId` parents the +loop root under an enclosing span (e.g. a `traceRun` span) when given. +Best-effort: export failures are swallowed. Returns the resolved `traceId`. + +###### Parameters + +###### events + +readonly [`LoopTraceEvent`](runtime.md#looptraceevent)[] + +###### meta? + +[`RecordTraceMeta`](#recordtracemeta) + +###### Returns + +`string` + +##### doctor() + +> **doctor**(): [`DoctorReport`](#doctorreport) + +Defined in: [intelligence/index.ts:241](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L241) + +Network-free readiness report: which adoption modes are reachable given +this config. Observe is always reachable; Recommend needs outcomes; PR +needs checks + surfaces + repo. + +###### Returns + +[`DoctorReport`](#doctorreport) + +##### flush() + +> **flush**(): `Promise`\<`void`\> + +Defined in: [intelligence/index.ts:243](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L243) + +Flush any pending export spans. Best-effort; resolves even if export fails. + +###### Returns + +`Promise`\<`void`\> + +*** + +### ModeReadiness + +Defined in: [intelligence/index.ts:247](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L247) + +One mode's readiness verdict. + +#### Properties + +##### ready + +> **ready**: `boolean` + +Defined in: [intelligence/index.ts:248](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L248) + +##### missing + +> **missing**: `string`[] + +Defined in: [intelligence/index.ts:250](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L250) + +Inputs this mode still needs, when not ready. Empty when ready. + +*** + +### DoctorReport + +Defined in: [intelligence/index.ts:254](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L254) + +The `doctor()` readiness report — Mode-readiness without any network call. + +#### Properties + +##### project + +> **project**: `string` + +Defined in: [intelligence/index.ts:255](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L255) + +##### effort + +> **effort**: [`EffortSettings`](#effortsettings) + +Defined in: [intelligence/index.ts:256](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L256) + +##### exportConfigured + +> **exportConfigured**: `boolean` + +Defined in: [intelligence/index.ts:258](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L258) + +True when an OTLP endpoint is configured (export will actually ship). + +##### modes + +> **modes**: `object` + +Defined in: [intelligence/index.ts:259](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L259) + +###### observe + +> **observe**: [`ModeReadiness`](#modereadiness) + +###### recommend + +> **recommend**: [`ModeReadiness`](#modereadiness) + +###### pr + +> **pr**: [`ModeReadiness`](#modereadiness) + +*** + +### ProvisionedHost + +Defined in: [intelligence/resolver.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L49) + +A live, provisioned host the resolver tore up for a `process-on-infra` arm. + `teardown()` runs at `dispose()` in reverse provisioning order. + +#### Properties + +##### mcpConnection? + +> `optional` **mcpConnection?**: `AgentProfileMcpServer` + +Defined in: [intelligence/resolver.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L52) + +Lower the inner binding's mcp connection now that the host is up; the URL/ + command points at the host. Absent when the host serves a non-mcp inner. + +#### Methods + +##### teardown() + +> **teardown**(): `Promise`\<`void`\> + +Defined in: [intelligence/resolver.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L53) + +###### Returns + +`Promise`\<`void`\> + +*** + +### ResolveCtx + +Defined in: [intelligence/resolver.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L61) + +Per-call, per-tenant context the resolver reads. Everything that touches the +network, a secret, or an infra provisioner is INJECTED so the manifest carries +no live secret and the substrate-free caller wires only what it can host. + +#### Properties + +##### tenant? + +> `optional` **tenant?**: `string` + +Defined in: [intelligence/resolver.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L63) + +Stable tenant id — namespaces billing + teardown (`tenant#target`). + +##### fetchImpl? + +> `optional` **fetchImpl?**: (`input`, `init?`) => `Promise`\<`Response`\> + +Defined in: [intelligence/resolver.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L65) + +fetch impl for http tools. Defaults to global fetch; absent ⇒ http tools fail loud. + +###### Parameters + +###### input + +`string` \| `URL` \| `Request` + +###### init? + +`RequestInit` + +###### Returns + +`Promise`\<`Response`\> + +##### resolveSecret? + +> `optional` **resolveSecret?**: (`auth`, `tenant`) => `Promise`\<\{ `succeeded`: `true`; `value`: `string`; \} \| \{ `succeeded`: `false`; `error`: `string`; \}\> + +Defined in: [intelligence/resolver.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L71) + +Resolve a declared credential to a live secret for THIS tenant. Returns a +typed outcome — inspect `succeeded` before `value`. Absent ⇒ a binding that +declares non-`none` auth fails loud (never a request with no credential). + +###### Parameters + +###### auth + +[`CapabilityAuth`](#capabilityauth) + +###### tenant + +`string` \| `undefined` + +###### Returns + +`Promise`\<\{ `succeeded`: `true`; `value`: `string`; \} \| \{ `succeeded`: `false`; `error`: `string`; \}\> + +##### runSandboxCode? + +> `optional` **runSandboxCode?**: (`code`, `entry`, `args`, `task`) => `Promise`\<`string`\> + +Defined in: [intelligence/resolver.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L80) + +Run a `sandbox-code` body per call. Injected by the host that owns a sandbox +client (the spine does not import the sandbox executor). Absent ⇒ +`sandbox-code` bindings fail loud. + +###### Parameters + +###### code + +[`ContentRef`](#contentref) + +###### entry + +`string` + +###### args + +`Record`\<`string`, `unknown`\> + +###### task + +`unknown` + +###### Returns + +`Promise`\<`string`\> + +##### provisionHost? + +> `optional` **provisionHost?**: (`host`, `inner`, `costTag`) => `Promise`\<[`ProvisionedHost`](#provisionedhost)\> + +Defined in: [intelligence/resolver.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L92) + +Provision a host for a `process-on-infra` binding, then serve the inner +binding inside it. Injected by the host that owns `createExecutor`. Absent ⇒ +`process-on-infra` bindings fail loud. The provider resolves the inner +binding INSIDE the host and returns the connection + a teardown. + +###### Parameters + +###### host + +[`HostSpec`](#hostspec) + +###### inner + +[`DeliveryBinding`](#deliverybinding) + +###### costTag + +`string` + +###### Returns + +`Promise`\<[`ProvisionedHost`](#provisionedhost)\> + +##### probeLiveToolNames? + +> `optional` **probeLiveToolNames?**: (`capabilityId`) => `Promise`\<`string`[]\> + +Defined in: [intelligence/resolver.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L105) + +Drift probe: return the LIVE tool names a resolved surface exposes for a +given capability id (a `tools/list` over an mcp connection, the agent's +actual registered tool names for a host tool). When present, the post-resolve +drift check drops any tool/mcp whose live names diverge from the certified +interface — the only callable surfaces are gate-blessed ones. Absent ⇒ the +check enforces only the host-side executor↔spec parity (no live probe). + +###### Parameters + +###### capabilityId + +`string` + +###### Returns + +`Promise`\<`string`[]\> + +##### onDrop? + +> `optional` **onDrop?**: (`capabilityId`, `error`) => `void` + +Defined in: [intelligence/resolver.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L113) + +Observe a DROPPED capability — a per-capability resolve failure that is +fail-closed (the capability is omitted, never half-wired). The drop is the +contract; this surfaces the diagnostic so it is never silently erased. NOT +called for [CapabilityNotAdmittedError](#capabilitynotadmittederror) (that rethrows — a manifest +carrying an un-admitted binding kind is a hard error, not a soft drop). + +###### Parameters + +###### capabilityId + +`string` + +###### error + +`Error` + +###### Returns + +`void` + +## Type Aliases + +### JsonSchema + +> **JsonSchema** = `Record`\<`string`, `unknown`\> + +Defined in: [intelligence/capability.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L36) + +A JSON Schema object describing a tool's parameters. Kept structural — the + resolver forwards it verbatim into a `ToolSpec` / MCP `tools/list` check. + +*** + +### CapabilityInterface + +> **CapabilityInterface** = \{ `surface`: `"tool"`; `name`: `string`; `description?`: `string`; `parameters`: [`JsonSchema`](#jsonschema); `returns?`: [`JsonSchema`](#jsonschema); \} \| \{ `surface`: `"mcp"`; `serverName`: `string`; `toolset?`: `string`[]; \} \| \{ `surface`: `"context"`; `kind`: `"prompt-surface"` \| `"skill"` \| `"instructions"`; `name`: `string`; \} \| \{ `surface`: `"retrieval"`; `name`: `string`; `description?`: `string`; `topK?`: `number`; \} \| \{ `surface`: `"hook"`; `event`: `string`; `matcher?`: `string`; \} \| \{ `surface`: `"subagent"`; `name`: `string`; `description?`: `string`; \} + +Defined in: [intelligence/capability.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L42) + +What the agent consumes. CLOSED — a new runtime kind NEVER extends this. Each +arm maps slot-for-slot onto `AgentProfile` + the host `RouterToolsSeam`. + +*** + +### CapabilitySurface + +> **CapabilitySurface** = [`CapabilityInterface`](#capabilityinterface)\[`"surface"`\] + +Defined in: [intelligence/capability.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L57) + +Every interface surface tag — the closed set the resolver fans into slots. + +*** + +### ContentRef + +> **ContentRef** = \{ `kind`: `"inline"`; `content`: `string`; \} \| \{ `kind`: `"github"`; `repository?`: `string`; `path`: `string`; `ref?`: `string`; \} \| \{ `kind`: `"blob"`; `uri`: `string`; `sha256`: `string`; `bytes?`: `number`; \} + +Defined in: [intelligence/capability.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L65) + +Where a capability's bytes live. A leaked manifest carries no live secret and +no inlined blob: `github`/`blob` are pointers resolved at provision time. + +*** + +### CapabilityAuth + +> **CapabilityAuth** = \{ `mode`: `"none"`; \} \| \{ `mode`: `"tangle-key"`; \} \| \{ `mode`: `"hub-connection"`; `providerId`: `string`; `scopes?`: `string`[]; \} \| \{ `mode`: `"secret-ref"`; `key`: `string`; \} + +Defined in: [intelligence/capability.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L80) + +How a binding authenticates at resolve time. Declared as a REQUIREMENT in the +manifest; the live secret is resolved per-tenant by the resolver context, +never inlined here. + +*** + +### DeliveryBinding + +> **DeliveryBinding** = \{ `kind`: `"inline"`; `content`: [`ContentRef`](#contentref); \} \| \{ `kind`: `"file"`; `path`: `string`; `content`: [`ContentRef`](#contentref); `executable?`: `boolean`; \} \| \{ `kind`: `"http"`; `url`: `string`; `method?`: `string`; `auth?`: [`CapabilityAuth`](#capabilityauth); \} \| \{ `kind`: `"sandbox-code"`; `entry`: `string`; `code`: [`ContentRef`](#contentref); `runtime?`: `string`; `harness?`: `string`; \} \| \{ `kind`: `"mcp-stdio"`; `command`: `string`; `args?`: `string`[]; `env?`: `Record`\<`string`, `string`\>; `cwd?`: `string`; \} \| \{ `kind`: `"mcp-remote"`; `url`: `string`; `transport`: `"http"` \| `"sse"`; `headers?`: `Record`\<`string`, `string`\>; \} \| \{ `kind`: `"process-on-infra"`; `host`: [`HostSpec`](#hostspec); `inner`: [`DeliveryBinding`](#deliverybinding); \} \| \{ `kind`: `"rag-index"`; `index`: [`ContentRef`](#contentref); `embedModel`: `string`; `topK?`: `number`; \} \| \{ `kind`: `"memory-store"`; `provision`: `"sqlite"` \| `"neo4j"` \| `"vector"`; `seed?`: [`ContentRef`](#contentref); \} \| \{ `kind`: `"wasm"`; `module`: [`ContentRef`](#contentref); `exports`: `string`[]; \} \| \{ `kind`: `"a2a"`; `endpoint`: `string`; `card`: [`ContentRef`](#contentref); `auth?`: [`CapabilityAuth`](#capabilityauth); \} + +Defined in: [intelligence/capability.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L108) + +How a capability is backed. OPEN tagged union — THE extension point. All arms +are typed even when the resolver does not yet admit them; an un-admitted arm +throws [CapabilityNotAdmittedError](#capabilitynotadmittederror) at resolve, never silently no-ops. + +*** + +### DeliveryBindingKind + +> **DeliveryBindingKind** = [`DeliveryBinding`](#deliverybinding)\[`"kind"`\] + +Defined in: [intelligence/capability.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L137) + +Every binding kind — the open set the resolver dispatches over. + +*** + +### PullOutcome + +> **PullOutcome** = \{ `succeeded`: `true`; `value`: [`CertifiedProfile`](#certifiedprofile); \} \| \{ `succeeded`: `false`; `error`: `string`; `status?`: `number`; \} + +Defined in: [intelligence/delivery.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L63) + +Typed outcome for the pull — inspect `succeeded` before `value`. A 404 + (nothing promoted yet) is a normal, non-error `succeeded: false`. + +*** + +### DeliveredAgent + +> **DeliveredAgent**\<`I`, `O`\> = (`input`, `applied`) => `Promise`\<`O`\> + +Defined in: [intelligence/delivery.ts:191](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L191) + +An agent wrapped by [withCertifiedDelivery](#withcertifieddelivery): receives the input plus + the certified intelligence delivered for this run. + +#### Type Parameters + +##### I + +`I` + +##### O + +`O` + +#### Parameters + +##### input + +`I` + +##### applied + +[`AppliedIntelligence`](#appliedintelligence) + +#### Returns + +`Promise`\<`O`\> + +*** + +### EffortTier + +> **EffortTier** = `"off"` \| `"eco"` \| `"standard"` \| `"thorough"` \| `"max"` + +Defined in: [intelligence/effort.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L19) + +The named effort tiers, lowest to highest. `'off'` is the honest floor + below `'eco'`: intelligence fully off, telemetry still best-effort. + +*** + +### CorpusAccess + +> **CorpusAccess** = `"off"` \| `"read"` \| `"read-write"` + +Defined in: [intelligence/effort.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L24) + +Corpus access an intelligence tier permits. `'off'` reads and writes + nothing; `'read'` consults the cross-run corpus without contributing; + `'read-write'` both consults and accumulates. + +*** + +### EffortOverrides + +> **EffortOverrides** = `Partial`\<[`EffortSettings`](#effortsettings)\> + +Defined in: [intelligence/effort.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L51) + +Per-field overrides applied on top of a tier preset. Any subset of the + resolved settings; each provided field wins over the preset. + +*** + +### UsageClass + +> **UsageClass** = `"inference"` \| `"intelligence"` + +Defined in: [intelligence/index.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L96) + +Usage class for billing. Base-stream tokens bill `'inference'`; every + intelligence spawn (analyst, corpus, loop) bills `'intelligence'`. The + billing line falls on the spawn line. + +*** + +### Agent + +> **Agent**\<`TInput`, `TOutput`\> = (`input`) => `Promise`\<`TOutput`\> + +Defined in: [intelligence/index.ts:512](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L512) + +A generic agent: one async input → output. The shape `withTangleIntelligence` + preserves exactly. + +#### Type Parameters + +##### TInput + +`TInput` + +##### TOutput + +`TOutput` + +#### Parameters + +##### input + +`TInput` + +#### Returns + +`Promise`\<`TOutput`\> + +*** + +### ClientOrConfig + +> **ClientOrConfig** = [`IntelligenceClient`](#intelligenceclient) \| [`IntelligenceConfig`](#intelligenceconfig) + +Defined in: [intelligence/index.ts:515](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L515) + +Either a built client or the config to build one. + +*** + +### Redactor + +> **Redactor** = (`value`) => `unknown` + +Defined in: [intelligence/redact.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/redact.ts#L17) + +A redactor maps an arbitrary trace value to a safe-to-export value. Pure; + must not throw on cyclic input (the default tolerates cycles). + +#### Parameters + +##### value + +`unknown` + +#### Returns + +`unknown` + +## Variables + +### defaultEffortTier + +> `const` **defaultEffortTier**: [`EffortTier`](#efforttier) = `'standard'` + +Defined in: [intelligence/effort.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L94) + +The default tier when a client declares no effort. `'standard'` turns + intelligence on with sensible knobs; opt down to `'off'`/`'eco'` or up to + `'thorough'`/`'max'`. + +## Functions + +### manifestFromProfile() + +> **manifestFromProfile**(`profile`): [`CapabilityManifest`](#capabilitymanifest) + +Defined in: [intelligence/capability.ts:365](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L365) + +Lower the EXISTING plane wire (`CertifiedProfile`) into a `CapabilityManifest`. +`prompt-surface`/`skill` artifacts → `context`/inline capabilities (the +shipped fold, generalized); any other artifact type → best-effort binding +inference (see inferCapability). `promptSurface` is carried through so +the resolver folds it first, exactly as `composeCertifiedPrompt` does today. +This delivers the spine against today's wire before the plane changes. + +#### Parameters + +##### profile + +[`CertifiedProfile`](#certifiedprofile) + +#### Returns + +[`CapabilityManifest`](#capabilitymanifest) + +*** + +### pullCertified() + +> **pullCertified**(`opts`): `Promise`\<[`PullOutcome`](#pulloutcome)\> + +Defined in: [intelligence/delivery.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L106) + +Pull the certified composed profile for a target. Fail-closed: a network +error or a non-2xx returns a typed `succeeded: false` (never throws), so a +caller can run on its base surface when Intelligence is unreachable. A 404 is +the normal "nothing promoted yet" signal, carried as `status: 404`. + +#### Parameters + +##### opts + +[`PullCertifiedOptions`](#pullcertifiedoptions) + +#### Returns + +`Promise`\<[`PullOutcome`](#pulloutcome)\> + +*** + +### composeCertifiedPrompt() + +> **composeCertifiedPrompt**(`base`, `certified`): `string` + +Defined in: [intelligence/delivery.ts:166](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L166) + +Fold the certified prompt surface (and any certified prompt-folding artifacts: +`prompt-surface` / `skill` / `instructions`) into a base system prompt under a +marked section, so the deployed agent prompt == base + the gate-certified +additions. Order is stable (prompt surface first, then artifact buckets in +`promptFoldTypes` order, then by path within a bucket) so the same profile +renders byte-identically each call. Returns `base` unchanged when there is no +usable certified content. + +#### Parameters + +##### base + +`string` + +##### certified + +[`CertifiedProfile`](#certifiedprofile) \| `null` + +#### Returns + +`string` + +*** + +### withCertifiedDelivery() + +> **withCertifiedDelivery**\<`I`, `O`\>(`agent`, `config`): (`input`) => `Promise`\<`O`\> & `object` + +Defined in: [intelligence/delivery.ts:216](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L216) + +Wrap an agent so it (a) Observes each run via the shipped Observe client and +(b) RECEIVES the tenant's certified artifacts pulled from the deployed plane. +The certified profile is cached and refreshed at most every `refreshMs`; a +failed pull is fail-closed — the agent runs on its base surface and never +breaks because Intelligence is unreachable. When the plane promotes a new +gate-certified surface, the next refresh delivers it to the running agent. + +#### Type Parameters + +##### I + +`I` + +##### O + +`O` + +#### Parameters + +##### agent + +[`DeliveredAgent`](#deliveredagent)\<`I`, `O`\> + +##### config + +[`DeliveryConfig`](#deliveryconfig) + +#### Returns + +(`input`) => `Promise`\<`O`\> & `object` + +*** + +### resolveEffort() + +> **resolveEffort**(`tier`, `overrides?`): [`EffortSettings`](#effortsettings) + +Defined in: [intelligence/effort.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L107) + +Compile a named tier (plus optional per-field overrides) into the flat +`EffortSettings` the wrapper reads. Pure: same inputs → same object, no I/O, +no execution. Fails loud on an unknown tier rather than silently defaulting — +a typo'd tier must not quietly grant or deny intelligence. + +Invariant preserved for the billing floor: `resolveEffort('off')` always +yields `intelligenceBudgetUsd: 0` with every intelligence knob off UNLESS the +caller explicitly overrides a field — overriding off is an opt-in the caller +owns, not a default the composer leaks. + +#### Parameters + +##### tier + +[`EffortTier`](#efforttier) + +##### overrides? + +`Partial`\<[`EffortSettings`](#effortsettings)\> + +#### Returns + +[`EffortSettings`](#effortsettings) + +*** + +### isIntelligenceOff() + +> **isIntelligenceOff**(`settings`): `boolean` + +Defined in: [intelligence/effort.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L128) + +True when these settings admit NO intelligence spawn — the passthrough +predicate the wrapper branches on. Every intelligence axis must be off: +analysts disabled, corpus off, no breadth, no loops, and a zero intelligence +budget. A caller who overrides any one of these back on is no longer at the +OFF floor and the wrapper treats them as an intelligence-enabled run. + +#### Parameters + +##### settings + +[`EffortSettings`](#effortsettings) + +#### Returns + +`boolean` + +*** + +### compileEffort() + +> **compileEffort**(`settings`): [`EffortOverridesCompiled`](#effortoverridescompiled) + +Defined in: [intelligence/effort.ts:178](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L178) + +Compile resolved `EffortSettings` into the orchestration overrides above. Pure: same +input → same object, no I/O, no execution, no construction. It is the single place that +maps the effort axes onto the run-config knobs, so no `if (effort)` leaks into the +supervise kernel — the kernel stays effort-blind, the caller reads these flags once. + +`off`/`eco` (`analysts: false`) compile to `withAnalyst: false` ⇒ the caller omits the +analyst and the run degrades to the dormant base agent rather than throwing. `fanout: 1` +(no breadth) at `off`; `withLoops: false` no-ops the improvement cycle. `standard`+ +compile to `withAnalyst: true`, the tier's `fanout`, and `withLoops: true`. + +#### Parameters + +##### settings + +[`EffortSettings`](#effortsettings) + +#### Returns + +[`EffortOverridesCompiled`](#effortoverridescompiled) + +*** + +### createIntelligenceClient() + +> **createIntelligenceClient**(`config`): [`IntelligenceClient`](#intelligenceclient) + +Defined in: [intelligence/index.ts:323](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L323) + +Create an Observe-mode Intelligence client. Resolves effort, endpoint, and +redactor up front; the exporter is built lazily and is `undefined` when no +endpoint is configured (export becomes a no-op — best-effort by +construction). + +#### Parameters + +##### config + +[`IntelligenceConfig`](#intelligenceconfig) + +#### Returns + +[`IntelligenceClient`](#intelligenceclient) + +*** + +### withTangleIntelligence() + +> **withTangleIntelligence**\<`TInput`, `TOutput`\>(`agent`, `clientOrConfig`): [`Agent`](#agent)\<`TInput`, `TOutput`\> + +Defined in: [intelligence/index.ts:530](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L530) + +Wrap a generic `agent` with best-effort Observe-mode tracing, returning the +SAME shape. Each call runs the agent under a trace and exports one span; an +export failure is swallowed (the live agent never fails because Intelligence +is down) but an error from the agent itself propagates unchanged. + +At `effort: 'off'` this is pure passthrough plus best-effort telemetry — +zero intelligence spawns, `intelligenceUsd: 0` on the trace. + +#### Type Parameters + +##### TInput + +`TInput` + +##### TOutput + +`TOutput` + +#### Parameters + +##### agent + +[`Agent`](#agent)\<`TInput`, `TOutput`\> + +##### clientOrConfig + +[`ClientOrConfig`](#clientorconfig) + +#### Returns + +[`Agent`](#agent)\<`TInput`, `TOutput`\> + +*** + +### defaultRedactor() + +> **defaultRedactor**(`value`): `unknown` + +Defined in: [intelligence/redact.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/redact.ts#L56) + +The built-in redactor. Walks objects and arrays; replaces values under +secret-bearing keys wholesale; scrubs in-value patterns from every string. +Cycle-safe (a seen-set short-circuits self-referential payloads to +`'[circular]'`), depth-bounded, and total — never throws on customer input. + +#### Parameters + +##### value + +`unknown` + +#### Returns + +`unknown` + +*** + +### resolveRedactor() + +> **resolveRedactor**(`redact`): [`Redactor`](#redactor) + +Defined in: [intelligence/redact.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/redact.ts#L91) + +Resolve the redactor a client uses. A caller-supplied hook replaces the +default entirely (the customer owns their PII rules); absent one, the +built-in `defaultRedactor` runs. Returning `false` is the explicit opt-out — +NO redaction, for a caller who has already sanitized upstream and wants raw +fidelity. Opt-out is loud (an explicit `false`), never a silent default. + +#### Parameters + +##### redact + +`false` \| [`Redactor`](#redactor) \| `undefined` + +#### Returns + +[`Redactor`](#redactor) + +*** + +### composeCertifiedProfile() + +> **composeCertifiedProfile**(`base`, `manifest`, `ctx?`): `Promise`\<[`ResolvedSurface`](#resolvedsurface)\> + +Defined in: [intelligence/resolver.ts:158](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L158) + +Compose a certified profile into a uniform `ResolvedSurface`. Additive over +`composeCertifiedPrompt`: the inline/context fold is delegated to +`composeCertifiedPrompt` so the byte-stable ordering (prompt surface first, +then type alphabetic, then path locale-compare) is reused EXACTLY — the +prompt-only path is a strict subset of this. + +Fail-closed: a `null` manifest returns the base surface only. + +#### Parameters + +##### base + +###### systemPrompt + +`string` + +##### manifest + +[`CapabilityManifest`](#capabilitymanifest) \| `null` + +##### ctx? + +[`ResolveCtx`](#resolvectx) = `{}` + +#### Returns + +`Promise`\<[`ResolvedSurface`](#resolvedsurface)\> + +*** + +### composeCertifiedProfileFromWire() + +> **composeCertifiedProfileFromWire**(`base`, `profile`, `ctx?`): `Promise`\<[`ResolvedSurface`](#resolvedsurface)\> + +Defined in: [intelligence/resolver.ts:663](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L663) + +Lower a plane `CertifiedProfile` straight into a `ResolvedSurface` via + `manifestFromProfile` — the convenience the shipped pull lane calls when it + already holds a `CertifiedProfile` (today's wire) rather than a manifest. + +#### Parameters + +##### base + +###### systemPrompt + +`string` + +##### profile + +[`CertifiedProfile`](#certifiedprofile) \| `null` + +##### ctx? + +[`ResolveCtx`](#resolvectx) = `{}` + +#### Returns + +`Promise`\<[`ResolvedSurface`](#resolvedsurface)\> diff --git a/docs/api/intelligence/README.md b/docs/api/intelligence/README.md deleted file mode 100644 index 6b01412..0000000 --- a/docs/api/intelligence/README.md +++ /dev/null @@ -1,82 +0,0 @@ -[**@tangle-network/agent-runtime**](../README.md) - -*** - -[@tangle-network/agent-runtime](../README.md) / intelligence - -# intelligence - -## Classes - -- [CapabilityNotAdmittedError](classes/CapabilityNotAdmittedError.md) - -## Interfaces - -- [CredentialRef](interfaces/CredentialRef.md) -- [HostSpec](interfaces/HostSpec.md) -- [CertProvenance](interfaces/CertProvenance.md) -- [CertifiedCapability](interfaces/CertifiedCapability.md) -- [CapabilityManifest](interfaces/CapabilityManifest.md) -- [ResolvedRetrieval](interfaces/ResolvedRetrieval.md) -- [ResolvedHook](interfaces/ResolvedHook.md) -- [ResolvedSubagent](interfaces/ResolvedSubagent.md) -- [ResolvedSurface](interfaces/ResolvedSurface.md) -- [CertifiedArtifact](interfaces/CertifiedArtifact.md) -- [CertifiedPromptSurface](interfaces/CertifiedPromptSurface.md) -- [CertifiedProfile](interfaces/CertifiedProfile.md) -- [PullCertifiedOptions](interfaces/PullCertifiedOptions.md) -- [AppliedIntelligence](interfaces/AppliedIntelligence.md) -- [DeliveryConfig](interfaces/DeliveryConfig.md) -- [EffortSettings](interfaces/EffortSettings.md) -- [EffortOverridesCompiled](interfaces/EffortOverridesCompiled.md) -- [UsageSplit](interfaces/UsageSplit.md) -- [RepoConfig](interfaces/RepoConfig.md) -- [IntelligenceConfig](interfaces/IntelligenceConfig.md) -- [TraceMeta](interfaces/TraceMeta.md) -- [TraceHandle](interfaces/TraceHandle.md) -- [RecordTraceMeta](interfaces/RecordTraceMeta.md) -- [TraceOutcome](interfaces/TraceOutcome.md) -- [IntelligenceClient](interfaces/IntelligenceClient.md) -- [ModeReadiness](interfaces/ModeReadiness.md) -- [DoctorReport](interfaces/DoctorReport.md) -- [ProvisionedHost](interfaces/ProvisionedHost.md) -- [ResolveCtx](interfaces/ResolveCtx.md) - -## Type Aliases - -- [JsonSchema](type-aliases/JsonSchema.md) -- [CapabilityInterface](type-aliases/CapabilityInterface.md) -- [CapabilitySurface](type-aliases/CapabilitySurface.md) -- [ContentRef](type-aliases/ContentRef.md) -- [CapabilityAuth](type-aliases/CapabilityAuth.md) -- [DeliveryBinding](type-aliases/DeliveryBinding.md) -- [DeliveryBindingKind](type-aliases/DeliveryBindingKind.md) -- [PullOutcome](type-aliases/PullOutcome.md) -- [DeliveredAgent](type-aliases/DeliveredAgent.md) -- [EffortTier](type-aliases/EffortTier.md) -- [CorpusAccess](type-aliases/CorpusAccess.md) -- [EffortOverrides](type-aliases/EffortOverrides.md) -- [UsageClass](type-aliases/UsageClass.md) -- [Agent](type-aliases/Agent.md) -- [ClientOrConfig](type-aliases/ClientOrConfig.md) -- [Redactor](type-aliases/Redactor.md) - -## Variables - -- [defaultEffortTier](variables/defaultEffortTier.md) - -## Functions - -- [manifestFromProfile](functions/manifestFromProfile.md) -- [pullCertified](functions/pullCertified.md) -- [composeCertifiedPrompt](functions/composeCertifiedPrompt.md) -- [withCertifiedDelivery](functions/withCertifiedDelivery.md) -- [resolveEffort](functions/resolveEffort.md) -- [isIntelligenceOff](functions/isIntelligenceOff.md) -- [compileEffort](functions/compileEffort.md) -- [createIntelligenceClient](functions/createIntelligenceClient.md) -- [withTangleIntelligence](functions/withTangleIntelligence.md) -- [defaultRedactor](functions/defaultRedactor.md) -- [resolveRedactor](functions/resolveRedactor.md) -- [composeCertifiedProfile](functions/composeCertifiedProfile.md) -- [composeCertifiedProfileFromWire](functions/composeCertifiedProfileFromWire.md) diff --git a/docs/api/intelligence/classes/CapabilityNotAdmittedError.md b/docs/api/intelligence/classes/CapabilityNotAdmittedError.md deleted file mode 100644 index 3d47bcb..0000000 --- a/docs/api/intelligence/classes/CapabilityNotAdmittedError.md +++ /dev/null @@ -1,64 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / CapabilityNotAdmittedError - -# Class: CapabilityNotAdmittedError - -Defined in: [intelligence/capability.ts:245](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L245) - -A binding kind whose resolver case is typed but not yet admitted (rag-index, -memory-store, wasm, a2a). Thrown by the resolver — NEVER faked into a working -surface. The TYPE arms exist so the union is closed against the spec; the -resolver grows them later behind their lifecycle + admission gate. - -## Extends - -- `Error` - -## Constructors - -### Constructor - -> **new CapabilityNotAdmittedError**(`kind`, `capabilityId`, `reason`): `CapabilityNotAdmittedError` - -Defined in: [intelligence/capability.ts:248](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L248) - -#### Parameters - -##### kind - -`"inline"` \| `"file"` \| `"http"` \| `"sandbox-code"` \| `"mcp-stdio"` \| `"mcp-remote"` \| `"process-on-infra"` \| `"rag-index"` \| `"memory-store"` \| `"wasm"` \| `"a2a"` - -##### capabilityId - -`string` - -##### reason - -`string` - -#### Returns - -`CapabilityNotAdmittedError` - -#### Overrides - -`Error.constructor` - -## Properties - -### kind - -> `readonly` **kind**: `"inline"` \| `"file"` \| `"http"` \| `"sandbox-code"` \| `"mcp-stdio"` \| `"mcp-remote"` \| `"process-on-infra"` \| `"rag-index"` \| `"memory-store"` \| `"wasm"` \| `"a2a"` - -Defined in: [intelligence/capability.ts:246](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L246) - -*** - -### capabilityId - -> `readonly` **capabilityId**: `string` - -Defined in: [intelligence/capability.ts:247](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L247) diff --git a/docs/api/intelligence/functions/compileEffort.md b/docs/api/intelligence/functions/compileEffort.md deleted file mode 100644 index 56bb785..0000000 --- a/docs/api/intelligence/functions/compileEffort.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / compileEffort - -# Function: compileEffort() - -> **compileEffort**(`settings`): [`EffortOverridesCompiled`](../interfaces/EffortOverridesCompiled.md) - -Defined in: [intelligence/effort.ts:178](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L178) - -Compile resolved `EffortSettings` into the orchestration overrides above. Pure: same -input → same object, no I/O, no execution, no construction. It is the single place that -maps the effort axes onto the run-config knobs, so no `if (effort)` leaks into the -supervise kernel — the kernel stays effort-blind, the caller reads these flags once. - -`off`/`eco` (`analysts: false`) compile to `withAnalyst: false` ⇒ the caller omits the -analyst and the run degrades to the dormant base agent rather than throwing. `fanout: 1` -(no breadth) at `off`; `withLoops: false` no-ops the improvement cycle. `standard`+ -compile to `withAnalyst: true`, the tier's `fanout`, and `withLoops: true`. - -## Parameters - -### settings - -[`EffortSettings`](../interfaces/EffortSettings.md) - -## Returns - -[`EffortOverridesCompiled`](../interfaces/EffortOverridesCompiled.md) diff --git a/docs/api/intelligence/functions/composeCertifiedProfile.md b/docs/api/intelligence/functions/composeCertifiedProfile.md deleted file mode 100644 index 4787b1c..0000000 --- a/docs/api/intelligence/functions/composeCertifiedProfile.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / composeCertifiedProfile - -# Function: composeCertifiedProfile() - -> **composeCertifiedProfile**(`base`, `manifest`, `ctx?`): `Promise`\<[`ResolvedSurface`](../interfaces/ResolvedSurface.md)\> - -Defined in: [intelligence/resolver.ts:158](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L158) - -Compose a certified profile into a uniform `ResolvedSurface`. Additive over -`composeCertifiedPrompt`: the inline/context fold is delegated to -`composeCertifiedPrompt` so the byte-stable ordering (prompt surface first, -then type alphabetic, then path locale-compare) is reused EXACTLY — the -prompt-only path is a strict subset of this. - -Fail-closed: a `null` manifest returns the base surface only. - -## Parameters - -### base - -#### systemPrompt - -`string` - -### manifest - -[`CapabilityManifest`](../interfaces/CapabilityManifest.md) \| `null` - -### ctx? - -[`ResolveCtx`](../interfaces/ResolveCtx.md) = `{}` - -## Returns - -`Promise`\<[`ResolvedSurface`](../interfaces/ResolvedSurface.md)\> diff --git a/docs/api/intelligence/functions/composeCertifiedProfileFromWire.md b/docs/api/intelligence/functions/composeCertifiedProfileFromWire.md deleted file mode 100644 index 11eb040..0000000 --- a/docs/api/intelligence/functions/composeCertifiedProfileFromWire.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / composeCertifiedProfileFromWire - -# Function: composeCertifiedProfileFromWire() - -> **composeCertifiedProfileFromWire**(`base`, `profile`, `ctx?`): `Promise`\<[`ResolvedSurface`](../interfaces/ResolvedSurface.md)\> - -Defined in: [intelligence/resolver.ts:663](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L663) - -Lower a plane `CertifiedProfile` straight into a `ResolvedSurface` via - `manifestFromProfile` — the convenience the shipped pull lane calls when it - already holds a `CertifiedProfile` (today's wire) rather than a manifest. - -## Parameters - -### base - -#### systemPrompt - -`string` - -### profile - -[`CertifiedProfile`](../interfaces/CertifiedProfile.md) \| `null` - -### ctx? - -[`ResolveCtx`](../interfaces/ResolveCtx.md) = `{}` - -## Returns - -`Promise`\<[`ResolvedSurface`](../interfaces/ResolvedSurface.md)\> diff --git a/docs/api/intelligence/functions/composeCertifiedPrompt.md b/docs/api/intelligence/functions/composeCertifiedPrompt.md deleted file mode 100644 index ff5bdda..0000000 --- a/docs/api/intelligence/functions/composeCertifiedPrompt.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / composeCertifiedPrompt - -# Function: composeCertifiedPrompt() - -> **composeCertifiedPrompt**(`base`, `certified`): `string` - -Defined in: [intelligence/delivery.ts:166](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L166) - -Fold the certified prompt surface (and any certified prompt-folding artifacts: -`prompt-surface` / `skill` / `instructions`) into a base system prompt under a -marked section, so the deployed agent prompt == base + the gate-certified -additions. Order is stable (prompt surface first, then artifact buckets in -`promptFoldTypes` order, then by path within a bucket) so the same profile -renders byte-identically each call. Returns `base` unchanged when there is no -usable certified content. - -## Parameters - -### base - -`string` - -### certified - -[`CertifiedProfile`](../interfaces/CertifiedProfile.md) \| `null` - -## Returns - -`string` diff --git a/docs/api/intelligence/functions/createIntelligenceClient.md b/docs/api/intelligence/functions/createIntelligenceClient.md deleted file mode 100644 index 96a1bea..0000000 --- a/docs/api/intelligence/functions/createIntelligenceClient.md +++ /dev/null @@ -1,26 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / createIntelligenceClient - -# Function: createIntelligenceClient() - -> **createIntelligenceClient**(`config`): [`IntelligenceClient`](../interfaces/IntelligenceClient.md) - -Defined in: [intelligence/index.ts:323](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L323) - -Create an Observe-mode Intelligence client. Resolves effort, endpoint, and -redactor up front; the exporter is built lazily and is `undefined` when no -endpoint is configured (export becomes a no-op — best-effort by -construction). - -## Parameters - -### config - -[`IntelligenceConfig`](../interfaces/IntelligenceConfig.md) - -## Returns - -[`IntelligenceClient`](../interfaces/IntelligenceClient.md) diff --git a/docs/api/intelligence/functions/defaultRedactor.md b/docs/api/intelligence/functions/defaultRedactor.md deleted file mode 100644 index 0275458..0000000 --- a/docs/api/intelligence/functions/defaultRedactor.md +++ /dev/null @@ -1,26 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / defaultRedactor - -# Function: defaultRedactor() - -> **defaultRedactor**(`value`): `unknown` - -Defined in: [intelligence/redact.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/redact.ts#L56) - -The built-in redactor. Walks objects and arrays; replaces values under -secret-bearing keys wholesale; scrubs in-value patterns from every string. -Cycle-safe (a seen-set short-circuits self-referential payloads to -`'[circular]'`), depth-bounded, and total — never throws on customer input. - -## Parameters - -### value - -`unknown` - -## Returns - -`unknown` diff --git a/docs/api/intelligence/functions/isIntelligenceOff.md b/docs/api/intelligence/functions/isIntelligenceOff.md deleted file mode 100644 index 353cae2..0000000 --- a/docs/api/intelligence/functions/isIntelligenceOff.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / isIntelligenceOff - -# Function: isIntelligenceOff() - -> **isIntelligenceOff**(`settings`): `boolean` - -Defined in: [intelligence/effort.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L128) - -True when these settings admit NO intelligence spawn — the passthrough -predicate the wrapper branches on. Every intelligence axis must be off: -analysts disabled, corpus off, no breadth, no loops, and a zero intelligence -budget. A caller who overrides any one of these back on is no longer at the -OFF floor and the wrapper treats them as an intelligence-enabled run. - -## Parameters - -### settings - -[`EffortSettings`](../interfaces/EffortSettings.md) - -## Returns - -`boolean` diff --git a/docs/api/intelligence/functions/manifestFromProfile.md b/docs/api/intelligence/functions/manifestFromProfile.md deleted file mode 100644 index e278566..0000000 --- a/docs/api/intelligence/functions/manifestFromProfile.md +++ /dev/null @@ -1,28 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / manifestFromProfile - -# Function: manifestFromProfile() - -> **manifestFromProfile**(`profile`): [`CapabilityManifest`](../interfaces/CapabilityManifest.md) - -Defined in: [intelligence/capability.ts:365](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L365) - -Lower the EXISTING plane wire (`CertifiedProfile`) into a `CapabilityManifest`. -`prompt-surface`/`skill` artifacts → `context`/inline capabilities (the -shipped fold, generalized); any other artifact type → best-effort binding -inference (see inferCapability). `promptSurface` is carried through so -the resolver folds it first, exactly as `composeCertifiedPrompt` does today. -This delivers the spine against today's wire before the plane changes. - -## Parameters - -### profile - -[`CertifiedProfile`](../interfaces/CertifiedProfile.md) - -## Returns - -[`CapabilityManifest`](../interfaces/CapabilityManifest.md) diff --git a/docs/api/intelligence/functions/pullCertified.md b/docs/api/intelligence/functions/pullCertified.md deleted file mode 100644 index 6e4264c..0000000 --- a/docs/api/intelligence/functions/pullCertified.md +++ /dev/null @@ -1,26 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / pullCertified - -# Function: pullCertified() - -> **pullCertified**(`opts`): `Promise`\<[`PullOutcome`](../type-aliases/PullOutcome.md)\> - -Defined in: [intelligence/delivery.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L106) - -Pull the certified composed profile for a target. Fail-closed: a network -error or a non-2xx returns a typed `succeeded: false` (never throws), so a -caller can run on its base surface when Intelligence is unreachable. A 404 is -the normal "nothing promoted yet" signal, carried as `status: 404`. - -## Parameters - -### opts - -[`PullCertifiedOptions`](../interfaces/PullCertifiedOptions.md) - -## Returns - -`Promise`\<[`PullOutcome`](../type-aliases/PullOutcome.md)\> diff --git a/docs/api/intelligence/functions/resolveEffort.md b/docs/api/intelligence/functions/resolveEffort.md deleted file mode 100644 index 04ba96c..0000000 --- a/docs/api/intelligence/functions/resolveEffort.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / resolveEffort - -# Function: resolveEffort() - -> **resolveEffort**(`tier`, `overrides?`): [`EffortSettings`](../interfaces/EffortSettings.md) - -Defined in: [intelligence/effort.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L107) - -Compile a named tier (plus optional per-field overrides) into the flat -`EffortSettings` the wrapper reads. Pure: same inputs → same object, no I/O, -no execution. Fails loud on an unknown tier rather than silently defaulting — -a typo'd tier must not quietly grant or deny intelligence. - -Invariant preserved for the billing floor: `resolveEffort('off')` always -yields `intelligenceBudgetUsd: 0` with every intelligence knob off UNLESS the -caller explicitly overrides a field — overriding off is an opt-in the caller -owns, not a default the composer leaks. - -## Parameters - -### tier - -[`EffortTier`](../type-aliases/EffortTier.md) - -### overrides? - -`Partial`\<[`EffortSettings`](../interfaces/EffortSettings.md)\> - -## Returns - -[`EffortSettings`](../interfaces/EffortSettings.md) diff --git a/docs/api/intelligence/functions/resolveRedactor.md b/docs/api/intelligence/functions/resolveRedactor.md deleted file mode 100644 index b4d0696..0000000 --- a/docs/api/intelligence/functions/resolveRedactor.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / resolveRedactor - -# Function: resolveRedactor() - -> **resolveRedactor**(`redact`): [`Redactor`](../type-aliases/Redactor.md) - -Defined in: [intelligence/redact.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/redact.ts#L91) - -Resolve the redactor a client uses. A caller-supplied hook replaces the -default entirely (the customer owns their PII rules); absent one, the -built-in `defaultRedactor` runs. Returning `false` is the explicit opt-out — -NO redaction, for a caller who has already sanitized upstream and wants raw -fidelity. Opt-out is loud (an explicit `false`), never a silent default. - -## Parameters - -### redact - -`false` \| [`Redactor`](../type-aliases/Redactor.md) \| `undefined` - -## Returns - -[`Redactor`](../type-aliases/Redactor.md) diff --git a/docs/api/intelligence/functions/withCertifiedDelivery.md b/docs/api/intelligence/functions/withCertifiedDelivery.md deleted file mode 100644 index 3ba148f..0000000 --- a/docs/api/intelligence/functions/withCertifiedDelivery.md +++ /dev/null @@ -1,42 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / withCertifiedDelivery - -# Function: withCertifiedDelivery() - -> **withCertifiedDelivery**\<`I`, `O`\>(`agent`, `config`): (`input`) => `Promise`\<`O`\> & `object` - -Defined in: [intelligence/delivery.ts:216](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L216) - -Wrap an agent so it (a) Observes each run via the shipped Observe client and -(b) RECEIVES the tenant's certified artifacts pulled from the deployed plane. -The certified profile is cached and refreshed at most every `refreshMs`; a -failed pull is fail-closed — the agent runs on its base surface and never -breaks because Intelligence is unreachable. When the plane promotes a new -gate-certified surface, the next refresh delivers it to the running agent. - -## Type Parameters - -### I - -`I` - -### O - -`O` - -## Parameters - -### agent - -[`DeliveredAgent`](../type-aliases/DeliveredAgent.md)\<`I`, `O`\> - -### config - -[`DeliveryConfig`](../interfaces/DeliveryConfig.md) - -## Returns - -(`input`) => `Promise`\<`O`\> & `object` diff --git a/docs/api/intelligence/functions/withTangleIntelligence.md b/docs/api/intelligence/functions/withTangleIntelligence.md deleted file mode 100644 index 92dc5b3..0000000 --- a/docs/api/intelligence/functions/withTangleIntelligence.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / withTangleIntelligence - -# Function: withTangleIntelligence() - -> **withTangleIntelligence**\<`TInput`, `TOutput`\>(`agent`, `clientOrConfig`): [`Agent`](../type-aliases/Agent.md)\<`TInput`, `TOutput`\> - -Defined in: [intelligence/index.ts:530](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L530) - -Wrap a generic `agent` with best-effort Observe-mode tracing, returning the -SAME shape. Each call runs the agent under a trace and exports one span; an -export failure is swallowed (the live agent never fails because Intelligence -is down) but an error from the agent itself propagates unchanged. - -At `effort: 'off'` this is pure passthrough plus best-effort telemetry — -zero intelligence spawns, `intelligenceUsd: 0` on the trace. - -## Type Parameters - -### TInput - -`TInput` - -### TOutput - -`TOutput` - -## Parameters - -### agent - -[`Agent`](../type-aliases/Agent.md)\<`TInput`, `TOutput`\> - -### clientOrConfig - -[`ClientOrConfig`](../type-aliases/ClientOrConfig.md) - -## Returns - -[`Agent`](../type-aliases/Agent.md)\<`TInput`, `TOutput`\> diff --git a/docs/api/intelligence/interfaces/AppliedIntelligence.md b/docs/api/intelligence/interfaces/AppliedIntelligence.md deleted file mode 100644 index a64f719..0000000 --- a/docs/api/intelligence/interfaces/AppliedIntelligence.md +++ /dev/null @@ -1,42 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / AppliedIntelligence - -# Interface: AppliedIntelligence - -Defined in: [intelligence/delivery.ts:181](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L181) - -What the delivery wrapper hands the agent each run. - -## Properties - -### certified - -> **certified**: [`CertifiedProfile`](CertifiedProfile.md) \| `null` - -Defined in: [intelligence/delivery.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L184) - -The certified profile in effect (null when none promoted / pull failed — - fail-closed: the agent runs on its base surface). - -## Methods - -### composePrompt() - -> **composePrompt**(`base`): `string` - -Defined in: [intelligence/delivery.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L186) - -Fold the certified prompt surface into a base system prompt. - -#### Parameters - -##### base - -`string` - -#### Returns - -`string` diff --git a/docs/api/intelligence/interfaces/CapabilityManifest.md b/docs/api/intelligence/interfaces/CapabilityManifest.md deleted file mode 100644 index 05a2f49..0000000 --- a/docs/api/intelligence/interfaces/CapabilityManifest.md +++ /dev/null @@ -1,45 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / CapabilityManifest - -# Interface: CapabilityManifest - -Defined in: [intelligence/capability.ts:176](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L176) - -The strict generalization of `CertifiedProfile`. `promptSurface` is kept -during the migration window (the shipped pull lane still emits it); new -capabilities live in `capabilities`. - -## Properties - -### target - -> **target**: `string` - -Defined in: [intelligence/capability.ts:177](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L177) - -*** - -### generatedAt - -> **generatedAt**: `string` - -Defined in: [intelligence/capability.ts:178](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L178) - -*** - -### promptSurface - -> **promptSurface**: [`CertifiedPromptSurface`](CertifiedPromptSurface.md) \| `null` - -Defined in: [intelligence/capability.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L179) - -*** - -### capabilities - -> **capabilities**: [`CertifiedCapability`](CertifiedCapability.md)[] - -Defined in: [intelligence/capability.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L180) diff --git a/docs/api/intelligence/interfaces/CertProvenance.md b/docs/api/intelligence/interfaces/CertProvenance.md deleted file mode 100644 index afedfac..0000000 --- a/docs/api/intelligence/interfaces/CertProvenance.md +++ /dev/null @@ -1,61 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / CertProvenance - -# Interface: CertProvenance - -Defined in: [intelligence/capability.ts:154](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L154) - -The certify lane's held-out lift travelling WITH delivery. The shipped -`CertifiedArtifact` envelope minus its content (which moves into the binding -arm): `version`/`contentHash`/`lift` are stamped by the promote step, never -the author. - -`sourcePath` is the artifact's ORIGINAL path (including `null`). It is the -byte-stable fold sort key — the resolver folds context artifacts in -`composeCertifiedPrompt` order, which sorts by `path ?? ''`, so a `null` path -is load-bearing and MUST round-trip exactly. It is distinct from a context -`iface.name` (display only): collapsing the two flips the fold order for a -mix of null-path and non-null-path artifacts. - -## Properties - -### contentHash - -> **contentHash**: `string` - -Defined in: [intelligence/capability.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L155) - -*** - -### version - -> **version**: `number` \| `null` - -Defined in: [intelligence/capability.ts:156](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L156) - -*** - -### lift - -> **lift**: `string` \| `null` - -Defined in: [intelligence/capability.ts:157](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L157) - -*** - -### promotedAt - -> **promotedAt**: `string` - -Defined in: [intelligence/capability.ts:158](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L158) - -*** - -### sourcePath - -> **sourcePath**: `string` \| `null` - -Defined in: [intelligence/capability.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L159) diff --git a/docs/api/intelligence/interfaces/CertifiedArtifact.md b/docs/api/intelligence/interfaces/CertifiedArtifact.md deleted file mode 100644 index 4c9a969..0000000 --- a/docs/api/intelligence/interfaces/CertifiedArtifact.md +++ /dev/null @@ -1,62 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / CertifiedArtifact - -# Interface: CertifiedArtifact - -Defined in: [intelligence/delivery.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L33) - -A promoted, certified artifact (one entry in the composed profile). - -## Properties - -### path - -> **path**: `string` \| `null` - -Defined in: [intelligence/delivery.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L34) - -*** - -### content - -> **content**: `string` - -Defined in: [intelligence/delivery.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L35) - -*** - -### contentHash - -> **contentHash**: `string` - -Defined in: [intelligence/delivery.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L36) - -*** - -### version - -> **version**: `number` \| `null` - -Defined in: [intelligence/delivery.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L37) - -*** - -### lift - -> **lift**: `string` \| `null` - -Defined in: [intelligence/delivery.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L40) - -Held-out gate lift attached at certification, e.g. "+3.1pp" — never a - within-run claim. `null` when the promotion carried no lift record. - -*** - -### promotedAt - -> **promotedAt**: `string` - -Defined in: [intelligence/delivery.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L41) diff --git a/docs/api/intelligence/interfaces/CertifiedCapability.md b/docs/api/intelligence/interfaces/CertifiedCapability.md deleted file mode 100644 index e15eba3..0000000 --- a/docs/api/intelligence/interfaces/CertifiedCapability.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / CertifiedCapability - -# Interface: CertifiedCapability - -Defined in: [intelligence/capability.ts:163](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L163) - -One certified unit of agent power. - -## Properties - -### id - -> **id**: `string` - -Defined in: [intelligence/capability.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L164) - -*** - -### iface - -> **iface**: [`CapabilityInterface`](../type-aliases/CapabilityInterface.md) - -Defined in: [intelligence/capability.ts:165](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L165) - -*** - -### binding - -> **binding**: [`DeliveryBinding`](../type-aliases/DeliveryBinding.md) - -Defined in: [intelligence/capability.ts:166](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L166) - -*** - -### auth - -> **auth**: [`CapabilityAuth`](../type-aliases/CapabilityAuth.md) - -Defined in: [intelligence/capability.ts:167](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L167) - -*** - -### provenance - -> **provenance**: [`CertProvenance`](CertProvenance.md) - -Defined in: [intelligence/capability.ts:168](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L168) diff --git a/docs/api/intelligence/interfaces/CertifiedProfile.md b/docs/api/intelligence/interfaces/CertifiedProfile.md deleted file mode 100644 index e1018f9..0000000 --- a/docs/api/intelligence/interfaces/CertifiedProfile.md +++ /dev/null @@ -1,44 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / CertifiedProfile - -# Interface: CertifiedProfile - -Defined in: [intelligence/delivery.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L54) - -The composed certified profile — exactly the shape the plane's - `GET /v1/profiles/:target/composed` returns. - -## Properties - -### target - -> **target**: `string` - -Defined in: [intelligence/delivery.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L55) - -*** - -### generatedAt - -> **generatedAt**: `string` - -Defined in: [intelligence/delivery.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L56) - -*** - -### promptSurface - -> **promptSurface**: [`CertifiedPromptSurface`](CertifiedPromptSurface.md) \| `null` - -Defined in: [intelligence/delivery.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L57) - -*** - -### artifacts - -> **artifacts**: `Record`\<`string`, [`CertifiedArtifact`](CertifiedArtifact.md)[]\> - -Defined in: [intelligence/delivery.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L58) diff --git a/docs/api/intelligence/interfaces/CertifiedPromptSurface.md b/docs/api/intelligence/interfaces/CertifiedPromptSurface.md deleted file mode 100644 index bf6627b..0000000 --- a/docs/api/intelligence/interfaces/CertifiedPromptSurface.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / CertifiedPromptSurface - -# Interface: CertifiedPromptSurface - -Defined in: [intelligence/delivery.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L45) - -The active promoted prompt surface for a target. - -## Properties - -### surface - -> **surface**: `string` - -Defined in: [intelligence/delivery.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L46) - -*** - -### surfaceHash - -> **surfaceHash**: `string` - -Defined in: [intelligence/delivery.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L47) - -*** - -### version - -> **version**: `number` \| `null` - -Defined in: [intelligence/delivery.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L48) - -*** - -### lift - -> **lift**: `string` \| `null` - -Defined in: [intelligence/delivery.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L49) diff --git a/docs/api/intelligence/interfaces/CredentialRef.md b/docs/api/intelligence/interfaces/CredentialRef.md deleted file mode 100644 index 18f4210..0000000 --- a/docs/api/intelligence/interfaces/CredentialRef.md +++ /dev/null @@ -1,19 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / CredentialRef - -# Interface: CredentialRef - -Defined in: [intelligence/capability.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L71) - -A named secret a binding requires — declared, never carried. - -## Properties - -### key - -> **key**: `string` - -Defined in: [intelligence/capability.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L72) diff --git a/docs/api/intelligence/interfaces/DeliveryConfig.md b/docs/api/intelligence/interfaces/DeliveryConfig.md deleted file mode 100644 index ba5fd7e..0000000 --- a/docs/api/intelligence/interfaces/DeliveryConfig.md +++ /dev/null @@ -1,197 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / DeliveryConfig - -# Interface: DeliveryConfig - -Defined in: [intelligence/delivery.ts:194](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L194) - -Delivery config = the Observe config plus the pull target + refresh cadence. - -## Extends - -- [`IntelligenceConfig`](IntelligenceConfig.md) - -## Properties - -### target? - -> `optional` **target?**: `string` - -Defined in: [intelligence/delivery.ts:196](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L196) - -Pull target. Defaults to `project`. - -*** - -### baseUrl? - -> `optional` **baseUrl?**: `string` - -Defined in: [intelligence/delivery.ts:199](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L199) - -Plane base URL for the pull (NOT the OTLP `endpoint`). Defaults to - `TANGLE_INTELLIGENCE_URL` then `https://intelligence.tangle.tools`. - -*** - -### refreshMs? - -> `optional` **refreshMs?**: `number` - -Defined in: [intelligence/delivery.ts:201](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L201) - -Min interval between certified-profile pulls. Default 5m. - -*** - -### timeoutMs? - -> `optional` **timeoutMs?**: `number` - -Defined in: [intelligence/delivery.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L203) - -Per-pull timeout in ms (fail-closed on a hung plane). Default 10000. - -*** - -### fetchImpl? - -> `optional` **fetchImpl?**: (`input`, `init?`) => `Promise`\<`Response`\> - -Defined in: [intelligence/delivery.ts:205](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L205) - -fetch impl for the pull (tests). Defaults to global fetch. - -#### Parameters - -##### input - -`string` \| `URL` \| `Request` - -##### init? - -`RequestInit` - -#### Returns - -`Promise`\<`Response`\> - -*** - -### project - -> **project**: `string` - -Defined in: [intelligence/index.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L124) - -Stable project id — the tenant dimension every trace is tagged with. - -#### Inherited from - -[`IntelligenceConfig`](IntelligenceConfig.md).[`project`](IntelligenceConfig.md#project) - -*** - -### apiKey? - -> `optional` **apiKey?**: `string` - -Defined in: [intelligence/index.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L126) - -Bearer key for the Intelligence ingest. Reads `TANGLE_API_KEY` when omitted. - -#### Inherited from - -[`IntelligenceConfig`](IntelligenceConfig.md).[`apiKey`](IntelligenceConfig.md#apikey) - -*** - -### effort? - -> `optional` **effort?**: [`EffortTier`](../type-aliases/EffortTier.md) \| \{ `tier`: [`EffortTier`](../type-aliases/EffortTier.md); `overrides?`: `Partial`\<[`EffortSettings`](EffortSettings.md)\>; \} - -Defined in: [intelligence/index.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L128) - -Effort tier (default `'standard'`) plus optional per-field overrides. - -#### Inherited from - -[`IntelligenceConfig`](IntelligenceConfig.md).[`effort`](IntelligenceConfig.md#effort) - -*** - -### endpoint? - -> `optional` **endpoint?**: `string` - -Defined in: [intelligence/index.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L135) - -OTLP ingest base. The underlying exporter appends `/v1/traces`, so point -this at the OTLP route (e.g. `https://intelligence.tangle.tools/v1/otlp`). -Reads `INTELLIGENCE_OTLP_ENDPOINT` then `OTEL_EXPORTER_OTLP_ENDPOINT` when -omitted; absent all three, export is a no-op (best-effort by construction). - -#### Inherited from - -[`IntelligenceConfig`](IntelligenceConfig.md).[`endpoint`](IntelligenceConfig.md#endpoint) - -*** - -### redact? - -> `optional` **redact?**: `false` \| [`Redactor`](../type-aliases/Redactor.md) - -Defined in: [intelligence/index.ts:141](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L141) - -Redaction hook run over every exported input/output. A function replaces -the default scrubber; `false` opts out entirely (raw fidelity, caller has -sanitized upstream); omitted ⇒ the built-in `defaultRedactor`. - -#### Inherited from - -[`IntelligenceConfig`](IntelligenceConfig.md).[`redact`](IntelligenceConfig.md#redact) - -*** - -### surfaces? - -> `optional` **surfaces?**: `string`[] - -Defined in: [intelligence/index.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L143) - -Mutable surfaces a later PR mode would edit. Recorded for `doctor()` only. - -#### Inherited from - -[`IntelligenceConfig`](IntelligenceConfig.md).[`surfaces`](IntelligenceConfig.md#surfaces) - -*** - -### checks? - -> `optional` **checks?**: `string`[] - -Defined in: [intelligence/index.ts:145](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L145) - -Verification checks a later PR mode would gate on. Recorded for `doctor()` only. - -#### Inherited from - -[`IntelligenceConfig`](IntelligenceConfig.md).[`checks`](IntelligenceConfig.md#checks) - -*** - -### repo? - -> `optional` **repo?**: [`RepoConfig`](RepoConfig.md) - -Defined in: [intelligence/index.ts:147](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L147) - -Repo access a later PR mode would need. Recorded for `doctor()` only. - -#### Inherited from - -[`IntelligenceConfig`](IntelligenceConfig.md).[`repo`](IntelligenceConfig.md#repo) diff --git a/docs/api/intelligence/interfaces/DoctorReport.md b/docs/api/intelligence/interfaces/DoctorReport.md deleted file mode 100644 index 23e1797..0000000 --- a/docs/api/intelligence/interfaces/DoctorReport.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / DoctorReport - -# Interface: DoctorReport - -Defined in: [intelligence/index.ts:254](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L254) - -The `doctor()` readiness report — Mode-readiness without any network call. - -## Properties - -### project - -> **project**: `string` - -Defined in: [intelligence/index.ts:255](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L255) - -*** - -### effort - -> **effort**: [`EffortSettings`](EffortSettings.md) - -Defined in: [intelligence/index.ts:256](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L256) - -*** - -### exportConfigured - -> **exportConfigured**: `boolean` - -Defined in: [intelligence/index.ts:258](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L258) - -True when an OTLP endpoint is configured (export will actually ship). - -*** - -### modes - -> **modes**: `object` - -Defined in: [intelligence/index.ts:259](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L259) - -#### observe - -> **observe**: [`ModeReadiness`](ModeReadiness.md) - -#### recommend - -> **recommend**: [`ModeReadiness`](ModeReadiness.md) - -#### pr - -> **pr**: [`ModeReadiness`](ModeReadiness.md) diff --git a/docs/api/intelligence/interfaces/EffortOverridesCompiled.md b/docs/api/intelligence/interfaces/EffortOverridesCompiled.md deleted file mode 100644 index 46631d4..0000000 --- a/docs/api/intelligence/interfaces/EffortOverridesCompiled.md +++ /dev/null @@ -1,66 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / EffortOverridesCompiled - -# Interface: EffortOverridesCompiled - -Defined in: [intelligence/effort.ts:156](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L156) - -The run-config overrides an `EffortSettings` compiles to — the bridge between the -pure effort policy and the orchestration entrypoints (`runPersonified` / the -improvement cycle). This is ONLY data: it never constructs an analyst or runs a -loop. The caller reads these flags to decide WHAT to pass: - - - `withAnalyst: false` ⇒ DO NOT construct/pass a `ScopeAnalyst` to `runPersonified` - (the dormant empty-findings path runs; the base agent still works). This is the - PRODUCT fail-closed at `off`/`eco` — "don't construct the analyst" — distinct from - the EXPERIMENT fail-closed inside `createScopeAnalyst` ("hard abort"), which stays - untouched. Degrade, never throw. - - `fanout` ⇒ the `ShapeBudget.fanout` width to pass (`1` at `off`, the tier's breadth - otherwise). Overrides the personify default fanout. - - `withLoops: false` ⇒ the improvement cycle is a no-op for this run (no refine / - fanout-vote multi-step loop spawns). - - `intelligenceBudgetUsd` ⇒ the intelligence-class spend ceiling carried through for - the billing clamp (passed verbatim; `0` refuses every intelligence spawn). - -## Properties - -### withAnalyst - -> **withAnalyst**: `boolean` - -Defined in: [intelligence/effort.ts:158](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L158) - -Construct + pass a `ScopeAnalyst`? `false` ⇒ omit it (degrade to the base agent). - -*** - -### fanout - -> **fanout**: `number` - -Defined in: [intelligence/effort.ts:160](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L160) - -`ShapeBudget.fanout` width to pass to `runPersonified`. - -*** - -### withLoops - -> **withLoops**: `boolean` - -Defined in: [intelligence/effort.ts:162](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L162) - -Run the multi-step improvement cycle, or no-op it for this run? - -*** - -### intelligenceBudgetUsd - -> **intelligenceBudgetUsd**: `number` \| `null` - -Defined in: [intelligence/effort.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L164) - -Intelligence-class spend ceiling. `0` refuses every intelligence spawn; `null` uncapped. diff --git a/docs/api/intelligence/interfaces/EffortSettings.md b/docs/api/intelligence/interfaces/EffortSettings.md deleted file mode 100644 index efe233b..0000000 --- a/docs/api/intelligence/interfaces/EffortSettings.md +++ /dev/null @@ -1,66 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / EffortSettings - -# Interface: EffortSettings - -Defined in: [intelligence/effort.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L31) - -The flat, resolved settings a tier compiles to. Every field is individually -overridable through `resolveEffort`. Pure data — read by the wrapper, never -self-executing. - -## Properties - -### analysts - -> **analysts**: `boolean` - -Defined in: [intelligence/effort.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L33) - -Whether trace-derived analyst diagnosis may spawn. `false` ⇒ no analyst. - -*** - -### corpus - -> **corpus**: [`CorpusAccess`](../type-aliases/CorpusAccess.md) - -Defined in: [intelligence/effort.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L35) - -Cross-run corpus access this tier permits. - -*** - -### fanout - -> **fanout**: `number` - -Defined in: [intelligence/effort.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L37) - -Parallel candidate width. `1` ⇒ single-shot, no breadth. - -*** - -### loops - -> **loops**: `boolean` - -Defined in: [intelligence/effort.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L39) - -Whether multi-step improvement loops (refine / fanout-vote) may run. - -*** - -### intelligenceBudgetUsd - -> **intelligenceBudgetUsd**: `number` \| `null` - -Defined in: [intelligence/effort.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L46) - -Ceiling, in USD, for INTELLIGENCE-class spawns only (analysts, corpus, -loops) — NOT base inference. `0` refuses every intelligence spawn; `null` -means uncapped (the spend lands on the Pareto receipt). Base-stream -inference is billed on its own channel and is never constrained here. diff --git a/docs/api/intelligence/interfaces/HostSpec.md b/docs/api/intelligence/interfaces/HostSpec.md deleted file mode 100644 index 061af69..0000000 --- a/docs/api/intelligence/interfaces/HostSpec.md +++ /dev/null @@ -1,62 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / HostSpec - -# Interface: HostSpec - -Defined in: [intelligence/capability.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L94) - -The host a `process-on-infra` binding provisions before its inner binding. -Reuses `createExecutor`'s backend-as-data vocabulary — no new runtime invented. -`image` is the sandbox image tag; `warm`/`idleTtlMs`/`costTag` meter standing -cost; `ports` are the inner server's listen ports the host must expose. - -## Properties - -### backend - -> **backend**: `"router"` \| `"sandbox"` \| `"cli"` - -Defined in: [intelligence/capability.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L95) - -*** - -### image? - -> `optional` **image?**: `string` - -Defined in: [intelligence/capability.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L96) - -*** - -### ports? - -> `optional` **ports?**: `number`[] - -Defined in: [intelligence/capability.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L97) - -*** - -### warm? - -> `optional` **warm?**: `boolean` - -Defined in: [intelligence/capability.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L98) - -*** - -### idleTtlMs? - -> `optional` **idleTtlMs?**: `number` - -Defined in: [intelligence/capability.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L99) - -*** - -### costTag? - -> `optional` **costTag?**: `string` - -Defined in: [intelligence/capability.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L100) diff --git a/docs/api/intelligence/interfaces/IntelligenceClient.md b/docs/api/intelligence/interfaces/IntelligenceClient.md deleted file mode 100644 index 163ac90..0000000 --- a/docs/api/intelligence/interfaces/IntelligenceClient.md +++ /dev/null @@ -1,123 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / IntelligenceClient - -# Interface: IntelligenceClient - -Defined in: [intelligence/index.ts:215](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L215) - -The Observe-mode Intelligence client. - -## Properties - -### project - -> `readonly` **project**: `string` - -Defined in: [intelligence/index.ts:217](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L217) - -The resolved project id. - -*** - -### effort - -> `readonly` **effort**: [`EffortSettings`](EffortSettings.md) - -Defined in: [intelligence/index.ts:219](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L219) - -The resolved effort settings. - -## Methods - -### traceRun() - -> **traceRun**\<`T`\>(`meta`, `fn`): `Promise`\<`T`\> - -Defined in: [intelligence/index.ts:225](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L225) - -Run `fn` under a trace, export one span best-effort, and return whatever -`fn` returns. Telemetry-export failures are swallowed; an error THROWN by -`fn` propagates to the caller (the agent's own failures are not masked). - -#### Type Parameters - -##### T - -`T` - -#### Parameters - -##### meta - -[`TraceMeta`](TraceMeta.md) - -##### fn - -(`trace`) => `Promise`\<`T`\> - -#### Returns - -`Promise`\<`T`\> - -*** - -### recordTrace() - -> **recordTrace**(`events`, `meta?`): `string` - -Defined in: [intelligence/index.ts:235](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L235) - -Export a run's full loop topology — the ordered `LoopTraceEvent` stream a -`runLoop`/`Supervisor` run emits — as a nested OTLP span tree (loop → round → -iteration) into ONE trace. Reuses the shipped `buildLoopOtelSpans` builder -(NO second span builder), so the topology a viewer renders matches the -kernel's. `traceId` defaults to a fresh id; `rootParentSpanId` parents the -loop root under an enclosing span (e.g. a `traceRun` span) when given. -Best-effort: export failures are swallowed. Returns the resolved `traceId`. - -#### Parameters - -##### events - -readonly [`LoopTraceEvent`](../../runtime/type-aliases/LoopTraceEvent.md)[] - -##### meta? - -[`RecordTraceMeta`](RecordTraceMeta.md) - -#### Returns - -`string` - -*** - -### doctor() - -> **doctor**(): [`DoctorReport`](DoctorReport.md) - -Defined in: [intelligence/index.ts:241](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L241) - -Network-free readiness report: which adoption modes are reachable given -this config. Observe is always reachable; Recommend needs outcomes; PR -needs checks + surfaces + repo. - -#### Returns - -[`DoctorReport`](DoctorReport.md) - -*** - -### flush() - -> **flush**(): `Promise`\<`void`\> - -Defined in: [intelligence/index.ts:243](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L243) - -Flush any pending export spans. Best-effort; resolves even if export fails. - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/intelligence/interfaces/IntelligenceConfig.md b/docs/api/intelligence/interfaces/IntelligenceConfig.md deleted file mode 100644 index f05dcb0..0000000 --- a/docs/api/intelligence/interfaces/IntelligenceConfig.md +++ /dev/null @@ -1,102 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / IntelligenceConfig - -# Interface: IntelligenceConfig - -Defined in: [intelligence/index.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L122) - -Client configuration. `project` + `apiKey` are the Observe minimum; the - rest tune effort, endpoint, redaction, and (for `doctor()` readiness) - declare the surfaces/checks/repo a later PR mode would need. - -## Extended by - -- [`DeliveryConfig`](DeliveryConfig.md) - -## Properties - -### project - -> **project**: `string` - -Defined in: [intelligence/index.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L124) - -Stable project id — the tenant dimension every trace is tagged with. - -*** - -### apiKey? - -> `optional` **apiKey?**: `string` - -Defined in: [intelligence/index.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L126) - -Bearer key for the Intelligence ingest. Reads `TANGLE_API_KEY` when omitted. - -*** - -### effort? - -> `optional` **effort?**: [`EffortTier`](../type-aliases/EffortTier.md) \| \{ `tier`: [`EffortTier`](../type-aliases/EffortTier.md); `overrides?`: `Partial`\<[`EffortSettings`](EffortSettings.md)\>; \} - -Defined in: [intelligence/index.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L128) - -Effort tier (default `'standard'`) plus optional per-field overrides. - -*** - -### endpoint? - -> `optional` **endpoint?**: `string` - -Defined in: [intelligence/index.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L135) - -OTLP ingest base. The underlying exporter appends `/v1/traces`, so point -this at the OTLP route (e.g. `https://intelligence.tangle.tools/v1/otlp`). -Reads `INTELLIGENCE_OTLP_ENDPOINT` then `OTEL_EXPORTER_OTLP_ENDPOINT` when -omitted; absent all three, export is a no-op (best-effort by construction). - -*** - -### redact? - -> `optional` **redact?**: `false` \| [`Redactor`](../type-aliases/Redactor.md) - -Defined in: [intelligence/index.ts:141](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L141) - -Redaction hook run over every exported input/output. A function replaces -the default scrubber; `false` opts out entirely (raw fidelity, caller has -sanitized upstream); omitted ⇒ the built-in `defaultRedactor`. - -*** - -### surfaces? - -> `optional` **surfaces?**: `string`[] - -Defined in: [intelligence/index.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L143) - -Mutable surfaces a later PR mode would edit. Recorded for `doctor()` only. - -*** - -### checks? - -> `optional` **checks?**: `string`[] - -Defined in: [intelligence/index.ts:145](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L145) - -Verification checks a later PR mode would gate on. Recorded for `doctor()` only. - -*** - -### repo? - -> `optional` **repo?**: [`RepoConfig`](RepoConfig.md) - -Defined in: [intelligence/index.ts:147](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L147) - -Repo access a later PR mode would need. Recorded for `doctor()` only. diff --git a/docs/api/intelligence/interfaces/ModeReadiness.md b/docs/api/intelligence/interfaces/ModeReadiness.md deleted file mode 100644 index 1e98c8a..0000000 --- a/docs/api/intelligence/interfaces/ModeReadiness.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / ModeReadiness - -# Interface: ModeReadiness - -Defined in: [intelligence/index.ts:247](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L247) - -One mode's readiness verdict. - -## Properties - -### ready - -> **ready**: `boolean` - -Defined in: [intelligence/index.ts:248](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L248) - -*** - -### missing - -> **missing**: `string`[] - -Defined in: [intelligence/index.ts:250](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L250) - -Inputs this mode still needs, when not ready. Empty when ready. diff --git a/docs/api/intelligence/interfaces/ProvisionedHost.md b/docs/api/intelligence/interfaces/ProvisionedHost.md deleted file mode 100644 index a71ff5e..0000000 --- a/docs/api/intelligence/interfaces/ProvisionedHost.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / ProvisionedHost - -# Interface: ProvisionedHost - -Defined in: [intelligence/resolver.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L49) - -A live, provisioned host the resolver tore up for a `process-on-infra` arm. - `teardown()` runs at `dispose()` in reverse provisioning order. - -## Properties - -### mcpConnection? - -> `optional` **mcpConnection?**: `AgentProfileMcpServer` - -Defined in: [intelligence/resolver.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L52) - -Lower the inner binding's mcp connection now that the host is up; the URL/ - command points at the host. Absent when the host serves a non-mcp inner. - -## Methods - -### teardown() - -> **teardown**(): `Promise`\<`void`\> - -Defined in: [intelligence/resolver.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L53) - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/intelligence/interfaces/PullCertifiedOptions.md b/docs/api/intelligence/interfaces/PullCertifiedOptions.md deleted file mode 100644 index 090e0c0..0000000 --- a/docs/api/intelligence/interfaces/PullCertifiedOptions.md +++ /dev/null @@ -1,76 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / PullCertifiedOptions - -# Interface: PullCertifiedOptions - -Defined in: [intelligence/delivery.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L67) - -## Properties - -### target - -> **target**: `string` - -Defined in: [intelligence/delivery.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L69) - -The agent target certified artifacts are promoted under. - -*** - -### apiKey? - -> `optional` **apiKey?**: `string` - -Defined in: [intelligence/delivery.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L71) - -Bearer key. Defaults to `process.env.TANGLE_API_KEY`. - -*** - -### baseUrl? - -> `optional` **baseUrl?**: `string` - -Defined in: [intelligence/delivery.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L74) - -Plane base URL. Defaults to `process.env.TANGLE_INTELLIGENCE_URL` then - `https://intelligence.tangle.tools`. - -*** - -### fetchImpl? - -> `optional` **fetchImpl?**: (`input`, `init?`) => `Promise`\<`Response`\> - -Defined in: [intelligence/delivery.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L76) - -fetch impl (tests / non-global-fetch runtimes). Defaults to global fetch. - -#### Parameters - -##### input - -`string` \| `URL` \| `Request` - -##### init? - -`RequestInit` - -#### Returns - -`Promise`\<`Response`\> - -*** - -### timeoutMs? - -> `optional` **timeoutMs?**: `number` - -Defined in: [intelligence/delivery.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L80) - -Abort the pull after this many ms so a hung plane never blocks the caller. - Default 10000. The timeout surfaces as a normal fail-closed `succeeded: - false` (the agent runs on its base surface). diff --git a/docs/api/intelligence/interfaces/RecordTraceMeta.md b/docs/api/intelligence/interfaces/RecordTraceMeta.md deleted file mode 100644 index 0684383..0000000 --- a/docs/api/intelligence/interfaces/RecordTraceMeta.md +++ /dev/null @@ -1,32 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / RecordTraceMeta - -# Interface: RecordTraceMeta - -Defined in: [intelligence/index.ts:190](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L190) - -Metadata for [IntelligenceClient.recordTrace](IntelligenceClient.md#recordtrace). - -## Properties - -### traceId? - -> `optional` **traceId?**: `string` - -Defined in: [intelligence/index.ts:192](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L192) - -32-hex trace id to anchor every span to. Defaults to a fresh id. - -*** - -### rootParentSpanId? - -> `optional` **rootParentSpanId?**: `string` - -Defined in: [intelligence/index.ts:195](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L195) - -Span id of an enclosing span the loop root should parent under (e.g. a - `traceRun` span). Omitted ⇒ the loop root is the trace root. diff --git a/docs/api/intelligence/interfaces/RepoConfig.md b/docs/api/intelligence/interfaces/RepoConfig.md deleted file mode 100644 index cbf16a2..0000000 --- a/docs/api/intelligence/interfaces/RepoConfig.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / RepoConfig - -# Interface: RepoConfig - -Defined in: [intelligence/index.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L113) - -Repo coordinates a product may declare for the (later) Gated-PR mode. The - Observe slice only records their PRESENCE for `doctor()`; it never touches - the repo. - -## Properties - -### owner - -> **owner**: `string` - -Defined in: [intelligence/index.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L114) - -*** - -### name - -> **name**: `string` - -Defined in: [intelligence/index.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L115) - -*** - -### baseBranch - -> **baseBranch**: `string` - -Defined in: [intelligence/index.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L116) diff --git a/docs/api/intelligence/interfaces/ResolveCtx.md b/docs/api/intelligence/interfaces/ResolveCtx.md deleted file mode 100644 index ffb78b6..0000000 --- a/docs/api/intelligence/interfaces/ResolveCtx.md +++ /dev/null @@ -1,191 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / ResolveCtx - -# Interface: ResolveCtx - -Defined in: [intelligence/resolver.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L61) - -Per-call, per-tenant context the resolver reads. Everything that touches the -network, a secret, or an infra provisioner is INJECTED so the manifest carries -no live secret and the substrate-free caller wires only what it can host. - -## Properties - -### tenant? - -> `optional` **tenant?**: `string` - -Defined in: [intelligence/resolver.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L63) - -Stable tenant id — namespaces billing + teardown (`tenant#target`). - -*** - -### fetchImpl? - -> `optional` **fetchImpl?**: (`input`, `init?`) => `Promise`\<`Response`\> - -Defined in: [intelligence/resolver.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L65) - -fetch impl for http tools. Defaults to global fetch; absent ⇒ http tools fail loud. - -#### Parameters - -##### input - -`string` \| `URL` \| `Request` - -##### init? - -`RequestInit` - -#### Returns - -`Promise`\<`Response`\> - -*** - -### resolveSecret? - -> `optional` **resolveSecret?**: (`auth`, `tenant`) => `Promise`\<\{ `succeeded`: `true`; `value`: `string`; \} \| \{ `succeeded`: `false`; `error`: `string`; \}\> - -Defined in: [intelligence/resolver.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L71) - -Resolve a declared credential to a live secret for THIS tenant. Returns a -typed outcome — inspect `succeeded` before `value`. Absent ⇒ a binding that -declares non-`none` auth fails loud (never a request with no credential). - -#### Parameters - -##### auth - -[`CapabilityAuth`](../type-aliases/CapabilityAuth.md) - -##### tenant - -`string` \| `undefined` - -#### Returns - -`Promise`\<\{ `succeeded`: `true`; `value`: `string`; \} \| \{ `succeeded`: `false`; `error`: `string`; \}\> - -*** - -### runSandboxCode? - -> `optional` **runSandboxCode?**: (`code`, `entry`, `args`, `task`) => `Promise`\<`string`\> - -Defined in: [intelligence/resolver.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L80) - -Run a `sandbox-code` body per call. Injected by the host that owns a sandbox -client (the spine does not import the sandbox executor). Absent ⇒ -`sandbox-code` bindings fail loud. - -#### Parameters - -##### code - -[`ContentRef`](../type-aliases/ContentRef.md) - -##### entry - -`string` - -##### args - -`Record`\<`string`, `unknown`\> - -##### task - -`unknown` - -#### Returns - -`Promise`\<`string`\> - -*** - -### provisionHost? - -> `optional` **provisionHost?**: (`host`, `inner`, `costTag`) => `Promise`\<[`ProvisionedHost`](ProvisionedHost.md)\> - -Defined in: [intelligence/resolver.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L92) - -Provision a host for a `process-on-infra` binding, then serve the inner -binding inside it. Injected by the host that owns `createExecutor`. Absent ⇒ -`process-on-infra` bindings fail loud. The provider resolves the inner -binding INSIDE the host and returns the connection + a teardown. - -#### Parameters - -##### host - -[`HostSpec`](HostSpec.md) - -##### inner - -[`DeliveryBinding`](../type-aliases/DeliveryBinding.md) - -##### costTag - -`string` - -#### Returns - -`Promise`\<[`ProvisionedHost`](ProvisionedHost.md)\> - -*** - -### probeLiveToolNames? - -> `optional` **probeLiveToolNames?**: (`capabilityId`) => `Promise`\<`string`[]\> - -Defined in: [intelligence/resolver.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L105) - -Drift probe: return the LIVE tool names a resolved surface exposes for a -given capability id (a `tools/list` over an mcp connection, the agent's -actual registered tool names for a host tool). When present, the post-resolve -drift check drops any tool/mcp whose live names diverge from the certified -interface — the only callable surfaces are gate-blessed ones. Absent ⇒ the -check enforces only the host-side executor↔spec parity (no live probe). - -#### Parameters - -##### capabilityId - -`string` - -#### Returns - -`Promise`\<`string`[]\> - -*** - -### onDrop? - -> `optional` **onDrop?**: (`capabilityId`, `error`) => `void` - -Defined in: [intelligence/resolver.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/resolver.ts#L113) - -Observe a DROPPED capability — a per-capability resolve failure that is -fail-closed (the capability is omitted, never half-wired). The drop is the -contract; this surfaces the diagnostic so it is never silently erased. NOT -called for [CapabilityNotAdmittedError](../classes/CapabilityNotAdmittedError.md) (that rethrows — a manifest -carrying an un-admitted binding kind is a hard error, not a soft drop). - -#### Parameters - -##### capabilityId - -`string` - -##### error - -`Error` - -#### Returns - -`void` diff --git a/docs/api/intelligence/interfaces/ResolvedHook.md b/docs/api/intelligence/interfaces/ResolvedHook.md deleted file mode 100644 index 81a2baa..0000000 --- a/docs/api/intelligence/interfaces/ResolvedHook.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / ResolvedHook - -# Interface: ResolvedHook - -Defined in: [intelligence/capability.ts:193](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L193) - -One resolved hook — event + the command/matcher the seam folds into - `AgentProfile.hooks`. - -## Properties - -### event - -> **event**: `string` - -Defined in: [intelligence/capability.ts:194](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L194) - -*** - -### command - -> **command**: `string` - -Defined in: [intelligence/capability.ts:195](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L195) - -*** - -### matcher? - -> `optional` **matcher?**: `string` - -Defined in: [intelligence/capability.ts:196](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L196) diff --git a/docs/api/intelligence/interfaces/ResolvedRetrieval.md b/docs/api/intelligence/interfaces/ResolvedRetrieval.md deleted file mode 100644 index 38b07ed..0000000 --- a/docs/api/intelligence/interfaces/ResolvedRetrieval.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / ResolvedRetrieval - -# Interface: ResolvedRetrieval - -Defined in: [intelligence/capability.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L186) - -One retrieval handle. The agent never learns vector vs graph vs index. - -## Properties - -### name - -> **name**: `string` - -Defined in: [intelligence/capability.ts:187](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L187) - -## Methods - -### retrieve() - -> **retrieve**(`query`, `k?`): `Promise`\<`object`[]\> - -Defined in: [intelligence/capability.ts:188](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L188) - -#### Parameters - -##### query - -`string` - -##### k? - -`number` - -#### Returns - -`Promise`\<`object`[]\> diff --git a/docs/api/intelligence/interfaces/ResolvedSubagent.md b/docs/api/intelligence/interfaces/ResolvedSubagent.md deleted file mode 100644 index 7bc883b..0000000 --- a/docs/api/intelligence/interfaces/ResolvedSubagent.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / ResolvedSubagent - -# Interface: ResolvedSubagent - -Defined in: [intelligence/capability.ts:200](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L200) - -One resolved subagent — folded into `AgentProfile.subagents`. - -## Properties - -### name - -> **name**: `string` - -Defined in: [intelligence/capability.ts:201](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L201) - -*** - -### description? - -> `optional` **description?**: `string` - -Defined in: [intelligence/capability.ts:202](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L202) - -*** - -### prompt? - -> `optional` **prompt?**: `string` - -Defined in: [intelligence/capability.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L203) diff --git a/docs/api/intelligence/interfaces/ResolvedSurface.md b/docs/api/intelligence/interfaces/ResolvedSurface.md deleted file mode 100644 index e023d19..0000000 --- a/docs/api/intelligence/interfaces/ResolvedSurface.md +++ /dev/null @@ -1,150 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / ResolvedSurface - -# Interface: ResolvedSurface - -Defined in: [intelligence/capability.ts:212](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L212) - -What `composeCertifiedProfile` produces. Every binding fans into the same -slots, consumed identically by the in-process seam (`RouterToolsSeam.{tools, -executeToolCall}` + folded prompt) and the sandbox seam (`AgentProfile`). -`dispose()` tears provisioned hosts down in REVERSE dependency order. - -## Properties - -### tools - -> **tools**: [`ToolSpec`](../../runtime/interfaces/ToolSpec.md)[] - -Defined in: [intelligence/capability.ts:214](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L214) - -Host-side tool defs → `RouterToolsSeam.tools` / agent-app `extraTools`. - -*** - -### mcpConnections - -> **mcpConnections**: `Record`\<`string`, `AgentProfileMcpServer`\> - -Defined in: [intelligence/capability.ts:219](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L219) - -Sandbox-side tool delivery → `AgentProfile.mcp` / in-proc `createMcpEnvironment`. - -*** - -### promptAdditions - -> **promptAdditions**: `string`[] - -Defined in: [intelligence/capability.ts:221](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L221) - -Prompt-context additions, byte-stable-ordered → folded system prompt. - -*** - -### files - -> **files**: `object`[] - -Defined in: [intelligence/capability.ts:223](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L223) - -Workspace files → `AgentProfile.resources.files`. - -#### path - -> **path**: `string` - -#### content - -> **content**: `string` - -#### executable? - -> `optional` **executable?**: `boolean` - -*** - -### retrieval - -> **retrieval**: [`ResolvedRetrieval`](ResolvedRetrieval.md)[] - -Defined in: [intelligence/capability.ts:225](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L225) - -Uniform retrieval handles. - -*** - -### hooks - -> **hooks**: [`ResolvedHook`](ResolvedHook.md)[] - -Defined in: [intelligence/capability.ts:227](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L227) - -Hooks → `AgentProfile.hooks`. - -*** - -### subagents - -> **subagents**: [`ResolvedSubagent`](ResolvedSubagent.md)[] - -Defined in: [intelligence/capability.ts:229](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L229) - -Subagents → `AgentProfile.subagents`. - -*** - -### systemPrompt - -> **systemPrompt**: `string` - -Defined in: [intelligence/capability.ts:232](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L232) - -The folded system prompt — base + the byte-stable prompt additions, exactly - as `composeCertifiedPrompt` renders the inline/context capabilities. - -## Methods - -### execute() - -> **execute**(`name`, `args`, `task`): `Promise`\<`string`\> - -Defined in: [intelligence/capability.ts:217](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L217) - -Host-side dispatch for a resolved tool. Throws when `name` is unknown so a - mis-dispatch is loud, never a silent empty string. - -#### Parameters - -##### name - -`string` - -##### args - -`Record`\<`string`, `unknown`\> - -##### task - -`unknown` - -#### Returns - -`Promise`\<`string`\> - -*** - -### dispose() - -> **dispose**(): `Promise`\<`void`\> - -Defined in: [intelligence/capability.ts:234](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L234) - -Tear down provisioned hosts (reverse dependency order). - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/intelligence/interfaces/TraceHandle.md b/docs/api/intelligence/interfaces/TraceHandle.md deleted file mode 100644 index 625c87c..0000000 --- a/docs/api/intelligence/interfaces/TraceHandle.md +++ /dev/null @@ -1,71 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / TraceHandle - -# Interface: TraceHandle - -Defined in: [intelligence/index.ts:172](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L172) - -The trace handle a `traceRun` body records into. `recordOutput` captures the -agent's result (redacted on export); `recordOutcome` captures the scored -outcome + the `{ inferenceUsd, intelligenceUsd }` split. Both are optional — -an un-recorded run still exports a span with whatever was set. - -## Methods - -### recordOutput() - -> **recordOutput**(`output`): `void` - -Defined in: [intelligence/index.ts:174](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L174) - -Capture the run's output. Exported through the redactor. - -#### Parameters - -##### output - -`unknown` - -#### Returns - -`void` - -*** - -### recordOutcome() - -> **recordOutcome**(`outcome`): `void` - -Defined in: [intelligence/index.ts:181](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L181) - -Capture the run's outcome. `usage` defaults to inference-only -(`intelligenceUsd: 0`) — the OFF baseline; an intelligence-enabled run -fills `intelligenceUsd` itself. `costUsd`, when given without a split, is -treated as pure inference. - -#### Parameters - -##### outcome - -###### success? - -`boolean` - -###### score? - -`number` - -###### costUsd? - -`number` - -###### usage? - -`Partial`\<[`UsageSplit`](UsageSplit.md)\> - -#### Returns - -`void` diff --git a/docs/api/intelligence/interfaces/TraceMeta.md b/docs/api/intelligence/interfaces/TraceMeta.md deleted file mode 100644 index f1637bd..0000000 --- a/docs/api/intelligence/interfaces/TraceMeta.md +++ /dev/null @@ -1,71 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / TraceMeta - -# Interface: TraceMeta - -Defined in: [intelligence/index.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L151) - -Metadata describing one traced run. `runId`/`traceId` default to fresh ids. - -## Properties - -### input? - -> `optional` **input?**: `unknown` - -Defined in: [intelligence/index.ts:153](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L153) - -The run's input — exported through the redactor. - -*** - -### runId? - -> `optional` **runId?**: `string` - -Defined in: [intelligence/index.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L155) - -Stable run id. Defaults to a fresh id. - -*** - -### traceId? - -> `optional` **traceId?**: `string` - -Defined in: [intelligence/index.ts:157](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L157) - -32-hex trace id. Defaults to a fresh id. - -*** - -### model? - -> `optional` **model?**: `string` - -Defined in: [intelligence/index.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L159) - -Model id, when known — stamped on the span. - -*** - -### provider? - -> `optional` **provider?**: `string` - -Defined in: [intelligence/index.ts:161](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L161) - -Provider name, when known — stamped on the span. - -*** - -### labels? - -> `optional` **labels?**: `Record`\<`string`, `string` \| `number` \| `boolean`\> - -Defined in: [intelligence/index.ts:163](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L163) - -Arbitrary extra labels (string/number/boolean) stamped on the span. diff --git a/docs/api/intelligence/interfaces/TraceOutcome.md b/docs/api/intelligence/interfaces/TraceOutcome.md deleted file mode 100644 index 1b1bb2b..0000000 --- a/docs/api/intelligence/interfaces/TraceOutcome.md +++ /dev/null @@ -1,82 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / TraceOutcome - -# Interface: TraceOutcome - -Defined in: [intelligence/index.ts:200](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L200) - -The resolved outcome of one traced run, surfaced on the export span and - available to the caller for downstream billing assertions. - -## Properties - -### runId - -> **runId**: `string` - -Defined in: [intelligence/index.ts:201](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L201) - -*** - -### traceId - -> **traceId**: `string` - -Defined in: [intelligence/index.ts:202](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L202) - -*** - -### project - -> **project**: `string` - -Defined in: [intelligence/index.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L203) - -*** - -### effort - -> **effort**: [`EffortSettings`](EffortSettings.md) - -Defined in: [intelligence/index.ts:205](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L205) - -The resolved effort settings this run executed under. - -*** - -### intelligenceOff - -> **intelligenceOff**: `boolean` - -Defined in: [intelligence/index.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L207) - -True when this run ran as pure passthrough (the OFF floor). - -*** - -### success? - -> `optional` **success?**: `boolean` - -Defined in: [intelligence/index.ts:208](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L208) - -*** - -### score? - -> `optional` **score?**: `number` - -Defined in: [intelligence/index.ts:209](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L209) - -*** - -### usage - -> **usage**: [`UsageSplit`](UsageSplit.md) - -Defined in: [intelligence/index.ts:211](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L211) - -Per-class billing split. `intelligenceUsd` is `0` at the OFF tier. diff --git a/docs/api/intelligence/interfaces/UsageSplit.md b/docs/api/intelligence/interfaces/UsageSplit.md deleted file mode 100644 index b269aed..0000000 --- a/docs/api/intelligence/interfaces/UsageSplit.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / UsageSplit - -# Interface: UsageSplit - -Defined in: [intelligence/index.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L103) - -The per-class cost split carried by every trace and outcome. `off` ⇒ -`intelligenceUsd: 0` by construction — there is no intelligence spawn to -bill. This is a classification on the trace, NOT a budget-pool split. - -## Properties - -### inferenceUsd - -> **inferenceUsd**: `number` - -Defined in: [intelligence/index.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L105) - -Base-stream (model) spend in USD. - -*** - -### intelligenceUsd - -> **intelligenceUsd**: `number` - -Defined in: [intelligence/index.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L107) - -Intelligence-spawn spend in USD. Provably `0` at the OFF tier. diff --git a/docs/api/intelligence/type-aliases/Agent.md b/docs/api/intelligence/type-aliases/Agent.md deleted file mode 100644 index 8350011..0000000 --- a/docs/api/intelligence/type-aliases/Agent.md +++ /dev/null @@ -1,34 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / Agent - -# Type Alias: Agent\ - -> **Agent**\<`TInput`, `TOutput`\> = (`input`) => `Promise`\<`TOutput`\> - -Defined in: [intelligence/index.ts:512](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L512) - -A generic agent: one async input → output. The shape `withTangleIntelligence` - preserves exactly. - -## Type Parameters - -### TInput - -`TInput` - -### TOutput - -`TOutput` - -## Parameters - -### input - -`TInput` - -## Returns - -`Promise`\<`TOutput`\> diff --git a/docs/api/intelligence/type-aliases/CapabilityAuth.md b/docs/api/intelligence/type-aliases/CapabilityAuth.md deleted file mode 100644 index 1c4089c..0000000 --- a/docs/api/intelligence/type-aliases/CapabilityAuth.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / CapabilityAuth - -# Type Alias: CapabilityAuth - -> **CapabilityAuth** = \{ `mode`: `"none"`; \} \| \{ `mode`: `"tangle-key"`; \} \| \{ `mode`: `"hub-connection"`; `providerId`: `string`; `scopes?`: `string`[]; \} \| \{ `mode`: `"secret-ref"`; `key`: `string`; \} - -Defined in: [intelligence/capability.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L80) - -How a binding authenticates at resolve time. Declared as a REQUIREMENT in the -manifest; the live secret is resolved per-tenant by the resolver context, -never inlined here. diff --git a/docs/api/intelligence/type-aliases/CapabilityInterface.md b/docs/api/intelligence/type-aliases/CapabilityInterface.md deleted file mode 100644 index 844c74a..0000000 --- a/docs/api/intelligence/type-aliases/CapabilityInterface.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / CapabilityInterface - -# Type Alias: CapabilityInterface - -> **CapabilityInterface** = \{ `surface`: `"tool"`; `name`: `string`; `description?`: `string`; `parameters`: [`JsonSchema`](JsonSchema.md); `returns?`: [`JsonSchema`](JsonSchema.md); \} \| \{ `surface`: `"mcp"`; `serverName`: `string`; `toolset?`: `string`[]; \} \| \{ `surface`: `"context"`; `kind`: `"prompt-surface"` \| `"skill"` \| `"instructions"`; `name`: `string`; \} \| \{ `surface`: `"retrieval"`; `name`: `string`; `description?`: `string`; `topK?`: `number`; \} \| \{ `surface`: `"hook"`; `event`: `string`; `matcher?`: `string`; \} \| \{ `surface`: `"subagent"`; `name`: `string`; `description?`: `string`; \} - -Defined in: [intelligence/capability.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L42) - -What the agent consumes. CLOSED — a new runtime kind NEVER extends this. Each -arm maps slot-for-slot onto `AgentProfile` + the host `RouterToolsSeam`. diff --git a/docs/api/intelligence/type-aliases/CapabilitySurface.md b/docs/api/intelligence/type-aliases/CapabilitySurface.md deleted file mode 100644 index 249eddb..0000000 --- a/docs/api/intelligence/type-aliases/CapabilitySurface.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / CapabilitySurface - -# Type Alias: CapabilitySurface - -> **CapabilitySurface** = [`CapabilityInterface`](CapabilityInterface.md)\[`"surface"`\] - -Defined in: [intelligence/capability.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L57) - -Every interface surface tag — the closed set the resolver fans into slots. diff --git a/docs/api/intelligence/type-aliases/ClientOrConfig.md b/docs/api/intelligence/type-aliases/ClientOrConfig.md deleted file mode 100644 index 5a1dfba..0000000 --- a/docs/api/intelligence/type-aliases/ClientOrConfig.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / ClientOrConfig - -# Type Alias: ClientOrConfig - -> **ClientOrConfig** = [`IntelligenceClient`](../interfaces/IntelligenceClient.md) \| [`IntelligenceConfig`](../interfaces/IntelligenceConfig.md) - -Defined in: [intelligence/index.ts:515](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L515) - -Either a built client or the config to build one. diff --git a/docs/api/intelligence/type-aliases/ContentRef.md b/docs/api/intelligence/type-aliases/ContentRef.md deleted file mode 100644 index 988d9c9..0000000 --- a/docs/api/intelligence/type-aliases/ContentRef.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / ContentRef - -# Type Alias: ContentRef - -> **ContentRef** = \{ `kind`: `"inline"`; `content`: `string`; \} \| \{ `kind`: `"github"`; `repository?`: `string`; `path`: `string`; `ref?`: `string`; \} \| \{ `kind`: `"blob"`; `uri`: `string`; `sha256`: `string`; `bytes?`: `number`; \} - -Defined in: [intelligence/capability.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L65) - -Where a capability's bytes live. A leaked manifest carries no live secret and -no inlined blob: `github`/`blob` are pointers resolved at provision time. diff --git a/docs/api/intelligence/type-aliases/CorpusAccess.md b/docs/api/intelligence/type-aliases/CorpusAccess.md deleted file mode 100644 index 0bb51d0..0000000 --- a/docs/api/intelligence/type-aliases/CorpusAccess.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / CorpusAccess - -# Type Alias: CorpusAccess - -> **CorpusAccess** = `"off"` \| `"read"` \| `"read-write"` - -Defined in: [intelligence/effort.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L24) - -Corpus access an intelligence tier permits. `'off'` reads and writes - nothing; `'read'` consults the cross-run corpus without contributing; - `'read-write'` both consults and accumulates. diff --git a/docs/api/intelligence/type-aliases/DeliveredAgent.md b/docs/api/intelligence/type-aliases/DeliveredAgent.md deleted file mode 100644 index b900f63..0000000 --- a/docs/api/intelligence/type-aliases/DeliveredAgent.md +++ /dev/null @@ -1,38 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / DeliveredAgent - -# Type Alias: DeliveredAgent\ - -> **DeliveredAgent**\<`I`, `O`\> = (`input`, `applied`) => `Promise`\<`O`\> - -Defined in: [intelligence/delivery.ts:191](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L191) - -An agent wrapped by [withCertifiedDelivery](../functions/withCertifiedDelivery.md): receives the input plus - the certified intelligence delivered for this run. - -## Type Parameters - -### I - -`I` - -### O - -`O` - -## Parameters - -### input - -`I` - -### applied - -[`AppliedIntelligence`](../interfaces/AppliedIntelligence.md) - -## Returns - -`Promise`\<`O`\> diff --git a/docs/api/intelligence/type-aliases/DeliveryBinding.md b/docs/api/intelligence/type-aliases/DeliveryBinding.md deleted file mode 100644 index 9f02ba7..0000000 --- a/docs/api/intelligence/type-aliases/DeliveryBinding.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / DeliveryBinding - -# Type Alias: DeliveryBinding - -> **DeliveryBinding** = \{ `kind`: `"inline"`; `content`: [`ContentRef`](ContentRef.md); \} \| \{ `kind`: `"file"`; `path`: `string`; `content`: [`ContentRef`](ContentRef.md); `executable?`: `boolean`; \} \| \{ `kind`: `"http"`; `url`: `string`; `method?`: `string`; `auth?`: [`CapabilityAuth`](CapabilityAuth.md); \} \| \{ `kind`: `"sandbox-code"`; `entry`: `string`; `code`: [`ContentRef`](ContentRef.md); `runtime?`: `string`; `harness?`: `string`; \} \| \{ `kind`: `"mcp-stdio"`; `command`: `string`; `args?`: `string`[]; `env?`: `Record`\<`string`, `string`\>; `cwd?`: `string`; \} \| \{ `kind`: `"mcp-remote"`; `url`: `string`; `transport`: `"http"` \| `"sse"`; `headers?`: `Record`\<`string`, `string`\>; \} \| \{ `kind`: `"process-on-infra"`; `host`: [`HostSpec`](../interfaces/HostSpec.md); `inner`: `DeliveryBinding`; \} \| \{ `kind`: `"rag-index"`; `index`: [`ContentRef`](ContentRef.md); `embedModel`: `string`; `topK?`: `number`; \} \| \{ `kind`: `"memory-store"`; `provision`: `"sqlite"` \| `"neo4j"` \| `"vector"`; `seed?`: [`ContentRef`](ContentRef.md); \} \| \{ `kind`: `"wasm"`; `module`: [`ContentRef`](ContentRef.md); `exports`: `string`[]; \} \| \{ `kind`: `"a2a"`; `endpoint`: `string`; `card`: [`ContentRef`](ContentRef.md); `auth?`: [`CapabilityAuth`](CapabilityAuth.md); \} - -Defined in: [intelligence/capability.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L108) - -How a capability is backed. OPEN tagged union — THE extension point. All arms -are typed even when the resolver does not yet admit them; an un-admitted arm -throws [CapabilityNotAdmittedError](../classes/CapabilityNotAdmittedError.md) at resolve, never silently no-ops. diff --git a/docs/api/intelligence/type-aliases/DeliveryBindingKind.md b/docs/api/intelligence/type-aliases/DeliveryBindingKind.md deleted file mode 100644 index 120bb8b..0000000 --- a/docs/api/intelligence/type-aliases/DeliveryBindingKind.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / DeliveryBindingKind - -# Type Alias: DeliveryBindingKind - -> **DeliveryBindingKind** = [`DeliveryBinding`](DeliveryBinding.md)\[`"kind"`\] - -Defined in: [intelligence/capability.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L137) - -Every binding kind — the open set the resolver dispatches over. diff --git a/docs/api/intelligence/type-aliases/EffortOverrides.md b/docs/api/intelligence/type-aliases/EffortOverrides.md deleted file mode 100644 index b4bf548..0000000 --- a/docs/api/intelligence/type-aliases/EffortOverrides.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / EffortOverrides - -# Type Alias: EffortOverrides - -> **EffortOverrides** = `Partial`\<[`EffortSettings`](../interfaces/EffortSettings.md)\> - -Defined in: [intelligence/effort.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L51) - -Per-field overrides applied on top of a tier preset. Any subset of the - resolved settings; each provided field wins over the preset. diff --git a/docs/api/intelligence/type-aliases/EffortTier.md b/docs/api/intelligence/type-aliases/EffortTier.md deleted file mode 100644 index ffee304..0000000 --- a/docs/api/intelligence/type-aliases/EffortTier.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / EffortTier - -# Type Alias: EffortTier - -> **EffortTier** = `"off"` \| `"eco"` \| `"standard"` \| `"thorough"` \| `"max"` - -Defined in: [intelligence/effort.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L19) - -The named effort tiers, lowest to highest. `'off'` is the honest floor - below `'eco'`: intelligence fully off, telemetry still best-effort. diff --git a/docs/api/intelligence/type-aliases/JsonSchema.md b/docs/api/intelligence/type-aliases/JsonSchema.md deleted file mode 100644 index 2ba224f..0000000 --- a/docs/api/intelligence/type-aliases/JsonSchema.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / JsonSchema - -# Type Alias: JsonSchema - -> **JsonSchema** = `Record`\<`string`, `unknown`\> - -Defined in: [intelligence/capability.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/capability.ts#L36) - -A JSON Schema object describing a tool's parameters. Kept structural — the - resolver forwards it verbatim into a `ToolSpec` / MCP `tools/list` check. diff --git a/docs/api/intelligence/type-aliases/PullOutcome.md b/docs/api/intelligence/type-aliases/PullOutcome.md deleted file mode 100644 index acfabc9..0000000 --- a/docs/api/intelligence/type-aliases/PullOutcome.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / PullOutcome - -# Type Alias: PullOutcome - -> **PullOutcome** = \{ `succeeded`: `true`; `value`: [`CertifiedProfile`](../interfaces/CertifiedProfile.md); \} \| \{ `succeeded`: `false`; `error`: `string`; `status?`: `number`; \} - -Defined in: [intelligence/delivery.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/delivery.ts#L63) - -Typed outcome for the pull — inspect `succeeded` before `value`. A 404 - (nothing promoted yet) is a normal, non-error `succeeded: false`. diff --git a/docs/api/intelligence/type-aliases/Redactor.md b/docs/api/intelligence/type-aliases/Redactor.md deleted file mode 100644 index 4c85acd..0000000 --- a/docs/api/intelligence/type-aliases/Redactor.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / Redactor - -# Type Alias: Redactor - -> **Redactor** = (`value`) => `unknown` - -Defined in: [intelligence/redact.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/redact.ts#L17) - -A redactor maps an arbitrary trace value to a safe-to-export value. Pure; - must not throw on cyclic input (the default tolerates cycles). - -## Parameters - -### value - -`unknown` - -## Returns - -`unknown` diff --git a/docs/api/intelligence/type-aliases/UsageClass.md b/docs/api/intelligence/type-aliases/UsageClass.md deleted file mode 100644 index ba7d432..0000000 --- a/docs/api/intelligence/type-aliases/UsageClass.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / UsageClass - -# Type Alias: UsageClass - -> **UsageClass** = `"inference"` \| `"intelligence"` - -Defined in: [intelligence/index.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/index.ts#L96) - -Usage class for billing. Base-stream tokens bill `'inference'`; every - intelligence spawn (analyst, corpus, loop) bills `'intelligence'`. The - billing line falls on the spawn line. diff --git a/docs/api/intelligence/variables/defaultEffortTier.md b/docs/api/intelligence/variables/defaultEffortTier.md deleted file mode 100644 index 7cb6df8..0000000 --- a/docs/api/intelligence/variables/defaultEffortTier.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [intelligence](../README.md) / defaultEffortTier - -# Variable: defaultEffortTier - -> `const` **defaultEffortTier**: [`EffortTier`](../type-aliases/EffortTier.md) = `'standard'` - -Defined in: [intelligence/effort.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/intelligence/effort.ts#L94) - -The default tier when a client declares no effort. `'standard'` turns - intelligence on with sensible knobs; opt down to `'off'`/`'eco'` or up to - `'thorough'`/`'max'`. diff --git a/docs/api/mcp.md b/docs/api/mcp.md new file mode 100644 index 0000000..687a4db --- /dev/null +++ b/docs/api/mcp.md @@ -0,0 +1,8223 @@ +[**@tangle-network/agent-runtime**](README.md) + +*** + +[@tangle-network/agent-runtime](README.md) / mcp + +# mcp + +## Classes + +### DelegationStateCorruptError + +Defined in: [mcp/delegation-store.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L54) + +**`Experimental`** + +The persisted delegation state exists but cannot be parsed into +records. Fail loud: silently starting empty over a corrupt journal +would erase delegation history and re-run idempotent work. Opt into +recovery explicitly via `FileDelegationStoreOptions.recoverCorrupt` +(the bin maps `AGENT_RUNTIME_DELEGATION_STATE_RECOVER=1` onto it), +which archives the corrupt file and starts fresh. + +#### Extends + +- `AgentEvalError` + +#### Constructors + +##### Constructor + +> **new DelegationStateCorruptError**(`message`, `options?`): [`DelegationStateCorruptError`](#delegationstatecorrupterror) + +Defined in: [mcp/delegation-store.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L55) + +**`Experimental`** + +###### Parameters + +###### message + +`string` + +###### options? + +###### cause? + +`unknown` + +###### Returns + +[`DelegationStateCorruptError`](#delegationstatecorrupterror) + +###### Overrides + +`AgentEvalError.constructor` + +*** + +### DelegationPersistenceError + +Defined in: [mcp/delegation-store.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L68) + +**`Experimental`** + +A delegation-store read or write failed (filesystem error, store +called before `loadAll`, ...). Once the queue observes one, it stops +accepting new submissions — accepting work it cannot journal would +silently demote durable mode to in-memory mode. + +#### Extends + +- `AgentEvalError` + +#### Constructors + +##### Constructor + +> **new DelegationPersistenceError**(`message`, `options?`): [`DelegationPersistenceError`](#delegationpersistenceerror) + +Defined in: [mcp/delegation-store.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L69) + +**`Experimental`** + +###### Parameters + +###### message + +`string` + +###### options? + +###### cause? + +`unknown` + +###### Returns + +[`DelegationPersistenceError`](#delegationpersistenceerror) + +###### Overrides + +`AgentEvalError.constructor` + +*** + +### InMemoryDelegationStore + +Defined in: [mcp/delegation-store.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L75) + +**`Experimental`** + +#### Implements + +- [`DelegationStore`](#delegationstore) + +#### Constructors + +##### Constructor + +> **new InMemoryDelegationStore**(): [`InMemoryDelegationStore`](#inmemorydelegationstore) + +**`Experimental`** + +###### Returns + +[`InMemoryDelegationStore`](#inmemorydelegationstore) + +#### Methods + +##### loadAll() + +> **loadAll**(): `Promise`\<[`DelegationRecord`](#delegationrecord)[]\> + +Defined in: [mcp/delegation-store.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L78) + +**`Experimental`** + +Read every persisted record. Called once, by +`DelegationTaskQueue.restore`, before any write. A missing backing +file is an empty store; an unparseable one throws +`DelegationStateCorruptError`. + +###### Returns + +`Promise`\<[`DelegationRecord`](#delegationrecord)[]\> + +###### Implementation of + +[`DelegationStore`](#delegationstore).[`loadAll`](#loadall) + +##### upsert() + +> **upsert**(`record`): `Promise`\<`void`\> + +Defined in: [mcp/delegation-store.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L82) + +**`Experimental`** + +Insert or replace the record keyed by `record.taskId`. + +###### Parameters + +###### record + +[`DelegationRecord`](#delegationrecord) + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`DelegationStore`](#delegationstore).[`upsert`](#upsert) + +##### lookupIdempotencyKey() + +> **lookupIdempotencyKey**(`key`): `Promise`\<`string` \| `undefined`\> + +Defined in: [mcp/delegation-store.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L86) + +**`Experimental`** + +Resolve an idempotency key to the taskId that claimed it, if any. +The queue serves submit-time dedupe from its rehydrated in-memory +index; this read exists for consumers that share a store across +processes without holding the full record set. + +###### Parameters + +###### key + +`string` + +###### Returns + +`Promise`\<`string` \| `undefined`\> + +###### Implementation of + +[`DelegationStore`](#delegationstore).[`lookupIdempotencyKey`](#lookupidempotencykey) + +##### remove() + +> **remove**(`taskIds`): `Promise`\<`void`\> + +Defined in: [mcp/delegation-store.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L93) + +**`Experimental`** + +Delete the named records — the retention-cap eviction path. + +###### Parameters + +###### taskIds + +readonly `string`[] + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`DelegationStore`](#delegationstore).[`remove`](#remove) + +*** + +### FileDelegationStore + +Defined in: [mcp/delegation-store.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L130) + +**`Experimental`** + +JSON-file persistence for the delegation queue. Each write serializes +the full record set and lands it atomically (write to a sibling tmp +file, then `rename`), so readers never observe a torn file — a crash +mid-write leaves the previous snapshot intact. Writes are serialized +internally; concurrent `upsert`/`remove` calls cannot interleave. + +Built for the MCP server's scale (one stdio process, hundreds of +records): full-snapshot writes keep the format trivially inspectable +and corruption-detectable without a database dependency. + +#### Implements + +- [`DelegationStore`](#delegationstore) + +#### Constructors + +##### Constructor + +> **new FileDelegationStore**(`options`): [`FileDelegationStore`](#filedelegationstore) + +Defined in: [mcp/delegation-store.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L138) + +**`Experimental`** + +###### Parameters + +###### options + +[`FileDelegationStoreOptions`](#filedelegationstoreoptions) + +###### Returns + +[`FileDelegationStore`](#filedelegationstore) + +#### Methods + +##### loadAll() + +> **loadAll**(): `Promise`\<[`DelegationRecord`](#delegationrecord)[]\> + +Defined in: [mcp/delegation-store.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L143) + +**`Experimental`** + +Read every persisted record. Called once, by +`DelegationTaskQueue.restore`, before any write. A missing backing +file is an empty store; an unparseable one throws +`DelegationStateCorruptError`. + +###### Returns + +`Promise`\<[`DelegationRecord`](#delegationrecord)[]\> + +###### Implementation of + +[`DelegationStore`](#delegationstore).[`loadAll`](#loadall) + +##### upsert() + +> **upsert**(`record`): `Promise`\<`void`\> + +Defined in: [mcp/delegation-store.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L180) + +**`Experimental`** + +Insert or replace the record keyed by `record.taskId`. + +###### Parameters + +###### record + +[`DelegationRecord`](#delegationrecord) + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`DelegationStore`](#delegationstore).[`upsert`](#upsert) + +##### lookupIdempotencyKey() + +> **lookupIdempotencyKey**(`key`): `Promise`\<`string` \| `undefined`\> + +Defined in: [mcp/delegation-store.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L186) + +**`Experimental`** + +Resolve an idempotency key to the taskId that claimed it, if any. +The queue serves submit-time dedupe from its rehydrated in-memory +index; this read exists for consumers that share a store across +processes without holding the full record set. + +###### Parameters + +###### key + +`string` + +###### Returns + +`Promise`\<`string` \| `undefined`\> + +###### Implementation of + +[`DelegationStore`](#delegationstore).[`lookupIdempotencyKey`](#lookupidempotencykey) + +##### remove() + +> **remove**(`taskIds`): `Promise`\<`void`\> + +Defined in: [mcp/delegation-store.ts:194](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L194) + +**`Experimental`** + +Delete the named records — the retention-cap eviction path. + +###### Parameters + +###### taskIds + +readonly `string`[] + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`DelegationStore`](#delegationstore).[`remove`](#remove) + +*** + +### InMemoryFeedbackStore + +Defined in: [mcp/feedback-store.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L41) + +**`Experimental`** + +#### Implements + +- [`FeedbackStore`](#feedbackstore) + +#### Constructors + +##### Constructor + +> **new InMemoryFeedbackStore**(): [`InMemoryFeedbackStore`](#inmemoryfeedbackstore) + +**`Experimental`** + +###### Returns + +[`InMemoryFeedbackStore`](#inmemoryfeedbackstore) + +#### Methods + +##### put() + +> **put**(`event`): `Promise`\<`void`\> + +Defined in: [mcp/feedback-store.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L44) + +**`Experimental`** + +Append a new event. Never dedupes — every rating is its own event. + +###### Parameters + +###### event + +[`FeedbackEvent`](#feedbackevent) + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`FeedbackStore`](#feedbackstore).[`put`](#put) + +##### list() + +> **list**(`filter?`): `Promise`\<[`FeedbackEvent`](#feedbackevent)[]\> + +Defined in: [mcp/feedback-store.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L48) + +**`Experimental`** + +List events filtered by `namespace`. When `namespace` is omitted, list +across all namespaces. Returns events in insertion order. + +###### Parameters + +###### filter? + +###### namespace? + +`string` + +###### refersToRef? + +`string` + +###### Returns + +`Promise`\<[`FeedbackEvent`](#feedbackevent)[]\> + +###### Implementation of + +[`FeedbackStore`](#feedbackstore).[`list`](#list) + +*** + +### DelegationTaskQueue + +Defined in: [mcp/task-queue.ts:242](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L242) + +**`Experimental`** + +#### Constructors + +##### Constructor + +> **new DelegationTaskQueue**(`options?`): [`DelegationTaskQueue`](#delegationtaskqueue) + +Defined in: [mcp/task-queue.ts:256](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L256) + +**`Experimental`** + +###### Parameters + +###### options? + +[`DelegationTaskQueueOptions`](#delegationtaskqueueoptions) = `{}` + +###### Returns + +[`DelegationTaskQueue`](#delegationtaskqueue) + +#### Methods + +##### restore() + +> `static` **restore**(`options?`): `Promise`\<[`DelegationTaskQueue`](#delegationtaskqueue)\> + +Defined in: [mcp/task-queue.ts:292](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L292) + +**`Experimental`** + +Construct a queue from previously-persisted state. Loads every record +from `options.store`, rebuilds the idempotency index (so a re-submitted +identical task returns the prior taskId and its terminal state), then: + + - terminal records stay queryable via `status()` / `history()` + - in-flight records with a `detachedSessionRef` re-attach through + `options.resumeDelegate` and report `running` + - other in-flight records settle as failed — their driver died with + the previous process and the result is unrecoverable + +The retention cap applies to the loaded set as well. + +###### Parameters + +###### options? + +[`DelegationTaskQueueOptions`](#delegationtaskqueueoptions) = `{}` + +###### Returns + +`Promise`\<[`DelegationTaskQueue`](#delegationtaskqueue)\> + +##### submit() + +> **submit**\<`Args`\>(`input`): [`SubmitOutput`](#submitoutput) + +Defined in: [mcp/task-queue.ts:305](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L305) + +**`Experimental`** + +Kick off a delegation in the background. Returns immediately. The +`taskId` is queryable via `status` once this method returns. Throws +the recorded `DelegationPersistenceError` once the store has failed — +the queue does not accept work it cannot journal. + +###### Type Parameters + +###### Args + +`Args` *extends* `AnyDelegateArgs` + +###### Parameters + +###### input + +[`SubmitInput`](#submitinput)\<`Args`\> + +###### Returns + +[`SubmitOutput`](#submitoutput) + +##### status() + +> **status**(`taskId`, `opts?`): [`DelegationStatusResult`](#delegationstatusresult) \| `undefined` + +Defined in: [mcp/task-queue.ts:355](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L355) + +**`Experimental`** + +Snapshot the current state of a delegation. Returns `undefined` for +unknown ids so callers can distinguish missing from terminal. +`includeTrace` attaches the journaled loop-trace span tree — off by +default so status polls stay light. + +###### Parameters + +###### taskId + +`string` + +###### opts? + +###### includeTrace? + +`boolean` + +###### Returns + +[`DelegationStatusResult`](#delegationstatusresult) \| `undefined` + +##### cancel() + +> **cancel**(`taskId`): `boolean` + +Defined in: [mcp/task-queue.ts:368](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L368) + +**`Experimental`** + +Abort an in-flight delegation. Returns `false` if the task is unknown +or already terminal. The underlying `run` function MUST honor the +abort signal for the cancel to take effect; the queue marks the +record `cancelled` regardless so a misbehaving runner cannot pin the +UI on `running` forever. + +###### Parameters + +###### taskId + +`string` + +###### Returns + +`boolean` + +##### attachFeedback() + +> **attachFeedback**(`taskId`, `snapshot`): `boolean` + +Defined in: [mcp/task-queue.ts:388](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L388) + +**`Experimental`** + +Append a feedback event to the matching delegation. Returns `false` +when `ref` does not name a known taskId — the caller should still +record the feedback through a different surface (artifact/outcome +kinds are not queue-bound). + +###### Parameters + +###### taskId + +`string` + +###### snapshot + +[`DelegationFeedbackSnapshot`](#delegationfeedbacksnapshot) + +###### Returns + +`boolean` + +##### history() + +> **history**(`args?`): [`DelegationHistoryEntry`](#delegationhistoryentry)[] + +Defined in: [mcp/task-queue.ts:400](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L400) + +**`Experimental`** + +Query the recorded delegations. Returns entries newest-first (by +`startedAt`), truncated to `limit`. + +###### Parameters + +###### args? + +[`DelegationHistoryArgs`](#delegationhistoryargs) = `{}` + +###### Returns + +[`DelegationHistoryEntry`](#delegationhistoryentry)[] + +##### flush() + +> **flush**(): `Promise`\<`void`\> + +Defined in: [mcp/task-queue.ts:419](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L419) + +**`Experimental`** + +Await every journal write issued so far. Rejects with the recorded +`DelegationPersistenceError` when any of them failed. Call before +handing the store's backing file to another process. + +###### Returns + +`Promise`\<`void`\> + +##### inflightCount() + +> **inflightCount**(): `number` + +Defined in: [mcp/task-queue.ts:435](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L435) + +**`Experimental`** + +Test-only — number of in-flight (non-terminal) records. + +###### Returns + +`number` + +## Interfaces + +### DetectExecutorArgs + +Defined in: [mcp/bin-helpers.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/bin-helpers.ts#L20) + +**`Experimental`** + +#### Properties + +##### sandboxClient + +> **sandboxClient**: [`SandboxClient`](runtime.md#sandboxclient-2) + +Defined in: [mcp/bin-helpers.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/bin-helpers.ts#L21) + +**`Experimental`** + +##### env? + +> `optional` **env?**: `Record`\<`string`, `string` \| `undefined`\> + +Defined in: [mcp/bin-helpers.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/bin-helpers.ts#L23) + +**`Experimental`** + +Raw env (defaults to `process.env`). Pass an explicit map for tests. + +##### resolveFleet? + +> `optional` **resolveFleet?**: (`client`, `fleetId`) => `Promise`\<[`FleetHandle`](#fleethandle)\> + +Defined in: [mcp/bin-helpers.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/bin-helpers.ts#L29) + +**`Experimental`** + +Override how a fleet handle is resolved from the client + fleet id. The +default reads `client.fleets.get(fleetId)` and validates the returned +shape against the structural `FleetHandle` contract. + +###### Parameters + +###### client + +[`SandboxClient`](runtime.md#sandboxclient-2) + +###### fleetId + +`string` + +###### Returns + +`Promise`\<[`FleetHandle`](#fleethandle)\> + +*** + +### DelegateRunCtx + +Defined in: [mcp/delegates.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L65) + +**`Experimental`** + +#### Properties + +##### signal + +> **signal**: `AbortSignal` + +Defined in: [mcp/delegates.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L66) + +**`Experimental`** + +##### detachedSessionRef? + +> `optional` **detachedSessionRef?**: `string` + +Defined in: [mcp/delegates.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L74) + +**`Experimental`** + +Detached-run resume key recorded on the queue record at submit time +(`formatDetachedSessionRef`). Present only when the submit path requested +detached dispatch — its presence is what routes a session-backed delegate +onto the `driveTurn` tick path instead of holding a stream. + +##### traceEmitter? + +> `optional` **traceEmitter?**: [`LoopTraceEmitter`](runtime.md#looptraceemitter) + +Defined in: [mcp/delegates.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L83) + +**`Experimental`** + +Per-delegation trace sink supplied by the queue — loop events emitted +here land on the delegation record as a compact span tree. Delegates +compose it with their configured OTEL emitter so both sinks observe +the same stream. + +#### Methods + +##### report() + +> **report**(`progress`): `void` + +Defined in: [mcp/delegates.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L67) + +**`Experimental`** + +###### Parameters + +###### progress + +[`DelegationProgress`](#delegationprogress) + +###### Returns + +`void` + +##### updateDetachedSessionRef()? + +> `optional` **updateDetachedSessionRef**(`ref`): `void` + +Defined in: [mcp/delegates.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L76) + +**`Experimental`** + +Rebind the record's resume key (e.g. once the sandbox id is known). + +###### Parameters + +###### ref + +`string` + +###### Returns + +`void` + +*** + +### CoderReview + +Defined in: [mcp/delegates.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L111) + +**`Experimental`** + +Structured review verdict over a coder candidate. + +#### Properties + +##### approved + +> **approved**: `boolean` + +Defined in: [mcp/delegates.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L113) + +**`Experimental`** + +Gate: only approved candidates are eligible to win. + +##### recommendation + +> **recommendation**: `"ship"` \| `"approve-with-nits"` \| `"changes-requested"` \| `"reject"` + +Defined in: [mcp/delegates.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L115) + +**`Experimental`** + +Reviewer's recommendation — surfaced in traces. + +##### readiness + +> **readiness**: `number` + +Defined in: [mcp/delegates.ts:117](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L117) + +**`Experimental`** + +Readiness 0..1, used by the `highest-readiness` winner-selection strategy. + +##### notes? + +> `optional` **notes?**: `string` + +Defined in: [mcp/delegates.ts:118](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L118) + +**`Experimental`** + +*** + +### DetachedSessionDelegateOptions + +Defined in: [mcp/delegates.ts:150](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L150) + +**`Experimental`** + +#### Properties + +##### executor? + +> `optional` **executor?**: [`DelegationExecutor`](#delegationexecutor) + +Defined in: [mcp/delegates.ts:157](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L157) + +**`Experimental`** + +Execution placement. Pass a [DelegationExecutor](#delegationexecutor) (sibling or fleet) +to control where worker iterations land. `sandboxClient` is a +convenience shorthand that wraps the client in a sibling executor — pass +one or the other, not both. + +##### sandboxClient? + +> `optional` **sandboxClient?**: [`SandboxClient`](runtime.md#sandboxclient-2) + +Defined in: [mcp/delegates.ts:162](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L162) + +**`Experimental`** + +Convenience shorthand for sibling placement. Equivalent to +`executor: createSiblingSandboxExecutor({ client: sandboxClient })`. + +##### harness? + +> `optional` **harness?**: `string` + +Defined in: [mcp/delegates.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L164) + +**`Experimental`** + +Backend harness for the single-coder path. Default comes from `coderProfile`. + +##### model? + +> `optional` **model?**: `string` + +Defined in: [mcp/delegates.ts:166](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L166) + +**`Experimental`** + +Model override for the single-coder path. + +##### systemPrompt? + +> `optional` **systemPrompt?**: `string` + +Defined in: [mcp/delegates.ts:172](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L172) + +**`Experimental`** + +The worker's authored system prompt (§1.5). Flows onto `coderProfile`'s +`profile.prompt.systemPrompt` → through `runLoop` → the executor's `harnessInvocation`, so the +harness runs under this stance, not just the default coder prompt. Omit to keep the default. + +##### fanoutHarnesses? + +> `optional` **fanoutHarnesses?**: `string`[] + +Defined in: [mcp/delegates.ts:174](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L174) + +**`Experimental`** + +Default `['claude-code', 'codex', 'opencode/zai-coding-plan/glm-5.1']` when variants > 1. + +##### fanoutModels? + +> `optional` **fanoutModels?**: (`string` \| `undefined`)[] + +Defined in: [mcp/delegates.ts:176](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L176) + +**`Experimental`** + +Optional per-harness model override for `variants > 1`. + +##### maxConcurrency? + +> `optional` **maxConcurrency?**: `number` + +Defined in: [mcp/delegates.ts:178](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L178) + +**`Experimental`** + +Hard cap on the kernel's per-batch concurrency. Default 4. + +##### reviewer? + +> `optional` **reviewer?**: [`CoderReviewer`](#coderreviewer) + +Defined in: [mcp/delegates.ts:185](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L185) + +**`Experimental`** + +Optional adversarial reviewer. When set, a candidate must pass mechanical +validation AND `reviewer.approved` to be eligible to win — empty/secret/ +test-failing patches are already gone; this catches the "compiles + passes +but wrong/unsafe" class the deterministic validator can't see. + +##### winnerSelection? + +> `optional` **winnerSelection?**: [`DetachedWinnerSelection`](#detachedwinnerselection) + +Defined in: [mcp/delegates.ts:187](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L187) + +**`Experimental`** + +Winner-selection strategy among eligible candidates. Default `highest-score`. + +##### traceEmitter? + +> `optional` **traceEmitter?**: [`LoopTraceEmitter`](runtime.md#looptraceemitter) + +Defined in: [mcp/delegates.ts:199](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L199) + +**`Experimental`** + +Loop trace emitter forwarded into every delegated `runLoop`. Wire +`createPropagatingTraceEmitter(readTraceContextFromEnv())` here (the bin +does) so delegated build-loops export their topology spans to the OTLP / +Tangle Intelligence sink when `OTEL_EXPORTER_OTLP_ENDPOINT` is set — and +are a cheap no-op when it isn't. Configurable by construction. + +Detached single-variant turns (taken when `ctx.detachedSessionRef` is set) +bypass `runLoop`; `runDetachedTurn` synthesizes a single-iteration loop +event stream for them so this emitter observes detached work too. + +##### detachedTickIntervalMs? + +> `optional` **detachedTickIntervalMs?**: `number` + +Defined in: [mcp/delegates.ts:201](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L201) + +**`Experimental`** + +Tick cadence (ms) for the detached single-variant path. Default 5000. + +##### detachedWallCapMs? + +> `optional` **detachedWallCapMs?**: `number` + +Defined in: [mcp/delegates.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L203) + +**`Experimental`** + +Wall-clock cap (ms) forwarded to `driveTurn` for detached turns. + +*** + +### SettleDetachedCoderTurnOptions + +Defined in: [mcp/delegates.ts:442](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L442) + +**`Experimental`** + +#### Properties + +##### task + +> **task**: [`CoderTask`](profiles.md#codertask) + +Defined in: [mcp/delegates.ts:443](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L443) + +**`Experimental`** + +##### sessionId + +> **sessionId**: `string` + +Defined in: [mcp/delegates.ts:445](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L445) + +**`Experimental`** + +Session id of the detached turn — used as the synthesized event id. + +##### signal + +> **signal**: `AbortSignal` + +Defined in: [mcp/delegates.ts:446](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L446) + +**`Experimental`** + +##### harness? + +> `optional` **harness?**: `string` + +Defined in: [mcp/delegates.ts:447](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L447) + +**`Experimental`** + +##### model? + +> `optional` **model?**: `string` + +Defined in: [mcp/delegates.ts:448](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L448) + +**`Experimental`** + +##### reviewer? + +> `optional` **reviewer?**: [`CoderReviewer`](#coderreviewer) + +Defined in: [mcp/delegates.ts:450](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L450) + +**`Experimental`** + +Same gate as the streaming path: an unapproved candidate cannot win. + +*** + +### BuildDelegationMcpServerOptions + +Defined in: [mcp/delegation-profile.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L50) + +#### Properties + +##### sandboxApiKey? + +> `optional` **sandboxApiKey?**: `string` + +Defined in: [mcp/delegation-profile.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L54) + +Sandbox API key forwarded as `TANGLE_API_KEY` to the MCP child. The + agent-runtime MCP bin reads `TANGLE_API_KEY` and passes it straight to + `new Sandbox({ apiKey })`. Defaults to `env.TANGLE_API_KEY`. + +##### sandboxBaseUrl? + +> `optional` **sandboxBaseUrl?**: `string` + +Defined in: [mcp/delegation-profile.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L58) + +Sandbox base URL forwarded as `SANDBOX_BASE_URL`. Defaults to + `env.SANDBOX_BASE_URL`, then `env.SANDBOX_API_URL`, then the public + sandbox endpoint. + +##### env? + +> `optional` **env?**: `Record`\<`string`, `string` \| `undefined`\> + +Defined in: [mcp/delegation-profile.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L61) + +Environment source for key + OTEL resolution. Defaults to `process.env`; + injectable for tests and non-process callers. + +*** + +### ComposeProductionAgentProfileOptions + +Defined in: [mcp/delegation-profile.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L112) + +#### Properties + +##### sandboxApiKey? + +> `optional` **sandboxApiKey?**: `string` + +Defined in: [mcp/delegation-profile.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L115) + +Sandbox API key forwarded to the delegation MCP child. Defaults to + `env.TANGLE_API_KEY`. When unset, the delegation MCP entry is omitted. + +##### sandboxBaseUrl? + +> `optional` **sandboxBaseUrl?**: `string` + +Defined in: [mcp/delegation-profile.ts:117](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L117) + +Sandbox base URL forwarded as `SANDBOX_BASE_URL` to the MCP child. + +##### systemPrompt? + +> `optional` **systemPrompt?**: `string` + +Defined in: [mcp/delegation-profile.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L120) + +Replace the base profile's system prompt. Used by per-turn calls that + swap in workspace-augmented prompts (board summary, learned style). + +##### extraFiles? + +> `optional` **extraFiles?**: `AgentProfileFileMount`[] + +Defined in: [mcp/delegation-profile.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L122) + +Extra file mounts layered after the base profile's `resources.files`. + +##### name? + +> `optional` **name?**: `string` + +Defined in: [mcp/delegation-profile.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L124) + +Override the profile `name`. Defaults to the base profile's name. + +##### env? + +> `optional` **env?**: `Record`\<`string`, `string` \| `undefined`\> + +Defined in: [mcp/delegation-profile.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L126) + +Environment source for key + OTEL resolution. Defaults to `process.env`. + +##### tools? + +> `optional` **tools?**: `Record`\<`string`, `boolean`\> + +Defined in: [mcp/delegation-profile.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L131) + +Box built-in tool ON/OFF flags merged over the base profile's `tools` + (overlay wins per key). The sandbox-seam mapping of a certified surface's + tool grants — `AgentProfile.tools` is `Record` box flags, + so it carries grants, not arbitrary tool defs. + +##### hooks? + +> `optional` **hooks?**: `Record`\<`string`, `AgentProfileHookCommand`[]\> + +Defined in: [mcp/delegation-profile.ts:134](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L134) + +Per-event hook commands merged over the base profile's `hooks`. An event + present in both has the extra commands appended after the base ones. + +##### subagents? + +> `optional` **subagents?**: `Record`\<`string`, `AgentSubagentProfile`\> + +Defined in: [mcp/delegation-profile.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L137) + +Subagent definitions merged over the base profile's `subagents` (overlay + wins per key). + +##### mcpConnections? + +> `optional` **mcpConnections?**: `Record`\<`string`, `AgentProfileMcpServer`\> + +Defined in: [mcp/delegation-profile.ts:142](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L142) + +Resolved certified MCP connections injected into `AgentProfile.mcp` — the + sandbox-seam delivery of a `ResolvedSurface.mcpConnections`. Merged after + the base map and before the delegation entry, so a base/delegation key is + never silently shadowed by an injected one. + +*** + +### DelegationStore + +Defined in: [mcp/delegation-store.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L23) + +**`Experimental`** + +#### Methods + +##### loadAll() + +> **loadAll**(): `Promise`\<[`DelegationRecord`](#delegationrecord)[]\> + +Defined in: [mcp/delegation-store.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L30) + +**`Experimental`** + +Read every persisted record. Called once, by +`DelegationTaskQueue.restore`, before any write. A missing backing +file is an empty store; an unparseable one throws +`DelegationStateCorruptError`. + +###### Returns + +`Promise`\<[`DelegationRecord`](#delegationrecord)[]\> + +##### upsert() + +> **upsert**(`record`): `Promise`\<`void`\> + +Defined in: [mcp/delegation-store.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L32) + +**`Experimental`** + +Insert or replace the record keyed by `record.taskId`. + +###### Parameters + +###### record + +[`DelegationRecord`](#delegationrecord) + +###### Returns + +`Promise`\<`void`\> + +##### lookupIdempotencyKey() + +> **lookupIdempotencyKey**(`key`): `Promise`\<`string` \| `undefined`\> + +Defined in: [mcp/delegation-store.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L39) + +**`Experimental`** + +Resolve an idempotency key to the taskId that claimed it, if any. +The queue serves submit-time dedupe from its rehydrated in-memory +index; this read exists for consumers that share a store across +processes without holding the full record set. + +###### Parameters + +###### key + +`string` + +###### Returns + +`Promise`\<`string` \| `undefined`\> + +##### remove() + +> **remove**(`taskIds`): `Promise`\<`void`\> + +Defined in: [mcp/delegation-store.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L41) + +**`Experimental`** + +Delete the named records — the retention-cap eviction path. + +###### Parameters + +###### taskIds + +readonly `string`[] + +###### Returns + +`Promise`\<`void`\> + +*** + +### FileDelegationStoreOptions + +Defined in: [mcp/delegation-store.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L99) + +**`Experimental`** + +#### Properties + +##### filePath + +> **filePath**: `string` + +Defined in: [mcp/delegation-store.ts:101](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L101) + +**`Experimental`** + +Absolute path of the JSON state file. Parent directories are created on first write. + +##### recoverCorrupt? + +> `optional` **recoverCorrupt?**: `boolean` + +Defined in: [mcp/delegation-store.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L107) + +**`Experimental`** + +When the state file exists but cannot be parsed, archive it to +`.corrupt-` and start empty instead of +throwing `DelegationStateCorruptError`. Default false. + +*** + +### DelegationTraceSpan + +Defined in: [mcp/delegation-trace.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L31) + +**`Experimental`** + +One span of a delegation's compact trace. Flat (parent linkage by id), all +values JSON-safe scalars — `FileDelegationStore` round-trips records +through `JSON.stringify`. `meta` carries the span's attributes (GenAI +semconv keys + `tangle.loop.*` extensions) exactly as the OTEL sink emits +them, so a consumer can re-export journal traces losslessly. + +#### Properties + +##### spanId + +> **spanId**: `string` + +Defined in: [mcp/delegation-trace.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L32) + +**`Experimental`** + +##### parentSpanId? + +> `optional` **parentSpanId?**: `string` + +Defined in: [mcp/delegation-trace.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L34) + +**`Experimental`** + +Absent on the tree root. + +##### name + +> **name**: `string` + +Defined in: [mcp/delegation-trace.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L36) + +**`Experimental`** + +`'loop'` | `'loop.round'` | `'loop.iteration'` (or a sink-specific name). + +##### kind + +> **kind**: `"loop"` \| `"round"` \| `"branch"` + +Defined in: [mcp/delegation-trace.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L38) + +**`Experimental`** + +Topology level: loop root, plan round, or iteration branch. + +##### startMs + +> **startMs**: `number` + +Defined in: [mcp/delegation-trace.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L39) + +**`Experimental`** + +##### endMs + +> **endMs**: `number` + +Defined in: [mcp/delegation-trace.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L40) + +**`Experimental`** + +##### meta? + +> `optional` **meta?**: `Record`\<`string`, `string` \| `number` \| `boolean`\> + +Defined in: [mcp/delegation-trace.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L41) + +**`Experimental`** + +*** + +### DelegationTraceCaps + +Defined in: [mcp/delegation-trace.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L51) + +**`Experimental`** + +#### Properties + +##### maxSpans? + +> `optional` **maxSpans?**: `number` + +Defined in: [mcp/delegation-trace.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L53) + +**`Experimental`** + +Default [DELEGATION\_TRACE\_MAX\_SPANS](#delegation_trace_max_spans). + +##### maxBytes? + +> `optional` **maxBytes?**: `number` + +Defined in: [mcp/delegation-trace.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L56) + +**`Experimental`** + +Default [DELEGATION\_TRACE\_MAX\_BYTES](#delegation_trace_max_bytes). Approximate — measured as the + sum of per-span `JSON.stringify` lengths. + +*** + +### CappedDelegationTrace + +Defined in: [mcp/delegation-trace.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L60) + +**`Experimental`** + +#### Properties + +##### trace + +> **trace**: [`DelegationTraceSpan`](#delegationtracespan)[] + +Defined in: [mcp/delegation-trace.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L61) + +**`Experimental`** + +##### truncated + +> **truncated**: `boolean` + +Defined in: [mcp/delegation-trace.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L63) + +**`Experimental`** + +True when oldest spans were dropped to honor the caps. + +*** + +### DelegationTraceCollector + +Defined in: [mcp/delegation-trace.ts:123](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L123) + +**`Experimental`** + +Per-delegation trace collector. Buffers `LoopTraceEvent`s per runId +(mirroring the OTEL emitter's buffering) and hands the derived compact +spans to `onSpans` when a run reaches `loop.ended`. `settle()` drains runs +that never ended — a hard-aborted loop still leaves its partial tree in the +journal, unlike the OTEL path which drops it. + +#### Properties + +##### emitter + +> **emitter**: [`LoopTraceEmitter`](runtime.md#looptraceemitter) + +Defined in: [mcp/delegation-trace.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L124) + +**`Experimental`** + +#### Methods + +##### settle() + +> **settle**(): `void` + +Defined in: [mcp/delegation-trace.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L126) + +**`Experimental`** + +Flush buffered events of runs that never reached `loop.ended`. + +###### Returns + +`void` + +*** + +### DriveTurnCapableBox + +Defined in: [mcp/detached-turn.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L67) + +**`Experimental`** + +The box surface detached turns need. `SandboxInstance` +(`@tangle-network/sandbox` >= 0.6) satisfies it structurally; tests pass +in-memory fakes. `_sessionCancel` is the SDK's remote-cancellation surface — +optional here because older SDKs / fakes may not expose it; when present it +is invoked on abort so the remote run actually stops. + +#### Methods + +##### driveTurn() + +> **driveTurn**(`message`, `opts`): `Promise`\<[`DriveTurnTick`](#driveturntick)\> + +Defined in: [mcp/detached-turn.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L68) + +**`Experimental`** + +###### Parameters + +###### message + +`string` + +###### opts + +###### sessionId + +`string` + +###### turnId? + +`string` + +###### wallCapMs? + +`number` + +###### Returns + +`Promise`\<[`DriveTurnTick`](#driveturntick)\> + +##### \_sessionCancel()? + +> `optional` **\_sessionCancel**(`id`): `Promise`\<`void`\> + +Defined in: [mcp/detached-turn.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L72) + +**`Experimental`** + +###### Parameters + +###### id + +`string` + +###### Returns + +`Promise`\<`void`\> + +*** + +### DetachedSessionRefParts + +Defined in: [mcp/detached-turn.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L83) + +**`Experimental`** + +Decoded `DelegationRecord.detachedSessionRef`. `sandboxId` is absent between +submit and box acquisition — a record restored in that window is not +resumable (there is no box to resume on) and the resume driver fails it +loud rather than dispatching onto a guessed box. + +#### Properties + +##### sessionId + +> **sessionId**: `string` + +Defined in: [mcp/detached-turn.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L84) + +**`Experimental`** + +##### sandboxId? + +> `optional` **sandboxId?**: `string` + +Defined in: [mcp/detached-turn.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L85) + +**`Experimental`** + +*** + +### DetachedTurn + +Defined in: [mcp/detached-turn.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L135) + +**`Experimental`** + +The terminal payload of a finished detached turn. + +#### Properties + +##### text + +> **text**: `string` + +Defined in: [mcp/detached-turn.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L137) + +**`Experimental`** + +Final assistant text. + +##### result + +> **result**: `Record`\<`string`, `unknown`\> + +Defined in: [mcp/detached-turn.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L139) + +**`Experimental`** + +The SDK's cached AgentExecutionResult-shape record for the turn. + +*** + +### RunDetachedTurnOptions + +Defined in: [mcp/detached-turn.ts:166](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L166) + +**`Experimental`** + +#### Properties + +##### client + +> **client**: [`SandboxClient`](runtime.md#sandboxclient-2) + +Defined in: [mcp/detached-turn.ts:168](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L168) + +**`Experimental`** + +Sandbox client used to acquire the box (the delegate's executor client). + +##### spec + +> **spec**: [`AgentRunSpec`](runtime.md#agentrunspec)\<`unknown`\> + +Defined in: [mcp/detached-turn.ts:170](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L170) + +**`Experimental`** + +Profile + overrides for box acquisition — same spec the streaming path uses. + +##### prompt + +> **prompt**: `string` + +Defined in: [mcp/detached-turn.ts:172](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L172) + +**`Experimental`** + +The full turn prompt; consumed by `driveTurn`'s dispatch leg. + +##### sessionId + +> **sessionId**: `string` + +Defined in: [mcp/detached-turn.ts:174](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L174) + +**`Experimental`** + +Deterministic resume key, minted at submit time (`parseDetachedSessionRef(ref).sessionId`). + +##### signal + +> **signal**: `AbortSignal` + +Defined in: [mcp/detached-turn.ts:181](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L181) + +**`Experimental`** + +##### tickIntervalMs? + +> `optional` **tickIntervalMs?**: `number` + +Defined in: [mcp/detached-turn.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L184) + +**`Experimental`** + +Delay between `running` ticks (ms). Default 5000. + +##### wallCapMs? + +> `optional` **wallCapMs?**: `number` + +Defined in: [mcp/detached-turn.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L186) + +**`Experimental`** + +Wall-clock cap forwarded to `driveTurn` — the SDK cancels and fails a session past it. + +##### traceEmitter? + +> `optional` **traceEmitter?**: [`LoopTraceEmitter`](runtime.md#looptraceemitter) + +Defined in: [mcp/detached-turn.ts:196](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L196) + +**`Experimental`** + +Loop-trace sink. When set, the detached turn synthesizes a +single-iteration loop span tree (`runId` = `sessionId`, driver +`'detached-turn'`) so trace-context inheritance survives the detached +path — the same events the streaming `runLoop` path would emit, minus +per-token telemetry: `driveTurn` yields one terminal payload, so token +and cost figures are structurally unavailable and reported as 0 under +this driver tag. + +##### placement? + +> `optional` **placement?**: `"sibling"` \| `"fleet"` + +Defined in: [mcp/detached-turn.ts:198](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L198) + +**`Experimental`** + +Physical placement stamped on the synthesized dispatch event. Default `'sibling'`. + +#### Methods + +##### bindSandbox() + +> **bindSandbox**(`sandboxId`): `void` + +Defined in: [mcp/detached-turn.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L180) + +**`Experimental`** + +Called once the box exists, with its sandbox id. Callers persist +`formatDetachedSessionRef({ sandboxId, sessionId })` onto the record here so +a restart can resolve the box again. + +###### Parameters + +###### sandboxId + +`string` + +###### Returns + +`void` + +##### report() + +> **report**(`progress`): `void` + +Defined in: [mcp/detached-turn.ts:182](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L182) + +**`Experimental`** + +###### Parameters + +###### progress + +[`DelegationProgress`](#delegationprogress) + +###### Returns + +`void` + +*** + +### DriveTurnResumeDriverOptions + +Defined in: [mcp/detached-turn.ts:365](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L365) + +**`Experimental`** + +#### Properties + +##### intervalMs? + +> `optional` **intervalMs?**: `number` + +Defined in: [mcp/detached-turn.ts:390](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L390) + +**`Experimental`** + +Delay between `running` ticks (ms). Default 5000. + +##### wallCapMs? + +> `optional` **wallCapMs?**: `number` + +Defined in: [mcp/detached-turn.ts:392](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L392) + +**`Experimental`** + +Wall-clock cap forwarded to `driveTurn` on every tick. + +#### Methods + +##### resolveSandbox() + +> **resolveSandbox**(`sandboxId`): `Promise`\<[`DriveTurnCapableBox`](#driveturncapablebox)\> + +Defined in: [mcp/detached-turn.ts:371](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L371) + +**`Experimental`** + +Resolve the live box owning a detached session. The bin wires this to the +sandbox client's `get(sandboxId)`; throw when the box no longer exists — +a thrown tick settles the record as failed, which is the truth. + +###### Parameters + +###### sandboxId + +`string` + +###### Returns + +`Promise`\<[`DriveTurnCapableBox`](#driveturncapablebox)\> + +##### buildMessage() + +> **buildMessage**(`record`): `string` + +Defined in: [mcp/detached-turn.ts:378](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L378) + +**`Experimental`** + +Rebuild the turn prompt from the persisted record. Only consumed by +`driveTurn`'s dispatch leg — i.e. when the previous process died after +binding the box but before the session was dispatched. Must reproduce the +prompt the delegate would have sent. + +###### Parameters + +###### record + +[`DelegationRecord`](#delegationrecord) + +###### Returns + +`string` + +##### settleOutput() + +> **settleOutput**(`turn`, `record`, `ctx`): `CoderOutput` \| [`ResearchOutputShape`](#researchoutputshape) \| [`UiAuditorDelegationOutput`](#uiauditordelegationoutput) \| `Promise`\<`CoderOutput` \| [`ResearchOutputShape`](#researchoutputshape) \| [`UiAuditorDelegationOutput`](#uiauditordelegationoutput)\> + +Defined in: [mcp/detached-turn.ts:384](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L384) + +**`Experimental`** + +Map a completed turn onto the delegation's typed output payload (parse + +validate per profile). Throw when the resumed result does not pass the +profile's gate — the queue settles the record as failed with that error. + +###### Parameters + +###### turn + +[`DetachedTurn`](#detachedturn) + +###### record + +[`DelegationRecord`](#delegationrecord) + +###### ctx + +###### signal + +`AbortSignal` + +###### Returns + +`CoderOutput` \| [`ResearchOutputShape`](#researchoutputshape) \| [`UiAuditorDelegationOutput`](#uiauditordelegationoutput) \| `Promise`\<`CoderOutput` \| [`ResearchOutputShape`](#researchoutputshape) \| [`UiAuditorDelegationOutput`](#uiauditordelegationoutput)\> + +*** + +### DelegationExecutor + +Defined in: [mcp/executor.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L25) + +**`Experimental`** + +#### Properties + +##### client + +> `readonly` **client**: [`SandboxClient`](runtime.md#sandboxclient-2) + +Defined in: [mcp/executor.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L27) + +**`Experimental`** + +Sandbox client the kernel calls. Returned with `describePlacement` set. + +##### placement? + +> `readonly` `optional` **placement?**: `"sibling"` \| `"fleet"` \| `"in-process"` + +Defined in: [mcp/executor.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L37) + +**`Experimental`** + +Where delegated work physically runs. `sibling` and `fleet` placements are +session-backed (boxes expose `driveTurn`, so detached dispatch + resume +apply); `in-process` spawns local harness CLIs with no sandbox session to +detach. Optional so consumer-implemented executors stay source-compatible; +absent means "unknown" and detached dispatch is not enabled for it. + +#### Methods + +##### describe() + +> **describe**(): `string` + +Defined in: [mcp/executor.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L29) + +**`Experimental`** + +Best-effort one-liner used in stderr boot logs and diagnostics. + +###### Returns + +`string` + +*** + +### SiblingSandboxExecutorOptions + +Defined in: [mcp/executor.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L41) + +**`Experimental`** + +#### Properties + +##### client + +> **client**: [`SandboxClient`](runtime.md#sandboxclient-2) + +Defined in: [mcp/executor.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L42) + +**`Experimental`** + +*** + +### FleetHandle + +Defined in: [mcp/executor.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L82) + +**`Experimental`** + +Minimal `SandboxFleet` surface the fleet executor calls. Declared +structurally so tests can pass an in-memory stub without instantiating the +sandbox SDK. + +#### Properties + +##### fleetId + +> `readonly` **fleetId**: `string` + +Defined in: [mcp/executor.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L83) + +**`Experimental`** + +##### ids + +> `readonly` **ids**: readonly `string`[] + +Defined in: [mcp/executor.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L85) + +**`Experimental`** + +Machine ids in dispatch-eligible order. The executor round-robins. + +#### Methods + +##### sandbox() + +> **sandbox**(`machineId`): `Promise`\<`SandboxInstance`\> + +Defined in: [mcp/executor.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L89) + +**`Experimental`** + +Resolve a machine id to its `SandboxInstance` — that machine is mounted +on the fleet's shared workspace, so any diff the worker writes lands on +every other fleet machine's filesystem too. + +###### Parameters + +###### machineId + +`string` + +###### Returns + +`Promise`\<`SandboxInstance`\> + +*** + +### FleetWorkspaceExecutorOptions + +Defined in: [mcp/executor.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L93) + +**`Experimental`** + +#### Properties + +##### fleet + +> **fleet**: [`FleetHandle`](#fleethandle) + +Defined in: [mcp/executor.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L94) + +**`Experimental`** + +##### selectMachine? + +> `optional` **selectMachine?**: (`call`) => `string` + +Defined in: [mcp/executor.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L100) + +**`Experimental`** + +Override the machine-selection policy. Default = round-robin across +`fleet.ids`, skipping the optional `excludeMachineIds` set (typically the +coordinator machine the MCP server is running on). + +###### Parameters + +###### call + +###### callIndex + +`number` + +###### ids + +readonly `string`[] + +###### Returns + +`string` + +##### excludeMachineIds? + +> `optional` **excludeMachineIds?**: readonly `string`[] + +Defined in: [mcp/executor.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L105) + +**`Experimental`** + +Machine ids to skip during default round-robin. Set to the caller's own +machineId so workers don't compete with the orchestrator on the same VM. + +*** + +### FeedbackEvent + +Defined in: [mcp/feedback-store.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L20) + +**`Experimental`** + +#### Properties + +##### id + +> **id**: `string` + +Defined in: [mcp/feedback-store.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L21) + +**`Experimental`** + +##### refersTo + +> **refersTo**: [`FeedbackRefersTo`](#feedbackrefersto) + +Defined in: [mcp/feedback-store.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L22) + +**`Experimental`** + +##### rating + +> **rating**: [`FeedbackRating`](#feedbackrating) + +Defined in: [mcp/feedback-store.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L23) + +**`Experimental`** + +##### by + +> **by**: `"user"` \| `"agent"` \| `"downstream-judge"` + +Defined in: [mcp/feedback-store.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L24) + +**`Experimental`** + +##### capturedAt + +> **capturedAt**: `string` + +Defined in: [mcp/feedback-store.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L25) + +**`Experimental`** + +##### namespace? + +> `optional` **namespace?**: `string` + +Defined in: [mcp/feedback-store.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L26) + +**`Experimental`** + +*** + +### FeedbackStore + +Defined in: [mcp/feedback-store.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L30) + +**`Experimental`** + +#### Methods + +##### put() + +> **put**(`event`): `Promise`\<`void`\> + +Defined in: [mcp/feedback-store.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L32) + +**`Experimental`** + +Append a new event. Never dedupes — every rating is its own event. + +###### Parameters + +###### event + +[`FeedbackEvent`](#feedbackevent) + +###### Returns + +`Promise`\<`void`\> + +##### list() + +> **list**(`filter?`): `Promise`\<[`FeedbackEvent`](#feedbackevent)[]\> + +Defined in: [mcp/feedback-store.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L37) + +**`Experimental`** + +List events filtered by `namespace`. When `namespace` is omitted, list +across all namespaces. Returns events in insertion order. + +###### Parameters + +###### filter? + +###### namespace? + +`string` + +###### refersToRef? + +`string` + +###### Returns + +`Promise`\<[`FeedbackEvent`](#feedbackevent)[]\> + +*** + +### InProcessExecutorOptions + +Defined in: [mcp/in-process-executor.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L33) + +**`Experimental`** + +#### Properties + +##### repoRoot + +> **repoRoot**: `string` + +Defined in: [mcp/in-process-executor.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L35) + +**`Experimental`** + +Absolute path to the git repo (the workspace). Worktrees go under `/.agent-worktrees/`. + +##### harnesses? + +> `optional` **harnesses?**: readonly [`LocalHarness`](#localharness)[] + +Defined in: [mcp/in-process-executor.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L37) + +**`Experimental`** + +Harnesses to round-robin across `create()` calls. One entry = no fanout. Default `['claude']`. + +##### testCmd? + +> `optional` **testCmd?**: `string` + +Defined in: [mcp/in-process-executor.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L39) + +**`Experimental`** + +Optional per-delegation test command run in the worktree after the harness exits. + +##### typecheckCmd? + +> `optional` **typecheckCmd?**: `string` + +Defined in: [mcp/in-process-executor.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L41) + +**`Experimental`** + +Optional per-delegation typecheck command. Same shape as `testCmd`. + +##### harnessTimeoutMs? + +> `optional` **harnessTimeoutMs?**: `number` + +Defined in: [mcp/in-process-executor.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L43) + +**`Experimental`** + +Wall-clock cap per harness subprocess (ms). Default 5min. + +##### postCheckTimeoutMs? + +> `optional` **postCheckTimeoutMs?**: `number` + +Defined in: [mcp/in-process-executor.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L45) + +**`Experimental`** + +Wall-clock cap per test/typecheck subprocess (ms). Default 2min. + +##### runGit? + +> `optional` **runGit?**: [`GitRunner`](#gitrunner) + +Defined in: [mcp/in-process-executor.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L47) + +**`Experimental`** + +Test seam — override the git runner used by the worktree helpers. + +##### runHarness? + +> `optional` **runHarness?**: (`options`) => `Promise`\<[`LocalHarnessResult`](#localharnessresult)\> + +Defined in: [mcp/in-process-executor.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L49) + +**`Experimental`** + +Test seam — override the harness runner (defaults to the real CLI via `runLocalHarness`). + +**`Experimental`** + +Spawn a local coding harness CLI as a subprocess + collect its output. + +NOT responsible for parsing the harness's output or extracting a diff — +the in-process executor's `streamPrompt` orchestrates `git diff` against +the worktree after this resolves. This function is intentionally narrow: +spawn, wait, capture, return. + +Fails loud — throws when: + - `cwd` doesn't exist (subprocess emits ENOENT; surfaced as Error) + - the harness binary is not on PATH (ENOENT) + +Does NOT throw when: + - the subprocess exits non-zero (`result.exitCode` carries the code) + - the subprocess is aborted / timed out (`result.killedBySignal` / + `result.timedOut` carries the reason) + +###### Parameters + +###### options + +[`RunLocalHarnessOptions`](#runlocalharnessoptions) + +###### Returns + +`Promise`\<[`LocalHarnessResult`](#localharnessresult)\> + +##### runPostCheck? + +> `optional` **runPostCheck?**: (`cmd`, `cwd`, `signal?`) => `Promise`\<\{ `exitCode`: `number`; `stdout`: `string`; `stderr`: `string`; \}\> + +Defined in: [mcp/in-process-executor.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L52) + +**`Experimental`** + +Test seam — override the post-check runner (defaults to a `sh -c` spawn). A throw is folded + into a non-fatal `{exitCode:-1}` so a broken check command fails the signal, not the run. + +###### Parameters + +###### cmd + +`string` + +###### cwd + +`string` + +###### signal? + +`AbortSignal` + +###### Returns + +`Promise`\<\{ `exitCode`: `number`; `stdout`: `string`; `stderr`: `string`; \}\> + +*** + +### InProcessExecutorDescribePlacement + +Defined in: [mcp/in-process-executor.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L60) + +**`Experimental`** + +#### Extends + +- [`LoopSandboxPlacement`](runtime.md#loopsandboxplacement) + +#### Properties + +##### worktreePath? + +> `optional` **worktreePath?**: `string` + +Defined in: [mcp/in-process-executor.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L62) + +**`Experimental`** + +Worktree path in the parent sandbox's filesystem (set so traces correlate to on-disk artifacts). + +##### harness? + +> `optional` **harness?**: [`LocalHarness`](#localharness) + +Defined in: [mcp/in-process-executor.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L64) + +**`Experimental`** + +Which harness handled this delegation. + +##### kind + +> **kind**: `"sibling"` \| `"fleet"` + +Defined in: [runtime/types.ts:314](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L314) + +**`Experimental`** + +###### Inherited from + +[`LoopSandboxPlacement`](runtime.md#loopsandboxplacement).[`kind`](runtime.md#kind-3) + +##### sandboxId? + +> `optional` **sandboxId?**: `string` + +Defined in: [runtime/types.ts:315](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L315) + +**`Experimental`** + +###### Inherited from + +[`LoopSandboxPlacement`](runtime.md#loopsandboxplacement).[`sandboxId`](runtime.md#sandboxid) + +##### fleetId? + +> `optional` **fleetId?**: `string` + +Defined in: [runtime/types.ts:316](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L316) + +**`Experimental`** + +###### Inherited from + +[`LoopSandboxPlacement`](runtime.md#loopsandboxplacement).[`fleetId`](runtime.md#fleetid) + +##### machineId? + +> `optional` **machineId?**: `string` + +Defined in: [runtime/types.ts:317](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L317) + +**`Experimental`** + +###### Inherited from + +[`LoopSandboxPlacement`](runtime.md#loopsandboxplacement).[`machineId`](runtime.md#machineid) + +*** + +### FactCandidate + +Defined in: [mcp/kb-gate.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L24) + +**`Experimental`** + +A fact proposed for the KB, with its grounding. + +#### Properties + +##### claim + +> **claim**: `string` + +Defined in: [mcp/kb-gate.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L26) + +**`Experimental`** + +The atomic claim text. + +##### value? + +> `optional` **value?**: `string` \| `number` + +Defined in: [mcp/kb-gate.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L28) + +**`Experimental`** + +Optional extracted value (number or string) the claim asserts. + +##### verbatimPassage + +> **verbatimPassage**: `string` + +Defined in: [mcp/kb-gate.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L30) + +**`Experimental`** + +Verbatim span lifted from the source that backs the claim. + +##### sourceText + +> **sourceText**: `string` + +Defined in: [mcp/kb-gate.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L32) + +**`Experimental`** + +The raw source text the passage must be grounded in. + +##### citation? + +> `optional` **citation?**: `string` + +Defined in: [mcp/kb-gate.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L34) + +**`Experimental`** + +Where the fact claims to come from — checked for circular/self citations. + +*** + +### FactJudgeVerdict + +Defined in: [mcp/kb-gate.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L38) + +**`Experimental`** + +#### Properties + +##### accept + +> **accept**: `boolean` + +Defined in: [mcp/kb-gate.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L39) + +**`Experimental`** + +##### reason? + +> `optional` **reason?**: `string` + +Defined in: [mcp/kb-gate.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L40) + +**`Experimental`** + +*** + +### FactJudge + +Defined in: [mcp/kb-gate.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L45) + +**`Experimental`** + +A pluggable fact validator. Throw is NOT allowed — return a + verdict; a thrown judge is a programmer error, not a veto. + +#### Properties + +##### name + +> **name**: `string` + +Defined in: [mcp/kb-gate.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L46) + +**`Experimental`** + +#### Methods + +##### judge() + +> **judge**(`candidate`): [`FactJudgeVerdict`](#factjudgeverdict) \| `Promise`\<[`FactJudgeVerdict`](#factjudgeverdict)\> + +Defined in: [mcp/kb-gate.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L47) + +**`Experimental`** + +###### Parameters + +###### candidate + +[`FactCandidate`](#factcandidate) + +###### Returns + +[`FactJudgeVerdict`](#factjudgeverdict) \| `Promise`\<[`FactJudgeVerdict`](#factjudgeverdict)\> + +*** + +### KbGateResult + +Defined in: [mcp/kb-gate.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L51) + +**`Experimental`** + +#### Properties + +##### accepted + +> **accepted**: `boolean` + +Defined in: [mcp/kb-gate.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L52) + +**`Experimental`** + +##### vetoedBy? + +> `optional` **vetoedBy?**: `string` + +Defined in: [mcp/kb-gate.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L54) + +**`Experimental`** + +Name of the judge that vetoed; undefined when accepted. + +##### reason? + +> `optional` **reason?**: `string` + +Defined in: [mcp/kb-gate.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L55) + +**`Experimental`** + +*** + +### CreateKbGateOptions + +Defined in: [mcp/kb-gate.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L59) + +**`Experimental`** + +#### Properties + +##### judges? + +> `optional` **judges?**: [`FactJudge`](#factjudge)[] + +Defined in: [mcp/kb-gate.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L61) + +**`Experimental`** + +Extra judges appended after the built-in floor (e.g. an LLM judge). + +##### minPassageChars? + +> `optional` **minPassageChars?**: `number` + +Defined in: [mcp/kb-gate.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L63) + +**`Experimental`** + +Minimum verbatim-passage length. Default 12 — kills empty/stub passages. + +##### selfArtifactKinds? + +> `optional` **selfArtifactKinds?**: `string`[] + +Defined in: [mcp/kb-gate.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L70) + +**`Experimental`** + +Citation tokens that denote a SELF-generated artifact (e.g. `'spec'`, +`'cad_params'`, `'requirements'`). A citation naming one is circular +(laundering) — the fact cites a derived artifact, not a real source. +Default `[]` (no circular check unless the consumer declares its kinds). + +*** + +### RunLocalHarnessOptions + +Defined in: [mcp/local-harness.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L107) + +**`Experimental`** + +#### Properties + +##### harness + +> **harness**: [`LocalHarness`](#localharness) + +Defined in: [mcp/local-harness.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L108) + +**`Experimental`** + +##### cwd + +> **cwd**: `string` + +Defined in: [mcp/local-harness.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L110) + +**`Experimental`** + +Working directory for the subprocess (typically a worktree path). + +##### taskPrompt + +> **taskPrompt**: `string` + +Defined in: [mcp/local-harness.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L112) + +**`Experimental`** + +Prompt forwarded as the harness CLI's task argument. + +##### invocation? + +> `optional` **invocation?**: `object` + +Defined in: [mcp/local-harness.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L120) + +**`Experimental`** + +Pre-built command + args (e.g. from `harnessInvocation` so the full authored +`AgentProfile` — systemPrompt + model — reaches the harness). When set it OVERRIDES the +default prompt-only `buildArgs(taskPrompt)` path; `command` defaults to the harness's +default binary when only `args` is supplied. When absent the legacy prompt-only shape +is used unchanged. + +###### command? + +> `optional` **command?**: `string` + +###### args + +> **args**: readonly `string`[] + +##### timeoutMs? + +> `optional` **timeoutMs?**: `number` + +Defined in: [mcp/local-harness.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L122) + +**`Experimental`** + +Wall-clock kill deadline (ms). Default 5 min. Subprocess SIGTERMed on expiry. + +##### signal? + +> `optional` **signal?**: `AbortSignal` + +Defined in: [mcp/local-harness.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L124) + +**`Experimental`** + +Caller cancellation. SIGTERM is sent on abort. + +##### env? + +> `optional` **env?**: `ProcessEnv` + +Defined in: [mcp/local-harness.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L126) + +**`Experimental`** + +Override env (defaults to inheriting from the parent). + +##### spawn? + +> `optional` **spawn?**: (`command`, `args`, `opts`) => `ChildProcess` + +Defined in: [mcp/local-harness.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L131) + +**`Experimental`** + +Test seam — inject a custom spawner so unit tests can mock the +subprocess without touching the OS. Defaults to node's `child_process.spawn`. + +###### Parameters + +###### command + +`string` + +###### args + +readonly `string`[] + +###### opts + +###### cwd + +`string` + +###### env + +`ProcessEnv` + +###### stdio + +`"pipe"` + +###### Returns + +`ChildProcess` + +*** + +### LocalHarnessResult + +Defined in: [mcp/local-harness.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L143) + +**`Experimental`** + +#### Properties + +##### exitCode + +> **exitCode**: `number` \| `null` + +Defined in: [mcp/local-harness.ts:145](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L145) + +**`Experimental`** + +OS exit code. `null` when killed before exit. + +##### stdout + +> **stdout**: `string` + +Defined in: [mcp/local-harness.ts:147](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L147) + +**`Experimental`** + +Concatenated stdout. + +##### stderr + +> **stderr**: `string` + +Defined in: [mcp/local-harness.ts:149](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L149) + +**`Experimental`** + +Concatenated stderr. + +##### killedBySignal + +> **killedBySignal**: `Signals` \| `null` + +Defined in: [mcp/local-harness.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L151) + +**`Experimental`** + +Set when the process exited via signal (timeout / abort). + +##### durationMs + +> **durationMs**: `number` + +Defined in: [mcp/local-harness.ts:153](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L153) + +**`Experimental`** + +Wall-clock duration ms (spawn → exit). + +##### timedOut + +> **timedOut**: `boolean` + +Defined in: [mcp/local-harness.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L155) + +**`Experimental`** + +Set when timeoutMs elapsed before exit. + +*** + +### McpServerOptions + +Defined in: [mcp/server.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L64) + +**`Experimental`** + +#### Properties + +##### coderDelegate? + +> `optional` **coderDelegate?**: [`CoderDelegate`](#coderdelegate) + +Defined in: [mcp/server.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L66) + +**`Experimental`** + +Required to enable delegate_code. + +##### researcherDelegate? + +> `optional` **researcherDelegate?**: [`ResearcherDelegate`](#researcherdelegate) + +Defined in: [mcp/server.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L73) + +**`Experimental`** + +Required to enable delegate_research. The substrate cannot ship a +default — wire one that closes over your `runLoop` + a +researcher profile (typically `@tangle-network/agent-knowledge`'s +`researcherProfile` / `multiHarnessResearcherFanout`). + +##### uiAuditorDelegate? + +> `optional` **uiAuditorDelegate?**: [`UiAuditorDelegate`](#uiauditordelegate) + +Defined in: [mcp/server.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L80) + +**`Experimental`** + +Required to enable delegate_ui_audit. Wire one that closes over your +`runLoop` + `uiAuditorProfile` + a `SandboxClient` (the +canonical in-process choice is `createInProcessUiAuditClient` from +`@tangle-network/agent-runtime/profiles`) + your vision judge. + +##### feedbackStore? + +> `optional` **feedbackStore?**: [`FeedbackStore`](#feedbackstore) + +Defined in: [mcp/server.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L82) + +**`Experimental`** + +Override the default in-memory feedback store. + +##### queue? + +> `optional` **queue?**: [`DelegationTaskQueue`](#delegationtaskqueue) + +Defined in: [mcp/server.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L84) + +**`Experimental`** + +Override the default in-memory task queue. + +##### detachedDispatch? + +> `optional` **detachedDispatch?**: `boolean` + +Defined in: [mcp/server.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L93) + +**`Experimental`** + +Record deterministic detached-session resume keys on single-variant +coder/researcher submissions so a durable queue can resume them after a +restart. Enable only when the wired delegates dispatch via sandbox +sessions (`driveTurn`) AND `queue` persists records — the keys are inert +otherwise. The bin turns this on alongside the durable store for +session-backed (sibling/fleet) placements. + +##### extraTools? + +> `optional` **extraTools?**: [`McpToolDescriptor`](#mcptooldescriptor)[] + +Defined in: [mcp/server.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L99) + +**`Experimental`** + +Extra tools to serve alongside the delegation tools, for example +`createCoordinationTools(...).tools`. Registered after the built-ins; a +duplicate name throws so delegation tools cannot be shadowed silently. + +##### traceContext? + +> `optional` **traceContext?**: [`TraceContext`](#tracecontext-2) + +Defined in: [mcp/server.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L105) + +**`Experimental`** + +Inherited trace identity (`readTraceContextFromEnv()`) stamped on every +record the DEFAULT queue creates. Ignored when `queue` is supplied — +pass `traceContext` to that queue's constructor instead. + +##### serverName? + +> `optional` **serverName?**: `string` + +Defined in: [mcp/server.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L107) + +**`Experimental`** + +Server display name surfaced via `initialize`. Default `'agent-runtime-mcp'`. + +##### serverVersion? + +> `optional` **serverVersion?**: `string` + +Defined in: [mcp/server.ts:109](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L109) + +**`Experimental`** + +Server version surfaced via `initialize`. Default = the package version baked at build time. + +*** + +### McpToolDescriptor + +Defined in: [mcp/server.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L113) + +**`Experimental`** + +#### Properties + +##### name + +> **name**: `string` + +Defined in: [mcp/server.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L114) + +**`Experimental`** + +##### description + +> **description**: `string` + +Defined in: [mcp/server.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L115) + +**`Experimental`** + +##### inputSchema + +> **inputSchema**: `Record`\<`string`, `unknown`\> + +Defined in: [mcp/server.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L116) + +**`Experimental`** + +##### handler + +> **handler**: (`raw`) => `Promise`\<`unknown`\> + +Defined in: [mcp/server.ts:117](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L117) + +**`Experimental`** + +###### Parameters + +###### raw + +`unknown` + +###### Returns + +`Promise`\<`unknown`\> + +*** + +### McpServer + +Defined in: [mcp/server.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L121) + +**`Experimental`** + +#### Properties + +##### tools + +> `readonly` **tools**: `ReadonlyMap`\<`string`, [`McpToolDescriptor`](#mcptooldescriptor)\> + +Defined in: [mcp/server.ts:123](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L123) + +**`Experimental`** + +Tools currently registered (depend on which delegates were wired). + +##### queue + +> `readonly` **queue**: [`DelegationTaskQueue`](#delegationtaskqueue) + +Defined in: [mcp/server.ts:125](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L125) + +**`Experimental`** + +The underlying queue — exposed so tests can introspect it. + +##### feedbackStore + +> `readonly` **feedbackStore**: [`FeedbackStore`](#feedbackstore) + +Defined in: [mcp/server.ts:127](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L127) + +**`Experimental`** + +The feedback store — exposed for the same reason. + +#### Methods + +##### handle() + +> **handle**(`message`): `Promise`\<[`JsonRpcResponse`](#jsonrpcresponse) \| `null`\> + +Defined in: [mcp/server.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L129) + +**`Experimental`** + +Handle a single parsed JSON-RPC message. Returns the response object (or `null` for notifications). + +###### Parameters + +###### message + +[`JsonRpcMessage`](#jsonrpcmessage) + +###### Returns + +`Promise`\<[`JsonRpcResponse`](#jsonrpcresponse) \| `null`\> + +##### serve() + +> **serve**(`transport?`): `Promise`\<`void`\> + +Defined in: [mcp/server.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L131) + +**`Experimental`** + +Drive the server on a stdio-shaped transport until `stop()` is called. + +###### Parameters + +###### transport? + +[`McpTransport`](#mcptransport) + +###### Returns + +`Promise`\<`void`\> + +##### stop() + +> **stop**(): `void` + +Defined in: [mcp/server.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L133) + +**`Experimental`** + +Stop a `serve` call. Subsequent requests are rejected. + +###### Returns + +`void` + +*** + +### McpTransport + +Defined in: [mcp/server.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L137) + +**`Experimental`** + +#### Properties + +##### input + +> **input**: `ReadableStream` + +Defined in: [mcp/server.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L138) + +**`Experimental`** + +##### output + +> **output**: `WritableStream` + +Defined in: [mcp/server.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L139) + +**`Experimental`** + +*** + +### JsonRpcMessage + +Defined in: [mcp/server.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L143) + +**`Experimental`** + +#### Properties + +##### jsonrpc + +> **jsonrpc**: `"2.0"` + +Defined in: [mcp/server.ts:144](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L144) + +**`Experimental`** + +##### id? + +> `optional` **id?**: `string` \| `number` \| `null` + +Defined in: [mcp/server.ts:145](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L145) + +**`Experimental`** + +##### method + +> **method**: `string` + +Defined in: [mcp/server.ts:146](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L146) + +**`Experimental`** + +##### params? + +> `optional` **params?**: `unknown` + +Defined in: [mcp/server.ts:147](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L147) + +**`Experimental`** + +*** + +### JsonRpcResponse + +Defined in: [mcp/server.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L151) + +**`Experimental`** + +#### Properties + +##### jsonrpc + +> **jsonrpc**: `"2.0"` + +Defined in: [mcp/server.ts:152](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L152) + +**`Experimental`** + +##### id + +> **id**: `string` \| `number` \| `null` + +Defined in: [mcp/server.ts:153](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L153) + +**`Experimental`** + +##### result? + +> `optional` **result?**: `unknown` + +Defined in: [mcp/server.ts:154](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L154) + +**`Experimental`** + +##### error? + +> `optional` **error?**: `object` + +Defined in: [mcp/server.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L155) + +**`Experimental`** + +###### code + +> **code**: `number` + +###### message + +> **message**: `string` + +###### data? + +> `optional` **data?**: `unknown` + +*** + +### DelegationRecord + +Defined in: [mcp/task-queue.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L65) + +**`Experimental`** + +Must be JSON-safe end to end (`args`, `result`, `error`, `feedback`) — +persistent stores round-trip records through `JSON.stringify`. + +#### Properties + +##### taskId + +> **taskId**: `string` + +Defined in: [mcp/task-queue.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L66) + +**`Experimental`** + +##### profile + +> **profile**: [`DelegationProfile`](#delegationprofile) + +Defined in: [mcp/task-queue.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L67) + +**`Experimental`** + +##### namespace? + +> `optional` **namespace?**: `string` + +Defined in: [mcp/task-queue.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L68) + +**`Experimental`** + +##### args + +> **args**: `AnyDelegateArgs` + +Defined in: [mcp/task-queue.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L69) + +**`Experimental`** + +##### status + +> **status**: [`DelegationStatus`](#delegationstatus) + +Defined in: [mcp/task-queue.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L70) + +**`Experimental`** + +##### progress? + +> `optional` **progress?**: [`DelegationProgress`](#delegationprogress) + +Defined in: [mcp/task-queue.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L71) + +**`Experimental`** + +##### result? + +> `optional` **result?**: [`DelegationResultPayload`](#delegationresultpayload) + +Defined in: [mcp/task-queue.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L72) + +**`Experimental`** + +##### error? + +> `optional` **error?**: [`DelegationError`](#delegationerror) + +Defined in: [mcp/task-queue.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L73) + +**`Experimental`** + +##### costUsd? + +> `optional` **costUsd?**: `number` + +Defined in: [mcp/task-queue.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L74) + +**`Experimental`** + +##### startedAt + +> **startedAt**: `string` + +Defined in: [mcp/task-queue.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L75) + +**`Experimental`** + +##### completedAt? + +> `optional` **completedAt?**: `string` + +Defined in: [mcp/task-queue.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L76) + +**`Experimental`** + +##### idempotencyKey? + +> `optional` **idempotencyKey?**: `string` + +Defined in: [mcp/task-queue.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L78) + +**`Experimental`** + +Sha-prefix hash of the canonical input — used for idempotency lookup. + +##### detachedSessionRef? + +> `optional` **detachedSessionRef?**: `string` + +Defined in: [mcp/task-queue.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L85) + +**`Experimental`** + +Caller-generated deterministic id of a detached run (e.g. the sandbox +session id a single-tick driver resumes by). Presence is what makes a +restored in-flight record resumable via `resumeDelegate`; without it a +restart settles the record as failed. + +##### feedback + +> **feedback**: [`DelegationFeedbackSnapshot`](#delegationfeedbacksnapshot)[] + +Defined in: [mcp/task-queue.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L87) + +**`Experimental`** + +Feedback events keyed by this delegation's taskId. + +##### trace? + +> `optional` **trace?**: [`DelegationTraceSpan`](#delegationtracespan)[] + +Defined in: [mcp/task-queue.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L94) + +**`Experimental`** + +Compact loop-trace span tree teed from the delegation's run, oldest +spans first. Appended when a delegated loop reaches `loop.ended` and +settled (partial buffers included) at the terminal transition. Capped +via `capDelegationTrace` — see `traceTruncated`. + +##### traceTruncated? + +> `optional` **traceTruncated?**: `true` + +Defined in: [mcp/task-queue.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L96) + +**`Experimental`** + +Present when oldest trace spans were dropped to honor the trace caps. + +##### traceId? + +> `optional` **traceId?**: `string` + +Defined in: [mcp/task-queue.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L103) + +**`Experimental`** + +Inherited trace identity (the queue's `traceContext` at submit time — +typically `readTraceContextFromEnv()`), distinct from the span payload: +a journal consumer joins records into the parent trace by these ids +without parsing spans. Restored records keep their persisted identity. + +##### parentSpanId? + +> `optional` **parentSpanId?**: `string` + +Defined in: [mcp/task-queue.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L105) + +**`Experimental`** + +Caller span that dispatched the delegation, when one was inherited. + +*** + +### SubmitInput + +Defined in: [mcp/task-queue.ts:109](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L109) + +**`Experimental`** + +#### Type Parameters + +##### Args + +`Args` *extends* `AnyDelegateArgs` + +#### Properties + +##### profile + +> **profile**: [`DelegationProfile`](#delegationprofile) + +Defined in: [mcp/task-queue.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L110) + +**`Experimental`** + +##### args + +> **args**: `Args` + +Defined in: [mcp/task-queue.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L111) + +**`Experimental`** + +##### namespace? + +> `optional` **namespace?**: `string` + +Defined in: [mcp/task-queue.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L112) + +**`Experimental`** + +##### idempotencyKey? + +> `optional` **idempotencyKey?**: `string` + +Defined in: [mcp/task-queue.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L113) + +**`Experimental`** + +##### detachedSessionRef? + +> `optional` **detachedSessionRef?**: `string` + +Defined in: [mcp/task-queue.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L120) + +**`Experimental`** + +Records the detached-run resume key on the new record. The submitted +`run` function still executes in-process exactly as without it — the +ref only matters after a restart, when `DelegationTaskQueue.restore` +hands it to the `resumeDelegate` seam instead of failing the record. + +##### run + +> **run**: (`ctx`) => `Promise`\<`CoderOutput` \| [`ResearchOutputShape`](#researchoutputshape) \| [`UiAuditorDelegationOutput`](#uiauditordelegationoutput)\> + +Defined in: [mcp/task-queue.ts:127](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L127) + +**`Experimental`** + +Runs the underlying delegation. The queue passes a fresh `AbortSignal` +and a `report` channel for incremental progress updates. The function +MUST resolve with the typed `DelegationResultPayload['output']`; the +queue wraps it with the profile tag. + +###### Parameters + +###### ctx + +[`DelegationRunContext`](#delegationruncontext) + +###### Returns + +`Promise`\<`CoderOutput` \| [`ResearchOutputShape`](#researchoutputshape) \| [`UiAuditorDelegationOutput`](#uiauditordelegationoutput)\> + +*** + +### DelegationRunContext + +Defined in: [mcp/task-queue.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L131) + +**`Experimental`** + +Context handed to a `SubmitInput.run` function. + +#### Properties + +##### signal + +> **signal**: `AbortSignal` + +Defined in: [mcp/task-queue.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L132) + +**`Experimental`** + +##### detachedSessionRef? + +> `optional` **detachedSessionRef?**: `string` + +Defined in: [mcp/task-queue.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L135) + +**`Experimental`** + +The `detachedSessionRef` recorded at submit, when one was supplied. + +##### traceEmitter? + +> `optional` **traceEmitter?**: [`LoopTraceEmitter`](runtime.md#looptraceemitter) + +Defined in: [mcp/task-queue.ts:153](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L153) + +**`Experimental`** + +Per-delegation loop-trace sink, always provided by the queue. Events +emitted here are journaled onto the record as a compact span tree +(`record.trace`) when each loop run ends and at the delegation's +terminal transition. Delegates forward it into their `runLoop` ctx, +composed with any process-wide OTEL emitter +(`composeLoopTraceEmitters`). Optional in the type so consumer-built +contexts stay source-compatible. + +#### Methods + +##### report() + +> **report**(`progress`): `void` + +Defined in: [mcp/task-queue.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L133) + +**`Experimental`** + +###### Parameters + +###### progress + +[`DelegationProgress`](#delegationprogress) + +###### Returns + +`void` + +##### updateDetachedSessionRef() + +> **updateDetachedSessionRef**(`ref`): `void` + +Defined in: [mcp/task-queue.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L143) + +**`Experimental`** + +Replace the record's detached-run resume key — the detached dispatch path +calls this once the sandbox id is known so the persisted ref names a +resolvable box. Ignored after the record settles (a cancel racing the +rebind is legitimate; the ref no longer matters then). Throws on an empty +ref — erasing the resume key would silently make the record unresumable. + +###### Parameters + +###### ref + +`string` + +###### Returns + +`void` + +*** + +### SubmitOutput + +Defined in: [mcp/task-queue.ts:157](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L157) + +**`Experimental`** + +#### Properties + +##### taskId + +> **taskId**: `string` + +Defined in: [mcp/task-queue.ts:158](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L158) + +**`Experimental`** + +##### reused + +> **reused**: `boolean` + +Defined in: [mcp/task-queue.ts:160](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L160) + +**`Experimental`** + +True when a prior matching `idempotencyKey` returned an existing record. + +*** + +### DelegationResumeContext + +Defined in: [mcp/task-queue.ts:177](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L177) + +**`Experimental`** + +#### Properties + +##### signal + +> **signal**: `AbortSignal` + +Defined in: [mcp/task-queue.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L179) + +**`Experimental`** + +Fired by `cancel(taskId)`; the driver should stop the remote run when it can. + +#### Methods + +##### report() + +> **report**(`progress`): `void` + +Defined in: [mcp/task-queue.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L180) + +**`Experimental`** + +###### Parameters + +###### progress + +[`DelegationProgress`](#delegationprogress) + +###### Returns + +`void` + +*** + +### DelegationResumeDriver + +Defined in: [mcp/task-queue.ts:193](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L193) + +**`Experimental`** + +Re-attaches restored in-flight records to their detached runs. The queue +calls `tick` repeatedly — it never awaits a whole run — so the driver can +be a thin wrapper over a one-pass primitive: resolve the run named by +`detachedSessionRef`, advance/poll it once, report where it stands. A +thrown error settles the record as failed; `failed` ticks are treated as +terminal and are not retried. + +#### Properties + +##### intervalMs? + +> `optional` **intervalMs?**: `number` + +Defined in: [mcp/task-queue.ts:199](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L199) + +**`Experimental`** + +Delay between `running` ticks, in milliseconds. Default 5000. + +#### Methods + +##### tick() + +> **tick**(`task`, `ctx`): `Promise`\<[`DelegationResumeTick`](#delegationresumetick)\> + +Defined in: [mcp/task-queue.ts:194](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L194) + +**`Experimental`** + +###### Parameters + +###### task + +###### record + +[`DelegationRecord`](#delegationrecord) + +###### detachedSessionRef + +`string` + +###### ctx + +[`DelegationResumeContext`](#delegationresumecontext) + +###### Returns + +`Promise`\<[`DelegationResumeTick`](#delegationresumetick)\> + +*** + +### DelegationTaskQueueOptions + +Defined in: [mcp/task-queue.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L203) + +**`Experimental`** + +#### Properties + +##### generateId? + +> `optional` **generateId?**: () => `string` + +Defined in: [mcp/task-queue.ts:205](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L205) + +**`Experimental`** + +ID generator override; default `randomTaskId`. + +###### Returns + +`string` + +##### now? + +> `optional` **now?**: () => `string` + +Defined in: [mcp/task-queue.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L207) + +**`Experimental`** + +Clock override; default `() => new Date().toISOString()`. + +###### Returns + +`string` + +##### store? + +> `optional` **store?**: [`DelegationStore`](#delegationstore) + +Defined in: [mcp/task-queue.ts:215](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L215) + +**`Experimental`** + +Journal for record mutations and the `restore()` load source. Default +`InMemoryDelegationStore` — observably identical to an unjournaled +queue. Pass a `FileDelegationStore` through +`DelegationTaskQueue.restore` for state that survives a restart; +constructing with `new` never loads prior state. + +##### resumeDelegate? + +> `optional` **resumeDelegate?**: [`DelegationResumeDriver`](#delegationresumedriver) + +Defined in: [mcp/task-queue.ts:217](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L217) + +**`Experimental`** + +Resume seam for restored in-flight records that carry a `detachedSessionRef`. + +##### maxTerminalRecords? + +> `optional` **maxTerminalRecords?**: `number` + +Defined in: [mcp/task-queue.ts:223](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L223) + +**`Experimental`** + +Maximum number of terminal (completed | failed | cancelled) records +retained; the oldest (by `completedAt`) are evicted from memory and +store once the cap is exceeded. Default unbounded. + +##### onPersistError? + +> `optional` **onPersistError?**: (`error`) => `void` + +Defined in: [mcp/task-queue.ts:230](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L230) + +**`Experimental`** + +Observes the first store failure. After it fires, the queue refuses +new submissions and `flush()` rejects with the same error. Default: +rethrow on a microtask — an unhandled crash — because silently +degrading durable mode to memory-only would lie to the caller. + +###### Parameters + +###### error + +[`DelegationPersistenceError`](#delegationpersistenceerror) + +###### Returns + +`void` + +##### traceContext? + +> `optional` **traceContext?**: [`TraceContext`](#tracecontext-2) + +Defined in: [mcp/task-queue.ts:238](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L238) + +**`Experimental`** + +Inherited trace identity stamped on every submitted record +(`traceId` / `parentSpanId`). The bin passes +`readTraceContextFromEnv()` so journal consumers can join delegation +records into the caller's trace. Restored records keep the identity +they were persisted with. + +*** + +### Check + +Defined in: [mcp/tools/checks.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L82) + +One lens — a composable analyst kind. Identity fields mirror `TraceAnalystKindSpec` so a kind is + upgradeable to the full agentic factory; `lookFor` is the lens question the actor applies. + +#### Properties + +##### id + +> `readonly` **id**: `string` + +Defined in: [mcp/tools/checks.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L83) + +##### description + +> `readonly` **description**: `string` + +Defined in: [mcp/tools/checks.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L84) + +##### area + +> `readonly` **area**: `string` + +Defined in: [mcp/tools/checks.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L86) + +Coarse classification stamped on every finding this kind emits (the renderer groups by it). + +##### version + +> `readonly` **version**: `string` + +Defined in: [mcp/tools/checks.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L87) + +##### lookFor + +> `readonly` **lookFor**: `string` + +Defined in: [mcp/tools/checks.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L89) + +The lens — what this analyst looks for in the trace. + +*** + +### CheckRunnerOptions + +Defined in: [mcp/tools/checks.ts:209](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L209) + +#### Properties + +##### routerBaseUrl + +> **routerBaseUrl**: `string` + +Defined in: [mcp/tools/checks.ts:210](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L210) + +##### routerKey + +> **routerKey**: `string` + +Defined in: [mcp/tools/checks.ts:211](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L211) + +##### model + +> **model**: `string` + +Defined in: [mcp/tools/checks.ts:212](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L212) + +##### chat? + +> `optional` **chat?**: (`system`, `user`) => `Promise`\<`string`\> + +Defined in: [mcp/tools/checks.ts:214](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L214) + +Test/override seam — replace the LLM call. Default: a router chat completion. + +###### Parameters + +###### system + +`string` + +###### user + +`string` + +###### Returns + +`Promise`\<`string`\> + +*** + +### SettledWorker + +Defined in: [mcp/tools/coordination.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L21) + +A worker the driver has drained via `await_event`. + +#### Properties + +##### id + +> `readonly` **id**: `string` + +Defined in: [mcp/tools/coordination.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L22) + +##### status + +> `readonly` **status**: `"done"` \| `"down"` + +Defined in: [mcp/tools/coordination.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L23) + +##### score? + +> `readonly` `optional` **score?**: `number` + +Defined in: [mcp/tools/coordination.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L24) + +##### valid? + +> `readonly` `optional` **valid?**: `boolean` + +Defined in: [mcp/tools/coordination.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L25) + +##### outRef? + +> `readonly` `optional` **outRef?**: `string` + +Defined in: [mcp/tools/coordination.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L26) + +##### reason? + +> `readonly` `optional` **reason?**: `string` + +Defined in: [mcp/tools/coordination.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L27) + +*** + +### Question + +Defined in: [mcp/tools/coordination.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L38) + +#### Extended by + +- [`QuestionRecord`](#questionrecord) + +#### Properties + +##### id + +> `readonly` **id**: `string` + +Defined in: [mcp/tools/coordination.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L39) + +##### from + +> `readonly` **from**: `string` + +Defined in: [mcp/tools/coordination.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L40) + +##### level + +> `readonly` **level**: `QuestionLevel` + +Defined in: [mcp/tools/coordination.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L41) + +##### question + +> `readonly` **question**: `string` + +Defined in: [mcp/tools/coordination.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L42) + +##### reason + +> `readonly` **reason**: `string` + +Defined in: [mcp/tools/coordination.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L43) + +##### urgency + +> `readonly` **urgency**: `QuestionUrgency` + +Defined in: [mcp/tools/coordination.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L44) + +##### options? + +> `readonly` `optional` **options?**: readonly `QuestionOption`[] + +Defined in: [mcp/tools/coordination.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L45) + +*** + +### QuestionRecord + +Defined in: [mcp/tools/coordination.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L53) + +#### Extends + +- [`Question`](#question) + +#### Properties + +##### id + +> `readonly` **id**: `string` + +Defined in: [mcp/tools/coordination.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L39) + +###### Inherited from + +[`Question`](#question).[`id`](#id-5) + +##### from + +> `readonly` **from**: `string` + +Defined in: [mcp/tools/coordination.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L40) + +###### Inherited from + +[`Question`](#question).[`from`](#from) + +##### level + +> `readonly` **level**: `QuestionLevel` + +Defined in: [mcp/tools/coordination.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L41) + +###### Inherited from + +[`Question`](#question).[`level`](#level) + +##### question + +> `readonly` **question**: `string` + +Defined in: [mcp/tools/coordination.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L42) + +###### Inherited from + +[`Question`](#question).[`question`](#question-1) + +##### reason + +> `readonly` **reason**: `string` + +Defined in: [mcp/tools/coordination.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L43) + +###### Inherited from + +[`Question`](#question).[`reason`](#reason-3) + +##### urgency + +> `readonly` **urgency**: `QuestionUrgency` + +Defined in: [mcp/tools/coordination.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L44) + +###### Inherited from + +[`Question`](#question).[`urgency`](#urgency) + +##### options? + +> `readonly` `optional` **options?**: readonly `QuestionOption`[] + +Defined in: [mcp/tools/coordination.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L45) + +###### Inherited from + +[`Question`](#question).[`options`](#options) + +##### status + +> `readonly` **status**: `"open"` \| `"answered"` \| `"deferred"` \| `"escalated"` + +Defined in: [mcp/tools/coordination.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L54) + +##### decision? + +> `readonly` `optional` **decision?**: [`QuestionDecision`](#questiondecision) + +Defined in: [mcp/tools/coordination.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L55) + +##### openedAt + +> `readonly` **openedAt**: `number` + +Defined in: [mcp/tools/coordination.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L56) + +*** + +### AnalystRegistry + +Defined in: [mcp/tools/coordination.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L62) + +#### Properties + +##### kinds + +> `readonly` **kinds**: readonly `object`[] + +Defined in: [mcp/tools/coordination.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L63) + +##### run + +> `readonly` **run**: (`kindId`, `trace`) => `Promise`\<`unknown`\> + +Defined in: [mcp/tools/coordination.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L64) + +###### Parameters + +###### kindId + +`string` + +###### trace + +`unknown` + +###### Returns + +`Promise`\<`unknown`\> + +*** + +### CoordinationToolsOptions + +Defined in: [mcp/tools/coordination.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L94) + +#### Properties + +##### scope + +> `readonly` **scope**: [`Scope`](runtime.md#scope-1)\<`unknown`\> + +Defined in: [mcp/tools/coordination.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L95) + +##### blobs + +> `readonly` **blobs**: [`ResultBlobStore`](runtime.md#resultblobstore) + +Defined in: [mcp/tools/coordination.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L96) + +##### makeWorkerAgent + +> `readonly` **makeWorkerAgent**: [`MakeWorkerAgent`](#makeworkeragent) + +Defined in: [mcp/tools/coordination.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L97) + +##### perWorker + +> `readonly` **perWorker**: [`Budget`](runtime.md#budget-8) + +Defined in: [mcp/tools/coordination.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L98) + +##### analysts? + +> `readonly` `optional` **analysts?**: [`AnalystRegistry`](#analystregistry) + +Defined in: [mcp/tools/coordination.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L99) + +##### onEvent? + +> `readonly` `optional` **onEvent?**: (`event`) => `void` \| `Promise`\<`void`\> + +Defined in: [mcp/tools/coordination.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L100) + +###### Parameters + +###### event + +[`CoordinationEvent`](#coordinationevent) + +###### Returns + +`void` \| `Promise`\<`void`\> + +##### questionPolicy? + +> `readonly` `optional` **questionPolicy?**: [`QuestionPolicy`](#questionpolicy) + +Defined in: [mcp/tools/coordination.ts:101](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L101) + +##### analyzeOnSettle? + +> `readonly` `optional` **analyzeOnSettle?**: readonly `string`[] + +Defined in: [mcp/tools/coordination.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L106) + +Analyst kind ids to run AUTOMATICALLY when a worker settles `done` (the analyst-on-settle + hook). Each result is published as a `finding` event on the bus — pass-through to subscribers + and queued for the driver to pull via `await_event`. Omit/empty = no auto-analysis (default; + the driver can still run lenses on demand via `run_analyst`). Requires `analysts`. + +*** + +### CoordinationTools + +Defined in: [mcp/tools/coordination.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L116) + +The supervisor-side toolbox returned by [createCoordinationTools](#createcoordinationtools): the MCP tool +descriptors a driver `AgentProfile` calls to spawn, steer, observe, and settle workers +over a live `Scope`, plus the typed accessors (`settled`/`questions`/`history`/`stats`/ +`raiseFinding`) for the bidirectional coordination bus. This is the live, backend-of-your- +choice, steerable counterpart to the one-shot own-sandbox delegation MCP. + +#### Properties + +##### tools + +> `readonly` **tools**: [`McpToolDescriptor`](#mcptooldescriptor)[] + +Defined in: [mcp/tools/coordination.ts:117](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L117) + +#### Methods + +##### isStopped() + +> **isStopped**(): `boolean` + +Defined in: [mcp/tools/coordination.ts:118](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L118) + +###### Returns + +`boolean` + +##### stopReason() + +> **stopReason**(): `string` \| `undefined` + +Defined in: [mcp/tools/coordination.ts:119](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L119) + +###### Returns + +`string` \| `undefined` + +##### settled() + +> **settled**(): readonly [`SettledWorker`](#settledworker)[] + +Defined in: [mcp/tools/coordination.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L120) + +###### Returns + +readonly [`SettledWorker`](#settledworker)[] + +##### questions() + +> **questions**(): readonly [`QuestionRecord`](#questionrecord)[] + +Defined in: [mcp/tools/coordination.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L121) + +###### Returns + +readonly [`QuestionRecord`](#questionrecord)[] + +##### history() + +> **history**(): readonly [`BusRecord`](runtime.md#busrecord)\<[`CoordinationEvent`](#coordinationevent)\>[] + +Defined in: [mcp/tools/coordination.ts:125](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L125) + +The full ordered log of every bus event — UP (settled / question / finding) and DOWN + (steer / answer) — the observability audit + replay trail. Each record carries seq, + timestamp, and priority. + +###### Returns + +readonly [`BusRecord`](runtime.md#busrecord)\<[`CoordinationEvent`](#coordinationevent)\>[] + +##### stats() + +> **stats**(): [`BusStats`](runtime.md#busstats) + +Defined in: [mcp/tools/coordination.ts:127](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L127) + +Bus throughput counters (published / pulled / by-kind) for live dashboards. + +###### Returns + +[`BusStats`](runtime.md#busstats) + +##### raiseFinding() + +> **raiseFinding**(`finding`): `Promise`\<`void`\> + +Defined in: [mcp/tools/coordination.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L131) + +Raise a `finding` on the bus from outside the settle hook — the seam an ONLINE detector + (mid-run, on the worker pipe) uses to tell the driver "this worker is looping/erroring" the + moment it happens, instead of only at settle. Queued for `await_event` + pass-through. + +###### Parameters + +###### finding + +`AnalystFindingEvent` + +###### Returns + +`Promise`\<`void`\> + +*** + +### TraceContext + +Defined in: [mcp/trace-propagation.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/trace-propagation.ts#L24) + +#### Properties + +##### traceId + +> **traceId**: `string` + +Defined in: [mcp/trace-propagation.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/trace-propagation.ts#L26) + +Trace id inherited from the parent process, or a fresh one. + +##### parentSpanId? + +> `optional` **parentSpanId?**: `string` + +Defined in: [mcp/trace-propagation.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/trace-propagation.ts#L28) + +Parent span id from the delegation that launched this MCP server. + +*** + +### DelegateCodeConfig + +Defined in: [mcp/types.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L34) + +**`Experimental`** + +Minimal `CoderTask` overrides exposed over the MCP wire. The full +`CoderTask` carries fields the kernel synthesizes from `goal` + +`repoRoot` — the agent only edits the few that materially gate +validator behavior. + +#### Properties + +##### testCmd? + +> `optional` **testCmd?**: `string` + +Defined in: [mcp/types.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L35) + +**`Experimental`** + +##### typecheckCmd? + +> `optional` **typecheckCmd?**: `string` + +Defined in: [mcp/types.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L36) + +**`Experimental`** + +##### forbiddenPaths? + +> `optional` **forbiddenPaths?**: `string`[] + +Defined in: [mcp/types.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L37) + +**`Experimental`** + +##### maxDiffLines? + +> `optional` **maxDiffLines?**: `number` + +Defined in: [mcp/types.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L38) + +**`Experimental`** + +*** + +### DelegateCodeArgs + +Defined in: [mcp/types.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L42) + +**`Experimental`** + +#### Properties + +##### goal + +> **goal**: `string` + +Defined in: [mcp/types.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L44) + +**`Experimental`** + +Natural-language description of what the coder must accomplish. + +##### repoRoot + +> **repoRoot**: `string` + +Defined in: [mcp/types.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L46) + +**`Experimental`** + +Absolute path inside the sandbox where the repo lives. + +##### contextHint? + +> `optional` **contextHint?**: `string` + +Defined in: [mcp/types.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L48) + +**`Experimental`** + +Optional free-form context the agent surfaces in the prompt prelude. + +##### variants? + +> `optional` **variants?**: `number` + +Defined in: [mcp/types.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L54) + +**`Experimental`** + +When > 1, dispatches `multiHarnessCoderFanout` across N harnesses +(claude-code, codex, opencode-glm) and picks the highest-scoring +passing patch. Default 1. + +##### config? + +> `optional` **config?**: [`DelegateCodeConfig`](#delegatecodeconfig) + +Defined in: [mcp/types.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L56) + +**`Experimental`** + +Validator + prompt overrides the agent knows for this repo. + +##### namespace? + +> `optional` **namespace?**: `string` + +Defined in: [mcp/types.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L58) + +**`Experimental`** + +Multi-tenant scope (customer-id, workspace-id). + +*** + +### DelegateCodeResult + +Defined in: [mcp/types.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L62) + +**`Experimental`** + +#### Properties + +##### taskId + +> **taskId**: `string` + +Defined in: [mcp/types.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L63) + +**`Experimental`** + +##### estimatedDurationMs? + +> `optional` **estimatedDurationMs?**: `number` + +Defined in: [mcp/types.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L65) + +**`Experimental`** + +Best-effort hint — coder loops can take minutes-to-hours. + +*** + +### DelegateResearchConfig + +Defined in: [mcp/types.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L72) + +**`Experimental`** + +#### Properties + +##### recencyWindow? + +> `optional` **recencyWindow?**: `object` + +Defined in: [mcp/types.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L73) + +**`Experimental`** + +###### since? + +> `optional` **since?**: `string` + +###### until? + +> `optional` **until?**: `string` + +##### maxItems? + +> `optional` **maxItems?**: `number` + +Defined in: [mcp/types.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L74) + +**`Experimental`** + +##### minConfidence? + +> `optional` **minConfidence?**: `number` + +Defined in: [mcp/types.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L75) + +**`Experimental`** + +*** + +### DelegateResearchArgs + +Defined in: [mcp/types.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L79) + +**`Experimental`** + +#### Properties + +##### question + +> **question**: `string` + +Defined in: [mcp/types.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L80) + +**`Experimental`** + +##### namespace + +> **namespace**: `string` + +Defined in: [mcp/types.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L81) + +**`Experimental`** + +##### scope? + +> `optional` **scope?**: `string` + +Defined in: [mcp/types.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L82) + +**`Experimental`** + +##### sources? + +> `optional` **sources?**: [`ResearchSource`](#researchsource)[] + +Defined in: [mcp/types.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L83) + +**`Experimental`** + +##### variants? + +> `optional` **variants?**: `number` + +Defined in: [mcp/types.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L84) + +**`Experimental`** + +##### config? + +> `optional` **config?**: [`DelegateResearchConfig`](#delegateresearchconfig) + +Defined in: [mcp/types.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L85) + +**`Experimental`** + +*** + +### DelegateResearchResult + +Defined in: [mcp/types.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L89) + +**`Experimental`** + +#### Properties + +##### taskId + +> **taskId**: `string` + +Defined in: [mcp/types.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L90) + +**`Experimental`** + +##### estimatedDurationMs? + +> `optional` **estimatedDurationMs?**: `number` + +Defined in: [mcp/types.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L91) + +**`Experimental`** + +*** + +### FeedbackRefersTo + +Defined in: [mcp/types.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L95) + +**`Experimental`** + +#### Properties + +##### kind + +> **kind**: `"artifact"` \| `"delegation"` \| `"outcome"` + +Defined in: [mcp/types.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L96) + +**`Experimental`** + +##### ref + +> **ref**: `string` + +Defined in: [mcp/types.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L98) + +**`Experimental`** + +For `'delegation'`, this is the taskId. + +*** + +### FeedbackRating + +Defined in: [mcp/types.ts:102](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L102) + +**`Experimental`** + +#### Properties + +##### score + +> **score**: `number` + +Defined in: [mcp/types.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L104) + +**`Experimental`** + +[0, 1]. + +##### label? + +> `optional` **label?**: `"good"` \| `"bad"` \| `"neutral"` \| `"mixed"` + +Defined in: [mcp/types.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L105) + +**`Experimental`** + +##### notes + +> **notes**: `string` + +Defined in: [mcp/types.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L106) + +**`Experimental`** + +*** + +### DelegateFeedbackArgs + +Defined in: [mcp/types.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L110) + +**`Experimental`** + +#### Properties + +##### refersTo + +> **refersTo**: [`FeedbackRefersTo`](#feedbackrefersto) + +Defined in: [mcp/types.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L111) + +**`Experimental`** + +##### rating + +> **rating**: [`FeedbackRating`](#feedbackrating) + +Defined in: [mcp/types.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L112) + +**`Experimental`** + +##### by + +> **by**: `"user"` \| `"agent"` \| `"downstream-judge"` + +Defined in: [mcp/types.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L113) + +**`Experimental`** + +##### capturedAt? + +> `optional` **capturedAt?**: `string` + +Defined in: [mcp/types.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L115) + +**`Experimental`** + +ISO timestamp; defaults to server clock when omitted. + +##### namespace? + +> `optional` **namespace?**: `string` + +Defined in: [mcp/types.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L116) + +**`Experimental`** + +*** + +### DelegateFeedbackResult + +Defined in: [mcp/types.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L120) + +**`Experimental`** + +#### Properties + +##### recorded + +> **recorded**: `true` + +Defined in: [mcp/types.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L121) + +**`Experimental`** + +##### id + +> **id**: `string` + +Defined in: [mcp/types.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L122) + +**`Experimental`** + +*** + +### DelegationStatusArgs + +Defined in: [mcp/types.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L126) + +**`Experimental`** + +#### Properties + +##### taskId + +> **taskId**: `string` + +Defined in: [mcp/types.ts:127](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L127) + +**`Experimental`** + +##### includeTrace? + +> `optional` **includeTrace?**: `boolean` + +Defined in: [mcp/types.ts:134](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L134) + +**`Experimental`** + +Return the delegation's compact loop-trace span tree alongside the +status. Default false — status polls stay light; opt in when you need +the topology (which iterations ran, where they were placed, what each +cost) rather than just the state machine. + +*** + +### DelegationProgress + +Defined in: [mcp/types.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L138) + +**`Experimental`** + +#### Properties + +##### iteration + +> **iteration**: `number` + +Defined in: [mcp/types.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L139) + +**`Experimental`** + +##### phase + +> **phase**: `string` + +Defined in: [mcp/types.ts:140](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L140) + +**`Experimental`** + +*** + +### DelegationError + +Defined in: [mcp/types.ts:144](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L144) + +**`Experimental`** + +#### Properties + +##### message + +> **message**: `string` + +Defined in: [mcp/types.ts:145](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L145) + +**`Experimental`** + +##### kind + +> **kind**: `string` + +Defined in: [mcp/types.ts:146](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L146) + +**`Experimental`** + +*** + +### UiAuditorDelegationOutput + +Defined in: [mcp/types.ts:170](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L170) + +**`Experimental`** + +Wire-shape of a completed UI-audit delegation. The `findings` array +contains every finding persisted to the workspace during the run, +already enriched with `id` and `createdAt` by the writer. `workspaceDir` +is the absolute path to the workspace; `indexFile` is the workspace- +relative path to the regenerated index.md. + +#### Properties + +##### workspaceDir + +> **workspaceDir**: `string` + +Defined in: [mcp/types.ts:171](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L171) + +**`Experimental`** + +##### indexFile + +> **indexFile**: `string` + +Defined in: [mcp/types.ts:172](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L172) + +**`Experimental`** + +##### findings + +> **findings**: [`UiFinding`](profiles.md#uifinding)[] + +Defined in: [mcp/types.ts:173](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L173) + +**`Experimental`** + +##### iterations + +> **iterations**: `number` + +Defined in: [mcp/types.ts:175](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L175) + +**`Experimental`** + +Total iterations the loop ran for this delegation. + +*** + +### DelegateUiAuditRoute + +Defined in: [mcp/types.ts:182](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L182) + +Optional per-route capture spec the agent surfaces over the wire. + +#### Properties + +##### name + +> **name**: `string` + +Defined in: [mcp/types.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L184) + +Stable route name (used in screenshot filenames + finding metadata). + +##### url + +> **url**: `string` + +Defined in: [mcp/types.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L186) + +Fully-qualified URL. + +##### viewports? + +> `optional` **viewports?**: readonly `object`[] + +Defined in: [mcp/types.ts:188](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L188) + +Viewports to capture at. Defaults to `[{ width: 1280, height: 800 }]`. + +##### fullPage? + +> `optional` **fullPage?**: `boolean` + +Defined in: [mcp/types.ts:190](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L190) + +Default false. Full-page captures for the broad lenses. + +##### waitFor? + +> `optional` **waitFor?**: `string` + +Defined in: [mcp/types.ts:192](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L192) + +Selector to wait for before capture. + +*** + +### DelegateUiAuditConfig + +Defined in: [mcp/types.ts:196](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L196) + +**`Experimental`** + +#### Properties + +##### lenses? + +> `optional` **lenses?**: `UiAuditLensFilter` + +Defined in: [mcp/types.ts:201](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L201) + +**`Experimental`** + +Lenses to iterate. Default: every lens except `'other'`. Order is +preserved — the driver iterates lens-by-lens. + +##### maxIterations? + +> `optional` **maxIterations?**: `number` + +Defined in: [mcp/types.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L203) + +**`Experimental`** + +Maximum total iterations across all (lens × route) pairs. Default 33 (11 lenses × 3 routes). + +##### maxConcurrency? + +> `optional` **maxConcurrency?**: `number` + +Defined in: [mcp/types.ts:205](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L205) + +**`Experimental`** + +Maximum concurrent iterations within a single plan() round. Default 2. + +##### productContext? + +> `optional` **productContext?**: `string` + +Defined in: [mcp/types.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L207) + +**`Experimental`** + +Free-form product context surfaced to the judge. + +*** + +### DelegateUiAuditArgs + +Defined in: [mcp/types.ts:211](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L211) + +**`Experimental`** + +#### Properties + +##### workspaceDir + +> **workspaceDir**: `string` + +Defined in: [mcp/types.ts:213](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L213) + +**`Experimental`** + +Workspace root for the audit (absolute path). + +##### routes + +> **routes**: readonly [`DelegateUiAuditRoute`](#delegateuiauditroute)[] + +Defined in: [mcp/types.ts:215](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L215) + +**`Experimental`** + +Routes to audit. Must be non-empty. + +##### namespace? + +> `optional` **namespace?**: `string` + +Defined in: [mcp/types.ts:217](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L217) + +**`Experimental`** + +Multi-tenant scope. + +##### config? + +> `optional` **config?**: [`DelegateUiAuditConfig`](#delegateuiauditconfig) + +Defined in: [mcp/types.ts:218](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L218) + +**`Experimental`** + +*** + +### DelegateUiAuditResult + +Defined in: [mcp/types.ts:222](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L222) + +**`Experimental`** + +#### Properties + +##### taskId + +> **taskId**: `string` + +Defined in: [mcp/types.ts:223](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L223) + +**`Experimental`** + +##### estimatedDurationMs? + +> `optional` **estimatedDurationMs?**: `number` + +Defined in: [mcp/types.ts:224](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L224) + +**`Experimental`** + +*** + +### ResearchOutputShape + +Defined in: [mcp/types.ts:234](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L234) + +**`Experimental`** + +Loose shape of a research output over the wire — the substrate cannot +import the `ResearchOutput` type from agent-knowledge without inducing +a dependency cycle, so the MCP layer treats it structurally. + +#### Indexable + +> \[`key`: `string`\]: `unknown` +**`Experimental`** + +#### Properties + +##### items + +> **items**: `unknown`[] + +Defined in: [mcp/types.ts:235](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L235) + +**`Experimental`** + +##### citations + +> **citations**: `unknown`[] + +Defined in: [mcp/types.ts:236](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L236) + +**`Experimental`** + +##### proposedWrites + +> **proposedWrites**: `unknown`[] + +Defined in: [mcp/types.ts:237](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L237) + +**`Experimental`** + +##### gaps? + +> `optional` **gaps?**: `string`[] + +Defined in: [mcp/types.ts:238](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L238) + +**`Experimental`** + +##### notes? + +> `optional` **notes?**: `string` + +Defined in: [mcp/types.ts:239](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L239) + +**`Experimental`** + +*** + +### DelegationStatusResult + +Defined in: [mcp/types.ts:244](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L244) + +**`Experimental`** + +#### Properties + +##### taskId + +> **taskId**: `string` + +Defined in: [mcp/types.ts:245](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L245) + +**`Experimental`** + +##### profile + +> **profile**: [`DelegationProfile`](#delegationprofile) + +Defined in: [mcp/types.ts:246](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L246) + +**`Experimental`** + +##### status + +> **status**: [`DelegationStatus`](#delegationstatus) + +Defined in: [mcp/types.ts:247](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L247) + +**`Experimental`** + +##### progress? + +> `optional` **progress?**: [`DelegationProgress`](#delegationprogress) + +Defined in: [mcp/types.ts:248](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L248) + +**`Experimental`** + +##### result? + +> `optional` **result?**: [`DelegationResultPayload`](#delegationresultpayload) + +Defined in: [mcp/types.ts:249](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L249) + +**`Experimental`** + +##### error? + +> `optional` **error?**: [`DelegationError`](#delegationerror) + +Defined in: [mcp/types.ts:250](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L250) + +**`Experimental`** + +##### costUsd? + +> `optional` **costUsd?**: `number` + +Defined in: [mcp/types.ts:251](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L251) + +**`Experimental`** + +##### startedAt + +> **startedAt**: `string` + +Defined in: [mcp/types.ts:252](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L252) + +**`Experimental`** + +##### completedAt? + +> `optional` **completedAt?**: `string` + +Defined in: [mcp/types.ts:253](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L253) + +**`Experimental`** + +##### trace? + +> `optional` **trace?**: [`DelegationTraceSpan`](#delegationtracespan)[] + +Defined in: [mcp/types.ts:255](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L255) + +**`Experimental`** + +Compact loop-trace span tree; present only when `includeTrace: true` was passed and spans were recorded. + +##### traceTruncated? + +> `optional` **traceTruncated?**: `true` + +Defined in: [mcp/types.ts:257](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L257) + +**`Experimental`** + +Present when oldest trace spans were dropped to honor the trace caps. + +##### traceId? + +> `optional` **traceId?**: `string` + +Defined in: [mcp/types.ts:259](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L259) + +**`Experimental`** + +Inherited trace identity recorded at submit — join key into the caller's trace. + +##### parentSpanId? + +> `optional` **parentSpanId?**: `string` + +Defined in: [mcp/types.ts:261](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L261) + +**`Experimental`** + +Caller span that dispatched the delegation, when one was inherited. + +*** + +### DelegationHistoryArgs + +Defined in: [mcp/types.ts:265](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L265) + +**`Experimental`** + +#### Properties + +##### namespace? + +> `optional` **namespace?**: `string` + +Defined in: [mcp/types.ts:266](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L266) + +**`Experimental`** + +##### profile? + +> `optional` **profile?**: [`DelegationProfile`](#delegationprofile) + +Defined in: [mcp/types.ts:267](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L267) + +**`Experimental`** + +##### since? + +> `optional` **since?**: `string` + +Defined in: [mcp/types.ts:269](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L269) + +**`Experimental`** + +ISO date — only delegations started at-or-after `since` are returned. + +##### limit? + +> `optional` **limit?**: `number` + +Defined in: [mcp/types.ts:271](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L271) + +**`Experimental`** + +Default 50. Hard cap 500. + +*** + +### DelegationFeedbackSnapshot + +Defined in: [mcp/types.ts:275](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L275) + +**`Experimental`** + +#### Properties + +##### id + +> **id**: `string` + +Defined in: [mcp/types.ts:276](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L276) + +**`Experimental`** + +##### score + +> **score**: `number` + +Defined in: [mcp/types.ts:277](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L277) + +**`Experimental`** + +##### label? + +> `optional` **label?**: `"good"` \| `"bad"` \| `"neutral"` \| `"mixed"` + +Defined in: [mcp/types.ts:278](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L278) + +**`Experimental`** + +##### by + +> **by**: `"user"` \| `"agent"` \| `"downstream-judge"` + +Defined in: [mcp/types.ts:279](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L279) + +**`Experimental`** + +##### notes + +> **notes**: `string` + +Defined in: [mcp/types.ts:280](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L280) + +**`Experimental`** + +##### capturedAt + +> **capturedAt**: `string` + +Defined in: [mcp/types.ts:281](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L281) + +**`Experimental`** + +*** + +### DelegationHistoryEntry + +Defined in: [mcp/types.ts:285](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L285) + +**`Experimental`** + +#### Properties + +##### taskId + +> **taskId**: `string` + +Defined in: [mcp/types.ts:286](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L286) + +**`Experimental`** + +##### profile + +> **profile**: [`DelegationProfile`](#delegationprofile) + +Defined in: [mcp/types.ts:287](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L287) + +**`Experimental`** + +##### namespace? + +> `optional` **namespace?**: `string` + +Defined in: [mcp/types.ts:288](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L288) + +**`Experimental`** + +##### args + +> **args**: [`DelegateCodeArgs`](#delegatecodeargs) \| [`DelegateResearchArgs`](#delegateresearchargs) \| [`DelegateUiAuditArgs`](#delegateuiauditargs) + +Defined in: [mcp/types.ts:289](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L289) + +**`Experimental`** + +##### status + +> **status**: [`DelegationStatus`](#delegationstatus) + +Defined in: [mcp/types.ts:290](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L290) + +**`Experimental`** + +##### feedback? + +> `optional` **feedback?**: [`DelegationFeedbackSnapshot`](#delegationfeedbacksnapshot)[] + +Defined in: [mcp/types.ts:291](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L291) + +**`Experimental`** + +##### costUsd? + +> `optional` **costUsd?**: `number` + +Defined in: [mcp/types.ts:292](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L292) + +**`Experimental`** + +##### startedAt + +> **startedAt**: `string` + +Defined in: [mcp/types.ts:293](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L293) + +**`Experimental`** + +##### completedAt? + +> `optional` **completedAt?**: `string` + +Defined in: [mcp/types.ts:294](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L294) + +**`Experimental`** + +##### hasTrace + +> **hasTrace**: `boolean` + +Defined in: [mcp/types.ts:300](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L300) + +**`Experimental`** + +True when the record carries a journaled loop trace. History stays +light by design — fetch the spans via +`delegation_status { taskId, includeTrace: true }`. + +##### traceId? + +> `optional` **traceId?**: `string` + +Defined in: [mcp/types.ts:302](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L302) + +**`Experimental`** + +Inherited trace identity recorded at submit — join key into the caller's trace. + +*** + +### DelegationHistoryResult + +Defined in: [mcp/types.ts:306](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L306) + +**`Experimental`** + +#### Properties + +##### delegations + +> **delegations**: [`DelegationHistoryEntry`](#delegationhistoryentry)[] + +Defined in: [mcp/types.ts:307](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L307) + +**`Experimental`** + +*** + +### WorktreeHandle + +Defined in: [mcp/worktree.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L21) + +**`Experimental`** + +#### Properties + +##### path + +> **path**: `string` + +Defined in: [mcp/worktree.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L23) + +**`Experimental`** + +Absolute path to the worktree directory. + +##### baseSha + +> **baseSha**: `string` + +Defined in: [mcp/worktree.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L25) + +**`Experimental`** + +SHA the worktree was created at. + +##### branch + +> **branch**: `string` + +Defined in: [mcp/worktree.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L27) + +**`Experimental`** + +Branch name created for this worktree (typically `delegate/`). + +*** + +### CreateWorktreeOptions + +Defined in: [mcp/worktree.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L31) + +**`Experimental`** + +#### Properties + +##### repoRoot + +> **repoRoot**: `string` + +Defined in: [mcp/worktree.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L33) + +**`Experimental`** + +Absolute path to the main git checkout. + +##### runId + +> **runId**: `string` + +Defined in: [mcp/worktree.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L35) + +**`Experimental`** + +Unique id for the worktree path + branch. Use the delegation run id. + +##### variantsDir? + +> `optional` **variantsDir?**: `string` + +Defined in: [mcp/worktree.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L37) + +**`Experimental`** + +Parent directory the worktree lives under. Defaults to `.agent-worktrees`. + +##### baseRef? + +> `optional` **baseRef?**: `string` + +Defined in: [mcp/worktree.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L39) + +**`Experimental`** + +Override the base ref (default `HEAD`). + +##### runGit? + +> `optional` **runGit?**: [`GitRunner`](#gitrunner) + +Defined in: [mcp/worktree.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L41) + +**`Experimental`** + +Test seam — inject a custom git runner. + +*** + +### DiffOptions + +Defined in: [mcp/worktree.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L45) + +**`Experimental`** + +#### Properties + +##### worktree + +> **worktree**: [`WorktreeHandle`](#worktreehandle) + +Defined in: [mcp/worktree.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L47) + +**`Experimental`** + +Worktree to diff. + +##### baseRef? + +> `optional` **baseRef?**: `string` + +Defined in: [mcp/worktree.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L49) + +**`Experimental`** + +What to compare against. Default `worktree.baseSha`. + +##### runGit? + +> `optional` **runGit?**: [`GitRunner`](#gitrunner) + +Defined in: [mcp/worktree.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L51) + +**`Experimental`** + +Test seam. + +*** + +### DiffResult + +Defined in: [mcp/worktree.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L55) + +**`Experimental`** + +#### Properties + +##### patch + +> **patch**: `string` + +Defined in: [mcp/worktree.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L56) + +**`Experimental`** + +##### stats + +> **stats**: `object` + +Defined in: [mcp/worktree.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L57) + +**`Experimental`** + +###### filesChanged + +> **filesChanged**: `number` + +###### insertions + +> **insertions**: `number` + +###### deletions + +> **deletions**: `number` + +*** + +### RemoveWorktreeOptions + +Defined in: [mcp/worktree.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L65) + +**`Experimental`** + +#### Properties + +##### worktree + +> **worktree**: [`WorktreeHandle`](#worktreehandle) + +Defined in: [mcp/worktree.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L66) + +**`Experimental`** + +##### repoRoot + +> **repoRoot**: `string` + +Defined in: [mcp/worktree.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L67) + +**`Experimental`** + +##### force? + +> `optional` **force?**: `boolean` + +Defined in: [mcp/worktree.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L69) + +**`Experimental`** + +Force removal even if dirty (default true; the loser of a fanout has uncommitted changes). + +##### runGit? + +> `optional` **runGit?**: [`GitRunner`](#gitrunner) + +Defined in: [mcp/worktree.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L71) + +**`Experimental`** + +Test seam. + +## Type Aliases + +### CoderDelegate + +> **CoderDelegate** = (`args`, `ctx`) => `Promise`\<`CoderOutput`\> + +Defined in: [mcp/delegates.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L88) + +**`Experimental`** + +The server's coder-profile delegate slot — the closure the queue invokes for a + `delegate_code` task. `detachedSessionDelegate` is the built-in implementation. + +#### Parameters + +##### args + +[`DelegateCodeArgs`](#delegatecodeargs) + +##### ctx + +[`DelegateRunCtx`](#delegaterunctx) + +#### Returns + +`Promise`\<`CoderOutput`\> + +*** + +### ResearcherDelegate + +> **ResearcherDelegate** = (`args`, `ctx`) => `Promise`\<[`ResearchOutputShape`](#researchoutputshape)\> + +Defined in: [mcp/delegates.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L91) + +**`Experimental`** + +#### Parameters + +##### args + +[`DelegateResearchArgs`](#delegateresearchargs) + +##### ctx + +[`DelegateRunCtx`](#delegaterunctx) + +#### Returns + +`Promise`\<[`ResearchOutputShape`](#researchoutputshape)\> + +*** + +### UiAuditorDelegate + +> **UiAuditorDelegate** = (`args`, `ctx`) => `Promise`\<[`UiAuditorDelegationOutput`](#uiauditordelegationoutput)\> + +Defined in: [mcp/delegates.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L105) + +**`Experimental`** + +UI-auditor delegate — fully consumer-injected. agent-runtime ships no +default factory because the inputs are workspace path + judge function ++ (optionally) a `SandboxClient`, and the judge is the consumer's +model seam. See `createInProcessUiAuditClient` + `uiAuditorProfile` in +`@tangle-network/agent-runtime/profiles` for the canonical wiring. + +#### Parameters + +##### args + +[`DelegateUiAuditArgs`](#delegateuiauditargs) + +##### ctx + +[`DelegateRunCtx`](#delegaterunctx) + +#### Returns + +`Promise`\<[`UiAuditorDelegationOutput`](#uiauditordelegationoutput)\> + +*** + +### CoderReviewer + +> **CoderReviewer** = (`output`, `task`, `ctx`) => `Promise`\<[`CoderReview`](#coderreview)\> \| [`CoderReview`](#coderreview) + +Defined in: [mcp/delegates.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L130) + +**`Experimental`** + +Optional adversarial reviewer over a coder candidate that already passed +mechanical validation (tests/typecheck/forbidden/diff/no-op/secrets). Folded +from the ai-trading-blueprint delegation MCP: a candidate is only eligible to +win if the reviewer approves it. The reviewer is the consumer's seam — an LLM +judge, a `pnpm review` command, anything returning a `CoderReview`. + +#### Parameters + +##### output + +`CoderOutput` + +##### task + +[`CoderTask`](profiles.md#codertask) + +##### ctx + +###### signal + +`AbortSignal` + +#### Returns + +`Promise`\<[`CoderReview`](#coderreview)\> \| [`CoderReview`](#coderreview) + +*** + +### DetachedWinnerSelection + +> **DetachedWinnerSelection** = `"highest-score"` \| `"smallest-diff"` \| `"highest-readiness"` \| `"first-approved"` + +Defined in: [mcp/delegates.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L143) + +**`Experimental`** + +Winner-selection strategy among validated (+ reviewed) candidates on the +sandbox-session path. The base strategies (`highest-score` / `smallest-diff` / +`first-approved`) delegate to the shared `selectValidWinner`; `highest-readiness` is the +reviewer-only strategy this path keeps that the generic selector does not express. Default +`highest-score`. + +*** + +### DriveTurnTick + +> **DriveTurnTick** = \{ `state`: `"completed"`; `text`: `string`; `result`: `Record`\<`string`, `unknown`\>; \} \| \{ `state`: `"running"`; `startedAt?`: `Date`; `elapsedMs?`: `number`; \} \| \{ `state`: `"failed"`; `error`: `string`; \} + +Defined in: [mcp/detached-turn.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L53) + +**`Experimental`** + +Structural mirror of the sandbox SDK's `TurnDriveResult` (>= 0.6). +Discriminated on `state`; `failed` is terminal and deterministic per the +SDK contract — re-invoking with the same ids returns the same outcome. + +*** + +### LocalHarness + +> **LocalHarness** = `"claude"` \| `"codex"` \| `"opencode"` + +Defined in: [mcp/local-harness.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L23) + +Local coding harness available inside the sandbox. + +*** + +### DelegationResumeTick + +> **DelegationResumeTick** = \{ `state`: `"running"`; \} \| \{ `state`: `"completed"`; `output`: [`DelegationResultPayload`](#delegationresultpayload)\[`"output"`\]; `costUsd?`: `number`; \} \| \{ `state`: `"failed"`; `error`: [`DelegationError`](#delegationerror); \} + +Defined in: [mcp/task-queue.ts:171](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L171) + +**`Experimental`** + +One observation of a detached run, mapped 1:1 from a single-tick driver +(e.g. the sandbox SDK's `driveTurn`, which reports +completed | running | failed per pass). `running` schedules another tick +after `intervalMs`; `completed` / `failed` settle the record. + +*** + +### QuestionDecision + +> **QuestionDecision** = \{ `kind`: `"answer"`; `answer`: `string`; `by`: `string`; \} \| \{ `kind`: `"defer"`; `reason`: `string`; \} \| \{ `kind`: `"escalate"`; `to`: `"parent"` \| `"user"` \| `string`; `reason`: `string`; \} + +Defined in: [mcp/tools/coordination.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L48) + +*** + +### QuestionPolicy + +> **QuestionPolicy** = `"auto"` \| `"mustDecide"` \| `"bubble"` \| `"failClosed"` + +Defined in: [mcp/tools/coordination.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L60) + +*** + +### CoordinationEvent + +> **CoordinationEvent** = \{ `type`: `"question"`; `question`: [`QuestionRecord`](#questionrecord); \} \| \{ `type`: `"settled"`; `worker`: [`SettledWorker`](#settledworker); \} \| \{ `type`: `"finding"`; `finding`: `AnalystFindingEvent`; \} \| \{ `type`: `"steer"`; `down`: `DownMessageEvent`; \} \| \{ `type`: `"answer"`; `down`: `DownMessageEvent`; `questionId`: `string`; \} + +Defined in: [mcp/tools/coordination.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L85) + +Every message on the one typed pipe. UP (child→parent): question / settled / finding — queued for + the driver to `pull`. DOWN (parent→child): steer / answer — record-only (history + subscribers), + routed to the child inbox. New kinds are additive. + +*** + +### MakeWorkerAgent + +> **MakeWorkerAgent** = (`profile`) => [`Agent`](runtime.md#agent)\<`unknown`, `unknown`\> + +Defined in: [mcp/tools/coordination.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L92) + +#### Parameters + +##### profile + +`unknown` + +#### Returns + +[`Agent`](runtime.md#agent)\<`unknown`, `unknown`\> + +*** + +### DelegationProfile + +> **DelegationProfile** = `"coder"` \| `"researcher"` \| `"ui-auditor"` + +Defined in: [mcp/types.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L21) + +**`Experimental`** + +*** + +### DelegationStatus + +> **DelegationStatus** = `"pending"` \| `"running"` \| `"completed"` \| `"failed"` \| `"cancelled"` + +Defined in: [mcp/types.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L24) + +**`Experimental`** + +*** + +### ResearchSource + +> **ResearchSource** = `"web"` \| `"corpus"` \| `"twitter"` \| `"github"` \| `"docs"` + +Defined in: [mcp/types.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L69) + +**`Experimental`** + +*** + +### DelegationResultPayload + +> **DelegationResultPayload** = \{ `profile`: `"coder"`; `output`: `CoderOutput`; \} \| \{ `profile`: `"researcher"`; `output`: [`ResearchOutputShape`](#researchoutputshape); \} \| \{ `profile`: `"ui-auditor"`; `output`: [`UiAuditorDelegationOutput`](#uiauditordelegationoutput); \} + +Defined in: [mcp/types.ts:156](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L156) + +**`Experimental`** + +Polymorphic `result` field: `CoderOutput` when the underlying profile +is `'coder'`, a structurally-typed research output when `'researcher'`. +The MCP wire carries it as JSON either way. + +*** + +### GitRunner + +> **GitRunner** = (`args`, `opts`) => `object` + +Defined in: [mcp/worktree.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L75) + +Pluggable git runner (sync) — replaceable in tests. + +#### Parameters + +##### args + +`ReadonlyArray`\<`string`\> + +##### opts + +###### cwd + +`string` + +#### Returns + +`object` + +##### stdout + +> **stdout**: `string` + +##### stderr + +> **stderr**: `string` + +##### exitCode + +> **exitCode**: `number` + +## Variables + +### DELEGATION\_MCP\_SERVER\_KEY + +> `const` **DELEGATION\_MCP\_SERVER\_KEY**: `"agent-runtime-delegation"` = `'agent-runtime-delegation'` + +Defined in: [mcp/delegation-profile.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L32) + +MCP server key under which the agent-runtime delegation tools mount. + +*** + +### DELEGATION\_TRACE\_MAX\_SPANS + +> `const` **DELEGATION\_TRACE\_MAX\_SPANS**: `512` = `512` + +Defined in: [mcp/delegation-trace.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L45) + +**`Experimental`** + +Default cap on spans retained per delegation record. + +*** + +### DELEGATION\_TRACE\_MAX\_BYTES + +> `const` **DELEGATION\_TRACE\_MAX\_BYTES**: `number` + +Defined in: [mcp/delegation-trace.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L48) + +**`Experimental`** + +Default cap on the serialized trace payload per record, in bytes. + +*** + +### defaultChecks + +> `const` **defaultChecks**: `Record`\<`string`, [`Check`](#check)\> + +Defined in: [mcp/tools/checks.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L93) + +The built-in lens directory. Domain-blind (about any agent trace); compose at test time. + +*** + +### DELEGATE\_CODE\_TOOL\_NAME + +> `const` **DELEGATE\_CODE\_TOOL\_NAME**: `"delegate_code"` = `'delegate_code'` + +Defined in: [mcp/tools/delegate-code.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-code.ts#L19) + +**`Experimental`** + +*** + +### DELEGATE\_CODE\_DESCRIPTION + +> `const` **DELEGATE\_CODE\_DESCRIPTION**: `string` + +Defined in: [mcp/tools/delegate-code.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-code.ts#L22) + +**`Experimental`** + +*** + +### DELEGATE\_CODE\_INPUT\_SCHEMA + +> `const` **DELEGATE\_CODE\_INPUT\_SCHEMA**: `object` + +Defined in: [mcp/tools/delegate-code.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-code.ts#L46) + +**`Experimental`** + +#### Type Declaration + +##### type + +> `readonly` **type**: `"object"` = `'object'` + +##### properties + +> `readonly` **properties**: `object` + +###### properties.goal + +> `readonly` **goal**: `object` + +###### properties.goal.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.goal.description + +> `readonly` **description**: `"Natural-language description of what the coder must accomplish."` = `'Natural-language description of what the coder must accomplish.'` + +###### properties.repoRoot + +> `readonly` **repoRoot**: `object` + +###### properties.repoRoot.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.repoRoot.description + +> `readonly` **description**: `"Absolute path inside the sandbox where the repo lives."` = `'Absolute path inside the sandbox where the repo lives.'` + +###### properties.contextHint + +> `readonly` **contextHint**: `object` + +###### properties.contextHint.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.contextHint.description + +> `readonly` **description**: `"Optional free-form context the coder sees in the prompt prelude."` = `'Optional free-form context the coder sees in the prompt prelude.'` + +###### properties.variants + +> `readonly` **variants**: `object` + +###### properties.variants.type + +> `readonly` **type**: `"integer"` = `'integer'` + +###### properties.variants.minimum + +> `readonly` **minimum**: `1` = `1` + +###### properties.variants.maximum + +> `readonly` **maximum**: `8` = `8` + +###### properties.variants.description + +> `readonly` **description**: `"Number of parallel coder harnesses. Default 1."` = `'Number of parallel coder harnesses. Default 1.'` + +###### properties.config + +> `readonly` **config**: `object` + +###### properties.config.type + +> `readonly` **type**: `"object"` = `'object'` + +###### properties.config.properties + +> `readonly` **properties**: `object` + +###### properties.config.properties.testCmd + +> `readonly` **testCmd**: `object` + +###### properties.config.properties.testCmd.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.config.properties.typecheckCmd + +> `readonly` **typecheckCmd**: `object` + +###### properties.config.properties.typecheckCmd.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.config.properties.forbiddenPaths + +> `readonly` **forbiddenPaths**: `object` + +###### properties.config.properties.forbiddenPaths.type + +> `readonly` **type**: `"array"` = `'array'` + +###### properties.config.properties.forbiddenPaths.items + +> `readonly` **items**: `object` + +###### properties.config.properties.forbiddenPaths.items.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.config.properties.maxDiffLines + +> `readonly` **maxDiffLines**: `object` + +###### properties.config.properties.maxDiffLines.type + +> `readonly` **type**: `"integer"` = `'integer'` + +###### properties.config.properties.maxDiffLines.minimum + +> `readonly` **minimum**: `1` = `1` + +###### properties.config.additionalProperties + +> `readonly` **additionalProperties**: `false` = `false` + +###### properties.namespace + +> `readonly` **namespace**: `object` + +###### properties.namespace.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.namespace.description + +> `readonly` **description**: `"Multi-tenant scope (customer-id, workspace-id)."` = `'Multi-tenant scope (customer-id, workspace-id).'` + +##### required + +> `readonly` **required**: readonly \[`"goal"`, `"repoRoot"`\] + +##### additionalProperties + +> `readonly` **additionalProperties**: `false` = `false` + +*** + +### DELEGATE\_FEEDBACK\_TOOL\_NAME + +> `const` **DELEGATE\_FEEDBACK\_TOOL\_NAME**: `"delegate_feedback"` = `'delegate_feedback'` + +Defined in: [mcp/tools/delegate-feedback.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-feedback.ts#L24) + +**`Experimental`** + +*** + +### DELEGATE\_FEEDBACK\_DESCRIPTION + +> `const` **DELEGATE\_FEEDBACK\_DESCRIPTION**: `string` + +Defined in: [mcp/tools/delegate-feedback.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-feedback.ts#L27) + +**`Experimental`** + +*** + +### DELEGATE\_FEEDBACK\_INPUT\_SCHEMA + +> `const` **DELEGATE\_FEEDBACK\_INPUT\_SCHEMA**: `object` + +Defined in: [mcp/tools/delegate-feedback.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-feedback.ts#L51) + +**`Experimental`** + +#### Type Declaration + +##### type + +> `readonly` **type**: `"object"` = `'object'` + +##### properties + +> `readonly` **properties**: `object` + +###### properties.refersTo + +> `readonly` **refersTo**: `object` + +###### properties.refersTo.type + +> `readonly` **type**: `"object"` = `'object'` + +###### properties.refersTo.properties + +> `readonly` **properties**: `object` + +###### properties.refersTo.properties.kind + +> `readonly` **kind**: `object` + +###### properties.refersTo.properties.kind.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.refersTo.properties.kind.enum + +> `readonly` **enum**: readonly \[`"delegation"`, `"artifact"`, `"outcome"`\] + +###### properties.refersTo.properties.ref + +> `readonly` **ref**: `object` + +###### properties.refersTo.properties.ref.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.refersTo.required + +> `readonly` **required**: readonly \[`"kind"`, `"ref"`\] + +###### properties.refersTo.additionalProperties + +> `readonly` **additionalProperties**: `false` = `false` + +###### properties.rating + +> `readonly` **rating**: `object` + +###### properties.rating.type + +> `readonly` **type**: `"object"` = `'object'` + +###### properties.rating.properties + +> `readonly` **properties**: `object` + +###### properties.rating.properties.score + +> `readonly` **score**: `object` + +###### properties.rating.properties.score.type + +> `readonly` **type**: `"number"` = `'number'` + +###### properties.rating.properties.score.minimum + +> `readonly` **minimum**: `0` = `0` + +###### properties.rating.properties.score.maximum + +> `readonly` **maximum**: `1` = `1` + +###### properties.rating.properties.label + +> `readonly` **label**: `object` + +###### properties.rating.properties.label.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.rating.properties.label.enum + +> `readonly` **enum**: readonly \[`"good"`, `"bad"`, `"neutral"`, `"mixed"`\] + +###### properties.rating.properties.notes + +> `readonly` **notes**: `object` + +###### properties.rating.properties.notes.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.rating.required + +> `readonly` **required**: readonly \[`"score"`, `"notes"`\] + +###### properties.rating.additionalProperties + +> `readonly` **additionalProperties**: `false` = `false` + +###### properties.by + +> `readonly` **by**: `object` + +###### properties.by.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.by.enum + +> `readonly` **enum**: readonly \[`"agent"`, `"user"`, `"downstream-judge"`\] + +###### properties.capturedAt + +> `readonly` **capturedAt**: `object` + +###### properties.capturedAt.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.namespace + +> `readonly` **namespace**: `object` + +###### properties.namespace.type + +> `readonly` **type**: `"string"` = `'string'` + +##### required + +> `readonly` **required**: readonly \[`"refersTo"`, `"rating"`, `"by"`\] + +##### additionalProperties + +> `readonly` **additionalProperties**: `false` = `false` + +*** + +### DELEGATE\_RESEARCH\_TOOL\_NAME + +> `const` **DELEGATE\_RESEARCH\_TOOL\_NAME**: `"delegate_research"` = `'delegate_research'` + +Defined in: [mcp/tools/delegate-research.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-research.ts#L25) + +**`Experimental`** + +*** + +### DELEGATE\_RESEARCH\_DESCRIPTION + +> `const` **DELEGATE\_RESEARCH\_DESCRIPTION**: `string` + +Defined in: [mcp/tools/delegate-research.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-research.ts#L28) + +**`Experimental`** + +*** + +### DELEGATE\_RESEARCH\_INPUT\_SCHEMA + +> `const` **DELEGATE\_RESEARCH\_INPUT\_SCHEMA**: `object` + +Defined in: [mcp/tools/delegate-research.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-research.ts#L52) + +**`Experimental`** + +#### Type Declaration + +##### type + +> `readonly` **type**: `"object"` = `'object'` + +##### properties + +> `readonly` **properties**: `object` + +###### properties.question + +> `readonly` **question**: `object` + +###### properties.question.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.question.description + +> `readonly` **description**: `"The research question to answer."` = `'The research question to answer.'` + +###### properties.namespace + +> `readonly` **namespace**: `object` + +###### properties.namespace.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.namespace.description + +> `readonly` **description**: `"Multi-tenant scope (customer-id, workspace-id). REQUIRED."` = `'Multi-tenant scope (customer-id, workspace-id). REQUIRED.'` + +###### properties.scope + +> `readonly` **scope**: `object` + +###### properties.scope.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.scope.description + +> `readonly` **description**: "Bound, e.g. \"audience for cpg-founder ICP\"." = `'Bound, e.g. "audience for cpg-founder ICP".'` + +###### properties.sources + +> `readonly` **sources**: `object` + +###### properties.sources.type + +> `readonly` **type**: `"array"` = `'array'` + +###### properties.sources.items + +> `readonly` **items**: `object` + +###### properties.sources.items.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.sources.items.enum + +> `readonly` **enum**: readonly [`ResearchSource`](#researchsource)[] + +###### properties.variants + +> `readonly` **variants**: `object` + +###### properties.variants.type + +> `readonly` **type**: `"integer"` = `'integer'` + +###### properties.variants.minimum + +> `readonly` **minimum**: `1` = `1` + +###### properties.variants.maximum + +> `readonly` **maximum**: `8` = `8` + +###### properties.config + +> `readonly` **config**: `object` + +###### properties.config.type + +> `readonly` **type**: `"object"` = `'object'` + +###### properties.config.properties + +> `readonly` **properties**: `object` + +###### properties.config.properties.recencyWindow + +> `readonly` **recencyWindow**: `object` + +###### properties.config.properties.recencyWindow.type + +> `readonly` **type**: `"object"` = `'object'` + +###### properties.config.properties.recencyWindow.properties + +> `readonly` **properties**: `object` + +###### properties.config.properties.recencyWindow.properties.since + +> `readonly` **since**: `object` + +###### properties.config.properties.recencyWindow.properties.since.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.config.properties.recencyWindow.properties.since.description + +> `readonly` **description**: `"ISO datetime"` = `'ISO datetime'` + +###### properties.config.properties.recencyWindow.properties.until + +> `readonly` **until**: `object` + +###### properties.config.properties.recencyWindow.properties.until.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.config.properties.recencyWindow.properties.until.description + +> `readonly` **description**: `"ISO datetime"` = `'ISO datetime'` + +###### properties.config.properties.recencyWindow.additionalProperties + +> `readonly` **additionalProperties**: `false` = `false` + +###### properties.config.properties.maxItems + +> `readonly` **maxItems**: `object` + +###### properties.config.properties.maxItems.type + +> `readonly` **type**: `"integer"` = `'integer'` + +###### properties.config.properties.maxItems.minimum + +> `readonly` **minimum**: `1` = `1` + +###### properties.config.properties.minConfidence + +> `readonly` **minConfidence**: `object` + +###### properties.config.properties.minConfidence.type + +> `readonly` **type**: `"number"` = `'number'` + +###### properties.config.properties.minConfidence.minimum + +> `readonly` **minimum**: `0` = `0` + +###### properties.config.properties.minConfidence.maximum + +> `readonly` **maximum**: `1` = `1` + +###### properties.config.additionalProperties + +> `readonly` **additionalProperties**: `false` = `false` + +##### required + +> `readonly` **required**: readonly \[`"question"`, `"namespace"`\] + +##### additionalProperties + +> `readonly` **additionalProperties**: `false` = `false` + +*** + +### DELEGATE\_UI\_AUDIT\_TOOL\_NAME + +> `const` **DELEGATE\_UI\_AUDIT\_TOOL\_NAME**: `"delegate_ui_audit"` = `'delegate_ui_audit'` + +Defined in: [mcp/tools/delegate-ui-audit.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-ui-audit.ts#L30) + +**`Experimental`** + +*** + +### DELEGATE\_UI\_AUDIT\_DESCRIPTION + +> `const` **DELEGATE\_UI\_AUDIT\_DESCRIPTION**: `string` + +Defined in: [mcp/tools/delegate-ui-audit.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-ui-audit.ts#L33) + +**`Experimental`** + +*** + +### DELEGATE\_UI\_AUDIT\_INPUT\_SCHEMA + +> `const` **DELEGATE\_UI\_AUDIT\_INPUT\_SCHEMA**: `object` + +Defined in: [mcp/tools/delegate-ui-audit.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-ui-audit.ts#L86) + +**`Experimental`** + +#### Type Declaration + +##### type + +> `readonly` **type**: `"object"` = `'object'` + +##### properties + +> `readonly` **properties**: `object` + +###### properties.workspaceDir + +> `readonly` **workspaceDir**: `object` + +###### properties.workspaceDir.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.workspaceDir.description + +> `readonly` **description**: `"Absolute path for the audit workspace."` = `'Absolute path for the audit workspace.'` + +###### properties.routes + +> `readonly` **routes**: `object` + +###### properties.routes.type + +> `readonly` **type**: `"array"` = `'array'` + +###### properties.routes.items + +> `readonly` **items**: `object` = `ROUTE_SCHEMA` + +###### properties.routes.items.type + +> `readonly` **type**: `"object"` = `'object'` + +###### properties.routes.items.properties + +> `readonly` **properties**: `object` + +###### properties.routes.items.properties.name + +> `readonly` **name**: `object` + +###### properties.routes.items.properties.name.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.routes.items.properties.name.description + +> `readonly` **description**: `"Stable route name (used in screenshot filenames)."` = `'Stable route name (used in screenshot filenames).'` + +###### properties.routes.items.properties.url + +> `readonly` **url**: `object` + +###### properties.routes.items.properties.url.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.routes.items.properties.url.description + +> `readonly` **description**: `"Fully-qualified URL."` = `'Fully-qualified URL.'` + +###### properties.routes.items.properties.viewports + +> `readonly` **viewports**: `object` + +###### properties.routes.items.properties.viewports.type + +> `readonly` **type**: `"array"` = `'array'` + +###### properties.routes.items.properties.viewports.items + +> `readonly` **items**: `object` = `VIEWPORT_SCHEMA` + +###### properties.routes.items.properties.viewports.items.type + +> `readonly` **type**: `"object"` = `'object'` + +###### properties.routes.items.properties.viewports.items.properties + +> `readonly` **properties**: `object` + +###### properties.routes.items.properties.viewports.items.properties.width + +> `readonly` **width**: `object` + +###### properties.routes.items.properties.viewports.items.properties.width.type + +> `readonly` **type**: `"integer"` = `'integer'` + +###### properties.routes.items.properties.viewports.items.properties.width.minimum + +> `readonly` **minimum**: `1` = `1` + +###### properties.routes.items.properties.viewports.items.properties.height + +> `readonly` **height**: `object` + +###### properties.routes.items.properties.viewports.items.properties.height.type + +> `readonly` **type**: `"integer"` = `'integer'` + +###### properties.routes.items.properties.viewports.items.properties.height.minimum + +> `readonly` **minimum**: `1` = `1` + +###### properties.routes.items.properties.viewports.items.required + +> `readonly` **required**: readonly \[`"width"`, `"height"`\] + +###### properties.routes.items.properties.viewports.items.additionalProperties + +> `readonly` **additionalProperties**: `false` = `false` + +###### properties.routes.items.properties.viewports.description + +> `readonly` **description**: `"Viewports to capture at. Default [{1280, 800}]."` = `'Viewports to capture at. Default [{1280, 800}].'` + +###### properties.routes.items.properties.fullPage + +> `readonly` **fullPage**: `object` + +###### properties.routes.items.properties.fullPage.type + +> `readonly` **type**: `"boolean"` = `'boolean'` + +###### properties.routes.items.properties.waitFor + +> `readonly` **waitFor**: `object` + +###### properties.routes.items.properties.waitFor.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.routes.items.properties.waitFor.description + +> `readonly` **description**: `"CSS selector to wait for before capturing."` = `'CSS selector to wait for before capturing.'` + +###### properties.routes.items.required + +> `readonly` **required**: readonly \[`"name"`, `"url"`\] + +###### properties.routes.items.additionalProperties + +> `readonly` **additionalProperties**: `false` = `false` + +###### properties.routes.minItems + +> `readonly` **minItems**: `1` = `1` + +###### properties.namespace + +> `readonly` **namespace**: `object` + +###### properties.namespace.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.namespace.description + +> `readonly` **description**: `"Multi-tenant scope."` = `'Multi-tenant scope.'` + +###### properties.config + +> `readonly` **config**: `object` + +###### properties.config.type + +> `readonly` **type**: `"object"` = `'object'` + +###### properties.config.properties + +> `readonly` **properties**: `object` + +###### properties.config.properties.lenses + +> `readonly` **lenses**: `object` + +###### properties.config.properties.lenses.type + +> `readonly` **type**: `"array"` = `'array'` + +###### properties.config.properties.lenses.items + +> `readonly` **items**: `object` + +###### properties.config.properties.lenses.items.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.config.properties.lenses.items.enum + +> `readonly` **enum**: readonly [`UiLens`](profiles.md#uilens)[] + +###### properties.config.properties.lenses.description + +> `readonly` **description**: "Lenses to iterate. Default: every lens except \"other\"." = `'Lenses to iterate. Default: every lens except "other".'` + +###### properties.config.properties.maxIterations + +> `readonly` **maxIterations**: `object` + +###### properties.config.properties.maxIterations.type + +> `readonly` **type**: `"integer"` = `'integer'` + +###### properties.config.properties.maxIterations.minimum + +> `readonly` **minimum**: `1` = `1` + +###### properties.config.properties.maxConcurrency + +> `readonly` **maxConcurrency**: `object` + +###### properties.config.properties.maxConcurrency.type + +> `readonly` **type**: `"integer"` = `'integer'` + +###### properties.config.properties.maxConcurrency.minimum + +> `readonly` **minimum**: `1` = `1` + +###### properties.config.properties.productContext + +> `readonly` **productContext**: `object` + +###### properties.config.properties.productContext.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.config.additionalProperties + +> `readonly` **additionalProperties**: `false` = `false` + +##### required + +> `readonly` **required**: readonly \[`"workspaceDir"`, `"routes"`\] + +##### additionalProperties + +> `readonly` **additionalProperties**: `false` = `false` + +*** + +### DELEGATION\_HISTORY\_TOOL\_NAME + +> `const` **DELEGATION\_HISTORY\_TOOL\_NAME**: `"delegation_history"` = `'delegation_history'` + +Defined in: [mcp/tools/delegation-history.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-history.ts#L17) + +**`Experimental`** + +*** + +### DELEGATION\_HISTORY\_DESCRIPTION + +> `const` **DELEGATION\_HISTORY\_DESCRIPTION**: `string` + +Defined in: [mcp/tools/delegation-history.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-history.ts#L20) + +**`Experimental`** + +*** + +### DELEGATION\_HISTORY\_INPUT\_SCHEMA + +> `const` **DELEGATION\_HISTORY\_INPUT\_SCHEMA**: `object` + +Defined in: [mcp/tools/delegation-history.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-history.ts#L41) + +**`Experimental`** + +#### Type Declaration + +##### type + +> `readonly` **type**: `"object"` = `'object'` + +##### properties + +> `readonly` **properties**: `object` + +###### properties.namespace + +> `readonly` **namespace**: `object` + +###### properties.namespace.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.profile + +> `readonly` **profile**: `object` + +###### properties.profile.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.profile.enum + +> `readonly` **enum**: readonly \[`"coder"`, `"researcher"`\] + +###### properties.since + +> `readonly` **since**: `object` + +###### properties.since.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.since.description + +> `readonly` **description**: `"ISO datetime — earliest startedAt to include."` = `'ISO datetime — earliest startedAt to include.'` + +###### properties.limit + +> `readonly` **limit**: `object` + +###### properties.limit.type + +> `readonly` **type**: `"integer"` = `'integer'` + +###### properties.limit.minimum + +> `readonly` **minimum**: `1` = `1` + +###### properties.limit.maximum + +> `readonly` **maximum**: `500` = `500` + +##### additionalProperties + +> `readonly` **additionalProperties**: `false` = `false` + +*** + +### DELEGATION\_STATUS\_TOOL\_NAME + +> `const` **DELEGATION\_STATUS\_TOOL\_NAME**: `"delegation_status"` = `'delegation_status'` + +Defined in: [mcp/tools/delegation-status.ts:16](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-status.ts#L16) + +**`Experimental`** + +*** + +### DELEGATION\_STATUS\_DESCRIPTION + +> `const` **DELEGATION\_STATUS\_DESCRIPTION**: `string` + +Defined in: [mcp/tools/delegation-status.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-status.ts#L19) + +**`Experimental`** + +*** + +### DELEGATION\_STATUS\_INPUT\_SCHEMA + +> `const` **DELEGATION\_STATUS\_INPUT\_SCHEMA**: `object` + +Defined in: [mcp/tools/delegation-status.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-status.ts#L41) + +**`Experimental`** + +#### Type Declaration + +##### type + +> `readonly` **type**: `"object"` = `'object'` + +##### properties + +> `readonly` **properties**: `object` + +###### properties.taskId + +> `readonly` **taskId**: `object` + +###### properties.taskId.type + +> `readonly` **type**: `"string"` = `'string'` + +###### properties.taskId.description + +> `readonly` **description**: `"Returned by delegate_code / delegate_research."` = `'Returned by delegate_code / delegate_research.'` + +###### properties.includeTrace + +> `readonly` **includeTrace**: `object` + +###### properties.includeTrace.type + +> `readonly` **type**: `"boolean"` = `'boolean'` + +###### properties.includeTrace.description + +> `readonly` **description**: `"Also return the journaled loop-trace span tree for this delegation. Default false."` = `'Also return the journaled loop-trace span tree for this delegation. Default false.'` + +##### required + +> `readonly` **required**: readonly \[`"taskId"`\] + +##### additionalProperties + +> `readonly` **additionalProperties**: `false` = `false` + +## Functions + +### detectExecutor() + +> **detectExecutor**(`args`): `Promise`\<[`DelegationExecutor`](#delegationexecutor)\> + +Defined in: [mcp/bin-helpers.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/bin-helpers.ts#L46) + +**`Experimental`** + +Pick the right executor for an MCP server invocation based on env vars. + +- `TANGLE_FLEET_ID` set → fleet-workspace placement; resolves the handle + via `sandboxClient.fleets.get(...)`. +- Otherwise → sibling-sandbox placement; each delegation creates a fresh + sandbox via `sandboxClient.create(...)`. + +Fails loud (throws) when fleet mode is requested but the SDK shape is +incompatible — the operator chose fleet semantics, silently degrading to +sibling mode would lie about workspace topology. + +#### Parameters + +##### args + +[`DetectExecutorArgs`](#detectexecutorargs) + +#### Returns + +`Promise`\<[`DelegationExecutor`](#delegationexecutor)\> + +*** + +### detachedSessionDelegate() + +> **detachedSessionDelegate**(`options`): [`CoderDelegate`](#coderdelegate) + +Defined in: [mcp/delegates.ts:223](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L223) + +**`Experimental`** + +Build the sandbox-session coder delegate. It drives `runLoop` against the project's +sandbox client + coder profile; when `args.variants > 1` it switches to the multi-harness fanout +topology. + +This is the SANDBOX-SESSION coder path: workers run the in-box harness via the +`SandboxClient`'s `streamPrompt`, and single-variant turns can dispatch DETACHED +(driveTurn ticks) so a durable queue resumes them across an MCP restart — a substrate +the recursive worktree-CLI leaf does not yet have a journal-replay equivalent for. + +For NEW local-repo coding use `worktreeFanout` / `worktreeLoopRunner` (author an `AgentProfile` +per harness → `createWorktreeCliExecutor` leaves → `gateOnDeliverable`). This delegate stays as the +MCP server's built-in `delegate_code` path; it runs held-stream by default and only its OPTIONAL +cross-restart resume (the `driveTurn` tick) is opt-in behind `MCP_ENABLE_DETACHED_RESUME`. + +#### Parameters + +##### options + +[`DetachedSessionDelegateOptions`](#detachedsessiondelegateoptions) + +#### Returns + +[`CoderDelegate`](#coderdelegate) + +*** + +### coderTaskFromArgs() + +> **coderTaskFromArgs**(`args`): [`CoderTask`](profiles.md#codertask) + +Defined in: [mcp/delegates.ts:430](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L430) + +**`Experimental`** + +Canonical `DelegateCodeArgs` → `CoderTask` mapping — the single source for +the delegate's live dispatch AND the resume driver's settle/message +rebuilding, so a resumed record reproduces exactly the task the original +process dispatched. + +#### Parameters + +##### args + +[`DelegateCodeArgs`](#delegatecodeargs) + +#### Returns + +[`CoderTask`](profiles.md#codertask) + +*** + +### settleDetachedCoderTurn() + +> **settleDetachedCoderTurn**(`turn`, `options`): `Promise`\<`CoderOutput`\> + +Defined in: [mcp/delegates.ts:468](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L468) + +**`Experimental`** + +Settle a completed detached coder turn through the same gate the streaming +path applies: parse the terminal payload with the coder output adapter, +run the mechanical validator (tests/typecheck/forbidden/diff/no-op/secrets), +then the optional reviewer. Throws when nothing survives — a resumed or +detached run must not return an unvalidated patch. + +SCOPE NOTE (detached/resume): the detached `driveTurn`-tick + cross-restart resume path is +bound to the `runLoop` + sandbox-session substrate. The recursive `Scope`/worktree-CLI leaf has +journal→replay but no driveTurn-over-a-detached-sandbox-session equivalent yet, so resume is NOT +advertised on the generic `worktreeFanout` path. This helper (with `coderTaskFromArgs` and +`createDriveTurnResumeDriver`) stays as the resume seam `bin.ts` wires for in-flight records. + +#### Parameters + +##### turn + +[`DetachedTurn`](#detachedturn) + +##### options + +[`SettleDetachedCoderTurnOptions`](#settledetachedcoderturnoptions) + +#### Returns + +`Promise`\<`CoderOutput`\> + +*** + +### buildDelegationMcpServer() + +> **buildDelegationMcpServer**(`options?`): `Record`\<`string`, `AgentProfileMcpServer`\> \| `undefined` + +Defined in: [mcp/delegation-profile.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L69) + +Build the delegation MCP entry the sandbox-side agent loads on startup. +Returns `undefined` when no sandbox API key is resolvable — callers merge +the result into a profile's `mcp` map only when defined. + +#### Parameters + +##### options? + +[`BuildDelegationMcpServerOptions`](#builddelegationmcpserveroptions) = `{}` + +#### Returns + +`Record`\<`string`, `AgentProfileMcpServer`\> \| `undefined` + +*** + +### composeProductionAgentProfile() + +> **composeProductionAgentProfile**(`baseProfile`, `options?`): `AgentProfile` + +Defined in: [mcp/delegation-profile.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L164) + +Compose the production `AgentProfile`: the canonical base profile with the +delegation MCP merged into `mcp`. Used by every call site that boots a +sandbox or runs a chat turn through the sandbox path, and by eval wiring so +the scorecard profile hash reflects the actual production profile. + +Merge rules: + - `mcp`: base map preserved; `options.mcpConnections` (resolved certified + servers) merged over it; the delegation entry is appended last under + [DELEGATION\_MCP\_SERVER\_KEY](#delegation_mcp_server_key), and omitted entirely when no sandbox + API key resolves. + - `tools`: base box-flags map preserved; `options.tools` overlaid per key. + - `hooks`: per event, base commands preserved; `options.hooks[event]` + appended after the base ones. + - `subagents`: base map preserved; `options.subagents` overlaid per key. + - `prompt.systemPrompt`: replaced when `options.systemPrompt` is set. + - `resources.files`: `options.extraFiles` concatenated after base files. + - `name`: replaced when `options.name` is set. + +#### Parameters + +##### baseProfile + +`AgentProfile` + +##### options? + +[`ComposeProductionAgentProfileOptions`](#composeproductionagentprofileoptions) = `{}` + +#### Returns + +`AgentProfile` + +*** + +### buildDelegationTraceSpans() + +> **buildDelegationTraceSpans**(`events`): [`DelegationTraceSpan`](#delegationtracespan)[] + +Defined in: [mcp/delegation-trace.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L73) + +**`Experimental`** + +Derive the compact span tree for ONE loop run from its buffered +`LoopTraceEvent` stream. Same reconstruction as the OTEL exporter +([buildLoopSpanNodes](index.md#buildloopspannodes)); tolerates partial streams. + +#### Parameters + +##### events + +readonly [`LoopTraceEvent`](runtime.md#looptraceevent)[] + +#### Returns + +[`DelegationTraceSpan`](#delegationtracespan)[] + +*** + +### capDelegationTrace() + +> **capDelegationTrace**(`spans`, `caps?`): [`CappedDelegationTrace`](#cappeddelegationtrace) + +Defined in: [mcp/delegation-trace.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L97) + +**`Experimental`** + +Enforce the trace caps over an ordered (oldest-first) span list. Drops the +OLDEST spans first and reports `truncated: true` when anything was dropped; +the newest span always survives, so a non-empty input never caps to empty. +Dropping a parent may orphan surviving children's `parentSpanId` references +— acceptable for the flat journal shape; consumers treat unresolved parents +as roots. + +#### Parameters + +##### spans + +readonly [`DelegationTraceSpan`](#delegationtracespan)[] + +##### caps? + +[`DelegationTraceCaps`](#delegationtracecaps) + +#### Returns + +[`CappedDelegationTrace`](#cappeddelegationtrace) + +*** + +### createDelegationTraceCollector() + +> **createDelegationTraceCollector**(`onSpans`): [`DelegationTraceCollector`](#delegationtracecollector) + +Defined in: [mcp/delegation-trace.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L130) + +**`Experimental`** + +#### Parameters + +##### onSpans + +(`spans`) => `void` + +#### Returns + +[`DelegationTraceCollector`](#delegationtracecollector) + +*** + +### composeLoopTraceEmitters() + +> **composeLoopTraceEmitters**(...`emitters`): [`LoopTraceEmitter`](runtime.md#looptraceemitter) \| `undefined` + +Defined in: [mcp/delegation-trace.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L184) + +**`Experimental`** + +Fan one `LoopTraceEvent` stream into several emitters — e.g. the +process-wide OTEL exporter AND the per-delegation journal collector. +`undefined` entries are skipped; returns `undefined` when nothing is left +so callers keep the kernel's "no emitter, no events" fast path. + +#### Parameters + +##### emitters + +...readonly ([`LoopTraceEmitter`](runtime.md#looptraceemitter) \| `undefined`)[] + +#### Returns + +[`LoopTraceEmitter`](runtime.md#looptraceemitter) \| `undefined` + +*** + +### formatDetachedSessionRef() + +> **formatDetachedSessionRef**(`parts`): `string` + +Defined in: [mcp/detached-turn.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L95) + +**`Experimental`** + +Encode ref parts into the JSON-safe string stored on the record: +`session=` before the box exists, `sandbox=;session=` once +bound. Ids must not contain the `;`/`=` delimiters. + +#### Parameters + +##### parts + +[`DetachedSessionRefParts`](#detachedsessionrefparts) + +#### Returns + +`string` + +*** + +### parseDetachedSessionRef() + +> **parseDetachedSessionRef**(`raw`): [`DetachedSessionRefParts`](#detachedsessionrefparts) + +Defined in: [mcp/detached-turn.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L103) + +**`Experimental`** + +Inverse of [formatDetachedSessionRef](#formatdetachedsessionref); throws `ValidationError` on malformed input. + +#### Parameters + +##### raw + +`string` + +#### Returns + +[`DetachedSessionRefParts`](#detachedsessionrefparts) + +*** + +### detachedTurnEvents() + +> **detachedTurnEvents**(`sessionId`, `turn`): `SandboxEvent`[] + +Defined in: [mcp/detached-turn.ts:150](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L150) + +**`Experimental`** + +Synthesize the terminal event array a detached turn settles through. Shaped +so the existing event-stream output adapters (coder, researcher) parse it: +`data.result` for adapters that read a structured terminal record, `data.text` +for adapters that scan assistant text for the fenced result block. + +#### Parameters + +##### sessionId + +`string` + +##### turn + +[`DetachedTurn`](#detachedturn) + +#### Returns + +`SandboxEvent`[] + +*** + +### runDetachedTurn() + +> **runDetachedTurn**(`options`): `Promise`\<[`DetachedTurn`](#detachedturn)\> + +Defined in: [mcp/detached-turn.ts:211](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L211) + +**`Experimental`** + +Dispatch one detached turn and advance it to a terminal state with +`driveTurn` ticks. The first tick dispatches (idempotent on `sessionId`); +subsequent ticks poll. On abort the remote session is cancelled via +`_sessionCancel` when the box exposes it. The box is torn down on every +in-process exit path (success, failure, abort) — only a process death skips +teardown, which is exactly the case the resume driver re-attaches to. + +#### Parameters + +##### options + +[`RunDetachedTurnOptions`](#rundetachedturnoptions) + +#### Returns + +`Promise`\<[`DetachedTurn`](#detachedturn)\> + +*** + +### createDriveTurnResumeDriver() + +> **createDriveTurnResumeDriver**(`options`): [`DelegationResumeDriver`](#delegationresumedriver) + +Defined in: [mcp/detached-turn.ts:415](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L415) + +**`Experimental`** + +Build the `driveTurn`-backed [DelegationResumeDriver](#delegationresumedriver). Each `tick()` +is one settle/poll/dispatch pass: + + - ref without a sandbox binding → `failed` (`DetachedSessionUnboundError`): + the previous process died before a box existed; there is nothing to resume. + - `driveTurn` `completed` → `settleOutput` → `completed` tick. + - `running` → progress via `ctx.report`, `running` tick (queue re-ticks + after `intervalMs`). + - `failed` → `failed` tick (`DetachedTurnFailedError`) — terminal per the + SDK's deterministic-failure contract. + +Abort: the queue stops ticking once `cancel()` flips the record, so remote +cancellation is hooked onto `ctx.signal` (once per task) and fires +`_sessionCancel` when the SDK surface exposes it. The driver never deletes +boxes — it cannot know whether `sandboxId` is a disposable sibling or a +fleet machine, and destroying a fleet machine would be unrecoverable. + +#### Parameters + +##### options + +[`DriveTurnResumeDriverOptions`](#driveturnresumedriveroptions) + +#### Returns + +[`DelegationResumeDriver`](#delegationresumedriver) + +*** + +### createSiblingSandboxExecutor() + +> **createSiblingSandboxExecutor**(`options`): [`DelegationExecutor`](#delegationexecutor) + +Defined in: [mcp/executor.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L54) + +**`Experimental`** + +Wrap a raw sandbox SDK client so the kernel emits +`loop.iteration.dispatch` events with `{ placement: 'sibling', sandboxId }`. + +The returned client `.create()` delegates to the underlying client; the +only added behavior is a `describePlacement` tag the kernel reads. + +#### Parameters + +##### options + +[`SiblingSandboxExecutorOptions`](#siblingsandboxexecutoroptions) + +#### Returns + +[`DelegationExecutor`](#delegationexecutor) + +*** + +### createFleetWorkspaceExecutor() + +> **createFleetWorkspaceExecutor**(`options`): [`DelegationExecutor`](#delegationexecutor) + +Defined in: [mcp/executor.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L116) + +**`Experimental`** + +Build an executor that resolves each delegated iteration to an existing +machine in `fleet`. The fleet's shared-workspace policy means the worker +machine sees the caller's filesystem — diffs land in-place with no +cross-sandbox copy step. + +#### Parameters + +##### options + +[`FleetWorkspaceExecutorOptions`](#fleetworkspaceexecutoroptions) + +#### Returns + +[`DelegationExecutor`](#delegationexecutor) + +*** + +### eventToSnapshot() + +> **eventToSnapshot**(`event`): [`DelegationFeedbackSnapshot`](#delegationfeedbacksnapshot) + +Defined in: [mcp/feedback-store.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L66) + +**`Experimental`** + +Project a `FeedbackEvent` down to the snapshot shape carried on +`delegation_history` entries. + +#### Parameters + +##### event + +[`FeedbackEvent`](#feedbackevent) + +#### Returns + +[`DelegationFeedbackSnapshot`](#delegationfeedbacksnapshot) + +*** + +### createInProcessExecutor() + +> **createInProcessExecutor**(`options`): [`DelegationExecutor`](#delegationexecutor) + +Defined in: [mcp/in-process-executor.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L87) + +**`Experimental`** + +Build an in-process executor. Returns a [DelegationExecutor](#delegationexecutor) whose `client.create()` +returns a minimal virtual `SandboxInstance`; the kernel calls `streamPrompt(msg)` on it, which +runs the shared worktree-harness core and emits one `result` event whose `data.result` is the +raw `WorktreeHarnessResult` (the content-addressed patch artifact). The authored profile +(`backend.profile`) threads its systemPrompt + model into the harness via the core. + +#### Parameters + +##### options + +[`InProcessExecutorOptions`](#inprocessexecutoroptions) + +#### Returns + +[`DelegationExecutor`](#delegationexecutor) + +*** + +### createKbGate() + +> **createKbGate**(`options?`): (`candidate`) => `Promise`\<[`KbGateResult`](#kbgateresult)\> + +Defined in: [mcp/kb-gate.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L137) + +**`Experimental`** + +Build a fail-closed KB gate. The returned function runs the built-in floor +(passage-non-empty → passage-present → value-in-passage → no-circular-citation) +then any consumer judges, returning on the first veto. + +#### Parameters + +##### options? + +[`CreateKbGateOptions`](#createkbgateoptions) = `{}` + +#### Returns + +(`candidate`) => `Promise`\<[`KbGateResult`](#kbgateresult)\> + +*** + +### runLocalHarness() + +> **runLocalHarness**(`options`): `Promise`\<[`LocalHarnessResult`](#localharnessresult)\> + +Defined in: [mcp/local-harness.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L179) + +**`Experimental`** + +Spawn a local coding harness CLI as a subprocess + collect its output. + +NOT responsible for parsing the harness's output or extracting a diff — +the in-process executor's `streamPrompt` orchestrates `git diff` against +the worktree after this resolves. This function is intentionally narrow: +spawn, wait, capture, return. + +Fails loud — throws when: + - `cwd` doesn't exist (subprocess emits ENOENT; surfaced as Error) + - the harness binary is not on PATH (ENOENT) + +Does NOT throw when: + - the subprocess exits non-zero (`result.exitCode` carries the code) + - the subprocess is aborted / timed out (`result.killedBySignal` / + `result.timedOut` carries the reason) + +#### Parameters + +##### options + +[`RunLocalHarnessOptions`](#runlocalharnessoptions) + +#### Returns + +`Promise`\<[`LocalHarnessResult`](#localharnessresult)\> + +*** + +### createMcpServer() + +> **createMcpServer**(`options?`): [`McpServer`](#mcpserver) + +Defined in: [mcp/server.ts:163](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L163) + +**`Experimental`** + +#### Parameters + +##### options? + +[`McpServerOptions`](#mcpserveroptions) = `{}` + +#### Returns + +[`McpServer`](#mcpserver) + +*** + +### createInProcessTransport() + +> **createInProcessTransport**(): `object` + +Defined in: [mcp/server.ts:367](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L367) + +**`Experimental`** + +In-process pair of `Readable` + `Writable` streams suitable for driving +`server.serve(...)` from a test. Returns the agent-side stream (the +client writes to it) and the server-side stream (the test reads from it). + +#### Returns + +`object` + +##### transport + +> **transport**: [`McpTransport`](#mcptransport) + +##### clientWrite() + +> **clientWrite**(`line`): `void` + +###### Parameters + +###### line + +`string` + +###### Returns + +`void` + +##### clientClose() + +> **clientClose**(): `void` + +###### Returns + +`void` + +##### readServer() + +> **readServer**(): `Promise`\<[`JsonRpcResponse`](#jsonrpcresponse)[]\> + +###### Returns + +`Promise`\<[`JsonRpcResponse`](#jsonrpcresponse)[]\> + +*** + +### hashIdempotencyInput() + +> **hashIdempotencyInput**(`value`): `string` + +Defined in: [mcp/task-queue.ts:799](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L799) + +**`Experimental`** + +Best-effort stable hash for use as `idempotencyKey`. Not cryptographic; +collisions only affect dedupe, never correctness. + +#### Parameters + +##### value + +`unknown` + +#### Returns + +`string` + +*** + +### liftFindings() + +> **liftFindings**(`kind`, `rows`, `producedAt`): `AnalystFinding`[] + +Defined in: [mcp/tools/checks.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L143) + +Lift validated raw rows into `AnalystFinding`s (agent-eval `makeFinding` stamps `finding_id`/ + `produced_at`), then enforce the trace-derived firewall (selector ≠ judge). Pure — no LLM. + +#### Parameters + +##### kind + +[`Check`](#check) + +##### rows + +`unknown`[] + +##### producedAt + +`string` + +#### Returns + +`AnalystFinding`[] + +*** + +### renderTrace() + +> **renderTrace**(`trace`): `string` + +Defined in: [mcp/tools/checks.ts:183](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L183) + +Render a worker's trace (tool calls + results) into the text an analyst lens reads. Generic over + the trace shape: a `{ messages }` conversation, a bare message array, else stringified. + +#### Parameters + +##### trace + +`unknown` + +#### Returns + +`string` + +*** + +### runCheck() + +> **runCheck**(`kind`, `trace`, `opts`, `producedAt`): `Promise`\<`AnalystFinding`[]\> + +Defined in: [mcp/tools/checks.ts:219](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L219) + +Run ONE lens over a trace → findings. Generic over any kind: prompt = the lens + the agent-eval + finding schema; the model's JSON array is parsed (`parseRawFinding`), lifted, and firewalled. + +#### Parameters + +##### kind + +[`Check`](#check) + +##### trace + +`unknown` + +##### opts + +[`CheckRunnerOptions`](#checkrunneroptions) + +##### producedAt + +`string` + +#### Returns + +`Promise`\<`AnalystFinding`[]\> + +*** + +### makeCheckRunner() + +> **makeCheckRunner**(`kinds`, `opts`): (`kindId`, `trace`, `producedAt`) => `Promise`\<`AnalystFinding`[] \| \{ `error`: `string`; \}\> + +Defined in: [mcp/tools/checks.ts:271](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L271) + +Build a `run_analyst` runner over a kind directory. +Returns findings, or a typed error for an unknown kind. `producedAt` is +passed in because replay-safe paths must not read `Date.now`. + +#### Parameters + +##### kinds + +`Record`\<`string`, [`Check`](#check)\> + +##### opts + +[`CheckRunnerOptions`](#checkrunneroptions) + +#### Returns + +(`kindId`, `trace`, `producedAt`) => `Promise`\<`AnalystFinding`[] \| \{ `error`: `string`; \}\> + +*** + +### createCoordinationTools() + +> **createCoordinationTools**(`opts`): [`CoordinationTools`](#coordinationtools) + +Defined in: [mcp/tools/coordination.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L137) + +Build the driver's MCP tools over a live scope. + +#### Parameters + +##### opts + +[`CoordinationToolsOptions`](#coordinationtoolsoptions) + +#### Returns + +[`CoordinationTools`](#coordinationtools) + +*** + +### validateDelegateCodeArgs() + +> **validateDelegateCodeArgs**(`raw`): [`DelegateCodeArgs`](#delegatecodeargs) + +Defined in: [mcp/tools/delegate-code.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-code.ts#L90) + +**`Experimental`** + +#### Parameters + +##### raw + +`unknown` + +#### Returns + +[`DelegateCodeArgs`](#delegatecodeargs) + +*** + +### createDelegateCodeHandler() + +> **createDelegateCodeHandler**(`options`): (`raw`) => `Promise`\<[`DelegateCodeResult`](#delegatecoderesult)\> + +Defined in: [mcp/tools/delegate-code.ts:177](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-code.ts#L177) + +**`Experimental`** + +#### Parameters + +##### options + +`DelegateCodeHandlerOptions` + +#### Returns + +(`raw`) => `Promise`\<[`DelegateCodeResult`](#delegatecoderesult)\> + +*** + +### validateDelegateFeedbackArgs() + +> **validateDelegateFeedbackArgs**(`raw`): [`DelegateFeedbackArgs`](#delegatefeedbackargs) + +Defined in: [mcp/tools/delegate-feedback.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-feedback.ts#L82) + +**`Experimental`** + +#### Parameters + +##### raw + +`unknown` + +#### Returns + +[`DelegateFeedbackArgs`](#delegatefeedbackargs) + +*** + +### createDelegateFeedbackHandler() + +> **createDelegateFeedbackHandler**(`options`): (`raw`) => `Promise`\<[`DelegateFeedbackResult`](#delegatefeedbackresult)\> + +Defined in: [mcp/tools/delegate-feedback.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-feedback.ts#L159) + +**`Experimental`** + +#### Parameters + +##### options + +`DelegateFeedbackHandlerOptions` + +#### Returns + +(`raw`) => `Promise`\<[`DelegateFeedbackResult`](#delegatefeedbackresult)\> + +*** + +### validateDelegateResearchArgs() + +> **validateDelegateResearchArgs**(`raw`): [`DelegateResearchArgs`](#delegateresearchargs) + +Defined in: [mcp/tools/delegate-research.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-research.ts#L94) + +**`Experimental`** + +#### Parameters + +##### raw + +`unknown` + +#### Returns + +[`DelegateResearchArgs`](#delegateresearchargs) + +*** + +### createDelegateResearchHandler() + +> **createDelegateResearchHandler**(`options`): (`raw`) => `Promise`\<[`DelegateResearchResult`](#delegateresearchresult)\> + +Defined in: [mcp/tools/delegate-research.ts:192](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-research.ts#L192) + +**`Experimental`** + +#### Parameters + +##### options + +`DelegateResearchHandlerOptions` + +#### Returns + +(`raw`) => `Promise`\<[`DelegateResearchResult`](#delegateresearchresult)\> + +*** + +### validateDelegateUiAuditArgs() + +> **validateDelegateUiAuditArgs**(`raw`): [`DelegateUiAuditArgs`](#delegateuiauditargs) + +Defined in: [mcp/tools/delegate-ui-audit.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-ui-audit.ts#L114) + +**`Experimental`** + +#### Parameters + +##### raw + +`unknown` + +#### Returns + +[`DelegateUiAuditArgs`](#delegateuiauditargs) + +*** + +### createDelegateUiAuditHandler() + +> **createDelegateUiAuditHandler**(`options`): (`raw`) => `Promise`\<[`DelegateUiAuditResult`](#delegateuiauditresult)\> + +Defined in: [mcp/tools/delegate-ui-audit.ts:300](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-ui-audit.ts#L300) + +**`Experimental`** + +#### Parameters + +##### options + +`DelegateUiAuditHandlerOptions` + +#### Returns + +(`raw`) => `Promise`\<[`DelegateUiAuditResult`](#delegateuiauditresult)\> + +*** + +### validateDelegationHistoryArgs() + +> **validateDelegationHistoryArgs**(`raw`): [`DelegationHistoryArgs`](#delegationhistoryargs) + +Defined in: [mcp/tools/delegation-history.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-history.ts#L53) + +**`Experimental`** + +#### Parameters + +##### raw + +`unknown` + +#### Returns + +[`DelegationHistoryArgs`](#delegationhistoryargs) + +*** + +### createDelegationHistoryHandler() + +> **createDelegationHistoryHandler**(`options`): (`raw`) => `Promise`\<[`DelegationHistoryResult`](#delegationhistoryresult)\> + +Defined in: [mcp/tools/delegation-history.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-history.ts#L94) + +**`Experimental`** + +#### Parameters + +##### options + +`DelegationHistoryHandlerOptions` + +#### Returns + +(`raw`) => `Promise`\<[`DelegationHistoryResult`](#delegationhistoryresult)\> + +*** + +### validateDelegationStatusArgs() + +> **validateDelegationStatusArgs**(`raw`): [`DelegationStatusArgs`](#delegationstatusargs) + +Defined in: [mcp/tools/delegation-status.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-status.ts#L56) + +**`Experimental`** + +#### Parameters + +##### raw + +`unknown` + +#### Returns + +[`DelegationStatusArgs`](#delegationstatusargs) + +*** + +### createDelegationStatusHandler() + +> **createDelegationStatusHandler**(`options`): (`raw`) => `Promise`\<[`DelegationStatusResult`](#delegationstatusresult)\> + +Defined in: [mcp/tools/delegation-status.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-status.ts#L81) + +**`Experimental`** + +#### Parameters + +##### options + +`DelegationStatusHandlerOptions` + +#### Returns + +(`raw`) => `Promise`\<[`DelegationStatusResult`](#delegationstatusresult)\> + +*** + +### readTraceContextFromEnv() + +> **readTraceContextFromEnv**(): [`TraceContext`](#tracecontext-2) + +Defined in: [mcp/trace-propagation.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/trace-propagation.ts#L35) + +Read trace context from the process environment. +Returns a context with inherited ids or a freshly generated root. + +#### Returns + +[`TraceContext`](#tracecontext-2) + +*** + +### createPropagatingTraceEmitter() + +> **createPropagatingTraceEmitter**(`ctx`): `object` + +Defined in: [mcp/trace-propagation.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/trace-propagation.ts#L48) + +Create a LoopTraceEmitter that: + 1. Parents all spans under the inherited PARENT_SPAN_ID. + 2. Exports spans to OTEL when OTEL_EXPORTER_OTLP_ENDPOINT is set. + +Returns both the emitter and the optional exporter handle for shutdown. + +#### Parameters + +##### ctx + +[`TraceContext`](#tracecontext-2) + +#### Returns + +`object` + +##### emitter + +> **emitter**: [`LoopTraceEmitter`](runtime.md#looptraceemitter) + +##### exporter + +> **exporter**: [`OtelExporter`](index.md#otelexporter) \| `undefined` + +##### context + +> **context**: [`TraceContext`](#tracecontext-2) + +*** + +### traceContextToEnv() + +> **traceContextToEnv**(`ctx`): `Record`\<`string`, `string`\> + +Defined in: [mcp/trace-propagation.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/trace-propagation.ts#L85) + +Build env vars to pass to a child MCP subprocess so it inherits the +current trace context. + +#### Parameters + +##### ctx + +[`TraceContext`](#tracecontext-2) + +#### Returns + +`Record`\<`string`, `string`\> + +*** + +### createWorktree() + +> **createWorktree**(`options`): `Promise`\<[`WorktreeHandle`](#worktreehandle)\> + +Defined in: [mcp/worktree.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L113) + +**`Experimental`** + +#### Parameters + +##### options + +[`CreateWorktreeOptions`](#createworktreeoptions) + +#### Returns + +`Promise`\<[`WorktreeHandle`](#worktreehandle)\> + +*** + +### captureWorktreeDiff() + +> **captureWorktreeDiff**(`options`): `Promise`\<[`DiffResult`](#diffresult)\> + +Defined in: [mcp/worktree.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L133) + +**`Experimental`** + +#### Parameters + +##### options + +[`DiffOptions`](#diffoptions) + +#### Returns + +`Promise`\<[`DiffResult`](#diffresult)\> + +*** + +### removeWorktree() + +> **removeWorktree**(`options`): `Promise`\<`void`\> + +Defined in: [mcp/worktree.ts:173](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L173) + +**`Experimental`** + +#### Parameters + +##### options + +[`RemoveWorktreeOptions`](#removeworktreeoptions) + +#### Returns + +`Promise`\<`void`\> + +## References + +### mcpToolsForRuntimeMcp + +Re-exports [mcpToolsForRuntimeMcp](index.md#mcptoolsforruntimemcp) + +*** + +### mcpToolsForRuntimeMcpSubset + +Re-exports [mcpToolsForRuntimeMcpSubset](index.md#mcptoolsforruntimemcpsubset) diff --git a/docs/api/mcp/README.md b/docs/api/mcp/README.md deleted file mode 100644 index 016869c..0000000 --- a/docs/api/mcp/README.md +++ /dev/null @@ -1,210 +0,0 @@ -[**@tangle-network/agent-runtime**](../README.md) - -*** - -[@tangle-network/agent-runtime](../README.md) / mcp - -# mcp - -## Classes - -- [DelegationStateCorruptError](classes/DelegationStateCorruptError.md) -- [DelegationPersistenceError](classes/DelegationPersistenceError.md) -- [InMemoryDelegationStore](classes/InMemoryDelegationStore.md) -- [FileDelegationStore](classes/FileDelegationStore.md) -- [InMemoryFeedbackStore](classes/InMemoryFeedbackStore.md) -- [DelegationTaskQueue](classes/DelegationTaskQueue.md) - -## Interfaces - -- [DetectExecutorArgs](interfaces/DetectExecutorArgs.md) -- [DelegateRunCtx](interfaces/DelegateRunCtx.md) -- [CoderReview](interfaces/CoderReview.md) -- [DetachedSessionDelegateOptions](interfaces/DetachedSessionDelegateOptions.md) -- [SettleDetachedCoderTurnOptions](interfaces/SettleDetachedCoderTurnOptions.md) -- [BuildDelegationMcpServerOptions](interfaces/BuildDelegationMcpServerOptions.md) -- [ComposeProductionAgentProfileOptions](interfaces/ComposeProductionAgentProfileOptions.md) -- [DelegationStore](interfaces/DelegationStore.md) -- [FileDelegationStoreOptions](interfaces/FileDelegationStoreOptions.md) -- [DelegationTraceSpan](interfaces/DelegationTraceSpan.md) -- [DelegationTraceCaps](interfaces/DelegationTraceCaps.md) -- [CappedDelegationTrace](interfaces/CappedDelegationTrace.md) -- [DelegationTraceCollector](interfaces/DelegationTraceCollector.md) -- [DriveTurnCapableBox](interfaces/DriveTurnCapableBox.md) -- [DetachedSessionRefParts](interfaces/DetachedSessionRefParts.md) -- [DetachedTurn](interfaces/DetachedTurn.md) -- [RunDetachedTurnOptions](interfaces/RunDetachedTurnOptions.md) -- [DriveTurnResumeDriverOptions](interfaces/DriveTurnResumeDriverOptions.md) -- [DelegationExecutor](interfaces/DelegationExecutor.md) -- [SiblingSandboxExecutorOptions](interfaces/SiblingSandboxExecutorOptions.md) -- [FleetHandle](interfaces/FleetHandle.md) -- [FleetWorkspaceExecutorOptions](interfaces/FleetWorkspaceExecutorOptions.md) -- [FeedbackEvent](interfaces/FeedbackEvent.md) -- [FeedbackStore](interfaces/FeedbackStore.md) -- [InProcessExecutorOptions](interfaces/InProcessExecutorOptions.md) -- [InProcessExecutorDescribePlacement](interfaces/InProcessExecutorDescribePlacement.md) -- [FactCandidate](interfaces/FactCandidate.md) -- [FactJudgeVerdict](interfaces/FactJudgeVerdict.md) -- [FactJudge](interfaces/FactJudge.md) -- [KbGateResult](interfaces/KbGateResult.md) -- [CreateKbGateOptions](interfaces/CreateKbGateOptions.md) -- [RunLocalHarnessOptions](interfaces/RunLocalHarnessOptions.md) -- [LocalHarnessResult](interfaces/LocalHarnessResult.md) -- [McpServerOptions](interfaces/McpServerOptions.md) -- [McpToolDescriptor](interfaces/McpToolDescriptor.md) -- [McpServer](interfaces/McpServer.md) -- [McpTransport](interfaces/McpTransport.md) -- [JsonRpcMessage](interfaces/JsonRpcMessage.md) -- [JsonRpcResponse](interfaces/JsonRpcResponse.md) -- [DelegationRecord](interfaces/DelegationRecord.md) -- [SubmitInput](interfaces/SubmitInput.md) -- [DelegationRunContext](interfaces/DelegationRunContext.md) -- [SubmitOutput](interfaces/SubmitOutput.md) -- [DelegationResumeContext](interfaces/DelegationResumeContext.md) -- [DelegationResumeDriver](interfaces/DelegationResumeDriver.md) -- [DelegationTaskQueueOptions](interfaces/DelegationTaskQueueOptions.md) -- [Check](interfaces/Check.md) -- [CheckRunnerOptions](interfaces/CheckRunnerOptions.md) -- [SettledWorker](interfaces/SettledWorker.md) -- [Question](interfaces/Question.md) -- [QuestionRecord](interfaces/QuestionRecord.md) -- [AnalystRegistry](interfaces/AnalystRegistry.md) -- [CoordinationToolsOptions](interfaces/CoordinationToolsOptions.md) -- [CoordinationTools](interfaces/CoordinationTools.md) -- [TraceContext](interfaces/TraceContext.md) -- [DelegateCodeConfig](interfaces/DelegateCodeConfig.md) -- [DelegateCodeArgs](interfaces/DelegateCodeArgs.md) -- [DelegateCodeResult](interfaces/DelegateCodeResult.md) -- [DelegateResearchConfig](interfaces/DelegateResearchConfig.md) -- [DelegateResearchArgs](interfaces/DelegateResearchArgs.md) -- [DelegateResearchResult](interfaces/DelegateResearchResult.md) -- [FeedbackRefersTo](interfaces/FeedbackRefersTo.md) -- [FeedbackRating](interfaces/FeedbackRating.md) -- [DelegateFeedbackArgs](interfaces/DelegateFeedbackArgs.md) -- [DelegateFeedbackResult](interfaces/DelegateFeedbackResult.md) -- [DelegationStatusArgs](interfaces/DelegationStatusArgs.md) -- [DelegationProgress](interfaces/DelegationProgress.md) -- [DelegationError](interfaces/DelegationError.md) -- [UiAuditorDelegationOutput](interfaces/UiAuditorDelegationOutput.md) -- [DelegateUiAuditRoute](interfaces/DelegateUiAuditRoute.md) -- [DelegateUiAuditConfig](interfaces/DelegateUiAuditConfig.md) -- [DelegateUiAuditArgs](interfaces/DelegateUiAuditArgs.md) -- [DelegateUiAuditResult](interfaces/DelegateUiAuditResult.md) -- [ResearchOutputShape](interfaces/ResearchOutputShape.md) -- [DelegationStatusResult](interfaces/DelegationStatusResult.md) -- [DelegationHistoryArgs](interfaces/DelegationHistoryArgs.md) -- [DelegationFeedbackSnapshot](interfaces/DelegationFeedbackSnapshot.md) -- [DelegationHistoryEntry](interfaces/DelegationHistoryEntry.md) -- [DelegationHistoryResult](interfaces/DelegationHistoryResult.md) -- [WorktreeHandle](interfaces/WorktreeHandle.md) -- [CreateWorktreeOptions](interfaces/CreateWorktreeOptions.md) -- [DiffOptions](interfaces/DiffOptions.md) -- [DiffResult](interfaces/DiffResult.md) -- [RemoveWorktreeOptions](interfaces/RemoveWorktreeOptions.md) - -## Type Aliases - -- [CoderDelegate](type-aliases/CoderDelegate.md) -- [ResearcherDelegate](type-aliases/ResearcherDelegate.md) -- [UiAuditorDelegate](type-aliases/UiAuditorDelegate.md) -- [CoderReviewer](type-aliases/CoderReviewer.md) -- [DetachedWinnerSelection](type-aliases/DetachedWinnerSelection.md) -- [DriveTurnTick](type-aliases/DriveTurnTick.md) -- [LocalHarness](type-aliases/LocalHarness.md) -- [DelegationResumeTick](type-aliases/DelegationResumeTick.md) -- [QuestionDecision](type-aliases/QuestionDecision.md) -- [QuestionPolicy](type-aliases/QuestionPolicy.md) -- [CoordinationEvent](type-aliases/CoordinationEvent.md) -- [MakeWorkerAgent](type-aliases/MakeWorkerAgent.md) -- [DelegationProfile](type-aliases/DelegationProfile.md) -- [DelegationStatus](type-aliases/DelegationStatus.md) -- [ResearchSource](type-aliases/ResearchSource.md) -- [DelegationResultPayload](type-aliases/DelegationResultPayload.md) -- [GitRunner](type-aliases/GitRunner.md) - -## Variables - -- [DELEGATION\_MCP\_SERVER\_KEY](variables/DELEGATION_MCP_SERVER_KEY.md) -- [DELEGATION\_TRACE\_MAX\_SPANS](variables/DELEGATION_TRACE_MAX_SPANS.md) -- [DELEGATION\_TRACE\_MAX\_BYTES](variables/DELEGATION_TRACE_MAX_BYTES.md) -- [defaultChecks](variables/defaultChecks.md) -- [DELEGATE\_CODE\_TOOL\_NAME](variables/DELEGATE_CODE_TOOL_NAME.md) -- [DELEGATE\_CODE\_DESCRIPTION](variables/DELEGATE_CODE_DESCRIPTION.md) -- [DELEGATE\_CODE\_INPUT\_SCHEMA](variables/DELEGATE_CODE_INPUT_SCHEMA.md) -- [DELEGATE\_FEEDBACK\_TOOL\_NAME](variables/DELEGATE_FEEDBACK_TOOL_NAME.md) -- [DELEGATE\_FEEDBACK\_DESCRIPTION](variables/DELEGATE_FEEDBACK_DESCRIPTION.md) -- [DELEGATE\_FEEDBACK\_INPUT\_SCHEMA](variables/DELEGATE_FEEDBACK_INPUT_SCHEMA.md) -- [DELEGATE\_RESEARCH\_TOOL\_NAME](variables/DELEGATE_RESEARCH_TOOL_NAME.md) -- [DELEGATE\_RESEARCH\_DESCRIPTION](variables/DELEGATE_RESEARCH_DESCRIPTION.md) -- [DELEGATE\_RESEARCH\_INPUT\_SCHEMA](variables/DELEGATE_RESEARCH_INPUT_SCHEMA.md) -- [DELEGATE\_UI\_AUDIT\_TOOL\_NAME](variables/DELEGATE_UI_AUDIT_TOOL_NAME.md) -- [DELEGATE\_UI\_AUDIT\_DESCRIPTION](variables/DELEGATE_UI_AUDIT_DESCRIPTION.md) -- [DELEGATE\_UI\_AUDIT\_INPUT\_SCHEMA](variables/DELEGATE_UI_AUDIT_INPUT_SCHEMA.md) -- [DELEGATION\_HISTORY\_TOOL\_NAME](variables/DELEGATION_HISTORY_TOOL_NAME.md) -- [DELEGATION\_HISTORY\_DESCRIPTION](variables/DELEGATION_HISTORY_DESCRIPTION.md) -- [DELEGATION\_HISTORY\_INPUT\_SCHEMA](variables/DELEGATION_HISTORY_INPUT_SCHEMA.md) -- [DELEGATION\_STATUS\_TOOL\_NAME](variables/DELEGATION_STATUS_TOOL_NAME.md) -- [DELEGATION\_STATUS\_DESCRIPTION](variables/DELEGATION_STATUS_DESCRIPTION.md) -- [DELEGATION\_STATUS\_INPUT\_SCHEMA](variables/DELEGATION_STATUS_INPUT_SCHEMA.md) - -## Functions - -- [detectExecutor](functions/detectExecutor.md) -- [detachedSessionDelegate](functions/detachedSessionDelegate.md) -- [coderTaskFromArgs](functions/coderTaskFromArgs.md) -- [settleDetachedCoderTurn](functions/settleDetachedCoderTurn.md) -- [buildDelegationMcpServer](functions/buildDelegationMcpServer.md) -- [composeProductionAgentProfile](functions/composeProductionAgentProfile.md) -- [buildDelegationTraceSpans](functions/buildDelegationTraceSpans.md) -- [capDelegationTrace](functions/capDelegationTrace.md) -- [createDelegationTraceCollector](functions/createDelegationTraceCollector.md) -- [composeLoopTraceEmitters](functions/composeLoopTraceEmitters.md) -- [formatDetachedSessionRef](functions/formatDetachedSessionRef.md) -- [parseDetachedSessionRef](functions/parseDetachedSessionRef.md) -- [detachedTurnEvents](functions/detachedTurnEvents.md) -- [runDetachedTurn](functions/runDetachedTurn.md) -- [createDriveTurnResumeDriver](functions/createDriveTurnResumeDriver.md) -- [createSiblingSandboxExecutor](functions/createSiblingSandboxExecutor.md) -- [createFleetWorkspaceExecutor](functions/createFleetWorkspaceExecutor.md) -- [eventToSnapshot](functions/eventToSnapshot.md) -- [createInProcessExecutor](functions/createInProcessExecutor.md) -- [createKbGate](functions/createKbGate.md) -- [runLocalHarness](functions/runLocalHarness.md) -- [createMcpServer](functions/createMcpServer.md) -- [createInProcessTransport](functions/createInProcessTransport.md) -- [hashIdempotencyInput](functions/hashIdempotencyInput.md) -- [liftFindings](functions/liftFindings.md) -- [renderTrace](functions/renderTrace.md) -- [runCheck](functions/runCheck.md) -- [makeCheckRunner](functions/makeCheckRunner.md) -- [createCoordinationTools](functions/createCoordinationTools.md) -- [validateDelegateCodeArgs](functions/validateDelegateCodeArgs.md) -- [createDelegateCodeHandler](functions/createDelegateCodeHandler.md) -- [validateDelegateFeedbackArgs](functions/validateDelegateFeedbackArgs.md) -- [createDelegateFeedbackHandler](functions/createDelegateFeedbackHandler.md) -- [validateDelegateResearchArgs](functions/validateDelegateResearchArgs.md) -- [createDelegateResearchHandler](functions/createDelegateResearchHandler.md) -- [validateDelegateUiAuditArgs](functions/validateDelegateUiAuditArgs.md) -- [createDelegateUiAuditHandler](functions/createDelegateUiAuditHandler.md) -- [validateDelegationHistoryArgs](functions/validateDelegationHistoryArgs.md) -- [createDelegationHistoryHandler](functions/createDelegationHistoryHandler.md) -- [validateDelegationStatusArgs](functions/validateDelegationStatusArgs.md) -- [createDelegationStatusHandler](functions/createDelegationStatusHandler.md) -- [readTraceContextFromEnv](functions/readTraceContextFromEnv.md) -- [createPropagatingTraceEmitter](functions/createPropagatingTraceEmitter.md) -- [traceContextToEnv](functions/traceContextToEnv.md) -- [createWorktree](functions/createWorktree.md) -- [captureWorktreeDiff](functions/captureWorktreeDiff.md) -- [removeWorktree](functions/removeWorktree.md) - -## References - -### mcpToolsForRuntimeMcp - -Re-exports [mcpToolsForRuntimeMcp](../index/functions/mcpToolsForRuntimeMcp.md) - -*** - -### mcpToolsForRuntimeMcpSubset - -Re-exports [mcpToolsForRuntimeMcpSubset](../index/functions/mcpToolsForRuntimeMcpSubset.md) diff --git a/docs/api/mcp/classes/DelegationPersistenceError.md b/docs/api/mcp/classes/DelegationPersistenceError.md deleted file mode 100644 index 024706e..0000000 --- a/docs/api/mcp/classes/DelegationPersistenceError.md +++ /dev/null @@ -1,50 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationPersistenceError - -# Class: DelegationPersistenceError - -Defined in: [mcp/delegation-store.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L68) - -**`Experimental`** - -A delegation-store read or write failed (filesystem error, store -called before `loadAll`, ...). Once the queue observes one, it stops -accepting new submissions — accepting work it cannot journal would -silently demote durable mode to in-memory mode. - -## Extends - -- `AgentEvalError` - -## Constructors - -### Constructor - -> **new DelegationPersistenceError**(`message`, `options?`): `DelegationPersistenceError` - -Defined in: [mcp/delegation-store.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L69) - -**`Experimental`** - -#### Parameters - -##### message - -`string` - -##### options? - -###### cause? - -`unknown` - -#### Returns - -`DelegationPersistenceError` - -#### Overrides - -`AgentEvalError.constructor` diff --git a/docs/api/mcp/classes/DelegationStateCorruptError.md b/docs/api/mcp/classes/DelegationStateCorruptError.md deleted file mode 100644 index 27b88f8..0000000 --- a/docs/api/mcp/classes/DelegationStateCorruptError.md +++ /dev/null @@ -1,52 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationStateCorruptError - -# Class: DelegationStateCorruptError - -Defined in: [mcp/delegation-store.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L54) - -**`Experimental`** - -The persisted delegation state exists but cannot be parsed into -records. Fail loud: silently starting empty over a corrupt journal -would erase delegation history and re-run idempotent work. Opt into -recovery explicitly via `FileDelegationStoreOptions.recoverCorrupt` -(the bin maps `AGENT_RUNTIME_DELEGATION_STATE_RECOVER=1` onto it), -which archives the corrupt file and starts fresh. - -## Extends - -- `AgentEvalError` - -## Constructors - -### Constructor - -> **new DelegationStateCorruptError**(`message`, `options?`): `DelegationStateCorruptError` - -Defined in: [mcp/delegation-store.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L55) - -**`Experimental`** - -#### Parameters - -##### message - -`string` - -##### options? - -###### cause? - -`unknown` - -#### Returns - -`DelegationStateCorruptError` - -#### Overrides - -`AgentEvalError.constructor` diff --git a/docs/api/mcp/classes/DelegationTaskQueue.md b/docs/api/mcp/classes/DelegationTaskQueue.md deleted file mode 100644 index d1cc4b4..0000000 --- a/docs/api/mcp/classes/DelegationTaskQueue.md +++ /dev/null @@ -1,237 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationTaskQueue - -# Class: DelegationTaskQueue - -Defined in: [mcp/task-queue.ts:242](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L242) - -**`Experimental`** - -## Constructors - -### Constructor - -> **new DelegationTaskQueue**(`options?`): `DelegationTaskQueue` - -Defined in: [mcp/task-queue.ts:256](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L256) - -**`Experimental`** - -#### Parameters - -##### options? - -[`DelegationTaskQueueOptions`](../interfaces/DelegationTaskQueueOptions.md) = `{}` - -#### Returns - -`DelegationTaskQueue` - -## Methods - -### restore() - -> `static` **restore**(`options?`): `Promise`\<`DelegationTaskQueue`\> - -Defined in: [mcp/task-queue.ts:292](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L292) - -**`Experimental`** - -Construct a queue from previously-persisted state. Loads every record -from `options.store`, rebuilds the idempotency index (so a re-submitted -identical task returns the prior taskId and its terminal state), then: - - - terminal records stay queryable via `status()` / `history()` - - in-flight records with a `detachedSessionRef` re-attach through - `options.resumeDelegate` and report `running` - - other in-flight records settle as failed — their driver died with - the previous process and the result is unrecoverable - -The retention cap applies to the loaded set as well. - -#### Parameters - -##### options? - -[`DelegationTaskQueueOptions`](../interfaces/DelegationTaskQueueOptions.md) = `{}` - -#### Returns - -`Promise`\<`DelegationTaskQueue`\> - -*** - -### submit() - -> **submit**\<`Args`\>(`input`): [`SubmitOutput`](../interfaces/SubmitOutput.md) - -Defined in: [mcp/task-queue.ts:305](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L305) - -**`Experimental`** - -Kick off a delegation in the background. Returns immediately. The -`taskId` is queryable via `status` once this method returns. Throws -the recorded `DelegationPersistenceError` once the store has failed — -the queue does not accept work it cannot journal. - -#### Type Parameters - -##### Args - -`Args` *extends* `AnyDelegateArgs` - -#### Parameters - -##### input - -[`SubmitInput`](../interfaces/SubmitInput.md)\<`Args`\> - -#### Returns - -[`SubmitOutput`](../interfaces/SubmitOutput.md) - -*** - -### status() - -> **status**(`taskId`, `opts?`): [`DelegationStatusResult`](../interfaces/DelegationStatusResult.md) \| `undefined` - -Defined in: [mcp/task-queue.ts:355](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L355) - -**`Experimental`** - -Snapshot the current state of a delegation. Returns `undefined` for -unknown ids so callers can distinguish missing from terminal. -`includeTrace` attaches the journaled loop-trace span tree — off by -default so status polls stay light. - -#### Parameters - -##### taskId - -`string` - -##### opts? - -###### includeTrace? - -`boolean` - -#### Returns - -[`DelegationStatusResult`](../interfaces/DelegationStatusResult.md) \| `undefined` - -*** - -### cancel() - -> **cancel**(`taskId`): `boolean` - -Defined in: [mcp/task-queue.ts:368](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L368) - -**`Experimental`** - -Abort an in-flight delegation. Returns `false` if the task is unknown -or already terminal. The underlying `run` function MUST honor the -abort signal for the cancel to take effect; the queue marks the -record `cancelled` regardless so a misbehaving runner cannot pin the -UI on `running` forever. - -#### Parameters - -##### taskId - -`string` - -#### Returns - -`boolean` - -*** - -### attachFeedback() - -> **attachFeedback**(`taskId`, `snapshot`): `boolean` - -Defined in: [mcp/task-queue.ts:388](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L388) - -**`Experimental`** - -Append a feedback event to the matching delegation. Returns `false` -when `ref` does not name a known taskId — the caller should still -record the feedback through a different surface (artifact/outcome -kinds are not queue-bound). - -#### Parameters - -##### taskId - -`string` - -##### snapshot - -[`DelegationFeedbackSnapshot`](../interfaces/DelegationFeedbackSnapshot.md) - -#### Returns - -`boolean` - -*** - -### history() - -> **history**(`args?`): [`DelegationHistoryEntry`](../interfaces/DelegationHistoryEntry.md)[] - -Defined in: [mcp/task-queue.ts:400](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L400) - -**`Experimental`** - -Query the recorded delegations. Returns entries newest-first (by -`startedAt`), truncated to `limit`. - -#### Parameters - -##### args? - -[`DelegationHistoryArgs`](../interfaces/DelegationHistoryArgs.md) = `{}` - -#### Returns - -[`DelegationHistoryEntry`](../interfaces/DelegationHistoryEntry.md)[] - -*** - -### flush() - -> **flush**(): `Promise`\<`void`\> - -Defined in: [mcp/task-queue.ts:419](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L419) - -**`Experimental`** - -Await every journal write issued so far. Rejects with the recorded -`DelegationPersistenceError` when any of them failed. Call before -handing the store's backing file to another process. - -#### Returns - -`Promise`\<`void`\> - -*** - -### inflightCount() - -> **inflightCount**(): `number` - -Defined in: [mcp/task-queue.ts:435](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L435) - -**`Experimental`** - -Test-only — number of in-flight (non-terminal) records. - -#### Returns - -`number` diff --git a/docs/api/mcp/classes/FileDelegationStore.md b/docs/api/mcp/classes/FileDelegationStore.md deleted file mode 100644 index 61cf100..0000000 --- a/docs/api/mcp/classes/FileDelegationStore.md +++ /dev/null @@ -1,149 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / FileDelegationStore - -# Class: FileDelegationStore - -Defined in: [mcp/delegation-store.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L130) - -**`Experimental`** - -JSON-file persistence for the delegation queue. Each write serializes -the full record set and lands it atomically (write to a sibling tmp -file, then `rename`), so readers never observe a torn file — a crash -mid-write leaves the previous snapshot intact. Writes are serialized -internally; concurrent `upsert`/`remove` calls cannot interleave. - -Built for the MCP server's scale (one stdio process, hundreds of -records): full-snapshot writes keep the format trivially inspectable -and corruption-detectable without a database dependency. - -## Implements - -- [`DelegationStore`](../interfaces/DelegationStore.md) - -## Constructors - -### Constructor - -> **new FileDelegationStore**(`options`): `FileDelegationStore` - -Defined in: [mcp/delegation-store.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L138) - -**`Experimental`** - -#### Parameters - -##### options - -[`FileDelegationStoreOptions`](../interfaces/FileDelegationStoreOptions.md) - -#### Returns - -`FileDelegationStore` - -## Methods - -### loadAll() - -> **loadAll**(): `Promise`\<[`DelegationRecord`](../interfaces/DelegationRecord.md)[]\> - -Defined in: [mcp/delegation-store.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L143) - -**`Experimental`** - -Read every persisted record. Called once, by -`DelegationTaskQueue.restore`, before any write. A missing backing -file is an empty store; an unparseable one throws -`DelegationStateCorruptError`. - -#### Returns - -`Promise`\<[`DelegationRecord`](../interfaces/DelegationRecord.md)[]\> - -#### Implementation of - -[`DelegationStore`](../interfaces/DelegationStore.md).[`loadAll`](../interfaces/DelegationStore.md#loadall) - -*** - -### upsert() - -> **upsert**(`record`): `Promise`\<`void`\> - -Defined in: [mcp/delegation-store.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L180) - -**`Experimental`** - -Insert or replace the record keyed by `record.taskId`. - -#### Parameters - -##### record - -[`DelegationRecord`](../interfaces/DelegationRecord.md) - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`DelegationStore`](../interfaces/DelegationStore.md).[`upsert`](../interfaces/DelegationStore.md#upsert) - -*** - -### lookupIdempotencyKey() - -> **lookupIdempotencyKey**(`key`): `Promise`\<`string` \| `undefined`\> - -Defined in: [mcp/delegation-store.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L186) - -**`Experimental`** - -Resolve an idempotency key to the taskId that claimed it, if any. -The queue serves submit-time dedupe from its rehydrated in-memory -index; this read exists for consumers that share a store across -processes without holding the full record set. - -#### Parameters - -##### key - -`string` - -#### Returns - -`Promise`\<`string` \| `undefined`\> - -#### Implementation of - -[`DelegationStore`](../interfaces/DelegationStore.md).[`lookupIdempotencyKey`](../interfaces/DelegationStore.md#lookupidempotencykey) - -*** - -### remove() - -> **remove**(`taskIds`): `Promise`\<`void`\> - -Defined in: [mcp/delegation-store.ts:194](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L194) - -**`Experimental`** - -Delete the named records — the retention-cap eviction path. - -#### Parameters - -##### taskIds - -readonly `string`[] - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`DelegationStore`](../interfaces/DelegationStore.md).[`remove`](../interfaces/DelegationStore.md#remove) diff --git a/docs/api/mcp/classes/InMemoryDelegationStore.md b/docs/api/mcp/classes/InMemoryDelegationStore.md deleted file mode 100644 index 65cc846..0000000 --- a/docs/api/mcp/classes/InMemoryDelegationStore.md +++ /dev/null @@ -1,131 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / InMemoryDelegationStore - -# Class: InMemoryDelegationStore - -Defined in: [mcp/delegation-store.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L75) - -**`Experimental`** - -## Implements - -- [`DelegationStore`](../interfaces/DelegationStore.md) - -## Constructors - -### Constructor - -> **new InMemoryDelegationStore**(): `InMemoryDelegationStore` - -**`Experimental`** - -#### Returns - -`InMemoryDelegationStore` - -## Methods - -### loadAll() - -> **loadAll**(): `Promise`\<[`DelegationRecord`](../interfaces/DelegationRecord.md)[]\> - -Defined in: [mcp/delegation-store.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L78) - -**`Experimental`** - -Read every persisted record. Called once, by -`DelegationTaskQueue.restore`, before any write. A missing backing -file is an empty store; an unparseable one throws -`DelegationStateCorruptError`. - -#### Returns - -`Promise`\<[`DelegationRecord`](../interfaces/DelegationRecord.md)[]\> - -#### Implementation of - -[`DelegationStore`](../interfaces/DelegationStore.md).[`loadAll`](../interfaces/DelegationStore.md#loadall) - -*** - -### upsert() - -> **upsert**(`record`): `Promise`\<`void`\> - -Defined in: [mcp/delegation-store.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L82) - -**`Experimental`** - -Insert or replace the record keyed by `record.taskId`. - -#### Parameters - -##### record - -[`DelegationRecord`](../interfaces/DelegationRecord.md) - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`DelegationStore`](../interfaces/DelegationStore.md).[`upsert`](../interfaces/DelegationStore.md#upsert) - -*** - -### lookupIdempotencyKey() - -> **lookupIdempotencyKey**(`key`): `Promise`\<`string` \| `undefined`\> - -Defined in: [mcp/delegation-store.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L86) - -**`Experimental`** - -Resolve an idempotency key to the taskId that claimed it, if any. -The queue serves submit-time dedupe from its rehydrated in-memory -index; this read exists for consumers that share a store across -processes without holding the full record set. - -#### Parameters - -##### key - -`string` - -#### Returns - -`Promise`\<`string` \| `undefined`\> - -#### Implementation of - -[`DelegationStore`](../interfaces/DelegationStore.md).[`lookupIdempotencyKey`](../interfaces/DelegationStore.md#lookupidempotencykey) - -*** - -### remove() - -> **remove**(`taskIds`): `Promise`\<`void`\> - -Defined in: [mcp/delegation-store.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L93) - -**`Experimental`** - -Delete the named records — the retention-cap eviction path. - -#### Parameters - -##### taskIds - -readonly `string`[] - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`DelegationStore`](../interfaces/DelegationStore.md).[`remove`](../interfaces/DelegationStore.md#remove) diff --git a/docs/api/mcp/classes/InMemoryFeedbackStore.md b/docs/api/mcp/classes/InMemoryFeedbackStore.md deleted file mode 100644 index 3e5d68d..0000000 --- a/docs/api/mcp/classes/InMemoryFeedbackStore.md +++ /dev/null @@ -1,86 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / InMemoryFeedbackStore - -# Class: InMemoryFeedbackStore - -Defined in: [mcp/feedback-store.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L41) - -**`Experimental`** - -## Implements - -- [`FeedbackStore`](../interfaces/FeedbackStore.md) - -## Constructors - -### Constructor - -> **new InMemoryFeedbackStore**(): `InMemoryFeedbackStore` - -**`Experimental`** - -#### Returns - -`InMemoryFeedbackStore` - -## Methods - -### put() - -> **put**(`event`): `Promise`\<`void`\> - -Defined in: [mcp/feedback-store.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L44) - -**`Experimental`** - -Append a new event. Never dedupes — every rating is its own event. - -#### Parameters - -##### event - -[`FeedbackEvent`](../interfaces/FeedbackEvent.md) - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`FeedbackStore`](../interfaces/FeedbackStore.md).[`put`](../interfaces/FeedbackStore.md#put) - -*** - -### list() - -> **list**(`filter?`): `Promise`\<[`FeedbackEvent`](../interfaces/FeedbackEvent.md)[]\> - -Defined in: [mcp/feedback-store.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L48) - -**`Experimental`** - -List events filtered by `namespace`. When `namespace` is omitted, list -across all namespaces. Returns events in insertion order. - -#### Parameters - -##### filter? - -###### namespace? - -`string` - -###### refersToRef? - -`string` - -#### Returns - -`Promise`\<[`FeedbackEvent`](../interfaces/FeedbackEvent.md)[]\> - -#### Implementation of - -[`FeedbackStore`](../interfaces/FeedbackStore.md).[`list`](../interfaces/FeedbackStore.md#list) diff --git a/docs/api/mcp/functions/buildDelegationMcpServer.md b/docs/api/mcp/functions/buildDelegationMcpServer.md deleted file mode 100644 index c0fd6a2..0000000 --- a/docs/api/mcp/functions/buildDelegationMcpServer.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / buildDelegationMcpServer - -# Function: buildDelegationMcpServer() - -> **buildDelegationMcpServer**(`options?`): `Record`\<`string`, `AgentProfileMcpServer`\> \| `undefined` - -Defined in: [mcp/delegation-profile.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L69) - -Build the delegation MCP entry the sandbox-side agent loads on startup. -Returns `undefined` when no sandbox API key is resolvable — callers merge -the result into a profile's `mcp` map only when defined. - -## Parameters - -### options? - -[`BuildDelegationMcpServerOptions`](../interfaces/BuildDelegationMcpServerOptions.md) = `{}` - -## Returns - -`Record`\<`string`, `AgentProfileMcpServer`\> \| `undefined` diff --git a/docs/api/mcp/functions/buildDelegationTraceSpans.md b/docs/api/mcp/functions/buildDelegationTraceSpans.md deleted file mode 100644 index 93544c9..0000000 --- a/docs/api/mcp/functions/buildDelegationTraceSpans.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / buildDelegationTraceSpans - -# Function: buildDelegationTraceSpans() - -> **buildDelegationTraceSpans**(`events`): [`DelegationTraceSpan`](../interfaces/DelegationTraceSpan.md)[] - -Defined in: [mcp/delegation-trace.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L73) - -**`Experimental`** - -Derive the compact span tree for ONE loop run from its buffered -`LoopTraceEvent` stream. Same reconstruction as the OTEL exporter -([buildLoopSpanNodes](../../index/functions/buildLoopSpanNodes.md)); tolerates partial streams. - -## Parameters - -### events - -readonly [`LoopTraceEvent`](../../runtime/type-aliases/LoopTraceEvent.md)[] - -## Returns - -[`DelegationTraceSpan`](../interfaces/DelegationTraceSpan.md)[] diff --git a/docs/api/mcp/functions/capDelegationTrace.md b/docs/api/mcp/functions/capDelegationTrace.md deleted file mode 100644 index d76981e..0000000 --- a/docs/api/mcp/functions/capDelegationTrace.md +++ /dev/null @@ -1,34 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / capDelegationTrace - -# Function: capDelegationTrace() - -> **capDelegationTrace**(`spans`, `caps?`): [`CappedDelegationTrace`](../interfaces/CappedDelegationTrace.md) - -Defined in: [mcp/delegation-trace.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L97) - -**`Experimental`** - -Enforce the trace caps over an ordered (oldest-first) span list. Drops the -OLDEST spans first and reports `truncated: true` when anything was dropped; -the newest span always survives, so a non-empty input never caps to empty. -Dropping a parent may orphan surviving children's `parentSpanId` references -— acceptable for the flat journal shape; consumers treat unresolved parents -as roots. - -## Parameters - -### spans - -readonly [`DelegationTraceSpan`](../interfaces/DelegationTraceSpan.md)[] - -### caps? - -[`DelegationTraceCaps`](../interfaces/DelegationTraceCaps.md) - -## Returns - -[`CappedDelegationTrace`](../interfaces/CappedDelegationTrace.md) diff --git a/docs/api/mcp/functions/captureWorktreeDiff.md b/docs/api/mcp/functions/captureWorktreeDiff.md deleted file mode 100644 index 8dbca11..0000000 --- a/docs/api/mcp/functions/captureWorktreeDiff.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / captureWorktreeDiff - -# Function: captureWorktreeDiff() - -> **captureWorktreeDiff**(`options`): `Promise`\<[`DiffResult`](../interfaces/DiffResult.md)\> - -Defined in: [mcp/worktree.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L133) - -**`Experimental`** - -## Parameters - -### options - -[`DiffOptions`](../interfaces/DiffOptions.md) - -## Returns - -`Promise`\<[`DiffResult`](../interfaces/DiffResult.md)\> diff --git a/docs/api/mcp/functions/coderTaskFromArgs.md b/docs/api/mcp/functions/coderTaskFromArgs.md deleted file mode 100644 index bf432ee..0000000 --- a/docs/api/mcp/functions/coderTaskFromArgs.md +++ /dev/null @@ -1,28 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / coderTaskFromArgs - -# Function: coderTaskFromArgs() - -> **coderTaskFromArgs**(`args`): [`CoderTask`](../../profiles/interfaces/CoderTask.md) - -Defined in: [mcp/delegates.ts:430](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L430) - -**`Experimental`** - -Canonical `DelegateCodeArgs` → `CoderTask` mapping — the single source for -the delegate's live dispatch AND the resume driver's settle/message -rebuilding, so a resumed record reproduces exactly the task the original -process dispatched. - -## Parameters - -### args - -[`DelegateCodeArgs`](../interfaces/DelegateCodeArgs.md) - -## Returns - -[`CoderTask`](../../profiles/interfaces/CoderTask.md) diff --git a/docs/api/mcp/functions/composeLoopTraceEmitters.md b/docs/api/mcp/functions/composeLoopTraceEmitters.md deleted file mode 100644 index ca59e5c..0000000 --- a/docs/api/mcp/functions/composeLoopTraceEmitters.md +++ /dev/null @@ -1,28 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / composeLoopTraceEmitters - -# Function: composeLoopTraceEmitters() - -> **composeLoopTraceEmitters**(...`emitters`): [`LoopTraceEmitter`](../../runtime/interfaces/LoopTraceEmitter.md) \| `undefined` - -Defined in: [mcp/delegation-trace.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L184) - -**`Experimental`** - -Fan one `LoopTraceEvent` stream into several emitters — e.g. the -process-wide OTEL exporter AND the per-delegation journal collector. -`undefined` entries are skipped; returns `undefined` when nothing is left -so callers keep the kernel's "no emitter, no events" fast path. - -## Parameters - -### emitters - -...readonly ([`LoopTraceEmitter`](../../runtime/interfaces/LoopTraceEmitter.md) \| `undefined`)[] - -## Returns - -[`LoopTraceEmitter`](../../runtime/interfaces/LoopTraceEmitter.md) \| `undefined` diff --git a/docs/api/mcp/functions/composeProductionAgentProfile.md b/docs/api/mcp/functions/composeProductionAgentProfile.md deleted file mode 100644 index 3ff35fc..0000000 --- a/docs/api/mcp/functions/composeProductionAgentProfile.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / composeProductionAgentProfile - -# Function: composeProductionAgentProfile() - -> **composeProductionAgentProfile**(`baseProfile`, `options?`): `AgentProfile` - -Defined in: [mcp/delegation-profile.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L164) - -Compose the production `AgentProfile`: the canonical base profile with the -delegation MCP merged into `mcp`. Used by every call site that boots a -sandbox or runs a chat turn through the sandbox path, and by eval wiring so -the scorecard profile hash reflects the actual production profile. - -Merge rules: - - `mcp`: base map preserved; `options.mcpConnections` (resolved certified - servers) merged over it; the delegation entry is appended last under - [DELEGATION\_MCP\_SERVER\_KEY](../variables/DELEGATION_MCP_SERVER_KEY.md), and omitted entirely when no sandbox - API key resolves. - - `tools`: base box-flags map preserved; `options.tools` overlaid per key. - - `hooks`: per event, base commands preserved; `options.hooks[event]` - appended after the base ones. - - `subagents`: base map preserved; `options.subagents` overlaid per key. - - `prompt.systemPrompt`: replaced when `options.systemPrompt` is set. - - `resources.files`: `options.extraFiles` concatenated after base files. - - `name`: replaced when `options.name` is set. - -## Parameters - -### baseProfile - -`AgentProfile` - -### options? - -[`ComposeProductionAgentProfileOptions`](../interfaces/ComposeProductionAgentProfileOptions.md) = `{}` - -## Returns - -`AgentProfile` diff --git a/docs/api/mcp/functions/createCoordinationTools.md b/docs/api/mcp/functions/createCoordinationTools.md deleted file mode 100644 index 8036b81..0000000 --- a/docs/api/mcp/functions/createCoordinationTools.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createCoordinationTools - -# Function: createCoordinationTools() - -> **createCoordinationTools**(`opts`): [`CoordinationTools`](../interfaces/CoordinationTools.md) - -Defined in: [mcp/tools/coordination.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L137) - -Build the driver's MCP tools over a live scope. - -## Parameters - -### opts - -[`CoordinationToolsOptions`](../interfaces/CoordinationToolsOptions.md) - -## Returns - -[`CoordinationTools`](../interfaces/CoordinationTools.md) diff --git a/docs/api/mcp/functions/createDelegateCodeHandler.md b/docs/api/mcp/functions/createDelegateCodeHandler.md deleted file mode 100644 index b2f5009..0000000 --- a/docs/api/mcp/functions/createDelegateCodeHandler.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createDelegateCodeHandler - -# Function: createDelegateCodeHandler() - -> **createDelegateCodeHandler**(`options`): (`raw`) => `Promise`\<[`DelegateCodeResult`](../interfaces/DelegateCodeResult.md)\> - -Defined in: [mcp/tools/delegate-code.ts:177](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-code.ts#L177) - -**`Experimental`** - -## Parameters - -### options - -`DelegateCodeHandlerOptions` - -## Returns - -(`raw`) => `Promise`\<[`DelegateCodeResult`](../interfaces/DelegateCodeResult.md)\> diff --git a/docs/api/mcp/functions/createDelegateFeedbackHandler.md b/docs/api/mcp/functions/createDelegateFeedbackHandler.md deleted file mode 100644 index 3abe50e..0000000 --- a/docs/api/mcp/functions/createDelegateFeedbackHandler.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createDelegateFeedbackHandler - -# Function: createDelegateFeedbackHandler() - -> **createDelegateFeedbackHandler**(`options`): (`raw`) => `Promise`\<[`DelegateFeedbackResult`](../interfaces/DelegateFeedbackResult.md)\> - -Defined in: [mcp/tools/delegate-feedback.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-feedback.ts#L159) - -**`Experimental`** - -## Parameters - -### options - -`DelegateFeedbackHandlerOptions` - -## Returns - -(`raw`) => `Promise`\<[`DelegateFeedbackResult`](../interfaces/DelegateFeedbackResult.md)\> diff --git a/docs/api/mcp/functions/createDelegateResearchHandler.md b/docs/api/mcp/functions/createDelegateResearchHandler.md deleted file mode 100644 index 27e34d2..0000000 --- a/docs/api/mcp/functions/createDelegateResearchHandler.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createDelegateResearchHandler - -# Function: createDelegateResearchHandler() - -> **createDelegateResearchHandler**(`options`): (`raw`) => `Promise`\<[`DelegateResearchResult`](../interfaces/DelegateResearchResult.md)\> - -Defined in: [mcp/tools/delegate-research.ts:192](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-research.ts#L192) - -**`Experimental`** - -## Parameters - -### options - -`DelegateResearchHandlerOptions` - -## Returns - -(`raw`) => `Promise`\<[`DelegateResearchResult`](../interfaces/DelegateResearchResult.md)\> diff --git a/docs/api/mcp/functions/createDelegateUiAuditHandler.md b/docs/api/mcp/functions/createDelegateUiAuditHandler.md deleted file mode 100644 index 2744160..0000000 --- a/docs/api/mcp/functions/createDelegateUiAuditHandler.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createDelegateUiAuditHandler - -# Function: createDelegateUiAuditHandler() - -> **createDelegateUiAuditHandler**(`options`): (`raw`) => `Promise`\<[`DelegateUiAuditResult`](../interfaces/DelegateUiAuditResult.md)\> - -Defined in: [mcp/tools/delegate-ui-audit.ts:300](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-ui-audit.ts#L300) - -**`Experimental`** - -## Parameters - -### options - -`DelegateUiAuditHandlerOptions` - -## Returns - -(`raw`) => `Promise`\<[`DelegateUiAuditResult`](../interfaces/DelegateUiAuditResult.md)\> diff --git a/docs/api/mcp/functions/createDelegationHistoryHandler.md b/docs/api/mcp/functions/createDelegationHistoryHandler.md deleted file mode 100644 index d8b05de..0000000 --- a/docs/api/mcp/functions/createDelegationHistoryHandler.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createDelegationHistoryHandler - -# Function: createDelegationHistoryHandler() - -> **createDelegationHistoryHandler**(`options`): (`raw`) => `Promise`\<[`DelegationHistoryResult`](../interfaces/DelegationHistoryResult.md)\> - -Defined in: [mcp/tools/delegation-history.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-history.ts#L94) - -**`Experimental`** - -## Parameters - -### options - -`DelegationHistoryHandlerOptions` - -## Returns - -(`raw`) => `Promise`\<[`DelegationHistoryResult`](../interfaces/DelegationHistoryResult.md)\> diff --git a/docs/api/mcp/functions/createDelegationStatusHandler.md b/docs/api/mcp/functions/createDelegationStatusHandler.md deleted file mode 100644 index e18048a..0000000 --- a/docs/api/mcp/functions/createDelegationStatusHandler.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createDelegationStatusHandler - -# Function: createDelegationStatusHandler() - -> **createDelegationStatusHandler**(`options`): (`raw`) => `Promise`\<[`DelegationStatusResult`](../interfaces/DelegationStatusResult.md)\> - -Defined in: [mcp/tools/delegation-status.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-status.ts#L81) - -**`Experimental`** - -## Parameters - -### options - -`DelegationStatusHandlerOptions` - -## Returns - -(`raw`) => `Promise`\<[`DelegationStatusResult`](../interfaces/DelegationStatusResult.md)\> diff --git a/docs/api/mcp/functions/createDelegationTraceCollector.md b/docs/api/mcp/functions/createDelegationTraceCollector.md deleted file mode 100644 index 87efda4..0000000 --- a/docs/api/mcp/functions/createDelegationTraceCollector.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createDelegationTraceCollector - -# Function: createDelegationTraceCollector() - -> **createDelegationTraceCollector**(`onSpans`): [`DelegationTraceCollector`](../interfaces/DelegationTraceCollector.md) - -Defined in: [mcp/delegation-trace.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L130) - -**`Experimental`** - -## Parameters - -### onSpans - -(`spans`) => `void` - -## Returns - -[`DelegationTraceCollector`](../interfaces/DelegationTraceCollector.md) diff --git a/docs/api/mcp/functions/createDriveTurnResumeDriver.md b/docs/api/mcp/functions/createDriveTurnResumeDriver.md deleted file mode 100644 index 5ddf2d0..0000000 --- a/docs/api/mcp/functions/createDriveTurnResumeDriver.md +++ /dev/null @@ -1,40 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createDriveTurnResumeDriver - -# Function: createDriveTurnResumeDriver() - -> **createDriveTurnResumeDriver**(`options`): [`DelegationResumeDriver`](../interfaces/DelegationResumeDriver.md) - -Defined in: [mcp/detached-turn.ts:415](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L415) - -**`Experimental`** - -Build the `driveTurn`-backed [DelegationResumeDriver](../interfaces/DelegationResumeDriver.md). Each `tick()` -is one settle/poll/dispatch pass: - - - ref without a sandbox binding → `failed` (`DetachedSessionUnboundError`): - the previous process died before a box existed; there is nothing to resume. - - `driveTurn` `completed` → `settleOutput` → `completed` tick. - - `running` → progress via `ctx.report`, `running` tick (queue re-ticks - after `intervalMs`). - - `failed` → `failed` tick (`DetachedTurnFailedError`) — terminal per the - SDK's deterministic-failure contract. - -Abort: the queue stops ticking once `cancel()` flips the record, so remote -cancellation is hooked onto `ctx.signal` (once per task) and fires -`_sessionCancel` when the SDK surface exposes it. The driver never deletes -boxes — it cannot know whether `sandboxId` is a disposable sibling or a -fleet machine, and destroying a fleet machine would be unrecoverable. - -## Parameters - -### options - -[`DriveTurnResumeDriverOptions`](../interfaces/DriveTurnResumeDriverOptions.md) - -## Returns - -[`DelegationResumeDriver`](../interfaces/DelegationResumeDriver.md) diff --git a/docs/api/mcp/functions/createFleetWorkspaceExecutor.md b/docs/api/mcp/functions/createFleetWorkspaceExecutor.md deleted file mode 100644 index 8f3b803..0000000 --- a/docs/api/mcp/functions/createFleetWorkspaceExecutor.md +++ /dev/null @@ -1,28 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createFleetWorkspaceExecutor - -# Function: createFleetWorkspaceExecutor() - -> **createFleetWorkspaceExecutor**(`options`): [`DelegationExecutor`](../interfaces/DelegationExecutor.md) - -Defined in: [mcp/executor.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L116) - -**`Experimental`** - -Build an executor that resolves each delegated iteration to an existing -machine in `fleet`. The fleet's shared-workspace policy means the worker -machine sees the caller's filesystem — diffs land in-place with no -cross-sandbox copy step. - -## Parameters - -### options - -[`FleetWorkspaceExecutorOptions`](../interfaces/FleetWorkspaceExecutorOptions.md) - -## Returns - -[`DelegationExecutor`](../interfaces/DelegationExecutor.md) diff --git a/docs/api/mcp/functions/createInProcessExecutor.md b/docs/api/mcp/functions/createInProcessExecutor.md deleted file mode 100644 index f96d2a4..0000000 --- a/docs/api/mcp/functions/createInProcessExecutor.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createInProcessExecutor - -# Function: createInProcessExecutor() - -> **createInProcessExecutor**(`options`): [`DelegationExecutor`](../interfaces/DelegationExecutor.md) - -Defined in: [mcp/in-process-executor.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L87) - -**`Experimental`** - -Build an in-process executor. Returns a [DelegationExecutor](../interfaces/DelegationExecutor.md) whose `client.create()` -returns a minimal virtual `SandboxInstance`; the kernel calls `streamPrompt(msg)` on it, which -runs the shared worktree-harness core and emits one `result` event whose `data.result` is the -raw `WorktreeHarnessResult` (the content-addressed patch artifact). The authored profile -(`backend.profile`) threads its systemPrompt + model into the harness via the core. - -## Parameters - -### options - -[`InProcessExecutorOptions`](../interfaces/InProcessExecutorOptions.md) - -## Returns - -[`DelegationExecutor`](../interfaces/DelegationExecutor.md) diff --git a/docs/api/mcp/functions/createInProcessTransport.md b/docs/api/mcp/functions/createInProcessTransport.md deleted file mode 100644 index 8937a96..0000000 --- a/docs/api/mcp/functions/createInProcessTransport.md +++ /dev/null @@ -1,55 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createInProcessTransport - -# Function: createInProcessTransport() - -> **createInProcessTransport**(): `object` - -Defined in: [mcp/server.ts:367](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L367) - -**`Experimental`** - -In-process pair of `Readable` + `Writable` streams suitable for driving -`server.serve(...)` from a test. Returns the agent-side stream (the -client writes to it) and the server-side stream (the test reads from it). - -## Returns - -`object` - -### transport - -> **transport**: [`McpTransport`](../interfaces/McpTransport.md) - -### clientWrite() - -> **clientWrite**(`line`): `void` - -#### Parameters - -##### line - -`string` - -#### Returns - -`void` - -### clientClose() - -> **clientClose**(): `void` - -#### Returns - -`void` - -### readServer() - -> **readServer**(): `Promise`\<[`JsonRpcResponse`](../interfaces/JsonRpcResponse.md)[]\> - -#### Returns - -`Promise`\<[`JsonRpcResponse`](../interfaces/JsonRpcResponse.md)[]\> diff --git a/docs/api/mcp/functions/createKbGate.md b/docs/api/mcp/functions/createKbGate.md deleted file mode 100644 index ae032e1..0000000 --- a/docs/api/mcp/functions/createKbGate.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createKbGate - -# Function: createKbGate() - -> **createKbGate**(`options?`): (`candidate`) => `Promise`\<[`KbGateResult`](../interfaces/KbGateResult.md)\> - -Defined in: [mcp/kb-gate.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L137) - -**`Experimental`** - -Build a fail-closed KB gate. The returned function runs the built-in floor -(passage-non-empty → passage-present → value-in-passage → no-circular-citation) -then any consumer judges, returning on the first veto. - -## Parameters - -### options? - -[`CreateKbGateOptions`](../interfaces/CreateKbGateOptions.md) = `{}` - -## Returns - -(`candidate`) => `Promise`\<[`KbGateResult`](../interfaces/KbGateResult.md)\> diff --git a/docs/api/mcp/functions/createMcpServer.md b/docs/api/mcp/functions/createMcpServer.md deleted file mode 100644 index dbfb6dd..0000000 --- a/docs/api/mcp/functions/createMcpServer.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createMcpServer - -# Function: createMcpServer() - -> **createMcpServer**(`options?`): [`McpServer`](../interfaces/McpServer.md) - -Defined in: [mcp/server.ts:163](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L163) - -**`Experimental`** - -## Parameters - -### options? - -[`McpServerOptions`](../interfaces/McpServerOptions.md) = `{}` - -## Returns - -[`McpServer`](../interfaces/McpServer.md) diff --git a/docs/api/mcp/functions/createPropagatingTraceEmitter.md b/docs/api/mcp/functions/createPropagatingTraceEmitter.md deleted file mode 100644 index 9f59f39..0000000 --- a/docs/api/mcp/functions/createPropagatingTraceEmitter.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createPropagatingTraceEmitter - -# Function: createPropagatingTraceEmitter() - -> **createPropagatingTraceEmitter**(`ctx`): `object` - -Defined in: [mcp/trace-propagation.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/trace-propagation.ts#L48) - -Create a LoopTraceEmitter that: - 1. Parents all spans under the inherited PARENT_SPAN_ID. - 2. Exports spans to OTEL when OTEL_EXPORTER_OTLP_ENDPOINT is set. - -Returns both the emitter and the optional exporter handle for shutdown. - -## Parameters - -### ctx - -[`TraceContext`](../interfaces/TraceContext.md) - -## Returns - -`object` - -### emitter - -> **emitter**: [`LoopTraceEmitter`](../../runtime/interfaces/LoopTraceEmitter.md) - -### exporter - -> **exporter**: [`OtelExporter`](../../index/interfaces/OtelExporter.md) \| `undefined` - -### context - -> **context**: [`TraceContext`](../interfaces/TraceContext.md) diff --git a/docs/api/mcp/functions/createSiblingSandboxExecutor.md b/docs/api/mcp/functions/createSiblingSandboxExecutor.md deleted file mode 100644 index 80334d9..0000000 --- a/docs/api/mcp/functions/createSiblingSandboxExecutor.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createSiblingSandboxExecutor - -# Function: createSiblingSandboxExecutor() - -> **createSiblingSandboxExecutor**(`options`): [`DelegationExecutor`](../interfaces/DelegationExecutor.md) - -Defined in: [mcp/executor.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L54) - -**`Experimental`** - -Wrap a raw sandbox SDK client so the kernel emits -`loop.iteration.dispatch` events with `{ placement: 'sibling', sandboxId }`. - -The returned client `.create()` delegates to the underlying client; the -only added behavior is a `describePlacement` tag the kernel reads. - -## Parameters - -### options - -[`SiblingSandboxExecutorOptions`](../interfaces/SiblingSandboxExecutorOptions.md) - -## Returns - -[`DelegationExecutor`](../interfaces/DelegationExecutor.md) diff --git a/docs/api/mcp/functions/createWorktree.md b/docs/api/mcp/functions/createWorktree.md deleted file mode 100644 index 2e882b5..0000000 --- a/docs/api/mcp/functions/createWorktree.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / createWorktree - -# Function: createWorktree() - -> **createWorktree**(`options`): `Promise`\<[`WorktreeHandle`](../interfaces/WorktreeHandle.md)\> - -Defined in: [mcp/worktree.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L113) - -**`Experimental`** - -## Parameters - -### options - -[`CreateWorktreeOptions`](../interfaces/CreateWorktreeOptions.md) - -## Returns - -`Promise`\<[`WorktreeHandle`](../interfaces/WorktreeHandle.md)\> diff --git a/docs/api/mcp/functions/detachedSessionDelegate.md b/docs/api/mcp/functions/detachedSessionDelegate.md deleted file mode 100644 index c5666b1..0000000 --- a/docs/api/mcp/functions/detachedSessionDelegate.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / detachedSessionDelegate - -# Function: detachedSessionDelegate() - -> **detachedSessionDelegate**(`options`): [`CoderDelegate`](../type-aliases/CoderDelegate.md) - -Defined in: [mcp/delegates.ts:223](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L223) - -**`Experimental`** - -Build the sandbox-session coder delegate. It drives `runLoop` against the project's -sandbox client + coder profile; when `args.variants > 1` it switches to the multi-harness fanout -topology. - -This is the SANDBOX-SESSION coder path: workers run the in-box harness via the -`SandboxClient`'s `streamPrompt`, and single-variant turns can dispatch DETACHED -(driveTurn ticks) so a durable queue resumes them across an MCP restart — a substrate -the recursive worktree-CLI leaf does not yet have a journal-replay equivalent for. - -For NEW local-repo coding use `worktreeFanout` / `worktreeLoopRunner` (author an `AgentProfile` -per harness → `createWorktreeCliExecutor` leaves → `gateOnDeliverable`). This delegate stays as the -MCP server's built-in `delegate_code` path; it runs held-stream by default and only its OPTIONAL -cross-restart resume (the `driveTurn` tick) is opt-in behind `MCP_ENABLE_DETACHED_RESUME`. - -## Parameters - -### options - -[`DetachedSessionDelegateOptions`](../interfaces/DetachedSessionDelegateOptions.md) - -## Returns - -[`CoderDelegate`](../type-aliases/CoderDelegate.md) diff --git a/docs/api/mcp/functions/detachedTurnEvents.md b/docs/api/mcp/functions/detachedTurnEvents.md deleted file mode 100644 index 681b63b..0000000 --- a/docs/api/mcp/functions/detachedTurnEvents.md +++ /dev/null @@ -1,32 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / detachedTurnEvents - -# Function: detachedTurnEvents() - -> **detachedTurnEvents**(`sessionId`, `turn`): `SandboxEvent`[] - -Defined in: [mcp/detached-turn.ts:150](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L150) - -**`Experimental`** - -Synthesize the terminal event array a detached turn settles through. Shaped -so the existing event-stream output adapters (coder, researcher) parse it: -`data.result` for adapters that read a structured terminal record, `data.text` -for adapters that scan assistant text for the fenced result block. - -## Parameters - -### sessionId - -`string` - -### turn - -[`DetachedTurn`](../interfaces/DetachedTurn.md) - -## Returns - -`SandboxEvent`[] diff --git a/docs/api/mcp/functions/detectExecutor.md b/docs/api/mcp/functions/detectExecutor.md deleted file mode 100644 index 8c5ba27..0000000 --- a/docs/api/mcp/functions/detectExecutor.md +++ /dev/null @@ -1,34 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / detectExecutor - -# Function: detectExecutor() - -> **detectExecutor**(`args`): `Promise`\<[`DelegationExecutor`](../interfaces/DelegationExecutor.md)\> - -Defined in: [mcp/bin-helpers.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/bin-helpers.ts#L46) - -**`Experimental`** - -Pick the right executor for an MCP server invocation based on env vars. - -- `TANGLE_FLEET_ID` set → fleet-workspace placement; resolves the handle - via `sandboxClient.fleets.get(...)`. -- Otherwise → sibling-sandbox placement; each delegation creates a fresh - sandbox via `sandboxClient.create(...)`. - -Fails loud (throws) when fleet mode is requested but the SDK shape is -incompatible — the operator chose fleet semantics, silently degrading to -sibling mode would lie about workspace topology. - -## Parameters - -### args - -[`DetectExecutorArgs`](../interfaces/DetectExecutorArgs.md) - -## Returns - -`Promise`\<[`DelegationExecutor`](../interfaces/DelegationExecutor.md)\> diff --git a/docs/api/mcp/functions/eventToSnapshot.md b/docs/api/mcp/functions/eventToSnapshot.md deleted file mode 100644 index a0e7d6c..0000000 --- a/docs/api/mcp/functions/eventToSnapshot.md +++ /dev/null @@ -1,26 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / eventToSnapshot - -# Function: eventToSnapshot() - -> **eventToSnapshot**(`event`): [`DelegationFeedbackSnapshot`](../interfaces/DelegationFeedbackSnapshot.md) - -Defined in: [mcp/feedback-store.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L66) - -**`Experimental`** - -Project a `FeedbackEvent` down to the snapshot shape carried on -`delegation_history` entries. - -## Parameters - -### event - -[`FeedbackEvent`](../interfaces/FeedbackEvent.md) - -## Returns - -[`DelegationFeedbackSnapshot`](../interfaces/DelegationFeedbackSnapshot.md) diff --git a/docs/api/mcp/functions/formatDetachedSessionRef.md b/docs/api/mcp/functions/formatDetachedSessionRef.md deleted file mode 100644 index 5dbfbc7..0000000 --- a/docs/api/mcp/functions/formatDetachedSessionRef.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / formatDetachedSessionRef - -# Function: formatDetachedSessionRef() - -> **formatDetachedSessionRef**(`parts`): `string` - -Defined in: [mcp/detached-turn.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L95) - -**`Experimental`** - -Encode ref parts into the JSON-safe string stored on the record: -`session=` before the box exists, `sandbox=;session=` once -bound. Ids must not contain the `;`/`=` delimiters. - -## Parameters - -### parts - -[`DetachedSessionRefParts`](../interfaces/DetachedSessionRefParts.md) - -## Returns - -`string` diff --git a/docs/api/mcp/functions/hashIdempotencyInput.md b/docs/api/mcp/functions/hashIdempotencyInput.md deleted file mode 100644 index ea1ea25..0000000 --- a/docs/api/mcp/functions/hashIdempotencyInput.md +++ /dev/null @@ -1,26 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / hashIdempotencyInput - -# Function: hashIdempotencyInput() - -> **hashIdempotencyInput**(`value`): `string` - -Defined in: [mcp/task-queue.ts:799](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L799) - -**`Experimental`** - -Best-effort stable hash for use as `idempotencyKey`. Not cryptographic; -collisions only affect dedupe, never correctness. - -## Parameters - -### value - -`unknown` - -## Returns - -`string` diff --git a/docs/api/mcp/functions/liftFindings.md b/docs/api/mcp/functions/liftFindings.md deleted file mode 100644 index 042edec..0000000 --- a/docs/api/mcp/functions/liftFindings.md +++ /dev/null @@ -1,32 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / liftFindings - -# Function: liftFindings() - -> **liftFindings**(`kind`, `rows`, `producedAt`): `AnalystFinding`[] - -Defined in: [mcp/tools/checks.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L143) - -Lift validated raw rows into `AnalystFinding`s (agent-eval `makeFinding` stamps `finding_id`/ - `produced_at`), then enforce the trace-derived firewall (selector ≠ judge). Pure — no LLM. - -## Parameters - -### kind - -[`Check`](../interfaces/Check.md) - -### rows - -`unknown`[] - -### producedAt - -`string` - -## Returns - -`AnalystFinding`[] diff --git a/docs/api/mcp/functions/makeCheckRunner.md b/docs/api/mcp/functions/makeCheckRunner.md deleted file mode 100644 index 37541b9..0000000 --- a/docs/api/mcp/functions/makeCheckRunner.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / makeCheckRunner - -# Function: makeCheckRunner() - -> **makeCheckRunner**(`kinds`, `opts`): (`kindId`, `trace`, `producedAt`) => `Promise`\<`AnalystFinding`[] \| \{ `error`: `string`; \}\> - -Defined in: [mcp/tools/checks.ts:271](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L271) - -Build a `run_analyst` runner over a kind directory. -Returns findings, or a typed error for an unknown kind. `producedAt` is -passed in because replay-safe paths must not read `Date.now`. - -## Parameters - -### kinds - -`Record`\<`string`, [`Check`](../interfaces/Check.md)\> - -### opts - -[`CheckRunnerOptions`](../interfaces/CheckRunnerOptions.md) - -## Returns - -(`kindId`, `trace`, `producedAt`) => `Promise`\<`AnalystFinding`[] \| \{ `error`: `string`; \}\> diff --git a/docs/api/mcp/functions/parseDetachedSessionRef.md b/docs/api/mcp/functions/parseDetachedSessionRef.md deleted file mode 100644 index f743cb1..0000000 --- a/docs/api/mcp/functions/parseDetachedSessionRef.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / parseDetachedSessionRef - -# Function: parseDetachedSessionRef() - -> **parseDetachedSessionRef**(`raw`): [`DetachedSessionRefParts`](../interfaces/DetachedSessionRefParts.md) - -Defined in: [mcp/detached-turn.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L103) - -**`Experimental`** - -Inverse of [formatDetachedSessionRef](formatDetachedSessionRef.md); throws `ValidationError` on malformed input. - -## Parameters - -### raw - -`string` - -## Returns - -[`DetachedSessionRefParts`](../interfaces/DetachedSessionRefParts.md) diff --git a/docs/api/mcp/functions/readTraceContextFromEnv.md b/docs/api/mcp/functions/readTraceContextFromEnv.md deleted file mode 100644 index 8e92087..0000000 --- a/docs/api/mcp/functions/readTraceContextFromEnv.md +++ /dev/null @@ -1,18 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / readTraceContextFromEnv - -# Function: readTraceContextFromEnv() - -> **readTraceContextFromEnv**(): [`TraceContext`](../interfaces/TraceContext.md) - -Defined in: [mcp/trace-propagation.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/trace-propagation.ts#L35) - -Read trace context from the process environment. -Returns a context with inherited ids or a freshly generated root. - -## Returns - -[`TraceContext`](../interfaces/TraceContext.md) diff --git a/docs/api/mcp/functions/removeWorktree.md b/docs/api/mcp/functions/removeWorktree.md deleted file mode 100644 index 73844f9..0000000 --- a/docs/api/mcp/functions/removeWorktree.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / removeWorktree - -# Function: removeWorktree() - -> **removeWorktree**(`options`): `Promise`\<`void`\> - -Defined in: [mcp/worktree.ts:173](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L173) - -**`Experimental`** - -## Parameters - -### options - -[`RemoveWorktreeOptions`](../interfaces/RemoveWorktreeOptions.md) - -## Returns - -`Promise`\<`void`\> diff --git a/docs/api/mcp/functions/renderTrace.md b/docs/api/mcp/functions/renderTrace.md deleted file mode 100644 index 2c02d44..0000000 --- a/docs/api/mcp/functions/renderTrace.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / renderTrace - -# Function: renderTrace() - -> **renderTrace**(`trace`): `string` - -Defined in: [mcp/tools/checks.ts:183](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L183) - -Render a worker's trace (tool calls + results) into the text an analyst lens reads. Generic over - the trace shape: a `{ messages }` conversation, a bare message array, else stringified. - -## Parameters - -### trace - -`unknown` - -## Returns - -`string` diff --git a/docs/api/mcp/functions/runCheck.md b/docs/api/mcp/functions/runCheck.md deleted file mode 100644 index 2747ca7..0000000 --- a/docs/api/mcp/functions/runCheck.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / runCheck - -# Function: runCheck() - -> **runCheck**(`kind`, `trace`, `opts`, `producedAt`): `Promise`\<`AnalystFinding`[]\> - -Defined in: [mcp/tools/checks.ts:219](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L219) - -Run ONE lens over a trace → findings. Generic over any kind: prompt = the lens + the agent-eval - finding schema; the model's JSON array is parsed (`parseRawFinding`), lifted, and firewalled. - -## Parameters - -### kind - -[`Check`](../interfaces/Check.md) - -### trace - -`unknown` - -### opts - -[`CheckRunnerOptions`](../interfaces/CheckRunnerOptions.md) - -### producedAt - -`string` - -## Returns - -`Promise`\<`AnalystFinding`[]\> diff --git a/docs/api/mcp/functions/runDetachedTurn.md b/docs/api/mcp/functions/runDetachedTurn.md deleted file mode 100644 index 42d925e..0000000 --- a/docs/api/mcp/functions/runDetachedTurn.md +++ /dev/null @@ -1,30 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / runDetachedTurn - -# Function: runDetachedTurn() - -> **runDetachedTurn**(`options`): `Promise`\<[`DetachedTurn`](../interfaces/DetachedTurn.md)\> - -Defined in: [mcp/detached-turn.ts:211](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L211) - -**`Experimental`** - -Dispatch one detached turn and advance it to a terminal state with -`driveTurn` ticks. The first tick dispatches (idempotent on `sessionId`); -subsequent ticks poll. On abort the remote session is cancelled via -`_sessionCancel` when the box exposes it. The box is torn down on every -in-process exit path (success, failure, abort) — only a process death skips -teardown, which is exactly the case the resume driver re-attaches to. - -## Parameters - -### options - -[`RunDetachedTurnOptions`](../interfaces/RunDetachedTurnOptions.md) - -## Returns - -`Promise`\<[`DetachedTurn`](../interfaces/DetachedTurn.md)\> diff --git a/docs/api/mcp/functions/runLocalHarness.md b/docs/api/mcp/functions/runLocalHarness.md deleted file mode 100644 index c81ffc7..0000000 --- a/docs/api/mcp/functions/runLocalHarness.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / runLocalHarness - -# Function: runLocalHarness() - -> **runLocalHarness**(`options`): `Promise`\<[`LocalHarnessResult`](../interfaces/LocalHarnessResult.md)\> - -Defined in: [mcp/local-harness.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L179) - -**`Experimental`** - -Spawn a local coding harness CLI as a subprocess + collect its output. - -NOT responsible for parsing the harness's output or extracting a diff — -the in-process executor's `streamPrompt` orchestrates `git diff` against -the worktree after this resolves. This function is intentionally narrow: -spawn, wait, capture, return. - -Fails loud — throws when: - - `cwd` doesn't exist (subprocess emits ENOENT; surfaced as Error) - - the harness binary is not on PATH (ENOENT) - -Does NOT throw when: - - the subprocess exits non-zero (`result.exitCode` carries the code) - - the subprocess is aborted / timed out (`result.killedBySignal` / - `result.timedOut` carries the reason) - -## Parameters - -### options - -[`RunLocalHarnessOptions`](../interfaces/RunLocalHarnessOptions.md) - -## Returns - -`Promise`\<[`LocalHarnessResult`](../interfaces/LocalHarnessResult.md)\> diff --git a/docs/api/mcp/functions/settleDetachedCoderTurn.md b/docs/api/mcp/functions/settleDetachedCoderTurn.md deleted file mode 100644 index d7cf1f1..0000000 --- a/docs/api/mcp/functions/settleDetachedCoderTurn.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / settleDetachedCoderTurn - -# Function: settleDetachedCoderTurn() - -> **settleDetachedCoderTurn**(`turn`, `options`): `Promise`\<`CoderOutput`\> - -Defined in: [mcp/delegates.ts:468](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L468) - -**`Experimental`** - -Settle a completed detached coder turn through the same gate the streaming -path applies: parse the terminal payload with the coder output adapter, -run the mechanical validator (tests/typecheck/forbidden/diff/no-op/secrets), -then the optional reviewer. Throws when nothing survives — a resumed or -detached run must not return an unvalidated patch. - -SCOPE NOTE (detached/resume): the detached `driveTurn`-tick + cross-restart resume path is -bound to the `runLoop` + sandbox-session substrate. The recursive `Scope`/worktree-CLI leaf has -journal→replay but no driveTurn-over-a-detached-sandbox-session equivalent yet, so resume is NOT -advertised on the generic `worktreeFanout` path. This helper (with `coderTaskFromArgs` and -`createDriveTurnResumeDriver`) stays as the resume seam `bin.ts` wires for in-flight records. - -## Parameters - -### turn - -[`DetachedTurn`](../interfaces/DetachedTurn.md) - -### options - -[`SettleDetachedCoderTurnOptions`](../interfaces/SettleDetachedCoderTurnOptions.md) - -## Returns - -`Promise`\<`CoderOutput`\> diff --git a/docs/api/mcp/functions/traceContextToEnv.md b/docs/api/mcp/functions/traceContextToEnv.md deleted file mode 100644 index 8a77c10..0000000 --- a/docs/api/mcp/functions/traceContextToEnv.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / traceContextToEnv - -# Function: traceContextToEnv() - -> **traceContextToEnv**(`ctx`): `Record`\<`string`, `string`\> - -Defined in: [mcp/trace-propagation.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/trace-propagation.ts#L85) - -Build env vars to pass to a child MCP subprocess so it inherits the -current trace context. - -## Parameters - -### ctx - -[`TraceContext`](../interfaces/TraceContext.md) - -## Returns - -`Record`\<`string`, `string`\> diff --git a/docs/api/mcp/functions/validateDelegateCodeArgs.md b/docs/api/mcp/functions/validateDelegateCodeArgs.md deleted file mode 100644 index b4f85a1..0000000 --- a/docs/api/mcp/functions/validateDelegateCodeArgs.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / validateDelegateCodeArgs - -# Function: validateDelegateCodeArgs() - -> **validateDelegateCodeArgs**(`raw`): [`DelegateCodeArgs`](../interfaces/DelegateCodeArgs.md) - -Defined in: [mcp/tools/delegate-code.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-code.ts#L90) - -**`Experimental`** - -## Parameters - -### raw - -`unknown` - -## Returns - -[`DelegateCodeArgs`](../interfaces/DelegateCodeArgs.md) diff --git a/docs/api/mcp/functions/validateDelegateFeedbackArgs.md b/docs/api/mcp/functions/validateDelegateFeedbackArgs.md deleted file mode 100644 index 00a2523..0000000 --- a/docs/api/mcp/functions/validateDelegateFeedbackArgs.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / validateDelegateFeedbackArgs - -# Function: validateDelegateFeedbackArgs() - -> **validateDelegateFeedbackArgs**(`raw`): [`DelegateFeedbackArgs`](../interfaces/DelegateFeedbackArgs.md) - -Defined in: [mcp/tools/delegate-feedback.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-feedback.ts#L82) - -**`Experimental`** - -## Parameters - -### raw - -`unknown` - -## Returns - -[`DelegateFeedbackArgs`](../interfaces/DelegateFeedbackArgs.md) diff --git a/docs/api/mcp/functions/validateDelegateResearchArgs.md b/docs/api/mcp/functions/validateDelegateResearchArgs.md deleted file mode 100644 index 01a5997..0000000 --- a/docs/api/mcp/functions/validateDelegateResearchArgs.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / validateDelegateResearchArgs - -# Function: validateDelegateResearchArgs() - -> **validateDelegateResearchArgs**(`raw`): [`DelegateResearchArgs`](../interfaces/DelegateResearchArgs.md) - -Defined in: [mcp/tools/delegate-research.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-research.ts#L94) - -**`Experimental`** - -## Parameters - -### raw - -`unknown` - -## Returns - -[`DelegateResearchArgs`](../interfaces/DelegateResearchArgs.md) diff --git a/docs/api/mcp/functions/validateDelegateUiAuditArgs.md b/docs/api/mcp/functions/validateDelegateUiAuditArgs.md deleted file mode 100644 index 64f0415..0000000 --- a/docs/api/mcp/functions/validateDelegateUiAuditArgs.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / validateDelegateUiAuditArgs - -# Function: validateDelegateUiAuditArgs() - -> **validateDelegateUiAuditArgs**(`raw`): [`DelegateUiAuditArgs`](../interfaces/DelegateUiAuditArgs.md) - -Defined in: [mcp/tools/delegate-ui-audit.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-ui-audit.ts#L114) - -**`Experimental`** - -## Parameters - -### raw - -`unknown` - -## Returns - -[`DelegateUiAuditArgs`](../interfaces/DelegateUiAuditArgs.md) diff --git a/docs/api/mcp/functions/validateDelegationHistoryArgs.md b/docs/api/mcp/functions/validateDelegationHistoryArgs.md deleted file mode 100644 index ac61ca1..0000000 --- a/docs/api/mcp/functions/validateDelegationHistoryArgs.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / validateDelegationHistoryArgs - -# Function: validateDelegationHistoryArgs() - -> **validateDelegationHistoryArgs**(`raw`): [`DelegationHistoryArgs`](../interfaces/DelegationHistoryArgs.md) - -Defined in: [mcp/tools/delegation-history.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-history.ts#L53) - -**`Experimental`** - -## Parameters - -### raw - -`unknown` - -## Returns - -[`DelegationHistoryArgs`](../interfaces/DelegationHistoryArgs.md) diff --git a/docs/api/mcp/functions/validateDelegationStatusArgs.md b/docs/api/mcp/functions/validateDelegationStatusArgs.md deleted file mode 100644 index 35a44d9..0000000 --- a/docs/api/mcp/functions/validateDelegationStatusArgs.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / validateDelegationStatusArgs - -# Function: validateDelegationStatusArgs() - -> **validateDelegationStatusArgs**(`raw`): [`DelegationStatusArgs`](../interfaces/DelegationStatusArgs.md) - -Defined in: [mcp/tools/delegation-status.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-status.ts#L56) - -**`Experimental`** - -## Parameters - -### raw - -`unknown` - -## Returns - -[`DelegationStatusArgs`](../interfaces/DelegationStatusArgs.md) diff --git a/docs/api/mcp/interfaces/AnalystRegistry.md b/docs/api/mcp/interfaces/AnalystRegistry.md deleted file mode 100644 index fabf3f5..0000000 --- a/docs/api/mcp/interfaces/AnalystRegistry.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / AnalystRegistry - -# Interface: AnalystRegistry - -Defined in: [mcp/tools/coordination.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L62) - -## Properties - -### kinds - -> `readonly` **kinds**: readonly `object`[] - -Defined in: [mcp/tools/coordination.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L63) - -*** - -### run - -> `readonly` **run**: (`kindId`, `trace`) => `Promise`\<`unknown`\> - -Defined in: [mcp/tools/coordination.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L64) - -#### Parameters - -##### kindId - -`string` - -##### trace - -`unknown` - -#### Returns - -`Promise`\<`unknown`\> diff --git a/docs/api/mcp/interfaces/BuildDelegationMcpServerOptions.md b/docs/api/mcp/interfaces/BuildDelegationMcpServerOptions.md deleted file mode 100644 index 58933e7..0000000 --- a/docs/api/mcp/interfaces/BuildDelegationMcpServerOptions.md +++ /dev/null @@ -1,44 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / BuildDelegationMcpServerOptions - -# Interface: BuildDelegationMcpServerOptions - -Defined in: [mcp/delegation-profile.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L50) - -## Properties - -### sandboxApiKey? - -> `optional` **sandboxApiKey?**: `string` - -Defined in: [mcp/delegation-profile.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L54) - -Sandbox API key forwarded as `TANGLE_API_KEY` to the MCP child. The - agent-runtime MCP bin reads `TANGLE_API_KEY` and passes it straight to - `new Sandbox({ apiKey })`. Defaults to `env.TANGLE_API_KEY`. - -*** - -### sandboxBaseUrl? - -> `optional` **sandboxBaseUrl?**: `string` - -Defined in: [mcp/delegation-profile.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L58) - -Sandbox base URL forwarded as `SANDBOX_BASE_URL`. Defaults to - `env.SANDBOX_BASE_URL`, then `env.SANDBOX_API_URL`, then the public - sandbox endpoint. - -*** - -### env? - -> `optional` **env?**: `Record`\<`string`, `string` \| `undefined`\> - -Defined in: [mcp/delegation-profile.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L61) - -Environment source for key + OTEL resolution. Defaults to `process.env`; - injectable for tests and non-process callers. diff --git a/docs/api/mcp/interfaces/CappedDelegationTrace.md b/docs/api/mcp/interfaces/CappedDelegationTrace.md deleted file mode 100644 index 063834f..0000000 --- a/docs/api/mcp/interfaces/CappedDelegationTrace.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / CappedDelegationTrace - -# Interface: CappedDelegationTrace - -Defined in: [mcp/delegation-trace.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L60) - -**`Experimental`** - -## Properties - -### trace - -> **trace**: [`DelegationTraceSpan`](DelegationTraceSpan.md)[] - -Defined in: [mcp/delegation-trace.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L61) - -**`Experimental`** - -*** - -### truncated - -> **truncated**: `boolean` - -Defined in: [mcp/delegation-trace.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L63) - -**`Experimental`** - -True when oldest spans were dropped to honor the caps. diff --git a/docs/api/mcp/interfaces/Check.md b/docs/api/mcp/interfaces/Check.md deleted file mode 100644 index 932f613..0000000 --- a/docs/api/mcp/interfaces/Check.md +++ /dev/null @@ -1,56 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / Check - -# Interface: Check - -Defined in: [mcp/tools/checks.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L82) - -One lens — a composable analyst kind. Identity fields mirror `TraceAnalystKindSpec` so a kind is - upgradeable to the full agentic factory; `lookFor` is the lens question the actor applies. - -## Properties - -### id - -> `readonly` **id**: `string` - -Defined in: [mcp/tools/checks.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L83) - -*** - -### description - -> `readonly` **description**: `string` - -Defined in: [mcp/tools/checks.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L84) - -*** - -### area - -> `readonly` **area**: `string` - -Defined in: [mcp/tools/checks.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L86) - -Coarse classification stamped on every finding this kind emits (the renderer groups by it). - -*** - -### version - -> `readonly` **version**: `string` - -Defined in: [mcp/tools/checks.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L87) - -*** - -### lookFor - -> `readonly` **lookFor**: `string` - -Defined in: [mcp/tools/checks.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L89) - -The lens — what this analyst looks for in the trace. diff --git a/docs/api/mcp/interfaces/CheckRunnerOptions.md b/docs/api/mcp/interfaces/CheckRunnerOptions.md deleted file mode 100644 index 4138864..0000000 --- a/docs/api/mcp/interfaces/CheckRunnerOptions.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / CheckRunnerOptions - -# Interface: CheckRunnerOptions - -Defined in: [mcp/tools/checks.ts:209](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L209) - -## Properties - -### routerBaseUrl - -> **routerBaseUrl**: `string` - -Defined in: [mcp/tools/checks.ts:210](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L210) - -*** - -### routerKey - -> **routerKey**: `string` - -Defined in: [mcp/tools/checks.ts:211](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L211) - -*** - -### model - -> **model**: `string` - -Defined in: [mcp/tools/checks.ts:212](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L212) - -*** - -### chat? - -> `optional` **chat?**: (`system`, `user`) => `Promise`\<`string`\> - -Defined in: [mcp/tools/checks.ts:214](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L214) - -Test/override seam — replace the LLM call. Default: a router chat completion. - -#### Parameters - -##### system - -`string` - -##### user - -`string` - -#### Returns - -`Promise`\<`string`\> diff --git a/docs/api/mcp/interfaces/CoderReview.md b/docs/api/mcp/interfaces/CoderReview.md deleted file mode 100644 index ddf7025..0000000 --- a/docs/api/mcp/interfaces/CoderReview.md +++ /dev/null @@ -1,59 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / CoderReview - -# Interface: CoderReview - -Defined in: [mcp/delegates.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L111) - -**`Experimental`** - -Structured review verdict over a coder candidate. - -## Properties - -### approved - -> **approved**: `boolean` - -Defined in: [mcp/delegates.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L113) - -**`Experimental`** - -Gate: only approved candidates are eligible to win. - -*** - -### recommendation - -> **recommendation**: `"ship"` \| `"approve-with-nits"` \| `"changes-requested"` \| `"reject"` - -Defined in: [mcp/delegates.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L115) - -**`Experimental`** - -Reviewer's recommendation — surfaced in traces. - -*** - -### readiness - -> **readiness**: `number` - -Defined in: [mcp/delegates.ts:117](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L117) - -**`Experimental`** - -Readiness 0..1, used by the `highest-readiness` winner-selection strategy. - -*** - -### notes? - -> `optional` **notes?**: `string` - -Defined in: [mcp/delegates.ts:118](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L118) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/ComposeProductionAgentProfileOptions.md b/docs/api/mcp/interfaces/ComposeProductionAgentProfileOptions.md deleted file mode 100644 index 8e50e18..0000000 --- a/docs/api/mcp/interfaces/ComposeProductionAgentProfileOptions.md +++ /dev/null @@ -1,119 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / ComposeProductionAgentProfileOptions - -# Interface: ComposeProductionAgentProfileOptions - -Defined in: [mcp/delegation-profile.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L112) - -## Properties - -### sandboxApiKey? - -> `optional` **sandboxApiKey?**: `string` - -Defined in: [mcp/delegation-profile.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L115) - -Sandbox API key forwarded to the delegation MCP child. Defaults to - `env.TANGLE_API_KEY`. When unset, the delegation MCP entry is omitted. - -*** - -### sandboxBaseUrl? - -> `optional` **sandboxBaseUrl?**: `string` - -Defined in: [mcp/delegation-profile.ts:117](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L117) - -Sandbox base URL forwarded as `SANDBOX_BASE_URL` to the MCP child. - -*** - -### systemPrompt? - -> `optional` **systemPrompt?**: `string` - -Defined in: [mcp/delegation-profile.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L120) - -Replace the base profile's system prompt. Used by per-turn calls that - swap in workspace-augmented prompts (board summary, learned style). - -*** - -### extraFiles? - -> `optional` **extraFiles?**: `AgentProfileFileMount`[] - -Defined in: [mcp/delegation-profile.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L122) - -Extra file mounts layered after the base profile's `resources.files`. - -*** - -### name? - -> `optional` **name?**: `string` - -Defined in: [mcp/delegation-profile.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L124) - -Override the profile `name`. Defaults to the base profile's name. - -*** - -### env? - -> `optional` **env?**: `Record`\<`string`, `string` \| `undefined`\> - -Defined in: [mcp/delegation-profile.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L126) - -Environment source for key + OTEL resolution. Defaults to `process.env`. - -*** - -### tools? - -> `optional` **tools?**: `Record`\<`string`, `boolean`\> - -Defined in: [mcp/delegation-profile.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L131) - -Box built-in tool ON/OFF flags merged over the base profile's `tools` - (overlay wins per key). The sandbox-seam mapping of a certified surface's - tool grants — `AgentProfile.tools` is `Record` box flags, - so it carries grants, not arbitrary tool defs. - -*** - -### hooks? - -> `optional` **hooks?**: `Record`\<`string`, `AgentProfileHookCommand`[]\> - -Defined in: [mcp/delegation-profile.ts:134](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L134) - -Per-event hook commands merged over the base profile's `hooks`. An event - present in both has the extra commands appended after the base ones. - -*** - -### subagents? - -> `optional` **subagents?**: `Record`\<`string`, `AgentSubagentProfile`\> - -Defined in: [mcp/delegation-profile.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L137) - -Subagent definitions merged over the base profile's `subagents` (overlay - wins per key). - -*** - -### mcpConnections? - -> `optional` **mcpConnections?**: `Record`\<`string`, `AgentProfileMcpServer`\> - -Defined in: [mcp/delegation-profile.ts:142](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L142) - -Resolved certified MCP connections injected into `AgentProfile.mcp` — the - sandbox-seam delivery of a `ResolvedSurface.mcpConnections`. Merged after - the base map and before the delegation entry, so a base/delegation key is - never silently shadowed by an injected one. diff --git a/docs/api/mcp/interfaces/CoordinationTools.md b/docs/api/mcp/interfaces/CoordinationTools.md deleted file mode 100644 index 667d2a9..0000000 --- a/docs/api/mcp/interfaces/CoordinationTools.md +++ /dev/null @@ -1,123 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / CoordinationTools - -# Interface: CoordinationTools - -Defined in: [mcp/tools/coordination.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L116) - -The supervisor-side toolbox returned by [createCoordinationTools](../functions/createCoordinationTools.md): the MCP tool -descriptors a driver `AgentProfile` calls to spawn, steer, observe, and settle workers -over a live `Scope`, plus the typed accessors (`settled`/`questions`/`history`/`stats`/ -`raiseFinding`) for the bidirectional coordination bus. This is the live, backend-of-your- -choice, steerable counterpart to the one-shot own-sandbox delegation MCP. - -## Properties - -### tools - -> `readonly` **tools**: [`McpToolDescriptor`](McpToolDescriptor.md)[] - -Defined in: [mcp/tools/coordination.ts:117](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L117) - -## Methods - -### isStopped() - -> **isStopped**(): `boolean` - -Defined in: [mcp/tools/coordination.ts:118](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L118) - -#### Returns - -`boolean` - -*** - -### stopReason() - -> **stopReason**(): `string` \| `undefined` - -Defined in: [mcp/tools/coordination.ts:119](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L119) - -#### Returns - -`string` \| `undefined` - -*** - -### settled() - -> **settled**(): readonly [`SettledWorker`](SettledWorker.md)[] - -Defined in: [mcp/tools/coordination.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L120) - -#### Returns - -readonly [`SettledWorker`](SettledWorker.md)[] - -*** - -### questions() - -> **questions**(): readonly [`QuestionRecord`](QuestionRecord.md)[] - -Defined in: [mcp/tools/coordination.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L121) - -#### Returns - -readonly [`QuestionRecord`](QuestionRecord.md)[] - -*** - -### history() - -> **history**(): readonly [`BusRecord`](../../runtime/interfaces/BusRecord.md)\<[`CoordinationEvent`](../type-aliases/CoordinationEvent.md)\>[] - -Defined in: [mcp/tools/coordination.ts:125](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L125) - -The full ordered log of every bus event — UP (settled / question / finding) and DOWN - (steer / answer) — the observability audit + replay trail. Each record carries seq, - timestamp, and priority. - -#### Returns - -readonly [`BusRecord`](../../runtime/interfaces/BusRecord.md)\<[`CoordinationEvent`](../type-aliases/CoordinationEvent.md)\>[] - -*** - -### stats() - -> **stats**(): [`BusStats`](../../runtime/interfaces/BusStats.md) - -Defined in: [mcp/tools/coordination.ts:127](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L127) - -Bus throughput counters (published / pulled / by-kind) for live dashboards. - -#### Returns - -[`BusStats`](../../runtime/interfaces/BusStats.md) - -*** - -### raiseFinding() - -> **raiseFinding**(`finding`): `Promise`\<`void`\> - -Defined in: [mcp/tools/coordination.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L131) - -Raise a `finding` on the bus from outside the settle hook — the seam an ONLINE detector - (mid-run, on the worker pipe) uses to tell the driver "this worker is looping/erroring" the - moment it happens, instead of only at settle. Queued for `await_event` + pass-through. - -#### Parameters - -##### finding - -`AnalystFindingEvent` - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/mcp/interfaces/CoordinationToolsOptions.md b/docs/api/mcp/interfaces/CoordinationToolsOptions.md deleted file mode 100644 index 8a795dd..0000000 --- a/docs/api/mcp/interfaces/CoordinationToolsOptions.md +++ /dev/null @@ -1,88 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / CoordinationToolsOptions - -# Interface: CoordinationToolsOptions - -Defined in: [mcp/tools/coordination.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L94) - -## Properties - -### scope - -> `readonly` **scope**: [`Scope`](../../runtime/interfaces/Scope.md)\<`unknown`\> - -Defined in: [mcp/tools/coordination.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L95) - -*** - -### blobs - -> `readonly` **blobs**: [`ResultBlobStore`](../../runtime/interfaces/ResultBlobStore.md) - -Defined in: [mcp/tools/coordination.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L96) - -*** - -### makeWorkerAgent - -> `readonly` **makeWorkerAgent**: [`MakeWorkerAgent`](../type-aliases/MakeWorkerAgent.md) - -Defined in: [mcp/tools/coordination.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L97) - -*** - -### perWorker - -> `readonly` **perWorker**: [`Budget`](../../runtime/interfaces/Budget.md) - -Defined in: [mcp/tools/coordination.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L98) - -*** - -### analysts? - -> `readonly` `optional` **analysts?**: [`AnalystRegistry`](AnalystRegistry.md) - -Defined in: [mcp/tools/coordination.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L99) - -*** - -### onEvent? - -> `readonly` `optional` **onEvent?**: (`event`) => `void` \| `Promise`\<`void`\> - -Defined in: [mcp/tools/coordination.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L100) - -#### Parameters - -##### event - -[`CoordinationEvent`](../type-aliases/CoordinationEvent.md) - -#### Returns - -`void` \| `Promise`\<`void`\> - -*** - -### questionPolicy? - -> `readonly` `optional` **questionPolicy?**: [`QuestionPolicy`](../type-aliases/QuestionPolicy.md) - -Defined in: [mcp/tools/coordination.ts:101](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L101) - -*** - -### analyzeOnSettle? - -> `readonly` `optional` **analyzeOnSettle?**: readonly `string`[] - -Defined in: [mcp/tools/coordination.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L106) - -Analyst kind ids to run AUTOMATICALLY when a worker settles `done` (the analyst-on-settle - hook). Each result is published as a `finding` event on the bus — pass-through to subscribers - and queued for the driver to pull via `await_event`. Omit/empty = no auto-analysis (default; - the driver can still run lenses on demand via `run_analyst`). Requires `analysts`. diff --git a/docs/api/mcp/interfaces/CreateKbGateOptions.md b/docs/api/mcp/interfaces/CreateKbGateOptions.md deleted file mode 100644 index 3b2be3b..0000000 --- a/docs/api/mcp/interfaces/CreateKbGateOptions.md +++ /dev/null @@ -1,50 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / CreateKbGateOptions - -# Interface: CreateKbGateOptions - -Defined in: [mcp/kb-gate.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L59) - -**`Experimental`** - -## Properties - -### judges? - -> `optional` **judges?**: [`FactJudge`](FactJudge.md)[] - -Defined in: [mcp/kb-gate.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L61) - -**`Experimental`** - -Extra judges appended after the built-in floor (e.g. an LLM judge). - -*** - -### minPassageChars? - -> `optional` **minPassageChars?**: `number` - -Defined in: [mcp/kb-gate.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L63) - -**`Experimental`** - -Minimum verbatim-passage length. Default 12 — kills empty/stub passages. - -*** - -### selfArtifactKinds? - -> `optional` **selfArtifactKinds?**: `string`[] - -Defined in: [mcp/kb-gate.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L70) - -**`Experimental`** - -Citation tokens that denote a SELF-generated artifact (e.g. `'spec'`, -`'cad_params'`, `'requirements'`). A citation naming one is circular -(laundering) — the fact cites a derived artifact, not a real source. -Default `[]` (no circular check unless the consumer declares its kinds). diff --git a/docs/api/mcp/interfaces/CreateWorktreeOptions.md b/docs/api/mcp/interfaces/CreateWorktreeOptions.md deleted file mode 100644 index 2ddb755..0000000 --- a/docs/api/mcp/interfaces/CreateWorktreeOptions.md +++ /dev/null @@ -1,71 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / CreateWorktreeOptions - -# Interface: CreateWorktreeOptions - -Defined in: [mcp/worktree.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L31) - -**`Experimental`** - -## Properties - -### repoRoot - -> **repoRoot**: `string` - -Defined in: [mcp/worktree.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L33) - -**`Experimental`** - -Absolute path to the main git checkout. - -*** - -### runId - -> **runId**: `string` - -Defined in: [mcp/worktree.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L35) - -**`Experimental`** - -Unique id for the worktree path + branch. Use the delegation run id. - -*** - -### variantsDir? - -> `optional` **variantsDir?**: `string` - -Defined in: [mcp/worktree.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L37) - -**`Experimental`** - -Parent directory the worktree lives under. Defaults to `.agent-worktrees`. - -*** - -### baseRef? - -> `optional` **baseRef?**: `string` - -Defined in: [mcp/worktree.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L39) - -**`Experimental`** - -Override the base ref (default `HEAD`). - -*** - -### runGit? - -> `optional` **runGit?**: [`GitRunner`](../type-aliases/GitRunner.md) - -Defined in: [mcp/worktree.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L41) - -**`Experimental`** - -Test seam — inject a custom git runner. diff --git a/docs/api/mcp/interfaces/DelegateCodeArgs.md b/docs/api/mcp/interfaces/DelegateCodeArgs.md deleted file mode 100644 index 9ee9c2c..0000000 --- a/docs/api/mcp/interfaces/DelegateCodeArgs.md +++ /dev/null @@ -1,85 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegateCodeArgs - -# Interface: DelegateCodeArgs - -Defined in: [mcp/types.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L42) - -**`Experimental`** - -## Properties - -### goal - -> **goal**: `string` - -Defined in: [mcp/types.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L44) - -**`Experimental`** - -Natural-language description of what the coder must accomplish. - -*** - -### repoRoot - -> **repoRoot**: `string` - -Defined in: [mcp/types.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L46) - -**`Experimental`** - -Absolute path inside the sandbox where the repo lives. - -*** - -### contextHint? - -> `optional` **contextHint?**: `string` - -Defined in: [mcp/types.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L48) - -**`Experimental`** - -Optional free-form context the agent surfaces in the prompt prelude. - -*** - -### variants? - -> `optional` **variants?**: `number` - -Defined in: [mcp/types.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L54) - -**`Experimental`** - -When > 1, dispatches `multiHarnessCoderFanout` across N harnesses -(claude-code, codex, opencode-glm) and picks the highest-scoring -passing patch. Default 1. - -*** - -### config? - -> `optional` **config?**: [`DelegateCodeConfig`](DelegateCodeConfig.md) - -Defined in: [mcp/types.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L56) - -**`Experimental`** - -Validator + prompt overrides the agent knows for this repo. - -*** - -### namespace? - -> `optional` **namespace?**: `string` - -Defined in: [mcp/types.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L58) - -**`Experimental`** - -Multi-tenant scope (customer-id, workspace-id). diff --git a/docs/api/mcp/interfaces/DelegateCodeConfig.md b/docs/api/mcp/interfaces/DelegateCodeConfig.md deleted file mode 100644 index 9e8b637..0000000 --- a/docs/api/mcp/interfaces/DelegateCodeConfig.md +++ /dev/null @@ -1,56 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegateCodeConfig - -# Interface: DelegateCodeConfig - -Defined in: [mcp/types.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L34) - -**`Experimental`** - -Minimal `CoderTask` overrides exposed over the MCP wire. The full -`CoderTask` carries fields the kernel synthesizes from `goal` + -`repoRoot` — the agent only edits the few that materially gate -validator behavior. - -## Properties - -### testCmd? - -> `optional` **testCmd?**: `string` - -Defined in: [mcp/types.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L35) - -**`Experimental`** - -*** - -### typecheckCmd? - -> `optional` **typecheckCmd?**: `string` - -Defined in: [mcp/types.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L36) - -**`Experimental`** - -*** - -### forbiddenPaths? - -> `optional` **forbiddenPaths?**: `string`[] - -Defined in: [mcp/types.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L37) - -**`Experimental`** - -*** - -### maxDiffLines? - -> `optional` **maxDiffLines?**: `number` - -Defined in: [mcp/types.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L38) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/DelegateCodeResult.md b/docs/api/mcp/interfaces/DelegateCodeResult.md deleted file mode 100644 index bcbfc47..0000000 --- a/docs/api/mcp/interfaces/DelegateCodeResult.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegateCodeResult - -# Interface: DelegateCodeResult - -Defined in: [mcp/types.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L62) - -**`Experimental`** - -## Properties - -### taskId - -> **taskId**: `string` - -Defined in: [mcp/types.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L63) - -**`Experimental`** - -*** - -### estimatedDurationMs? - -> `optional` **estimatedDurationMs?**: `number` - -Defined in: [mcp/types.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L65) - -**`Experimental`** - -Best-effort hint — coder loops can take minutes-to-hours. diff --git a/docs/api/mcp/interfaces/DelegateFeedbackArgs.md b/docs/api/mcp/interfaces/DelegateFeedbackArgs.md deleted file mode 100644 index 5fd418e..0000000 --- a/docs/api/mcp/interfaces/DelegateFeedbackArgs.md +++ /dev/null @@ -1,63 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegateFeedbackArgs - -# Interface: DelegateFeedbackArgs - -Defined in: [mcp/types.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L110) - -**`Experimental`** - -## Properties - -### refersTo - -> **refersTo**: [`FeedbackRefersTo`](FeedbackRefersTo.md) - -Defined in: [mcp/types.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L111) - -**`Experimental`** - -*** - -### rating - -> **rating**: [`FeedbackRating`](FeedbackRating.md) - -Defined in: [mcp/types.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L112) - -**`Experimental`** - -*** - -### by - -> **by**: `"user"` \| `"agent"` \| `"downstream-judge"` - -Defined in: [mcp/types.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L113) - -**`Experimental`** - -*** - -### capturedAt? - -> `optional` **capturedAt?**: `string` - -Defined in: [mcp/types.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L115) - -**`Experimental`** - -ISO timestamp; defaults to server clock when omitted. - -*** - -### namespace? - -> `optional` **namespace?**: `string` - -Defined in: [mcp/types.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L116) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/DelegateFeedbackResult.md b/docs/api/mcp/interfaces/DelegateFeedbackResult.md deleted file mode 100644 index 4215f9b..0000000 --- a/docs/api/mcp/interfaces/DelegateFeedbackResult.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegateFeedbackResult - -# Interface: DelegateFeedbackResult - -Defined in: [mcp/types.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L120) - -**`Experimental`** - -## Properties - -### recorded - -> **recorded**: `true` - -Defined in: [mcp/types.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L121) - -**`Experimental`** - -*** - -### id - -> **id**: `string` - -Defined in: [mcp/types.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L122) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/DelegateResearchArgs.md b/docs/api/mcp/interfaces/DelegateResearchArgs.md deleted file mode 100644 index 644dccc..0000000 --- a/docs/api/mcp/interfaces/DelegateResearchArgs.md +++ /dev/null @@ -1,71 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegateResearchArgs - -# Interface: DelegateResearchArgs - -Defined in: [mcp/types.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L79) - -**`Experimental`** - -## Properties - -### question - -> **question**: `string` - -Defined in: [mcp/types.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L80) - -**`Experimental`** - -*** - -### namespace - -> **namespace**: `string` - -Defined in: [mcp/types.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L81) - -**`Experimental`** - -*** - -### scope? - -> `optional` **scope?**: `string` - -Defined in: [mcp/types.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L82) - -**`Experimental`** - -*** - -### sources? - -> `optional` **sources?**: [`ResearchSource`](../type-aliases/ResearchSource.md)[] - -Defined in: [mcp/types.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L83) - -**`Experimental`** - -*** - -### variants? - -> `optional` **variants?**: `number` - -Defined in: [mcp/types.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L84) - -**`Experimental`** - -*** - -### config? - -> `optional` **config?**: [`DelegateResearchConfig`](DelegateResearchConfig.md) - -Defined in: [mcp/types.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L85) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/DelegateResearchConfig.md b/docs/api/mcp/interfaces/DelegateResearchConfig.md deleted file mode 100644 index 4cd9295..0000000 --- a/docs/api/mcp/interfaces/DelegateResearchConfig.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegateResearchConfig - -# Interface: DelegateResearchConfig - -Defined in: [mcp/types.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L72) - -**`Experimental`** - -## Properties - -### recencyWindow? - -> `optional` **recencyWindow?**: `object` - -Defined in: [mcp/types.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L73) - -**`Experimental`** - -#### since? - -> `optional` **since?**: `string` - -#### until? - -> `optional` **until?**: `string` - -*** - -### maxItems? - -> `optional` **maxItems?**: `number` - -Defined in: [mcp/types.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L74) - -**`Experimental`** - -*** - -### minConfidence? - -> `optional` **minConfidence?**: `number` - -Defined in: [mcp/types.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L75) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/DelegateResearchResult.md b/docs/api/mcp/interfaces/DelegateResearchResult.md deleted file mode 100644 index ce15b81..0000000 --- a/docs/api/mcp/interfaces/DelegateResearchResult.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegateResearchResult - -# Interface: DelegateResearchResult - -Defined in: [mcp/types.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L89) - -**`Experimental`** - -## Properties - -### taskId - -> **taskId**: `string` - -Defined in: [mcp/types.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L90) - -**`Experimental`** - -*** - -### estimatedDurationMs? - -> `optional` **estimatedDurationMs?**: `number` - -Defined in: [mcp/types.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L91) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/DelegateRunCtx.md b/docs/api/mcp/interfaces/DelegateRunCtx.md deleted file mode 100644 index 57190d5..0000000 --- a/docs/api/mcp/interfaces/DelegateRunCtx.md +++ /dev/null @@ -1,93 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegateRunCtx - -# Interface: DelegateRunCtx - -Defined in: [mcp/delegates.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L65) - -**`Experimental`** - -## Properties - -### signal - -> **signal**: `AbortSignal` - -Defined in: [mcp/delegates.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L66) - -**`Experimental`** - -*** - -### detachedSessionRef? - -> `optional` **detachedSessionRef?**: `string` - -Defined in: [mcp/delegates.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L74) - -**`Experimental`** - -Detached-run resume key recorded on the queue record at submit time -(`formatDetachedSessionRef`). Present only when the submit path requested -detached dispatch — its presence is what routes a session-backed delegate -onto the `driveTurn` tick path instead of holding a stream. - -*** - -### traceEmitter? - -> `optional` **traceEmitter?**: [`LoopTraceEmitter`](../../runtime/interfaces/LoopTraceEmitter.md) - -Defined in: [mcp/delegates.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L83) - -**`Experimental`** - -Per-delegation trace sink supplied by the queue — loop events emitted -here land on the delegation record as a compact span tree. Delegates -compose it with their configured OTEL emitter so both sinks observe -the same stream. - -## Methods - -### report() - -> **report**(`progress`): `void` - -Defined in: [mcp/delegates.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L67) - -**`Experimental`** - -#### Parameters - -##### progress - -[`DelegationProgress`](DelegationProgress.md) - -#### Returns - -`void` - -*** - -### updateDetachedSessionRef()? - -> `optional` **updateDetachedSessionRef**(`ref`): `void` - -Defined in: [mcp/delegates.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L76) - -**`Experimental`** - -Rebind the record's resume key (e.g. once the sandbox id is known). - -#### Parameters - -##### ref - -`string` - -#### Returns - -`void` diff --git a/docs/api/mcp/interfaces/DelegateUiAuditArgs.md b/docs/api/mcp/interfaces/DelegateUiAuditArgs.md deleted file mode 100644 index f05e2a4..0000000 --- a/docs/api/mcp/interfaces/DelegateUiAuditArgs.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegateUiAuditArgs - -# Interface: DelegateUiAuditArgs - -Defined in: [mcp/types.ts:211](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L211) - -**`Experimental`** - -## Properties - -### workspaceDir - -> **workspaceDir**: `string` - -Defined in: [mcp/types.ts:213](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L213) - -**`Experimental`** - -Workspace root for the audit (absolute path). - -*** - -### routes - -> **routes**: readonly [`DelegateUiAuditRoute`](DelegateUiAuditRoute.md)[] - -Defined in: [mcp/types.ts:215](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L215) - -**`Experimental`** - -Routes to audit. Must be non-empty. - -*** - -### namespace? - -> `optional` **namespace?**: `string` - -Defined in: [mcp/types.ts:217](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L217) - -**`Experimental`** - -Multi-tenant scope. - -*** - -### config? - -> `optional` **config?**: [`DelegateUiAuditConfig`](DelegateUiAuditConfig.md) - -Defined in: [mcp/types.ts:218](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L218) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/DelegateUiAuditConfig.md b/docs/api/mcp/interfaces/DelegateUiAuditConfig.md deleted file mode 100644 index f3529a9..0000000 --- a/docs/api/mcp/interfaces/DelegateUiAuditConfig.md +++ /dev/null @@ -1,60 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegateUiAuditConfig - -# Interface: DelegateUiAuditConfig - -Defined in: [mcp/types.ts:196](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L196) - -**`Experimental`** - -## Properties - -### lenses? - -> `optional` **lenses?**: `UiAuditLensFilter` - -Defined in: [mcp/types.ts:201](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L201) - -**`Experimental`** - -Lenses to iterate. Default: every lens except `'other'`. Order is -preserved — the driver iterates lens-by-lens. - -*** - -### maxIterations? - -> `optional` **maxIterations?**: `number` - -Defined in: [mcp/types.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L203) - -**`Experimental`** - -Maximum total iterations across all (lens × route) pairs. Default 33 (11 lenses × 3 routes). - -*** - -### maxConcurrency? - -> `optional` **maxConcurrency?**: `number` - -Defined in: [mcp/types.ts:205](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L205) - -**`Experimental`** - -Maximum concurrent iterations within a single plan() round. Default 2. - -*** - -### productContext? - -> `optional` **productContext?**: `string` - -Defined in: [mcp/types.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L207) - -**`Experimental`** - -Free-form product context surfaced to the judge. diff --git a/docs/api/mcp/interfaces/DelegateUiAuditResult.md b/docs/api/mcp/interfaces/DelegateUiAuditResult.md deleted file mode 100644 index 9960e42..0000000 --- a/docs/api/mcp/interfaces/DelegateUiAuditResult.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegateUiAuditResult - -# Interface: DelegateUiAuditResult - -Defined in: [mcp/types.ts:222](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L222) - -**`Experimental`** - -## Properties - -### taskId - -> **taskId**: `string` - -Defined in: [mcp/types.ts:223](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L223) - -**`Experimental`** - -*** - -### estimatedDurationMs? - -> `optional` **estimatedDurationMs?**: `number` - -Defined in: [mcp/types.ts:224](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L224) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/DelegateUiAuditRoute.md b/docs/api/mcp/interfaces/DelegateUiAuditRoute.md deleted file mode 100644 index b8cf37b..0000000 --- a/docs/api/mcp/interfaces/DelegateUiAuditRoute.md +++ /dev/null @@ -1,61 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegateUiAuditRoute - -# Interface: DelegateUiAuditRoute - -Defined in: [mcp/types.ts:182](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L182) - -Optional per-route capture spec the agent surfaces over the wire. - -## Properties - -### name - -> **name**: `string` - -Defined in: [mcp/types.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L184) - -Stable route name (used in screenshot filenames + finding metadata). - -*** - -### url - -> **url**: `string` - -Defined in: [mcp/types.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L186) - -Fully-qualified URL. - -*** - -### viewports? - -> `optional` **viewports?**: readonly `object`[] - -Defined in: [mcp/types.ts:188](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L188) - -Viewports to capture at. Defaults to `[{ width: 1280, height: 800 }]`. - -*** - -### fullPage? - -> `optional` **fullPage?**: `boolean` - -Defined in: [mcp/types.ts:190](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L190) - -Default false. Full-page captures for the broad lenses. - -*** - -### waitFor? - -> `optional` **waitFor?**: `string` - -Defined in: [mcp/types.ts:192](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L192) - -Selector to wait for before capture. diff --git a/docs/api/mcp/interfaces/DelegationError.md b/docs/api/mcp/interfaces/DelegationError.md deleted file mode 100644 index 77af404..0000000 --- a/docs/api/mcp/interfaces/DelegationError.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationError - -# Interface: DelegationError - -Defined in: [mcp/types.ts:144](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L144) - -**`Experimental`** - -## Properties - -### message - -> **message**: `string` - -Defined in: [mcp/types.ts:145](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L145) - -**`Experimental`** - -*** - -### kind - -> **kind**: `string` - -Defined in: [mcp/types.ts:146](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L146) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/DelegationExecutor.md b/docs/api/mcp/interfaces/DelegationExecutor.md deleted file mode 100644 index b2f3afc..0000000 --- a/docs/api/mcp/interfaces/DelegationExecutor.md +++ /dev/null @@ -1,55 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationExecutor - -# Interface: DelegationExecutor - -Defined in: [mcp/executor.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L25) - -**`Experimental`** - -## Properties - -### client - -> `readonly` **client**: [`SandboxClient`](../../runtime/interfaces/SandboxClient.md) - -Defined in: [mcp/executor.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L27) - -**`Experimental`** - -Sandbox client the kernel calls. Returned with `describePlacement` set. - -*** - -### placement? - -> `readonly` `optional` **placement?**: `"sibling"` \| `"fleet"` \| `"in-process"` - -Defined in: [mcp/executor.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L37) - -**`Experimental`** - -Where delegated work physically runs. `sibling` and `fleet` placements are -session-backed (boxes expose `driveTurn`, so detached dispatch + resume -apply); `in-process` spawns local harness CLIs with no sandbox session to -detach. Optional so consumer-implemented executors stay source-compatible; -absent means "unknown" and detached dispatch is not enabled for it. - -## Methods - -### describe() - -> **describe**(): `string` - -Defined in: [mcp/executor.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L29) - -**`Experimental`** - -Best-effort one-liner used in stderr boot logs and diagnostics. - -#### Returns - -`string` diff --git a/docs/api/mcp/interfaces/DelegationFeedbackSnapshot.md b/docs/api/mcp/interfaces/DelegationFeedbackSnapshot.md deleted file mode 100644 index d6faa00..0000000 --- a/docs/api/mcp/interfaces/DelegationFeedbackSnapshot.md +++ /dev/null @@ -1,71 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationFeedbackSnapshot - -# Interface: DelegationFeedbackSnapshot - -Defined in: [mcp/types.ts:275](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L275) - -**`Experimental`** - -## Properties - -### id - -> **id**: `string` - -Defined in: [mcp/types.ts:276](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L276) - -**`Experimental`** - -*** - -### score - -> **score**: `number` - -Defined in: [mcp/types.ts:277](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L277) - -**`Experimental`** - -*** - -### label? - -> `optional` **label?**: `"good"` \| `"bad"` \| `"neutral"` \| `"mixed"` - -Defined in: [mcp/types.ts:278](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L278) - -**`Experimental`** - -*** - -### by - -> **by**: `"user"` \| `"agent"` \| `"downstream-judge"` - -Defined in: [mcp/types.ts:279](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L279) - -**`Experimental`** - -*** - -### notes - -> **notes**: `string` - -Defined in: [mcp/types.ts:280](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L280) - -**`Experimental`** - -*** - -### capturedAt - -> **capturedAt**: `string` - -Defined in: [mcp/types.ts:281](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L281) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/DelegationHistoryArgs.md b/docs/api/mcp/interfaces/DelegationHistoryArgs.md deleted file mode 100644 index 665a74e..0000000 --- a/docs/api/mcp/interfaces/DelegationHistoryArgs.md +++ /dev/null @@ -1,55 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationHistoryArgs - -# Interface: DelegationHistoryArgs - -Defined in: [mcp/types.ts:265](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L265) - -**`Experimental`** - -## Properties - -### namespace? - -> `optional` **namespace?**: `string` - -Defined in: [mcp/types.ts:266](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L266) - -**`Experimental`** - -*** - -### profile? - -> `optional` **profile?**: [`DelegationProfile`](../type-aliases/DelegationProfile.md) - -Defined in: [mcp/types.ts:267](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L267) - -**`Experimental`** - -*** - -### since? - -> `optional` **since?**: `string` - -Defined in: [mcp/types.ts:269](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L269) - -**`Experimental`** - -ISO date — only delegations started at-or-after `since` are returned. - -*** - -### limit? - -> `optional` **limit?**: `number` - -Defined in: [mcp/types.ts:271](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L271) - -**`Experimental`** - -Default 50. Hard cap 500. diff --git a/docs/api/mcp/interfaces/DelegationHistoryEntry.md b/docs/api/mcp/interfaces/DelegationHistoryEntry.md deleted file mode 100644 index bfd83a3..0000000 --- a/docs/api/mcp/interfaces/DelegationHistoryEntry.md +++ /dev/null @@ -1,127 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationHistoryEntry - -# Interface: DelegationHistoryEntry - -Defined in: [mcp/types.ts:285](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L285) - -**`Experimental`** - -## Properties - -### taskId - -> **taskId**: `string` - -Defined in: [mcp/types.ts:286](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L286) - -**`Experimental`** - -*** - -### profile - -> **profile**: [`DelegationProfile`](../type-aliases/DelegationProfile.md) - -Defined in: [mcp/types.ts:287](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L287) - -**`Experimental`** - -*** - -### namespace? - -> `optional` **namespace?**: `string` - -Defined in: [mcp/types.ts:288](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L288) - -**`Experimental`** - -*** - -### args - -> **args**: [`DelegateCodeArgs`](DelegateCodeArgs.md) \| [`DelegateResearchArgs`](DelegateResearchArgs.md) \| [`DelegateUiAuditArgs`](DelegateUiAuditArgs.md) - -Defined in: [mcp/types.ts:289](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L289) - -**`Experimental`** - -*** - -### status - -> **status**: [`DelegationStatus`](../type-aliases/DelegationStatus.md) - -Defined in: [mcp/types.ts:290](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L290) - -**`Experimental`** - -*** - -### feedback? - -> `optional` **feedback?**: [`DelegationFeedbackSnapshot`](DelegationFeedbackSnapshot.md)[] - -Defined in: [mcp/types.ts:291](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L291) - -**`Experimental`** - -*** - -### costUsd? - -> `optional` **costUsd?**: `number` - -Defined in: [mcp/types.ts:292](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L292) - -**`Experimental`** - -*** - -### startedAt - -> **startedAt**: `string` - -Defined in: [mcp/types.ts:293](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L293) - -**`Experimental`** - -*** - -### completedAt? - -> `optional` **completedAt?**: `string` - -Defined in: [mcp/types.ts:294](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L294) - -**`Experimental`** - -*** - -### hasTrace - -> **hasTrace**: `boolean` - -Defined in: [mcp/types.ts:300](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L300) - -**`Experimental`** - -True when the record carries a journaled loop trace. History stays -light by design — fetch the spans via -`delegation_status { taskId, includeTrace: true }`. - -*** - -### traceId? - -> `optional` **traceId?**: `string` - -Defined in: [mcp/types.ts:302](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L302) - -**`Experimental`** - -Inherited trace identity recorded at submit — join key into the caller's trace. diff --git a/docs/api/mcp/interfaces/DelegationHistoryResult.md b/docs/api/mcp/interfaces/DelegationHistoryResult.md deleted file mode 100644 index 021ba32..0000000 --- a/docs/api/mcp/interfaces/DelegationHistoryResult.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationHistoryResult - -# Interface: DelegationHistoryResult - -Defined in: [mcp/types.ts:306](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L306) - -**`Experimental`** - -## Properties - -### delegations - -> **delegations**: [`DelegationHistoryEntry`](DelegationHistoryEntry.md)[] - -Defined in: [mcp/types.ts:307](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L307) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/DelegationProgress.md b/docs/api/mcp/interfaces/DelegationProgress.md deleted file mode 100644 index a2205b5..0000000 --- a/docs/api/mcp/interfaces/DelegationProgress.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationProgress - -# Interface: DelegationProgress - -Defined in: [mcp/types.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L138) - -**`Experimental`** - -## Properties - -### iteration - -> **iteration**: `number` - -Defined in: [mcp/types.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L139) - -**`Experimental`** - -*** - -### phase - -> **phase**: `string` - -Defined in: [mcp/types.ts:140](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L140) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/DelegationRecord.md b/docs/api/mcp/interfaces/DelegationRecord.md deleted file mode 100644 index 18babfb..0000000 --- a/docs/api/mcp/interfaces/DelegationRecord.md +++ /dev/null @@ -1,217 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationRecord - -# Interface: DelegationRecord - -Defined in: [mcp/task-queue.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L65) - -**`Experimental`** - -Must be JSON-safe end to end (`args`, `result`, `error`, `feedback`) — -persistent stores round-trip records through `JSON.stringify`. - -## Properties - -### taskId - -> **taskId**: `string` - -Defined in: [mcp/task-queue.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L66) - -**`Experimental`** - -*** - -### profile - -> **profile**: [`DelegationProfile`](../type-aliases/DelegationProfile.md) - -Defined in: [mcp/task-queue.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L67) - -**`Experimental`** - -*** - -### namespace? - -> `optional` **namespace?**: `string` - -Defined in: [mcp/task-queue.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L68) - -**`Experimental`** - -*** - -### args - -> **args**: `AnyDelegateArgs` - -Defined in: [mcp/task-queue.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L69) - -**`Experimental`** - -*** - -### status - -> **status**: [`DelegationStatus`](../type-aliases/DelegationStatus.md) - -Defined in: [mcp/task-queue.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L70) - -**`Experimental`** - -*** - -### progress? - -> `optional` **progress?**: [`DelegationProgress`](DelegationProgress.md) - -Defined in: [mcp/task-queue.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L71) - -**`Experimental`** - -*** - -### result? - -> `optional` **result?**: [`DelegationResultPayload`](../type-aliases/DelegationResultPayload.md) - -Defined in: [mcp/task-queue.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L72) - -**`Experimental`** - -*** - -### error? - -> `optional` **error?**: [`DelegationError`](DelegationError.md) - -Defined in: [mcp/task-queue.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L73) - -**`Experimental`** - -*** - -### costUsd? - -> `optional` **costUsd?**: `number` - -Defined in: [mcp/task-queue.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L74) - -**`Experimental`** - -*** - -### startedAt - -> **startedAt**: `string` - -Defined in: [mcp/task-queue.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L75) - -**`Experimental`** - -*** - -### completedAt? - -> `optional` **completedAt?**: `string` - -Defined in: [mcp/task-queue.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L76) - -**`Experimental`** - -*** - -### idempotencyKey? - -> `optional` **idempotencyKey?**: `string` - -Defined in: [mcp/task-queue.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L78) - -**`Experimental`** - -Sha-prefix hash of the canonical input — used for idempotency lookup. - -*** - -### detachedSessionRef? - -> `optional` **detachedSessionRef?**: `string` - -Defined in: [mcp/task-queue.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L85) - -**`Experimental`** - -Caller-generated deterministic id of a detached run (e.g. the sandbox -session id a single-tick driver resumes by). Presence is what makes a -restored in-flight record resumable via `resumeDelegate`; without it a -restart settles the record as failed. - -*** - -### feedback - -> **feedback**: [`DelegationFeedbackSnapshot`](DelegationFeedbackSnapshot.md)[] - -Defined in: [mcp/task-queue.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L87) - -**`Experimental`** - -Feedback events keyed by this delegation's taskId. - -*** - -### trace? - -> `optional` **trace?**: [`DelegationTraceSpan`](DelegationTraceSpan.md)[] - -Defined in: [mcp/task-queue.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L94) - -**`Experimental`** - -Compact loop-trace span tree teed from the delegation's run, oldest -spans first. Appended when a delegated loop reaches `loop.ended` and -settled (partial buffers included) at the terminal transition. Capped -via `capDelegationTrace` — see `traceTruncated`. - -*** - -### traceTruncated? - -> `optional` **traceTruncated?**: `true` - -Defined in: [mcp/task-queue.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L96) - -**`Experimental`** - -Present when oldest trace spans were dropped to honor the trace caps. - -*** - -### traceId? - -> `optional` **traceId?**: `string` - -Defined in: [mcp/task-queue.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L103) - -**`Experimental`** - -Inherited trace identity (the queue's `traceContext` at submit time — -typically `readTraceContextFromEnv()`), distinct from the span payload: -a journal consumer joins records into the parent trace by these ids -without parsing spans. Restored records keep their persisted identity. - -*** - -### parentSpanId? - -> `optional` **parentSpanId?**: `string` - -Defined in: [mcp/task-queue.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L105) - -**`Experimental`** - -Caller span that dispatched the delegation, when one was inherited. diff --git a/docs/api/mcp/interfaces/DelegationResumeContext.md b/docs/api/mcp/interfaces/DelegationResumeContext.md deleted file mode 100644 index 2f99fa0..0000000 --- a/docs/api/mcp/interfaces/DelegationResumeContext.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationResumeContext - -# Interface: DelegationResumeContext - -Defined in: [mcp/task-queue.ts:177](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L177) - -**`Experimental`** - -## Properties - -### signal - -> **signal**: `AbortSignal` - -Defined in: [mcp/task-queue.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L179) - -**`Experimental`** - -Fired by `cancel(taskId)`; the driver should stop the remote run when it can. - -## Methods - -### report() - -> **report**(`progress`): `void` - -Defined in: [mcp/task-queue.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L180) - -**`Experimental`** - -#### Parameters - -##### progress - -[`DelegationProgress`](DelegationProgress.md) - -#### Returns - -`void` diff --git a/docs/api/mcp/interfaces/DelegationResumeDriver.md b/docs/api/mcp/interfaces/DelegationResumeDriver.md deleted file mode 100644 index d173a6b..0000000 --- a/docs/api/mcp/interfaces/DelegationResumeDriver.md +++ /dev/null @@ -1,60 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationResumeDriver - -# Interface: DelegationResumeDriver - -Defined in: [mcp/task-queue.ts:193](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L193) - -**`Experimental`** - -Re-attaches restored in-flight records to their detached runs. The queue -calls `tick` repeatedly — it never awaits a whole run — so the driver can -be a thin wrapper over a one-pass primitive: resolve the run named by -`detachedSessionRef`, advance/poll it once, report where it stands. A -thrown error settles the record as failed; `failed` ticks are treated as -terminal and are not retried. - -## Properties - -### intervalMs? - -> `optional` **intervalMs?**: `number` - -Defined in: [mcp/task-queue.ts:199](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L199) - -**`Experimental`** - -Delay between `running` ticks, in milliseconds. Default 5000. - -## Methods - -### tick() - -> **tick**(`task`, `ctx`): `Promise`\<[`DelegationResumeTick`](../type-aliases/DelegationResumeTick.md)\> - -Defined in: [mcp/task-queue.ts:194](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L194) - -**`Experimental`** - -#### Parameters - -##### task - -###### record - -[`DelegationRecord`](DelegationRecord.md) - -###### detachedSessionRef - -`string` - -##### ctx - -[`DelegationResumeContext`](DelegationResumeContext.md) - -#### Returns - -`Promise`\<[`DelegationResumeTick`](../type-aliases/DelegationResumeTick.md)\> diff --git a/docs/api/mcp/interfaces/DelegationRunContext.md b/docs/api/mcp/interfaces/DelegationRunContext.md deleted file mode 100644 index 3535c67..0000000 --- a/docs/api/mcp/interfaces/DelegationRunContext.md +++ /dev/null @@ -1,99 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationRunContext - -# Interface: DelegationRunContext - -Defined in: [mcp/task-queue.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L131) - -**`Experimental`** - -Context handed to a `SubmitInput.run` function. - -## Properties - -### signal - -> **signal**: `AbortSignal` - -Defined in: [mcp/task-queue.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L132) - -**`Experimental`** - -*** - -### detachedSessionRef? - -> `optional` **detachedSessionRef?**: `string` - -Defined in: [mcp/task-queue.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L135) - -**`Experimental`** - -The `detachedSessionRef` recorded at submit, when one was supplied. - -*** - -### traceEmitter? - -> `optional` **traceEmitter?**: [`LoopTraceEmitter`](../../runtime/interfaces/LoopTraceEmitter.md) - -Defined in: [mcp/task-queue.ts:153](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L153) - -**`Experimental`** - -Per-delegation loop-trace sink, always provided by the queue. Events -emitted here are journaled onto the record as a compact span tree -(`record.trace`) when each loop run ends and at the delegation's -terminal transition. Delegates forward it into their `runLoop` ctx, -composed with any process-wide OTEL emitter -(`composeLoopTraceEmitters`). Optional in the type so consumer-built -contexts stay source-compatible. - -## Methods - -### report() - -> **report**(`progress`): `void` - -Defined in: [mcp/task-queue.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L133) - -**`Experimental`** - -#### Parameters - -##### progress - -[`DelegationProgress`](DelegationProgress.md) - -#### Returns - -`void` - -*** - -### updateDetachedSessionRef() - -> **updateDetachedSessionRef**(`ref`): `void` - -Defined in: [mcp/task-queue.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L143) - -**`Experimental`** - -Replace the record's detached-run resume key — the detached dispatch path -calls this once the sandbox id is known so the persisted ref names a -resolvable box. Ignored after the record settles (a cancel racing the -rebind is legitimate; the ref no longer matters then). Throws on an empty -ref — erasing the resume key would silently make the record unresumable. - -#### Parameters - -##### ref - -`string` - -#### Returns - -`void` diff --git a/docs/api/mcp/interfaces/DelegationStatusArgs.md b/docs/api/mcp/interfaces/DelegationStatusArgs.md deleted file mode 100644 index 891d937..0000000 --- a/docs/api/mcp/interfaces/DelegationStatusArgs.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationStatusArgs - -# Interface: DelegationStatusArgs - -Defined in: [mcp/types.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L126) - -**`Experimental`** - -## Properties - -### taskId - -> **taskId**: `string` - -Defined in: [mcp/types.ts:127](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L127) - -**`Experimental`** - -*** - -### includeTrace? - -> `optional` **includeTrace?**: `boolean` - -Defined in: [mcp/types.ts:134](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L134) - -**`Experimental`** - -Return the delegation's compact loop-trace span tree alongside the -status. Default false — status polls stay light; opt in when you need -the topology (which iterations ran, where they were placed, what each -cost) rather than just the state machine. diff --git a/docs/api/mcp/interfaces/DelegationStatusResult.md b/docs/api/mcp/interfaces/DelegationStatusResult.md deleted file mode 100644 index 7dce3a0..0000000 --- a/docs/api/mcp/interfaces/DelegationStatusResult.md +++ /dev/null @@ -1,149 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationStatusResult - -# Interface: DelegationStatusResult - -Defined in: [mcp/types.ts:244](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L244) - -**`Experimental`** - -## Properties - -### taskId - -> **taskId**: `string` - -Defined in: [mcp/types.ts:245](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L245) - -**`Experimental`** - -*** - -### profile - -> **profile**: [`DelegationProfile`](../type-aliases/DelegationProfile.md) - -Defined in: [mcp/types.ts:246](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L246) - -**`Experimental`** - -*** - -### status - -> **status**: [`DelegationStatus`](../type-aliases/DelegationStatus.md) - -Defined in: [mcp/types.ts:247](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L247) - -**`Experimental`** - -*** - -### progress? - -> `optional` **progress?**: [`DelegationProgress`](DelegationProgress.md) - -Defined in: [mcp/types.ts:248](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L248) - -**`Experimental`** - -*** - -### result? - -> `optional` **result?**: [`DelegationResultPayload`](../type-aliases/DelegationResultPayload.md) - -Defined in: [mcp/types.ts:249](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L249) - -**`Experimental`** - -*** - -### error? - -> `optional` **error?**: [`DelegationError`](DelegationError.md) - -Defined in: [mcp/types.ts:250](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L250) - -**`Experimental`** - -*** - -### costUsd? - -> `optional` **costUsd?**: `number` - -Defined in: [mcp/types.ts:251](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L251) - -**`Experimental`** - -*** - -### startedAt - -> **startedAt**: `string` - -Defined in: [mcp/types.ts:252](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L252) - -**`Experimental`** - -*** - -### completedAt? - -> `optional` **completedAt?**: `string` - -Defined in: [mcp/types.ts:253](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L253) - -**`Experimental`** - -*** - -### trace? - -> `optional` **trace?**: [`DelegationTraceSpan`](DelegationTraceSpan.md)[] - -Defined in: [mcp/types.ts:255](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L255) - -**`Experimental`** - -Compact loop-trace span tree; present only when `includeTrace: true` was passed and spans were recorded. - -*** - -### traceTruncated? - -> `optional` **traceTruncated?**: `true` - -Defined in: [mcp/types.ts:257](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L257) - -**`Experimental`** - -Present when oldest trace spans were dropped to honor the trace caps. - -*** - -### traceId? - -> `optional` **traceId?**: `string` - -Defined in: [mcp/types.ts:259](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L259) - -**`Experimental`** - -Inherited trace identity recorded at submit — join key into the caller's trace. - -*** - -### parentSpanId? - -> `optional` **parentSpanId?**: `string` - -Defined in: [mcp/types.ts:261](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L261) - -**`Experimental`** - -Caller span that dispatched the delegation, when one was inherited. diff --git a/docs/api/mcp/interfaces/DelegationStore.md b/docs/api/mcp/interfaces/DelegationStore.md deleted file mode 100644 index 3e69651..0000000 --- a/docs/api/mcp/interfaces/DelegationStore.md +++ /dev/null @@ -1,99 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationStore - -# Interface: DelegationStore - -Defined in: [mcp/delegation-store.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L23) - -**`Experimental`** - -## Methods - -### loadAll() - -> **loadAll**(): `Promise`\<[`DelegationRecord`](DelegationRecord.md)[]\> - -Defined in: [mcp/delegation-store.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L30) - -**`Experimental`** - -Read every persisted record. Called once, by -`DelegationTaskQueue.restore`, before any write. A missing backing -file is an empty store; an unparseable one throws -`DelegationStateCorruptError`. - -#### Returns - -`Promise`\<[`DelegationRecord`](DelegationRecord.md)[]\> - -*** - -### upsert() - -> **upsert**(`record`): `Promise`\<`void`\> - -Defined in: [mcp/delegation-store.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L32) - -**`Experimental`** - -Insert or replace the record keyed by `record.taskId`. - -#### Parameters - -##### record - -[`DelegationRecord`](DelegationRecord.md) - -#### Returns - -`Promise`\<`void`\> - -*** - -### lookupIdempotencyKey() - -> **lookupIdempotencyKey**(`key`): `Promise`\<`string` \| `undefined`\> - -Defined in: [mcp/delegation-store.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L39) - -**`Experimental`** - -Resolve an idempotency key to the taskId that claimed it, if any. -The queue serves submit-time dedupe from its rehydrated in-memory -index; this read exists for consumers that share a store across -processes without holding the full record set. - -#### Parameters - -##### key - -`string` - -#### Returns - -`Promise`\<`string` \| `undefined`\> - -*** - -### remove() - -> **remove**(`taskIds`): `Promise`\<`void`\> - -Defined in: [mcp/delegation-store.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L41) - -**`Experimental`** - -Delete the named records — the retention-cap eviction path. - -#### Parameters - -##### taskIds - -readonly `string`[] - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/mcp/interfaces/DelegationTaskQueueOptions.md b/docs/api/mcp/interfaces/DelegationTaskQueueOptions.md deleted file mode 100644 index c9b330c..0000000 --- a/docs/api/mcp/interfaces/DelegationTaskQueueOptions.md +++ /dev/null @@ -1,126 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationTaskQueueOptions - -# Interface: DelegationTaskQueueOptions - -Defined in: [mcp/task-queue.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L203) - -**`Experimental`** - -## Properties - -### generateId? - -> `optional` **generateId?**: () => `string` - -Defined in: [mcp/task-queue.ts:205](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L205) - -**`Experimental`** - -ID generator override; default `randomTaskId`. - -#### Returns - -`string` - -*** - -### now? - -> `optional` **now?**: () => `string` - -Defined in: [mcp/task-queue.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L207) - -**`Experimental`** - -Clock override; default `() => new Date().toISOString()`. - -#### Returns - -`string` - -*** - -### store? - -> `optional` **store?**: [`DelegationStore`](DelegationStore.md) - -Defined in: [mcp/task-queue.ts:215](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L215) - -**`Experimental`** - -Journal for record mutations and the `restore()` load source. Default -`InMemoryDelegationStore` — observably identical to an unjournaled -queue. Pass a `FileDelegationStore` through -`DelegationTaskQueue.restore` for state that survives a restart; -constructing with `new` never loads prior state. - -*** - -### resumeDelegate? - -> `optional` **resumeDelegate?**: [`DelegationResumeDriver`](DelegationResumeDriver.md) - -Defined in: [mcp/task-queue.ts:217](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L217) - -**`Experimental`** - -Resume seam for restored in-flight records that carry a `detachedSessionRef`. - -*** - -### maxTerminalRecords? - -> `optional` **maxTerminalRecords?**: `number` - -Defined in: [mcp/task-queue.ts:223](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L223) - -**`Experimental`** - -Maximum number of terminal (completed | failed | cancelled) records -retained; the oldest (by `completedAt`) are evicted from memory and -store once the cap is exceeded. Default unbounded. - -*** - -### onPersistError? - -> `optional` **onPersistError?**: (`error`) => `void` - -Defined in: [mcp/task-queue.ts:230](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L230) - -**`Experimental`** - -Observes the first store failure. After it fires, the queue refuses -new submissions and `flush()` rejects with the same error. Default: -rethrow on a microtask — an unhandled crash — because silently -degrading durable mode to memory-only would lie to the caller. - -#### Parameters - -##### error - -[`DelegationPersistenceError`](../classes/DelegationPersistenceError.md) - -#### Returns - -`void` - -*** - -### traceContext? - -> `optional` **traceContext?**: [`TraceContext`](TraceContext.md) - -Defined in: [mcp/task-queue.ts:238](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L238) - -**`Experimental`** - -Inherited trace identity stamped on every submitted record -(`traceId` / `parentSpanId`). The bin passes -`readTraceContextFromEnv()` so journal consumers can join delegation -records into the caller's trace. Restored records keep the identity -they were persisted with. diff --git a/docs/api/mcp/interfaces/DelegationTraceCaps.md b/docs/api/mcp/interfaces/DelegationTraceCaps.md deleted file mode 100644 index 0d7f508..0000000 --- a/docs/api/mcp/interfaces/DelegationTraceCaps.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationTraceCaps - -# Interface: DelegationTraceCaps - -Defined in: [mcp/delegation-trace.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L51) - -**`Experimental`** - -## Properties - -### maxSpans? - -> `optional` **maxSpans?**: `number` - -Defined in: [mcp/delegation-trace.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L53) - -**`Experimental`** - -Default [DELEGATION\_TRACE\_MAX\_SPANS](../variables/DELEGATION_TRACE_MAX_SPANS.md). - -*** - -### maxBytes? - -> `optional` **maxBytes?**: `number` - -Defined in: [mcp/delegation-trace.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L56) - -**`Experimental`** - -Default [DELEGATION\_TRACE\_MAX\_BYTES](../variables/DELEGATION_TRACE_MAX_BYTES.md). Approximate — measured as the - sum of per-span `JSON.stringify` lengths. diff --git a/docs/api/mcp/interfaces/DelegationTraceCollector.md b/docs/api/mcp/interfaces/DelegationTraceCollector.md deleted file mode 100644 index a3580cd..0000000 --- a/docs/api/mcp/interfaces/DelegationTraceCollector.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationTraceCollector - -# Interface: DelegationTraceCollector - -Defined in: [mcp/delegation-trace.ts:123](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L123) - -**`Experimental`** - -Per-delegation trace collector. Buffers `LoopTraceEvent`s per runId -(mirroring the OTEL emitter's buffering) and hands the derived compact -spans to `onSpans` when a run reaches `loop.ended`. `settle()` drains runs -that never ended — a hard-aborted loop still leaves its partial tree in the -journal, unlike the OTEL path which drops it. - -## Properties - -### emitter - -> **emitter**: [`LoopTraceEmitter`](../../runtime/interfaces/LoopTraceEmitter.md) - -Defined in: [mcp/delegation-trace.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L124) - -**`Experimental`** - -## Methods - -### settle() - -> **settle**(): `void` - -Defined in: [mcp/delegation-trace.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L126) - -**`Experimental`** - -Flush buffered events of runs that never reached `loop.ended`. - -#### Returns - -`void` diff --git a/docs/api/mcp/interfaces/DelegationTraceSpan.md b/docs/api/mcp/interfaces/DelegationTraceSpan.md deleted file mode 100644 index 1fb2ec7..0000000 --- a/docs/api/mcp/interfaces/DelegationTraceSpan.md +++ /dev/null @@ -1,93 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationTraceSpan - -# Interface: DelegationTraceSpan - -Defined in: [mcp/delegation-trace.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L31) - -**`Experimental`** - -One span of a delegation's compact trace. Flat (parent linkage by id), all -values JSON-safe scalars — `FileDelegationStore` round-trips records -through `JSON.stringify`. `meta` carries the span's attributes (GenAI -semconv keys + `tangle.loop.*` extensions) exactly as the OTEL sink emits -them, so a consumer can re-export journal traces losslessly. - -## Properties - -### spanId - -> **spanId**: `string` - -Defined in: [mcp/delegation-trace.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L32) - -**`Experimental`** - -*** - -### parentSpanId? - -> `optional` **parentSpanId?**: `string` - -Defined in: [mcp/delegation-trace.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L34) - -**`Experimental`** - -Absent on the tree root. - -*** - -### name - -> **name**: `string` - -Defined in: [mcp/delegation-trace.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L36) - -**`Experimental`** - -`'loop'` | `'loop.round'` | `'loop.iteration'` (or a sink-specific name). - -*** - -### kind - -> **kind**: `"loop"` \| `"round"` \| `"branch"` - -Defined in: [mcp/delegation-trace.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L38) - -**`Experimental`** - -Topology level: loop root, plan round, or iteration branch. - -*** - -### startMs - -> **startMs**: `number` - -Defined in: [mcp/delegation-trace.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L39) - -**`Experimental`** - -*** - -### endMs - -> **endMs**: `number` - -Defined in: [mcp/delegation-trace.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L40) - -**`Experimental`** - -*** - -### meta? - -> `optional` **meta?**: `Record`\<`string`, `string` \| `number` \| `boolean`\> - -Defined in: [mcp/delegation-trace.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L41) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/DetachedSessionDelegateOptions.md b/docs/api/mcp/interfaces/DetachedSessionDelegateOptions.md deleted file mode 100644 index 0ed1515..0000000 --- a/docs/api/mcp/interfaces/DetachedSessionDelegateOptions.md +++ /dev/null @@ -1,184 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DetachedSessionDelegateOptions - -# Interface: DetachedSessionDelegateOptions - -Defined in: [mcp/delegates.ts:150](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L150) - -**`Experimental`** - -## Properties - -### executor? - -> `optional` **executor?**: [`DelegationExecutor`](DelegationExecutor.md) - -Defined in: [mcp/delegates.ts:157](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L157) - -**`Experimental`** - -Execution placement. Pass a [DelegationExecutor](DelegationExecutor.md) (sibling or fleet) -to control where worker iterations land. `sandboxClient` is a -convenience shorthand that wraps the client in a sibling executor — pass -one or the other, not both. - -*** - -### sandboxClient? - -> `optional` **sandboxClient?**: [`SandboxClient`](../../runtime/interfaces/SandboxClient.md) - -Defined in: [mcp/delegates.ts:162](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L162) - -**`Experimental`** - -Convenience shorthand for sibling placement. Equivalent to -`executor: createSiblingSandboxExecutor({ client: sandboxClient })`. - -*** - -### harness? - -> `optional` **harness?**: `string` - -Defined in: [mcp/delegates.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L164) - -**`Experimental`** - -Backend harness for the single-coder path. Default comes from `coderProfile`. - -*** - -### model? - -> `optional` **model?**: `string` - -Defined in: [mcp/delegates.ts:166](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L166) - -**`Experimental`** - -Model override for the single-coder path. - -*** - -### systemPrompt? - -> `optional` **systemPrompt?**: `string` - -Defined in: [mcp/delegates.ts:172](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L172) - -**`Experimental`** - -The worker's authored system prompt (§1.5). Flows onto `coderProfile`'s -`profile.prompt.systemPrompt` → through `runLoop` → the executor's `harnessInvocation`, so the -harness runs under this stance, not just the default coder prompt. Omit to keep the default. - -*** - -### fanoutHarnesses? - -> `optional` **fanoutHarnesses?**: `string`[] - -Defined in: [mcp/delegates.ts:174](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L174) - -**`Experimental`** - -Default `['claude-code', 'codex', 'opencode/zai-coding-plan/glm-5.1']` when variants > 1. - -*** - -### fanoutModels? - -> `optional` **fanoutModels?**: (`string` \| `undefined`)[] - -Defined in: [mcp/delegates.ts:176](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L176) - -**`Experimental`** - -Optional per-harness model override for `variants > 1`. - -*** - -### maxConcurrency? - -> `optional` **maxConcurrency?**: `number` - -Defined in: [mcp/delegates.ts:178](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L178) - -**`Experimental`** - -Hard cap on the kernel's per-batch concurrency. Default 4. - -*** - -### reviewer? - -> `optional` **reviewer?**: [`CoderReviewer`](../type-aliases/CoderReviewer.md) - -Defined in: [mcp/delegates.ts:185](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L185) - -**`Experimental`** - -Optional adversarial reviewer. When set, a candidate must pass mechanical -validation AND `reviewer.approved` to be eligible to win — empty/secret/ -test-failing patches are already gone; this catches the "compiles + passes -but wrong/unsafe" class the deterministic validator can't see. - -*** - -### winnerSelection? - -> `optional` **winnerSelection?**: [`DetachedWinnerSelection`](../type-aliases/DetachedWinnerSelection.md) - -Defined in: [mcp/delegates.ts:187](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L187) - -**`Experimental`** - -Winner-selection strategy among eligible candidates. Default `highest-score`. - -*** - -### traceEmitter? - -> `optional` **traceEmitter?**: [`LoopTraceEmitter`](../../runtime/interfaces/LoopTraceEmitter.md) - -Defined in: [mcp/delegates.ts:199](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L199) - -**`Experimental`** - -Loop trace emitter forwarded into every delegated `runLoop`. Wire -`createPropagatingTraceEmitter(readTraceContextFromEnv())` here (the bin -does) so delegated build-loops export their topology spans to the OTLP / -Tangle Intelligence sink when `OTEL_EXPORTER_OTLP_ENDPOINT` is set — and -are a cheap no-op when it isn't. Configurable by construction. - -Detached single-variant turns (taken when `ctx.detachedSessionRef` is set) -bypass `runLoop`; `runDetachedTurn` synthesizes a single-iteration loop -event stream for them so this emitter observes detached work too. - -*** - -### detachedTickIntervalMs? - -> `optional` **detachedTickIntervalMs?**: `number` - -Defined in: [mcp/delegates.ts:201](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L201) - -**`Experimental`** - -Tick cadence (ms) for the detached single-variant path. Default 5000. - -*** - -### detachedWallCapMs? - -> `optional` **detachedWallCapMs?**: `number` - -Defined in: [mcp/delegates.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L203) - -**`Experimental`** - -Wall-clock cap (ms) forwarded to `driveTurn` for detached turns. diff --git a/docs/api/mcp/interfaces/DetachedSessionRefParts.md b/docs/api/mcp/interfaces/DetachedSessionRefParts.md deleted file mode 100644 index 598f200..0000000 --- a/docs/api/mcp/interfaces/DetachedSessionRefParts.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DetachedSessionRefParts - -# Interface: DetachedSessionRefParts - -Defined in: [mcp/detached-turn.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L83) - -**`Experimental`** - -Decoded `DelegationRecord.detachedSessionRef`. `sandboxId` is absent between -submit and box acquisition — a record restored in that window is not -resumable (there is no box to resume on) and the resume driver fails it -loud rather than dispatching onto a guessed box. - -## Properties - -### sessionId - -> **sessionId**: `string` - -Defined in: [mcp/detached-turn.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L84) - -**`Experimental`** - -*** - -### sandboxId? - -> `optional` **sandboxId?**: `string` - -Defined in: [mcp/detached-turn.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L85) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/DetachedTurn.md b/docs/api/mcp/interfaces/DetachedTurn.md deleted file mode 100644 index 1109d80..0000000 --- a/docs/api/mcp/interfaces/DetachedTurn.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DetachedTurn - -# Interface: DetachedTurn - -Defined in: [mcp/detached-turn.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L135) - -**`Experimental`** - -The terminal payload of a finished detached turn. - -## Properties - -### text - -> **text**: `string` - -Defined in: [mcp/detached-turn.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L137) - -**`Experimental`** - -Final assistant text. - -*** - -### result - -> **result**: `Record`\<`string`, `unknown`\> - -Defined in: [mcp/detached-turn.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L139) - -**`Experimental`** - -The SDK's cached AgentExecutionResult-shape record for the turn. diff --git a/docs/api/mcp/interfaces/DetectExecutorArgs.md b/docs/api/mcp/interfaces/DetectExecutorArgs.md deleted file mode 100644 index 39d517b..0000000 --- a/docs/api/mcp/interfaces/DetectExecutorArgs.md +++ /dev/null @@ -1,61 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DetectExecutorArgs - -# Interface: DetectExecutorArgs - -Defined in: [mcp/bin-helpers.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/bin-helpers.ts#L20) - -**`Experimental`** - -## Properties - -### sandboxClient - -> **sandboxClient**: [`SandboxClient`](../../runtime/interfaces/SandboxClient.md) - -Defined in: [mcp/bin-helpers.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/bin-helpers.ts#L21) - -**`Experimental`** - -*** - -### env? - -> `optional` **env?**: `Record`\<`string`, `string` \| `undefined`\> - -Defined in: [mcp/bin-helpers.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/bin-helpers.ts#L23) - -**`Experimental`** - -Raw env (defaults to `process.env`). Pass an explicit map for tests. - -*** - -### resolveFleet? - -> `optional` **resolveFleet?**: (`client`, `fleetId`) => `Promise`\<[`FleetHandle`](FleetHandle.md)\> - -Defined in: [mcp/bin-helpers.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/bin-helpers.ts#L29) - -**`Experimental`** - -Override how a fleet handle is resolved from the client + fleet id. The -default reads `client.fleets.get(fleetId)` and validates the returned -shape against the structural `FleetHandle` contract. - -#### Parameters - -##### client - -[`SandboxClient`](../../runtime/interfaces/SandboxClient.md) - -##### fleetId - -`string` - -#### Returns - -`Promise`\<[`FleetHandle`](FleetHandle.md)\> diff --git a/docs/api/mcp/interfaces/DiffOptions.md b/docs/api/mcp/interfaces/DiffOptions.md deleted file mode 100644 index 4b447c1..0000000 --- a/docs/api/mcp/interfaces/DiffOptions.md +++ /dev/null @@ -1,47 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DiffOptions - -# Interface: DiffOptions - -Defined in: [mcp/worktree.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L45) - -**`Experimental`** - -## Properties - -### worktree - -> **worktree**: [`WorktreeHandle`](WorktreeHandle.md) - -Defined in: [mcp/worktree.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L47) - -**`Experimental`** - -Worktree to diff. - -*** - -### baseRef? - -> `optional` **baseRef?**: `string` - -Defined in: [mcp/worktree.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L49) - -**`Experimental`** - -What to compare against. Default `worktree.baseSha`. - -*** - -### runGit? - -> `optional` **runGit?**: [`GitRunner`](../type-aliases/GitRunner.md) - -Defined in: [mcp/worktree.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L51) - -**`Experimental`** - -Test seam. diff --git a/docs/api/mcp/interfaces/DiffResult.md b/docs/api/mcp/interfaces/DiffResult.md deleted file mode 100644 index dce057e..0000000 --- a/docs/api/mcp/interfaces/DiffResult.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DiffResult - -# Interface: DiffResult - -Defined in: [mcp/worktree.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L55) - -**`Experimental`** - -## Properties - -### patch - -> **patch**: `string` - -Defined in: [mcp/worktree.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L56) - -**`Experimental`** - -*** - -### stats - -> **stats**: `object` - -Defined in: [mcp/worktree.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L57) - -**`Experimental`** - -#### filesChanged - -> **filesChanged**: `number` - -#### insertions - -> **insertions**: `number` - -#### deletions - -> **deletions**: `number` diff --git a/docs/api/mcp/interfaces/DriveTurnCapableBox.md b/docs/api/mcp/interfaces/DriveTurnCapableBox.md deleted file mode 100644 index d472847..0000000 --- a/docs/api/mcp/interfaces/DriveTurnCapableBox.md +++ /dev/null @@ -1,71 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DriveTurnCapableBox - -# Interface: DriveTurnCapableBox - -Defined in: [mcp/detached-turn.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L67) - -**`Experimental`** - -The box surface detached turns need. `SandboxInstance` -(`@tangle-network/sandbox` >= 0.6) satisfies it structurally; tests pass -in-memory fakes. `_sessionCancel` is the SDK's remote-cancellation surface — -optional here because older SDKs / fakes may not expose it; when present it -is invoked on abort so the remote run actually stops. - -## Methods - -### driveTurn() - -> **driveTurn**(`message`, `opts`): `Promise`\<[`DriveTurnTick`](../type-aliases/DriveTurnTick.md)\> - -Defined in: [mcp/detached-turn.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L68) - -**`Experimental`** - -#### Parameters - -##### message - -`string` - -##### opts - -###### sessionId - -`string` - -###### turnId? - -`string` - -###### wallCapMs? - -`number` - -#### Returns - -`Promise`\<[`DriveTurnTick`](../type-aliases/DriveTurnTick.md)\> - -*** - -### \_sessionCancel()? - -> `optional` **\_sessionCancel**(`id`): `Promise`\<`void`\> - -Defined in: [mcp/detached-turn.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L72) - -**`Experimental`** - -#### Parameters - -##### id - -`string` - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/mcp/interfaces/DriveTurnResumeDriverOptions.md b/docs/api/mcp/interfaces/DriveTurnResumeDriverOptions.md deleted file mode 100644 index 0c662c4..0000000 --- a/docs/api/mcp/interfaces/DriveTurnResumeDriverOptions.md +++ /dev/null @@ -1,118 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DriveTurnResumeDriverOptions - -# Interface: DriveTurnResumeDriverOptions - -Defined in: [mcp/detached-turn.ts:365](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L365) - -**`Experimental`** - -## Properties - -### intervalMs? - -> `optional` **intervalMs?**: `number` - -Defined in: [mcp/detached-turn.ts:390](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L390) - -**`Experimental`** - -Delay between `running` ticks (ms). Default 5000. - -*** - -### wallCapMs? - -> `optional` **wallCapMs?**: `number` - -Defined in: [mcp/detached-turn.ts:392](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L392) - -**`Experimental`** - -Wall-clock cap forwarded to `driveTurn` on every tick. - -## Methods - -### resolveSandbox() - -> **resolveSandbox**(`sandboxId`): `Promise`\<[`DriveTurnCapableBox`](DriveTurnCapableBox.md)\> - -Defined in: [mcp/detached-turn.ts:371](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L371) - -**`Experimental`** - -Resolve the live box owning a detached session. The bin wires this to the -sandbox client's `get(sandboxId)`; throw when the box no longer exists — -a thrown tick settles the record as failed, which is the truth. - -#### Parameters - -##### sandboxId - -`string` - -#### Returns - -`Promise`\<[`DriveTurnCapableBox`](DriveTurnCapableBox.md)\> - -*** - -### buildMessage() - -> **buildMessage**(`record`): `string` - -Defined in: [mcp/detached-turn.ts:378](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L378) - -**`Experimental`** - -Rebuild the turn prompt from the persisted record. Only consumed by -`driveTurn`'s dispatch leg — i.e. when the previous process died after -binding the box but before the session was dispatched. Must reproduce the -prompt the delegate would have sent. - -#### Parameters - -##### record - -[`DelegationRecord`](DelegationRecord.md) - -#### Returns - -`string` - -*** - -### settleOutput() - -> **settleOutput**(`turn`, `record`, `ctx`): `CoderOutput` \| [`ResearchOutputShape`](ResearchOutputShape.md) \| [`UiAuditorDelegationOutput`](UiAuditorDelegationOutput.md) \| `Promise`\<`CoderOutput` \| [`ResearchOutputShape`](ResearchOutputShape.md) \| [`UiAuditorDelegationOutput`](UiAuditorDelegationOutput.md)\> - -Defined in: [mcp/detached-turn.ts:384](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L384) - -**`Experimental`** - -Map a completed turn onto the delegation's typed output payload (parse + -validate per profile). Throw when the resumed result does not pass the -profile's gate — the queue settles the record as failed with that error. - -#### Parameters - -##### turn - -[`DetachedTurn`](DetachedTurn.md) - -##### record - -[`DelegationRecord`](DelegationRecord.md) - -##### ctx - -###### signal - -`AbortSignal` - -#### Returns - -`CoderOutput` \| [`ResearchOutputShape`](ResearchOutputShape.md) \| [`UiAuditorDelegationOutput`](UiAuditorDelegationOutput.md) \| `Promise`\<`CoderOutput` \| [`ResearchOutputShape`](ResearchOutputShape.md) \| [`UiAuditorDelegationOutput`](UiAuditorDelegationOutput.md)\> diff --git a/docs/api/mcp/interfaces/FactCandidate.md b/docs/api/mcp/interfaces/FactCandidate.md deleted file mode 100644 index 8aa0c38..0000000 --- a/docs/api/mcp/interfaces/FactCandidate.md +++ /dev/null @@ -1,73 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / FactCandidate - -# Interface: FactCandidate - -Defined in: [mcp/kb-gate.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L24) - -**`Experimental`** - -A fact proposed for the KB, with its grounding. - -## Properties - -### claim - -> **claim**: `string` - -Defined in: [mcp/kb-gate.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L26) - -**`Experimental`** - -The atomic claim text. - -*** - -### value? - -> `optional` **value?**: `string` \| `number` - -Defined in: [mcp/kb-gate.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L28) - -**`Experimental`** - -Optional extracted value (number or string) the claim asserts. - -*** - -### verbatimPassage - -> **verbatimPassage**: `string` - -Defined in: [mcp/kb-gate.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L30) - -**`Experimental`** - -Verbatim span lifted from the source that backs the claim. - -*** - -### sourceText - -> **sourceText**: `string` - -Defined in: [mcp/kb-gate.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L32) - -**`Experimental`** - -The raw source text the passage must be grounded in. - -*** - -### citation? - -> `optional` **citation?**: `string` - -Defined in: [mcp/kb-gate.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L34) - -**`Experimental`** - -Where the fact claims to come from — checked for circular/self citations. diff --git a/docs/api/mcp/interfaces/FactJudge.md b/docs/api/mcp/interfaces/FactJudge.md deleted file mode 100644 index 5fba25b..0000000 --- a/docs/api/mcp/interfaces/FactJudge.md +++ /dev/null @@ -1,44 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / FactJudge - -# Interface: FactJudge - -Defined in: [mcp/kb-gate.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L45) - -**`Experimental`** - -A pluggable fact validator. Throw is NOT allowed — return a - verdict; a thrown judge is a programmer error, not a veto. - -## Properties - -### name - -> **name**: `string` - -Defined in: [mcp/kb-gate.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L46) - -**`Experimental`** - -## Methods - -### judge() - -> **judge**(`candidate`): [`FactJudgeVerdict`](FactJudgeVerdict.md) \| `Promise`\<[`FactJudgeVerdict`](FactJudgeVerdict.md)\> - -Defined in: [mcp/kb-gate.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L47) - -**`Experimental`** - -#### Parameters - -##### candidate - -[`FactCandidate`](FactCandidate.md) - -#### Returns - -[`FactJudgeVerdict`](FactJudgeVerdict.md) \| `Promise`\<[`FactJudgeVerdict`](FactJudgeVerdict.md)\> diff --git a/docs/api/mcp/interfaces/FactJudgeVerdict.md b/docs/api/mcp/interfaces/FactJudgeVerdict.md deleted file mode 100644 index 15cdd6c..0000000 --- a/docs/api/mcp/interfaces/FactJudgeVerdict.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / FactJudgeVerdict - -# Interface: FactJudgeVerdict - -Defined in: [mcp/kb-gate.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L38) - -**`Experimental`** - -## Properties - -### accept - -> **accept**: `boolean` - -Defined in: [mcp/kb-gate.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L39) - -**`Experimental`** - -*** - -### reason? - -> `optional` **reason?**: `string` - -Defined in: [mcp/kb-gate.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L40) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/FeedbackEvent.md b/docs/api/mcp/interfaces/FeedbackEvent.md deleted file mode 100644 index a6da9e8..0000000 --- a/docs/api/mcp/interfaces/FeedbackEvent.md +++ /dev/null @@ -1,71 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / FeedbackEvent - -# Interface: FeedbackEvent - -Defined in: [mcp/feedback-store.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L20) - -**`Experimental`** - -## Properties - -### id - -> **id**: `string` - -Defined in: [mcp/feedback-store.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L21) - -**`Experimental`** - -*** - -### refersTo - -> **refersTo**: [`FeedbackRefersTo`](FeedbackRefersTo.md) - -Defined in: [mcp/feedback-store.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L22) - -**`Experimental`** - -*** - -### rating - -> **rating**: [`FeedbackRating`](FeedbackRating.md) - -Defined in: [mcp/feedback-store.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L23) - -**`Experimental`** - -*** - -### by - -> **by**: `"user"` \| `"agent"` \| `"downstream-judge"` - -Defined in: [mcp/feedback-store.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L24) - -**`Experimental`** - -*** - -### capturedAt - -> **capturedAt**: `string` - -Defined in: [mcp/feedback-store.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L25) - -**`Experimental`** - -*** - -### namespace? - -> `optional` **namespace?**: `string` - -Defined in: [mcp/feedback-store.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L26) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/FeedbackRating.md b/docs/api/mcp/interfaces/FeedbackRating.md deleted file mode 100644 index 41e81b3..0000000 --- a/docs/api/mcp/interfaces/FeedbackRating.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / FeedbackRating - -# Interface: FeedbackRating - -Defined in: [mcp/types.ts:102](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L102) - -**`Experimental`** - -## Properties - -### score - -> **score**: `number` - -Defined in: [mcp/types.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L104) - -**`Experimental`** - -[0, 1]. - -*** - -### label? - -> `optional` **label?**: `"good"` \| `"bad"` \| `"neutral"` \| `"mixed"` - -Defined in: [mcp/types.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L105) - -**`Experimental`** - -*** - -### notes - -> **notes**: `string` - -Defined in: [mcp/types.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L106) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/FeedbackRefersTo.md b/docs/api/mcp/interfaces/FeedbackRefersTo.md deleted file mode 100644 index 0b2b48e..0000000 --- a/docs/api/mcp/interfaces/FeedbackRefersTo.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / FeedbackRefersTo - -# Interface: FeedbackRefersTo - -Defined in: [mcp/types.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L95) - -**`Experimental`** - -## Properties - -### kind - -> **kind**: `"artifact"` \| `"delegation"` \| `"outcome"` - -Defined in: [mcp/types.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L96) - -**`Experimental`** - -*** - -### ref - -> **ref**: `string` - -Defined in: [mcp/types.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L98) - -**`Experimental`** - -For `'delegation'`, this is the taskId. diff --git a/docs/api/mcp/interfaces/FeedbackStore.md b/docs/api/mcp/interfaces/FeedbackStore.md deleted file mode 100644 index 1361424..0000000 --- a/docs/api/mcp/interfaces/FeedbackStore.md +++ /dev/null @@ -1,62 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / FeedbackStore - -# Interface: FeedbackStore - -Defined in: [mcp/feedback-store.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L30) - -**`Experimental`** - -## Methods - -### put() - -> **put**(`event`): `Promise`\<`void`\> - -Defined in: [mcp/feedback-store.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L32) - -**`Experimental`** - -Append a new event. Never dedupes — every rating is its own event. - -#### Parameters - -##### event - -[`FeedbackEvent`](FeedbackEvent.md) - -#### Returns - -`Promise`\<`void`\> - -*** - -### list() - -> **list**(`filter?`): `Promise`\<[`FeedbackEvent`](FeedbackEvent.md)[]\> - -Defined in: [mcp/feedback-store.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/feedback-store.ts#L37) - -**`Experimental`** - -List events filtered by `namespace`. When `namespace` is omitted, list -across all namespaces. Returns events in insertion order. - -#### Parameters - -##### filter? - -###### namespace? - -`string` - -###### refersToRef? - -`string` - -#### Returns - -`Promise`\<[`FeedbackEvent`](FeedbackEvent.md)[]\> diff --git a/docs/api/mcp/interfaces/FileDelegationStoreOptions.md b/docs/api/mcp/interfaces/FileDelegationStoreOptions.md deleted file mode 100644 index af6fd86..0000000 --- a/docs/api/mcp/interfaces/FileDelegationStoreOptions.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / FileDelegationStoreOptions - -# Interface: FileDelegationStoreOptions - -Defined in: [mcp/delegation-store.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L99) - -**`Experimental`** - -## Properties - -### filePath - -> **filePath**: `string` - -Defined in: [mcp/delegation-store.ts:101](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L101) - -**`Experimental`** - -Absolute path of the JSON state file. Parent directories are created on first write. - -*** - -### recoverCorrupt? - -> `optional` **recoverCorrupt?**: `boolean` - -Defined in: [mcp/delegation-store.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-store.ts#L107) - -**`Experimental`** - -When the state file exists but cannot be parsed, archive it to -`.corrupt-` and start empty instead of -throwing `DelegationStateCorruptError`. Default false. diff --git a/docs/api/mcp/interfaces/FleetHandle.md b/docs/api/mcp/interfaces/FleetHandle.md deleted file mode 100644 index 7278668..0000000 --- a/docs/api/mcp/interfaces/FleetHandle.md +++ /dev/null @@ -1,61 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / FleetHandle - -# Interface: FleetHandle - -Defined in: [mcp/executor.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L82) - -**`Experimental`** - -Minimal `SandboxFleet` surface the fleet executor calls. Declared -structurally so tests can pass an in-memory stub without instantiating the -sandbox SDK. - -## Properties - -### fleetId - -> `readonly` **fleetId**: `string` - -Defined in: [mcp/executor.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L83) - -**`Experimental`** - -*** - -### ids - -> `readonly` **ids**: readonly `string`[] - -Defined in: [mcp/executor.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L85) - -**`Experimental`** - -Machine ids in dispatch-eligible order. The executor round-robins. - -## Methods - -### sandbox() - -> **sandbox**(`machineId`): `Promise`\<`SandboxInstance`\> - -Defined in: [mcp/executor.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L89) - -**`Experimental`** - -Resolve a machine id to its `SandboxInstance` — that machine is mounted -on the fleet's shared workspace, so any diff the worker writes lands on -every other fleet machine's filesystem too. - -#### Parameters - -##### machineId - -`string` - -#### Returns - -`Promise`\<`SandboxInstance`\> diff --git a/docs/api/mcp/interfaces/FleetWorkspaceExecutorOptions.md b/docs/api/mcp/interfaces/FleetWorkspaceExecutorOptions.md deleted file mode 100644 index 815c246..0000000 --- a/docs/api/mcp/interfaces/FleetWorkspaceExecutorOptions.md +++ /dev/null @@ -1,64 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / FleetWorkspaceExecutorOptions - -# Interface: FleetWorkspaceExecutorOptions - -Defined in: [mcp/executor.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L93) - -**`Experimental`** - -## Properties - -### fleet - -> **fleet**: [`FleetHandle`](FleetHandle.md) - -Defined in: [mcp/executor.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L94) - -**`Experimental`** - -*** - -### selectMachine? - -> `optional` **selectMachine?**: (`call`) => `string` - -Defined in: [mcp/executor.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L100) - -**`Experimental`** - -Override the machine-selection policy. Default = round-robin across -`fleet.ids`, skipping the optional `excludeMachineIds` set (typically the -coordinator machine the MCP server is running on). - -#### Parameters - -##### call - -###### callIndex - -`number` - -###### ids - -readonly `string`[] - -#### Returns - -`string` - -*** - -### excludeMachineIds? - -> `optional` **excludeMachineIds?**: readonly `string`[] - -Defined in: [mcp/executor.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L105) - -**`Experimental`** - -Machine ids to skip during default round-robin. Set to the caller's own -machineId so workers don't compete with the orchestrator on the same VM. diff --git a/docs/api/mcp/interfaces/InProcessExecutorDescribePlacement.md b/docs/api/mcp/interfaces/InProcessExecutorDescribePlacement.md deleted file mode 100644 index 82c21a4..0000000 --- a/docs/api/mcp/interfaces/InProcessExecutorDescribePlacement.md +++ /dev/null @@ -1,95 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / InProcessExecutorDescribePlacement - -# Interface: InProcessExecutorDescribePlacement - -Defined in: [mcp/in-process-executor.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L60) - -**`Experimental`** - -## Extends - -- [`LoopSandboxPlacement`](../../runtime/interfaces/LoopSandboxPlacement.md) - -## Properties - -### worktreePath? - -> `optional` **worktreePath?**: `string` - -Defined in: [mcp/in-process-executor.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L62) - -**`Experimental`** - -Worktree path in the parent sandbox's filesystem (set so traces correlate to on-disk artifacts). - -*** - -### harness? - -> `optional` **harness?**: [`LocalHarness`](../type-aliases/LocalHarness.md) - -Defined in: [mcp/in-process-executor.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L64) - -**`Experimental`** - -Which harness handled this delegation. - -*** - -### kind - -> **kind**: `"sibling"` \| `"fleet"` - -Defined in: [runtime/types.ts:314](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L314) - -**`Experimental`** - -#### Inherited from - -[`LoopSandboxPlacement`](../../runtime/interfaces/LoopSandboxPlacement.md).[`kind`](../../runtime/interfaces/LoopSandboxPlacement.md#kind) - -*** - -### sandboxId? - -> `optional` **sandboxId?**: `string` - -Defined in: [runtime/types.ts:315](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L315) - -**`Experimental`** - -#### Inherited from - -[`LoopSandboxPlacement`](../../runtime/interfaces/LoopSandboxPlacement.md).[`sandboxId`](../../runtime/interfaces/LoopSandboxPlacement.md#sandboxid) - -*** - -### fleetId? - -> `optional` **fleetId?**: `string` - -Defined in: [runtime/types.ts:316](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L316) - -**`Experimental`** - -#### Inherited from - -[`LoopSandboxPlacement`](../../runtime/interfaces/LoopSandboxPlacement.md).[`fleetId`](../../runtime/interfaces/LoopSandboxPlacement.md#fleetid) - -*** - -### machineId? - -> `optional` **machineId?**: `string` - -Defined in: [runtime/types.ts:317](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L317) - -**`Experimental`** - -#### Inherited from - -[`LoopSandboxPlacement`](../../runtime/interfaces/LoopSandboxPlacement.md).[`machineId`](../../runtime/interfaces/LoopSandboxPlacement.md#machineid) diff --git a/docs/api/mcp/interfaces/InProcessExecutorOptions.md b/docs/api/mcp/interfaces/InProcessExecutorOptions.md deleted file mode 100644 index 0d1ac61..0000000 --- a/docs/api/mcp/interfaces/InProcessExecutorOptions.md +++ /dev/null @@ -1,166 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / InProcessExecutorOptions - -# Interface: InProcessExecutorOptions - -Defined in: [mcp/in-process-executor.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L33) - -**`Experimental`** - -## Properties - -### repoRoot - -> **repoRoot**: `string` - -Defined in: [mcp/in-process-executor.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L35) - -**`Experimental`** - -Absolute path to the git repo (the workspace). Worktrees go under `/.agent-worktrees/`. - -*** - -### harnesses? - -> `optional` **harnesses?**: readonly [`LocalHarness`](../type-aliases/LocalHarness.md)[] - -Defined in: [mcp/in-process-executor.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L37) - -**`Experimental`** - -Harnesses to round-robin across `create()` calls. One entry = no fanout. Default `['claude']`. - -*** - -### testCmd? - -> `optional` **testCmd?**: `string` - -Defined in: [mcp/in-process-executor.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L39) - -**`Experimental`** - -Optional per-delegation test command run in the worktree after the harness exits. - -*** - -### typecheckCmd? - -> `optional` **typecheckCmd?**: `string` - -Defined in: [mcp/in-process-executor.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L41) - -**`Experimental`** - -Optional per-delegation typecheck command. Same shape as `testCmd`. - -*** - -### harnessTimeoutMs? - -> `optional` **harnessTimeoutMs?**: `number` - -Defined in: [mcp/in-process-executor.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L43) - -**`Experimental`** - -Wall-clock cap per harness subprocess (ms). Default 5min. - -*** - -### postCheckTimeoutMs? - -> `optional` **postCheckTimeoutMs?**: `number` - -Defined in: [mcp/in-process-executor.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L45) - -**`Experimental`** - -Wall-clock cap per test/typecheck subprocess (ms). Default 2min. - -*** - -### runGit? - -> `optional` **runGit?**: [`GitRunner`](../type-aliases/GitRunner.md) - -Defined in: [mcp/in-process-executor.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L47) - -**`Experimental`** - -Test seam — override the git runner used by the worktree helpers. - -*** - -### runHarness? - -> `optional` **runHarness?**: (`options`) => `Promise`\<[`LocalHarnessResult`](LocalHarnessResult.md)\> - -Defined in: [mcp/in-process-executor.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L49) - -**`Experimental`** - -Test seam — override the harness runner (defaults to the real CLI via `runLocalHarness`). - -**`Experimental`** - -Spawn a local coding harness CLI as a subprocess + collect its output. - -NOT responsible for parsing the harness's output or extracting a diff — -the in-process executor's `streamPrompt` orchestrates `git diff` against -the worktree after this resolves. This function is intentionally narrow: -spawn, wait, capture, return. - -Fails loud — throws when: - - `cwd` doesn't exist (subprocess emits ENOENT; surfaced as Error) - - the harness binary is not on PATH (ENOENT) - -Does NOT throw when: - - the subprocess exits non-zero (`result.exitCode` carries the code) - - the subprocess is aborted / timed out (`result.killedBySignal` / - `result.timedOut` carries the reason) - -#### Parameters - -##### options - -[`RunLocalHarnessOptions`](RunLocalHarnessOptions.md) - -#### Returns - -`Promise`\<[`LocalHarnessResult`](LocalHarnessResult.md)\> - -*** - -### runPostCheck? - -> `optional` **runPostCheck?**: (`cmd`, `cwd`, `signal?`) => `Promise`\<\{ `exitCode`: `number`; `stdout`: `string`; `stderr`: `string`; \}\> - -Defined in: [mcp/in-process-executor.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/in-process-executor.ts#L52) - -**`Experimental`** - -Test seam — override the post-check runner (defaults to a `sh -c` spawn). A throw is folded - into a non-fatal `{exitCode:-1}` so a broken check command fails the signal, not the run. - -#### Parameters - -##### cmd - -`string` - -##### cwd - -`string` - -##### signal? - -`AbortSignal` - -#### Returns - -`Promise`\<\{ `exitCode`: `number`; `stdout`: `string`; `stderr`: `string`; \}\> diff --git a/docs/api/mcp/interfaces/JsonRpcMessage.md b/docs/api/mcp/interfaces/JsonRpcMessage.md deleted file mode 100644 index 1c7113a..0000000 --- a/docs/api/mcp/interfaces/JsonRpcMessage.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / JsonRpcMessage - -# Interface: JsonRpcMessage - -Defined in: [mcp/server.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L143) - -**`Experimental`** - -## Properties - -### jsonrpc - -> **jsonrpc**: `"2.0"` - -Defined in: [mcp/server.ts:144](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L144) - -**`Experimental`** - -*** - -### id? - -> `optional` **id?**: `string` \| `number` \| `null` - -Defined in: [mcp/server.ts:145](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L145) - -**`Experimental`** - -*** - -### method - -> **method**: `string` - -Defined in: [mcp/server.ts:146](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L146) - -**`Experimental`** - -*** - -### params? - -> `optional` **params?**: `unknown` - -Defined in: [mcp/server.ts:147](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L147) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/JsonRpcResponse.md b/docs/api/mcp/interfaces/JsonRpcResponse.md deleted file mode 100644 index 759362c..0000000 --- a/docs/api/mcp/interfaces/JsonRpcResponse.md +++ /dev/null @@ -1,63 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / JsonRpcResponse - -# Interface: JsonRpcResponse - -Defined in: [mcp/server.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L151) - -**`Experimental`** - -## Properties - -### jsonrpc - -> **jsonrpc**: `"2.0"` - -Defined in: [mcp/server.ts:152](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L152) - -**`Experimental`** - -*** - -### id - -> **id**: `string` \| `number` \| `null` - -Defined in: [mcp/server.ts:153](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L153) - -**`Experimental`** - -*** - -### result? - -> `optional` **result?**: `unknown` - -Defined in: [mcp/server.ts:154](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L154) - -**`Experimental`** - -*** - -### error? - -> `optional` **error?**: `object` - -Defined in: [mcp/server.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L155) - -**`Experimental`** - -#### code - -> **code**: `number` - -#### message - -> **message**: `string` - -#### data? - -> `optional` **data?**: `unknown` diff --git a/docs/api/mcp/interfaces/KbGateResult.md b/docs/api/mcp/interfaces/KbGateResult.md deleted file mode 100644 index 816ca22..0000000 --- a/docs/api/mcp/interfaces/KbGateResult.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / KbGateResult - -# Interface: KbGateResult - -Defined in: [mcp/kb-gate.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L51) - -**`Experimental`** - -## Properties - -### accepted - -> **accepted**: `boolean` - -Defined in: [mcp/kb-gate.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L52) - -**`Experimental`** - -*** - -### vetoedBy? - -> `optional` **vetoedBy?**: `string` - -Defined in: [mcp/kb-gate.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L54) - -**`Experimental`** - -Name of the judge that vetoed; undefined when accepted. - -*** - -### reason? - -> `optional` **reason?**: `string` - -Defined in: [mcp/kb-gate.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/kb-gate.ts#L55) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/LocalHarnessResult.md b/docs/api/mcp/interfaces/LocalHarnessResult.md deleted file mode 100644 index fb5d068..0000000 --- a/docs/api/mcp/interfaces/LocalHarnessResult.md +++ /dev/null @@ -1,83 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / LocalHarnessResult - -# Interface: LocalHarnessResult - -Defined in: [mcp/local-harness.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L143) - -**`Experimental`** - -## Properties - -### exitCode - -> **exitCode**: `number` \| `null` - -Defined in: [mcp/local-harness.ts:145](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L145) - -**`Experimental`** - -OS exit code. `null` when killed before exit. - -*** - -### stdout - -> **stdout**: `string` - -Defined in: [mcp/local-harness.ts:147](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L147) - -**`Experimental`** - -Concatenated stdout. - -*** - -### stderr - -> **stderr**: `string` - -Defined in: [mcp/local-harness.ts:149](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L149) - -**`Experimental`** - -Concatenated stderr. - -*** - -### killedBySignal - -> **killedBySignal**: `Signals` \| `null` - -Defined in: [mcp/local-harness.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L151) - -**`Experimental`** - -Set when the process exited via signal (timeout / abort). - -*** - -### durationMs - -> **durationMs**: `number` - -Defined in: [mcp/local-harness.ts:153](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L153) - -**`Experimental`** - -Wall-clock duration ms (spawn → exit). - -*** - -### timedOut - -> **timedOut**: `boolean` - -Defined in: [mcp/local-harness.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L155) - -**`Experimental`** - -Set when timeoutMs elapsed before exit. diff --git a/docs/api/mcp/interfaces/McpServer.md b/docs/api/mcp/interfaces/McpServer.md deleted file mode 100644 index b06e6dd..0000000 --- a/docs/api/mcp/interfaces/McpServer.md +++ /dev/null @@ -1,107 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / McpServer - -# Interface: McpServer - -Defined in: [mcp/server.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L121) - -**`Experimental`** - -## Properties - -### tools - -> `readonly` **tools**: `ReadonlyMap`\<`string`, [`McpToolDescriptor`](McpToolDescriptor.md)\> - -Defined in: [mcp/server.ts:123](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L123) - -**`Experimental`** - -Tools currently registered (depend on which delegates were wired). - -*** - -### queue - -> `readonly` **queue**: [`DelegationTaskQueue`](../classes/DelegationTaskQueue.md) - -Defined in: [mcp/server.ts:125](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L125) - -**`Experimental`** - -The underlying queue — exposed so tests can introspect it. - -*** - -### feedbackStore - -> `readonly` **feedbackStore**: [`FeedbackStore`](FeedbackStore.md) - -Defined in: [mcp/server.ts:127](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L127) - -**`Experimental`** - -The feedback store — exposed for the same reason. - -## Methods - -### handle() - -> **handle**(`message`): `Promise`\<[`JsonRpcResponse`](JsonRpcResponse.md) \| `null`\> - -Defined in: [mcp/server.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L129) - -**`Experimental`** - -Handle a single parsed JSON-RPC message. Returns the response object (or `null` for notifications). - -#### Parameters - -##### message - -[`JsonRpcMessage`](JsonRpcMessage.md) - -#### Returns - -`Promise`\<[`JsonRpcResponse`](JsonRpcResponse.md) \| `null`\> - -*** - -### serve() - -> **serve**(`transport?`): `Promise`\<`void`\> - -Defined in: [mcp/server.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L131) - -**`Experimental`** - -Drive the server on a stdio-shaped transport until `stop()` is called. - -#### Parameters - -##### transport? - -[`McpTransport`](McpTransport.md) - -#### Returns - -`Promise`\<`void`\> - -*** - -### stop() - -> **stop**(): `void` - -Defined in: [mcp/server.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L133) - -**`Experimental`** - -Stop a `serve` call. Subsequent requests are rejected. - -#### Returns - -`void` diff --git a/docs/api/mcp/interfaces/McpServerOptions.md b/docs/api/mcp/interfaces/McpServerOptions.md deleted file mode 100644 index 256295a..0000000 --- a/docs/api/mcp/interfaces/McpServerOptions.md +++ /dev/null @@ -1,146 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / McpServerOptions - -# Interface: McpServerOptions - -Defined in: [mcp/server.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L64) - -**`Experimental`** - -## Properties - -### coderDelegate? - -> `optional` **coderDelegate?**: [`CoderDelegate`](../type-aliases/CoderDelegate.md) - -Defined in: [mcp/server.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L66) - -**`Experimental`** - -Required to enable delegate_code. - -*** - -### researcherDelegate? - -> `optional` **researcherDelegate?**: [`ResearcherDelegate`](../type-aliases/ResearcherDelegate.md) - -Defined in: [mcp/server.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L73) - -**`Experimental`** - -Required to enable delegate_research. The substrate cannot ship a -default — wire one that closes over your `runLoop` + a -researcher profile (typically `@tangle-network/agent-knowledge`'s -`researcherProfile` / `multiHarnessResearcherFanout`). - -*** - -### uiAuditorDelegate? - -> `optional` **uiAuditorDelegate?**: [`UiAuditorDelegate`](../type-aliases/UiAuditorDelegate.md) - -Defined in: [mcp/server.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L80) - -**`Experimental`** - -Required to enable delegate_ui_audit. Wire one that closes over your -`runLoop` + `uiAuditorProfile` + a `SandboxClient` (the -canonical in-process choice is `createInProcessUiAuditClient` from -`@tangle-network/agent-runtime/profiles`) + your vision judge. - -*** - -### feedbackStore? - -> `optional` **feedbackStore?**: [`FeedbackStore`](FeedbackStore.md) - -Defined in: [mcp/server.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L82) - -**`Experimental`** - -Override the default in-memory feedback store. - -*** - -### queue? - -> `optional` **queue?**: [`DelegationTaskQueue`](../classes/DelegationTaskQueue.md) - -Defined in: [mcp/server.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L84) - -**`Experimental`** - -Override the default in-memory task queue. - -*** - -### detachedDispatch? - -> `optional` **detachedDispatch?**: `boolean` - -Defined in: [mcp/server.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L93) - -**`Experimental`** - -Record deterministic detached-session resume keys on single-variant -coder/researcher submissions so a durable queue can resume them after a -restart. Enable only when the wired delegates dispatch via sandbox -sessions (`driveTurn`) AND `queue` persists records — the keys are inert -otherwise. The bin turns this on alongside the durable store for -session-backed (sibling/fleet) placements. - -*** - -### extraTools? - -> `optional` **extraTools?**: [`McpToolDescriptor`](McpToolDescriptor.md)[] - -Defined in: [mcp/server.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L99) - -**`Experimental`** - -Extra tools to serve alongside the delegation tools, for example -`createCoordinationTools(...).tools`. Registered after the built-ins; a -duplicate name throws so delegation tools cannot be shadowed silently. - -*** - -### traceContext? - -> `optional` **traceContext?**: [`TraceContext`](TraceContext.md) - -Defined in: [mcp/server.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L105) - -**`Experimental`** - -Inherited trace identity (`readTraceContextFromEnv()`) stamped on every -record the DEFAULT queue creates. Ignored when `queue` is supplied — -pass `traceContext` to that queue's constructor instead. - -*** - -### serverName? - -> `optional` **serverName?**: `string` - -Defined in: [mcp/server.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L107) - -**`Experimental`** - -Server display name surfaced via `initialize`. Default `'agent-runtime-mcp'`. - -*** - -### serverVersion? - -> `optional` **serverVersion?**: `string` - -Defined in: [mcp/server.ts:109](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L109) - -**`Experimental`** - -Server version surfaced via `initialize`. Default = the package version baked at build time. diff --git a/docs/api/mcp/interfaces/McpToolDescriptor.md b/docs/api/mcp/interfaces/McpToolDescriptor.md deleted file mode 100644 index daa3a11..0000000 --- a/docs/api/mcp/interfaces/McpToolDescriptor.md +++ /dev/null @@ -1,61 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / McpToolDescriptor - -# Interface: McpToolDescriptor - -Defined in: [mcp/server.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L113) - -**`Experimental`** - -## Properties - -### name - -> **name**: `string` - -Defined in: [mcp/server.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L114) - -**`Experimental`** - -*** - -### description - -> **description**: `string` - -Defined in: [mcp/server.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L115) - -**`Experimental`** - -*** - -### inputSchema - -> **inputSchema**: `Record`\<`string`, `unknown`\> - -Defined in: [mcp/server.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L116) - -**`Experimental`** - -*** - -### handler - -> **handler**: (`raw`) => `Promise`\<`unknown`\> - -Defined in: [mcp/server.ts:117](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L117) - -**`Experimental`** - -#### Parameters - -##### raw - -`unknown` - -#### Returns - -`Promise`\<`unknown`\> diff --git a/docs/api/mcp/interfaces/McpTransport.md b/docs/api/mcp/interfaces/McpTransport.md deleted file mode 100644 index 2d72760..0000000 --- a/docs/api/mcp/interfaces/McpTransport.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / McpTransport - -# Interface: McpTransport - -Defined in: [mcp/server.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L137) - -**`Experimental`** - -## Properties - -### input - -> **input**: `ReadableStream` - -Defined in: [mcp/server.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L138) - -**`Experimental`** - -*** - -### output - -> **output**: `WritableStream` - -Defined in: [mcp/server.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/server.ts#L139) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/Question.md b/docs/api/mcp/interfaces/Question.md deleted file mode 100644 index 4bfe228..0000000 --- a/docs/api/mcp/interfaces/Question.md +++ /dev/null @@ -1,69 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / Question - -# Interface: Question - -Defined in: [mcp/tools/coordination.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L38) - -## Extended by - -- [`QuestionRecord`](QuestionRecord.md) - -## Properties - -### id - -> `readonly` **id**: `string` - -Defined in: [mcp/tools/coordination.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L39) - -*** - -### from - -> `readonly` **from**: `string` - -Defined in: [mcp/tools/coordination.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L40) - -*** - -### level - -> `readonly` **level**: `QuestionLevel` - -Defined in: [mcp/tools/coordination.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L41) - -*** - -### question - -> `readonly` **question**: `string` - -Defined in: [mcp/tools/coordination.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L42) - -*** - -### reason - -> `readonly` **reason**: `string` - -Defined in: [mcp/tools/coordination.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L43) - -*** - -### urgency - -> `readonly` **urgency**: `QuestionUrgency` - -Defined in: [mcp/tools/coordination.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L44) - -*** - -### options? - -> `readonly` `optional` **options?**: readonly `QuestionOption`[] - -Defined in: [mcp/tools/coordination.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L45) diff --git a/docs/api/mcp/interfaces/QuestionRecord.md b/docs/api/mcp/interfaces/QuestionRecord.md deleted file mode 100644 index fe42fb5..0000000 --- a/docs/api/mcp/interfaces/QuestionRecord.md +++ /dev/null @@ -1,121 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / QuestionRecord - -# Interface: QuestionRecord - -Defined in: [mcp/tools/coordination.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L53) - -## Extends - -- [`Question`](Question.md) - -## Properties - -### id - -> `readonly` **id**: `string` - -Defined in: [mcp/tools/coordination.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L39) - -#### Inherited from - -[`Question`](Question.md).[`id`](Question.md#id) - -*** - -### from - -> `readonly` **from**: `string` - -Defined in: [mcp/tools/coordination.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L40) - -#### Inherited from - -[`Question`](Question.md).[`from`](Question.md#from) - -*** - -### level - -> `readonly` **level**: `QuestionLevel` - -Defined in: [mcp/tools/coordination.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L41) - -#### Inherited from - -[`Question`](Question.md).[`level`](Question.md#level) - -*** - -### question - -> `readonly` **question**: `string` - -Defined in: [mcp/tools/coordination.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L42) - -#### Inherited from - -[`Question`](Question.md).[`question`](Question.md#question) - -*** - -### reason - -> `readonly` **reason**: `string` - -Defined in: [mcp/tools/coordination.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L43) - -#### Inherited from - -[`Question`](Question.md).[`reason`](Question.md#reason) - -*** - -### urgency - -> `readonly` **urgency**: `QuestionUrgency` - -Defined in: [mcp/tools/coordination.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L44) - -#### Inherited from - -[`Question`](Question.md).[`urgency`](Question.md#urgency) - -*** - -### options? - -> `readonly` `optional` **options?**: readonly `QuestionOption`[] - -Defined in: [mcp/tools/coordination.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L45) - -#### Inherited from - -[`Question`](Question.md).[`options`](Question.md#options) - -*** - -### status - -> `readonly` **status**: `"open"` \| `"answered"` \| `"deferred"` \| `"escalated"` - -Defined in: [mcp/tools/coordination.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L54) - -*** - -### decision? - -> `readonly` `optional` **decision?**: [`QuestionDecision`](../type-aliases/QuestionDecision.md) - -Defined in: [mcp/tools/coordination.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L55) - -*** - -### openedAt - -> `readonly` **openedAt**: `number` - -Defined in: [mcp/tools/coordination.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L56) diff --git a/docs/api/mcp/interfaces/RemoveWorktreeOptions.md b/docs/api/mcp/interfaces/RemoveWorktreeOptions.md deleted file mode 100644 index d93f6d2..0000000 --- a/docs/api/mcp/interfaces/RemoveWorktreeOptions.md +++ /dev/null @@ -1,55 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / RemoveWorktreeOptions - -# Interface: RemoveWorktreeOptions - -Defined in: [mcp/worktree.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L65) - -**`Experimental`** - -## Properties - -### worktree - -> **worktree**: [`WorktreeHandle`](WorktreeHandle.md) - -Defined in: [mcp/worktree.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L66) - -**`Experimental`** - -*** - -### repoRoot - -> **repoRoot**: `string` - -Defined in: [mcp/worktree.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L67) - -**`Experimental`** - -*** - -### force? - -> `optional` **force?**: `boolean` - -Defined in: [mcp/worktree.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L69) - -**`Experimental`** - -Force removal even if dirty (default true; the loser of a fanout has uncommitted changes). - -*** - -### runGit? - -> `optional` **runGit?**: [`GitRunner`](../type-aliases/GitRunner.md) - -Defined in: [mcp/worktree.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L71) - -**`Experimental`** - -Test seam. diff --git a/docs/api/mcp/interfaces/ResearchOutputShape.md b/docs/api/mcp/interfaces/ResearchOutputShape.md deleted file mode 100644 index 04bf098..0000000 --- a/docs/api/mcp/interfaces/ResearchOutputShape.md +++ /dev/null @@ -1,70 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / ResearchOutputShape - -# Interface: ResearchOutputShape - -Defined in: [mcp/types.ts:234](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L234) - -**`Experimental`** - -Loose shape of a research output over the wire — the substrate cannot -import the `ResearchOutput` type from agent-knowledge without inducing -a dependency cycle, so the MCP layer treats it structurally. - -## Indexable - -> \[`key`: `string`\]: `unknown` -**`Experimental`** - -## Properties - -### items - -> **items**: `unknown`[] - -Defined in: [mcp/types.ts:235](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L235) - -**`Experimental`** - -*** - -### citations - -> **citations**: `unknown`[] - -Defined in: [mcp/types.ts:236](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L236) - -**`Experimental`** - -*** - -### proposedWrites - -> **proposedWrites**: `unknown`[] - -Defined in: [mcp/types.ts:237](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L237) - -**`Experimental`** - -*** - -### gaps? - -> `optional` **gaps?**: `string`[] - -Defined in: [mcp/types.ts:238](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L238) - -**`Experimental`** - -*** - -### notes? - -> `optional` **notes?**: `string` - -Defined in: [mcp/types.ts:239](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L239) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/RunDetachedTurnOptions.md b/docs/api/mcp/interfaces/RunDetachedTurnOptions.md deleted file mode 100644 index a3d8c4c..0000000 --- a/docs/api/mcp/interfaces/RunDetachedTurnOptions.md +++ /dev/null @@ -1,167 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / RunDetachedTurnOptions - -# Interface: RunDetachedTurnOptions - -Defined in: [mcp/detached-turn.ts:166](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L166) - -**`Experimental`** - -## Properties - -### client - -> **client**: [`SandboxClient`](../../runtime/interfaces/SandboxClient.md) - -Defined in: [mcp/detached-turn.ts:168](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L168) - -**`Experimental`** - -Sandbox client used to acquire the box (the delegate's executor client). - -*** - -### spec - -> **spec**: [`AgentRunSpec`](../../runtime/interfaces/AgentRunSpec.md)\<`unknown`\> - -Defined in: [mcp/detached-turn.ts:170](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L170) - -**`Experimental`** - -Profile + overrides for box acquisition — same spec the streaming path uses. - -*** - -### prompt - -> **prompt**: `string` - -Defined in: [mcp/detached-turn.ts:172](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L172) - -**`Experimental`** - -The full turn prompt; consumed by `driveTurn`'s dispatch leg. - -*** - -### sessionId - -> **sessionId**: `string` - -Defined in: [mcp/detached-turn.ts:174](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L174) - -**`Experimental`** - -Deterministic resume key, minted at submit time (`parseDetachedSessionRef(ref).sessionId`). - -*** - -### signal - -> **signal**: `AbortSignal` - -Defined in: [mcp/detached-turn.ts:181](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L181) - -**`Experimental`** - -*** - -### tickIntervalMs? - -> `optional` **tickIntervalMs?**: `number` - -Defined in: [mcp/detached-turn.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L184) - -**`Experimental`** - -Delay between `running` ticks (ms). Default 5000. - -*** - -### wallCapMs? - -> `optional` **wallCapMs?**: `number` - -Defined in: [mcp/detached-turn.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L186) - -**`Experimental`** - -Wall-clock cap forwarded to `driveTurn` — the SDK cancels and fails a session past it. - -*** - -### traceEmitter? - -> `optional` **traceEmitter?**: [`LoopTraceEmitter`](../../runtime/interfaces/LoopTraceEmitter.md) - -Defined in: [mcp/detached-turn.ts:196](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L196) - -**`Experimental`** - -Loop-trace sink. When set, the detached turn synthesizes a -single-iteration loop span tree (`runId` = `sessionId`, driver -`'detached-turn'`) so trace-context inheritance survives the detached -path — the same events the streaming `runLoop` path would emit, minus -per-token telemetry: `driveTurn` yields one terminal payload, so token -and cost figures are structurally unavailable and reported as 0 under -this driver tag. - -*** - -### placement? - -> `optional` **placement?**: `"sibling"` \| `"fleet"` - -Defined in: [mcp/detached-turn.ts:198](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L198) - -**`Experimental`** - -Physical placement stamped on the synthesized dispatch event. Default `'sibling'`. - -## Methods - -### bindSandbox() - -> **bindSandbox**(`sandboxId`): `void` - -Defined in: [mcp/detached-turn.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L180) - -**`Experimental`** - -Called once the box exists, with its sandbox id. Callers persist -`formatDetachedSessionRef({ sandboxId, sessionId })` onto the record here so -a restart can resolve the box again. - -#### Parameters - -##### sandboxId - -`string` - -#### Returns - -`void` - -*** - -### report() - -> **report**(`progress`): `void` - -Defined in: [mcp/detached-turn.ts:182](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L182) - -**`Experimental`** - -#### Parameters - -##### progress - -[`DelegationProgress`](DelegationProgress.md) - -#### Returns - -`void` diff --git a/docs/api/mcp/interfaces/RunLocalHarnessOptions.md b/docs/api/mcp/interfaces/RunLocalHarnessOptions.md deleted file mode 100644 index 8e7f846..0000000 --- a/docs/api/mcp/interfaces/RunLocalHarnessOptions.md +++ /dev/null @@ -1,146 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / RunLocalHarnessOptions - -# Interface: RunLocalHarnessOptions - -Defined in: [mcp/local-harness.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L107) - -**`Experimental`** - -## Properties - -### harness - -> **harness**: [`LocalHarness`](../type-aliases/LocalHarness.md) - -Defined in: [mcp/local-harness.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L108) - -**`Experimental`** - -*** - -### cwd - -> **cwd**: `string` - -Defined in: [mcp/local-harness.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L110) - -**`Experimental`** - -Working directory for the subprocess (typically a worktree path). - -*** - -### taskPrompt - -> **taskPrompt**: `string` - -Defined in: [mcp/local-harness.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L112) - -**`Experimental`** - -Prompt forwarded as the harness CLI's task argument. - -*** - -### invocation? - -> `optional` **invocation?**: `object` - -Defined in: [mcp/local-harness.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L120) - -**`Experimental`** - -Pre-built command + args (e.g. from `harnessInvocation` so the full authored -`AgentProfile` — systemPrompt + model — reaches the harness). When set it OVERRIDES the -default prompt-only `buildArgs(taskPrompt)` path; `command` defaults to the harness's -default binary when only `args` is supplied. When absent the legacy prompt-only shape -is used unchanged. - -#### command? - -> `optional` **command?**: `string` - -#### args - -> **args**: readonly `string`[] - -*** - -### timeoutMs? - -> `optional` **timeoutMs?**: `number` - -Defined in: [mcp/local-harness.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L122) - -**`Experimental`** - -Wall-clock kill deadline (ms). Default 5 min. Subprocess SIGTERMed on expiry. - -*** - -### signal? - -> `optional` **signal?**: `AbortSignal` - -Defined in: [mcp/local-harness.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L124) - -**`Experimental`** - -Caller cancellation. SIGTERM is sent on abort. - -*** - -### env? - -> `optional` **env?**: `ProcessEnv` - -Defined in: [mcp/local-harness.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L126) - -**`Experimental`** - -Override env (defaults to inheriting from the parent). - -*** - -### spawn? - -> `optional` **spawn?**: (`command`, `args`, `opts`) => `ChildProcess` - -Defined in: [mcp/local-harness.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L131) - -**`Experimental`** - -Test seam — inject a custom spawner so unit tests can mock the -subprocess without touching the OS. Defaults to node's `child_process.spawn`. - -#### Parameters - -##### command - -`string` - -##### args - -readonly `string`[] - -##### opts - -###### cwd - -`string` - -###### env - -`ProcessEnv` - -###### stdio - -`"pipe"` - -#### Returns - -`ChildProcess` diff --git a/docs/api/mcp/interfaces/SettleDetachedCoderTurnOptions.md b/docs/api/mcp/interfaces/SettleDetachedCoderTurnOptions.md deleted file mode 100644 index e8513eb..0000000 --- a/docs/api/mcp/interfaces/SettleDetachedCoderTurnOptions.md +++ /dev/null @@ -1,75 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / SettleDetachedCoderTurnOptions - -# Interface: SettleDetachedCoderTurnOptions - -Defined in: [mcp/delegates.ts:442](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L442) - -**`Experimental`** - -## Properties - -### task - -> **task**: [`CoderTask`](../../profiles/interfaces/CoderTask.md) - -Defined in: [mcp/delegates.ts:443](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L443) - -**`Experimental`** - -*** - -### sessionId - -> **sessionId**: `string` - -Defined in: [mcp/delegates.ts:445](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L445) - -**`Experimental`** - -Session id of the detached turn — used as the synthesized event id. - -*** - -### signal - -> **signal**: `AbortSignal` - -Defined in: [mcp/delegates.ts:446](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L446) - -**`Experimental`** - -*** - -### harness? - -> `optional` **harness?**: `string` - -Defined in: [mcp/delegates.ts:447](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L447) - -**`Experimental`** - -*** - -### model? - -> `optional` **model?**: `string` - -Defined in: [mcp/delegates.ts:448](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L448) - -**`Experimental`** - -*** - -### reviewer? - -> `optional` **reviewer?**: [`CoderReviewer`](../type-aliases/CoderReviewer.md) - -Defined in: [mcp/delegates.ts:450](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L450) - -**`Experimental`** - -Same gate as the streaming path: an unapproved candidate cannot win. diff --git a/docs/api/mcp/interfaces/SettledWorker.md b/docs/api/mcp/interfaces/SettledWorker.md deleted file mode 100644 index c0f3654..0000000 --- a/docs/api/mcp/interfaces/SettledWorker.md +++ /dev/null @@ -1,59 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / SettledWorker - -# Interface: SettledWorker - -Defined in: [mcp/tools/coordination.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L21) - -A worker the driver has drained via `await_event`. - -## Properties - -### id - -> `readonly` **id**: `string` - -Defined in: [mcp/tools/coordination.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L22) - -*** - -### status - -> `readonly` **status**: `"done"` \| `"down"` - -Defined in: [mcp/tools/coordination.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L23) - -*** - -### score? - -> `readonly` `optional` **score?**: `number` - -Defined in: [mcp/tools/coordination.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L24) - -*** - -### valid? - -> `readonly` `optional` **valid?**: `boolean` - -Defined in: [mcp/tools/coordination.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L25) - -*** - -### outRef? - -> `readonly` `optional` **outRef?**: `string` - -Defined in: [mcp/tools/coordination.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L26) - -*** - -### reason? - -> `readonly` `optional` **reason?**: `string` - -Defined in: [mcp/tools/coordination.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L27) diff --git a/docs/api/mcp/interfaces/SiblingSandboxExecutorOptions.md b/docs/api/mcp/interfaces/SiblingSandboxExecutorOptions.md deleted file mode 100644 index b971c2e..0000000 --- a/docs/api/mcp/interfaces/SiblingSandboxExecutorOptions.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / SiblingSandboxExecutorOptions - -# Interface: SiblingSandboxExecutorOptions - -Defined in: [mcp/executor.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L41) - -**`Experimental`** - -## Properties - -### client - -> **client**: [`SandboxClient`](../../runtime/interfaces/SandboxClient.md) - -Defined in: [mcp/executor.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/executor.ts#L42) - -**`Experimental`** diff --git a/docs/api/mcp/interfaces/SubmitInput.md b/docs/api/mcp/interfaces/SubmitInput.md deleted file mode 100644 index 0e0d1f3..0000000 --- a/docs/api/mcp/interfaces/SubmitInput.md +++ /dev/null @@ -1,97 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / SubmitInput - -# Interface: SubmitInput\ - -Defined in: [mcp/task-queue.ts:109](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L109) - -**`Experimental`** - -## Type Parameters - -### Args - -`Args` *extends* `AnyDelegateArgs` - -## Properties - -### profile - -> **profile**: [`DelegationProfile`](../type-aliases/DelegationProfile.md) - -Defined in: [mcp/task-queue.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L110) - -**`Experimental`** - -*** - -### args - -> **args**: `Args` - -Defined in: [mcp/task-queue.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L111) - -**`Experimental`** - -*** - -### namespace? - -> `optional` **namespace?**: `string` - -Defined in: [mcp/task-queue.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L112) - -**`Experimental`** - -*** - -### idempotencyKey? - -> `optional` **idempotencyKey?**: `string` - -Defined in: [mcp/task-queue.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L113) - -**`Experimental`** - -*** - -### detachedSessionRef? - -> `optional` **detachedSessionRef?**: `string` - -Defined in: [mcp/task-queue.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L120) - -**`Experimental`** - -Records the detached-run resume key on the new record. The submitted -`run` function still executes in-process exactly as without it — the -ref only matters after a restart, when `DelegationTaskQueue.restore` -hands it to the `resumeDelegate` seam instead of failing the record. - -*** - -### run - -> **run**: (`ctx`) => `Promise`\<`CoderOutput` \| [`ResearchOutputShape`](ResearchOutputShape.md) \| [`UiAuditorDelegationOutput`](UiAuditorDelegationOutput.md)\> - -Defined in: [mcp/task-queue.ts:127](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L127) - -**`Experimental`** - -Runs the underlying delegation. The queue passes a fresh `AbortSignal` -and a `report` channel for incremental progress updates. The function -MUST resolve with the typed `DelegationResultPayload['output']`; the -queue wraps it with the profile tag. - -#### Parameters - -##### ctx - -[`DelegationRunContext`](DelegationRunContext.md) - -#### Returns - -`Promise`\<`CoderOutput` \| [`ResearchOutputShape`](ResearchOutputShape.md) \| [`UiAuditorDelegationOutput`](UiAuditorDelegationOutput.md)\> diff --git a/docs/api/mcp/interfaces/SubmitOutput.md b/docs/api/mcp/interfaces/SubmitOutput.md deleted file mode 100644 index 88556fd..0000000 --- a/docs/api/mcp/interfaces/SubmitOutput.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / SubmitOutput - -# Interface: SubmitOutput - -Defined in: [mcp/task-queue.ts:157](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L157) - -**`Experimental`** - -## Properties - -### taskId - -> **taskId**: `string` - -Defined in: [mcp/task-queue.ts:158](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L158) - -**`Experimental`** - -*** - -### reused - -> **reused**: `boolean` - -Defined in: [mcp/task-queue.ts:160](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L160) - -**`Experimental`** - -True when a prior matching `idempotencyKey` returned an existing record. diff --git a/docs/api/mcp/interfaces/TraceContext.md b/docs/api/mcp/interfaces/TraceContext.md deleted file mode 100644 index bdd66cd..0000000 --- a/docs/api/mcp/interfaces/TraceContext.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / TraceContext - -# Interface: TraceContext - -Defined in: [mcp/trace-propagation.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/trace-propagation.ts#L24) - -## Properties - -### traceId - -> **traceId**: `string` - -Defined in: [mcp/trace-propagation.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/trace-propagation.ts#L26) - -Trace id inherited from the parent process, or a fresh one. - -*** - -### parentSpanId? - -> `optional` **parentSpanId?**: `string` - -Defined in: [mcp/trace-propagation.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/trace-propagation.ts#L28) - -Parent span id from the delegation that launched this MCP server. diff --git a/docs/api/mcp/interfaces/UiAuditorDelegationOutput.md b/docs/api/mcp/interfaces/UiAuditorDelegationOutput.md deleted file mode 100644 index bac3574..0000000 --- a/docs/api/mcp/interfaces/UiAuditorDelegationOutput.md +++ /dev/null @@ -1,59 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / UiAuditorDelegationOutput - -# Interface: UiAuditorDelegationOutput - -Defined in: [mcp/types.ts:170](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L170) - -**`Experimental`** - -Wire-shape of a completed UI-audit delegation. The `findings` array -contains every finding persisted to the workspace during the run, -already enriched with `id` and `createdAt` by the writer. `workspaceDir` -is the absolute path to the workspace; `indexFile` is the workspace- -relative path to the regenerated index.md. - -## Properties - -### workspaceDir - -> **workspaceDir**: `string` - -Defined in: [mcp/types.ts:171](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L171) - -**`Experimental`** - -*** - -### indexFile - -> **indexFile**: `string` - -Defined in: [mcp/types.ts:172](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L172) - -**`Experimental`** - -*** - -### findings - -> **findings**: [`UiFinding`](../../profiles/interfaces/UiFinding.md)[] - -Defined in: [mcp/types.ts:173](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L173) - -**`Experimental`** - -*** - -### iterations - -> **iterations**: `number` - -Defined in: [mcp/types.ts:175](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L175) - -**`Experimental`** - -Total iterations the loop ran for this delegation. diff --git a/docs/api/mcp/interfaces/WorktreeHandle.md b/docs/api/mcp/interfaces/WorktreeHandle.md deleted file mode 100644 index f9c2c56..0000000 --- a/docs/api/mcp/interfaces/WorktreeHandle.md +++ /dev/null @@ -1,47 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / WorktreeHandle - -# Interface: WorktreeHandle - -Defined in: [mcp/worktree.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L21) - -**`Experimental`** - -## Properties - -### path - -> **path**: `string` - -Defined in: [mcp/worktree.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L23) - -**`Experimental`** - -Absolute path to the worktree directory. - -*** - -### baseSha - -> **baseSha**: `string` - -Defined in: [mcp/worktree.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L25) - -**`Experimental`** - -SHA the worktree was created at. - -*** - -### branch - -> **branch**: `string` - -Defined in: [mcp/worktree.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L27) - -**`Experimental`** - -Branch name created for this worktree (typically `delegate/`). diff --git a/docs/api/mcp/type-aliases/CoderDelegate.md b/docs/api/mcp/type-aliases/CoderDelegate.md deleted file mode 100644 index fbd200c..0000000 --- a/docs/api/mcp/type-aliases/CoderDelegate.md +++ /dev/null @@ -1,30 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / CoderDelegate - -# Type Alias: CoderDelegate - -> **CoderDelegate** = (`args`, `ctx`) => `Promise`\<`CoderOutput`\> - -Defined in: [mcp/delegates.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L88) - -**`Experimental`** - -The server's coder-profile delegate slot — the closure the queue invokes for a - `delegate_code` task. `detachedSessionDelegate` is the built-in implementation. - -## Parameters - -### args - -[`DelegateCodeArgs`](../interfaces/DelegateCodeArgs.md) - -### ctx - -[`DelegateRunCtx`](../interfaces/DelegateRunCtx.md) - -## Returns - -`Promise`\<`CoderOutput`\> diff --git a/docs/api/mcp/type-aliases/CoderReviewer.md b/docs/api/mcp/type-aliases/CoderReviewer.md deleted file mode 100644 index 0cb69d4..0000000 --- a/docs/api/mcp/type-aliases/CoderReviewer.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / CoderReviewer - -# Type Alias: CoderReviewer - -> **CoderReviewer** = (`output`, `task`, `ctx`) => `Promise`\<[`CoderReview`](../interfaces/CoderReview.md)\> \| [`CoderReview`](../interfaces/CoderReview.md) - -Defined in: [mcp/delegates.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L130) - -**`Experimental`** - -Optional adversarial reviewer over a coder candidate that already passed -mechanical validation (tests/typecheck/forbidden/diff/no-op/secrets). Folded -from the ai-trading-blueprint delegation MCP: a candidate is only eligible to -win if the reviewer approves it. The reviewer is the consumer's seam — an LLM -judge, a `pnpm review` command, anything returning a `CoderReview`. - -## Parameters - -### output - -`CoderOutput` - -### task - -[`CoderTask`](../../profiles/interfaces/CoderTask.md) - -### ctx - -#### signal - -`AbortSignal` - -## Returns - -`Promise`\<[`CoderReview`](../interfaces/CoderReview.md)\> \| [`CoderReview`](../interfaces/CoderReview.md) diff --git a/docs/api/mcp/type-aliases/CoordinationEvent.md b/docs/api/mcp/type-aliases/CoordinationEvent.md deleted file mode 100644 index a1723c2..0000000 --- a/docs/api/mcp/type-aliases/CoordinationEvent.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / CoordinationEvent - -# Type Alias: CoordinationEvent - -> **CoordinationEvent** = \{ `type`: `"question"`; `question`: [`QuestionRecord`](../interfaces/QuestionRecord.md); \} \| \{ `type`: `"settled"`; `worker`: [`SettledWorker`](../interfaces/SettledWorker.md); \} \| \{ `type`: `"finding"`; `finding`: `AnalystFindingEvent`; \} \| \{ `type`: `"steer"`; `down`: `DownMessageEvent`; \} \| \{ `type`: `"answer"`; `down`: `DownMessageEvent`; `questionId`: `string`; \} - -Defined in: [mcp/tools/coordination.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L85) - -Every message on the one typed pipe. UP (child→parent): question / settled / finding — queued for - the driver to `pull`. DOWN (parent→child): steer / answer — record-only (history + subscribers), - routed to the child inbox. New kinds are additive. diff --git a/docs/api/mcp/type-aliases/DelegationProfile.md b/docs/api/mcp/type-aliases/DelegationProfile.md deleted file mode 100644 index ee05400..0000000 --- a/docs/api/mcp/type-aliases/DelegationProfile.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationProfile - -# Type Alias: DelegationProfile - -> **DelegationProfile** = `"coder"` \| `"researcher"` \| `"ui-auditor"` - -Defined in: [mcp/types.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L21) - -**`Experimental`** diff --git a/docs/api/mcp/type-aliases/DelegationResultPayload.md b/docs/api/mcp/type-aliases/DelegationResultPayload.md deleted file mode 100644 index 4e3fd5a..0000000 --- a/docs/api/mcp/type-aliases/DelegationResultPayload.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationResultPayload - -# Type Alias: DelegationResultPayload - -> **DelegationResultPayload** = \{ `profile`: `"coder"`; `output`: `CoderOutput`; \} \| \{ `profile`: `"researcher"`; `output`: [`ResearchOutputShape`](../interfaces/ResearchOutputShape.md); \} \| \{ `profile`: `"ui-auditor"`; `output`: [`UiAuditorDelegationOutput`](../interfaces/UiAuditorDelegationOutput.md); \} - -Defined in: [mcp/types.ts:156](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L156) - -**`Experimental`** - -Polymorphic `result` field: `CoderOutput` when the underlying profile -is `'coder'`, a structurally-typed research output when `'researcher'`. -The MCP wire carries it as JSON either way. diff --git a/docs/api/mcp/type-aliases/DelegationResumeTick.md b/docs/api/mcp/type-aliases/DelegationResumeTick.md deleted file mode 100644 index 169cb8d..0000000 --- a/docs/api/mcp/type-aliases/DelegationResumeTick.md +++ /dev/null @@ -1,18 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationResumeTick - -# Type Alias: DelegationResumeTick - -> **DelegationResumeTick** = \{ `state`: `"running"`; \} \| \{ `state`: `"completed"`; `output`: [`DelegationResultPayload`](DelegationResultPayload.md)\[`"output"`\]; `costUsd?`: `number`; \} \| \{ `state`: `"failed"`; `error`: [`DelegationError`](../interfaces/DelegationError.md); \} - -Defined in: [mcp/task-queue.ts:171](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/task-queue.ts#L171) - -**`Experimental`** - -One observation of a detached run, mapped 1:1 from a single-tick driver -(e.g. the sandbox SDK's `driveTurn`, which reports -completed | running | failed per pass). `running` schedules another tick -after `intervalMs`; `completed` / `failed` settle the record. diff --git a/docs/api/mcp/type-aliases/DelegationStatus.md b/docs/api/mcp/type-aliases/DelegationStatus.md deleted file mode 100644 index deba4aa..0000000 --- a/docs/api/mcp/type-aliases/DelegationStatus.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DelegationStatus - -# Type Alias: DelegationStatus - -> **DelegationStatus** = `"pending"` \| `"running"` \| `"completed"` \| `"failed"` \| `"cancelled"` - -Defined in: [mcp/types.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L24) - -**`Experimental`** diff --git a/docs/api/mcp/type-aliases/DetachedWinnerSelection.md b/docs/api/mcp/type-aliases/DetachedWinnerSelection.md deleted file mode 100644 index fdb33c8..0000000 --- a/docs/api/mcp/type-aliases/DetachedWinnerSelection.md +++ /dev/null @@ -1,19 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DetachedWinnerSelection - -# Type Alias: DetachedWinnerSelection - -> **DetachedWinnerSelection** = `"highest-score"` \| `"smallest-diff"` \| `"highest-readiness"` \| `"first-approved"` - -Defined in: [mcp/delegates.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L143) - -**`Experimental`** - -Winner-selection strategy among validated (+ reviewed) candidates on the -sandbox-session path. The base strategies (`highest-score` / `smallest-diff` / -`first-approved`) delegate to the shared `selectValidWinner`; `highest-readiness` is the -reviewer-only strategy this path keeps that the generic selector does not express. Default -`highest-score`. diff --git a/docs/api/mcp/type-aliases/DriveTurnTick.md b/docs/api/mcp/type-aliases/DriveTurnTick.md deleted file mode 100644 index b606e67..0000000 --- a/docs/api/mcp/type-aliases/DriveTurnTick.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DriveTurnTick - -# Type Alias: DriveTurnTick - -> **DriveTurnTick** = \{ `state`: `"completed"`; `text`: `string`; `result`: `Record`\<`string`, `unknown`\>; \} \| \{ `state`: `"running"`; `startedAt?`: `Date`; `elapsedMs?`: `number`; \} \| \{ `state`: `"failed"`; `error`: `string`; \} - -Defined in: [mcp/detached-turn.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/detached-turn.ts#L53) - -**`Experimental`** - -Structural mirror of the sandbox SDK's `TurnDriveResult` (>= 0.6). -Discriminated on `state`; `failed` is terminal and deterministic per the -SDK contract — re-invoking with the same ids returns the same outcome. diff --git a/docs/api/mcp/type-aliases/GitRunner.md b/docs/api/mcp/type-aliases/GitRunner.md deleted file mode 100644 index 8385bbb..0000000 --- a/docs/api/mcp/type-aliases/GitRunner.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / GitRunner - -# Type Alias: GitRunner - -> **GitRunner** = (`args`, `opts`) => `object` - -Defined in: [mcp/worktree.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree.ts#L75) - -Pluggable git runner (sync) — replaceable in tests. - -## Parameters - -### args - -`ReadonlyArray`\<`string`\> - -### opts - -#### cwd - -`string` - -## Returns - -`object` - -### stdout - -> **stdout**: `string` - -### stderr - -> **stderr**: `string` - -### exitCode - -> **exitCode**: `number` diff --git a/docs/api/mcp/type-aliases/LocalHarness.md b/docs/api/mcp/type-aliases/LocalHarness.md deleted file mode 100644 index 99d6384..0000000 --- a/docs/api/mcp/type-aliases/LocalHarness.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / LocalHarness - -# Type Alias: LocalHarness - -> **LocalHarness** = `"claude"` \| `"codex"` \| `"opencode"` - -Defined in: [mcp/local-harness.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/local-harness.ts#L23) - -Local coding harness available inside the sandbox. diff --git a/docs/api/mcp/type-aliases/MakeWorkerAgent.md b/docs/api/mcp/type-aliases/MakeWorkerAgent.md deleted file mode 100644 index e73178d..0000000 --- a/docs/api/mcp/type-aliases/MakeWorkerAgent.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / MakeWorkerAgent - -# Type Alias: MakeWorkerAgent - -> **MakeWorkerAgent** = (`profile`) => [`Agent`](../../runtime/interfaces/Agent.md)\<`unknown`, `unknown`\> - -Defined in: [mcp/tools/coordination.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L92) - -## Parameters - -### profile - -`unknown` - -## Returns - -[`Agent`](../../runtime/interfaces/Agent.md)\<`unknown`, `unknown`\> diff --git a/docs/api/mcp/type-aliases/QuestionDecision.md b/docs/api/mcp/type-aliases/QuestionDecision.md deleted file mode 100644 index 79b6328..0000000 --- a/docs/api/mcp/type-aliases/QuestionDecision.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / QuestionDecision - -# Type Alias: QuestionDecision - -> **QuestionDecision** = \{ `kind`: `"answer"`; `answer`: `string`; `by`: `string`; \} \| \{ `kind`: `"defer"`; `reason`: `string`; \} \| \{ `kind`: `"escalate"`; `to`: `"parent"` \| `"user"` \| `string`; `reason`: `string`; \} - -Defined in: [mcp/tools/coordination.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L48) diff --git a/docs/api/mcp/type-aliases/QuestionPolicy.md b/docs/api/mcp/type-aliases/QuestionPolicy.md deleted file mode 100644 index fd33ae7..0000000 --- a/docs/api/mcp/type-aliases/QuestionPolicy.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / QuestionPolicy - -# Type Alias: QuestionPolicy - -> **QuestionPolicy** = `"auto"` \| `"mustDecide"` \| `"bubble"` \| `"failClosed"` - -Defined in: [mcp/tools/coordination.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/coordination.ts#L60) diff --git a/docs/api/mcp/type-aliases/ResearchSource.md b/docs/api/mcp/type-aliases/ResearchSource.md deleted file mode 100644 index aef3c4a..0000000 --- a/docs/api/mcp/type-aliases/ResearchSource.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / ResearchSource - -# Type Alias: ResearchSource - -> **ResearchSource** = `"web"` \| `"corpus"` \| `"twitter"` \| `"github"` \| `"docs"` - -Defined in: [mcp/types.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/types.ts#L69) - -**`Experimental`** diff --git a/docs/api/mcp/type-aliases/ResearcherDelegate.md b/docs/api/mcp/type-aliases/ResearcherDelegate.md deleted file mode 100644 index b23454b..0000000 --- a/docs/api/mcp/type-aliases/ResearcherDelegate.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / ResearcherDelegate - -# Type Alias: ResearcherDelegate - -> **ResearcherDelegate** = (`args`, `ctx`) => `Promise`\<[`ResearchOutputShape`](../interfaces/ResearchOutputShape.md)\> - -Defined in: [mcp/delegates.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L91) - -**`Experimental`** - -## Parameters - -### args - -[`DelegateResearchArgs`](../interfaces/DelegateResearchArgs.md) - -### ctx - -[`DelegateRunCtx`](../interfaces/DelegateRunCtx.md) - -## Returns - -`Promise`\<[`ResearchOutputShape`](../interfaces/ResearchOutputShape.md)\> diff --git a/docs/api/mcp/type-aliases/UiAuditorDelegate.md b/docs/api/mcp/type-aliases/UiAuditorDelegate.md deleted file mode 100644 index 56456d2..0000000 --- a/docs/api/mcp/type-aliases/UiAuditorDelegate.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / UiAuditorDelegate - -# Type Alias: UiAuditorDelegate - -> **UiAuditorDelegate** = (`args`, `ctx`) => `Promise`\<[`UiAuditorDelegationOutput`](../interfaces/UiAuditorDelegationOutput.md)\> - -Defined in: [mcp/delegates.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L105) - -**`Experimental`** - -UI-auditor delegate — fully consumer-injected. agent-runtime ships no -default factory because the inputs are workspace path + judge function -+ (optionally) a `SandboxClient`, and the judge is the consumer's -model seam. See `createInProcessUiAuditClient` + `uiAuditorProfile` in -`@tangle-network/agent-runtime/profiles` for the canonical wiring. - -## Parameters - -### args - -[`DelegateUiAuditArgs`](../interfaces/DelegateUiAuditArgs.md) - -### ctx - -[`DelegateRunCtx`](../interfaces/DelegateRunCtx.md) - -## Returns - -`Promise`\<[`UiAuditorDelegationOutput`](../interfaces/UiAuditorDelegationOutput.md)\> diff --git a/docs/api/mcp/variables/DELEGATE_CODE_DESCRIPTION.md b/docs/api/mcp/variables/DELEGATE_CODE_DESCRIPTION.md deleted file mode 100644 index a898a32..0000000 --- a/docs/api/mcp/variables/DELEGATE_CODE_DESCRIPTION.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATE\_CODE\_DESCRIPTION - -# Variable: DELEGATE\_CODE\_DESCRIPTION - -> `const` **DELEGATE\_CODE\_DESCRIPTION**: `string` - -Defined in: [mcp/tools/delegate-code.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-code.ts#L22) - -**`Experimental`** diff --git a/docs/api/mcp/variables/DELEGATE_CODE_INPUT_SCHEMA.md b/docs/api/mcp/variables/DELEGATE_CODE_INPUT_SCHEMA.md deleted file mode 100644 index 918d6ed..0000000 --- a/docs/api/mcp/variables/DELEGATE_CODE_INPUT_SCHEMA.md +++ /dev/null @@ -1,159 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATE\_CODE\_INPUT\_SCHEMA - -# Variable: DELEGATE\_CODE\_INPUT\_SCHEMA - -> `const` **DELEGATE\_CODE\_INPUT\_SCHEMA**: `object` - -Defined in: [mcp/tools/delegate-code.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-code.ts#L46) - -**`Experimental`** - -## Type Declaration - -### type - -> `readonly` **type**: `"object"` = `'object'` - -### properties - -> `readonly` **properties**: `object` - -#### properties.goal - -> `readonly` **goal**: `object` - -#### properties.goal.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.goal.description - -> `readonly` **description**: `"Natural-language description of what the coder must accomplish."` = `'Natural-language description of what the coder must accomplish.'` - -#### properties.repoRoot - -> `readonly` **repoRoot**: `object` - -#### properties.repoRoot.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.repoRoot.description - -> `readonly` **description**: `"Absolute path inside the sandbox where the repo lives."` = `'Absolute path inside the sandbox where the repo lives.'` - -#### properties.contextHint - -> `readonly` **contextHint**: `object` - -#### properties.contextHint.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.contextHint.description - -> `readonly` **description**: `"Optional free-form context the coder sees in the prompt prelude."` = `'Optional free-form context the coder sees in the prompt prelude.'` - -#### properties.variants - -> `readonly` **variants**: `object` - -#### properties.variants.type - -> `readonly` **type**: `"integer"` = `'integer'` - -#### properties.variants.minimum - -> `readonly` **minimum**: `1` = `1` - -#### properties.variants.maximum - -> `readonly` **maximum**: `8` = `8` - -#### properties.variants.description - -> `readonly` **description**: `"Number of parallel coder harnesses. Default 1."` = `'Number of parallel coder harnesses. Default 1.'` - -#### properties.config - -> `readonly` **config**: `object` - -#### properties.config.type - -> `readonly` **type**: `"object"` = `'object'` - -#### properties.config.properties - -> `readonly` **properties**: `object` - -#### properties.config.properties.testCmd - -> `readonly` **testCmd**: `object` - -#### properties.config.properties.testCmd.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.config.properties.typecheckCmd - -> `readonly` **typecheckCmd**: `object` - -#### properties.config.properties.typecheckCmd.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.config.properties.forbiddenPaths - -> `readonly` **forbiddenPaths**: `object` - -#### properties.config.properties.forbiddenPaths.type - -> `readonly` **type**: `"array"` = `'array'` - -#### properties.config.properties.forbiddenPaths.items - -> `readonly` **items**: `object` - -#### properties.config.properties.forbiddenPaths.items.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.config.properties.maxDiffLines - -> `readonly` **maxDiffLines**: `object` - -#### properties.config.properties.maxDiffLines.type - -> `readonly` **type**: `"integer"` = `'integer'` - -#### properties.config.properties.maxDiffLines.minimum - -> `readonly` **minimum**: `1` = `1` - -#### properties.config.additionalProperties - -> `readonly` **additionalProperties**: `false` = `false` - -#### properties.namespace - -> `readonly` **namespace**: `object` - -#### properties.namespace.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.namespace.description - -> `readonly` **description**: `"Multi-tenant scope (customer-id, workspace-id)."` = `'Multi-tenant scope (customer-id, workspace-id).'` - -### required - -> `readonly` **required**: readonly \[`"goal"`, `"repoRoot"`\] - -### additionalProperties - -> `readonly` **additionalProperties**: `false` = `false` diff --git a/docs/api/mcp/variables/DELEGATE_CODE_TOOL_NAME.md b/docs/api/mcp/variables/DELEGATE_CODE_TOOL_NAME.md deleted file mode 100644 index d111c1a..0000000 --- a/docs/api/mcp/variables/DELEGATE_CODE_TOOL_NAME.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATE\_CODE\_TOOL\_NAME - -# Variable: DELEGATE\_CODE\_TOOL\_NAME - -> `const` **DELEGATE\_CODE\_TOOL\_NAME**: `"delegate_code"` = `'delegate_code'` - -Defined in: [mcp/tools/delegate-code.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-code.ts#L19) - -**`Experimental`** diff --git a/docs/api/mcp/variables/DELEGATE_FEEDBACK_DESCRIPTION.md b/docs/api/mcp/variables/DELEGATE_FEEDBACK_DESCRIPTION.md deleted file mode 100644 index ad44584..0000000 --- a/docs/api/mcp/variables/DELEGATE_FEEDBACK_DESCRIPTION.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATE\_FEEDBACK\_DESCRIPTION - -# Variable: DELEGATE\_FEEDBACK\_DESCRIPTION - -> `const` **DELEGATE\_FEEDBACK\_DESCRIPTION**: `string` - -Defined in: [mcp/tools/delegate-feedback.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-feedback.ts#L27) - -**`Experimental`** diff --git a/docs/api/mcp/variables/DELEGATE_FEEDBACK_INPUT_SCHEMA.md b/docs/api/mcp/variables/DELEGATE_FEEDBACK_INPUT_SCHEMA.md deleted file mode 100644 index fa6eb49..0000000 --- a/docs/api/mcp/variables/DELEGATE_FEEDBACK_INPUT_SCHEMA.md +++ /dev/null @@ -1,155 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATE\_FEEDBACK\_INPUT\_SCHEMA - -# Variable: DELEGATE\_FEEDBACK\_INPUT\_SCHEMA - -> `const` **DELEGATE\_FEEDBACK\_INPUT\_SCHEMA**: `object` - -Defined in: [mcp/tools/delegate-feedback.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-feedback.ts#L51) - -**`Experimental`** - -## Type Declaration - -### type - -> `readonly` **type**: `"object"` = `'object'` - -### properties - -> `readonly` **properties**: `object` - -#### properties.refersTo - -> `readonly` **refersTo**: `object` - -#### properties.refersTo.type - -> `readonly` **type**: `"object"` = `'object'` - -#### properties.refersTo.properties - -> `readonly` **properties**: `object` - -#### properties.refersTo.properties.kind - -> `readonly` **kind**: `object` - -#### properties.refersTo.properties.kind.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.refersTo.properties.kind.enum - -> `readonly` **enum**: readonly \[`"delegation"`, `"artifact"`, `"outcome"`\] - -#### properties.refersTo.properties.ref - -> `readonly` **ref**: `object` - -#### properties.refersTo.properties.ref.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.refersTo.required - -> `readonly` **required**: readonly \[`"kind"`, `"ref"`\] - -#### properties.refersTo.additionalProperties - -> `readonly` **additionalProperties**: `false` = `false` - -#### properties.rating - -> `readonly` **rating**: `object` - -#### properties.rating.type - -> `readonly` **type**: `"object"` = `'object'` - -#### properties.rating.properties - -> `readonly` **properties**: `object` - -#### properties.rating.properties.score - -> `readonly` **score**: `object` - -#### properties.rating.properties.score.type - -> `readonly` **type**: `"number"` = `'number'` - -#### properties.rating.properties.score.minimum - -> `readonly` **minimum**: `0` = `0` - -#### properties.rating.properties.score.maximum - -> `readonly` **maximum**: `1` = `1` - -#### properties.rating.properties.label - -> `readonly` **label**: `object` - -#### properties.rating.properties.label.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.rating.properties.label.enum - -> `readonly` **enum**: readonly \[`"good"`, `"bad"`, `"neutral"`, `"mixed"`\] - -#### properties.rating.properties.notes - -> `readonly` **notes**: `object` - -#### properties.rating.properties.notes.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.rating.required - -> `readonly` **required**: readonly \[`"score"`, `"notes"`\] - -#### properties.rating.additionalProperties - -> `readonly` **additionalProperties**: `false` = `false` - -#### properties.by - -> `readonly` **by**: `object` - -#### properties.by.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.by.enum - -> `readonly` **enum**: readonly \[`"agent"`, `"user"`, `"downstream-judge"`\] - -#### properties.capturedAt - -> `readonly` **capturedAt**: `object` - -#### properties.capturedAt.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.namespace - -> `readonly` **namespace**: `object` - -#### properties.namespace.type - -> `readonly` **type**: `"string"` = `'string'` - -### required - -> `readonly` **required**: readonly \[`"refersTo"`, `"rating"`, `"by"`\] - -### additionalProperties - -> `readonly` **additionalProperties**: `false` = `false` diff --git a/docs/api/mcp/variables/DELEGATE_FEEDBACK_TOOL_NAME.md b/docs/api/mcp/variables/DELEGATE_FEEDBACK_TOOL_NAME.md deleted file mode 100644 index ddae79b..0000000 --- a/docs/api/mcp/variables/DELEGATE_FEEDBACK_TOOL_NAME.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATE\_FEEDBACK\_TOOL\_NAME - -# Variable: DELEGATE\_FEEDBACK\_TOOL\_NAME - -> `const` **DELEGATE\_FEEDBACK\_TOOL\_NAME**: `"delegate_feedback"` = `'delegate_feedback'` - -Defined in: [mcp/tools/delegate-feedback.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-feedback.ts#L24) - -**`Experimental`** diff --git a/docs/api/mcp/variables/DELEGATE_RESEARCH_DESCRIPTION.md b/docs/api/mcp/variables/DELEGATE_RESEARCH_DESCRIPTION.md deleted file mode 100644 index 9d291f8..0000000 --- a/docs/api/mcp/variables/DELEGATE_RESEARCH_DESCRIPTION.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATE\_RESEARCH\_DESCRIPTION - -# Variable: DELEGATE\_RESEARCH\_DESCRIPTION - -> `const` **DELEGATE\_RESEARCH\_DESCRIPTION**: `string` - -Defined in: [mcp/tools/delegate-research.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-research.ts#L28) - -**`Experimental`** diff --git a/docs/api/mcp/variables/DELEGATE_RESEARCH_INPUT_SCHEMA.md b/docs/api/mcp/variables/DELEGATE_RESEARCH_INPUT_SCHEMA.md deleted file mode 100644 index 0d0c79c..0000000 --- a/docs/api/mcp/variables/DELEGATE_RESEARCH_INPUT_SCHEMA.md +++ /dev/null @@ -1,187 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATE\_RESEARCH\_INPUT\_SCHEMA - -# Variable: DELEGATE\_RESEARCH\_INPUT\_SCHEMA - -> `const` **DELEGATE\_RESEARCH\_INPUT\_SCHEMA**: `object` - -Defined in: [mcp/tools/delegate-research.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-research.ts#L52) - -**`Experimental`** - -## Type Declaration - -### type - -> `readonly` **type**: `"object"` = `'object'` - -### properties - -> `readonly` **properties**: `object` - -#### properties.question - -> `readonly` **question**: `object` - -#### properties.question.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.question.description - -> `readonly` **description**: `"The research question to answer."` = `'The research question to answer.'` - -#### properties.namespace - -> `readonly` **namespace**: `object` - -#### properties.namespace.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.namespace.description - -> `readonly` **description**: `"Multi-tenant scope (customer-id, workspace-id). REQUIRED."` = `'Multi-tenant scope (customer-id, workspace-id). REQUIRED.'` - -#### properties.scope - -> `readonly` **scope**: `object` - -#### properties.scope.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.scope.description - -> `readonly` **description**: "Bound, e.g. \"audience for cpg-founder ICP\"." = `'Bound, e.g. "audience for cpg-founder ICP".'` - -#### properties.sources - -> `readonly` **sources**: `object` - -#### properties.sources.type - -> `readonly` **type**: `"array"` = `'array'` - -#### properties.sources.items - -> `readonly` **items**: `object` - -#### properties.sources.items.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.sources.items.enum - -> `readonly` **enum**: readonly [`ResearchSource`](../type-aliases/ResearchSource.md)[] - -#### properties.variants - -> `readonly` **variants**: `object` - -#### properties.variants.type - -> `readonly` **type**: `"integer"` = `'integer'` - -#### properties.variants.minimum - -> `readonly` **minimum**: `1` = `1` - -#### properties.variants.maximum - -> `readonly` **maximum**: `8` = `8` - -#### properties.config - -> `readonly` **config**: `object` - -#### properties.config.type - -> `readonly` **type**: `"object"` = `'object'` - -#### properties.config.properties - -> `readonly` **properties**: `object` - -#### properties.config.properties.recencyWindow - -> `readonly` **recencyWindow**: `object` - -#### properties.config.properties.recencyWindow.type - -> `readonly` **type**: `"object"` = `'object'` - -#### properties.config.properties.recencyWindow.properties - -> `readonly` **properties**: `object` - -#### properties.config.properties.recencyWindow.properties.since - -> `readonly` **since**: `object` - -#### properties.config.properties.recencyWindow.properties.since.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.config.properties.recencyWindow.properties.since.description - -> `readonly` **description**: `"ISO datetime"` = `'ISO datetime'` - -#### properties.config.properties.recencyWindow.properties.until - -> `readonly` **until**: `object` - -#### properties.config.properties.recencyWindow.properties.until.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.config.properties.recencyWindow.properties.until.description - -> `readonly` **description**: `"ISO datetime"` = `'ISO datetime'` - -#### properties.config.properties.recencyWindow.additionalProperties - -> `readonly` **additionalProperties**: `false` = `false` - -#### properties.config.properties.maxItems - -> `readonly` **maxItems**: `object` - -#### properties.config.properties.maxItems.type - -> `readonly` **type**: `"integer"` = `'integer'` - -#### properties.config.properties.maxItems.minimum - -> `readonly` **minimum**: `1` = `1` - -#### properties.config.properties.minConfidence - -> `readonly` **minConfidence**: `object` - -#### properties.config.properties.minConfidence.type - -> `readonly` **type**: `"number"` = `'number'` - -#### properties.config.properties.minConfidence.minimum - -> `readonly` **minimum**: `0` = `0` - -#### properties.config.properties.minConfidence.maximum - -> `readonly` **maximum**: `1` = `1` - -#### properties.config.additionalProperties - -> `readonly` **additionalProperties**: `false` = `false` - -### required - -> `readonly` **required**: readonly \[`"question"`, `"namespace"`\] - -### additionalProperties - -> `readonly` **additionalProperties**: `false` = `false` diff --git a/docs/api/mcp/variables/DELEGATE_RESEARCH_TOOL_NAME.md b/docs/api/mcp/variables/DELEGATE_RESEARCH_TOOL_NAME.md deleted file mode 100644 index 55470ca..0000000 --- a/docs/api/mcp/variables/DELEGATE_RESEARCH_TOOL_NAME.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATE\_RESEARCH\_TOOL\_NAME - -# Variable: DELEGATE\_RESEARCH\_TOOL\_NAME - -> `const` **DELEGATE\_RESEARCH\_TOOL\_NAME**: `"delegate_research"` = `'delegate_research'` - -Defined in: [mcp/tools/delegate-research.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-research.ts#L25) - -**`Experimental`** diff --git a/docs/api/mcp/variables/DELEGATE_UI_AUDIT_DESCRIPTION.md b/docs/api/mcp/variables/DELEGATE_UI_AUDIT_DESCRIPTION.md deleted file mode 100644 index 520cb93..0000000 --- a/docs/api/mcp/variables/DELEGATE_UI_AUDIT_DESCRIPTION.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATE\_UI\_AUDIT\_DESCRIPTION - -# Variable: DELEGATE\_UI\_AUDIT\_DESCRIPTION - -> `const` **DELEGATE\_UI\_AUDIT\_DESCRIPTION**: `string` - -Defined in: [mcp/tools/delegate-ui-audit.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-ui-audit.ts#L33) - -**`Experimental`** diff --git a/docs/api/mcp/variables/DELEGATE_UI_AUDIT_INPUT_SCHEMA.md b/docs/api/mcp/variables/DELEGATE_UI_AUDIT_INPUT_SCHEMA.md deleted file mode 100644 index 36584dd..0000000 --- a/docs/api/mcp/variables/DELEGATE_UI_AUDIT_INPUT_SCHEMA.md +++ /dev/null @@ -1,259 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATE\_UI\_AUDIT\_INPUT\_SCHEMA - -# Variable: DELEGATE\_UI\_AUDIT\_INPUT\_SCHEMA - -> `const` **DELEGATE\_UI\_AUDIT\_INPUT\_SCHEMA**: `object` - -Defined in: [mcp/tools/delegate-ui-audit.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-ui-audit.ts#L86) - -**`Experimental`** - -## Type Declaration - -### type - -> `readonly` **type**: `"object"` = `'object'` - -### properties - -> `readonly` **properties**: `object` - -#### properties.workspaceDir - -> `readonly` **workspaceDir**: `object` - -#### properties.workspaceDir.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.workspaceDir.description - -> `readonly` **description**: `"Absolute path for the audit workspace."` = `'Absolute path for the audit workspace.'` - -#### properties.routes - -> `readonly` **routes**: `object` - -#### properties.routes.type - -> `readonly` **type**: `"array"` = `'array'` - -#### properties.routes.items - -> `readonly` **items**: `object` = `ROUTE_SCHEMA` - -#### properties.routes.items.type - -> `readonly` **type**: `"object"` = `'object'` - -#### properties.routes.items.properties - -> `readonly` **properties**: `object` - -#### properties.routes.items.properties.name - -> `readonly` **name**: `object` - -#### properties.routes.items.properties.name.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.routes.items.properties.name.description - -> `readonly` **description**: `"Stable route name (used in screenshot filenames)."` = `'Stable route name (used in screenshot filenames).'` - -#### properties.routes.items.properties.url - -> `readonly` **url**: `object` - -#### properties.routes.items.properties.url.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.routes.items.properties.url.description - -> `readonly` **description**: `"Fully-qualified URL."` = `'Fully-qualified URL.'` - -#### properties.routes.items.properties.viewports - -> `readonly` **viewports**: `object` - -#### properties.routes.items.properties.viewports.type - -> `readonly` **type**: `"array"` = `'array'` - -#### properties.routes.items.properties.viewports.items - -> `readonly` **items**: `object` = `VIEWPORT_SCHEMA` - -#### properties.routes.items.properties.viewports.items.type - -> `readonly` **type**: `"object"` = `'object'` - -#### properties.routes.items.properties.viewports.items.properties - -> `readonly` **properties**: `object` - -#### properties.routes.items.properties.viewports.items.properties.width - -> `readonly` **width**: `object` - -#### properties.routes.items.properties.viewports.items.properties.width.type - -> `readonly` **type**: `"integer"` = `'integer'` - -#### properties.routes.items.properties.viewports.items.properties.width.minimum - -> `readonly` **minimum**: `1` = `1` - -#### properties.routes.items.properties.viewports.items.properties.height - -> `readonly` **height**: `object` - -#### properties.routes.items.properties.viewports.items.properties.height.type - -> `readonly` **type**: `"integer"` = `'integer'` - -#### properties.routes.items.properties.viewports.items.properties.height.minimum - -> `readonly` **minimum**: `1` = `1` - -#### properties.routes.items.properties.viewports.items.required - -> `readonly` **required**: readonly \[`"width"`, `"height"`\] - -#### properties.routes.items.properties.viewports.items.additionalProperties - -> `readonly` **additionalProperties**: `false` = `false` - -#### properties.routes.items.properties.viewports.description - -> `readonly` **description**: `"Viewports to capture at. Default [{1280, 800}]."` = `'Viewports to capture at. Default [{1280, 800}].'` - -#### properties.routes.items.properties.fullPage - -> `readonly` **fullPage**: `object` - -#### properties.routes.items.properties.fullPage.type - -> `readonly` **type**: `"boolean"` = `'boolean'` - -#### properties.routes.items.properties.waitFor - -> `readonly` **waitFor**: `object` - -#### properties.routes.items.properties.waitFor.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.routes.items.properties.waitFor.description - -> `readonly` **description**: `"CSS selector to wait for before capturing."` = `'CSS selector to wait for before capturing.'` - -#### properties.routes.items.required - -> `readonly` **required**: readonly \[`"name"`, `"url"`\] - -#### properties.routes.items.additionalProperties - -> `readonly` **additionalProperties**: `false` = `false` - -#### properties.routes.minItems - -> `readonly` **minItems**: `1` = `1` - -#### properties.namespace - -> `readonly` **namespace**: `object` - -#### properties.namespace.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.namespace.description - -> `readonly` **description**: `"Multi-tenant scope."` = `'Multi-tenant scope.'` - -#### properties.config - -> `readonly` **config**: `object` - -#### properties.config.type - -> `readonly` **type**: `"object"` = `'object'` - -#### properties.config.properties - -> `readonly` **properties**: `object` - -#### properties.config.properties.lenses - -> `readonly` **lenses**: `object` - -#### properties.config.properties.lenses.type - -> `readonly` **type**: `"array"` = `'array'` - -#### properties.config.properties.lenses.items - -> `readonly` **items**: `object` - -#### properties.config.properties.lenses.items.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.config.properties.lenses.items.enum - -> `readonly` **enum**: readonly [`UiLens`](../../profiles/type-aliases/UiLens.md)[] - -#### properties.config.properties.lenses.description - -> `readonly` **description**: "Lenses to iterate. Default: every lens except \"other\"." = `'Lenses to iterate. Default: every lens except "other".'` - -#### properties.config.properties.maxIterations - -> `readonly` **maxIterations**: `object` - -#### properties.config.properties.maxIterations.type - -> `readonly` **type**: `"integer"` = `'integer'` - -#### properties.config.properties.maxIterations.minimum - -> `readonly` **minimum**: `1` = `1` - -#### properties.config.properties.maxConcurrency - -> `readonly` **maxConcurrency**: `object` - -#### properties.config.properties.maxConcurrency.type - -> `readonly` **type**: `"integer"` = `'integer'` - -#### properties.config.properties.maxConcurrency.minimum - -> `readonly` **minimum**: `1` = `1` - -#### properties.config.properties.productContext - -> `readonly` **productContext**: `object` - -#### properties.config.properties.productContext.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.config.additionalProperties - -> `readonly` **additionalProperties**: `false` = `false` - -### required - -> `readonly` **required**: readonly \[`"workspaceDir"`, `"routes"`\] - -### additionalProperties - -> `readonly` **additionalProperties**: `false` = `false` diff --git a/docs/api/mcp/variables/DELEGATE_UI_AUDIT_TOOL_NAME.md b/docs/api/mcp/variables/DELEGATE_UI_AUDIT_TOOL_NAME.md deleted file mode 100644 index 7cf1e5f..0000000 --- a/docs/api/mcp/variables/DELEGATE_UI_AUDIT_TOOL_NAME.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATE\_UI\_AUDIT\_TOOL\_NAME - -# Variable: DELEGATE\_UI\_AUDIT\_TOOL\_NAME - -> `const` **DELEGATE\_UI\_AUDIT\_TOOL\_NAME**: `"delegate_ui_audit"` = `'delegate_ui_audit'` - -Defined in: [mcp/tools/delegate-ui-audit.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegate-ui-audit.ts#L30) - -**`Experimental`** diff --git a/docs/api/mcp/variables/DELEGATION_HISTORY_DESCRIPTION.md b/docs/api/mcp/variables/DELEGATION_HISTORY_DESCRIPTION.md deleted file mode 100644 index 72f25af..0000000 --- a/docs/api/mcp/variables/DELEGATION_HISTORY_DESCRIPTION.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATION\_HISTORY\_DESCRIPTION - -# Variable: DELEGATION\_HISTORY\_DESCRIPTION - -> `const` **DELEGATION\_HISTORY\_DESCRIPTION**: `string` - -Defined in: [mcp/tools/delegation-history.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-history.ts#L20) - -**`Experimental`** diff --git a/docs/api/mcp/variables/DELEGATION_HISTORY_INPUT_SCHEMA.md b/docs/api/mcp/variables/DELEGATION_HISTORY_INPUT_SCHEMA.md deleted file mode 100644 index 2eef3cb..0000000 --- a/docs/api/mcp/variables/DELEGATION_HISTORY_INPUT_SCHEMA.md +++ /dev/null @@ -1,75 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATION\_HISTORY\_INPUT\_SCHEMA - -# Variable: DELEGATION\_HISTORY\_INPUT\_SCHEMA - -> `const` **DELEGATION\_HISTORY\_INPUT\_SCHEMA**: `object` - -Defined in: [mcp/tools/delegation-history.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-history.ts#L41) - -**`Experimental`** - -## Type Declaration - -### type - -> `readonly` **type**: `"object"` = `'object'` - -### properties - -> `readonly` **properties**: `object` - -#### properties.namespace - -> `readonly` **namespace**: `object` - -#### properties.namespace.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.profile - -> `readonly` **profile**: `object` - -#### properties.profile.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.profile.enum - -> `readonly` **enum**: readonly \[`"coder"`, `"researcher"`\] - -#### properties.since - -> `readonly` **since**: `object` - -#### properties.since.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.since.description - -> `readonly` **description**: `"ISO datetime — earliest startedAt to include."` = `'ISO datetime — earliest startedAt to include.'` - -#### properties.limit - -> `readonly` **limit**: `object` - -#### properties.limit.type - -> `readonly` **type**: `"integer"` = `'integer'` - -#### properties.limit.minimum - -> `readonly` **minimum**: `1` = `1` - -#### properties.limit.maximum - -> `readonly` **maximum**: `500` = `500` - -### additionalProperties - -> `readonly` **additionalProperties**: `false` = `false` diff --git a/docs/api/mcp/variables/DELEGATION_HISTORY_TOOL_NAME.md b/docs/api/mcp/variables/DELEGATION_HISTORY_TOOL_NAME.md deleted file mode 100644 index d770a5c..0000000 --- a/docs/api/mcp/variables/DELEGATION_HISTORY_TOOL_NAME.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATION\_HISTORY\_TOOL\_NAME - -# Variable: DELEGATION\_HISTORY\_TOOL\_NAME - -> `const` **DELEGATION\_HISTORY\_TOOL\_NAME**: `"delegation_history"` = `'delegation_history'` - -Defined in: [mcp/tools/delegation-history.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-history.ts#L17) - -**`Experimental`** diff --git a/docs/api/mcp/variables/DELEGATION_MCP_SERVER_KEY.md b/docs/api/mcp/variables/DELEGATION_MCP_SERVER_KEY.md deleted file mode 100644 index 2a972b2..0000000 --- a/docs/api/mcp/variables/DELEGATION_MCP_SERVER_KEY.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATION\_MCP\_SERVER\_KEY - -# Variable: DELEGATION\_MCP\_SERVER\_KEY - -> `const` **DELEGATION\_MCP\_SERVER\_KEY**: `"agent-runtime-delegation"` = `'agent-runtime-delegation'` - -Defined in: [mcp/delegation-profile.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-profile.ts#L32) - -MCP server key under which the agent-runtime delegation tools mount. diff --git a/docs/api/mcp/variables/DELEGATION_STATUS_DESCRIPTION.md b/docs/api/mcp/variables/DELEGATION_STATUS_DESCRIPTION.md deleted file mode 100644 index 57acaf2..0000000 --- a/docs/api/mcp/variables/DELEGATION_STATUS_DESCRIPTION.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATION\_STATUS\_DESCRIPTION - -# Variable: DELEGATION\_STATUS\_DESCRIPTION - -> `const` **DELEGATION\_STATUS\_DESCRIPTION**: `string` - -Defined in: [mcp/tools/delegation-status.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-status.ts#L19) - -**`Experimental`** diff --git a/docs/api/mcp/variables/DELEGATION_STATUS_INPUT_SCHEMA.md b/docs/api/mcp/variables/DELEGATION_STATUS_INPUT_SCHEMA.md deleted file mode 100644 index e23874b..0000000 --- a/docs/api/mcp/variables/DELEGATION_STATUS_INPUT_SCHEMA.md +++ /dev/null @@ -1,55 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATION\_STATUS\_INPUT\_SCHEMA - -# Variable: DELEGATION\_STATUS\_INPUT\_SCHEMA - -> `const` **DELEGATION\_STATUS\_INPUT\_SCHEMA**: `object` - -Defined in: [mcp/tools/delegation-status.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-status.ts#L41) - -**`Experimental`** - -## Type Declaration - -### type - -> `readonly` **type**: `"object"` = `'object'` - -### properties - -> `readonly` **properties**: `object` - -#### properties.taskId - -> `readonly` **taskId**: `object` - -#### properties.taskId.type - -> `readonly` **type**: `"string"` = `'string'` - -#### properties.taskId.description - -> `readonly` **description**: `"Returned by delegate_code / delegate_research."` = `'Returned by delegate_code / delegate_research.'` - -#### properties.includeTrace - -> `readonly` **includeTrace**: `object` - -#### properties.includeTrace.type - -> `readonly` **type**: `"boolean"` = `'boolean'` - -#### properties.includeTrace.description - -> `readonly` **description**: `"Also return the journaled loop-trace span tree for this delegation. Default false."` = `'Also return the journaled loop-trace span tree for this delegation. Default false.'` - -### required - -> `readonly` **required**: readonly \[`"taskId"`\] - -### additionalProperties - -> `readonly` **additionalProperties**: `false` = `false` diff --git a/docs/api/mcp/variables/DELEGATION_STATUS_TOOL_NAME.md b/docs/api/mcp/variables/DELEGATION_STATUS_TOOL_NAME.md deleted file mode 100644 index 75842aa..0000000 --- a/docs/api/mcp/variables/DELEGATION_STATUS_TOOL_NAME.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATION\_STATUS\_TOOL\_NAME - -# Variable: DELEGATION\_STATUS\_TOOL\_NAME - -> `const` **DELEGATION\_STATUS\_TOOL\_NAME**: `"delegation_status"` = `'delegation_status'` - -Defined in: [mcp/tools/delegation-status.ts:16](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/delegation-status.ts#L16) - -**`Experimental`** diff --git a/docs/api/mcp/variables/DELEGATION_TRACE_MAX_BYTES.md b/docs/api/mcp/variables/DELEGATION_TRACE_MAX_BYTES.md deleted file mode 100644 index ced3de4..0000000 --- a/docs/api/mcp/variables/DELEGATION_TRACE_MAX_BYTES.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATION\_TRACE\_MAX\_BYTES - -# Variable: DELEGATION\_TRACE\_MAX\_BYTES - -> `const` **DELEGATION\_TRACE\_MAX\_BYTES**: `number` - -Defined in: [mcp/delegation-trace.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L48) - -**`Experimental`** - -Default cap on the serialized trace payload per record, in bytes. diff --git a/docs/api/mcp/variables/DELEGATION_TRACE_MAX_SPANS.md b/docs/api/mcp/variables/DELEGATION_TRACE_MAX_SPANS.md deleted file mode 100644 index 697f497..0000000 --- a/docs/api/mcp/variables/DELEGATION_TRACE_MAX_SPANS.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / DELEGATION\_TRACE\_MAX\_SPANS - -# Variable: DELEGATION\_TRACE\_MAX\_SPANS - -> `const` **DELEGATION\_TRACE\_MAX\_SPANS**: `512` = `512` - -Defined in: [mcp/delegation-trace.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegation-trace.ts#L45) - -**`Experimental`** - -Default cap on spans retained per delegation record. diff --git a/docs/api/mcp/variables/defaultChecks.md b/docs/api/mcp/variables/defaultChecks.md deleted file mode 100644 index 09c4233..0000000 --- a/docs/api/mcp/variables/defaultChecks.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [mcp](../README.md) / defaultChecks - -# Variable: defaultChecks - -> `const` **defaultChecks**: `Record`\<`string`, [`Check`](../interfaces/Check.md)\> - -Defined in: [mcp/tools/checks.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/tools/checks.ts#L93) - -The built-in lens directory. Domain-blind (about any agent trace); compose at test time. diff --git a/docs/api/platform.md b/docs/api/platform.md new file mode 100644 index 0000000..72e180e --- /dev/null +++ b/docs/api/platform.md @@ -0,0 +1,1080 @@ +[**@tangle-network/agent-runtime**](README.md) + +*** + +[@tangle-network/agent-runtime](README.md) / platform + +# platform + +## Classes + +### PlatformAuthError + +Defined in: [platform/auth.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L50) + +`@tangle-network/agent-runtime/platform` — typed server-side clients +for the Tangle platform's cross-site SSO bridge and integrations +hub. Apps consume these to avoid rolling their own OAuth, session, +and connection storage. + +See: + - [PlatformAuthClient](#platformauthclient) for "Login with Tangle" + - [PlatformHubClient](#platformhubclient) for the `/v1/hub/*` surface + +#### Extends + +- `Error` + +#### Constructors + +##### Constructor + +> **new PlatformAuthError**(`message`, `status`, `body`): [`PlatformAuthError`](#platformautherror) + +Defined in: [platform/auth.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L51) + +###### Parameters + +###### message + +`string` + +###### status + +`number` + +###### body + +`unknown` + +###### Returns + +[`PlatformAuthError`](#platformautherror) + +###### Overrides + +`Error.constructor` + +#### Properties + +##### status + +> `readonly` **status**: `number` + +Defined in: [platform/auth.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L53) + +##### body + +> `readonly` **body**: `unknown` + +Defined in: [platform/auth.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L54) + +*** + +### PlatformAuthClient + +Defined in: [platform/auth.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L61) + +`@tangle-network/agent-runtime/platform` — typed server-side clients +for the Tangle platform's cross-site SSO bridge and integrations +hub. Apps consume these to avoid rolling their own OAuth, session, +and connection storage. + +See: + - [PlatformAuthClient](#platformauthclient) for "Login with Tangle" + - [PlatformHubClient](#platformhubclient) for the `/v1/hub/*` surface + +#### Constructors + +##### Constructor + +> **new PlatformAuthClient**(`options`): [`PlatformAuthClient`](#platformauthclient) + +Defined in: [platform/auth.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L66) + +###### Parameters + +###### options + +[`PlatformAuthClientOptions`](#platformauthclientoptions) + +###### Returns + +[`PlatformAuthClient`](#platformauthclient) + +#### Methods + +##### authorizeUrl() + +> **authorizeUrl**(`options`): `string` + +Defined in: [platform/auth.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L81) + +Build the URL the user is redirected to in order to start SSO. +The platform redirects back to one of `appId`'s registered +`redirectUris` with `?code=...&app=...&state=...`. + +###### Parameters + +###### options + +[`AuthorizeUrlOptions`](#authorizeurloptions) + +###### Returns + +`string` + +##### exchange() + +> **exchange**(`code`): `Promise`\<[`ExchangeCodeResult`](#exchangecoderesult)\> + +Defined in: [platform/auth.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L99) + +Exchange a single-use auth code (delivered to the consumer's +callback by the platform) for an API key + the user's identity. +Codes are single-use and expire ~5 minutes after issue. + +###### Parameters + +###### code + +`string` + +###### Returns + +`Promise`\<[`ExchangeCodeResult`](#exchangecoderesult)\> + +*** + +### PlatformHubError + +Defined in: [platform/integrations.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L132) + +#### Extends + +- `Error` + +#### Constructors + +##### Constructor + +> **new PlatformHubError**(`message`, `status`, `code`, `body`): [`PlatformHubError`](#platformhuberror) + +Defined in: [platform/integrations.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L133) + +###### Parameters + +###### message + +`string` + +###### status + +`number` + +###### code + +`string` \| `undefined` + +###### body + +`unknown` + +###### Returns + +[`PlatformHubError`](#platformhuberror) + +###### Overrides + +`Error.constructor` + +#### Properties + +##### status + +> `readonly` **status**: `number` + +Defined in: [platform/integrations.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L135) + +##### code + +> `readonly` **code**: `string` \| `undefined` + +Defined in: [platform/integrations.ts:136](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L136) + +##### body + +> `readonly` **body**: `unknown` + +Defined in: [platform/integrations.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L137) + +*** + +### PlatformHubClient + +Defined in: [platform/integrations.ts:150](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L150) + +#### Constructors + +##### Constructor + +> **new PlatformHubClient**(`options`): [`PlatformHubClient`](#platformhubclient) + +Defined in: [platform/integrations.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L155) + +###### Parameters + +###### options + +[`PlatformHubClientOptions`](#platformhubclientoptions) + +###### Returns + +[`PlatformHubClient`](#platformhubclient) + +#### Methods + +##### catalog() + +> **catalog**(): `Promise`\<[`CatalogResult`](#catalogresult)\> + +Defined in: [platform/integrations.ts:166](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L166) + +GET /v1/hub/providers — the connectable provider catalog. + +###### Returns + +`Promise`\<[`CatalogResult`](#catalogresult)\> + +##### listConnections() + +> **listConnections**(): `Promise`\<[`PlatformConnection`](#platformconnection)[]\> + +Defined in: [platform/integrations.ts:171](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L171) + +GET /v1/hub/connections — the calling user's live connections. + +###### Returns + +`Promise`\<[`PlatformConnection`](#platformconnection)[]\> + +##### revokeConnection() + +> **revokeConnection**(`connectionId`): `Promise`\<\{ `connection`: [`PlatformConnection`](#platformconnection); \}\> + +Defined in: [platform/integrations.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L180) + +DELETE /v1/hub/connections/:connectionId — revoke + disable a connection. + +###### Parameters + +###### connectionId + +`string` + +###### Returns + +`Promise`\<\{ `connection`: [`PlatformConnection`](#platformconnection); \}\> + +##### startAuth() + +> **startAuth**(`input`): `Promise`\<[`StartAuthResult`](#startauthresult)\> + +Defined in: [platform/integrations.ts:190](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L190) + +POST /v1/hub/connections/:provider/start — begin OAuth/grant. The provider +is taken from the URL; the body carries `returnUrl` (+ `cli`). The platform's +two start branches name the URL field differently (github → `authorizationUrl`, +substrate → `redirectUrl`); this normalizes to `authorizationUrl`. + +###### Parameters + +###### input + +[`StartAuthInput`](#startauthinput) + +###### Returns + +`Promise`\<[`StartAuthResult`](#startauthresult)\> + +##### listHealthchecks() + +> **listHealthchecks**(): `Promise`\<[`HealthCheck`](#healthcheck)[]\> + +Defined in: [platform/integrations.ts:217](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L217) + +Last-known health for every connection. The platform has no global +healthcheck listing — health rides on each connection row — so this derives +the list from `listConnections()` (one request, no extra round-trips). + +###### Returns + +`Promise`\<[`HealthCheck`](#healthcheck)[]\> + +##### checkConnectionHealth() + +> **checkConnectionHealth**(`connectionId`): `Promise`\<[`ConnectionHealthResult`](#connectionhealthresult)\> + +Defined in: [platform/integrations.ts:231](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L231) + +POST /v1/hub/connections/:connectionId/health — trigger a fresh health +probe for one connection and return its updated state. + +###### Parameters + +###### connectionId + +`string` + +###### Returns + +`Promise`\<[`ConnectionHealthResult`](#connectionhealthresult)\> + +##### runHealthchecks() + +> **runHealthchecks**(): `Promise`\<\{ `scheduled`: `number`; \}\> + +Defined in: [platform/integrations.ts:240](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L240) + +Trigger a fresh health probe across all of the user's connections. The +platform exposes health per-connection only, so this fans out over +`listConnections()`. `scheduled` is the number of probes dispatched. + +###### Returns + +`Promise`\<\{ `scheduled`: `number`; \}\> + +##### status() + +> **status**(): `Promise`\<[`PlatformHubStatus`](#platformhubstatus)\> + +Defined in: [platform/integrations.ts:247](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L247) + +GET /v1/hub/status — principal + aggregate connection counts. + +###### Returns + +`Promise`\<[`PlatformHubStatus`](#platformhubstatus)\> + +##### mintToken() + +> **mintToken**(`input`): `Promise`\<[`MintTokenResult`](#minttokenresult)\> + +Defined in: [platform/integrations.ts:256](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L256) + +POST /v1/hub/tokens — mint a short-lived, action-scoped capability token a +sandbox can use to invoke one hub action on the user's behalf without +seeing the underlying provider credential. + +###### Parameters + +###### input + +[`MintTokenInput`](#minttokeninput) + +###### Returns + +`Promise`\<[`MintTokenResult`](#minttokenresult)\> + +##### exec() + +> **exec**(`input`): `Promise`\<`unknown`\> + +Defined in: [platform/integrations.ts:261](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L261) + +POST /v1/hub/exec — execute a hub action and return its result. + +###### Parameters + +###### input + +[`ExecInput`](#execinput) + +###### Returns + +`Promise`\<`unknown`\> + +## Interfaces + +### PlatformAuthClientOptions + +Defined in: [platform/auth.ts:15](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L15) + +Server-side client for the Tangle platform's cross-site SSO bridge. + +Consumer apps (gtm-agent, tax-agent, legal-agent, creative-agent, …) +use this to: + 1. Build an /authorize URL that lands the user on id.tangle.tools + and brings them back with a single-use code. + 2. Exchange that code for an API key + the user's identity. + +The platform endpoint contract is documented in +`products/platform/api/src/routes/cross-site.ts`. This client only +speaks HTTP — no SDK weight, no transitive deps. + +#### Properties + +##### baseUrl + +> **baseUrl**: `string` + +Defined in: [platform/auth.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L17) + +Platform base URL, e.g. `https://id.tangle.tools`. + +##### appId + +> **appId**: `string` + +Defined in: [platform/auth.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L19) + +App id as registered in the platform's TRUSTED_APPS registry. + +##### fetchImpl? + +> `optional` **fetchImpl?**: (`input`, `init?`) => `Promise`\<`Response`\> + +Defined in: [platform/auth.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L21) + +Override the global fetch (useful for tests + edge runtimes). + +###### Parameters + +###### input + +`string` \| `URL` \| `Request` + +###### init? + +`RequestInit` + +###### Returns + +`Promise`\<`Response`\> + +*** + +### AuthorizeUrlOptions + +Defined in: [platform/auth.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L24) + +`@tangle-network/agent-runtime/platform` — typed server-side clients +for the Tangle platform's cross-site SSO bridge and integrations +hub. Apps consume these to avoid rolling their own OAuth, session, +and connection storage. + +See: + - [PlatformAuthClient](#platformauthclient) for "Login with Tangle" + - [PlatformHubClient](#platformhubclient) for the `/v1/hub/*` surface + +#### Properties + +##### state + +> **state**: `string` + +Defined in: [platform/auth.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L26) + +Required CSRF token; the consumer verifies it on the callback. + +##### redirectUri? + +> `optional` **redirectUri?**: `string` + +Defined in: [platform/auth.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L31) + +Final redirect URI. Must be one of the URIs registered for `appId` +on the platform. Omit to use the first registered URI. + +##### prompt? + +> `optional` **prompt?**: `"login"` + +Defined in: [platform/auth.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L33) + +Force the login screen even if a session is already active. + +##### email? + +> `optional` **email?**: `string` + +Defined in: [platform/auth.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L35) + +Pre-fill the email field on the login screen. + +*** + +### ExchangeCodeResult + +Defined in: [platform/auth.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L38) + +`@tangle-network/agent-runtime/platform` — typed server-side clients +for the Tangle platform's cross-site SSO bridge and integrations +hub. Apps consume these to avoid rolling their own OAuth, session, +and connection storage. + +See: + - [PlatformAuthClient](#platformauthclient) for "Login with Tangle" + - [PlatformHubClient](#platformhubclient) for the `/v1/hub/*` surface + +#### Properties + +##### apiKey + +> **apiKey**: `string` + +Defined in: [platform/auth.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L39) + +##### user + +> **user**: `object` + +Defined in: [platform/auth.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L40) + +###### id + +> **id**: `string` + +###### email + +> **email**: `string` + +###### name? + +> `optional` **name?**: `string` + +##### plan + +> **plan**: `object` + +Defined in: [platform/auth.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L45) + +###### tier + +> **tier**: `string` + +*** + +### PlatformHubClientOptions + +Defined in: [platform/integrations.ts:15](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L15) + +Server-side client for the Tangle platform's integration hub +(`/v1/hub/*`). Consumer apps use this instead of rolling their own +OAuth + connection tables. + +Auth: the caller supplies a bearer (either the user's API key from +cross-site exchange, or a platform service token) on construction. + +Endpoint contract (authoritative): the platform's `src/lib/hub-contract.ts` ++ `src/routes/hub.ts`. The platform wraps every response in +`{ success, data }`; non-2xx or `success:false` surfaces as `PlatformHubError` +carrying the real upstream status. + +#### Properties + +##### baseUrl + +> **baseUrl**: `string` + +Defined in: [platform/integrations.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L17) + +Platform base URL, e.g. `https://id.tangle.tools`. + +##### bearer + +> **bearer**: `string` + +Defined in: [platform/integrations.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L19) + +Bearer credential — user API key or service token. + +##### fetchImpl? + +> `optional` **fetchImpl?**: (`input`, `init?`) => `Promise`\<`Response`\> + +Defined in: [platform/integrations.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L21) + +Override fetch (tests + edge runtimes). + +###### Parameters + +###### input + +`string` \| `URL` \| `Request` + +###### init? + +`RequestInit` + +###### Returns + +`Promise`\<`Response`\> + +*** + +### PlatformConnection + +Defined in: [platform/integrations.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L25) + +A live integration connection, as returned by `/v1/hub/connections`. + +#### Properties + +##### id + +> **id**: `string` + +Defined in: [platform/integrations.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L26) + +##### providerId + +> **providerId**: `string` + +Defined in: [platform/integrations.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L27) + +##### displayName + +> **displayName**: `string` + +Defined in: [platform/integrations.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L28) + +##### accountDisplay + +> **accountDisplay**: `string` \| `null` + +Defined in: [platform/integrations.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L29) + +##### scopes + +> **scopes**: `string`[] + +Defined in: [platform/integrations.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L30) + +##### status + +> **status**: `string` & `object` \| `"unhealthy"` \| `"active"` \| `"revoked"` \| `"reconnect_required"` + +Defined in: [platform/integrations.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L31) + +##### health + +> **health**: `string` & `object` \| `"unknown"` \| `"healthy"` \| `"unhealthy"` \| `"rate_limited"` + +Defined in: [platform/integrations.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L32) + +##### createdAt + +> **createdAt**: `string` + +Defined in: [platform/integrations.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L33) + +##### updatedAt + +> **updatedAt**: `string` + +Defined in: [platform/integrations.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L34) + +##### lastUsedAt + +> **lastUsedAt**: `string` \| `null` + +Defined in: [platform/integrations.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L35) + +*** + +### PlatformCatalogProvider + +Defined in: [platform/integrations.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L39) + +A connectable provider in the catalog (`/v1/hub/providers`). + +#### Indexable + +> \[`k`: `string`\]: `unknown` + +#### Properties + +##### providerId + +> **providerId**: `string` + +Defined in: [platform/integrations.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L40) + +##### title? + +> `optional` **title?**: `string` + +Defined in: [platform/integrations.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L41) + +##### authKind? + +> `optional` **authKind?**: `string` + +Defined in: [platform/integrations.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L42) + +##### category? + +> `optional` **category?**: `string` + +Defined in: [platform/integrations.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L43) + +##### scopes? + +> `optional` **scopes?**: `string`[] + +Defined in: [platform/integrations.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L44) + +##### capabilityCount? + +> `optional` **capabilityCount?**: `number` + +Defined in: [platform/integrations.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L45) + +##### native? + +> `optional` **native?**: `boolean` + +Defined in: [platform/integrations.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L46) + +##### configured? + +> `optional` **configured?**: `boolean` + +Defined in: [platform/integrations.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L49) + +Whether the OAuth app's credentials are wired — the UI offers Connect + only when true. + +*** + +### CatalogResult + +Defined in: [platform/integrations.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L53) + +#### Indexable + +> \[`k`: `string`\]: `unknown` + +#### Properties + +##### providers + +> **providers**: [`PlatformCatalogProvider`](#platformcatalogprovider)[] + +Defined in: [platform/integrations.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L54) + +##### substrateBundled? + +> `optional` **substrateBundled?**: `number` + +Defined in: [platform/integrations.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L56) + +Count of substrate-bundled connectors behind the catalog. + +*** + +### StartAuthInput + +Defined in: [platform/integrations.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L60) + +#### Properties + +##### providerId + +> **providerId**: `string` + +Defined in: [platform/integrations.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L62) + +The provider to connect (goes in the URL path). + +##### connectorId? + +> `optional` **connectorId?**: `string` + +Defined in: [platform/integrations.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L65) + +Accepted for interface compatibility; the platform's start endpoint is + provider-level and does not consume a connector id. + +##### returnUrl + +> **returnUrl**: `string` + +Defined in: [platform/integrations.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L67) + +Where the platform redirects the user back to after OAuth. + +##### requestedScopes? + +> `optional` **requestedScopes?**: `string`[] + +Defined in: [platform/integrations.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L69) + +Accepted for interface compatibility; not consumed by the start endpoint. + +##### cli? + +> `optional` **cli?**: `boolean` + +Defined in: [platform/integrations.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L71) + +CLI flow flag — affects the platform's post-auth redirect handling. + +*** + +### StartAuthResult + +Defined in: [platform/integrations.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L74) + +#### Properties + +##### authorizationUrl + +> **authorizationUrl**: `string` + +Defined in: [platform/integrations.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L78) + +The URL to send the user to. Normalized across the platform's two start + branches: github returns `authorizationUrl`, substrate returns + `redirectUrl`. + +##### state + +> **state**: `string` + +Defined in: [platform/integrations.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L79) + +##### expiresAt? + +> `optional` **expiresAt?**: `string` + +Defined in: [platform/integrations.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L80) + +##### scopes? + +> `optional` **scopes?**: `string`[] + +Defined in: [platform/integrations.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L81) + +*** + +### ConnectionHealth + +Defined in: [platform/integrations.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L84) + +#### Properties + +##### status + +> **status**: `string` & `object` \| `"unknown"` \| `"healthy"` \| `"unhealthy"` \| `"rate_limited"` + +Defined in: [platform/integrations.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L85) + +##### checkedAt + +> **checkedAt**: `string` + +Defined in: [platform/integrations.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L86) + +##### error? + +> `optional` **error?**: `object` + +Defined in: [platform/integrations.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L87) + +###### code + +> **code**: `string` + +###### message + +> **message**: `string` + +*** + +### ConnectionHealthResult + +Defined in: [platform/integrations.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L90) + +#### Properties + +##### connection + +> **connection**: [`PlatformConnection`](#platformconnection) + +Defined in: [platform/integrations.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L91) + +##### health + +> **health**: [`ConnectionHealth`](#connectionhealth) + +Defined in: [platform/integrations.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L92) + +*** + +### HealthCheck + +Defined in: [platform/integrations.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L96) + +Last-known health for a connection, derived from the connection row. + +#### Properties + +##### connectionId + +> **connectionId**: `string` + +Defined in: [platform/integrations.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L97) + +##### providerId + +> **providerId**: `string` + +Defined in: [platform/integrations.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L98) + +##### status + +> **status**: `string` & `object` \| `"unknown"` \| `"healthy"` \| `"unhealthy"` \| `"rate_limited"` + +Defined in: [platform/integrations.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L100) + +Mirrors `PlatformConnection.health`. + +##### checkedAt? + +> `optional` **checkedAt?**: `string` + +Defined in: [platform/integrations.ts:101](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L101) + +*** + +### MintTokenInput + +Defined in: [platform/integrations.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L104) + +#### Properties + +##### actionPath + +> **actionPath**: `string` + +Defined in: [platform/integrations.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L106) + +The hub action the token authorizes (e.g. `slack.chat.postMessage`). + +##### connectionId? + +> `optional` **connectionId?**: `string` + +Defined in: [platform/integrations.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L108) + +Bind to a specific connection, or … + +##### provider? + +> `optional` **provider?**: `string` + +Defined in: [platform/integrations.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L110) + +… resolve the connection by provider for the calling user. + +*** + +### MintTokenResult + +Defined in: [platform/integrations.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L113) + +#### Properties + +##### tokenId + +> **tokenId**: `string` + +Defined in: [platform/integrations.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L114) + +##### token + +> **token**: `string` + +Defined in: [platform/integrations.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L115) + +##### expiresAt + +> **expiresAt**: `string` + +Defined in: [platform/integrations.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L116) + +*** + +### ExecInput + +Defined in: [platform/integrations.ts:119](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L119) + +#### Properties + +##### path + +> **path**: `string` + +Defined in: [platform/integrations.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L121) + +The hub action path to execute. + +##### input? + +> `optional` **input?**: `unknown` + +Defined in: [platform/integrations.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L122) + +##### connectionId? + +> `optional` **connectionId?**: `string` + +Defined in: [platform/integrations.ts:123](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L123) + +*** + +### PlatformHubStatus + +Defined in: [platform/integrations.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L126) + +#### Properties + +##### contract? + +> `optional` **contract?**: `unknown` + +Defined in: [platform/integrations.ts:127](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L127) + +##### principal + +> **principal**: `object` + +Defined in: [platform/integrations.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L128) + +###### Index Signature + +\[`k`: `string`\]: `unknown` + +###### kind + +> **kind**: `string` + +###### userId + +> **userId**: `string` + +##### connections + +> **connections**: `object` + +Defined in: [platform/integrations.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L129) + +###### connectedProviderCount + +> **connectedProviderCount**: `number` + +###### unhealthyProviderCount + +> **unhealthyProviderCount**: `number` diff --git a/docs/api/platform/README.md b/docs/api/platform/README.md deleted file mode 100644 index 7000e63..0000000 --- a/docs/api/platform/README.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../README.md) - -*** - -[@tangle-network/agent-runtime](../README.md) / platform - -# platform - -## Classes - -- [PlatformAuthError](classes/PlatformAuthError.md) -- [PlatformAuthClient](classes/PlatformAuthClient.md) -- [PlatformHubError](classes/PlatformHubError.md) -- [PlatformHubClient](classes/PlatformHubClient.md) - -## Interfaces - -- [PlatformAuthClientOptions](interfaces/PlatformAuthClientOptions.md) -- [AuthorizeUrlOptions](interfaces/AuthorizeUrlOptions.md) -- [ExchangeCodeResult](interfaces/ExchangeCodeResult.md) -- [PlatformHubClientOptions](interfaces/PlatformHubClientOptions.md) -- [PlatformConnection](interfaces/PlatformConnection.md) -- [PlatformCatalogProvider](interfaces/PlatformCatalogProvider.md) -- [CatalogResult](interfaces/CatalogResult.md) -- [StartAuthInput](interfaces/StartAuthInput.md) -- [StartAuthResult](interfaces/StartAuthResult.md) -- [ConnectionHealth](interfaces/ConnectionHealth.md) -- [ConnectionHealthResult](interfaces/ConnectionHealthResult.md) -- [HealthCheck](interfaces/HealthCheck.md) -- [MintTokenInput](interfaces/MintTokenInput.md) -- [MintTokenResult](interfaces/MintTokenResult.md) -- [ExecInput](interfaces/ExecInput.md) -- [PlatformHubStatus](interfaces/PlatformHubStatus.md) diff --git a/docs/api/platform/classes/PlatformAuthClient.md b/docs/api/platform/classes/PlatformAuthClient.md deleted file mode 100644 index de9adc2..0000000 --- a/docs/api/platform/classes/PlatformAuthClient.md +++ /dev/null @@ -1,80 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / PlatformAuthClient - -# Class: PlatformAuthClient - -Defined in: [platform/auth.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L61) - -`@tangle-network/agent-runtime/platform` — typed server-side clients -for the Tangle platform's cross-site SSO bridge and integrations -hub. Apps consume these to avoid rolling their own OAuth, session, -and connection storage. - -See: - - PlatformAuthClient for "Login with Tangle" - - [PlatformHubClient](PlatformHubClient.md) for the `/v1/hub/*` surface - -## Constructors - -### Constructor - -> **new PlatformAuthClient**(`options`): `PlatformAuthClient` - -Defined in: [platform/auth.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L66) - -#### Parameters - -##### options - -[`PlatformAuthClientOptions`](../interfaces/PlatformAuthClientOptions.md) - -#### Returns - -`PlatformAuthClient` - -## Methods - -### authorizeUrl() - -> **authorizeUrl**(`options`): `string` - -Defined in: [platform/auth.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L81) - -Build the URL the user is redirected to in order to start SSO. -The platform redirects back to one of `appId`'s registered -`redirectUris` with `?code=...&app=...&state=...`. - -#### Parameters - -##### options - -[`AuthorizeUrlOptions`](../interfaces/AuthorizeUrlOptions.md) - -#### Returns - -`string` - -*** - -### exchange() - -> **exchange**(`code`): `Promise`\<[`ExchangeCodeResult`](../interfaces/ExchangeCodeResult.md)\> - -Defined in: [platform/auth.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L99) - -Exchange a single-use auth code (delivered to the consumer's -callback by the platform) for an API key + the user's identity. -Codes are single-use and expire ~5 minutes after issue. - -#### Parameters - -##### code - -`string` - -#### Returns - -`Promise`\<[`ExchangeCodeResult`](../interfaces/ExchangeCodeResult.md)\> diff --git a/docs/api/platform/classes/PlatformAuthError.md b/docs/api/platform/classes/PlatformAuthError.md deleted file mode 100644 index 96946f2..0000000 --- a/docs/api/platform/classes/PlatformAuthError.md +++ /dev/null @@ -1,68 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / PlatformAuthError - -# Class: PlatformAuthError - -Defined in: [platform/auth.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L50) - -`@tangle-network/agent-runtime/platform` — typed server-side clients -for the Tangle platform's cross-site SSO bridge and integrations -hub. Apps consume these to avoid rolling their own OAuth, session, -and connection storage. - -See: - - [PlatformAuthClient](PlatformAuthClient.md) for "Login with Tangle" - - [PlatformHubClient](PlatformHubClient.md) for the `/v1/hub/*` surface - -## Extends - -- `Error` - -## Constructors - -### Constructor - -> **new PlatformAuthError**(`message`, `status`, `body`): `PlatformAuthError` - -Defined in: [platform/auth.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L51) - -#### Parameters - -##### message - -`string` - -##### status - -`number` - -##### body - -`unknown` - -#### Returns - -`PlatformAuthError` - -#### Overrides - -`Error.constructor` - -## Properties - -### status - -> `readonly` **status**: `number` - -Defined in: [platform/auth.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L53) - -*** - -### body - -> `readonly` **body**: `unknown` - -Defined in: [platform/auth.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L54) diff --git a/docs/api/platform/classes/PlatformHubClient.md b/docs/api/platform/classes/PlatformHubClient.md deleted file mode 100644 index 93cf964..0000000 --- a/docs/api/platform/classes/PlatformHubClient.md +++ /dev/null @@ -1,207 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / PlatformHubClient - -# Class: PlatformHubClient - -Defined in: [platform/integrations.ts:150](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L150) - -## Constructors - -### Constructor - -> **new PlatformHubClient**(`options`): `PlatformHubClient` - -Defined in: [platform/integrations.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L155) - -#### Parameters - -##### options - -[`PlatformHubClientOptions`](../interfaces/PlatformHubClientOptions.md) - -#### Returns - -`PlatformHubClient` - -## Methods - -### catalog() - -> **catalog**(): `Promise`\<[`CatalogResult`](../interfaces/CatalogResult.md)\> - -Defined in: [platform/integrations.ts:166](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L166) - -GET /v1/hub/providers — the connectable provider catalog. - -#### Returns - -`Promise`\<[`CatalogResult`](../interfaces/CatalogResult.md)\> - -*** - -### listConnections() - -> **listConnections**(): `Promise`\<[`PlatformConnection`](../interfaces/PlatformConnection.md)[]\> - -Defined in: [platform/integrations.ts:171](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L171) - -GET /v1/hub/connections — the calling user's live connections. - -#### Returns - -`Promise`\<[`PlatformConnection`](../interfaces/PlatformConnection.md)[]\> - -*** - -### revokeConnection() - -> **revokeConnection**(`connectionId`): `Promise`\<\{ `connection`: [`PlatformConnection`](../interfaces/PlatformConnection.md); \}\> - -Defined in: [platform/integrations.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L180) - -DELETE /v1/hub/connections/:connectionId — revoke + disable a connection. - -#### Parameters - -##### connectionId - -`string` - -#### Returns - -`Promise`\<\{ `connection`: [`PlatformConnection`](../interfaces/PlatformConnection.md); \}\> - -*** - -### startAuth() - -> **startAuth**(`input`): `Promise`\<[`StartAuthResult`](../interfaces/StartAuthResult.md)\> - -Defined in: [platform/integrations.ts:190](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L190) - -POST /v1/hub/connections/:provider/start — begin OAuth/grant. The provider -is taken from the URL; the body carries `returnUrl` (+ `cli`). The platform's -two start branches name the URL field differently (github → `authorizationUrl`, -substrate → `redirectUrl`); this normalizes to `authorizationUrl`. - -#### Parameters - -##### input - -[`StartAuthInput`](../interfaces/StartAuthInput.md) - -#### Returns - -`Promise`\<[`StartAuthResult`](../interfaces/StartAuthResult.md)\> - -*** - -### listHealthchecks() - -> **listHealthchecks**(): `Promise`\<[`HealthCheck`](../interfaces/HealthCheck.md)[]\> - -Defined in: [platform/integrations.ts:217](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L217) - -Last-known health for every connection. The platform has no global -healthcheck listing — health rides on each connection row — so this derives -the list from `listConnections()` (one request, no extra round-trips). - -#### Returns - -`Promise`\<[`HealthCheck`](../interfaces/HealthCheck.md)[]\> - -*** - -### checkConnectionHealth() - -> **checkConnectionHealth**(`connectionId`): `Promise`\<[`ConnectionHealthResult`](../interfaces/ConnectionHealthResult.md)\> - -Defined in: [platform/integrations.ts:231](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L231) - -POST /v1/hub/connections/:connectionId/health — trigger a fresh health -probe for one connection and return its updated state. - -#### Parameters - -##### connectionId - -`string` - -#### Returns - -`Promise`\<[`ConnectionHealthResult`](../interfaces/ConnectionHealthResult.md)\> - -*** - -### runHealthchecks() - -> **runHealthchecks**(): `Promise`\<\{ `scheduled`: `number`; \}\> - -Defined in: [platform/integrations.ts:240](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L240) - -Trigger a fresh health probe across all of the user's connections. The -platform exposes health per-connection only, so this fans out over -`listConnections()`. `scheduled` is the number of probes dispatched. - -#### Returns - -`Promise`\<\{ `scheduled`: `number`; \}\> - -*** - -### status() - -> **status**(): `Promise`\<[`PlatformHubStatus`](../interfaces/PlatformHubStatus.md)\> - -Defined in: [platform/integrations.ts:247](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L247) - -GET /v1/hub/status — principal + aggregate connection counts. - -#### Returns - -`Promise`\<[`PlatformHubStatus`](../interfaces/PlatformHubStatus.md)\> - -*** - -### mintToken() - -> **mintToken**(`input`): `Promise`\<[`MintTokenResult`](../interfaces/MintTokenResult.md)\> - -Defined in: [platform/integrations.ts:256](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L256) - -POST /v1/hub/tokens — mint a short-lived, action-scoped capability token a -sandbox can use to invoke one hub action on the user's behalf without -seeing the underlying provider credential. - -#### Parameters - -##### input - -[`MintTokenInput`](../interfaces/MintTokenInput.md) - -#### Returns - -`Promise`\<[`MintTokenResult`](../interfaces/MintTokenResult.md)\> - -*** - -### exec() - -> **exec**(`input`): `Promise`\<`unknown`\> - -Defined in: [platform/integrations.ts:261](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L261) - -POST /v1/hub/exec — execute a hub action and return its result. - -#### Parameters - -##### input - -[`ExecInput`](../interfaces/ExecInput.md) - -#### Returns - -`Promise`\<`unknown`\> diff --git a/docs/api/platform/classes/PlatformHubError.md b/docs/api/platform/classes/PlatformHubError.md deleted file mode 100644 index 1ef1640..0000000 --- a/docs/api/platform/classes/PlatformHubError.md +++ /dev/null @@ -1,71 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / PlatformHubError - -# Class: PlatformHubError - -Defined in: [platform/integrations.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L132) - -## Extends - -- `Error` - -## Constructors - -### Constructor - -> **new PlatformHubError**(`message`, `status`, `code`, `body`): `PlatformHubError` - -Defined in: [platform/integrations.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L133) - -#### Parameters - -##### message - -`string` - -##### status - -`number` - -##### code - -`string` \| `undefined` - -##### body - -`unknown` - -#### Returns - -`PlatformHubError` - -#### Overrides - -`Error.constructor` - -## Properties - -### status - -> `readonly` **status**: `number` - -Defined in: [platform/integrations.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L135) - -*** - -### code - -> `readonly` **code**: `string` \| `undefined` - -Defined in: [platform/integrations.ts:136](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L136) - -*** - -### body - -> `readonly` **body**: `unknown` - -Defined in: [platform/integrations.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L137) diff --git a/docs/api/platform/interfaces/AuthorizeUrlOptions.md b/docs/api/platform/interfaces/AuthorizeUrlOptions.md deleted file mode 100644 index c76f7b2..0000000 --- a/docs/api/platform/interfaces/AuthorizeUrlOptions.md +++ /dev/null @@ -1,59 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / AuthorizeUrlOptions - -# Interface: AuthorizeUrlOptions - -Defined in: [platform/auth.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L24) - -`@tangle-network/agent-runtime/platform` — typed server-side clients -for the Tangle platform's cross-site SSO bridge and integrations -hub. Apps consume these to avoid rolling their own OAuth, session, -and connection storage. - -See: - - [PlatformAuthClient](../classes/PlatformAuthClient.md) for "Login with Tangle" - - [PlatformHubClient](../classes/PlatformHubClient.md) for the `/v1/hub/*` surface - -## Properties - -### state - -> **state**: `string` - -Defined in: [platform/auth.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L26) - -Required CSRF token; the consumer verifies it on the callback. - -*** - -### redirectUri? - -> `optional` **redirectUri?**: `string` - -Defined in: [platform/auth.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L31) - -Final redirect URI. Must be one of the URIs registered for `appId` -on the platform. Omit to use the first registered URI. - -*** - -### prompt? - -> `optional` **prompt?**: `"login"` - -Defined in: [platform/auth.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L33) - -Force the login screen even if a session is already active. - -*** - -### email? - -> `optional` **email?**: `string` - -Defined in: [platform/auth.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L35) - -Pre-fill the email field on the login screen. diff --git a/docs/api/platform/interfaces/CatalogResult.md b/docs/api/platform/interfaces/CatalogResult.md deleted file mode 100644 index a8dfd0a..0000000 --- a/docs/api/platform/interfaces/CatalogResult.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / CatalogResult - -# Interface: CatalogResult - -Defined in: [platform/integrations.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L53) - -## Indexable - -> \[`k`: `string`\]: `unknown` - -## Properties - -### providers - -> **providers**: [`PlatformCatalogProvider`](PlatformCatalogProvider.md)[] - -Defined in: [platform/integrations.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L54) - -*** - -### substrateBundled? - -> `optional` **substrateBundled?**: `number` - -Defined in: [platform/integrations.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L56) - -Count of substrate-bundled connectors behind the catalog. diff --git a/docs/api/platform/interfaces/ConnectionHealth.md b/docs/api/platform/interfaces/ConnectionHealth.md deleted file mode 100644 index 830113b..0000000 --- a/docs/api/platform/interfaces/ConnectionHealth.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / ConnectionHealth - -# Interface: ConnectionHealth - -Defined in: [platform/integrations.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L84) - -## Properties - -### status - -> **status**: `string` & `object` \| `"unknown"` \| `"healthy"` \| `"unhealthy"` \| `"rate_limited"` - -Defined in: [platform/integrations.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L85) - -*** - -### checkedAt - -> **checkedAt**: `string` - -Defined in: [platform/integrations.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L86) - -*** - -### error? - -> `optional` **error?**: `object` - -Defined in: [platform/integrations.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L87) - -#### code - -> **code**: `string` - -#### message - -> **message**: `string` diff --git a/docs/api/platform/interfaces/ConnectionHealthResult.md b/docs/api/platform/interfaces/ConnectionHealthResult.md deleted file mode 100644 index 6925c47..0000000 --- a/docs/api/platform/interfaces/ConnectionHealthResult.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / ConnectionHealthResult - -# Interface: ConnectionHealthResult - -Defined in: [platform/integrations.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L90) - -## Properties - -### connection - -> **connection**: [`PlatformConnection`](PlatformConnection.md) - -Defined in: [platform/integrations.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L91) - -*** - -### health - -> **health**: [`ConnectionHealth`](ConnectionHealth.md) - -Defined in: [platform/integrations.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L92) diff --git a/docs/api/platform/interfaces/ExchangeCodeResult.md b/docs/api/platform/interfaces/ExchangeCodeResult.md deleted file mode 100644 index 4cb6ed6..0000000 --- a/docs/api/platform/interfaces/ExchangeCodeResult.md +++ /dev/null @@ -1,58 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / ExchangeCodeResult - -# Interface: ExchangeCodeResult - -Defined in: [platform/auth.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L38) - -`@tangle-network/agent-runtime/platform` — typed server-side clients -for the Tangle platform's cross-site SSO bridge and integrations -hub. Apps consume these to avoid rolling their own OAuth, session, -and connection storage. - -See: - - [PlatformAuthClient](../classes/PlatformAuthClient.md) for "Login with Tangle" - - [PlatformHubClient](../classes/PlatformHubClient.md) for the `/v1/hub/*` surface - -## Properties - -### apiKey - -> **apiKey**: `string` - -Defined in: [platform/auth.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L39) - -*** - -### user - -> **user**: `object` - -Defined in: [platform/auth.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L40) - -#### id - -> **id**: `string` - -#### email - -> **email**: `string` - -#### name? - -> `optional` **name?**: `string` - -*** - -### plan - -> **plan**: `object` - -Defined in: [platform/auth.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L45) - -#### tier - -> **tier**: `string` diff --git a/docs/api/platform/interfaces/ExecInput.md b/docs/api/platform/interfaces/ExecInput.md deleted file mode 100644 index cca684c..0000000 --- a/docs/api/platform/interfaces/ExecInput.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / ExecInput - -# Interface: ExecInput - -Defined in: [platform/integrations.ts:119](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L119) - -## Properties - -### path - -> **path**: `string` - -Defined in: [platform/integrations.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L121) - -The hub action path to execute. - -*** - -### input? - -> `optional` **input?**: `unknown` - -Defined in: [platform/integrations.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L122) - -*** - -### connectionId? - -> `optional` **connectionId?**: `string` - -Defined in: [platform/integrations.ts:123](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L123) diff --git a/docs/api/platform/interfaces/HealthCheck.md b/docs/api/platform/interfaces/HealthCheck.md deleted file mode 100644 index 46c99f4..0000000 --- a/docs/api/platform/interfaces/HealthCheck.md +++ /dev/null @@ -1,45 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / HealthCheck - -# Interface: HealthCheck - -Defined in: [platform/integrations.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L96) - -Last-known health for a connection, derived from the connection row. - -## Properties - -### connectionId - -> **connectionId**: `string` - -Defined in: [platform/integrations.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L97) - -*** - -### providerId - -> **providerId**: `string` - -Defined in: [platform/integrations.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L98) - -*** - -### status - -> **status**: `string` & `object` \| `"unknown"` \| `"healthy"` \| `"unhealthy"` \| `"rate_limited"` - -Defined in: [platform/integrations.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L100) - -Mirrors `PlatformConnection.health`. - -*** - -### checkedAt? - -> `optional` **checkedAt?**: `string` - -Defined in: [platform/integrations.ts:101](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L101) diff --git a/docs/api/platform/interfaces/MintTokenInput.md b/docs/api/platform/interfaces/MintTokenInput.md deleted file mode 100644 index d0fc989..0000000 --- a/docs/api/platform/interfaces/MintTokenInput.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / MintTokenInput - -# Interface: MintTokenInput - -Defined in: [platform/integrations.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L104) - -## Properties - -### actionPath - -> **actionPath**: `string` - -Defined in: [platform/integrations.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L106) - -The hub action the token authorizes (e.g. `slack.chat.postMessage`). - -*** - -### connectionId? - -> `optional` **connectionId?**: `string` - -Defined in: [platform/integrations.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L108) - -Bind to a specific connection, or … - -*** - -### provider? - -> `optional` **provider?**: `string` - -Defined in: [platform/integrations.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L110) - -… resolve the connection by provider for the calling user. diff --git a/docs/api/platform/interfaces/MintTokenResult.md b/docs/api/platform/interfaces/MintTokenResult.md deleted file mode 100644 index 2d8f72f..0000000 --- a/docs/api/platform/interfaces/MintTokenResult.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / MintTokenResult - -# Interface: MintTokenResult - -Defined in: [platform/integrations.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L113) - -## Properties - -### tokenId - -> **tokenId**: `string` - -Defined in: [platform/integrations.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L114) - -*** - -### token - -> **token**: `string` - -Defined in: [platform/integrations.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L115) - -*** - -### expiresAt - -> **expiresAt**: `string` - -Defined in: [platform/integrations.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L116) diff --git a/docs/api/platform/interfaces/PlatformAuthClientOptions.md b/docs/api/platform/interfaces/PlatformAuthClientOptions.md deleted file mode 100644 index 2390f3c..0000000 --- a/docs/api/platform/interfaces/PlatformAuthClientOptions.md +++ /dev/null @@ -1,65 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / PlatformAuthClientOptions - -# Interface: PlatformAuthClientOptions - -Defined in: [platform/auth.ts:15](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L15) - -Server-side client for the Tangle platform's cross-site SSO bridge. - -Consumer apps (gtm-agent, tax-agent, legal-agent, creative-agent, …) -use this to: - 1. Build an /authorize URL that lands the user on id.tangle.tools - and brings them back with a single-use code. - 2. Exchange that code for an API key + the user's identity. - -The platform endpoint contract is documented in -`products/platform/api/src/routes/cross-site.ts`. This client only -speaks HTTP — no SDK weight, no transitive deps. - -## Properties - -### baseUrl - -> **baseUrl**: `string` - -Defined in: [platform/auth.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L17) - -Platform base URL, e.g. `https://id.tangle.tools`. - -*** - -### appId - -> **appId**: `string` - -Defined in: [platform/auth.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L19) - -App id as registered in the platform's TRUSTED_APPS registry. - -*** - -### fetchImpl? - -> `optional` **fetchImpl?**: (`input`, `init?`) => `Promise`\<`Response`\> - -Defined in: [platform/auth.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/auth.ts#L21) - -Override the global fetch (useful for tests + edge runtimes). - -#### Parameters - -##### input - -`string` \| `URL` \| `Request` - -##### init? - -`RequestInit` - -#### Returns - -`Promise`\<`Response`\> diff --git a/docs/api/platform/interfaces/PlatformCatalogProvider.md b/docs/api/platform/interfaces/PlatformCatalogProvider.md deleted file mode 100644 index 51be762..0000000 --- a/docs/api/platform/interfaces/PlatformCatalogProvider.md +++ /dev/null @@ -1,82 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / PlatformCatalogProvider - -# Interface: PlatformCatalogProvider - -Defined in: [platform/integrations.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L39) - -A connectable provider in the catalog (`/v1/hub/providers`). - -## Indexable - -> \[`k`: `string`\]: `unknown` - -## Properties - -### providerId - -> **providerId**: `string` - -Defined in: [platform/integrations.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L40) - -*** - -### title? - -> `optional` **title?**: `string` - -Defined in: [platform/integrations.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L41) - -*** - -### authKind? - -> `optional` **authKind?**: `string` - -Defined in: [platform/integrations.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L42) - -*** - -### category? - -> `optional` **category?**: `string` - -Defined in: [platform/integrations.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L43) - -*** - -### scopes? - -> `optional` **scopes?**: `string`[] - -Defined in: [platform/integrations.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L44) - -*** - -### capabilityCount? - -> `optional` **capabilityCount?**: `number` - -Defined in: [platform/integrations.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L45) - -*** - -### native? - -> `optional` **native?**: `boolean` - -Defined in: [platform/integrations.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L46) - -*** - -### configured? - -> `optional` **configured?**: `boolean` - -Defined in: [platform/integrations.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L49) - -Whether the OAuth app's credentials are wired — the UI offers Connect - only when true. diff --git a/docs/api/platform/interfaces/PlatformConnection.md b/docs/api/platform/interfaces/PlatformConnection.md deleted file mode 100644 index 1ede818..0000000 --- a/docs/api/platform/interfaces/PlatformConnection.md +++ /dev/null @@ -1,91 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / PlatformConnection - -# Interface: PlatformConnection - -Defined in: [platform/integrations.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L25) - -A live integration connection, as returned by `/v1/hub/connections`. - -## Properties - -### id - -> **id**: `string` - -Defined in: [platform/integrations.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L26) - -*** - -### providerId - -> **providerId**: `string` - -Defined in: [platform/integrations.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L27) - -*** - -### displayName - -> **displayName**: `string` - -Defined in: [platform/integrations.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L28) - -*** - -### accountDisplay - -> **accountDisplay**: `string` \| `null` - -Defined in: [platform/integrations.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L29) - -*** - -### scopes - -> **scopes**: `string`[] - -Defined in: [platform/integrations.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L30) - -*** - -### status - -> **status**: `string` & `object` \| `"unhealthy"` \| `"active"` \| `"revoked"` \| `"reconnect_required"` - -Defined in: [platform/integrations.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L31) - -*** - -### health - -> **health**: `string` & `object` \| `"unknown"` \| `"healthy"` \| `"unhealthy"` \| `"rate_limited"` - -Defined in: [platform/integrations.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L32) - -*** - -### createdAt - -> **createdAt**: `string` - -Defined in: [platform/integrations.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L33) - -*** - -### updatedAt - -> **updatedAt**: `string` - -Defined in: [platform/integrations.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L34) - -*** - -### lastUsedAt - -> **lastUsedAt**: `string` \| `null` - -Defined in: [platform/integrations.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L35) diff --git a/docs/api/platform/interfaces/PlatformHubClientOptions.md b/docs/api/platform/interfaces/PlatformHubClientOptions.md deleted file mode 100644 index 601e88f..0000000 --- a/docs/api/platform/interfaces/PlatformHubClientOptions.md +++ /dev/null @@ -1,65 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / PlatformHubClientOptions - -# Interface: PlatformHubClientOptions - -Defined in: [platform/integrations.ts:15](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L15) - -Server-side client for the Tangle platform's integration hub -(`/v1/hub/*`). Consumer apps use this instead of rolling their own -OAuth + connection tables. - -Auth: the caller supplies a bearer (either the user's API key from -cross-site exchange, or a platform service token) on construction. - -Endpoint contract (authoritative): the platform's `src/lib/hub-contract.ts` -+ `src/routes/hub.ts`. The platform wraps every response in -`{ success, data }`; non-2xx or `success:false` surfaces as `PlatformHubError` -carrying the real upstream status. - -## Properties - -### baseUrl - -> **baseUrl**: `string` - -Defined in: [platform/integrations.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L17) - -Platform base URL, e.g. `https://id.tangle.tools`. - -*** - -### bearer - -> **bearer**: `string` - -Defined in: [platform/integrations.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L19) - -Bearer credential — user API key or service token. - -*** - -### fetchImpl? - -> `optional` **fetchImpl?**: (`input`, `init?`) => `Promise`\<`Response`\> - -Defined in: [platform/integrations.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L21) - -Override fetch (tests + edge runtimes). - -#### Parameters - -##### input - -`string` \| `URL` \| `Request` - -##### init? - -`RequestInit` - -#### Returns - -`Promise`\<`Response`\> diff --git a/docs/api/platform/interfaces/PlatformHubStatus.md b/docs/api/platform/interfaces/PlatformHubStatus.md deleted file mode 100644 index ee35a44..0000000 --- a/docs/api/platform/interfaces/PlatformHubStatus.md +++ /dev/null @@ -1,53 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / PlatformHubStatus - -# Interface: PlatformHubStatus - -Defined in: [platform/integrations.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L126) - -## Properties - -### contract? - -> `optional` **contract?**: `unknown` - -Defined in: [platform/integrations.ts:127](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L127) - -*** - -### principal - -> **principal**: `object` - -Defined in: [platform/integrations.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L128) - -#### Index Signature - -\[`k`: `string`\]: `unknown` - -#### kind - -> **kind**: `string` - -#### userId - -> **userId**: `string` - -*** - -### connections - -> **connections**: `object` - -Defined in: [platform/integrations.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L129) - -#### connectedProviderCount - -> **connectedProviderCount**: `number` - -#### unhealthyProviderCount - -> **unhealthyProviderCount**: `number` diff --git a/docs/api/platform/interfaces/StartAuthInput.md b/docs/api/platform/interfaces/StartAuthInput.md deleted file mode 100644 index 8ac504f..0000000 --- a/docs/api/platform/interfaces/StartAuthInput.md +++ /dev/null @@ -1,60 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / StartAuthInput - -# Interface: StartAuthInput - -Defined in: [platform/integrations.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L60) - -## Properties - -### providerId - -> **providerId**: `string` - -Defined in: [platform/integrations.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L62) - -The provider to connect (goes in the URL path). - -*** - -### connectorId? - -> `optional` **connectorId?**: `string` - -Defined in: [platform/integrations.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L65) - -Accepted for interface compatibility; the platform's start endpoint is - provider-level and does not consume a connector id. - -*** - -### returnUrl - -> **returnUrl**: `string` - -Defined in: [platform/integrations.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L67) - -Where the platform redirects the user back to after OAuth. - -*** - -### requestedScopes? - -> `optional` **requestedScopes?**: `string`[] - -Defined in: [platform/integrations.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L69) - -Accepted for interface compatibility; not consumed by the start endpoint. - -*** - -### cli? - -> `optional` **cli?**: `boolean` - -Defined in: [platform/integrations.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L71) - -CLI flow flag — affects the platform's post-auth redirect handling. diff --git a/docs/api/platform/interfaces/StartAuthResult.md b/docs/api/platform/interfaces/StartAuthResult.md deleted file mode 100644 index 6b93dd4..0000000 --- a/docs/api/platform/interfaces/StartAuthResult.md +++ /dev/null @@ -1,45 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [platform](../README.md) / StartAuthResult - -# Interface: StartAuthResult - -Defined in: [platform/integrations.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L74) - -## Properties - -### authorizationUrl - -> **authorizationUrl**: `string` - -Defined in: [platform/integrations.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L78) - -The URL to send the user to. Normalized across the platform's two start - branches: github returns `authorizationUrl`, substrate returns - `redirectUrl`. - -*** - -### state - -> **state**: `string` - -Defined in: [platform/integrations.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L79) - -*** - -### expiresAt? - -> `optional` **expiresAt?**: `string` - -Defined in: [platform/integrations.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L80) - -*** - -### scopes? - -> `optional` **scopes?**: `string`[] - -Defined in: [platform/integrations.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/platform/integrations.ts#L81) diff --git a/docs/api/profiles.md b/docs/api/profiles.md new file mode 100644 index 0000000..45afff6 --- /dev/null +++ b/docs/api/profiles.md @@ -0,0 +1,1395 @@ +[**@tangle-network/agent-runtime**](README.md) + +*** + +[@tangle-network/agent-runtime](README.md) / profiles + +# profiles + +## Interfaces + +### CoderTask + +Defined in: [profiles/coder.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L20) + +**`Experimental`** + +The per-task inputs `coderTaskToPrompt` renders + the worktree gate enforces. + +#### Properties + +##### goal + +> **goal**: `string` + +Defined in: [profiles/coder.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L22) + +**`Experimental`** + +What the agent must accomplish. Free-form prose. + +##### repoRoot + +> **repoRoot**: `string` + +Defined in: [profiles/coder.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L24) + +**`Experimental`** + +Absolute path inside the sandbox where the repo lives. + +##### baseBranch? + +> `optional` **baseBranch?**: `string` + +Defined in: [profiles/coder.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L26) + +**`Experimental`** + +Default `main`. The branch the agent diffs against. + +##### testCmd? + +> `optional` **testCmd?**: `string` + +Defined in: [profiles/coder.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L28) + +**`Experimental`** + +Default `pnpm test --run`. + +##### typecheckCmd? + +> `optional` **typecheckCmd?**: `string` + +Defined in: [profiles/coder.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L30) + +**`Experimental`** + +Default `pnpm typecheck`. + +##### contextFiles? + +> `optional` **contextFiles?**: `string`[] + +Defined in: [profiles/coder.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L32) + +**`Experimental`** + +Files the agent may inspect for context. Surfaced verbatim in the prompt. + +##### forbiddenPaths? + +> `optional` **forbiddenPaths?**: `string`[] + +Defined in: [profiles/coder.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L37) + +**`Experimental`** + +Paths the agent must not touch. The mechanical gate hard-fails on any match. +Use glob-free literal path prefixes for unambiguous enforcement. + +##### maxDiffLines? + +> `optional` **maxDiffLines?**: `number` + +Defined in: [profiles/coder.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L39) + +**`Experimental`** + +Default 400. Hard cap; the gate hard-fails when exceeded. + +*** + +### InProcessUiAuditClientOptions + +Defined in: [profiles/ui-auditor/in-process-client.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L45) + +**`Experimental`** + +#### Properties + +##### workspaceDir + +> **workspaceDir**: `string` + +Defined in: [profiles/ui-auditor/in-process-client.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L51) + +**`Experimental`** + +Absolute path under which screenshots are written. Each capture lands +at `/screenshots/`; finding screenshot paths +are workspace-relative (`screenshots/`). + +##### judge + +> **judge**: [`UiJudge`](#uijudge) + +Defined in: [profiles/ui-auditor/in-process-client.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L53) + +**`Experimental`** + +The vision judge that turns captures into findings. + +##### navPolicy? + +> `optional` **navPolicy?**: `"strict"` \| `"spa"` + +Defined in: [profiles/ui-auditor/in-process-client.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L62) + +**`Experimental`** + +Navigation policy. + +`'strict'` (default) waits for `networkidle` and fails the iteration +if the page does not settle. `'spa'` waits for `domcontentloaded` — +use for single-page apps that hold open long-poll/websocket +connections and never settle. + +##### launchBrowser? + +> `optional` **launchBrowser?**: () => `Promise`\<[`BrowserHandle`](#browserhandle)\> + +Defined in: [profiles/ui-auditor/in-process-client.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L68) + +**`Experimental`** + +Browser launch override. Default: chromium headless via Playwright. +Consumers pass a custom factory to target a remote browser, a +different channel, or a fleet adapter. + +###### Returns + +`Promise`\<[`BrowserHandle`](#browserhandle)\> + +*** + +### BrowserHandle + +Defined in: [profiles/ui-auditor/in-process-client.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L72) + +**`Experimental`** + +#### Methods + +##### newContext() + +> **newContext**(`options?`): `Promise`\<[`BrowserContextHandle`](#browsercontexthandle)\> + +Defined in: [profiles/ui-auditor/in-process-client.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L73) + +**`Experimental`** + +###### Parameters + +###### options? + +###### viewport? + +\{ `width`: `number`; `height`: `number`; \} + +###### viewport.width + +`number` + +###### viewport.height + +`number` + +###### Returns + +`Promise`\<[`BrowserContextHandle`](#browsercontexthandle)\> + +##### close() + +> **close**(): `Promise`\<`void`\> + +Defined in: [profiles/ui-auditor/in-process-client.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L76) + +**`Experimental`** + +###### Returns + +`Promise`\<`void`\> + +*** + +### BrowserContextHandle + +Defined in: [profiles/ui-auditor/in-process-client.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L80) + +**`Experimental`** + +#### Methods + +##### newPage() + +> **newPage**(): `Promise`\<[`PageHandle`](#pagehandle)\> + +Defined in: [profiles/ui-auditor/in-process-client.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L81) + +**`Experimental`** + +###### Returns + +`Promise`\<[`PageHandle`](#pagehandle)\> + +##### close() + +> **close**(): `Promise`\<`void`\> + +Defined in: [profiles/ui-auditor/in-process-client.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L82) + +**`Experimental`** + +###### Returns + +`Promise`\<`void`\> + +*** + +### PageHandle + +Defined in: [profiles/ui-auditor/in-process-client.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L86) + +**`Experimental`** + +#### Methods + +##### setViewportSize() + +> **setViewportSize**(`size`): `Promise`\<`void`\> + +Defined in: [profiles/ui-auditor/in-process-client.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L87) + +**`Experimental`** + +###### Parameters + +###### size + +###### width + +`number` + +###### height + +`number` + +###### Returns + +`Promise`\<`void`\> + +##### goto() + +> **goto**(`url`, `options?`): `Promise`\<`unknown`\> + +Defined in: [profiles/ui-auditor/in-process-client.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L88) + +**`Experimental`** + +###### Parameters + +###### url + +`string` + +###### options? + +###### waitUntil? + +`string` + +###### timeout? + +`number` + +###### Returns + +`Promise`\<`unknown`\> + +##### waitForSelector() + +> **waitForSelector**(`selector`, `options?`): `Promise`\<`unknown`\> + +Defined in: [profiles/ui-auditor/in-process-client.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L89) + +**`Experimental`** + +###### Parameters + +###### selector + +`string` + +###### options? + +###### timeout? + +`number` + +###### Returns + +`Promise`\<`unknown`\> + +##### waitForTimeout() + +> **waitForTimeout**(`ms`): `Promise`\<`void`\> + +Defined in: [profiles/ui-auditor/in-process-client.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L90) + +**`Experimental`** + +###### Parameters + +###### ms + +`number` + +###### Returns + +`Promise`\<`void`\> + +##### screenshot() + +> **screenshot**(`options`): `Promise`\<`void`\> + +Defined in: [profiles/ui-auditor/in-process-client.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L91) + +**`Experimental`** + +###### Parameters + +###### options + +###### path + +`string` + +###### fullPage? + +`boolean` + +###### Returns + +`Promise`\<`void`\> + +##### locator() + +> **locator**(`selector`): `object` + +Defined in: [profiles/ui-auditor/in-process-client.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L92) + +**`Experimental`** + +###### Parameters + +###### selector + +`string` + +###### Returns + +`object` + +###### first() + +> **first**(): `object` + +###### Returns + +`object` + +###### screenshot() + +> **screenshot**(`options`): `Promise`\<`void`\> + +###### Parameters + +###### options + +###### path + +`string` + +###### Returns + +`Promise`\<`void`\> + +*** + +### UiJudgeTokenUsage + +Defined in: [profiles/ui-auditor/judge.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L30) + +**`Experimental`** + +#### Properties + +##### input + +> **input**: `number` + +Defined in: [profiles/ui-auditor/judge.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L31) + +**`Experimental`** + +##### output + +> **output**: `number` + +Defined in: [profiles/ui-auditor/judge.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L32) + +**`Experimental`** + +*** + +### UiJudgeInput + +Defined in: [profiles/ui-auditor/judge.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L36) + +**`Experimental`** + +#### Properties + +##### lens + +> **lens**: [`UiLens`](#uilens) + +Defined in: [profiles/ui-auditor/judge.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L37) + +**`Experimental`** + +##### captures + +> **captures**: readonly [`UiAuditCapture`](#uiauditcapture)[] + +Defined in: [profiles/ui-auditor/judge.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L38) + +**`Experimental`** + +##### productContext? + +> `optional` **productContext?**: `string` + +Defined in: [profiles/ui-auditor/judge.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L40) + +**`Experimental`** + +Free-form product context the consumer wants the judge to know. + +##### knownFindingIds? + +> `optional` **knownFindingIds?**: readonly `number`[] + +Defined in: [profiles/ui-auditor/judge.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L42) + +**`Experimental`** + +Findings already on file across earlier iterations — for similarTo linkage. + +##### promptText + +> **promptText**: `string` + +Defined in: [profiles/ui-auditor/judge.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L44) + +**`Experimental`** + +The full prompt the loop kernel synthesized for this iteration. + +##### signal + +> **signal**: `AbortSignal` + +Defined in: [profiles/ui-auditor/judge.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L46) + +**`Experimental`** + +Cooperative cancellation. + +*** + +### UiJudgeOutput + +Defined in: [profiles/ui-auditor/judge.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L50) + +**`Experimental`** + +#### Properties + +##### findings + +> **findings**: [`UiFinding`](#uifinding)[] + +Defined in: [profiles/ui-auditor/judge.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L51) + +**`Experimental`** + +##### notes? + +> `optional` **notes?**: `string` + +Defined in: [profiles/ui-auditor/judge.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L53) + +**`Experimental`** + +Optional triage commentary. + +##### tokenUsage? + +> `optional` **tokenUsage?**: [`UiJudgeTokenUsage`](#uijudgetokenusage) + +Defined in: [profiles/ui-auditor/judge.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L55) + +**`Experimental`** + +Optional usage; folded into the kernel cost ledger when present. + +##### costUsd? + +> `optional` **costUsd?**: `number` + +Defined in: [profiles/ui-auditor/judge.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L57) + +**`Experimental`** + +Optional total cost in USD. + +*** + +### UiAuditorProfileOptions + +Defined in: [profiles/ui-auditor/profile.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/profile.ts#L22) + +**`Experimental`** + +#### Properties + +##### name? + +> `optional` **name?**: `string` + +Defined in: [profiles/ui-auditor/profile.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/profile.ts#L26) + +**`Experimental`** + +Stable name surfaced in trace events. Defaults to `ui-auditor`. + +##### model? + +> `optional` **model?**: `string` + +Defined in: [profiles/ui-auditor/profile.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/profile.ts#L31) + +**`Experimental`** + +Optional model identifier passed in `AgentProfile.model.default`. +The consumer's `SandboxClient` chooses how to interpret it. + +##### task? + +> `optional` **task?**: [`UiAuditTask`](#uiaudittask) + +Defined in: [profiles/ui-auditor/profile.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/profile.ts#L37) + +**`Experimental`** + +Task bound to the validator. Without it the validator uses the lens +embedded in the iteration output as its expectation — fine for one-off +use; less strict than passing the task explicitly. + +*** + +### UiFindingScreenshot + +Defined in: [profiles/ui-auditor/substrate.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L68) + +Pointer to a screenshot referenced by a finding (workspace-relative path). + +#### Properties + +##### path + +> **path**: `string` + +Defined in: [profiles/ui-auditor/substrate.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L69) + +##### viewport? + +> `optional` **viewport?**: `string` + +Defined in: [profiles/ui-auditor/substrate.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L70) + +##### label? + +> `optional` **label?**: `string` + +Defined in: [profiles/ui-auditor/substrate.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L71) + +*** + +### UiFinding + +Defined in: [profiles/ui-auditor/substrate.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L81) + +A single UI audit finding — the unit of work a contributor can act on. + +Every field except the documented optionals is required. The auditor +validator + writer hard-fail on missing screenshot evidence, missing +lens, missing title, etc. + +#### Properties + +##### id? + +> `optional` **id?**: `number` + +Defined in: [profiles/ui-auditor/substrate.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L83) + +Monotonic id assigned by the writer when persisting. Optional in-transit. + +##### title + +> **title**: `string` + +Defined in: [profiles/ui-auditor/substrate.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L84) + +##### lens + +> **lens**: [`UiLens`](#uilens) + +Defined in: [profiles/ui-auditor/substrate.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L85) + +##### severity + +> **severity**: [`UiFindingSeverity`](#uifindingseverity) + +Defined in: [profiles/ui-auditor/substrate.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L86) + +##### route + +> **route**: `string` + +Defined in: [profiles/ui-auditor/substrate.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L88) + +Logical route the finding was observed on (e.g. `home`, `checkout-step-2`). + +##### url? + +> `optional` **url?**: `string` + +Defined in: [profiles/ui-auditor/substrate.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L90) + +Fully qualified URL the finding was observed at. + +##### viewport? + +> `optional` **viewport?**: `string` + +Defined in: [profiles/ui-auditor/substrate.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L92) + +Viewport string the offending capture was taken at (e.g. `1280x800`). + +##### selector? + +> `optional` **selector?**: `string` + +Defined in: [profiles/ui-auditor/substrate.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L94) + +CSS selector pinning the offending element, when one can be identified. + +##### observation + +> **observation**: `string` + +Defined in: [profiles/ui-auditor/substrate.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L96) + +1–3 sentences describing what the screenshot shows that is wrong. + +##### impact + +> **impact**: `string` + +Defined in: [profiles/ui-auditor/substrate.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L98) + +Who is affected and how. + +##### suggestedFix + +> **suggestedFix**: `string` + +Defined in: [profiles/ui-auditor/substrate.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L100) + +A specific change a contributor could apply without asking back. + +##### reproSteps? + +> `optional` **reproSteps?**: `string` + +Defined in: [profiles/ui-auditor/substrate.ts:102](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L102) + +Optional explicit reproduction steps. Writer synthesizes from route/url/selector when omitted. + +##### tags? + +> `optional` **tags?**: readonly `string`[] + +Defined in: [profiles/ui-auditor/substrate.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L104) + +Free-form tags. + +##### screenshots + +> **screenshots**: readonly [`UiFindingScreenshot`](#uifindingscreenshot)[] + +Defined in: [profiles/ui-auditor/substrate.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L106) + +Screenshot references — must be non-empty for actionable findings. + +##### similarTo? + +> `optional` **similarTo?**: readonly `number`[] + +Defined in: [profiles/ui-auditor/substrate.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L108) + +Cross-references to similar findings already on file, by id. + +##### createdAt? + +> `optional` **createdAt?**: `string` + +Defined in: [profiles/ui-auditor/substrate.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L110) + +ISO-8601 creation timestamp set by the writer when persisted. + +*** + +### UiAuditViewport + +Defined in: [profiles/ui-auditor/task.ts:16](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L16) + +**`Experimental`** + +#### Properties + +##### width + +> **width**: `number` + +Defined in: [profiles/ui-auditor/task.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L17) + +**`Experimental`** + +##### height + +> **height**: `number` + +Defined in: [profiles/ui-auditor/task.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L18) + +**`Experimental`** + +*** + +### UiAuditCaptureRequest + +Defined in: [profiles/ui-auditor/task.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L22) + +**`Experimental`** + +#### Properties + +##### route + +> **route**: `string` + +Defined in: [profiles/ui-auditor/task.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L27) + +**`Experimental`** + +Logical route name (e.g. `home`, `checkout-step-2`). Used in screenshot +filenames and finding metadata. + +##### url + +> **url**: `string` + +Defined in: [profiles/ui-auditor/task.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L29) + +**`Experimental`** + +Fully qualified URL the iteration audits. + +##### viewport? + +> `optional` **viewport?**: [`UiAuditViewport`](#uiauditviewport) + +Defined in: [profiles/ui-auditor/task.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L31) + +**`Experimental`** + +Default `{ width: 1280, height: 800 }`. + +##### fullPage? + +> `optional` **fullPage?**: `boolean` + +Defined in: [profiles/ui-auditor/task.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L33) + +**`Experimental`** + +Default `false`. + +##### waitFor? + +> `optional` **waitFor?**: `string` + +Defined in: [profiles/ui-auditor/task.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L35) + +**`Experimental`** + +CSS selector to wait for before capturing. + +##### waitMs? + +> `optional` **waitMs?**: `number` + +Defined in: [profiles/ui-auditor/task.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L37) + +**`Experimental`** + +Extra milliseconds to wait after navigation settles. Default `500`. + +##### elementSelector? + +> `optional` **elementSelector?**: `string` + +Defined in: [profiles/ui-auditor/task.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L39) + +**`Experimental`** + +Optional CSS selector — capture only the matched element. + +##### label? + +> `optional` **label?**: `string` + +Defined in: [profiles/ui-auditor/task.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L41) + +**`Experimental`** + +Optional human-readable label appended to the screenshot filename. + +*** + +### UiAuditTask + +Defined in: [profiles/ui-auditor/task.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L54) + +**`Experimental`** + +One iteration's task: audit a single (lens × route) pair, capturing the +surfaces the lens needs. + +`captures` lists the screenshots to take BEFORE the judge is invoked. +The judge sees all captures from this iteration plus the lens-specific +brief. + +#### Properties + +##### lens + +> **lens**: [`UiLens`](#uilens) + +Defined in: [profiles/ui-auditor/task.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L56) + +**`Experimental`** + +The audit lens that scopes which findings are valid this iteration. + +##### captures + +> **captures**: readonly [`UiAuditCaptureRequest`](#uiauditcapturerequest)[] + +Defined in: [profiles/ui-auditor/task.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L58) + +**`Experimental`** + +Required captures. Order is preserved; index 0 is the primary frame. + +##### productContext? + +> `optional` **productContext?**: `string` + +Defined in: [profiles/ui-auditor/task.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L63) + +**`Experimental`** + +Free-form context the consumer wants the judge to know about (product +name, target audience, copy tone). Surfaced as a prompt prelude. + +##### knownFindingIds? + +> `optional` **knownFindingIds?**: readonly `number`[] + +Defined in: [profiles/ui-auditor/task.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L69) + +**`Experimental`** + +IDs of findings already on file across earlier iterations. The judge +uses these to mark cross-references via `similarTo` instead of filing +pile-on duplicates. + +*** + +### UiAuditCapture + +Defined in: [profiles/ui-auditor/task.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L73) + +**`Experimental`** + +#### Properties + +##### path + +> **path**: `string` + +Defined in: [profiles/ui-auditor/task.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L75) + +**`Experimental`** + +Workspace-relative path to the screenshot file. + +##### viewport + +> **viewport**: `string` + +Defined in: [profiles/ui-auditor/task.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L76) + +**`Experimental`** + +##### fullPage + +> **fullPage**: `boolean` + +Defined in: [profiles/ui-auditor/task.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L77) + +**`Experimental`** + +##### elementSelector? + +> `optional` **elementSelector?**: `string` + +Defined in: [profiles/ui-auditor/task.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L78) + +**`Experimental`** + +##### label? + +> `optional` **label?**: `string` + +Defined in: [profiles/ui-auditor/task.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L79) + +**`Experimental`** + +##### route + +> **route**: `string` + +Defined in: [profiles/ui-auditor/task.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L80) + +**`Experimental`** + +##### url + +> **url**: `string` + +Defined in: [profiles/ui-auditor/task.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L81) + +**`Experimental`** + +##### capturedAt + +> **capturedAt**: `string` + +Defined in: [profiles/ui-auditor/task.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L83) + +**`Experimental`** + +Wall-clock when the capture completed. + +*** + +### UiAuditOutput + +Defined in: [profiles/ui-auditor/task.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L93) + +**`Experimental`** + +Output of one iteration. `findings` is the headline payload; `captures` +is the screenshot manifest the writer needs to link evidence. `notes` +carries judge commentary that didn't rise to a finding. + +#### Properties + +##### lens + +> **lens**: [`UiLens`](#uilens) + +Defined in: [profiles/ui-auditor/task.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L94) + +**`Experimental`** + +##### findings + +> **findings**: [`UiFinding`](#uifinding)[] + +Defined in: [profiles/ui-auditor/task.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L95) + +**`Experimental`** + +##### captures + +> **captures**: [`UiAuditCapture`](#uiauditcapture)[] + +Defined in: [profiles/ui-auditor/task.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L96) + +**`Experimental`** + +##### notes? + +> `optional` **notes?**: `string` + +Defined in: [profiles/ui-auditor/task.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L98) + +**`Experimental`** + +Optional judge commentary (debug / triage aid). + +## Type Aliases + +### UiJudge + +> **UiJudge** = (`input`) => `Promise`\<[`UiJudgeOutput`](#uijudgeoutput)\> + +Defined in: [profiles/ui-auditor/judge.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L61) + +**`Experimental`** + +#### Parameters + +##### input + +[`UiJudgeInput`](#uijudgeinput) + +#### Returns + +`Promise`\<[`UiJudgeOutput`](#uijudgeoutput)\> + +*** + +### UiLens + +> **UiLens** = `"consistency"` \| `"hierarchy"` \| `"layout"` \| `"ux-flow"` \| `"duplication"` \| `"accessibility"` \| `"responsive"` \| `"states"` \| `"content"` \| `"interaction"` \| `"performance-perceived"` \| `"other"` + +Defined in: [profiles/ui-auditor/substrate.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L20) + +Canonical audit lenses. Each lens scopes a finding to a single class of +problem so a single audit pass can iterate them without pile-on findings +under a generic label. + +*** + +### UiFindingSeverity + +> **UiFindingSeverity** = `"low"` \| `"med"` \| `"high"` \| `"critical"` + +Defined in: [profiles/ui-auditor/substrate.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L57) + +Severity scale. + - `critical` — blocks a core task or is an accessibility blocker. + - `high` — confusing, broken-looking, or noticeable friction. + - `med` — visible polish issue, would be caught in code review. + - `low` — nitpick worth fixing eventually. + +## Variables + +### DEFAULT\_CODER\_SYSTEM\_PROMPT + +> `const` **DEFAULT\_CODER\_SYSTEM\_PROMPT**: `string` + +Defined in: [profiles/coder.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L43) + +**`Experimental`** + +The coder agent's standing instruction (its body lives in `coderProfile.prompt`). + +*** + +### coderProfile + +> `const` **coderProfile**: `AgentProfile` + +Defined in: [profiles/coder.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L72) + +**`Experimental`** + +The coder `AgentProfile` — the §1.5 DATA the substrate materializes into a harness invocation. +Stateless and harness-agnostic: a consumer overrides `model`/`metadata.backendType` by spreading +a copy, never by a factory. `worktreeFanout` authors one such profile per harness leaf. + +*** + +### SHARED\_AUDITOR\_RULES + +> `const` **SHARED\_AUDITOR\_RULES**: `string` + +Defined in: [profiles/ui-auditor/lens-prompts.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/lens-prompts.ts#L17) + +**`Experimental`** + +*** + +### LENS\_BRIEFS + +> `const` **LENS\_BRIEFS**: `Record`\<[`UiLens`](#uilens), `string`\> + +Defined in: [profiles/ui-auditor/lens-prompts.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/lens-prompts.ts#L39) + +**`Experimental`** + +*** + +### UI\_LENSES + +> `const` **UI\_LENSES**: readonly [`UiLens`](#uilens)[] + +Defined in: [profiles/ui-auditor/substrate.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L35) + +Frozen tuple of lenses for validation + iteration. + +*** + +### UI\_FINDING\_SEVERITIES + +> `const` **UI\_FINDING\_SEVERITIES**: readonly [`UiFindingSeverity`](#uifindingseverity)[] + +Defined in: [profiles/ui-auditor/substrate.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L60) + +Frozen severity tuple, ordered worst → least bad for sort/report. + +## Functions + +### coderTaskToPrompt() + +> **coderTaskToPrompt**(`task`): `string` + +Defined in: [profiles/coder.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L81) + +**`Experimental`** + +Render a `CoderTask` into the per-task instruction handed to the coder profile. + +#### Parameters + +##### task + +[`CoderTask`](#codertask) + +#### Returns + +`string` + +*** + +### createInProcessUiAuditClient() + +> **createInProcessUiAuditClient**(`options`): [`SandboxClient`](runtime.md#sandboxclient-2) & `object` + +Defined in: [profiles/ui-auditor/in-process-client.ts:189](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L189) + +**`Experimental`** + +#### Parameters + +##### options + +[`InProcessUiAuditClientOptions`](#inprocessuiauditclientoptions) + +#### Returns + +*** + +### buildAuditorSystemPrompt() + +> **buildAuditorSystemPrompt**(`lens`): `string` + +Defined in: [profiles/ui-auditor/lens-prompts.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/lens-prompts.ts#L128) + +**`Experimental`** + +Build a system prompt for a single auditor iteration. + +#### Parameters + +##### lens + +[`UiLens`](#uilens) + +#### Returns + +`string` + +*** + +### parseAuditorEvents() + +> **parseAuditorEvents**(`events`): [`UiAuditOutput`](#uiauditoutput) + +Defined in: [profiles/ui-auditor/output-adapter.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/output-adapter.ts#L32) + +**`Experimental`** + +#### Parameters + +##### events + +`SandboxEvent`[] + +#### Returns + +[`UiAuditOutput`](#uiauditoutput) + +*** + +### uiAuditorProfile() + +> **uiAuditorProfile**(`options?`): `object` + +Defined in: [profiles/ui-auditor/profile.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/profile.ts#L41) + +**`Experimental`** + +#### Parameters + +##### options? + +[`UiAuditorProfileOptions`](#uiauditorprofileoptions) = `{}` + +#### Returns + +`object` + +##### profile + +> **profile**: `AgentProfile` + +##### taskToPrompt + +> **taskToPrompt**: (`task`) => `string` + +###### Parameters + +###### task + +[`UiAuditTask`](#uiaudittask) + +###### Returns + +`string` + +##### output + +> **output**: [`OutputAdapter`](runtime.md#outputadapter)\<[`UiAuditOutput`](#uiauditoutput)\> + +##### validator + +> **validator**: [`Validator`](runtime.md#validator-1)\<[`UiAuditOutput`](#uiauditoutput)\> + +##### agentRunSpec + +> **agentRunSpec**: [`AgentRunSpec`](runtime.md#agentrunspec)\<[`UiAuditTask`](#uiaudittask)\> + +*** + +### encodeAuditTaskEnvelope() + +> **encodeAuditTaskEnvelope**(`task`): `string` + +Defined in: [profiles/ui-auditor/prompt.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/prompt.ts#L25) + +**`Experimental`** + +#### Parameters + +##### task + +[`UiAuditTask`](#uiaudittask) + +#### Returns + +`string` + +*** + +### decodeAuditTaskEnvelope() + +> **decodeAuditTaskEnvelope**(`prompt`): [`UiAuditTask`](#uiaudittask) \| `undefined` + +Defined in: [profiles/ui-auditor/prompt.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/prompt.ts#L36) + +**`Experimental`** + +Parse a task envelope back out of a prompt string. Returns undefined if +the prompt does not contain a complete envelope OR if the payload is +not valid JSON. + +#### Parameters + +##### prompt + +`string` + +#### Returns + +[`UiAuditTask`](#uiaudittask) \| `undefined` + +*** + +### formatAuditorPrompt() + +> **formatAuditorPrompt**(`task`): `string` + +Defined in: [profiles/ui-auditor/prompt.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/prompt.ts#L55) + +**`Experimental`** + +#### Parameters + +##### task + +[`UiAuditTask`](#uiaudittask) + +#### Returns + +`string` + +*** + +### createUiAuditorValidator() + +> **createUiAuditorValidator**(`task`): [`Validator`](runtime.md#validator-1)\<[`UiAuditOutput`](#uiauditoutput)\> + +Defined in: [profiles/ui-auditor/validator.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/validator.ts#L51) + +**`Experimental`** + +#### Parameters + +##### task + +[`UiAuditTask`](#uiaudittask) + +#### Returns + +[`Validator`](runtime.md#validator-1)\<[`UiAuditOutput`](#uiauditoutput)\> diff --git a/docs/api/profiles/README.md b/docs/api/profiles/README.md deleted file mode 100644 index f29cddc..0000000 --- a/docs/api/profiles/README.md +++ /dev/null @@ -1,53 +0,0 @@ -[**@tangle-network/agent-runtime**](../README.md) - -*** - -[@tangle-network/agent-runtime](../README.md) / profiles - -# profiles - -## Interfaces - -- [CoderTask](interfaces/CoderTask.md) -- [InProcessUiAuditClientOptions](interfaces/InProcessUiAuditClientOptions.md) -- [BrowserHandle](interfaces/BrowserHandle.md) -- [BrowserContextHandle](interfaces/BrowserContextHandle.md) -- [PageHandle](interfaces/PageHandle.md) -- [UiJudgeTokenUsage](interfaces/UiJudgeTokenUsage.md) -- [UiJudgeInput](interfaces/UiJudgeInput.md) -- [UiJudgeOutput](interfaces/UiJudgeOutput.md) -- [UiAuditorProfileOptions](interfaces/UiAuditorProfileOptions.md) -- [UiFindingScreenshot](interfaces/UiFindingScreenshot.md) -- [UiFinding](interfaces/UiFinding.md) -- [UiAuditViewport](interfaces/UiAuditViewport.md) -- [UiAuditCaptureRequest](interfaces/UiAuditCaptureRequest.md) -- [UiAuditTask](interfaces/UiAuditTask.md) -- [UiAuditCapture](interfaces/UiAuditCapture.md) -- [UiAuditOutput](interfaces/UiAuditOutput.md) - -## Type Aliases - -- [UiJudge](type-aliases/UiJudge.md) -- [UiLens](type-aliases/UiLens.md) -- [UiFindingSeverity](type-aliases/UiFindingSeverity.md) - -## Variables - -- [DEFAULT\_CODER\_SYSTEM\_PROMPT](variables/DEFAULT_CODER_SYSTEM_PROMPT.md) -- [coderProfile](variables/coderProfile.md) -- [SHARED\_AUDITOR\_RULES](variables/SHARED_AUDITOR_RULES.md) -- [LENS\_BRIEFS](variables/LENS_BRIEFS.md) -- [UI\_LENSES](variables/UI_LENSES.md) -- [UI\_FINDING\_SEVERITIES](variables/UI_FINDING_SEVERITIES.md) - -## Functions - -- [coderTaskToPrompt](functions/coderTaskToPrompt.md) -- [createInProcessUiAuditClient](functions/createInProcessUiAuditClient.md) -- [buildAuditorSystemPrompt](functions/buildAuditorSystemPrompt.md) -- [parseAuditorEvents](functions/parseAuditorEvents.md) -- [uiAuditorProfile](functions/uiAuditorProfile.md) -- [encodeAuditTaskEnvelope](functions/encodeAuditTaskEnvelope.md) -- [decodeAuditTaskEnvelope](functions/decodeAuditTaskEnvelope.md) -- [formatAuditorPrompt](functions/formatAuditorPrompt.md) -- [createUiAuditorValidator](functions/createUiAuditorValidator.md) diff --git a/docs/api/profiles/functions/buildAuditorSystemPrompt.md b/docs/api/profiles/functions/buildAuditorSystemPrompt.md deleted file mode 100644 index b1a61fc..0000000 --- a/docs/api/profiles/functions/buildAuditorSystemPrompt.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / buildAuditorSystemPrompt - -# Function: buildAuditorSystemPrompt() - -> **buildAuditorSystemPrompt**(`lens`): `string` - -Defined in: [profiles/ui-auditor/lens-prompts.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/lens-prompts.ts#L128) - -**`Experimental`** - -Build a system prompt for a single auditor iteration. - -## Parameters - -### lens - -[`UiLens`](../type-aliases/UiLens.md) - -## Returns - -`string` diff --git a/docs/api/profiles/functions/coderTaskToPrompt.md b/docs/api/profiles/functions/coderTaskToPrompt.md deleted file mode 100644 index b88b18b..0000000 --- a/docs/api/profiles/functions/coderTaskToPrompt.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / coderTaskToPrompt - -# Function: coderTaskToPrompt() - -> **coderTaskToPrompt**(`task`): `string` - -Defined in: [profiles/coder.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L81) - -**`Experimental`** - -Render a `CoderTask` into the per-task instruction handed to the coder profile. - -## Parameters - -### task - -[`CoderTask`](../interfaces/CoderTask.md) - -## Returns - -`string` diff --git a/docs/api/profiles/functions/createInProcessUiAuditClient.md b/docs/api/profiles/functions/createInProcessUiAuditClient.md deleted file mode 100644 index 9903df6..0000000 --- a/docs/api/profiles/functions/createInProcessUiAuditClient.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / createInProcessUiAuditClient - -# Function: createInProcessUiAuditClient() - -> **createInProcessUiAuditClient**(`options`): [`SandboxClient`](../../runtime/interfaces/SandboxClient.md) & `object` - -Defined in: [profiles/ui-auditor/in-process-client.ts:189](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L189) - -**`Experimental`** - -## Parameters - -### options - -[`InProcessUiAuditClientOptions`](../interfaces/InProcessUiAuditClientOptions.md) - -## Returns diff --git a/docs/api/profiles/functions/createUiAuditorValidator.md b/docs/api/profiles/functions/createUiAuditorValidator.md deleted file mode 100644 index ba7cde4..0000000 --- a/docs/api/profiles/functions/createUiAuditorValidator.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / createUiAuditorValidator - -# Function: createUiAuditorValidator() - -> **createUiAuditorValidator**(`task`): [`Validator`](../../runtime/interfaces/Validator.md)\<[`UiAuditOutput`](../interfaces/UiAuditOutput.md)\> - -Defined in: [profiles/ui-auditor/validator.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/validator.ts#L51) - -**`Experimental`** - -## Parameters - -### task - -[`UiAuditTask`](../interfaces/UiAuditTask.md) - -## Returns - -[`Validator`](../../runtime/interfaces/Validator.md)\<[`UiAuditOutput`](../interfaces/UiAuditOutput.md)\> diff --git a/docs/api/profiles/functions/decodeAuditTaskEnvelope.md b/docs/api/profiles/functions/decodeAuditTaskEnvelope.md deleted file mode 100644 index ad9c988..0000000 --- a/docs/api/profiles/functions/decodeAuditTaskEnvelope.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / decodeAuditTaskEnvelope - -# Function: decodeAuditTaskEnvelope() - -> **decodeAuditTaskEnvelope**(`prompt`): [`UiAuditTask`](../interfaces/UiAuditTask.md) \| `undefined` - -Defined in: [profiles/ui-auditor/prompt.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/prompt.ts#L36) - -**`Experimental`** - -Parse a task envelope back out of a prompt string. Returns undefined if -the prompt does not contain a complete envelope OR if the payload is -not valid JSON. - -## Parameters - -### prompt - -`string` - -## Returns - -[`UiAuditTask`](../interfaces/UiAuditTask.md) \| `undefined` diff --git a/docs/api/profiles/functions/encodeAuditTaskEnvelope.md b/docs/api/profiles/functions/encodeAuditTaskEnvelope.md deleted file mode 100644 index 84b3c3c..0000000 --- a/docs/api/profiles/functions/encodeAuditTaskEnvelope.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / encodeAuditTaskEnvelope - -# Function: encodeAuditTaskEnvelope() - -> **encodeAuditTaskEnvelope**(`task`): `string` - -Defined in: [profiles/ui-auditor/prompt.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/prompt.ts#L25) - -**`Experimental`** - -## Parameters - -### task - -[`UiAuditTask`](../interfaces/UiAuditTask.md) - -## Returns - -`string` diff --git a/docs/api/profiles/functions/formatAuditorPrompt.md b/docs/api/profiles/functions/formatAuditorPrompt.md deleted file mode 100644 index 61b0c13..0000000 --- a/docs/api/profiles/functions/formatAuditorPrompt.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / formatAuditorPrompt - -# Function: formatAuditorPrompt() - -> **formatAuditorPrompt**(`task`): `string` - -Defined in: [profiles/ui-auditor/prompt.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/prompt.ts#L55) - -**`Experimental`** - -## Parameters - -### task - -[`UiAuditTask`](../interfaces/UiAuditTask.md) - -## Returns - -`string` diff --git a/docs/api/profiles/functions/parseAuditorEvents.md b/docs/api/profiles/functions/parseAuditorEvents.md deleted file mode 100644 index a796796..0000000 --- a/docs/api/profiles/functions/parseAuditorEvents.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / parseAuditorEvents - -# Function: parseAuditorEvents() - -> **parseAuditorEvents**(`events`): [`UiAuditOutput`](../interfaces/UiAuditOutput.md) - -Defined in: [profiles/ui-auditor/output-adapter.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/output-adapter.ts#L32) - -**`Experimental`** - -## Parameters - -### events - -`SandboxEvent`[] - -## Returns - -[`UiAuditOutput`](../interfaces/UiAuditOutput.md) diff --git a/docs/api/profiles/functions/uiAuditorProfile.md b/docs/api/profiles/functions/uiAuditorProfile.md deleted file mode 100644 index b464789..0000000 --- a/docs/api/profiles/functions/uiAuditorProfile.md +++ /dev/null @@ -1,53 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / uiAuditorProfile - -# Function: uiAuditorProfile() - -> **uiAuditorProfile**(`options?`): `object` - -Defined in: [profiles/ui-auditor/profile.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/profile.ts#L41) - -**`Experimental`** - -## Parameters - -### options? - -[`UiAuditorProfileOptions`](../interfaces/UiAuditorProfileOptions.md) = `{}` - -## Returns - -`object` - -### profile - -> **profile**: `AgentProfile` - -### taskToPrompt - -> **taskToPrompt**: (`task`) => `string` - -#### Parameters - -##### task - -[`UiAuditTask`](../interfaces/UiAuditTask.md) - -#### Returns - -`string` - -### output - -> **output**: [`OutputAdapter`](../../runtime/interfaces/OutputAdapter.md)\<[`UiAuditOutput`](../interfaces/UiAuditOutput.md)\> - -### validator - -> **validator**: [`Validator`](../../runtime/interfaces/Validator.md)\<[`UiAuditOutput`](../interfaces/UiAuditOutput.md)\> - -### agentRunSpec - -> **agentRunSpec**: [`AgentRunSpec`](../../runtime/interfaces/AgentRunSpec.md)\<[`UiAuditTask`](../interfaces/UiAuditTask.md)\> diff --git a/docs/api/profiles/interfaces/BrowserContextHandle.md b/docs/api/profiles/interfaces/BrowserContextHandle.md deleted file mode 100644 index 4854bbb..0000000 --- a/docs/api/profiles/interfaces/BrowserContextHandle.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / BrowserContextHandle - -# Interface: BrowserContextHandle - -Defined in: [profiles/ui-auditor/in-process-client.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L80) - -**`Experimental`** - -## Methods - -### newPage() - -> **newPage**(): `Promise`\<[`PageHandle`](PageHandle.md)\> - -Defined in: [profiles/ui-auditor/in-process-client.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L81) - -**`Experimental`** - -#### Returns - -`Promise`\<[`PageHandle`](PageHandle.md)\> - -*** - -### close() - -> **close**(): `Promise`\<`void`\> - -Defined in: [profiles/ui-auditor/in-process-client.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L82) - -**`Experimental`** - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/profiles/interfaces/BrowserHandle.md b/docs/api/profiles/interfaces/BrowserHandle.md deleted file mode 100644 index 4133790..0000000 --- a/docs/api/profiles/interfaces/BrowserHandle.md +++ /dev/null @@ -1,55 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / BrowserHandle - -# Interface: BrowserHandle - -Defined in: [profiles/ui-auditor/in-process-client.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L72) - -**`Experimental`** - -## Methods - -### newContext() - -> **newContext**(`options?`): `Promise`\<[`BrowserContextHandle`](BrowserContextHandle.md)\> - -Defined in: [profiles/ui-auditor/in-process-client.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L73) - -**`Experimental`** - -#### Parameters - -##### options? - -###### viewport? - -\{ `width`: `number`; `height`: `number`; \} - -###### viewport.width - -`number` - -###### viewport.height - -`number` - -#### Returns - -`Promise`\<[`BrowserContextHandle`](BrowserContextHandle.md)\> - -*** - -### close() - -> **close**(): `Promise`\<`void`\> - -Defined in: [profiles/ui-auditor/in-process-client.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L76) - -**`Experimental`** - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/profiles/interfaces/CoderTask.md b/docs/api/profiles/interfaces/CoderTask.md deleted file mode 100644 index 86c6db3..0000000 --- a/docs/api/profiles/interfaces/CoderTask.md +++ /dev/null @@ -1,110 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / CoderTask - -# Interface: CoderTask - -Defined in: [profiles/coder.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L20) - -**`Experimental`** - -The per-task inputs `coderTaskToPrompt` renders + the worktree gate enforces. - -## Properties - -### goal - -> **goal**: `string` - -Defined in: [profiles/coder.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L22) - -**`Experimental`** - -What the agent must accomplish. Free-form prose. - -*** - -### repoRoot - -> **repoRoot**: `string` - -Defined in: [profiles/coder.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L24) - -**`Experimental`** - -Absolute path inside the sandbox where the repo lives. - -*** - -### baseBranch? - -> `optional` **baseBranch?**: `string` - -Defined in: [profiles/coder.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L26) - -**`Experimental`** - -Default `main`. The branch the agent diffs against. - -*** - -### testCmd? - -> `optional` **testCmd?**: `string` - -Defined in: [profiles/coder.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L28) - -**`Experimental`** - -Default `pnpm test --run`. - -*** - -### typecheckCmd? - -> `optional` **typecheckCmd?**: `string` - -Defined in: [profiles/coder.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L30) - -**`Experimental`** - -Default `pnpm typecheck`. - -*** - -### contextFiles? - -> `optional` **contextFiles?**: `string`[] - -Defined in: [profiles/coder.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L32) - -**`Experimental`** - -Files the agent may inspect for context. Surfaced verbatim in the prompt. - -*** - -### forbiddenPaths? - -> `optional` **forbiddenPaths?**: `string`[] - -Defined in: [profiles/coder.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L37) - -**`Experimental`** - -Paths the agent must not touch. The mechanical gate hard-fails on any match. -Use glob-free literal path prefixes for unambiguous enforcement. - -*** - -### maxDiffLines? - -> `optional` **maxDiffLines?**: `number` - -Defined in: [profiles/coder.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L39) - -**`Experimental`** - -Default 400. Hard cap; the gate hard-fails when exceeded. diff --git a/docs/api/profiles/interfaces/InProcessUiAuditClientOptions.md b/docs/api/profiles/interfaces/InProcessUiAuditClientOptions.md deleted file mode 100644 index efcd838..0000000 --- a/docs/api/profiles/interfaces/InProcessUiAuditClientOptions.md +++ /dev/null @@ -1,72 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / InProcessUiAuditClientOptions - -# Interface: InProcessUiAuditClientOptions - -Defined in: [profiles/ui-auditor/in-process-client.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L45) - -**`Experimental`** - -## Properties - -### workspaceDir - -> **workspaceDir**: `string` - -Defined in: [profiles/ui-auditor/in-process-client.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L51) - -**`Experimental`** - -Absolute path under which screenshots are written. Each capture lands -at `/screenshots/`; finding screenshot paths -are workspace-relative (`screenshots/`). - -*** - -### judge - -> **judge**: [`UiJudge`](../type-aliases/UiJudge.md) - -Defined in: [profiles/ui-auditor/in-process-client.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L53) - -**`Experimental`** - -The vision judge that turns captures into findings. - -*** - -### navPolicy? - -> `optional` **navPolicy?**: `"strict"` \| `"spa"` - -Defined in: [profiles/ui-auditor/in-process-client.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L62) - -**`Experimental`** - -Navigation policy. - -`'strict'` (default) waits for `networkidle` and fails the iteration -if the page does not settle. `'spa'` waits for `domcontentloaded` — -use for single-page apps that hold open long-poll/websocket -connections and never settle. - -*** - -### launchBrowser? - -> `optional` **launchBrowser?**: () => `Promise`\<[`BrowserHandle`](BrowserHandle.md)\> - -Defined in: [profiles/ui-auditor/in-process-client.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L68) - -**`Experimental`** - -Browser launch override. Default: chromium headless via Playwright. -Consumers pass a custom factory to target a remote browser, a -different channel, or a fleet adapter. - -#### Returns - -`Promise`\<[`BrowserHandle`](BrowserHandle.md)\> diff --git a/docs/api/profiles/interfaces/PageHandle.md b/docs/api/profiles/interfaces/PageHandle.md deleted file mode 100644 index 12199cf..0000000 --- a/docs/api/profiles/interfaces/PageHandle.md +++ /dev/null @@ -1,183 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / PageHandle - -# Interface: PageHandle - -Defined in: [profiles/ui-auditor/in-process-client.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L86) - -**`Experimental`** - -## Methods - -### setViewportSize() - -> **setViewportSize**(`size`): `Promise`\<`void`\> - -Defined in: [profiles/ui-auditor/in-process-client.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L87) - -**`Experimental`** - -#### Parameters - -##### size - -###### width - -`number` - -###### height - -`number` - -#### Returns - -`Promise`\<`void`\> - -*** - -### goto() - -> **goto**(`url`, `options?`): `Promise`\<`unknown`\> - -Defined in: [profiles/ui-auditor/in-process-client.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L88) - -**`Experimental`** - -#### Parameters - -##### url - -`string` - -##### options? - -###### waitUntil? - -`string` - -###### timeout? - -`number` - -#### Returns - -`Promise`\<`unknown`\> - -*** - -### waitForSelector() - -> **waitForSelector**(`selector`, `options?`): `Promise`\<`unknown`\> - -Defined in: [profiles/ui-auditor/in-process-client.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L89) - -**`Experimental`** - -#### Parameters - -##### selector - -`string` - -##### options? - -###### timeout? - -`number` - -#### Returns - -`Promise`\<`unknown`\> - -*** - -### waitForTimeout() - -> **waitForTimeout**(`ms`): `Promise`\<`void`\> - -Defined in: [profiles/ui-auditor/in-process-client.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L90) - -**`Experimental`** - -#### Parameters - -##### ms - -`number` - -#### Returns - -`Promise`\<`void`\> - -*** - -### screenshot() - -> **screenshot**(`options`): `Promise`\<`void`\> - -Defined in: [profiles/ui-auditor/in-process-client.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L91) - -**`Experimental`** - -#### Parameters - -##### options - -###### path - -`string` - -###### fullPage? - -`boolean` - -#### Returns - -`Promise`\<`void`\> - -*** - -### locator() - -> **locator**(`selector`): `object` - -Defined in: [profiles/ui-auditor/in-process-client.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/in-process-client.ts#L92) - -**`Experimental`** - -#### Parameters - -##### selector - -`string` - -#### Returns - -`object` - -##### first() - -> **first**(): `object` - -###### Returns - -`object` - -###### screenshot() - -> **screenshot**(`options`): `Promise`\<`void`\> - -###### Parameters - -###### options - -###### path - -`string` - -###### Returns - -`Promise`\<`void`\> diff --git a/docs/api/profiles/interfaces/UiAuditCapture.md b/docs/api/profiles/interfaces/UiAuditCapture.md deleted file mode 100644 index 52170e6..0000000 --- a/docs/api/profiles/interfaces/UiAuditCapture.md +++ /dev/null @@ -1,95 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / UiAuditCapture - -# Interface: UiAuditCapture - -Defined in: [profiles/ui-auditor/task.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L73) - -**`Experimental`** - -## Properties - -### path - -> **path**: `string` - -Defined in: [profiles/ui-auditor/task.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L75) - -**`Experimental`** - -Workspace-relative path to the screenshot file. - -*** - -### viewport - -> **viewport**: `string` - -Defined in: [profiles/ui-auditor/task.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L76) - -**`Experimental`** - -*** - -### fullPage - -> **fullPage**: `boolean` - -Defined in: [profiles/ui-auditor/task.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L77) - -**`Experimental`** - -*** - -### elementSelector? - -> `optional` **elementSelector?**: `string` - -Defined in: [profiles/ui-auditor/task.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L78) - -**`Experimental`** - -*** - -### label? - -> `optional` **label?**: `string` - -Defined in: [profiles/ui-auditor/task.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L79) - -**`Experimental`** - -*** - -### route - -> **route**: `string` - -Defined in: [profiles/ui-auditor/task.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L80) - -**`Experimental`** - -*** - -### url - -> **url**: `string` - -Defined in: [profiles/ui-auditor/task.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L81) - -**`Experimental`** - -*** - -### capturedAt - -> **capturedAt**: `string` - -Defined in: [profiles/ui-auditor/task.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L83) - -**`Experimental`** - -Wall-clock when the capture completed. diff --git a/docs/api/profiles/interfaces/UiAuditCaptureRequest.md b/docs/api/profiles/interfaces/UiAuditCaptureRequest.md deleted file mode 100644 index 104e7e8..0000000 --- a/docs/api/profiles/interfaces/UiAuditCaptureRequest.md +++ /dev/null @@ -1,108 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / UiAuditCaptureRequest - -# Interface: UiAuditCaptureRequest - -Defined in: [profiles/ui-auditor/task.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L22) - -**`Experimental`** - -## Properties - -### route - -> **route**: `string` - -Defined in: [profiles/ui-auditor/task.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L27) - -**`Experimental`** - -Logical route name (e.g. `home`, `checkout-step-2`). Used in screenshot -filenames and finding metadata. - -*** - -### url - -> **url**: `string` - -Defined in: [profiles/ui-auditor/task.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L29) - -**`Experimental`** - -Fully qualified URL the iteration audits. - -*** - -### viewport? - -> `optional` **viewport?**: [`UiAuditViewport`](UiAuditViewport.md) - -Defined in: [profiles/ui-auditor/task.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L31) - -**`Experimental`** - -Default `{ width: 1280, height: 800 }`. - -*** - -### fullPage? - -> `optional` **fullPage?**: `boolean` - -Defined in: [profiles/ui-auditor/task.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L33) - -**`Experimental`** - -Default `false`. - -*** - -### waitFor? - -> `optional` **waitFor?**: `string` - -Defined in: [profiles/ui-auditor/task.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L35) - -**`Experimental`** - -CSS selector to wait for before capturing. - -*** - -### waitMs? - -> `optional` **waitMs?**: `number` - -Defined in: [profiles/ui-auditor/task.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L37) - -**`Experimental`** - -Extra milliseconds to wait after navigation settles. Default `500`. - -*** - -### elementSelector? - -> `optional` **elementSelector?**: `string` - -Defined in: [profiles/ui-auditor/task.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L39) - -**`Experimental`** - -Optional CSS selector — capture only the matched element. - -*** - -### label? - -> `optional` **label?**: `string` - -Defined in: [profiles/ui-auditor/task.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L41) - -**`Experimental`** - -Optional human-readable label appended to the screenshot filename. diff --git a/docs/api/profiles/interfaces/UiAuditOutput.md b/docs/api/profiles/interfaces/UiAuditOutput.md deleted file mode 100644 index f0a75be..0000000 --- a/docs/api/profiles/interfaces/UiAuditOutput.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / UiAuditOutput - -# Interface: UiAuditOutput - -Defined in: [profiles/ui-auditor/task.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L93) - -**`Experimental`** - -Output of one iteration. `findings` is the headline payload; `captures` -is the screenshot manifest the writer needs to link evidence. `notes` -carries judge commentary that didn't rise to a finding. - -## Properties - -### lens - -> **lens**: [`UiLens`](../type-aliases/UiLens.md) - -Defined in: [profiles/ui-auditor/task.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L94) - -**`Experimental`** - -*** - -### findings - -> **findings**: [`UiFinding`](UiFinding.md)[] - -Defined in: [profiles/ui-auditor/task.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L95) - -**`Experimental`** - -*** - -### captures - -> **captures**: [`UiAuditCapture`](UiAuditCapture.md)[] - -Defined in: [profiles/ui-auditor/task.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L96) - -**`Experimental`** - -*** - -### notes? - -> `optional` **notes?**: `string` - -Defined in: [profiles/ui-auditor/task.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L98) - -**`Experimental`** - -Optional judge commentary (debug / triage aid). diff --git a/docs/api/profiles/interfaces/UiAuditTask.md b/docs/api/profiles/interfaces/UiAuditTask.md deleted file mode 100644 index b2086fc..0000000 --- a/docs/api/profiles/interfaces/UiAuditTask.md +++ /dev/null @@ -1,69 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / UiAuditTask - -# Interface: UiAuditTask - -Defined in: [profiles/ui-auditor/task.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L54) - -**`Experimental`** - -One iteration's task: audit a single (lens × route) pair, capturing the -surfaces the lens needs. - -`captures` lists the screenshots to take BEFORE the judge is invoked. -The judge sees all captures from this iteration plus the lens-specific -brief. - -## Properties - -### lens - -> **lens**: [`UiLens`](../type-aliases/UiLens.md) - -Defined in: [profiles/ui-auditor/task.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L56) - -**`Experimental`** - -The audit lens that scopes which findings are valid this iteration. - -*** - -### captures - -> **captures**: readonly [`UiAuditCaptureRequest`](UiAuditCaptureRequest.md)[] - -Defined in: [profiles/ui-auditor/task.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L58) - -**`Experimental`** - -Required captures. Order is preserved; index 0 is the primary frame. - -*** - -### productContext? - -> `optional` **productContext?**: `string` - -Defined in: [profiles/ui-auditor/task.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L63) - -**`Experimental`** - -Free-form context the consumer wants the judge to know about (product -name, target audience, copy tone). Surfaced as a prompt prelude. - -*** - -### knownFindingIds? - -> `optional` **knownFindingIds?**: readonly `number`[] - -Defined in: [profiles/ui-auditor/task.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L69) - -**`Experimental`** - -IDs of findings already on file across earlier iterations. The judge -uses these to mark cross-references via `similarTo` instead of filing -pile-on duplicates. diff --git a/docs/api/profiles/interfaces/UiAuditViewport.md b/docs/api/profiles/interfaces/UiAuditViewport.md deleted file mode 100644 index 19d1368..0000000 --- a/docs/api/profiles/interfaces/UiAuditViewport.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / UiAuditViewport - -# Interface: UiAuditViewport - -Defined in: [profiles/ui-auditor/task.ts:16](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L16) - -**`Experimental`** - -## Properties - -### width - -> **width**: `number` - -Defined in: [profiles/ui-auditor/task.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L17) - -**`Experimental`** - -*** - -### height - -> **height**: `number` - -Defined in: [profiles/ui-auditor/task.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/task.ts#L18) - -**`Experimental`** diff --git a/docs/api/profiles/interfaces/UiAuditorProfileOptions.md b/docs/api/profiles/interfaces/UiAuditorProfileOptions.md deleted file mode 100644 index 1993416..0000000 --- a/docs/api/profiles/interfaces/UiAuditorProfileOptions.md +++ /dev/null @@ -1,50 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / UiAuditorProfileOptions - -# Interface: UiAuditorProfileOptions - -Defined in: [profiles/ui-auditor/profile.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/profile.ts#L22) - -**`Experimental`** - -## Properties - -### name? - -> `optional` **name?**: `string` - -Defined in: [profiles/ui-auditor/profile.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/profile.ts#L26) - -**`Experimental`** - -Stable name surfaced in trace events. Defaults to `ui-auditor`. - -*** - -### model? - -> `optional` **model?**: `string` - -Defined in: [profiles/ui-auditor/profile.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/profile.ts#L31) - -**`Experimental`** - -Optional model identifier passed in `AgentProfile.model.default`. -The consumer's `SandboxClient` chooses how to interpret it. - -*** - -### task? - -> `optional` **task?**: [`UiAuditTask`](UiAuditTask.md) - -Defined in: [profiles/ui-auditor/profile.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/profile.ts#L37) - -**`Experimental`** - -Task bound to the validator. Without it the validator uses the lens -embedded in the iteration output as its expectation — fine for one-off -use; less strict than passing the task explicitly. diff --git a/docs/api/profiles/interfaces/UiFinding.md b/docs/api/profiles/interfaces/UiFinding.md deleted file mode 100644 index 6d9eb62..0000000 --- a/docs/api/profiles/interfaces/UiFinding.md +++ /dev/null @@ -1,169 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / UiFinding - -# Interface: UiFinding - -Defined in: [profiles/ui-auditor/substrate.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L81) - -A single UI audit finding — the unit of work a contributor can act on. - -Every field except the documented optionals is required. The auditor -validator + writer hard-fail on missing screenshot evidence, missing -lens, missing title, etc. - -## Properties - -### id? - -> `optional` **id?**: `number` - -Defined in: [profiles/ui-auditor/substrate.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L83) - -Monotonic id assigned by the writer when persisting. Optional in-transit. - -*** - -### title - -> **title**: `string` - -Defined in: [profiles/ui-auditor/substrate.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L84) - -*** - -### lens - -> **lens**: [`UiLens`](../type-aliases/UiLens.md) - -Defined in: [profiles/ui-auditor/substrate.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L85) - -*** - -### severity - -> **severity**: [`UiFindingSeverity`](../type-aliases/UiFindingSeverity.md) - -Defined in: [profiles/ui-auditor/substrate.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L86) - -*** - -### route - -> **route**: `string` - -Defined in: [profiles/ui-auditor/substrate.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L88) - -Logical route the finding was observed on (e.g. `home`, `checkout-step-2`). - -*** - -### url? - -> `optional` **url?**: `string` - -Defined in: [profiles/ui-auditor/substrate.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L90) - -Fully qualified URL the finding was observed at. - -*** - -### viewport? - -> `optional` **viewport?**: `string` - -Defined in: [profiles/ui-auditor/substrate.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L92) - -Viewport string the offending capture was taken at (e.g. `1280x800`). - -*** - -### selector? - -> `optional` **selector?**: `string` - -Defined in: [profiles/ui-auditor/substrate.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L94) - -CSS selector pinning the offending element, when one can be identified. - -*** - -### observation - -> **observation**: `string` - -Defined in: [profiles/ui-auditor/substrate.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L96) - -1–3 sentences describing what the screenshot shows that is wrong. - -*** - -### impact - -> **impact**: `string` - -Defined in: [profiles/ui-auditor/substrate.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L98) - -Who is affected and how. - -*** - -### suggestedFix - -> **suggestedFix**: `string` - -Defined in: [profiles/ui-auditor/substrate.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L100) - -A specific change a contributor could apply without asking back. - -*** - -### reproSteps? - -> `optional` **reproSteps?**: `string` - -Defined in: [profiles/ui-auditor/substrate.ts:102](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L102) - -Optional explicit reproduction steps. Writer synthesizes from route/url/selector when omitted. - -*** - -### tags? - -> `optional` **tags?**: readonly `string`[] - -Defined in: [profiles/ui-auditor/substrate.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L104) - -Free-form tags. - -*** - -### screenshots - -> **screenshots**: readonly [`UiFindingScreenshot`](UiFindingScreenshot.md)[] - -Defined in: [profiles/ui-auditor/substrate.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L106) - -Screenshot references — must be non-empty for actionable findings. - -*** - -### similarTo? - -> `optional` **similarTo?**: readonly `number`[] - -Defined in: [profiles/ui-auditor/substrate.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L108) - -Cross-references to similar findings already on file, by id. - -*** - -### createdAt? - -> `optional` **createdAt?**: `string` - -Defined in: [profiles/ui-auditor/substrate.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L110) - -ISO-8601 creation timestamp set by the writer when persisted. diff --git a/docs/api/profiles/interfaces/UiFindingScreenshot.md b/docs/api/profiles/interfaces/UiFindingScreenshot.md deleted file mode 100644 index 8f93c9c..0000000 --- a/docs/api/profiles/interfaces/UiFindingScreenshot.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / UiFindingScreenshot - -# Interface: UiFindingScreenshot - -Defined in: [profiles/ui-auditor/substrate.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L68) - -Pointer to a screenshot referenced by a finding (workspace-relative path). - -## Properties - -### path - -> **path**: `string` - -Defined in: [profiles/ui-auditor/substrate.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L69) - -*** - -### viewport? - -> `optional` **viewport?**: `string` - -Defined in: [profiles/ui-auditor/substrate.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L70) - -*** - -### label? - -> `optional` **label?**: `string` - -Defined in: [profiles/ui-auditor/substrate.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L71) diff --git a/docs/api/profiles/interfaces/UiJudgeInput.md b/docs/api/profiles/interfaces/UiJudgeInput.md deleted file mode 100644 index 4a6979d..0000000 --- a/docs/api/profiles/interfaces/UiJudgeInput.md +++ /dev/null @@ -1,79 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / UiJudgeInput - -# Interface: UiJudgeInput - -Defined in: [profiles/ui-auditor/judge.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L36) - -**`Experimental`** - -## Properties - -### lens - -> **lens**: [`UiLens`](../type-aliases/UiLens.md) - -Defined in: [profiles/ui-auditor/judge.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L37) - -**`Experimental`** - -*** - -### captures - -> **captures**: readonly [`UiAuditCapture`](UiAuditCapture.md)[] - -Defined in: [profiles/ui-auditor/judge.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L38) - -**`Experimental`** - -*** - -### productContext? - -> `optional` **productContext?**: `string` - -Defined in: [profiles/ui-auditor/judge.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L40) - -**`Experimental`** - -Free-form product context the consumer wants the judge to know. - -*** - -### knownFindingIds? - -> `optional` **knownFindingIds?**: readonly `number`[] - -Defined in: [profiles/ui-auditor/judge.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L42) - -**`Experimental`** - -Findings already on file across earlier iterations — for similarTo linkage. - -*** - -### promptText - -> **promptText**: `string` - -Defined in: [profiles/ui-auditor/judge.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L44) - -**`Experimental`** - -The full prompt the loop kernel synthesized for this iteration. - -*** - -### signal - -> **signal**: `AbortSignal` - -Defined in: [profiles/ui-auditor/judge.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L46) - -**`Experimental`** - -Cooperative cancellation. diff --git a/docs/api/profiles/interfaces/UiJudgeOutput.md b/docs/api/profiles/interfaces/UiJudgeOutput.md deleted file mode 100644 index eea3a8f..0000000 --- a/docs/api/profiles/interfaces/UiJudgeOutput.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / UiJudgeOutput - -# Interface: UiJudgeOutput - -Defined in: [profiles/ui-auditor/judge.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L50) - -**`Experimental`** - -## Properties - -### findings - -> **findings**: [`UiFinding`](UiFinding.md)[] - -Defined in: [profiles/ui-auditor/judge.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L51) - -**`Experimental`** - -*** - -### notes? - -> `optional` **notes?**: `string` - -Defined in: [profiles/ui-auditor/judge.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L53) - -**`Experimental`** - -Optional triage commentary. - -*** - -### tokenUsage? - -> `optional` **tokenUsage?**: [`UiJudgeTokenUsage`](UiJudgeTokenUsage.md) - -Defined in: [profiles/ui-auditor/judge.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L55) - -**`Experimental`** - -Optional usage; folded into the kernel cost ledger when present. - -*** - -### costUsd? - -> `optional` **costUsd?**: `number` - -Defined in: [profiles/ui-auditor/judge.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L57) - -**`Experimental`** - -Optional total cost in USD. diff --git a/docs/api/profiles/interfaces/UiJudgeTokenUsage.md b/docs/api/profiles/interfaces/UiJudgeTokenUsage.md deleted file mode 100644 index 2c4d6ca..0000000 --- a/docs/api/profiles/interfaces/UiJudgeTokenUsage.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / UiJudgeTokenUsage - -# Interface: UiJudgeTokenUsage - -Defined in: [profiles/ui-auditor/judge.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L30) - -**`Experimental`** - -## Properties - -### input - -> **input**: `number` - -Defined in: [profiles/ui-auditor/judge.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L31) - -**`Experimental`** - -*** - -### output - -> **output**: `number` - -Defined in: [profiles/ui-auditor/judge.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L32) - -**`Experimental`** diff --git a/docs/api/profiles/type-aliases/UiFindingSeverity.md b/docs/api/profiles/type-aliases/UiFindingSeverity.md deleted file mode 100644 index e9f5df8..0000000 --- a/docs/api/profiles/type-aliases/UiFindingSeverity.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / UiFindingSeverity - -# Type Alias: UiFindingSeverity - -> **UiFindingSeverity** = `"low"` \| `"med"` \| `"high"` \| `"critical"` - -Defined in: [profiles/ui-auditor/substrate.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L57) - -Severity scale. - - `critical` — blocks a core task or is an accessibility blocker. - - `high` — confusing, broken-looking, or noticeable friction. - - `med` — visible polish issue, would be caught in code review. - - `low` — nitpick worth fixing eventually. diff --git a/docs/api/profiles/type-aliases/UiJudge.md b/docs/api/profiles/type-aliases/UiJudge.md deleted file mode 100644 index f636671..0000000 --- a/docs/api/profiles/type-aliases/UiJudge.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / UiJudge - -# Type Alias: UiJudge - -> **UiJudge** = (`input`) => `Promise`\<[`UiJudgeOutput`](../interfaces/UiJudgeOutput.md)\> - -Defined in: [profiles/ui-auditor/judge.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/judge.ts#L61) - -**`Experimental`** - -## Parameters - -### input - -[`UiJudgeInput`](../interfaces/UiJudgeInput.md) - -## Returns - -`Promise`\<[`UiJudgeOutput`](../interfaces/UiJudgeOutput.md)\> diff --git a/docs/api/profiles/type-aliases/UiLens.md b/docs/api/profiles/type-aliases/UiLens.md deleted file mode 100644 index 07fd23d..0000000 --- a/docs/api/profiles/type-aliases/UiLens.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / UiLens - -# Type Alias: UiLens - -> **UiLens** = `"consistency"` \| `"hierarchy"` \| `"layout"` \| `"ux-flow"` \| `"duplication"` \| `"accessibility"` \| `"responsive"` \| `"states"` \| `"content"` \| `"interaction"` \| `"performance-perceived"` \| `"other"` - -Defined in: [profiles/ui-auditor/substrate.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L20) - -Canonical audit lenses. Each lens scopes a finding to a single class of -problem so a single audit pass can iterate them without pile-on findings -under a generic label. diff --git a/docs/api/profiles/variables/DEFAULT_CODER_SYSTEM_PROMPT.md b/docs/api/profiles/variables/DEFAULT_CODER_SYSTEM_PROMPT.md deleted file mode 100644 index d8cd89b..0000000 --- a/docs/api/profiles/variables/DEFAULT_CODER_SYSTEM_PROMPT.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / DEFAULT\_CODER\_SYSTEM\_PROMPT - -# Variable: DEFAULT\_CODER\_SYSTEM\_PROMPT - -> `const` **DEFAULT\_CODER\_SYSTEM\_PROMPT**: `string` - -Defined in: [profiles/coder.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L43) - -**`Experimental`** - -The coder agent's standing instruction (its body lives in `coderProfile.prompt`). diff --git a/docs/api/profiles/variables/LENS_BRIEFS.md b/docs/api/profiles/variables/LENS_BRIEFS.md deleted file mode 100644 index 0fcd1b1..0000000 --- a/docs/api/profiles/variables/LENS_BRIEFS.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / LENS\_BRIEFS - -# Variable: LENS\_BRIEFS - -> `const` **LENS\_BRIEFS**: `Record`\<[`UiLens`](../type-aliases/UiLens.md), `string`\> - -Defined in: [profiles/ui-auditor/lens-prompts.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/lens-prompts.ts#L39) - -**`Experimental`** diff --git a/docs/api/profiles/variables/SHARED_AUDITOR_RULES.md b/docs/api/profiles/variables/SHARED_AUDITOR_RULES.md deleted file mode 100644 index c5837d5..0000000 --- a/docs/api/profiles/variables/SHARED_AUDITOR_RULES.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / SHARED\_AUDITOR\_RULES - -# Variable: SHARED\_AUDITOR\_RULES - -> `const` **SHARED\_AUDITOR\_RULES**: `string` - -Defined in: [profiles/ui-auditor/lens-prompts.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/lens-prompts.ts#L17) - -**`Experimental`** diff --git a/docs/api/profiles/variables/UI_FINDING_SEVERITIES.md b/docs/api/profiles/variables/UI_FINDING_SEVERITIES.md deleted file mode 100644 index c8f5f14..0000000 --- a/docs/api/profiles/variables/UI_FINDING_SEVERITIES.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / UI\_FINDING\_SEVERITIES - -# Variable: UI\_FINDING\_SEVERITIES - -> `const` **UI\_FINDING\_SEVERITIES**: readonly [`UiFindingSeverity`](../type-aliases/UiFindingSeverity.md)[] - -Defined in: [profiles/ui-auditor/substrate.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L60) - -Frozen severity tuple, ordered worst → least bad for sort/report. diff --git a/docs/api/profiles/variables/UI_LENSES.md b/docs/api/profiles/variables/UI_LENSES.md deleted file mode 100644 index c6b78dd..0000000 --- a/docs/api/profiles/variables/UI_LENSES.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / UI\_LENSES - -# Variable: UI\_LENSES - -> `const` **UI\_LENSES**: readonly [`UiLens`](../type-aliases/UiLens.md)[] - -Defined in: [profiles/ui-auditor/substrate.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/ui-auditor/substrate.ts#L35) - -Frozen tuple of lenses for validation + iteration. diff --git a/docs/api/profiles/variables/coderProfile.md b/docs/api/profiles/variables/coderProfile.md deleted file mode 100644 index dd529d0..0000000 --- a/docs/api/profiles/variables/coderProfile.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [profiles](../README.md) / coderProfile - -# Variable: coderProfile - -> `const` **coderProfile**: `AgentProfile` - -Defined in: [profiles/coder.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/profiles/coder.ts#L72) - -**`Experimental`** - -The coder `AgentProfile` — the §1.5 DATA the substrate materializes into a harness invocation. -Stateless and harness-agnostic: a consumer overrides `model`/`metadata.backendType` by spreading -a copy, never by a factory. `worktreeFanout` authors one such profile per harness leaf. diff --git a/docs/api/runtime.md b/docs/api/runtime.md new file mode 100644 index 0000000..cb8a95d --- /dev/null +++ b/docs/api/runtime.md @@ -0,0 +1,16380 @@ +[**@tangle-network/agent-runtime**](README.md) + +*** + +[@tangle-network/agent-runtime](README.md) / runtime + +# runtime + +## Classes + +### InMemoryResultBlobStore + +Defined in: [durable/spawn-journal.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L69) + +In-memory `ResultBlobStore`. Content-addressed: `put` verifies the supplied +`outRef` matches the artifact's hash so a stale/forged ref fails loud rather than +silently rehydrating the wrong payload. Idempotent on an identical re-put. + +#### Implements + +- [`ResultBlobStore`](#resultblobstore) + +#### Constructors + +##### Constructor + +> **new InMemoryResultBlobStore**(): [`InMemoryResultBlobStore`](#inmemoryresultblobstore) + +###### Returns + +[`InMemoryResultBlobStore`](#inmemoryresultblobstore) + +#### Methods + +##### put() + +> **put**(`outRef`, `artifact`): `Promise`\<`void`\> + +Defined in: [durable/spawn-journal.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L72) + +###### Parameters + +###### outRef + +`string` + +###### artifact + +`unknown` + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`ResultBlobStore`](#resultblobstore).[`put`](#put-2) + +##### get() + +> **get**(`outRef`): `Promise`\<`unknown`\> + +Defined in: [durable/spawn-journal.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L77) + +###### Parameters + +###### outRef + +`string` + +###### Returns + +`Promise`\<`unknown`\> + +###### Implementation of + +[`ResultBlobStore`](#resultblobstore).[`get`](#get-2) + +*** + +### FileResultBlobStore + +Defined in: [durable/spawn-journal.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L87) + +FS `ResultBlobStore`. One JSON file per artifact under `dir`, named by a +filesystem-safe encoding of the `outRef` (`sha256:` → `sha256-.json`). +`put` fsyncs so a crash between writes never loses an acknowledged blob. + +#### Implements + +- [`ResultBlobStore`](#resultblobstore) + +#### Constructors + +##### Constructor + +> **new FileResultBlobStore**(`dir`): [`FileResultBlobStore`](#fileresultblobstore) + +Defined in: [durable/spawn-journal.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L88) + +###### Parameters + +###### dir + +`string` + +###### Returns + +[`FileResultBlobStore`](#fileresultblobstore) + +#### Methods + +##### put() + +> **put**(`outRef`, `artifact`): `Promise`\<`void`\> + +Defined in: [durable/spawn-journal.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L90) + +###### Parameters + +###### outRef + +`string` + +###### artifact + +`unknown` + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`ResultBlobStore`](#resultblobstore).[`put`](#put-2) + +##### get() + +> **get**(`outRef`): `Promise`\<`unknown`\> + +Defined in: [durable/spawn-journal.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L103) + +###### Parameters + +###### outRef + +`string` + +###### Returns + +`Promise`\<`unknown`\> + +###### Implementation of + +[`ResultBlobStore`](#resultblobstore).[`get`](#get-2) + +*** + +### InMemorySpawnJournal + +Defined in: [durable/spawn-journal.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L139) + +In-memory `SpawnJournal`. Appends are observed-committed only; the impl enforces +the corruption guards a durable replay rests on: + - an event before `beginTree` is a corrupted tree (fail loud), + - a duplicate `seq` within a tree is a corrupted cursor (fail loud) — two + settlements cannot share the cursor position replay orders by. + +#### Implements + +- [`SpawnJournal`](#spawnjournal) + +#### Constructors + +##### Constructor + +> **new InMemorySpawnJournal**(): [`InMemorySpawnJournal`](#inmemoryspawnjournal) + +###### Returns + +[`InMemorySpawnJournal`](#inmemoryspawnjournal) + +#### Methods + +##### loadTree() + +> **loadTree**(`root`): `Promise`\<[`SpawnEvent`](#spawnevent)[] \| `undefined`\> + +Defined in: [durable/spawn-journal.ts:142](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L142) + +###### Parameters + +###### root + +`string` + +###### Returns + +`Promise`\<[`SpawnEvent`](#spawnevent)[] \| `undefined`\> + +###### Implementation of + +[`SpawnJournal`](#spawnjournal).[`loadTree`](#loadtree-2) + +##### beginTree() + +> **beginTree**(`root`, `at`): `Promise`\<`void`\> + +Defined in: [durable/spawn-journal.ts:148](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L148) + +###### Parameters + +###### root + +`string` + +###### at + +`string` + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`SpawnJournal`](#spawnjournal).[`beginTree`](#begintree-2) + +##### appendEvent() + +> **appendEvent**(`root`, `ev`): `Promise`\<`void`\> + +Defined in: [durable/spawn-journal.ts:161](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L161) + +###### Parameters + +###### root + +`string` + +###### ev + +[`SpawnEvent`](#spawnevent) + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`SpawnJournal`](#spawnjournal).[`appendEvent`](#appendevent-2) + +*** + +### FileSpawnJournal + +Defined in: [durable/spawn-journal.ts:178](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L178) + +JSONL on disk. One line per record: the first record is `begin`, subsequent records +are `event` envelopes wrapping a `SpawnEvent`. `loadTree` replays the whole file, +filtering by `root`, and applies the same begin-precedes-events + unique-seq +corruption guards as the in-memory impl. Each append fsyncs so a crash between +writes never loses an acknowledged event. + +#### Implements + +- [`SpawnJournal`](#spawnjournal) + +#### Constructors + +##### Constructor + +> **new FileSpawnJournal**(`path`): [`FileSpawnJournal`](#filespawnjournal) + +Defined in: [durable/spawn-journal.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L179) + +###### Parameters + +###### path + +`string` + +###### Returns + +[`FileSpawnJournal`](#filespawnjournal) + +#### Methods + +##### loadTree() + +> **loadTree**(`root`): `Promise`\<[`SpawnEvent`](#spawnevent)[] \| `undefined`\> + +Defined in: [durable/spawn-journal.ts:181](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L181) + +###### Parameters + +###### root + +`string` + +###### Returns + +`Promise`\<[`SpawnEvent`](#spawnevent)[] \| `undefined`\> + +###### Implementation of + +[`SpawnJournal`](#spawnjournal).[`loadTree`](#loadtree-2) + +##### beginTree() + +> **beginTree**(`root`, `at`): `Promise`\<`void`\> + +Defined in: [durable/spawn-journal.ts:211](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L211) + +###### Parameters + +###### root + +`string` + +###### at + +`string` + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`SpawnJournal`](#spawnjournal).[`beginTree`](#begintree-2) + +##### appendEvent() + +> **appendEvent**(`root`, `ev`): `Promise`\<`void`\> + +Defined in: [durable/spawn-journal.ts:224](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L224) + +###### Parameters + +###### root + +`string` + +###### ev + +[`SpawnEvent`](#spawnevent) + +###### Returns + +`Promise`\<`void`\> + +###### Implementation of + +[`SpawnJournal`](#spawnjournal).[`appendEvent`](#appendevent-2) + +*** + +### InMemoryCorpus + +Defined in: [runtime/personify/corpus.ts:161](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/corpus.ts#L161) + +In-memory `Corpus`. Keyed by record `id`; `append` validates the record, is idempotent on an +identical re-append, and returns a typed `{ succeeded: false }` on a conflicting re-append under +the same `id` (never overwrites). `query` routes through the single-sourced `applyFilter`. + +#### Implements + +- [`Corpus`](#corpus-2) + +#### Constructors + +##### Constructor + +> **new InMemoryCorpus**(): [`InMemoryCorpus`](#inmemorycorpus) + +###### Returns + +[`InMemoryCorpus`](#inmemorycorpus) + +#### Methods + +##### append() + +> **append**(`record`): `Promise`\<\{ `succeeded`: `true`; \} \| \{ `succeeded`: `false`; `error`: `string`; \}\> + +Defined in: [runtime/personify/corpus.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/corpus.ts#L164) + +Append one accreted fact. Idempotent on an identical record; returns a typed outcome — + inspect `succeeded` before treating it as durable (no silent write-through on conflict). + +###### Parameters + +###### record + +[`CorpusRecord`](#corpusrecord) + +###### Returns + +`Promise`\<\{ `succeeded`: `true`; \} \| \{ `succeeded`: `false`; `error`: `string`; \}\> + +###### Implementation of + +[`Corpus`](#corpus-2).[`append`](#append-2) + +##### query() + +> **query**(`filter`): `Promise`\ + +Defined in: [runtime/personify/corpus.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/corpus.ts#L186) + +Query accreted facts by filter — most-confident first. Returns the matching records (an + empty array when none match is a valid result, NOT an error). + +###### Parameters + +###### filter + +[`CorpusFilter`](#corpusfilter) + +###### Returns + +`Promise`\ + +###### Implementation of + +[`Corpus`](#corpus-2).[`query`](#query-2) + +*** + +### FileCorpus + +Defined in: [runtime/personify/corpus.ts:202](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/corpus.ts#L202) + +JSONL on disk — one validated `CorpusRecord` per line, append-only. `query` replays the whole +file, validating every line (a malformed line fails loud — a corrupted corpus must never read +back silently) and folding by `id`: a later identical line dedups, a later conflicting line +under the same `id` is a corruption (fail loud). `append` first replays to enforce the same +idempotence/conflict contract as the in-mem impl, then fsyncs the new line so a crash between +writes never loses an acknowledged fact. Shares the JSONL append-line spine with the spawn +journal, but the interface stays separate (a learned fact is not a replay record). + +#### Implements + +- [`Corpus`](#corpus-2) + +#### Constructors + +##### Constructor + +> **new FileCorpus**(`path`): [`FileCorpus`](#filecorpus) + +Defined in: [runtime/personify/corpus.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/corpus.ts#L203) + +###### Parameters + +###### path + +`string` + +###### Returns + +[`FileCorpus`](#filecorpus) + +#### Methods + +##### append() + +> **append**(`record`): `Promise`\<\{ `succeeded`: `true`; \} \| \{ `succeeded`: `false`; `error`: `string`; \}\> + +Defined in: [runtime/personify/corpus.ts:205](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/corpus.ts#L205) + +Append one accreted fact. Idempotent on an identical record; returns a typed outcome — + inspect `succeeded` before treating it as durable (no silent write-through on conflict). + +###### Parameters + +###### record + +[`CorpusRecord`](#corpusrecord) + +###### Returns + +`Promise`\<\{ `succeeded`: `true`; \} \| \{ `succeeded`: `false`; `error`: `string`; \}\> + +###### Implementation of + +[`Corpus`](#corpus-2).[`append`](#append-2) + +##### query() + +> **query**(`filter`): `Promise`\ + +Defined in: [runtime/personify/corpus.ts:233](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/corpus.ts#L233) + +Query accreted facts by filter — most-confident first. Returns the matching records (an + empty array when none match is a valid result, NOT an error). + +###### Parameters + +###### filter + +[`CorpusFilter`](#corpusfilter) + +###### Returns + +`Promise`\ + +###### Implementation of + +[`Corpus`](#corpus-2).[`query`](#query-2) + +## Interfaces + +### WorktreeCommandResult + +Defined in: [mcp/worktree-harness.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree-harness.ts#L39) + +Outcome of one verification command run in the worktree (test or typecheck). + +#### Properties + +##### command + +> **command**: `string` + +Defined in: [mcp/worktree-harness.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree-harness.ts#L41) + +The shell command line that was run. + +##### passed + +> **passed**: `boolean` + +Defined in: [mcp/worktree-harness.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree-harness.ts#L43) + +Did the command exit 0? The PASS signal a deliverable gate / coder output reads. + +##### exitCode + +> **exitCode**: `number` \| `null` + +Defined in: [mcp/worktree-harness.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree-harness.ts#L45) + +OS exit code, or `null` when killed before exit. + +##### output + +> **output**: `string` + +Defined in: [mcp/worktree-harness.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree-harness.ts#L47) + +Combined stdout+stderr (capped) — surfaced in traces for diagnosis. + +*** + +### AnytimeTaskCurve + +Defined in: [runtime/anytime.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L25) + +#### Properties + +##### taskId + +> **taskId**: `string` + +Defined in: [runtime/anytime.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L26) + +##### strategy + +> **strategy**: `string` + +Defined in: [runtime/anytime.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L27) + +##### points + +> **points**: `object`[] + +Defined in: [runtime/anytime.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L30) + +Best-so-far after each settled shot: elapsed ms from the task's first spawn, + cumulative usd, and the running max score. + +###### elapsedMs + +> **elapsedMs**: `number` + +###### cumUsd + +> **cumUsd**: `number` + +###### best + +> **best**: `number` + +##### hits + +> **hits**: `Record`\<`string`, \{ `ms`: `number`; `shots`: `number`; `usd`: `number`; \} \| `null`\> + +Defined in: [runtime/anytime.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L33) + +Per satisficing target (keyed by the target value as a string): the first point + where best ≥ target, or null when never reached within budget. + +*** + +### AnytimeStrategySummary + +Defined in: [runtime/anytime.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L36) + +#### Properties + +##### strategy + +> **strategy**: `string` + +Defined in: [runtime/anytime.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L37) + +##### target + +> **target**: `number` + +Defined in: [runtime/anytime.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L39) + +The satisficing target this row summarizes. + +##### tasks + +> **tasks**: `number` + +Defined in: [runtime/anytime.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L40) + +##### reachedTarget + +> **reachedTarget**: `number` + +Defined in: [runtime/anytime.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L41) + +##### medianTttMs + +> **medianTttMs**: `number` \| `null` + +Defined in: [runtime/anytime.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L43) + +Median time-to-target over the tasks that reached it (null when none did). + +##### medianShotsToTarget + +> **medianShotsToTarget**: `number` \| `null` + +Defined in: [runtime/anytime.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L44) + +##### ertMs + +> **ertMs**: `number` \| `null` + +Defined in: [runtime/anytime.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L46) + +COCO ERT: Σ all task wall-time (incl. failures) / #successes. Null when 0 succeed. + +##### erUsd + +> **erUsd**: `number` \| `null` + +Defined in: [runtime/anytime.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L48) + +Same construction over dollars: Σ all spend / #successes. + +##### curveByShot + +> **curveByShot**: `number`[] + +Defined in: [runtime/anytime.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L50) + +Mean best-so-far score by shot index (the anytime curve, averaged over tasks). + +##### auc + +> **auc**: `number` + +Defined in: [runtime/anytime.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L52) + +Area under the per-shot anytime curve, normalized to [0,1]. + +*** + +### AnytimeReport + +Defined in: [runtime/anytime.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L55) + +#### Properties + +##### targets + +> **targets**: `number`[] + +Defined in: [runtime/anytime.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L56) + +##### perTask + +> **perTask**: [`AnytimeTaskCurve`](#anytimetaskcurve)[] + +Defined in: [runtime/anytime.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L57) + +##### perStrategy + +> **perStrategy**: [`AnytimeStrategySummary`](#anytimestrategysummary)[] + +Defined in: [runtime/anytime.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L59) + +One summary per (strategy, target) pair — the COCO-style multi-target view. + +*** + +### AuditIntentInput + +Defined in: [runtime/audit-intent.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L29) + +#### Properties + +##### declaredIntent + +> **declaredIntent**: `string` + +Defined in: [runtime/audit-intent.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L31) + +The declared intent: the task text / acceptance criteria the agent was given. + +##### trace + +> **trace**: readonly `unknown`[] + +Defined in: [runtime/audit-intent.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L33) + +The trajectory so far — tool calls + results + assistant turns (any event shapes). + +##### userIntent? + +> `optional` **userIntent?**: `string` + +Defined in: [runtime/audit-intent.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L35) + +The principal's actual intent when it differs from the literal task (the contract). + +##### metaIntent? + +> `optional` **metaIntent?**: `string` + +Defined in: [runtime/audit-intent.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L38) + +The loop-level purpose (meta-intent): what the WHOLE run is for — lets the auditor + flag locally-sensible work that serves the wrong larger objective. + +##### runId? + +> `optional` **runId?**: `string` + +Defined in: [runtime/audit-intent.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L39) + +*** + +### AuditIntentOptions + +Defined in: [runtime/audit-intent.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L42) + +#### Properties + +##### chat + +> **chat**: `ChatClient` + +Defined in: [runtime/audit-intent.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L43) + +##### model? + +> `optional` **model?**: `string` + +Defined in: [runtime/audit-intent.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L44) + +##### auditorInstruction? + +> `optional` **auditorInstruction?**: `string` + +Defined in: [runtime/audit-intent.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L46) + +Override the auditor instruction (optimizable like any analyst prompt). + +##### maxTraceLines? + +> `optional` **maxTraceLines?**: `number` + +Defined in: [runtime/audit-intent.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L48) + +Cap trace lines fed to the auditor. Default 80. + +##### signal? + +> `optional` **signal?**: `AbortSignal` + +Defined in: [runtime/audit-intent.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L49) + +*** + +### IntentAudit + +Defined in: [runtime/audit-intent.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L52) + +#### Properties + +##### revealedIntent + +> **revealedIntent**: `string` + +Defined in: [runtime/audit-intent.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L54) + +What the agent's actions reveal it is actually optimizing — one sentence. + +##### verdict + +> **verdict**: `"aligned"` \| `"drifting"` \| `"diverged"` + +Defined in: [runtime/audit-intent.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L55) + +##### evidence + +> **evidence**: `string` + +Defined in: [runtime/audit-intent.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L57) + +Trajectory-grounded evidence for the verdict (specific calls/patterns). + +##### recommendation + +> **recommendation**: `"abort"` \| `"continue"` \| `"steer"` + +Defined in: [runtime/audit-intent.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L59) + +The single recommended intervention. + +##### steer? + +> `optional` **steer?**: `string` + +Defined in: [runtime/audit-intent.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L61) + +When recommendation is 'steer': the corrective instruction to inject. + +##### confidence + +> **confidence**: `number` + +Defined in: [runtime/audit-intent.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L62) + +*** + +### CompletionEvidence + +Defined in: [runtime/completion.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L29) + +Trace-derived evidence for a completion claim — an artifact (output) or a verifier metric, + never the judge's own verdict. Mirrors the steer-firewall's provenance discipline. + +#### Properties + +##### kind + +> **kind**: `"artifact"` \| `"metric"` + +Defined in: [runtime/completion.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L30) + +##### uri + +> **uri**: `string` + +Defined in: [runtime/completion.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L31) + +*** + +### CompletionVerdict + +Defined in: [runtime/completion.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L35) + +The "is it done?" verdict an analyst returns to the parent. + +#### Properties + +##### done + +> **done**: `boolean` + +Defined in: [runtime/completion.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L36) + +##### determinism + +> **determinism**: `"deterministic"` \| `"probabilistic"` + +Defined in: [runtime/completion.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L38) + +How verifiable the claim is — sets whether the driver trusts it or validates it. + +##### reasons? + +> `optional` **reasons?**: `string` + +Defined in: [runtime/completion.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L40) + +Why the analyst believes it is (or isn't) done — what the driver validates. + +##### confidence? + +> `optional` **confidence?**: `number` + +Defined in: [runtime/completion.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L42) + +0..1, for probabilistic verdicts; the driver's validation threshold reads this. + +##### evidence? + +> `optional` **evidence?**: readonly [`CompletionEvidence`](#completionevidence)[] + +Defined in: [runtime/completion.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L43) + +*** + +### CompletionAnalyst + +Defined in: [runtime/completion.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L48) + +Reads a node's trace → a completion verdict. Same input shape as the `analyze` hook, so + ONE analyst node can back both channels (findings for steer, a verdict for stop). + +#### Type Parameters + +##### Task + +`Task` + +##### Output + +`Output` + +#### Methods + +##### assess() + +> **assess**(`input`): [`CompletionVerdict`](#completionverdict) \| `Promise`\<[`CompletionVerdict`](#completionverdict)\> + +Defined in: [runtime/completion.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L49) + +###### Parameters + +###### input + +###### task + +`Task` + +###### history + +readonly [`Iteration`](#iteration-1)\<`Task`, `Output`\>[] + +###### Returns + +[`CompletionVerdict`](#completionverdict) \| `Promise`\<[`CompletionVerdict`](#completionverdict)\> + +*** + +### CompletionPolicy + +Defined in: [runtime/completion.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L57) + +When a verdict authorizes the driver to END. Deterministic → trust (ground truth); + probabilistic → validate by confidence threshold (the driver's check). + +#### Properties + +##### minConfidence? + +> `optional` **minConfidence?**: `number` + +Defined in: [runtime/completion.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L59) + +Minimum confidence a PROBABILISTIC verdict must clear to end. Default 0.8. + +*** + +### HarvestCorpusOptions + +Defined in: [runtime/harvest-corpus.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L28) + +#### Properties + +##### runs + +> **runs**: `AsyncIterable`\<[`ObserveInput`](#observeinput), `any`, `any`\> \| `Iterable`\<[`ObserveInput`](#observeinput), `any`, `any`\> + +Defined in: [runtime/harvest-corpus.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L30) + +The completed runs to analyze — map your store's rows to `ObserveInput`. + +##### chat + +> **chat**: `ChatClient` + +Defined in: [runtime/harvest-corpus.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L32) + +The model-call seam (agent-eval `createChatClient`). + +##### model? + +> `optional` **model?**: `string` + +Defined in: [runtime/harvest-corpus.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L33) + +##### corpus + +> **corpus**: [`Corpus`](#corpus-2) + +Defined in: [runtime/harvest-corpus.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L35) + +The durable corpus the facts accrete into. + +##### tags? + +> `optional` **tags?**: readonly `string`[] + +Defined in: [runtime/harvest-corpus.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L37) + +Tags written onto learned facts (the product/domain key the read side queries by). + +##### analystInstruction? + +> `optional` **analystInstruction?**: `string` + +Defined in: [runtime/harvest-corpus.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L39) + +Override the analyst instruction (the GEPA-tunable knob). + +##### concurrency? + +> `optional` **concurrency?**: `number` + +Defined in: [runtime/harvest-corpus.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L41) + +Runs analyzed in parallel. Default 4. + +##### maxRuns? + +> `optional` **maxRuns?**: `number` + +Defined in: [runtime/harvest-corpus.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L43) + +Hard cap on runs consumed from the stream (a cost guard for unbounded stores). + +##### signal? + +> `optional` **signal?**: `AbortSignal` + +Defined in: [runtime/harvest-corpus.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L44) + +*** + +### HarvestFailure + +Defined in: [runtime/harvest-corpus.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L47) + +#### Properties + +##### runId + +> **runId**: `string` + +Defined in: [runtime/harvest-corpus.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L48) + +##### error + +> **error**: `string` + +Defined in: [runtime/harvest-corpus.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L49) + +*** + +### HarvestReport + +Defined in: [runtime/harvest-corpus.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L52) + +#### Properties + +##### runsObserved + +> **runsObserved**: `number` + +Defined in: [runtime/harvest-corpus.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L53) + +##### findings + +> **findings**: `number` + +Defined in: [runtime/harvest-corpus.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L55) + +Total findings the analyst produced (including ones already known). + +##### learned + +> **learned**: `number` + +Defined in: [runtime/harvest-corpus.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L57) + +NEW facts actually appended (idempotent dedup excludes re-learned ones). + +##### failures + +> **failures**: [`HarvestFailure`](#harvestfailure)[] + +Defined in: [runtime/harvest-corpus.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L59) + +Per-run analysis failures — reported, never silently dropped. + +*** + +### LoopDispatchOptions + +Defined in: [runtime/loop-dispatch.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L49) + +#### Type Parameters + +##### Task + +`Task` + +##### Output + +`Output` + +##### Decision + +`Decision` + +##### TScenario + +`TScenario` *extends* `Scenario` + +##### TArtifact + +`TArtifact` + +#### Properties + +##### sandboxClient + +> **sandboxClient**: [`SandboxClient`](#sandboxclient-2) + +Defined in: [runtime/loop-dispatch.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L57) + +Sandbox client used for every cell's `runLoop`. Supplied once. + +##### toLoopOptions + +> **toLoopOptions**: (`scenario`, `profile`) => [`LoopOptionsForDispatch`](#loopoptionsfordispatch)\<`Task`, `Output`, `Decision`\> + +Defined in: [runtime/loop-dispatch.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L60) + +Build the per-cell runLoop options from the scenario (+ profile, when + used with `runProfileMatrix`). + +###### Parameters + +###### scenario + +`TScenario` + +###### profile + +`AgentProfile` + +###### Returns + +[`LoopOptionsForDispatch`](#loopoptionsfordispatch)\<`Task`, `Output`, `Decision`\> + +##### toArtifact? + +> `optional` **toArtifact?**: (`result`) => `TArtifact` + +Defined in: [runtime/loop-dispatch.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L68) + +Map the finished loop to the artifact the judges score. Default: + `result.winner?.output`. A loop with no winner yields `undefined` (judges + skip the cell) — but the loop's token usage is STILL reported, so the + integrity guard sees real activity. + +###### Parameters + +###### result + +[`LoopResult`](#loopresult)\<`Task`, `Output`, `Decision`\> + +###### Returns + +`TArtifact` + +##### forwardTrace? + +> `optional` **forwardTrace?**: `boolean` + +Defined in: [runtime/loop-dispatch.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L71) + +Forward `loop.*` trace events into the campaign's scoped trace so loop + spans correlate with the cell. Default true. + +##### costSource? + +> `optional` **costSource?**: `string` + +Defined in: [runtime/loop-dispatch.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L73) + +Cost-meter source label for the loop's spend. Default `'loop'`. + +*** + +### McpEndpoint + +Defined in: [runtime/mcp-environment.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L25) + +Where a handle's MCP server lives; headers carry per-artifact scoping. + +#### Properties + +##### url + +> **url**: `string` + +Defined in: [runtime/mcp-environment.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L26) + +##### headers? + +> `optional` **headers?**: `Record`\<`string`, `string`\> + +Defined in: [runtime/mcp-environment.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L27) + +*** + +### McpEnvironmentOptions + +Defined in: [runtime/mcp-environment.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L30) + +#### Properties + +##### name + +> **name**: `string` + +Defined in: [runtime/mcp-environment.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L31) + +##### maxResultChars? + +> `optional` **maxResultChars?**: `number` + +Defined in: [runtime/mcp-environment.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L41) + +Cap on a tool result's text fed back to the worker. Default 1500 chars. + +#### Methods + +##### open() + +> **open**(`task`): `Promise`\<\{ `handle`: [`ArtifactHandle`](#artifacthandle); `endpoint`: [`McpEndpoint`](#mcpendpoint); \}\> + +Defined in: [runtime/mcp-environment.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L33) + +Create/seed the per-task artifact; return its handle + the MCP endpoint scoped to it. + +###### Parameters + +###### task + +[`AgenticTask`](#agentictask) + +###### Returns + +`Promise`\<\{ `handle`: [`ArtifactHandle`](#artifacthandle); `endpoint`: [`McpEndpoint`](#mcpendpoint); \}\> + +##### score() + +> **score**(`task`, `handle`): `Promise`\<[`SurfaceScore`](#surfacescore)\> + +Defined in: [runtime/mcp-environment.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L35) + +The deployable check over the artifact's current state. + +###### Parameters + +###### task + +[`AgenticTask`](#agentictask) + +###### handle + +[`ArtifactHandle`](#artifacthandle) + +###### Returns + +`Promise`\<[`SurfaceScore`](#surfacescore)\> + +##### close()? + +> `optional` **close**(`handle`): `Promise`\<`void`\> + +Defined in: [runtime/mcp-environment.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L37) + +Teardown (delete the seeded artifact). Optional — omit for stateless servers. + +###### Parameters + +###### handle + +[`ArtifactHandle`](#artifacthandle) + +###### Returns + +`Promise`\<`void`\> + +##### selectTools()? + +> `optional` **selectTools**(`task`, `all`): [`AgenticTool`](#agentictool)[] + +Defined in: [runtime/mcp-environment.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L39) + +Restrict/order the server's tools per task (e.g. the task's selected_tools). Default: all. + +###### Parameters + +###### task + +[`AgenticTask`](#agentictask) + +###### all + +[`AgenticTool`](#agentictool)[] + +###### Returns + +[`AgenticTool`](#agentictool)[] + +*** + +### ObserveInput + +Defined in: [runtime/observe.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L23) + +#### Properties + +##### task + +> **task**: `string` + +Defined in: [runtime/observe.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L25) + +What the worker was asked to do. + +##### output + +> **output**: `string` + +Defined in: [runtime/observe.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L27) + +What it produced (its final answer / artifact summary). + +##### trace + +> **trace**: readonly `unknown`[] + +Defined in: [runtime/observe.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L29) + +The worker's trace — any event array (sandbox events, tool-call records). + +##### outcome? + +> `optional` **outcome?**: `"failed"` \| `"unknown"` \| `"passed"` + +Defined in: [runtime/observe.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L32) + +Terminal status only (passed/failed/unknown) — NOT a judge score; the + observer never reads the verdict, it reads behavior. + +##### runId? + +> `optional` **runId?**: `string` + +Defined in: [runtime/observe.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L34) + +Provenance back to the run. + +*** + +### ObserveOptions + +Defined in: [runtime/observe.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L37) + +#### Properties + +##### chat + +> **chat**: `ChatClient` + +Defined in: [runtime/observe.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L39) + +The model-call seam (agent-eval `createChatClient`: router / cli-bridge / …). + +##### model? + +> `optional` **model?**: `string` + +Defined in: [runtime/observe.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L40) + +##### corpus? + +> `optional` **corpus?**: [`Corpus`](#corpus-2) + +Defined in: [runtime/observe.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L42) + +When set, learned facts are appended (idempotent) for the next run to read. + +##### tags? + +> `optional` **tags?**: readonly `string`[] + +Defined in: [runtime/observe.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L44) + +Tags written onto learned facts + used by the next run's corpus query. + +##### signal? + +> `optional` **signal?**: `AbortSignal` + +Defined in: [runtime/observe.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L45) + +##### maxTraceLines? + +> `optional` **maxTraceLines?**: `number` + +Defined in: [runtime/observe.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L47) + +Cap the trace lines fed to the observer (keeps the call cheap). Default 80. + +##### analystInstruction? + +> `optional` **analystInstruction?**: `string` + +Defined in: [runtime/observe.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L53) + +Override the analyst's system instruction — the prompt that turns a trace into + findings + recommended_actions. The analyst IS the steerer, so this is the knob a + prompt optimizer (GEPA) tunes. Omitted ⇒ the default observer instruction. The + firewall (trace-only, never the verdict) is structural (input has no score), so a + custom instruction cannot break it. + +*** + +### Observation + +Defined in: [runtime/observe.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L64) + +#### Properties + +##### findings + +> **findings**: `AnalystFinding`[] + +Defined in: [runtime/observe.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L65) + +##### learned + +> **learned**: [`CorpusRecord`](#corpusrecord)[] + +Defined in: [runtime/observe.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L67) + +Facts persisted to the corpus (empty when no corpus was supplied). + +##### report + +> **report**: `string` + +Defined in: [runtime/observe.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L69) + +Operator-facing markdown: what the observer noticed + what to change. + +*** + +### CreateScopeAnalystOptions + +Defined in: [runtime/personify/analyst.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L68) + +The analyst run an `Agent` performs over the children settled so far. +The combinator supplies the analyst's task projection (how to frame the drained settlements as +the analyst's input) — the analyst's `act` reads the trace and returns its raw findings; the +firewall is enforced afterwards by `createScopeAnalyst`, not by the analyst itself. + +#### Type Parameters + +##### D + +`D` + +#### Properties + +##### analyst + +> `readonly` **analyst**: [`Agent`](#agent)\<`unknown`, readonly `AnalystFinding`[]\> + +Defined in: [runtime/personify/analyst.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L72) + +The analyst agent the combinator spawns over the trace. `harness` is the persona's choice + (`null` for an inline router analyst, a `BackendType` for a sandboxed one). Its `act` returns + the RAW findings; this module asserts the firewall on them before returning. + +##### budget + +> `readonly` **budget**: [`Budget`](#budget-8) + +Defined in: [runtime/personify/analyst.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L78) + +The conserved budget reserved for one analyst spawn. The pool reserves against it and fails + closed; an analyst that cannot be admitted is a fail-loud abort, never silent empty findings. + +##### label? + +> `readonly` `optional` **label?**: `string` + +Defined in: [runtime/personify/analyst.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L80) + +Trace/journal label for the spawned analyst child. Default `'analyst'`. + +#### Methods + +##### buildTask() + +> **buildTask**(`input`): `unknown` + +Defined in: [runtime/personify/analyst.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L75) + +Build the analyst agent's task from the analyze input (the root-task framing + the children + drained so far). Pure projection — the analyst interprets it, this never reads it. + +###### Parameters + +###### input + +[`ScopeAnalyzeInput`](#scopeanalyzeinput)\<`D`\> + +###### Returns + +`unknown` + +*** + +### RegistryAnalyzeProjection + +Defined in: [runtime/personify/analyst.ts:183](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L183) + +Project a `ScopeAnalyzeInput` into the `AnalystRegistry.run` arguments. The registry runs over a +`runId` + `AnalystRunInputs` (a trace store / run record / artifact dir), NOT in-memory scope +settlements — so the CALLER owns the projection from the combinator's drained children to the +registry's inputs (e.g. the trace store the run already wrote). This adapter never invents that +bridge; it only runs the projected inputs and firewalls the merged findings. + +#### Properties + +##### runId + +> `readonly` **runId**: `string` + +Defined in: [runtime/personify/analyst.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L184) + +##### inputs + +> `readonly` **inputs**: `AnalystRunInputs` + +Defined in: [runtime/personify/analyst.ts:185](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L185) + +##### opts? + +> `readonly` `optional` **opts?**: `object` + +Defined in: [runtime/personify/analyst.ts:187](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L187) + +Optional `run` opts (e.g. `priorFindings`) forwarded verbatim to the registry. + +###### Index Signature + +\[`k`: `string`\]: `unknown` + +###### priorFindings? + +> `optional` **priorFindings?**: readonly `AnalystFinding`[] \| `Record`\<`string`, readonly `AnalystFinding`[]\> + +*** + +### Persona + +Defined in: [runtime/personify/types.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L70) + +The "act like X" record. A thin composition over the keystone's `AgentSpec`: it pairs the +root spec (the executor mapping for the root agent the shape builds) with the CONTENT a +shape consumes — the goal framing (`directive`) and who the loop is acting as (`context`). + +The framework never reads `directive`/`context` semantically; it threads them to the shape +verbatim through `ShapeContext`. This is the rule the mandate names: the FRAMEWORK is +structure, the PERSONA carries model/prompt/tools/directive. No model name, prompt, or +persona string is ever hardcoded in a shape or the engine. + +`D` is the deliverable type this persona's loops produce; it flows into `Outcome`. + +#### Type Parameters + +##### D + +`D` = `unknown` + +#### Properties + +##### name + +> `readonly` **name**: `string` + +Defined in: [runtime/personify/types.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L72) + +Stable persona name — used as the trace/journal label root, never as content. + +##### root + +> `readonly` **root**: [`AgentSpec`](#agentspec) + +Defined in: [runtime/personify/types.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L78) + +The root agent's executor mapping (profile + harness + optional BYO executor). The +shape's root `Agent` carries THIS as its `executorSpec`; child specs the shape spawns +are derived from / resolved against the same persona registry (see `ShapeContext`). + +##### directive + +> `readonly` **directive**: `string` + +Defined in: [runtime/personify/types.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L80) + +The goal framing handed to the shape — the "what to achieve", not "how". + +##### context + +> `readonly` **context**: [`PersonaContext`](#personacontext-1) + +Defined in: [runtime/personify/types.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L83) + +Who the loop is acting as — the opaque persona context blob the shape may inject into + child tasks. Opaque to the framework; only the persona's profiles/prompts interpret it. + +##### executors + +> `readonly` **executors**: [`PersonaExecutors`](#personaexecutors-1) + +Defined in: [runtime/personify/types.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L91) + +The executor seams (router endpoint+key, sandbox client, cli bin) the built-in runtimes +read off `ExecutorContext.seams`, OR a fully pre-configured registry. The supervisor +threads an EMPTY seam bag to the root scope, so a persona that uses built-in metered +runtimes MUST supply a registry whose factories close over their seams (or BYO executors +on each `AgentSpec`). Carried here so `runPersonified` can build `SupervisorOpts.executors`. + +##### extensions? + +> `readonly` `optional` **extensions?**: `Readonly`\<`Record`\<`string`, `unknown`\>\> + +Defined in: [runtime/personify/types.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L96) + +Forward-compatible extension bag — a later world-model / memory / tool-budget field is an +additive key here, never a breaking change to the `Persona` shape. Opaque to the engine. + +##### \_\_deliverable? + +> `readonly` `optional` **\_\_deliverable?**: `D` + +Defined in: [runtime/personify/types.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L99) + +Phantom: binds the persona to its deliverable type so `runPersonified` infers `D` from + the persona and the chosen shape must agree. Type-only — never present at runtime. + +*** + +### PersonaContext + +Defined in: [runtime/personify/types.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L104) + +The persona context blob — who the loop is acting as. Open by intent: a persona names its + own role/audience/constraints; the framework treats it as opaque content. + +#### Indexable + +> \[`key`: `string`\]: `unknown` + +Open content bag — persona-specific fields a shape's child tasks may carry. + +#### Properties + +##### role + +> `readonly` **role**: `string` + +Defined in: [runtime/personify/types.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L106) + +The role the loop embodies ("senior staff engineer", "equity research analyst", …). + +##### notes? + +> `readonly` `optional` **notes?**: `string` + +Defined in: [runtime/personify/types.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L108) + +Optional freeform framing the persona's prompts/profiles consume. + +*** + +### PersonaExecutors + +Defined in: [runtime/personify/types.ts:118](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L118) + +How a persona supplies executor resolution. Either a pre-built registry (factories already +closed over their seams) OR the raw seam bag the engine uses to construct a registry + +thread the seams onto each spawn. Exactly one is required — fail loud if neither is set. + +#### Properties + +##### registry? + +> `readonly` `optional` **registry?**: [`ExecutorRegistry`](#executorregistry) + +Defined in: [runtime/personify/types.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L120) + +A registry whose factories already capture their seams. Highest precedence. + +##### seams? + +> `readonly` `optional` **seams?**: `Readonly`\<`Record`\<`string`, `unknown`\>\> + +Defined in: [runtime/personify/types.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L122) + +Raw seams to thread onto built-in runtimes (`router`/`sandbox`/`cli` keys). + +*** + +### DefinePersonaInput + +Defined in: [runtime/personify/types.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L129) + +The minimal input to build a `Persona`. Mirrors `Persona` but lets the builder default + the executors-supplied invariant check and freeze the record. + +#### Type Parameters + +##### D + +`D` = `unknown` + +#### Properties + +##### name + +> `readonly` **name**: `string` + +Defined in: [runtime/personify/types.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L130) + +##### root + +> `readonly` **root**: [`AgentSpec`](#agentspec) + +Defined in: [runtime/personify/types.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L131) + +##### directive + +> `readonly` **directive**: `string` + +Defined in: [runtime/personify/types.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L132) + +##### context + +> `readonly` **context**: [`PersonaContext`](#personacontext-1) + +Defined in: [runtime/personify/types.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L133) + +##### executors + +> `readonly` **executors**: [`PersonaExecutors`](#personaexecutors-1) + +Defined in: [runtime/personify/types.ts:134](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L134) + +##### extensions? + +> `readonly` `optional` **extensions?**: `Readonly`\<`Record`\<`string`, `unknown`\>\> + +Defined in: [runtime/personify/types.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L135) + +##### \_\_deliverable? + +> `readonly` `optional` **\_\_deliverable?**: `D` + +Defined in: [runtime/personify/types.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L138) + +Phantom: pins the input's deliverable type so `definePersona` returns a `Persona` + the caller's shape must agree with. Type-only — never supplied at a call site. + +*** + +### ShapeBudget + +Defined in: [runtime/personify/types.ts:153](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L153) + +Budget knobs a shape reads to size its fanout/children WITHOUT owning the conserved pool. +The root budget lives on `SupervisorOpts.budget`; the shape only needs the per-child +sizing hints + the fanout width it is allowed to open. All ceilings — the pool reserves +against them and fails closed, so an over-eager shape can never overspend. + +#### Properties + +##### perChild + +> `readonly` **perChild**: [`Budget`](#budget-8) + +Defined in: [runtime/personify/types.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L155) + +Per-child spawn budget the shape reserves for each leaf/sub-loop it opens. + +##### fanout + +> `readonly` **fanout**: `number` + +Defined in: [runtime/personify/types.ts:157](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L157) + +Max children a fanout step may open in one round (the shape's structural width). + +*** + +### ShapeContext + +Defined in: [runtime/personify/types.ts:167](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L167) + +The construction context a `LoopShape` factory receives. Carries the persona's resolved +executor seams + the budget knobs, plus the ONE helper a shape needs to spawn a child +through the keystone: `spawnChild` resolves an `AgentSpec` (or a persona-derived child +profile) into an `Agent` the shape hands to `scope.spawn`. The shape never touches the +registry directly — it asks the context, keeping resolution single-sourced. + +#### Type Parameters + +##### D + +`D` = `unknown` + +#### Properties + +##### persona + +> `readonly` **persona**: [`Persona`](#persona)\<`D`\> + +Defined in: [runtime/personify/types.ts:168](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L168) + +##### budget + +> `readonly` **budget**: [`ShapeBudget`](#shapebudget) + +Defined in: [runtime/personify/types.ts:169](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L169) + +##### analyst? + +> `readonly` `optional` **analyst?**: [`ScopeAnalyst`](#scopeanalyst)\<`D`\> + +Defined in: [runtime/personify/types.ts:182](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L182) + +The scope analyst (selector≠judge firewall) the combinator steers from. Absent ⇒ the + dormant default (empty findings → gates read deliverables/state only). + +#### Methods + +##### spawnChild() + +> **spawnChild**(`name`, `spec`): [`Agent`](#agent)\<`unknown`, [`Outcome`](#outcome-1)\<`D`\>\> + +Defined in: [runtime/personify/types.ts:176](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L176) + +Wrap an `AgentSpec` into a leaf `Agent` carrying it as `executorSpec`, so the shape can +`scope.spawn(spawnChild(spec), task, opts)`. `name` labels the child for traces. The +returned agent's `act` is never invoked by the keystone (it is spawned, not run) — the +spec drives the resolved `Executor`; `act` exists only to satisfy the `Agent` shape. + +###### Parameters + +###### name + +`string` + +###### spec + +[`AgentSpec`](#agentspec) + +###### Returns + +[`Agent`](#agent)\<`unknown`, [`Outcome`](#outcome-1)\<`D`\>\> + +##### childSpec() + +> **childSpec**(`profile`, `harness?`): [`AgentSpec`](#agentspec) + +Defined in: [runtime/personify/types.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L179) + +Derive a child `AgentSpec` from the persona's root spec with an overridden profile — + the seam a shape uses to give a worker a narrower role/prompt than the root persona. + +###### Parameters + +###### profile + +`AgentProfile` + +###### harness? + +`BackendType` \| `null` + +###### Returns + +[`AgentSpec`](#agentspec) + +*** + +### ShapeRegistry + +Defined in: [runtime/personify/types.ts:201](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L201) + +The open shape registry — the extension point that makes a new loop-shape ONE file + one +`registerShape` call with zero edits elsewhere. `resolve` returns a typed outcome (inspect +`succeeded` before `value`); `register` fails loud on a duplicate name. + +#### Methods + +##### register() + +> **register**\<`Task`, `D`\>(`name`, `factory`): `void` + +Defined in: [runtime/personify/types.ts:202](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L202) + +###### Type Parameters + +###### Task + +`Task` + +###### D + +`D` + +###### Parameters + +###### name + +`string` + +###### factory + +[`LoopShape`](#loopshape)\<`Task`, `D`\> + +###### Returns + +`void` + +##### resolve() + +> **resolve**\<`Task`, `D`\>(`name`): \{ `succeeded`: `true`; `value`: [`LoopShape`](#loopshape)\<`Task`, `D`\>; \} \| \{ `succeeded`: `false`; `error`: `string`; \} + +Defined in: [runtime/personify/types.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L203) + +###### Type Parameters + +###### Task + +`Task` + +###### D + +`D` + +###### Parameters + +###### name + +`string` + +###### Returns + +\{ `succeeded`: `true`; `value`: [`LoopShape`](#loopshape)\<`Task`, `D`\>; \} \| \{ `succeeded`: `false`; `error`: `string`; \} + +##### names() + +> **names**(): `string`[] + +Defined in: [runtime/personify/types.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L207) + +The registered shape names — for diagnostics + a fail-loud "unknown shape" message. + +###### Returns + +`string`[] + +*** + +### RunPersonifiedOptions + +Defined in: [runtime/personify/types.ts:222](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L222) + +The end-to-end entrypoint. Builds the persona's root `Agent` from the chosen shape, then +runs it through a fresh `createSupervisor` over the persona's executors + the supplied +budget/journal/blobs. Returns the keystone's typed `SupervisedResult>` — a +`winner` carries the synthesized `Outcome`; a `no-winner` is never coerced into one. + +`shape` is either a resolved `LoopShape` or a registered shape NAME (resolved through the +default registry). The journal/blobs default to in-memory impls in the engine when omitted +(durable FS impls are passed explicitly for a persisted run). + +#### Type Parameters + +##### Task + +`Task` + +##### D + +`D` + +#### Properties + +##### persona + +> `readonly` **persona**: [`Persona`](#persona)\<`D`\> + +Defined in: [runtime/personify/types.ts:223](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L223) + +##### shape + +> `readonly` **shape**: `string` \| [`LoopShape`](#loopshape)\<`Task`, `D`\> + +Defined in: [runtime/personify/types.ts:225](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L225) + +A resolved shape factory OR a registered shape name. + +##### task + +> `readonly` **task**: `Task` + +Defined in: [runtime/personify/types.ts:226](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L226) + +##### budget + +> `readonly` **budget**: [`Budget`](#budget-8) + +Defined in: [runtime/personify/types.ts:227](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L227) + +##### shapeBudget? + +> `readonly` `optional` **shapeBudget?**: `Partial`\<[`ShapeBudget`](#shapebudget)\> + +Defined in: [runtime/personify/types.ts:229](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L229) + +Per-child sizing + fanout width handed to the shape. Defaults derive from `budget`. + +##### runId? + +> `readonly` `optional` **runId?**: `string` + +Defined in: [runtime/personify/types.ts:231](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L231) + +Trace/journal root key. Defaults to the persona name + a run discriminator in the engine. + +##### journal? + +> `readonly` `optional` **journal?**: [`SpawnJournal`](#spawnjournal) + +Defined in: [runtime/personify/types.ts:232](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L232) + +##### blobs? + +> `readonly` `optional` **blobs?**: [`ResultBlobStore`](#resultblobstore) + +Defined in: [runtime/personify/types.ts:233](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L233) + +##### maxDepth? + +> `readonly` `optional` **maxDepth?**: `number` + +Defined in: [runtime/personify/types.ts:235](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L235) + +Runtime recursion-depth ceiling, paired with the conserved pool. + +##### maxRestarts? + +> `readonly` `optional` **maxRestarts?**: `number` + +Defined in: [runtime/personify/types.ts:237](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L237) + +OTP intensity breaker bounds, forwarded to the supervisor verbatim. + +##### withinMs? + +> `readonly` `optional` **withinMs?**: `number` + +Defined in: [runtime/personify/types.ts:238](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L238) + +##### handle? + +> `readonly` `optional` **handle?**: [`RootHandle`](#roothandle)\<[`Outcome`](#outcome-1)\<`D`\>\> + +Defined in: [runtime/personify/types.ts:240](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L240) + +A live root handle to attach (view/signal/abort) before the run starts. + +##### now? + +> `readonly` `optional` **now?**: () => `number` + +Defined in: [runtime/personify/types.ts:241](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L241) + +###### Returns + +`number` + +##### signal? + +> `readonly` `optional` **signal?**: `AbortSignal` + +Defined in: [runtime/personify/types.ts:242](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L242) + +##### analyst? + +> `readonly` `optional` **analyst?**: [`ScopeAnalyst`](#scopeanalyst)\<`D`\> + +Defined in: [runtime/personify/types.ts:245](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L245) + +Optional scope analyst threaded into the shape's ShapeContext so loopUntil/widen steer + on trace-derived findings instead of the dormant empty default. + +##### hooks? + +> `readonly` `optional` **hooks?**: [`RuntimeHooks`](index.md#runtimehooks) + +Defined in: [runtime/personify/types.ts:251](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L251) + +Lifecycle stream sink, forwarded to `SupervisorOpts.hooks` so the root `Scope`'s +`agent.spawn`/`agent.child` events flow to an observer (e.g. the Intelligence SDK's +trace export). Absent ⇒ no stream (the run is silent, as today). + +*** + +### PipelineStage + +Defined in: [runtime/personify/wave-types.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L76) + +`pipeline(stages)` — sequential composition: each stage's `Outcome.deliverable` feeds the next +stage's task (via `feed`). The first `blocked` stage short-circuits the whole pipeline (its +blockers ARE the pipeline's blockers — never coerced past a failed stage). The terminal +stage's `done` deliverable is the pipeline's deliverable. Spawns one child per stage in order; +a stage that the conserved pool cannot admit is a concrete blocker. + +No domain: "code build test" is `pipeline([plan, implement, integrate])` under a coder persona, +not a named shape. A stage names only its label + how to derive its task from the prior output. + +#### Type Parameters + +##### Task + +`Task` + +##### StepIn + +`StepIn` + +##### StepOut + +`StepOut` + +#### Properties + +##### label + +> `readonly` **label**: `string` + +Defined in: [runtime/personify/wave-types.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L78) + +Trace/journal label for this stage's spawned child. + +#### Methods + +##### feed() + +> **feed**(`prior`, `ctx`, `rootTask`): `unknown` + +Defined in: [runtime/personify/wave-types.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L81) + +Derive this stage's task from the prior stage's deliverable (or the root task for stage 0). + Pure projection — the framework never interprets the result; the resolved leaf does. + +###### Parameters + +###### prior + +`StepIn` + +###### ctx + +[`ShapeContext`](#shapecontext)\<`unknown`\> + +###### rootTask + +`Task` + +###### Returns + +`unknown` + +##### collect() + +> **collect**(`settled`): [`Outcome`](#outcome-1)\<`StepOut`\> + +Defined in: [runtime/personify/wave-types.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L84) + +Read this stage's settled child output into the typed `StepOut` the next stage feeds on. + Fail loud (return a `blocked`) when the child produced nothing usable for the next stage. + +###### Parameters + +###### settled + +[`Settled`](#settled-2)\<[`Outcome`](#outcome-1)\<`StepOut`\>\> + +###### Returns + +[`Outcome`](#outcome-1)\<`StepOut`\> + +*** + +### FanoutOptions + +Defined in: [runtime/personify/wave-types.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L105) + +`fanout(items, { synthesize? })` — N children spawned in one round (one per item, bounded by +the conserved pool's fail-closed admission), drained via `scope.next()`, then optionally a +single SYNTHESIS child over the gathered results. Without `synthesize`, the combinator returns +the best-valid child via the single-sourced selector (selector≠judge). A round that admitted +zero children, or whose synthesis child could not be admitted, is a concrete blocker. + +No domain: a "research sweep over angles" is `fanout(angles, { synthesize: cite })` under a +research persona; a "fanout-vote" is `fanout(copies)` with the default selector. The item list ++ the synthesis posture are the SHAPE's args; the prompt that turns an item into work is the +persona's. + +#### Type Parameters + +##### Item + +`Item` + +##### D + +`D` + +#### Properties + +##### synthesize? + +> `optional` **synthesize?**: [`FanoutSynthesis`](#fanoutsynthesis)\<`D`\> + +Defined in: [runtime/personify/wave-types.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L124) + +Optional synthesis over the gathered child results: when present, the combinator spawns ONE +synthesis child whose task is built from the drained settlements, and its `done` output is +the deliverable. When absent, the deliverable is the best-valid child via `defaultSelectWinner`. +The synthesis child is a SEPARATE keystone agent (not a re-rank behind the driver). + +##### selectWinner? + +> `optional` **selectWinner?**: [`FanoutWinnerSelector`](#fanoutwinnerselector)\<`D`\> + +Defined in: [runtime/personify/wave-types.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L133) + +Winner-selection strategy among the gathered `done` children when there is no `synthesize`. +Receives the SAME `Iteration[]` the default selector reads (each child's output is its +`Outcome`), so a strategy is a thin re-sort (smallest-diff, highest-readiness, first-valid +…) over the candidates — NEVER a re-rank behind a judge. Default = `defaultSelectWinner` +semantics (best-valid-score, ties→earliest). Mutually exclusive with `synthesize` (a +synthesis child IS the selection); supplying both is a config error. + +#### Methods + +##### itemTask() + +> **itemTask**(`item`, `index`, `ctx`): `unknown` + +Defined in: [runtime/personify/wave-types.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L108) + +One child task per item: `item` + the index discriminator. The persona's directive/context + is threaded in by the combinator; this only supplies the per-item discriminator. + +###### Parameters + +###### item + +`Item` + +###### index + +`number` + +###### ctx + +[`ShapeContext`](#shapecontext)\<`D`\> + +###### Returns + +`unknown` + +##### label()? + +> `optional` **label**(`item`, `index`): `string` + +Defined in: [runtime/personify/wave-types.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L110) + +Per-item child label (defaults to `item:` in the impl). + +###### Parameters + +###### item + +`Item` + +###### index + +`number` + +###### Returns + +`string` + +##### itemSpec()? + +> `optional` **itemSpec**(`item`, `index`, `ctx`): [`AgentSpec`](#agentspec) + +Defined in: [runtime/personify/wave-types.ts:117](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L117) + +Optional per-item `AgentSpec` override. When set, each item's child is spawned against the +returned spec instead of `persona.root` — the seam a heterogeneous fanout uses to give each +item a DISTINCT executor (e.g. N authored harness profiles, each on its own worktree-CLI +leaf). Absent ⇒ every item runs against the persona's root spec (the homogeneous default). + +###### Parameters + +###### item + +`Item` + +###### index + +`number` + +###### ctx + +[`ShapeContext`](#shapecontext)\<`D`\> + +###### Returns + +[`AgentSpec`](#agentspec) + +*** + +### FanoutSynthesis + +Defined in: [runtime/personify/wave-types.ts:149](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L149) + +How a fanout's synthesis child is built + read. `synthesisTask` projects the drained child + settlements into the synthesis child's task; `collect` reads its settled output into the + deliverable `Outcome`. + +#### Type Parameters + +##### D + +`D` + +#### Methods + +##### synthesisTask() + +> **synthesisTask**(`gathered`, `ctx`): `unknown` + +Defined in: [runtime/personify/wave-types.ts:150](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L150) + +###### Parameters + +###### gathered + +readonly [`Settled`](#settled-2)\<[`Outcome`](#outcome-1)\<`D`\>\>[] + +###### ctx + +[`ShapeContext`](#shapecontext)\<`D`\> + +###### Returns + +`unknown` + +##### collect() + +> **collect**(`settled`): [`Outcome`](#outcome-1)\<`D`\> + +Defined in: [runtime/personify/wave-types.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L151) + +###### Parameters + +###### settled + +[`Settled`](#settled-2)\<[`Outcome`](#outcome-1)\<`D`\>\> + +###### Returns + +[`Outcome`](#outcome-1)\<`D`\> + +*** + +### LoopUntilSpec + +Defined in: [runtime/personify/wave-types.ts:170](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L170) + +`loopUntil({ until, step })` — iterative deepening inside the conserved pool: spawn one `step` +child per round, ask `until` whether the accumulated state satisfies the goal, and stop when it +does OR when the pool can no longer admit a step (budget IS the loop bound — no unbounded +while). The deployable, non-oracle stop: `until` is the satisfiability gate, read from trace +findings + accumulated deliverables, never a fresh raw verdict the loop minted to stop itself. + +No domain: "refine until tests pass" is `loopUntil` with a coder persona + a `step` that edits +and an `until` that reads the test-finding; the combinator owns only the round/stop wiring. + +#### Type Parameters + +##### Task + +`Task` + +##### State + +`State` + +##### D + +`D` + +#### Methods + +##### step() + +> **step**(`rootTask`, `state`, `ctx`): `unknown` + +Defined in: [runtime/personify/wave-types.ts:172](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L172) + +Build the next step child's task from the root task + the state accumulated so far. + +###### Parameters + +###### rootTask + +`Task` + +###### state + +[`LoopUntilState`](#loopuntilstate-2)\<`State`\> + +###### ctx + +[`ShapeContext`](#shapecontext)\<`D`\> + +###### Returns + +`unknown` + +##### fold() + +> **fold**(`prior`, `settled`): [`LoopUntilState`](#loopuntilstate-2)\<`State`\> + +Defined in: [runtime/personify/wave-types.ts:174](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L174) + +Fold one settled step into the accumulated state (the loop's running deliverable candidate). + +###### Parameters + +###### prior + +[`LoopUntilState`](#loopuntilstate-2)\<`State`\> + +###### settled + +[`Settled`](#settled-2)\<[`Outcome`](#outcome-1)\<`D`\>\> + +###### Returns + +[`LoopUntilState`](#loopuntilstate-2)\<`State`\> + +##### until() + +> **until**(`state`, `findings`): [`Outcome`](#outcome-1)\<`D`\> \| `null` + +Defined in: [runtime/personify/wave-types.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L180) + +The satisfiability gate: given the accumulated state + the round's trace findings, has the +goal been reached? Returns the terminal deliverable when satisfied, or `null` to keep going. +Reads `findings` (trace-derived), NOT a raw verdict score — the deployable-stop discipline. + +###### Parameters + +###### state + +[`LoopUntilState`](#loopuntilstate-2)\<`State`\> + +###### findings + +readonly `AnalystFinding`[] + +###### Returns + +[`Outcome`](#outcome-1)\<`D`\> \| `null` + +##### label()? + +> `optional` **label**(`round`): `string` + +Defined in: [runtime/personify/wave-types.ts:182](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L182) + +Per-round step label (defaults to `step:` in the impl). + +###### Parameters + +###### round + +`number` + +###### Returns + +`string` + +*** + +### LoopUntilState + +Defined in: [runtime/personify/wave-types.ts:187](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L187) + +The accumulated state `loopUntil` threads across rounds — the running candidate + the round + index, so `step`/`fold`/`until` are pure functions of it (replay-safe, no wall-clock). + +#### Type Parameters + +##### State + +`State` + +#### Properties + +##### round + +> `readonly` **round**: `number` + +Defined in: [runtime/personify/wave-types.ts:188](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L188) + +##### value + +> `readonly` **value**: `State` + +Defined in: [runtime/personify/wave-types.ts:189](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L189) + +*** + +### PanelSpec + +Defined in: [runtime/personify/wave-types.ts:208](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L208) + +`panel(judges)` — M judges over ONE artifact, merged WRITE-ONLY (selector≠judge taken to its +limit). The combinator spawns the M judge children over the same input artifact, drains their +settlements, and MERGES their findings into a panel verdict via `merge` — a pure WRITE-ONLY +fold (a judge's output is never fed back to steer another judge, and the merge never re-ranks +the children behind the driver). The merged verdict gates the deliverable. + +No domain: a "code review panel" and an "essay rubric panel" are the same `panel` shape under +different personas; the rubric lives in each judge persona's profile, not the combinator. + +#### Type Parameters + +##### Artifact + +`Artifact` + +##### D + +`D` + +#### Properties + +##### judges + +> `readonly` **judges**: readonly [`PanelJudge`](#paneljudge)[] + +Defined in: [runtime/personify/wave-types.ts:212](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L212) + +The M judge child specs: each is a persona-derived child (a narrower judge profile). The + combinator spawns one child per entry over the SAME `artifact` and never lets one judge's + output reach another's task (write-only). + +#### Methods + +##### judgeTask() + +> **judgeTask**(`artifact`, `judge`, `ctx`): `unknown` + +Defined in: [runtime/personify/wave-types.ts:214](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L214) + +Build one judge child's task from the shared artifact under review + the judge descriptor. + +###### Parameters + +###### artifact + +`Artifact` + +###### judge + +[`PanelJudge`](#paneljudge) + +###### ctx + +[`ShapeContext`](#shapecontext)\<`D`\> + +###### Returns + +`unknown` + +##### merge() + +> **merge**(`verdicts`, `artifact`): [`Outcome`](#outcome-1)\<`D`\> + +Defined in: [runtime/personify/wave-types.ts:220](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L220) + +Write-only merge: fold the M settled judge verdicts into the panel's terminal `Outcome`. +Pure over the drained settlements — it MUST NOT spawn, re-judge, or feed one verdict into +another. A panel that reached no quorum is a concrete blocker (fail loud, never a vacuous done). + +###### Parameters + +###### verdicts + +readonly [`PanelVerdict`](#panelverdict)[] + +###### artifact + +`Artifact` + +###### Returns + +[`Outcome`](#outcome-1)\<`D`\> + +*** + +### PanelJudge + +Defined in: [runtime/personify/wave-types.ts:225](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L225) + +One judge in a panel — a labeled persona-derived judge child. Content (the rubric) lives in + the judge's profile; this carries only the label + the optional weight the merge may read. + +#### Properties + +##### label + +> `readonly` **label**: `string` + +Defined in: [runtime/personify/wave-types.ts:226](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L226) + +##### weight? + +> `readonly` `optional` **weight?**: `number` + +Defined in: [runtime/personify/wave-types.ts:228](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L228) + +Optional merge weight (a write-only hint the `merge` fold may use; default-equal in the impl). + +*** + +### PanelVerdict + +Defined in: [runtime/personify/wave-types.ts:233](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L233) + +One judge child's settled verdict, surfaced to the write-only `merge`. `down` judges carry no + verdict (excluded from the merge `n`, like an infra-errored cell). + +#### Properties + +##### judge + +> `readonly` **judge**: [`PanelJudge`](#paneljudge) + +Defined in: [runtime/personify/wave-types.ts:234](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L234) + +##### verdict? + +> `readonly` `optional` **verdict?**: `DefaultVerdict` + +Defined in: [runtime/personify/wave-types.ts:235](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L235) + +##### output? + +> `readonly` `optional` **output?**: `unknown` + +Defined in: [runtime/personify/wave-types.ts:237](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L237) + +The judge child's raw output — what it was asked to assess, for a merge that quotes it. + +##### down + +> `readonly` **down**: `boolean` + +Defined in: [runtime/personify/wave-types.ts:239](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L239) + +True when the judge child went `down` (no usable verdict — kept out of the merge denominator). + +*** + +### VerifySpec + +Defined in: [runtime/personify/wave-types.ts:256](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L256) + +`verify({ implement, verifier })` — the 2-node sequential gate: an IMPLEMENT child produces a +candidate, then a SEPARATE VERIFIER child's verdict GATES shippability. A `valid` verifier +verdict ships the implement deliverable; any other outcome (implement down, verifier down, +invalid verdict) becomes a concrete blocker carrying the failure verbatim — never a coerced +"done". The verifier is a distinct keystone agent (selector≠judge: the implement child does +not grade itself). + +No domain: "write code then run the test gate" and "draft then fact-check" are the same `verify` +shape under different personas; the gate rubric is the verifier persona's, not the combinator's. + +#### Type Parameters + +##### Task + +`Task` + +##### Candidate + +`Candidate` + +##### D + +`D` + +#### Properties + +##### implementLabel? + +> `readonly` `optional` **implementLabel?**: `string` + +Defined in: [runtime/personify/wave-types.ts:264](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L264) + +Implement / verifier child labels (default `implement` / `verify` in the impl). + +##### verifierLabel? + +> `readonly` `optional` **verifierLabel?**: `string` + +Defined in: [runtime/personify/wave-types.ts:265](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L265) + +#### Methods + +##### implement() + +> **implement**(`rootTask`, `ctx`): `unknown` + +Defined in: [runtime/personify/wave-types.ts:258](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L258) + +Build the implement child's task from the root task. + +###### Parameters + +###### rootTask + +`Task` + +###### ctx + +[`ShapeContext`](#shapecontext)\<`D`\> + +###### Returns + +`unknown` + +##### verifier() + +> **verifier**(`candidate`, `ctx`): `unknown` + +Defined in: [runtime/personify/wave-types.ts:260](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L260) + +Build the verifier child's task from the implement child's settled candidate. + +###### Parameters + +###### candidate + +[`Settled`](#settled-2)\<[`Outcome`](#outcome-1)\<`Candidate`\>\> + +###### ctx + +[`ShapeContext`](#shapecontext)\<`D`\> + +###### Returns + +`unknown` + +##### collect() + +> **collect**(`candidate`, `verdict`): [`Outcome`](#outcome-1)\<`D`\> + +Defined in: [runtime/personify/wave-types.ts:262](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L262) + +Project the gated (verifier-`valid`) candidate into the terminal deliverable. + +###### Parameters + +###### candidate + +[`Settled`](#settled-2)\<[`Outcome`](#outcome-1)\<`Candidate`\>\> + +###### verdict + +`DefaultVerdict` + +###### Returns + +[`Outcome`](#outcome-1)\<`D`\> + +*** + +### WidenSpec + +Defined in: [runtime/personify/wave-types.ts:286](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L286) + +`widen({ gate })` (G5) — the STREAMING spawn-on-completion driver. Unlike the static-fanout +combinators above, the widener REACTS to each `scope.next()`: as each child settles it consults +the `WidenGate` and, when a lineage is `promising`, widens by AT MOST ONE child toward it under +the remaining conserved pool. Defaults to FLAT (the gate never widens) so a gate run stays +non-widening and the R2 selector≠judge collision is dormant. `promising` is derived from the +round's analyst FINDINGS (via `ScopeAnalyst`, §2), NOT a child's raw `verdict` — the firewall. + +This is the progressive-widening (MCTS-PW) combinator: the one shape whose breadth is decided +at runtime from the diagnosis, not fixed at spawn. It is the mechanism the diverse-strategy-vs- +blind GATE is run with — kept FLAT by default until that gate returns positive (don't build +mechanism ahead of the gate). + +#### Type Parameters + +##### Seed + +`Seed` + +##### D + +`D` + +#### Properties + +##### seeds + +> `readonly` **seeds**: readonly `Seed`[] + +Defined in: [runtime/personify/wave-types.ts:289](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L289) + +The initial children to spawn before any widening — the seed lineages the gate widens from. + One child task per seed; bounded by the conserved pool's fail-closed admission. + +##### gate + +> `readonly` **gate**: [`ScopeWidenGate`](#scopewidengate)\<`D`\> + +Defined in: [runtime/personify/wave-types.ts:296](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L296) + +The progressive-widening gate. Consulted on EVERY settled child with the round's +trace-derived `findings`; returns a widen decision (spawn one more toward a lineage) or a +stop. DEFAULTS to flat via `flatWidenGate` — never widens, so the firewall stays dormant. + +#### Methods + +##### seedTask() + +> **seedTask**(`seed`, `index`, `ctx`): `unknown` + +Defined in: [runtime/personify/wave-types.ts:290](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L290) + +###### Parameters + +###### seed + +`Seed` + +###### index + +`number` + +###### ctx + +[`ShapeContext`](#shapecontext)\<`D`\> + +###### Returns + +`unknown` + +##### widenTask() + +> **widenTask**(`toward`, `ctx`): `unknown` + +Defined in: [runtime/personify/wave-types.ts:298](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L298) + +Build the widened child's task from the lineage the gate chose to extend. + +###### Parameters + +###### toward + +[`WidenLineage`](#widenlineage)\<`D`\> + +###### ctx + +[`ShapeContext`](#shapecontext)\<`D`\> + +###### Returns + +`unknown` + +##### synthesize() + +> **synthesize**(`gathered`, `ctx`): [`Outcome`](#outcome-1)\<`D`\> + +Defined in: [runtime/personify/wave-types.ts:301](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L301) + +Synthesize the terminal deliverable from every settled lineage (selector≠judge: the + single-sourced selector over the gathered children, never a re-judge). + +###### Parameters + +###### gathered + +readonly [`Settled`](#settled-2)\<[`Outcome`](#outcome-1)\<`D`\>\>[] + +###### ctx + +[`ShapeContext`](#shapecontext)\<`D`\> + +###### Returns + +[`Outcome`](#outcome-1)\<`D`\> + +*** + +### ScopeWidenGate + +Defined in: [runtime/personify/wave-types.ts:310](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L310) + +The runtime widening gate (the reactive analogue of the keystone's `WidenGate`, lifted to read +trace FINDINGS instead of a raw verdict). `decide` is consulted per settled child; it MUST +derive `promising` from `findings`, never from `settled.verdict`, unless `judgeExempt` is +explicitly argued (the documented off-by-default escape hatch). Flat default never widens. + +#### Type Parameters + +##### D + +`D` + +#### Properties + +##### judgeExempt? + +> `readonly` `optional` **judgeExempt?**: `boolean` + +Defined in: [runtime/personify/wave-types.ts:318](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L318) + +When true, `decide` may read `settled.verdict` directly — collides with the steer firewall, + so it must be argued per cell, never defaulted on (mirrors the keystone `WidenGate`). + +#### Methods + +##### decide() + +> **decide**(`settled`, `findings`, `budget`): [`WidenDecision`](#widendecision)\<`D`\> + +Defined in: [runtime/personify/wave-types.ts:311](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L311) + +###### Parameters + +###### settled + +[`Settled`](#settled-2)\<[`Outcome`](#outcome-1)\<`D`\>\> + +###### findings + +readonly `AnalystFinding`[] + +###### budget + +`Readonly`\<\{ `tokensLeft`: `number`; `usdLeft`: `number`; `usdCapped`: `boolean`; `deadlineMs`: `number`; `reservedTokens`: `number`; \}\> + +###### Returns + +[`WidenDecision`](#widendecision)\<`D`\> + +*** + +### WidenLineage + +Defined in: [runtime/personify/wave-types.ts:329](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L329) + +A lineage the gate may widen toward — the settled child that looked promising + the findings + that justified it (the trace-derived provenance the firewall requires). + +#### Type Parameters + +##### D + +`D` + +#### Properties + +##### settled + +> `readonly` **settled**: `object` + +Defined in: [runtime/personify/wave-types.ts:330](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L330) + +###### kind + +> **kind**: `"done"` + +###### handle + +> **handle**: [`Handle`](#handle-2)\<[`Outcome`](#outcome-1)\<`D`\>\> + +###### out + +> **out**: [`Outcome`](#outcome-1) + +###### outRef + +> **outRef**: `string` + +###### verdict? + +> `optional` **verdict?**: `DefaultVerdict` + +###### spent + +> **spent**: [`Spend`](#spend) + +###### seq + +> **seq**: `number` + +##### findings + +> `readonly` **findings**: readonly `AnalystFinding`[] + +Defined in: [runtime/personify/wave-types.ts:331](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L331) + +*** + +### ScopeAnalyst + +Defined in: [runtime/personify/wave-types.ts:358](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L358) + +The reactive analyst seam — the PORT of the round-synchronous driver's `analyze` hook +(dynamic.ts) onto the reactive `Scope`. The old driver wired the analyst at round +boundaries (`plan` ran the analyst over `history` BEFORE the planner); the reactive `Scope` has +no rounds, so this carries the wire across: a combinator's `act` asks the `ScopeAnalyst` to turn +the settled children SO FAR into `AnalystFinding[]`, and steers from THOSE findings. + +The firewall is preserved (selector≠judge): `analyze` runs the trace-derived analyst and the +impl asserts `assertTraceDerivedFindings` semantics — a finding citing judge/verdict/score +`metric` evidence aborts the round. The steer decision reads `findings`, NEVER the children's +raw `verdict`. Fail loud — a throwing or non-array analyst aborts (no silent empty findings). + +#### Type Parameters + +##### D + +`D` + +#### Methods + +##### analyze() + +> **analyze**(`input`): `Promise`\ + +Defined in: [runtime/personify/wave-types.ts:365](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L365) + +Turn the children settled so far into trace-derived findings. `settledSoFar` is the cursor- +ordered settlement list a combinator has drained (the reactive analogue of the old driver's +`history`). The impl runs the analyst, then enforces the trace-derived firewall before +returning — a judge-derived finding is rejected, not filtered. + +###### Parameters + +###### input + +[`ScopeAnalyzeInput`](#scopeanalyzeinput)\<`D`\> + +###### Returns + +`Promise`\ + +*** + +### ScopeAnalyzeInput + +Defined in: [runtime/personify/wave-types.ts:369](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L369) + +Input to a `ScopeAnalyst.analyze` — the root task framing + the children settled so far. + +#### Type Parameters + +##### D + +`D` + +#### Properties + +##### task + +> `readonly` **task**: `unknown` + +Defined in: [runtime/personify/wave-types.ts:371](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L371) + +Opaque root-task framing (whatever the combinator was invoked with). + +##### settledSoFar + +> `readonly` **settledSoFar**: readonly [`Settled`](#settled-2)\<[`Outcome`](#outcome-1)\<`D`\>\>[] + +Defined in: [runtime/personify/wave-types.ts:373](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L373) + +The children this combinator has drained off `scope.next()`, in cursor order. + +##### nodeId + +> `readonly` **nodeId**: `string` + +Defined in: [runtime/personify/wave-types.ts:375](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L375) + +This combinator's scope id (the trace-correlation root for the analyst). + +*** + +### SteerContext + +Defined in: [runtime/personify/wave-types.ts:386](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L386) + +How a combinator's `act` consumes findings to steer — the SINGLE firewalled steer surface a +reactive combinator reads. `loopUntil.until`, `widen` gate, and any future steer all funnel +through a `SteerContext` so the firewall is enforced in one place: `findings` is trace-derived +(the analyst already asserted it), and a combinator MUST NOT reach back to `settled.verdict` +for the steer decision. `lastValidScore` is provided for OBSERVABILITY only (rendering/traces), +explicitly NOT for steering — reading it to steer is the coupling the architecture forbids. + +#### Type Parameters + +##### D + +`D` + +#### Properties + +##### findings + +> `readonly` **findings**: readonly `AnalystFinding`[] + +Defined in: [runtime/personify/wave-types.ts:387](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L387) + +##### settledSoFar + +> `readonly` **settledSoFar**: readonly [`Settled`](#settled-2)\<[`Outcome`](#outcome-1)\<`D`\>\>[] + +Defined in: [runtime/personify/wave-types.ts:388](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L388) + +##### lastValidScore? + +> `readonly` `optional` **lastValidScore?**: `number` + +Defined in: [runtime/personify/wave-types.ts:391](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L391) + +Observability-only: the best valid score seen so far. Rendering/trace use ONLY — steering + off this re-introduces selector=judge. Marked so a reviewer catches a misuse. + +*** + +### CorpusRecord + +Defined in: [runtime/personify/wave-types.ts:414](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L414) + +One accreted fact in the cross-run corpus — the learning-flywheel's durable unit. DISTINCT from +a `SpawnEvent` (a per-run decision record): a `CorpusRecord` is a fact a run LEARNED that a +FUTURE run should read back (the world-model for story 5). It is content the next persona reads, +not a replay input. Tagged + scored so `query`/`renderCorpusToInstructions` can project the +relevant, high-confidence subset. + +#### Properties + +##### schemaVersion + +> `readonly` **schemaVersion**: `"1.0.0"` + +Defined in: [runtime/personify/wave-types.ts:415](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L415) + +##### id + +> `readonly` **id**: `string` + +Defined in: [runtime/personify/wave-types.ts:417](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L417) + +Stable id over identity-defining fields (claim + tags) so a re-learned fact dedups. + +##### runId + +> `readonly` **runId**: `string` + +Defined in: [runtime/personify/wave-types.ts:419](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L419) + +The run that produced this fact (the journal `runId`/`root`) — provenance back to the trace. + +##### producedAt + +> `readonly` **producedAt**: `string` + +Defined in: [runtime/personify/wave-types.ts:420](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L420) + +##### area + +> `readonly` **area**: `string` + +Defined in: [runtime/personify/wave-types.ts:422](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L422) + +Coarse classification the query/render filters on (free-form, mirrors `AnalystFinding.area`). + +##### claim + +> `readonly` **claim**: `string` + +Defined in: [runtime/personify/wave-types.ts:424](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L424) + +The accreted fact — the instruction-shaped statement the next run reads back. + +##### rationale? + +> `readonly` `optional` **rationale?**: `string` + +Defined in: [runtime/personify/wave-types.ts:426](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L426) + +Optional supporting detail the renderer may include under the claim. + +##### tags + +> `readonly` **tags**: readonly `string`[] + +Defined in: [runtime/personify/wave-types.ts:428](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L428) + +Free-form tags for `query` filtering (domain, persona, surface). + +##### confidence + +> `readonly` **confidence**: `number` + +Defined in: [runtime/personify/wave-types.ts:430](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L430) + +0..1 — the producing run's confidence in this fact (the render threshold reads it). + +##### evidence? + +> `readonly` `optional` **evidence?**: readonly `object`[] + +Defined in: [runtime/personify/wave-types.ts:432](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L432) + +Optional provenance back into the run that learned it (a finding id / outRef / span). + +*** + +### CorpusFilter + +Defined in: [runtime/personify/wave-types.ts:436](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L436) + +A corpus query filter — every field is an AND-narrowing; an omitted field does not constrain. + +#### Properties + +##### area? + +> `readonly` `optional` **area?**: `string` + +Defined in: [runtime/personify/wave-types.ts:437](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L437) + +##### tags? + +> `readonly` `optional` **tags?**: readonly `string`[] + +Defined in: [runtime/personify/wave-types.ts:439](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L439) + +Match records carrying ALL of these tags. + +##### minConfidence? + +> `readonly` `optional` **minConfidence?**: `number` + +Defined in: [runtime/personify/wave-types.ts:441](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L441) + +Minimum confidence a record must clear to be returned (the render gate). + +##### runId? + +> `readonly` `optional` **runId?**: `string` + +Defined in: [runtime/personify/wave-types.ts:443](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L443) + +Only records from this run (rare — usually a cross-run read). + +##### limit? + +> `readonly` `optional` **limit?**: `number` + +Defined in: [runtime/personify/wave-types.ts:445](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L445) + +Cap the result count (most-confident first in the impl). + +*** + +### Corpus + +Defined in: [runtime/personify/wave-types.ts:458](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L458) + +The durable cross-run corpus — the learning-flywheel store. DISTINCT from `SpawnJournal` +(per-run decisions, replay) and `ResultBlobStore` (per-run payloads): `Corpus` holds accreted +FACTS across runs that the next run reads back. `InMemoryCorpus` + `FileCorpus` (JSONL) impls +live in `corpus.ts` and MAY share a storage spine with the JSONL journal, but the INTERFACE is +separate so a consumer never confuses a replay record with a learned fact. + +Fail-loud, typed-outcome boundary: `append` is idempotent on an identical record (same `id` + +`claim`); a conflicting re-append under the same `id` is a typed error, never a silent overwrite. + +#### Methods + +##### append() + +> **append**(`record`): `Promise`\<\{ `succeeded`: `true`; \} \| \{ `succeeded`: `false`; `error`: `string`; \}\> + +Defined in: [runtime/personify/wave-types.ts:461](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L461) + +Append one accreted fact. Idempotent on an identical record; returns a typed outcome — + inspect `succeeded` before treating it as durable (no silent write-through on conflict). + +###### Parameters + +###### record + +[`CorpusRecord`](#corpusrecord) + +###### Returns + +`Promise`\<\{ `succeeded`: `true`; \} \| \{ `succeeded`: `false`; `error`: `string`; \}\> + +##### query() + +> **query**(`filter`): `Promise`\ + +Defined in: [runtime/personify/wave-types.ts:464](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L464) + +Query accreted facts by filter — most-confident first. Returns the matching records (an + empty array when none match is a valid result, NOT an error). + +###### Parameters + +###### filter + +[`CorpusFilter`](#corpusfilter) + +###### Returns + +`Promise`\ + +*** + +### RenderCorpusToInstructionsOptions + +Defined in: [runtime/personify/wave-types.ts:478](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L478) + +Project accreted corpus facts into an `AgentProfile`'s instruction seams — the learning-flywheel +READ side. Reads the corpus through `filter`, renders the matching facts into instruction lines, +and returns a NEW profile with them merged into `prompt.instructions` (the append-line seam) so +the next run's persona reads the accreted world-model. Pure projection over the queried records; +never mutates the input profile (returns a fresh one). The impl lives in `corpus.ts`. + +`resources.instructions` is `string | AgentProfileResourceRef`; `prompt.instructions` is +`string[]`. The render targets `prompt.instructions` (additive lines) by default; a caller that +wants the single-blob `resources.instructions` form passes `target: 'resources'`. + +#### Properties + +##### corpus + +> `readonly` **corpus**: [`Corpus`](#corpus-2) + +Defined in: [runtime/personify/wave-types.ts:479](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L479) + +##### filter + +> `readonly` **filter**: [`CorpusFilter`](#corpusfilter) + +Defined in: [runtime/personify/wave-types.ts:480](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L480) + +##### profile + +> `readonly` **profile**: `AgentProfile` + +Defined in: [runtime/personify/wave-types.ts:482](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L482) + +The profile to project the facts into. The result is a fresh profile — the input is unchanged. + +##### target? + +> `readonly` `optional` **target?**: `"resources"` \| `"prompt"` + +Defined in: [runtime/personify/wave-types.ts:485](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L485) + +Where the rendered facts land: appended to `prompt.instructions[]` (default) or folded into + the single-blob `resources.instructions` string. + +##### maxLines? + +> `readonly` `optional` **maxLines?**: `number` + +Defined in: [runtime/personify/wave-types.ts:487](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L487) + +Optional cap on rendered lines (most-confident first), independent of the query `limit`. + +*** + +### TrajectoryNode + +Defined in: [runtime/personify/wave-types.ts:506](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L506) + +One node in the reconstructed trajectory tree — a driver OR a leaf, with its OWN spend and the +spend ROLLED UP over its subtree. Reconstructed from the `SpawnJournal` (structure + per-node +`Spend`) + the `ResultBlobStore` (the `out` artifact, rehydrated by `outRef`). The realized tree +shape: `parent`/`children` are the actual spawn edges the run took, not a planned topology. + +#### Properties + +##### id + +> `readonly` **id**: `string` + +Defined in: [runtime/personify/wave-types.ts:507](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L507) + +##### parent? + +> `readonly` `optional` **parent?**: `string` + +Defined in: [runtime/personify/wave-types.ts:508](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L508) + +##### children + +> `readonly` **children**: readonly `string`[] + +Defined in: [runtime/personify/wave-types.ts:509](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L509) + +##### label + +> `readonly` **label**: `string` + +Defined in: [runtime/personify/wave-types.ts:510](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L510) + +##### runtime + +> `readonly` **runtime**: `string` + +Defined in: [runtime/personify/wave-types.ts:511](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L511) + +##### status + +> `readonly` **status**: `"failed"` \| `"cancelled"` \| `"pending"` \| `"done"` + +Defined in: [runtime/personify/wave-types.ts:513](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L513) + +Terminal status the journal recorded for this node. + +##### ownSpend + +> `readonly` **ownSpend**: [`Spend`](#spend) + +Defined in: [runtime/personify/wave-types.ts:515](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L515) + +This node's OWN conserved spend (from its `settled` event). + +##### rolledUpSpend + +> `readonly` **rolledUpSpend**: [`Spend`](#spend) + +Defined in: [runtime/personify/wave-types.ts:518](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L518) + +This node's spend PLUS every descendant's — the rolled-up subtree cost. The cost a parent + "really" consumed inclusive of its children's fanout (the equal-k-on-cost basis). + +##### verdict? + +> `readonly` `optional` **verdict?**: `DefaultVerdict` + +Defined in: [runtime/personify/wave-types.ts:520](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L520) + +The node's verdict, when its settlement carried one (observability — NOT a steer input). + +##### output? + +> `readonly` `optional` **output?**: `unknown` + +Defined in: [runtime/personify/wave-types.ts:522](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L522) + +The rehydrated output artifact, when `withOutputs` was requested + the blob resolved. + +##### outRef? + +> `readonly` `optional` **outRef?**: `string` + +Defined in: [runtime/personify/wave-types.ts:523](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L523) + +*** + +### TrajectoryReport + +Defined in: [runtime/personify/wave-types.ts:528](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L528) + +The whole reconstructed trajectory — the realized tree + its root-rolled-up total. The + per-node + rolled-up `Spend` is the evidence both the trace viewer and `equalKOnCost` read. + +#### Properties + +##### root + +> `readonly` **root**: `string` + +Defined in: [runtime/personify/wave-types.ts:529](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L529) + +##### nodes + +> `readonly` **nodes**: readonly [`TrajectoryNode`](#trajectorynode)[] + +Defined in: [runtime/personify/wave-types.ts:531](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L531) + +Every node, in cursor/spawn order — the realized tree (`parent`/`children` are the real edges). + +##### total + +> `readonly` **total**: [`Spend`](#spend) + +Defined in: [runtime/personify/wave-types.ts:533](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L533) + +The root's rolled-up spend — the whole run's conserved total (tokens + usd + iterations + ms). + +##### statusCounts + +> `readonly` **statusCounts**: `Readonly`\<`Record`\<[`TrajectoryNode`](#trajectorynode)\[`"status"`\], `number`\>\> + +Defined in: [runtime/personify/wave-types.ts:535](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L535) + +Count of nodes by terminal status — a quick "how did the tree end" readout. + +*** + +### TrajectoryReportOptions + +Defined in: [runtime/personify/wave-types.ts:545](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L545) + +`trajectoryReport(journal, blobs, root, { withOutputs? })` — reconstruct the whole tree with +per-node + rolled-up `Spend`. Reads the journal for structure + spend and (when `withOutputs`) +the blob store for each `done` node's artifact. Fail loud on a tree that was never journaled or +a `done` node whose blob the store cannot rehydrate (a silent gap would mis-cost the tree). The +impl lives in `trajectory.ts`. + +#### Properties + +##### withOutputs? + +> `readonly` `optional` **withOutputs?**: `boolean` + +Defined in: [runtime/personify/wave-types.ts:547](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L547) + +Rehydrate each `done` node's `output` from the blob store. Off by default (cost-only report). + +*** + +### EqualKArm + +Defined in: [runtime/personify/wave-types.ts:566](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L566) + +One arm of an equal-k comparison — a labeled trajectory (a `TrajectoryReport` is one arm's whole +run). The arm's conserved COST is `report.total` (tokens + usd), which the sandbox executor +already reports INCLUSIVE of a leaf's internal sub-agent fanout — so comparing arms on this cost +(not raw `iterations`) closes the leaf-fanout confound: a treatment arm whose leaf fanned out +internally is charged for that fanout in `total.tokens`/`total.usd`, not hidden behind one +iteration count. + +#### Properties + +##### label + +> `readonly` **label**: `string` + +Defined in: [runtime/personify/wave-types.ts:567](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L567) + +##### report + +> `readonly` **report**: [`TrajectoryReport`](#trajectoryreport-3) + +Defined in: [runtime/personify/wave-types.ts:568](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L568) + +*** + +### EqualKVerdict + +Defined in: [runtime/personify/wave-types.ts:577](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L577) + +The equal-k-on-cost verdict: whether every arm spent within `tolerance` of the others on the +CONSERVED cost channels (tokens + usd), so a downstream metric comparison is "at equal k". Per- +arm cost is surfaced so a caller can see HOW close. `withinTolerance: false` means the arms are +NOT comparable at equal compute — a confound to report, not a result to publish. + +#### Properties + +##### withinTolerance + +> `readonly` **withinTolerance**: `boolean` + +Defined in: [runtime/personify/wave-types.ts:578](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L578) + +##### arms + +> `readonly` **arms**: readonly `object`[] + +Defined in: [runtime/personify/wave-types.ts:580](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L580) + +Per-arm conserved cost (the basis: tokens total + usd). + +##### spread + +> `readonly` **spread**: `object` + +Defined in: [runtime/personify/wave-types.ts:587](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L587) + +The realized spread on each channel (max − min across arms), for the report. + +###### tokens + +> `readonly` **tokens**: `number` + +###### usd + +> `readonly` **usd**: `number` + +##### tolerance + +> `readonly` **tolerance**: `number` + +Defined in: [runtime/personify/wave-types.ts:589](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L589) + +The fractional tolerance the check used (spread / median ≤ tolerance per channel). + +*** + +### EqualKOnCostOptions + +Defined in: [runtime/personify/wave-types.ts:599](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L599) + +`equalKOnCost(arms, { tolerance? })` — assert arms are comparable at EQUAL conserved COST +(tokens + usd), NOT raw iteration count. The conserved-pool guarantees `Σk` equal by +construction WITHIN one supervised run; this checks it ACROSS arms (separate runs) where the +pool cannot, so a cross-arm gate comparison can prove equal compute before claiming a win. The +impl lives in `trajectory.ts`. Pure over the reports — no I/O. + +#### Properties + +##### tolerance? + +> `readonly` `optional` **tolerance?**: `number` + +Defined in: [runtime/personify/wave-types.ts:602](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L602) + +Max fractional spread (spread/median) per channel for arms to count as equal-k. Default in + the impl (e.g. 0.05). A tighter tolerance = a stricter equal-compute claim. + +*** + +### PromotionGateOptions + +Defined in: [runtime/promotion-gate.ts:13](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L13) + +#### Properties + +##### report + +> **report**: [`BenchmarkReport`](#benchmarkreport) + +Defined in: [runtime/promotion-gate.ts:15](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L15) + +The HOLDOUT report — must carry per-task cells for both strategy names. + +##### incumbent + +> **incumbent**: `string` + +Defined in: [runtime/promotion-gate.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L17) + +The incumbent champion's strategy name. + +##### candidate + +> **candidate**: `string` + +Defined in: [runtime/promotion-gate.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L19) + +The challenger's strategy name. + +##### mode? + +> `optional` **mode?**: `"superiority"` \| `"non-inferiority"` + +Defined in: [runtime/promotion-gate.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L24) + +'superiority' (default): the candidate must score significantly BETTER. + 'non-inferiority': the candidate must prove its score is not worse than the + incumbent by more than `scoreTolerance` AND its cost savings are significant — + the gate for "same quality, cheaper" claims. + +##### scoreTolerance? + +> `optional` **scoreTolerance?**: `number` + +Defined in: [runtime/promotion-gate.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L26) + +non-inferiority: the score CI lower bound must clear −scoreTolerance. Default 0.05. + +##### deltaThreshold? + +> `optional` **deltaThreshold?**: `number` + +Defined in: [runtime/promotion-gate.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L28) + +The CI lower bound on the paired lift must EXCEED this (score scale). Default 0. + +##### minPairedTasks? + +> `optional` **minPairedTasks?**: `number` + +Defined in: [runtime/promotion-gate.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L31) + +Minimum paired tasks before significance can be claimed. Default 6 — below that + the bootstrap CI is too wide to separate a real lift from the per-task noise. + +##### statistic? + +> `optional` **statistic?**: `"mean"` \| `"median"` + +Defined in: [runtime/promotion-gate.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L33) + +Bootstrap statistic over the paired deltas. Default 'mean'. + +##### seed? + +> `optional` **seed?**: `number` + +Defined in: [runtime/promotion-gate.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L35) + +Fixed by the substrate by default — the same report always yields the same verdict. + +##### resamples? + +> `optional` **resamples?**: `number` + +Defined in: [runtime/promotion-gate.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L36) + +*** + +### PromotionVerdict + +Defined in: [runtime/promotion-gate.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L39) + +#### Properties + +##### promoted + +> **promoted**: `boolean` + +Defined in: [runtime/promotion-gate.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L40) + +##### reason + +> **reason**: `"identical-champion"` \| `"few-tasks"` \| `"no-margin"` \| `"significant"` \| `"non-inferior-and-cheaper"` \| `"non-inferiority-unproven"` \| `"not-cheaper"` + +Defined in: [runtime/promotion-gate.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L41) + +##### mode + +> **mode**: `"superiority"` \| `"non-inferiority"` + +Defined in: [runtime/promotion-gate.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L49) + +##### n + +> **n**: `number` + +Defined in: [runtime/promotion-gate.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L51) + +Paired tasks that carried both strategies' cells. + +##### lift + +> **lift**: `object` + +Defined in: [runtime/promotion-gate.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L53) + +Paired (candidate − incumbent) lift across the holdout tasks. + +###### mean + +> **mean**: `number` + +###### median + +> **median**: `number` + +###### low + +> **low**: `number` + +###### high + +> **high**: `number` + +##### costSavings? + +> `optional` **costSavings?**: `object` + +Defined in: [runtime/promotion-gate.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L56) + +non-inferiority mode: paired (incumbent − candidate) cost SAVINGS per task (usd) — + positive means the candidate is cheaper; significant iff the CI low clears zero. + +###### mean + +> **mean**: `number` + +###### median + +> **median**: `number` + +###### low + +> **low**: `number` + +###### high + +> **high**: `number` + +##### latency? + +> `optional` **latency?**: `object` + +Defined in: [runtime/promotion-gate.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L60) + +Paired (candidate − incumbent) wall-clock per task (ms) — negative = the candidate + is FASTER. Informational in every mode (never gates); the latency answer to "what + does this win actually cost the user?". + +###### mean + +> **mean**: `number` + +###### median + +> **median**: `number` + +###### low + +> **low**: `number` + +###### high + +> **high**: `number` + +*** + +### UsageSink + +Defined in: [runtime/report-usage.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/report-usage.ts#L24) + +The slice of an agent-eval campaign `DispatchContext.cost` this needs. + +#### Methods + +##### observe() + +> **observe**(`amountUsd`, `source`): `void` + +Defined in: [runtime/report-usage.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/report-usage.ts#L25) + +###### Parameters + +###### amountUsd + +`number` + +###### source + +`string` + +###### Returns + +`void` + +##### observeTokens() + +> **observeTokens**(`usage`): `void` + +Defined in: [runtime/report-usage.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/report-usage.ts#L26) + +###### Parameters + +###### usage + +[`LoopTokenUsage`](#looptokenusage) + +###### Returns + +`void` + +*** + +### RouterConfig + +Defined in: [runtime/router-client.ts:15](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L15) + +#### Properties + +##### routerBaseUrl + +> **routerBaseUrl**: `string` + +Defined in: [runtime/router-client.ts:16](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L16) + +##### routerKey + +> **routerKey**: `string` + +Defined in: [runtime/router-client.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L17) + +##### model + +> **model**: `string` + +Defined in: [runtime/router-client.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L18) + +*** + +### RouterChatResult + +Defined in: [runtime/router-client.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L21) + +#### Properties + +##### content + +> **content**: `string` + +Defined in: [runtime/router-client.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L22) + +##### usage? + +> `optional` **usage?**: `object` + +Defined in: [runtime/router-client.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L24) + +REAL usage, or undefined when the provider reported none. + +###### input + +> **input**: `number` + +###### output + +> **output**: `number` + +##### costUsd? + +> `optional` **costUsd?**: `number` + +Defined in: [runtime/router-client.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L26) + +Derived from usage via `estimateCost` when the model is priced; else undefined. + +*** + +### RouterToolCall + +Defined in: [runtime/router-client.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L96) + +A tool-call the model emitted (provider-neutral; mirrors the runtime's ToolCallRequest). + +#### Properties + +##### id + +> **id**: `string` + +Defined in: [runtime/router-client.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L97) + +##### name + +> **name**: `string` + +Defined in: [runtime/router-client.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L98) + +##### arguments + +> **arguments**: `string` + +Defined in: [runtime/router-client.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L100) + +Raw JSON arguments string as emitted by the model. + +*** + +### RouterChatToolsResult + +Defined in: [runtime/router-client.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L103) + +#### Properties + +##### content + +> **content**: `string` \| `null` + +Defined in: [runtime/router-client.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L104) + +##### toolCalls + +> **toolCalls**: [`RouterToolCall`](#routertoolcall)[] + +Defined in: [runtime/router-client.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L105) + +##### usage? + +> `optional` **usage?**: `object` + +Defined in: [runtime/router-client.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L106) + +###### input + +> **input**: `number` + +###### output + +> **output**: `number` + +##### costUsd? + +> `optional` **costUsd?**: `number` + +Defined in: [runtime/router-client.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L107) + +*** + +### ToolSpec + +Defined in: [runtime/router-client.ts:176](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L176) + +#### Properties + +##### type + +> **type**: `"function"` + +Defined in: [runtime/router-client.ts:177](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L177) + +##### function + +> **function**: `object` + +Defined in: [runtime/router-client.ts:178](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L178) + +###### name + +> **name**: `string` + +###### description? + +> `optional` **description?**: `string` + +###### parameters + +> **parameters**: `unknown` + +*** + +### RouterToolLoopResult + +Defined in: [runtime/router-client.ts:181](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L181) + +#### Properties + +##### final + +> **final**: `string` + +Defined in: [runtime/router-client.ts:183](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L183) + +The model's final assistant text (the turn where it stopped calling tools, or the budget turn). + +##### turns + +> **turns**: `number` + +Defined in: [runtime/router-client.ts:185](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L185) + +Inference turns spent (≤ maxTurns) — the equal-budget unit vs random@k. + +##### toolCalls + +> **toolCalls**: `number` + +Defined in: [runtime/router-client.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L186) + +##### toolTrace + +> **toolTrace**: `object`[] + +Defined in: [runtime/router-client.ts:189](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L189) + +The behavior trace: each tool call + its result, in order. What a trace-analyst + steerer reads (behavior, never the verdict) to diagnose + redirect the next shot. + +###### name + +> **name**: `string` + +###### args + +> **args**: `string` + +###### result + +> **result**: `string` + +##### usage + +> **usage**: `object` + +Defined in: [runtime/router-client.ts:190](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L190) + +###### input + +> **input**: `number` + +###### output + +> **output**: `number` + +##### messages + +> **messages**: `Record`\<`string`, `unknown`\>[] + +Defined in: [runtime/router-client.ts:193](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L193) + +The full conversation after the loop (seed + every assistant/tool turn). Lets a caller + CARRY the messages into the next shot (depth continuation) and read the trajectory. + +*** + +### BenchmarkConfig + +Defined in: [runtime/run-benchmark.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L32) + +#### Properties + +##### environment + +> **environment**: [`AgenticSurface`](#agenticsurface) + +Defined in: [runtime/run-benchmark.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L34) + +The task domain (5 hooks). + +##### tasks + +> **tasks**: [`AgenticTask`](#agentictask)[] + +Defined in: [runtime/run-benchmark.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L36) + +The tasks to score across. + +##### worker + +> **worker**: [`AgenticOptions`](#agenticoptions) + +Defined in: [runtime/run-benchmark.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L38) + +The worker: model + router + (optional) the critic's instruction (the steerer knob). + +##### strategies? + +> `optional` **strategies?**: [`Strategy`](#strategy-3)[] + +Defined in: [runtime/run-benchmark.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L41) + +Which strategies to compare. Pass the built-ins (`refine`, `sample`) or your own. + Default: [sample, refine]. + +##### budget? + +> `optional` **budget?**: `number` + +Defined in: [runtime/run-benchmark.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L43) + +Shots (refine) / width (sample) — the equal compute budget per strategy. Default 3. + +##### concurrency? + +> `optional` **concurrency?**: `number` + +Defined in: [runtime/run-benchmark.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L45) + +Tasks scored in parallel. Default 3. + +##### onTask? + +> `optional` **onTask?**: (`row`, `done`, `total`) => `void` + +Defined in: [runtime/run-benchmark.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L48) + +Progress hook — fires as each task settles (the live-monitoring seam: append to a + progress file, render a tree, stream to a dashboard). `done` counts settled tasks. + +###### Parameters + +###### row + +[`BenchmarkTaskRow`](#benchmarktaskrow) + +###### done + +`number` + +###### total + +`number` + +###### Returns + +`void` + +##### hooks? + +> `optional` **hooks?**: [`RuntimeHooks`](index.md#runtimehooks) + +Defined in: [runtime/run-benchmark.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L51) + +Lifecycle observability — every spawn/settle of every cell's shots/analysts streams + here live (the watchdog/route-auditor seam, passed through to `runAgentic`). + +*** + +### BenchmarkLift + +Defined in: [runtime/run-benchmark.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L54) + +#### Properties + +##### mean + +> **mean**: `number` + +Defined in: [runtime/run-benchmark.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L56) + +Mean of paired deltas (refine − sample). + +##### low + +> **low**: `number` + +Defined in: [runtime/run-benchmark.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L57) + +##### high + +> **high**: `number` + +Defined in: [runtime/run-benchmark.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L58) + +##### n + +> **n**: `number` + +Defined in: [runtime/run-benchmark.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L59) + +*** + +### BenchmarkCell + +Defined in: [runtime/run-benchmark.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L63) + +One strategy's outcome on one task — the per-task cell an optimizer consumes. + +#### Properties + +##### score + +> **score**: `number` + +Defined in: [runtime/run-benchmark.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L64) + +##### resolved + +> **resolved**: `boolean` + +Defined in: [runtime/run-benchmark.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L65) + +##### progression + +> **progression**: `number`[] + +Defined in: [runtime/run-benchmark.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L67) + +The progress curve (refine: score per shot; sample: best-so-far per rollout). + +##### usd + +> **usd**: `number` + +Defined in: [runtime/run-benchmark.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L68) + +##### ms + +> **ms**: `number` + +Defined in: [runtime/run-benchmark.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L69) + +##### tokens + +> **tokens**: `object` + +Defined in: [runtime/run-benchmark.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L70) + +###### input + +> **input**: `number` + +###### output + +> **output**: `number` + +*** + +### BenchmarkTaskRow + +Defined in: [runtime/run-benchmark.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L73) + +#### Properties + +##### taskId + +> **taskId**: `string` + +Defined in: [runtime/run-benchmark.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L74) + +##### cells? + +> `optional` **cells?**: `Record`\<`string`, [`BenchmarkCell`](#benchmarkcell)\> + +Defined in: [runtime/run-benchmark.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L76) + +Per-strategy cells; absent when the task errored before completing all strategies. + +##### errors? + +> `optional` **errors?**: `Record`\<`string`, `string`\> + +Defined in: [runtime/run-benchmark.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L80) + +Per-strategy failures on this task: the strategy competed, threw, and scored an + honest zero — it loses, it does not poison the row. The message is kept so a later + generation's author can see WHY a candidate died. + +##### error? + +> `optional` **error?**: `string` + +Defined in: [runtime/run-benchmark.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L82) + +Why the task was excluded (infra/setup failure) — never silently dropped. + +*** + +### BenchmarkStrategySummary + +Defined in: [runtime/run-benchmark.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L85) + +#### Properties + +##### score + +> **score**: `number` + +Defined in: [runtime/run-benchmark.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L87) + +Mean verifier score (0..1). + +##### resolved + +> **resolved**: `number` + +Defined in: [runtime/run-benchmark.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L89) + +Fraction of tasks fully resolved. + +##### usd + +> **usd**: `number` + +Defined in: [runtime/run-benchmark.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L91) + +Mean cost vector per task. + +##### ms + +> **ms**: `number` + +Defined in: [runtime/run-benchmark.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L92) + +*** + +### BenchmarkReport + +Defined in: [runtime/run-benchmark.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L95) + +#### Properties + +##### n + +> **n**: `number` + +Defined in: [runtime/run-benchmark.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L96) + +##### excluded + +> **excluded**: `number` + +Defined in: [runtime/run-benchmark.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L97) + +##### perStrategy + +> **perStrategy**: `Record`\<`string`, [`BenchmarkStrategySummary`](#benchmarkstrategysummary)\> + +Defined in: [runtime/run-benchmark.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L99) + +Per-strategy means (keyed by strategy.name). + +##### perTask + +> **perTask**: [`BenchmarkTaskRow`](#benchmarktaskrow)[] + +Defined in: [runtime/run-benchmark.ts:102](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L102) + +The full per-task × per-strategy table — the LOSSES an optimizer (GEPA, a + strategy-author, an operator) consumes. Includes errored tasks with the reason. + +##### pareto + +> **pareto**: `string`[] + +Defined in: [runtime/run-benchmark.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L105) + +The non-dominated strategies on (score ↑, $/task ↓) — collapse-last, per the canon: + a strategy that ties on score at half the cost WINS and a scalar would hide it. + +##### refineVsSample? + +> `optional` **refineVsSample?**: [`BenchmarkLift`](#benchmarklift) + +Defined in: [runtime/run-benchmark.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L107) + +The headline when both `refine` and `sample` ran: paired-bootstrap lift of refine over sample. + +*** + +### RunLoopOptions + +Defined in: [runtime/run-loop.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L69) + +**`Experimental`** + +#### Type Parameters + +##### Task + +`Task` + +##### Output + +`Output` + +##### Decision + +`Decision` + +#### Properties + +##### driver + +> **driver**: [`Driver`](#driver-2)\<`Task`, `Output`, `Decision`\> + +Defined in: [runtime/run-loop.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L70) + +**`Experimental`** + +##### agentRun? + +> `optional` **agentRun?**: [`AgentRunSpec`](#agentrunspec)\<`Task`\> + +Defined in: [runtime/run-loop.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L75) + +**`Experimental`** + +Single agent spec — every iteration uses this profile. Mutually +exclusive with `agentRuns`. + +##### agentRuns? + +> `optional` **agentRuns?**: [`AgentRunSpec`](#agentrunspec)\<`Task`\>[] + +Defined in: [runtime/run-loop.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L81) + +**`Experimental`** + +Multiple specs for heterogeneous fanout. The kernel round-robins +through them when the driver plans N tasks. Mutually exclusive with +`agentRun`. + +##### output + +> **output**: [`OutputAdapter`](#outputadapter)\<`Output`\> + +Defined in: [runtime/run-loop.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L82) + +**`Experimental`** + +##### validator? + +> `optional` **validator?**: [`Validator`](#validator-1)\<`Output`, `DefaultVerdict`\> + +Defined in: [runtime/run-loop.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L83) + +**`Experimental`** + +##### task + +> **task**: `Task` + +Defined in: [runtime/run-loop.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L84) + +**`Experimental`** + +##### ctx + +> **ctx**: [`ExecCtx`](#execctx) + +Defined in: [runtime/run-loop.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L85) + +**`Experimental`** + +##### maxIterations? + +> `optional` **maxIterations?**: `number` + +Defined in: [runtime/run-loop.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L87) + +**`Experimental`** + +Default 10. Hard cap on total iterations across all `plan()` rounds. + +##### maxConcurrency? + +> `optional` **maxConcurrency?**: `number` + +Defined in: [runtime/run-loop.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L89) + +**`Experimental`** + +Default 4. In-flight worker cap within a single `plan()` batch. + +##### runId? + +> `optional` **runId?**: `string` + +Defined in: [runtime/run-loop.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L94) + +**`Experimental`** + +Pre-allocated id for trace correlation. Default = `loop-${random}`. +Surfaces as `runId` on every emitted `LoopTraceEvent`. + +##### now? + +> `optional` **now?**: () => `number` + +Defined in: [runtime/run-loop.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L99) + +**`Experimental`** + +Clock override; default `Date.now`. Deterministic tests pass a +monotonic counter to stabilize iteration timing fields. + +###### Returns + +`number` + +##### selectWinner? + +> `optional` **selectWinner?**: (`iterations`) => [`LoopWinner`](#loopwinner)\<`Task`, `Output`\> \| `undefined` + +Defined in: [runtime/run-loop.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L104) + +**`Experimental`** + +Override the default winner selector (highest-valid-score, ties broken +by earliest iteration). + +###### Parameters + +###### iterations + +[`Iteration`](#iteration-1)\<`Task`, `Output`\>[] + +###### Returns + +[`LoopWinner`](#loopwinner)\<`Task`, `Output`\> \| `undefined` + +##### onWorkerBox? + +> `optional` **onWorkerBox?**: (`box`) => `void` + +Defined in: [runtime/run-loop.ts:119](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L119) + +**`Experimental`** + +Same-sandbox driver mode — a kernel→caller out-channel, not a value handed +in. When set, the kernel keeps each finished worker box alive across the +`plan()` boundary and hands it here, so a same-sandbox planner +(one that reuses the worker's box) can stream its move INTO the +worker's live box — steering from the worker's real filesystem and state, +not just a history summary. The kernel owns teardown: every box kept alive +this way is destroyed at loop end (and the callback is invoked with +`undefined` then as a teardown sentinel). Without it, worker boxes are torn +down per-iteration (default) and a same-sandbox planner has nothing to +reuse. Intended for single-worker (refine) loops: under fanout every box is +still kept for teardown, but only the last-finishing box is handed here, so +a planner sees an arbitrary branch's filesystem — pair it with refine. + +###### Parameters + +###### box + +`SandboxInstance` \| `undefined` + +###### Returns + +`void` + +##### lineage? + +> `optional` **lineage?**: [`LoopLineageOptions`](#looplineageoptions) + +Defined in: [runtime/run-loop.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L131) + +**`Experimental`** + +Opt-in box-lineage controls. Default OFF — unset means every iteration +acquires a fresh box, streams once, and tears it down (today's behavior, +byte-identical). With `sessionContinuity` on, a refine round continues the +parent iteration's session on its live box; with `forkFanout` on (and a +fork-capable platform), a fanout round forks the parent's checkpoint so the +branches share a context prefix. The lineage owns every box it starts or +forks and tears them all down at loop end — so these paths are mutually +exclusive with `onWorkerBox`, which claims the same box-ownership channel. + +*** + +### SandboxCapabilities + +Defined in: [runtime/sandbox-capabilities.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-capabilities.ts#L26) + +**`Experimental`** + +What the loop kernel is allowed to know about a sandbox backend: a single +capability bit, never the backend's identity. `canFork` gates the +checkpoint+fork fanout path; everything else (session continuation) is a +universal SDK feature that needs no probe. + +#### Properties + +##### canFork + +> **canFork**: `boolean` + +Defined in: [runtime/sandbox-capabilities.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-capabilities.ts#L32) + +**`Experimental`** + +True only when `client.criuStatus()` returned `{ available: true }`. When +false, a fork-enabled fanout degrades to independent fresh boxes — same +result, no shared context prefix. + +*** + +### CriuCapableClient + +Defined in: [runtime/sandbox-capabilities.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-capabilities.ts#L73) + +**`Experimental`** + +Narrowed view of the optional CRIU probe. The loop-side `SandboxClient` +does not require `criuStatus`; this widens it optionally so the probe can be +read without importing sandbox-backend specifics. + +#### Properties + +##### criuStatus? + +> `optional` **criuStatus?**: () => `Promise`\<\{ `available`: `boolean`; `criuVersion?`: `string`; `reason?`: `string`; \}\> + +Defined in: [runtime/sandbox-capabilities.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-capabilities.ts#L74) + +**`Experimental`** + +###### Returns + +`Promise`\<\{ `available`: `boolean`; `criuVersion?`: `string`; `reason?`: `string`; \}\> + +*** + +### SandboxLineageHandle + +Defined in: [runtime/sandbox-lineage.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L113) + +**`Experimental`** + +A live box plus the session that threads its iterations together. Handed back +by `start`/`fork`, passed into `continue`/`fork` to descend from. Opaque to +the kernel beyond `box` (for placement/teardown) and `sessionId` (trace). + +#### Properties + +##### box + +> **box**: `SandboxInstance` + +Defined in: [runtime/sandbox-lineage.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L115) + +**`Experimental`** + +The owned, running sandbox this handle drives. + +##### sessionId + +> **sessionId**: `string` + +Defined in: [runtime/sandbox-lineage.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L122) + +**`Experimental`** + +Stable session id threaded through this box's `streamPrompt` calls. Minted +by the lineage on `start`; reused on `continue` so the server continues the +same conversation. A forked handle starts a fresh session on its new box — +the shared context comes from the checkpoint, not a shared session id. + +*** + +### SandboxLineage + +Defined in: [runtime/sandbox-lineage.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L131) + +**`Experimental`** + +Owns box + session handles for one loop run and offers the three +capability-gated lifecycle moves. Construct via `createSandboxLineage`. + +#### Methods + +##### start() + +> **start**(`spec`, `prompt`, `signal`): `Promise`\<\{ `handle`: [`SandboxLineageHandle`](#sandboxlineagehandle); `events`: `AsyncIterable`\<`SandboxEvent`\>; \}\> + +Defined in: [runtime/sandbox-lineage.ts:136](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L136) + +**`Experimental`** + +Acquire a fresh box and begin a new session on it. Returns the handle and +the live `streamPrompt` iterable for the first turn (caller drains it). + +###### Parameters + +###### spec + +[`AgentRunSpec`](#agentrunspec)\<`unknown`\> + +###### prompt + +`string` + +###### signal + +`AbortSignal` + +###### Returns + +`Promise`\<\{ `handle`: [`SandboxLineageHandle`](#sandboxlineagehandle); `events`: `AsyncIterable`\<`SandboxEvent`\>; \}\> + +##### continue() + +> **continue**(`handle`, `prompt`, `signal`): `Promise`\<`AsyncIterable`\<`SandboxEvent`, `any`, `any`\>\> + +Defined in: [runtime/sandbox-lineage.ts:148](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L148) + +**`Experimental`** + +Continue an existing handle's session with one more turn on the SAME box. +The prior context is server-side; `prompt` is only the new turn. Asserts the +session is still known to the sandbox first (fail-loud) so a platform that +silently dropped the client-minted session id surfaces as an error instead +of a contextless turn the caller mistakes for a real continuation. + +###### Parameters + +###### handle + +[`SandboxLineageHandle`](#sandboxlineagehandle) + +###### prompt + +`string` + +###### signal + +`AbortSignal` + +###### Returns + +`Promise`\<`AsyncIterable`\<`SandboxEvent`, `any`, `any`\>\> + +##### fork() + +> **fork**(`parent`, `prompts`, `specs`, `signal`): `Promise`\<`object`[]\> + +Defined in: [runtime/sandbox-lineage.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L164) + +**`Experimental`** + +Branch `count` children from `parent`. When the platform can fork, each +child inherits `parent`'s checkpoint — and therefore the parent's IMAGE and +PROFILE: under a real fork `specs[i]` does NOT re-select a per-branch +profile (the SDK forks the running box, it can't swap the image). `specs[i]` +picks the per-branch profile ONLY on the degraded fresh-box path (no CRIU). +A heterogeneous-profile fanout therefore homogenizes to the parent's profile +when fork is available — pass a single shared spec for forked fanouts, or +use `random@k` (no fork) when branches must differ. Each child's first turn +streams `prompts[i]`. Child-box creation is bounded by `maxConcurrency`. + +###### Parameters + +###### parent + +[`SandboxLineageHandle`](#sandboxlineagehandle) + +###### prompts + +`string`[] + +###### specs + +[`AgentRunSpec`](#agentrunspec)\<`unknown`\>[] + +###### signal + +`AbortSignal` + +###### Returns + +`Promise`\<`object`[]\> + +##### prune() + +> **prune**(`keep`): `Promise`\<`void`\> + +Defined in: [runtime/sandbox-lineage.ts:177](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L177) + +**`Experimental`** + +Destroy every owned box whose handle is NOT in `keep`, freeing it before +loop end. The kernel calls this after a round when it can prove no future +round will descend from the pruned boxes (deterministic, monotonic branch +selection); boxes still reachable as a future branch source are retained. +Best-effort, bounded, parallel — a failed delete never throws. + +###### Parameters + +###### keep + +`Iterable`\<[`SandboxLineageHandle`](#sandboxlineagehandle)\> + +###### Returns + +`Promise`\<`void`\> + +##### teardown() + +> **teardown**(): `Promise`\<`void`\> + +Defined in: [runtime/sandbox-lineage.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L179) + +**`Experimental`** + +Destroy every box this lineage owns. Best-effort, bounded, parallel. + +###### Returns + +`Promise`\<`void`\> + +*** + +### CheckpointCapableBox + +Defined in: [runtime/sandbox-lineage.ts:375](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L375) + +**`Experimental`** + +Loop-side widening of the box's optional checkpoint method. The +`SandboxClient`/`SandboxInstance` surface the kernel relies on does not +require checkpointing; this reads it optionally so the lineage can probe-gate +without importing sandbox-backend specifics. + +#### Properties + +##### checkpoint? + +> `optional` **checkpoint?**: (`options?`) => `Promise`\<\{ `checkpointId`: `string`; \}\> + +Defined in: [runtime/sandbox-lineage.ts:376](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L376) + +**`Experimental`** + +###### Parameters + +###### options? + +###### leaveRunning? + +`boolean` + +###### tags? + +`string`[] + +###### Returns + +`Promise`\<\{ `checkpointId`: `string`; \}\> + +*** + +### ForkCapableBox + +Defined in: [runtime/sandbox-lineage.ts:382](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L382) + +**`Experimental`** + +Loop-side widening of the box's optional fork method. + +#### Properties + +##### fork? + +> `optional` **fork?**: (`checkpointId`, `options?`) => `Promise`\<`SandboxInstance`\> + +Defined in: [runtime/sandbox-lineage.ts:383](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L383) + +**`Experimental`** + +###### Parameters + +###### checkpointId + +`string` + +###### options? + +###### name? + +`string` + +###### Returns + +`Promise`\<`SandboxInstance`\> + +*** + +### SessionCapableBox + +Defined in: [runtime/sandbox-lineage.ts:393](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L393) + +**`Experimental`** + +Loop-side widening of the box's optional session accessor. The real +`SandboxInstance` exposes `session(id).status()`; the loop reads it optionally +so `continue` can assert session liveness without requiring it of the test +fakes. `status()` resolves `null` when the id is unknown to the sandbox. + +#### Properties + +##### session? + +> `optional` **session?**: (`id`) => `object` + +Defined in: [runtime/sandbox-lineage.ts:394](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L394) + +**`Experimental`** + +###### Parameters + +###### id + +`string` + +###### Returns + +`object` + +###### status + +> **status**: () => `Promise`\<`unknown`\> + +###### Returns + +`Promise`\<`unknown`\> + +*** + +### TurnResult + +Defined in: [runtime/sandbox-run.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L60) + +**`Experimental`** + +One finished turn over the artifact. A failed FS read is surfaced in `readError` +(never masked as an empty deliverable) so a caller distinguishes "agent produced +nothing" from a transport/FS fault. + +#### Type Parameters + +##### Out + +`Out` + +#### Properties + +##### out + +> **out**: `Out` + +Defined in: [runtime/sandbox-run.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L61) + +**`Experimental`** + +##### events + +> **events**: `SandboxEvent`[] + +Defined in: [runtime/sandbox-run.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L62) + +**`Experimental`** + +##### readError? + +> `optional` **readError?**: `string` + +Defined in: [runtime/sandbox-run.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L63) + +**`Experimental`** + +*** + +### SandboxRun + +Defined in: [runtime/sandbox-run.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L68) + +**`Experimental`** + +A live run over ONE persistent artifact (box + session). Close it + when done — `close()` tears the box down. + +#### Type Parameters + +##### Out + +`Out` + +#### Properties + +##### box + +> `readonly` **box**: `SandboxInstance` + +Defined in: [runtime/sandbox-run.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L69) + +**`Experimental`** + +##### sessionId + +> `readonly` **sessionId**: `string` + +Defined in: [runtime/sandbox-run.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L70) + +**`Experimental`** + +#### Methods + +##### start() + +> **start**(`prompt`): `Promise`\<[`TurnResult`](#turnresult)\<`Out`\>\> + +Defined in: [runtime/sandbox-run.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L72) + +**`Experimental`** + +First turn over the fresh box (mints the session). Throws if already started. + +###### Parameters + +###### prompt + +`string` + +###### Returns + +`Promise`\<[`TurnResult`](#turnresult)\<`Out`\>\> + +##### resume() + +> **resume**(`prompt`): `Promise`\<[`TurnResult`](#turnresult)\<`Out`\>\> + +Defined in: [runtime/sandbox-run.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L74) + +**`Experimental`** + +Continue THE SAME session over THE SAME artifact — a resumed turn/rollout. + +###### Parameters + +###### prompt + +`string` + +###### Returns + +`Promise`\<[`TurnResult`](#turnresult)\<`Out`\>\> + +##### close() + +> **close**(): `Promise`\<`void`\> + +Defined in: [runtime/sandbox-run.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L75) + +**`Experimental`** + +###### Returns + +`Promise`\<`void`\> + +*** + +### OpenSandboxRunOptions + +Defined in: [runtime/sandbox-run.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L79) + +**`Experimental`** + +#### Properties + +##### agentRun + +> **agentRun**: [`AgentRunSpec`](#agentrunspec)\<`string`\> + +Defined in: [runtime/sandbox-run.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L81) + +**`Experimental`** + +Profile + sandbox env/overrides. `sandboxOverrides.backend.type` is the harness. + +##### signal + +> **signal**: `AbortSignal` + +Defined in: [runtime/sandbox-run.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L82) + +**`Experimental`** + +##### hooks? + +> `optional` **hooks?**: [`RuntimeHooks`](index.md#runtimehooks) + +Defined in: [runtime/sandbox-run.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L84) + +**`Experimental`** + +Optional execution-scoped observers. Hook failures never fail the run. + +##### runId? + +> `optional` **runId?**: `string` + +Defined in: [runtime/sandbox-run.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L86) + +**`Experimental`** + +Stable run id for trace joins. Defaults to a short runtime-minted id. + +##### scenarioId? + +> `optional` **scenarioId?**: `string` + +Defined in: [runtime/sandbox-run.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L88) + +**`Experimental`** + +Optional benchmark/scenario id carried into emitted hook events. + +##### now? + +> `optional` **now?**: () => `number` + +Defined in: [runtime/sandbox-run.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L90) + +**`Experimental`** + +Test seam for deterministic hook timestamps. Defaults to `Date.now`. + +###### Returns + +`number` + +##### maxConcurrency? + +> `optional` **maxConcurrency?**: `number` + +Defined in: [runtime/sandbox-run.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L92) + +**`Experimental`** + +Bounds box-creation bursts inside lineage fanout. Default from lineage. + +##### readRetryDelayMs? + +> `optional` **readRetryDelayMs?**: `number` + +Defined in: [runtime/sandbox-run.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L95) + +**`Experimental`** + +Base backoff (ms) for retrying a transient artifact `fs.read` failure; the i-th + retry waits `readRetryDelayMs * i`. Default 1000. Set 0 to disable the wait (tests). + +*** + +### AuthorStrategyOptions + +Defined in: [runtime/strategy-author.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L77) + +#### Properties + +##### chat + +> **chat**: `ChatClient` + +Defined in: [runtime/strategy-author.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L79) + +The model-call seam (agent-eval `createChatClient`). + +##### model? + +> `optional` **model?**: `string` + +Defined in: [runtime/strategy-author.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L80) + +##### fallbackModel? + +> `optional` **fallbackModel?**: `string` + +Defined in: [runtime/strategy-author.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L85) + +A NAMED fallback author tried once when the primary call fails or returns no code + block (thinking models time out at the edge on long authoring prompts, or return + empty content without `maxTokens`). Opt-in — absent means the primary's failure + propagates. + +##### contract? + +> `optional` **contract?**: `string` + +Defined in: [runtime/strategy-author.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L89) + +The contract text shown to the author. Default `strategyAuthorContract`. The + meta-optimization coordinate: a GEPA/skill loop can evolve this text and gate each + variant on the same frozen holdout as any strategy. + +##### environmentName + +> **environmentName**: `string` + +Defined in: [runtime/strategy-author.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L91) + +The environment the losses came from (orientation only — never the verifiers). + +##### lossesJson + +> **lossesJson**: `string` + +Defined in: [runtime/strategy-author.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L93) + +The per-task losses table (e.g. JSON.stringify(report.perTask)) — the gradient. + +##### budget + +> **budget**: `number` + +Defined in: [runtime/strategy-author.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L95) + +The budget the strategy must respect (shots/width). + +##### outDir + +> **outDir**: `string` + +Defined in: [runtime/strategy-author.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L97) + +Where the authored module file is written (created if missing). + +##### temperature? + +> `optional` **temperature?**: `number` + +Defined in: [runtime/strategy-author.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L98) + +##### maxTokens? + +> `optional` **maxTokens?**: `number` + +Defined in: [runtime/strategy-author.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L100) + +Completion cap — required by thinking-model authors that stream reasoning first. + +##### signal? + +> `optional` **signal?**: `AbortSignal` + +Defined in: [runtime/strategy-author.ts:101](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L101) + +*** + +### AuthoredStrategy + +Defined in: [runtime/strategy-author.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L137) + +#### Properties + +##### strategy + +> **strategy**: [`Strategy`](#strategy-3) + +Defined in: [runtime/strategy-author.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L138) + +##### file + +> **file**: `string` + +Defined in: [runtime/strategy-author.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L139) + +##### code + +> **code**: `string` + +Defined in: [runtime/strategy-author.ts:140](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L140) + +*** + +### EvolutionAuthor + +Defined in: [runtime/strategy-evolution.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L46) + +#### Properties + +##### chat + +> **chat**: `ChatClient` + +Defined in: [runtime/strategy-evolution.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L48) + +The model-call seam (agent-eval `createChatClient`). + +##### model? + +> `optional` **model?**: `string` + +Defined in: [runtime/strategy-evolution.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L49) + +##### fallbackModel? + +> `optional` **fallbackModel?**: `string` + +Defined in: [runtime/strategy-evolution.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L50) + +##### temperature? + +> `optional` **temperature?**: `number` + +Defined in: [runtime/strategy-evolution.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L51) + +##### maxTokens? + +> `optional` **maxTokens?**: `number` + +Defined in: [runtime/strategy-evolution.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L52) + +*** + +### StrategyEvolutionConfig + +Defined in: [runtime/strategy-evolution.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L57) + +#### Properties + +##### environment + +> **environment**: [`AgenticSurface`](#agenticsurface) + +Defined in: [runtime/strategy-evolution.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L58) + +##### tasks + +> **tasks**: (`offset`, `n`) => `Promise`\<[`AgenticTask`](#agentictask)[]\> + +Defined in: [runtime/strategy-evolution.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L62) + +Task supply by DISJOINT slice: `(offset, n)` must return n tasks unique to that + offset range. Train draws [0, trainN); the holdout draws [trainN + holdoutOffset, + …) — tasks the search never touched. + +###### Parameters + +###### offset + +`number` + +###### n + +`number` + +###### Returns + +`Promise`\<[`AgenticTask`](#agentictask)[]\> + +##### trainN + +> **trainN**: `number` + +Defined in: [runtime/strategy-evolution.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L63) + +##### holdoutN + +> **holdoutN**: `number` + +Defined in: [runtime/strategy-evolution.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L64) + +##### holdoutOffset? + +> `optional` **holdoutOffset?**: `number` + +Defined in: [runtime/strategy-evolution.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L66) + +Extra offset past the train slice for the holdout draw (rotate across runs). + +##### worker + +> **worker**: [`AgenticOptions`](#agenticoptions) + +Defined in: [runtime/strategy-evolution.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L67) + +##### author + +> **author**: [`EvolutionAuthor`](#evolutionauthor) + +Defined in: [runtime/strategy-evolution.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L68) + +##### budget? + +> `optional` **budget?**: `number` + +Defined in: [runtime/strategy-evolution.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L70) + +Rollouts (sample) / shots (refine) per strategy per task. Default 3. + +##### concurrency? + +> `optional` **concurrency?**: `number` + +Defined in: [runtime/strategy-evolution.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L71) + +##### generations? + +> `optional` **generations?**: `number` + +Defined in: [runtime/strategy-evolution.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L73) + +Author→tournament rounds after gen0. Default 2. + +##### populationSize? + +> `optional` **populationSize?**: `number` + +Defined in: [runtime/strategy-evolution.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L75) + +Authored candidates per generation. Default 2. + +##### baselines? + +> `optional` **baselines?**: [`Strategy`](#strategy-3)[] + +Defined in: [runtime/strategy-evolution.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L77) + +The gen0 field. Default [sample, refine, sampleThenRefine]. + +##### objective? + +> `optional` **objective?**: `"score"` \| `"cost"` + +Defined in: [runtime/strategy-evolution.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L83) + +What "better" means for PROMOTION. 'score' (default): the candidate must beat the + incumbent's score (superiority gate). 'cost': the candidate must prove score + NON-INFERIORITY (not worse by more than `scoreTolerance`) plus significant cost + savings — the "same quality, cheaper" objective. The author is told the objective + and sees per-task spend either way. + +##### scoreTolerance? + +> `optional` **scoreTolerance?**: `number` + +Defined in: [runtime/strategy-evolution.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L85) + +Cost objective: the score CI lower bound must clear −scoreTolerance. Default 0.05. + +##### champion? + +> `optional` **champion?**: [`ChampionPolicy`](#championpolicy) + +Defined in: [runtime/strategy-evolution.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L87) + +Search-side champion selection. Default 'costAware'. + +##### championEpsilon? + +> `optional` **championEpsilon?**: `number` + +Defined in: [runtime/strategy-evolution.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L89) + +Score band treated as a tie under 'costAware'. Default 0.01. + +##### outDir + +> **outDir**: `string` + +Defined in: [runtime/strategy-evolution.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L91) + +Where authored modules are written. + +##### minPairedTasks? + +> `optional` **minPairedTasks?**: `number` + +Defined in: [runtime/strategy-evolution.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L93) + +Promotion-gate evidence floor (paired holdout tasks). + +##### band? + +> `optional` **band?**: `object` + +Defined in: [runtime/strategy-evolution.ts:102](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L102) + +BAND-AWARE scoring — concentrate the measurement where lift is possible. + Holdout: draw `holdoutPoolN` candidate tasks and run `baselines[0]` once at the run + budget as an INDEPENDENT reference screen; keep tasks scoring ≤ `maxRefScore` + (headroom exists) and take the first `holdoutN`. Band membership is decided before + either finalist touches a task and both finalists then face the SAME tasks — the + estimand becomes "paired lift on headroom tasks", pre-registered by this config. + Train: champion selection ignores zero-spread tasks (every field strategy scored + identically — zero selection information, pure noise dilution). + +###### holdoutPoolN + +> **holdoutPoolN**: `number` + +###### maxRefScore? + +> `optional` **maxRefScore?**: `number` + +Keep holdout tasks where the reference scores ≤ this. Default 0.99 — drop only + tasks the reference already solves fully (no headroom, a candidate can only tie). + +##### lossesDetail? + +> `optional` **lossesDetail?**: `"exact"` \| `"binary"` + +Defined in: [runtime/strategy-evolution.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L111) + +What the author learns from a tournament. 'exact' (default) = scores + progressions + per task; 'binary' = pass/fail only — the leakage-bounded channel (one bit per cell + per generation reaches the author from the evaluation data). + +##### reproducerCheck? + +> `optional` **reproducerCheck?**: `object` + +Defined in: [runtime/strategy-evolution.ts:118](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L118) + +Reproducer certification (arXiv:2606.11045): when the final champion is AUTHORED, + compress it to a short natural-language summary, have a fresh author re-implement + from the summary alone (no losses, no code), and score the reproduction on the same + holdout. A reproduction gap is an overfitting signal (their detector: 100% + sensitivity / 91% specificity in the ML-agent setting) — recorded on the report, + never gate-blocking in v1. + +###### summaryMaxWords? + +> `optional` **summaryMaxWords?**: `number` + +Word budget for the strategy summary. Default 64. + +###### tolerance? + +> `optional` **tolerance?**: `number` + +Reproduction counts as faithful when reproducedScore ≥ championScore − tolerance. + Default 0.05. + +##### checkpoint? + +> `optional` **checkpoint?**: `object` + +Defined in: [runtime/strategy-evolution.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L128) + +Endurance: write the run state after every completed phase; with `resume`, a + restart skips completed phases (authored modules re-imported from their files). + Worst case after a mid-run death is re-paying ONE phase, never the run. + +###### path + +> **path**: `string` + +###### resume? + +> `optional` **resume?**: `boolean` + +##### onPhase? + +> `optional` **onPhase?**: (`phase`) => `Promise`\<`void`\> + +Defined in: [runtime/strategy-evolution.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L135) + +Called before each benchmark phase (gen0, gen1…, band-screen, holdout, reproduce). + The seam for environment recycling — no artifacts span phases, so a runner may + recreate a wedge-prone environment container here. + +###### Parameters + +###### phase + +`string` + +###### Returns + +`Promise`\<`void`\> + +##### onTask? + +> `optional` **onTask?**: (`phase`, `row`, `done`, `total`) => `void` + +Defined in: [runtime/strategy-evolution.ts:136](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L136) + +###### Parameters + +###### phase + +`string` + +###### row + +[`BenchmarkTaskRow`](#benchmarktaskrow) + +###### done + +`number` + +###### total + +`number` + +###### Returns + +`void` + +##### hooks? + +> `optional` **hooks?**: [`RuntimeHooks`](index.md#runtimehooks) + +Defined in: [runtime/strategy-evolution.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L137) + +*** + +### ChampionPick + +Defined in: [runtime/strategy-evolution.ts:152](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L152) + +#### Properties + +##### name + +> **name**: `string` + +Defined in: [runtime/strategy-evolution.ts:153](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L153) + +##### score + +> **score**: `number` + +Defined in: [runtime/strategy-evolution.ts:154](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L154) + +##### usd + +> **usd**: `number` + +Defined in: [runtime/strategy-evolution.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L155) + +*** + +### EvolutionCandidate + +Defined in: [runtime/strategy-evolution.ts:158](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L158) + +#### Properties + +##### name + +> **name**: `string` + +Defined in: [runtime/strategy-evolution.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L159) + +##### file? + +> `optional` **file?**: `string` + +Defined in: [runtime/strategy-evolution.ts:160](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L160) + +##### gzipBits? + +> `optional` **gzipBits?**: `number` + +Defined in: [runtime/strategy-evolution.ts:161](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L161) + +##### codeChars? + +> `optional` **codeChars?**: `number` + +Defined in: [runtime/strategy-evolution.ts:162](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L162) + +##### error? + +> `optional` **error?**: `string` + +Defined in: [runtime/strategy-evolution.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L164) + +Present when this author attempt failed (recorded, never silent). + +*** + +### EvolutionGeneration + +Defined in: [runtime/strategy-evolution.ts:167](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L167) + +#### Properties + +##### generation + +> **generation**: `number` + +Defined in: [runtime/strategy-evolution.ts:168](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L168) + +##### candidates + +> **candidates**: [`EvolutionCandidate`](#evolutioncandidate)[] + +Defined in: [runtime/strategy-evolution.ts:169](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L169) + +##### report + +> **report**: [`BenchmarkReport`](#benchmarkreport) + +Defined in: [runtime/strategy-evolution.ts:170](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L170) + +##### champion + +> **champion**: [`ChampionPick`](#championpick) + +Defined in: [runtime/strategy-evolution.ts:171](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L171) + +*** + +### EvolutionArchiveNode + +Defined in: [runtime/strategy-evolution.ts:174](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L174) + +#### Properties + +##### name + +> **name**: `string` + +Defined in: [runtime/strategy-evolution.ts:175](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L175) + +##### source + +> **source**: `"baseline"` \| `"authored"` + +Defined in: [runtime/strategy-evolution.ts:176](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L176) + +##### generation + +> **generation**: `number` + +Defined in: [runtime/strategy-evolution.ts:177](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L177) + +##### parent? + +> `optional` **parent?**: `string` + +Defined in: [runtime/strategy-evolution.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L179) + +The champion whose tournament losses this candidate was authored from. + +##### gzipBits? + +> `optional` **gzipBits?**: `number` + +Defined in: [runtime/strategy-evolution.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L180) + +##### file? + +> `optional` **file?**: `string` + +Defined in: [runtime/strategy-evolution.ts:181](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L181) + +##### score + +> **score**: `number` + +Defined in: [runtime/strategy-evolution.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L184) + +Latest measured tournament result — 0 until the node's first tournament settles + (an authored node is created before its generation's benchmark runs). + +##### usd + +> **usd**: `number` + +Defined in: [runtime/strategy-evolution.ts:185](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L185) + +*** + +### EvolutionBandInfo + +Defined in: [runtime/strategy-evolution.ts:204](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L204) + +#### Properties + +##### screened + +> **screened**: `number` + +Defined in: [runtime/strategy-evolution.ts:206](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L206) + +Tasks screened by the reference on the holdout pool. + +##### inBand + +> **inBand**: `number` + +Defined in: [runtime/strategy-evolution.ts:208](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L208) + +Tasks kept (reference score ≤ maxRefScore) before truncating to holdoutN. + +##### refScores + +> **refScores**: `object`[] + +Defined in: [runtime/strategy-evolution.ts:210](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L210) + +Reference scores per screened task (the screening record). + +###### taskId + +> **taskId**: `string` + +###### score + +> **score**: `number` + +*** + +### EvolutionReport + +Defined in: [runtime/strategy-evolution.ts:213](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L213) + +#### Properties + +##### gen0 + +> **gen0**: [`BenchmarkReport`](#benchmarkreport) + +Defined in: [runtime/strategy-evolution.ts:214](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L214) + +##### gen0Champion + +> **gen0Champion**: [`ChampionPick`](#championpick) + +Defined in: [runtime/strategy-evolution.ts:215](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L215) + +##### generations + +> **generations**: [`EvolutionGeneration`](#evolutiongeneration)[] + +Defined in: [runtime/strategy-evolution.ts:216](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L216) + +##### archive + +> **archive**: [`EvolutionArchiveNode`](#evolutionarchivenode)[] + +Defined in: [runtime/strategy-evolution.ts:217](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L217) + +##### finalChampion + +> **finalChampion**: [`ChampionPick`](#championpick) + +Defined in: [runtime/strategy-evolution.ts:218](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L218) + +##### holdout + +> **holdout**: [`BenchmarkReport`](#benchmarkreport) + +Defined in: [runtime/strategy-evolution.ts:219](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L219) + +##### verdict + +> **verdict**: [`PromotionVerdict`](#promotionverdict) + +Defined in: [runtime/strategy-evolution.ts:220](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L220) + +##### band? + +> `optional` **band?**: [`EvolutionBandInfo`](#evolutionbandinfo) + +Defined in: [runtime/strategy-evolution.ts:223](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L223) + +Present when band screening ran — the verdict's estimand is then "paired lift on + headroom tasks" (band membership fixed by the reference screen, pre-registered). + +##### reproduction? + +> `optional` **reproduction?**: `ReproductionCheck` + +Defined in: [runtime/strategy-evolution.ts:225](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L225) + +Present when reproducerCheck ran (final champion was authored). + +##### trajectory + +> **trajectory**: `object`[] + +Defined in: [runtime/strategy-evolution.ts:230](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L230) + +SEARCH TELEMETRY, not evidence: each entry is that generation's own train-slice + re-measurement, so cross-generation deltas mix true drift with run-to-run variance + (entries are unpaired across generations). The only evidence-grade comparison in + this report is `verdict` — both finalists measured fresh, paired, on the holdout. + +###### generation + +> **generation**: `number` + +###### champion + +> **champion**: `string` + +###### score + +> **score**: `number` + +###### usd + +> **usd**: `number` + +*** + +### AgenticTask + +Defined in: [runtime/strategy.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L48) + +#### Properties + +##### id + +> `readonly` **id**: `string` + +Defined in: [runtime/strategy.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L49) + +##### systemPrompt + +> `readonly` **systemPrompt**: `string` + +Defined in: [runtime/strategy.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L50) + +##### userPrompt + +> `readonly` **userPrompt**: `string` + +Defined in: [runtime/strategy.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L51) + +##### meta? + +> `readonly` `optional` **meta?**: `Record`\<`string`, `unknown`\> + +Defined in: [runtime/strategy.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L53) + +Opaque domain payload the surface reads (EOPS: servers/verifiers/tools). Drivers never read it. + +*** + +### ArtifactHandle + +Defined in: [runtime/strategy.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L56) + +#### Properties + +##### id + +> `readonly` **id**: `string` + +Defined in: [runtime/strategy.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L57) + +##### surface + +> `readonly` **surface**: `string` + +Defined in: [runtime/strategy.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L58) + +##### ctx? + +> `readonly` `optional` **ctx?**: `unknown` + +Defined in: [runtime/strategy.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L60) + +Opaque per-artifact context the surface stashes (EOPS: the seeded gym server + db id). + +*** + +### AgenticTool + +Defined in: [runtime/strategy.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L63) + +#### Properties + +##### type + +> `readonly` **type**: `"function"` + +Defined in: [runtime/strategy.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L64) + +##### function + +> `readonly` **function**: `object` + +Defined in: [runtime/strategy.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L65) + +###### name + +> **name**: `string` + +###### description? + +> `optional` **description?**: `string` + +###### parameters + +> **parameters**: `Record`\<`string`, `unknown`\> + +*** + +### SurfaceScore + +Defined in: [runtime/strategy.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L68) + +#### Properties + +##### passes + +> **passes**: `number` + +Defined in: [runtime/strategy.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L69) + +##### total + +> **total**: `number` + +Defined in: [runtime/strategy.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L70) + +##### errored + +> **errored**: `number` + +Defined in: [runtime/strategy.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L72) + +Checks excluded as malformed (data defect, not the agent). `total === 0` ⇒ unscoreable. + +*** + +### AgenticSurface + +Defined in: [runtime/strategy.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L76) + +A stateful, checkable environment an agent operates over with tools. Open behind one interface. + +#### Properties + +##### name + +> `readonly` **name**: `string` + +Defined in: [runtime/strategy.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L77) + +#### Methods + +##### open() + +> **open**(`task`): `Promise`\<[`ArtifactHandle`](#artifacthandle)\> + +Defined in: [runtime/strategy.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L78) + +###### Parameters + +###### task + +[`AgenticTask`](#agentictask) + +###### Returns + +`Promise`\<[`ArtifactHandle`](#artifacthandle)\> + +##### tools() + +> **tools**(`task`, `handle`): `Promise`\<[`AgenticTool`](#agentictool)[]\> + +Defined in: [runtime/strategy.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L79) + +###### Parameters + +###### task + +[`AgenticTask`](#agentictask) + +###### handle + +[`ArtifactHandle`](#artifacthandle) + +###### Returns + +`Promise`\<[`AgenticTool`](#agentictool)[]\> + +##### call() + +> **call**(`handle`, `name`, `args`): `Promise`\<`string`\> + +Defined in: [runtime/strategy.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L80) + +###### Parameters + +###### handle + +[`ArtifactHandle`](#artifacthandle) + +###### name + +`string` + +###### args + +`Record`\<`string`, `unknown`\> + +###### Returns + +`Promise`\<`string`\> + +##### score() + +> **score**(`task`, `handle`): `Promise`\<[`SurfaceScore`](#surfacescore)\> + +Defined in: [runtime/strategy.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L81) + +###### Parameters + +###### task + +[`AgenticTask`](#agentictask) + +###### handle + +[`ArtifactHandle`](#artifacthandle) + +###### Returns + +`Promise`\<[`SurfaceScore`](#surfacescore)\> + +##### close() + +> **close**(`handle`): `Promise`\<`void`\> + +Defined in: [runtime/strategy.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L82) + +###### Parameters + +###### handle + +[`ArtifactHandle`](#artifacthandle) + +###### Returns + +`Promise`\<`void`\> + +*** + +### AgenticOptions + +Defined in: [runtime/strategy.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L85) + +#### Extended by + +- [`RunAgenticOptions`](#runagenticoptions) + +#### Properties + +##### routerBaseUrl + +> **routerBaseUrl**: `string` + +Defined in: [runtime/strategy.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L86) + +##### routerKey + +> **routerKey**: `string` + +Defined in: [runtime/strategy.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L87) + +##### model + +> **model**: `string` + +Defined in: [runtime/strategy.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L88) + +##### temperature? + +> `optional` **temperature?**: `number` + +Defined in: [runtime/strategy.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L89) + +##### maxTokens? + +> `optional` **maxTokens?**: `number` + +Defined in: [runtime/strategy.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L92) + +Completion cap per worker turn — REQUIRED for thinking models (they burn unbounded + budgets on reasoning and return empty content without it). Omitted ⇒ provider default. + +##### innerTurns? + +> `optional` **innerTurns?**: `number` + +Defined in: [runtime/strategy.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L94) + +Turns the agent may take within ONE shot before the driver intervenes. + +##### analystInstruction? + +> `optional` **analystInstruction?**: `string` + +Defined in: [runtime/strategy.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L97) + +The depth STEERER's analyst instruction (observe()'s system prompt). The knob a + prompt optimizer (GEPA) tunes — the analyst IS the steerer. Omitted ⇒ the default. + +##### analystModel? + +> `optional` **analystModel?**: `string` + +Defined in: [runtime/strategy.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L100) + +The critic's model — lets the analyst be a stronger (or cheaper) model than the + worker. Omitted ⇒ the worker's `model`. + +##### corpus? + +> `optional` **corpus?**: [`Corpus`](#corpus-2) + +Defined in: [runtime/strategy.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L104) + +Across-run learning: when set, the analyst's observe() pass appends trace-derived + facts here (the flywheel write side). Priming (the read side) is the caller's move — + query the corpus and fold facts into the task's systemPrompt before runAgentic. + +##### corpusTags? + +> `optional` **corpusTags?**: `string`[] + +Defined in: [runtime/strategy.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L106) + +Tags written onto learned facts (and used by the caller's priming query). + +*** + +### AgenticRunResult + +Defined in: [runtime/strategy.ts:505](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L505) + +#### Properties + +##### mode + +> **mode**: `string` + +Defined in: [runtime/strategy.ts:507](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L507) + +The strategy name (built-in 'depth'/'breadth' or a custom strategy's name). + +##### score + +> **score**: `number` + +Defined in: [runtime/strategy.ts:508](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L508) + +##### resolved + +> **resolved**: `boolean` + +Defined in: [runtime/strategy.ts:509](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L509) + +##### completions + +> **completions**: `number` + +Defined in: [runtime/strategy.ts:510](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L510) + +##### progression + +> **progression**: `number`[] + +Defined in: [runtime/strategy.ts:512](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L512) + +DEPTH: score after each shot — the progress-over-rounds curve. BREADTH: best-so-far per rollout. + +##### shots + +> **shots**: `number` + +Defined in: [runtime/strategy.ts:513](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L513) + +##### usd + +> **usd**: `number` + +Defined in: [runtime/strategy.ts:516](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L516) + +The cost vector, stamped by `runAgentic` from the Supervisor's conserved pool: real + router tokens, priced usd (0 when the model is unpriced — never fabricated), wall ms. + +##### ms + +> **ms**: `number` + +Defined in: [runtime/strategy.ts:517](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L517) + +##### tokens + +> **tokens**: `object` + +Defined in: [runtime/strategy.ts:518](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L518) + +###### input + +> **input**: `number` + +###### output + +> **output**: `number` + +*** + +### Strategy + +Defined in: [runtime/strategy.ts:652](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L652) + +A Strategy is HOW you spend the compute budget to beat the Environment's check — it +builds the driver `Agent` the Supervisor runs. This is the OPEN extension point: a dev +authors their own by implementing `driver()` to return an Agent whose `act()` spawns +shots/analysts via `scope.spawn` / `scope.next` / `scope.send`. The two built-ins are +the reference implementations to copy: + sample — K INDEPENDENT attempts, keep the best-verifying (best-of-N / resample). + refine — attempt → observe() reads the trace → steer the next → repeat (iterate). +(A multi-agent "team" is just a Strategy whose driver spawns several different agents.) + +#### Properties + +##### name + +> `readonly` **name**: `string` + +Defined in: [runtime/strategy.ts:653](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L653) + +#### Methods + +##### driver() + +> **driver**(`surface`, `task`, `opts`, `budget`): [`Agent`](#agent)\<`unknown`, [`Outcome`](#outcome-1)\<`unknown`\>\> + +Defined in: [runtime/strategy.ts:654](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L654) + +###### Parameters + +###### surface + +[`AgenticSurface`](#agenticsurface) + +###### task + +[`AgenticTask`](#agentictask) + +###### opts + +[`AgenticOptions`](#agenticoptions) + +###### budget + +`number` + +###### Returns + +[`Agent`](#agent)\<`unknown`, [`Outcome`](#outcome-1)\<`unknown`\>\> + +*** + +### ShotPersona + +Defined in: [runtime/strategy.ts:682](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L682) + +A role for one shot — multi-agent loops (researcher + engineer, a panel of k + researchers) give each shot its own system prompt and optionally its own model. + +#### Properties + +##### systemPrompt? + +> `optional` **systemPrompt?**: `string` + +Defined in: [runtime/strategy.ts:685](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L685) + +Replaces the task's systemPrompt for a FRESH shot; on a carried conversation it is + injected as a hand-off message (the transcript's earlier roles stay intact). + +##### model? + +> `optional` **model?**: `string` + +Defined in: [runtime/strategy.ts:687](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L687) + +Per-shot model override (e.g. a stronger model for the engineer shot). + +*** + +### ShotSpec + +Defined in: [runtime/strategy.ts:690](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L690) + +#### Properties + +##### handle? + +> `optional` **handle?**: [`ArtifactHandle`](#artifacthandle) + +Defined in: [runtime/strategy.ts:692](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L692) + +present ⇒ continue this artifact (depth); absent ⇒ the shot opens a fresh one (sample/restart). + +##### messages? + +> `optional` **messages?**: `Msg`[] + +Defined in: [runtime/strategy.ts:693](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L693) + +##### steer? + +> `optional` **steer?**: `string` + +Defined in: [runtime/strategy.ts:694](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L694) + +##### persona? + +> `optional` **persona?**: [`ShotPersona`](#shotpersona) + +Defined in: [runtime/strategy.ts:695](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L695) + +##### tools? + +> `optional` **tools?**: `string`[] + +Defined in: [runtime/strategy.ts:698](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L698) + +Restrict THIS shot to a subset of the domain's tools (by name) — focus a shot on + the relevant capabilities. Restriction-only; unknown names throw. Omitted ⇒ all. + +*** + +### StrategyResult + +Defined in: [runtime/strategy.ts:700](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L700) + +#### Properties + +##### score + +> **score**: `number` + +Defined in: [runtime/strategy.ts:701](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L701) + +##### resolved + +> **resolved**: `boolean` + +Defined in: [runtime/strategy.ts:702](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L702) + +##### completions + +> **completions**: `number` + +Defined in: [runtime/strategy.ts:703](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L703) + +##### progression + +> **progression**: `number`[] + +Defined in: [runtime/strategy.ts:704](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L704) + +##### shots + +> **shots**: `number` + +Defined in: [runtime/strategy.ts:705](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L705) + +*** + +### StrategyCtx + +Defined in: [runtime/strategy.ts:717](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L717) + +What a strategy body composes with: the artifact lifecycle, the budget, and the two steps. + +#### Properties + +##### surface + +> `readonly` **surface**: `StrategyArtifacts` + +Defined in: [runtime/strategy.ts:719](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L719) + +Open/close artifacts the body manages itself (e.g. one persistent handle for depth). + +##### task + +> `readonly` **task**: [`AgenticTask`](#agentictask) + +Defined in: [runtime/strategy.ts:720](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L720) + +##### opts + +> `readonly` **opts**: [`AgenticOptions`](#agenticoptions) + +Defined in: [runtime/strategy.ts:721](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L721) + +##### budget + +> `readonly` **budget**: `number` + +Defined in: [runtime/strategy.ts:722](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L722) + +##### scope + +> `readonly` **scope**: [`Scope`](#scope-1)\<[`Outcome`](#outcome-1)\<`unknown`\>\> + +Defined in: [runtime/strategy.ts:723](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L723) + +#### Methods + +##### shot() + +> **shot**(`spec?`): `Promise`\<`ShotResult` \| `null`\> + +Defined in: [runtime/strategy.ts:725](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L725) + +Run ONE worker shot; its harness-scored result, or null if it went down. + +###### Parameters + +###### spec? + +[`ShotSpec`](#shotspec) + +###### Returns + +`Promise`\<`ShotResult` \| `null`\> + +##### critique() + +> **critique**(`messages`): `Promise`\<`string` \| `null`\> + +Defined in: [runtime/strategy.ts:727](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L727) + +The firewalled critic reads the trajectory → a steer string, or null on COMPLETE/down. + +###### Parameters + +###### messages + +`Msg`[] + +###### Returns + +`Promise`\<`string` \| `null`\> + +##### consult() + +> **consult**(`messages`, `instruction`): `Promise`\<`string` \| `null`\> + +Defined in: [runtime/strategy.ts:732](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L732) + +The RAW analyst channel: the firewalled critic answers `instruction` over the + trajectory verbatim — no findings extraction, so verdict-shaped formats + (CONTINUE/STOP decisions, calibrated predictions) survive. Same firewall: + trajectory in, never scores. Null when the analyst went down. + +###### Parameters + +###### messages + +`Msg`[] + +###### instruction + +`string` + +###### Returns + +`Promise`\<`string` \| `null`\> + +##### listTools() + +> **listTools**(`handle`): `Promise`\<`object`[]\> + +Defined in: [runtime/strategy.ts:736](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L736) + +The tools THIS artifact's task actually offers (names + descriptions only — never + the implementations). Tool sets vary per task on heterogeneous domains; a strategy + that restricts shots MUST select from this list, never from hardcoded names. + +###### Parameters + +###### handle + +[`ArtifactHandle`](#artifacthandle) + +###### Returns + +`Promise`\<`object`[]\> + +*** + +### RunAgenticOptions + +Defined in: [runtime/strategy.ts:965](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L965) + +#### Extends + +- [`AgenticOptions`](#agenticoptions) + +#### Properties + +##### routerBaseUrl + +> **routerBaseUrl**: `string` + +Defined in: [runtime/strategy.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L86) + +###### Inherited from + +[`AgenticOptions`](#agenticoptions).[`routerBaseUrl`](#routerbaseurl-1) + +##### routerKey + +> **routerKey**: `string` + +Defined in: [runtime/strategy.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L87) + +###### Inherited from + +[`AgenticOptions`](#agenticoptions).[`routerKey`](#routerkey-1) + +##### model + +> **model**: `string` + +Defined in: [runtime/strategy.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L88) + +###### Inherited from + +[`AgenticOptions`](#agenticoptions).[`model`](#model-6) + +##### temperature? + +> `optional` **temperature?**: `number` + +Defined in: [runtime/strategy.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L89) + +###### Inherited from + +[`AgenticOptions`](#agenticoptions).[`temperature`](#temperature-2) + +##### maxTokens? + +> `optional` **maxTokens?**: `number` + +Defined in: [runtime/strategy.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L92) + +Completion cap per worker turn — REQUIRED for thinking models (they burn unbounded + budgets on reasoning and return empty content without it). Omitted ⇒ provider default. + +###### Inherited from + +[`AgenticOptions`](#agenticoptions).[`maxTokens`](#maxtokens-2) + +##### innerTurns? + +> `optional` **innerTurns?**: `number` + +Defined in: [runtime/strategy.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L94) + +Turns the agent may take within ONE shot before the driver intervenes. + +###### Inherited from + +[`AgenticOptions`](#agenticoptions).[`innerTurns`](#innerturns) + +##### analystInstruction? + +> `optional` **analystInstruction?**: `string` + +Defined in: [runtime/strategy.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L97) + +The depth STEERER's analyst instruction (observe()'s system prompt). The knob a + prompt optimizer (GEPA) tunes — the analyst IS the steerer. Omitted ⇒ the default. + +###### Inherited from + +[`AgenticOptions`](#agenticoptions).[`analystInstruction`](#analystinstruction-2) + +##### analystModel? + +> `optional` **analystModel?**: `string` + +Defined in: [runtime/strategy.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L100) + +The critic's model — lets the analyst be a stronger (or cheaper) model than the + worker. Omitted ⇒ the worker's `model`. + +###### Inherited from + +[`AgenticOptions`](#agenticoptions).[`analystModel`](#analystmodel) + +##### corpus? + +> `optional` **corpus?**: [`Corpus`](#corpus-2) + +Defined in: [runtime/strategy.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L104) + +Across-run learning: when set, the analyst's observe() pass appends trace-derived + facts here (the flywheel write side). Priming (the read side) is the caller's move — + query the corpus and fold facts into the task's systemPrompt before runAgentic. + +###### Inherited from + +[`AgenticOptions`](#agenticoptions).[`corpus`](#corpus-4) + +##### corpusTags? + +> `optional` **corpusTags?**: `string`[] + +Defined in: [runtime/strategy.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L106) + +Tags written onto learned facts (and used by the caller's priming query). + +###### Inherited from + +[`AgenticOptions`](#agenticoptions).[`corpusTags`](#corpustags) + +##### surface + +> **surface**: [`AgenticSurface`](#agenticsurface) + +Defined in: [runtime/strategy.ts:966](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L966) + +##### task + +> **task**: [`AgenticTask`](#agentictask) + +Defined in: [runtime/strategy.ts:967](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L967) + +##### hooks? + +> `optional` **hooks?**: [`RuntimeHooks`](index.md#runtimehooks) + +Defined in: [runtime/strategy.ts:970](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L970) + +Lifecycle observability — every spawn/settle (shots, analysts) streams here live. + The seam online watchdogs/route-auditors subscribe to. + +##### strategy? + +> `optional` **strategy?**: [`Strategy`](#strategy-3) + +Defined in: [runtime/strategy.ts:972](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L972) + +A Strategy (the open way) — author/pass your own. Overrides `mode` when present. + +##### mode? + +> `optional` **mode?**: `"depth"` \| `"breadth"` + +Defined in: [runtime/strategy.ts:974](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L974) + +Built-in shorthand: 'depth'→refine, 'breadth'→sample. Default 'depth'. + +##### budget + +> **budget**: `number` + +Defined in: [runtime/strategy.ts:976](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L976) + +budget: refine→max shots; sample→rollout width. + +##### rootBudget? + +> `optional` **rootBudget?**: [`Budget`](#budget-8) + +Defined in: [runtime/strategy.ts:977](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L977) + +*** + +### AuthoredProfile + +Defined in: [runtime/supervise/authoring.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/authoring.ts#L23) + +What the supervisor AUTHORS per sub-task — a worker recipe (a partial `AgentProfile`). + +#### Properties + +##### name + +> **name**: `string` + +Defined in: [runtime/supervise/authoring.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/authoring.ts#L24) + +##### systemPrompt + +> **systemPrompt**: `string` + +Defined in: [runtime/supervise/authoring.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/authoring.ts#L26) + +The rich, task-specific instructions the supervisor wrote for THIS worker. + +##### model? + +> `optional` **model?**: `string` + +Defined in: [runtime/supervise/authoring.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/authoring.ts#L28) + +The model the supervisor chose for this sub-task (falls back to the run default). + +*** + +### ReservationTicket + +Defined in: [runtime/supervise/budget.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L29) + +Opaque, single-use reservation handle returned by `reserve` and consumed by + `reconcile`. Carries the reserved ceilings so reconciliation needs no lookup. + +#### Properties + +##### id + +> `readonly` **id**: `number` + +Defined in: [runtime/supervise/budget.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L30) + +##### reserved + +> `readonly` **reserved**: `object` + +Defined in: [runtime/supervise/budget.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L31) + +###### tokens + +> `readonly` **tokens**: `number` + +###### usd + +> `readonly` **usd**: `number` + +###### iterations + +> `readonly` **iterations**: `number` + +*** + +### BudgetPool + +Defined in: [runtime/supervise/budget.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L51) + +#### Methods + +##### reserve() + +> **reserve**(`b`): \{ `ok`: `true`; `ticket`: [`ReservationTicket`](#reservationticket); \} \| \{ `ok`: `false`; `reason`: `"budget-exhausted"`; \} + +Defined in: [runtime/supervise/budget.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L57) + +Atomically reserve a child's full ceiling from the free balance. Fails closed +({ ok: false }) when the pool can't cover tokens, usd, or iterations — the +caller inspects `ok` before `ticket`. + +###### Parameters + +###### b + +[`Budget`](#budget-8) + +###### Returns + +\{ `ok`: `true`; `ticket`: [`ReservationTicket`](#reservationticket); \} \| \{ `ok`: `false`; `reason`: `"budget-exhausted"`; \} + +##### reconcile() + +> **reconcile**(`ticket`, `spent`): `void` + +Defined in: [runtime/supervise/budget.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L65) + +Release a reservation: commit the actual `spent`, refund the unspent remainder +to the free pool. Throws on an unknown or already-reconciled ticket (fail loud — +a double refund would silently break conservation). + +###### Parameters + +###### ticket + +[`ReservationTicket`](#reservationticket) + +###### spent + +[`Spend`](#spend) + +###### Returns + +`void` + +##### spendFrom() + +> **spendFrom**(`events`): `Promise`\<[`Spend`](#spend)\> + +Defined in: [runtime/supervise/budget.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L69) + +Fold a normalized `UsageEvent` stream (or array) into a `Spend`. Tokens via + `addTokenUsage`, usd on its own channel, iterations from `'iteration'` events. + `ms` is left zero — wall-clock duration is the caller's to record, not the pool's. + +###### Parameters + +###### events + +`AsyncIterable`\<[`UsageEvent`](#usageevent), `any`, `any`\> \| [`UsageEvent`](#usageevent)[] + +###### Returns + +`Promise`\<[`Spend`](#spend)\> + +##### readout() + +> **readout**(): [`BudgetReadout`](#budgetreadout) + +Defined in: [runtime/supervise/budget.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L71) + +The current readout, reflecting all outstanding reservations. + +###### Returns + +[`BudgetReadout`](#budgetreadout) + +##### observe() + +> **observe**(`spend`): `void` + +Defined in: [runtime/supervise/budget.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L82) + +Record OBSERVED spend that did NOT go through reserve/reconcile — the driver's OWN inference +(its chat turns), which is real compute but not a spawned child. A direct `free → committed` +debit, so `total ≡ free + reserved + committed` is preserved: equal-k counts the driver's +tokens and the in-loop budget guard (`readout().tokensLeft`) sees them. `free` may go negative +when a run overspends — that is honest (the readout then signals exhaustion). It never throws: +the spend already happened, so accounting records reality; the in-loop guard prevents MORE. +The DURABLE record is the journal's `metered` event (written by `Scope.meter`); this debit +only makes the live `readout()` reflect driver inference for the in-loop guard. + +###### Parameters + +###### spend + +[`Spend`](#spend) + +###### Returns + +`void` + +##### assertNoOpenTickets() + +> **assertNoOpenTickets**(): `void` + +Defined in: [runtime/supervise/budget.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L86) + +Fail loud if any reservation is still open — the conserved-pool leak detector. Called at the + supervisor's join barrier: once every child has settled, no ticket may remain (a leaked + reservation would silently break `total ≡ free + reserved + committed`). + +###### Returns + +`void` + +*** + +### DeliverableSpec + +Defined in: [runtime/supervise/completion-gate.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/completion-gate.ts#L31) + +The deployable completion oracle passed to [gateOnDeliverable](#gateondeliverable): a `check` that +decides DELIVERED (settles `valid` ⟺ it resolves true) plus an optional `describe` of +what the spawn was supposed to produce. The check reads the child's output — never the +model judging itself. + +#### Type Parameters + +##### Out + +`Out` = `unknown` + +#### Properties + +##### check + +> **check**: (`out`) => `boolean` \| `Promise`\<`boolean`\> + +Defined in: [runtime/supervise/completion-gate.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/completion-gate.ts#L33) + +The deployable check that decides DELIVERED. `settled.valid ⟺ this resolves true`. + +###### Parameters + +###### out + +`Out` + +###### Returns + +`boolean` \| `Promise`\<`boolean`\> + +##### describe? + +> `optional` **describe?**: `string` + +Defined in: [runtime/supervise/completion-gate.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/completion-gate.ts#L35) + +What the spawn was supposed to produce — surfaced in traces/reports. + +*** + +### DriverToolCall + +Defined in: [runtime/supervise/coordination-driver.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L33) + +One tool call the driver LLM asks for this turn. + +#### Properties + +##### id? + +> `readonly` `optional` **id?**: `string` + +Defined in: [runtime/supervise/coordination-driver.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L34) + +##### name + +> `readonly` **name**: `string` + +Defined in: [runtime/supervise/coordination-driver.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L35) + +##### arguments + +> `readonly` **arguments**: `Record`\<`string`, `unknown`\> + +Defined in: [runtime/supervise/coordination-driver.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L36) + +*** + +### DriverMessage + +Defined in: [runtime/supervise/coordination-driver.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L40) + +A turn in the driver↔tools conversation. Tool results ride back as `role: 'tool'`. + +#### Properties + +##### role + +> `readonly` **role**: `"tool"` \| `"user"` \| `"assistant"` + +Defined in: [runtime/supervise/coordination-driver.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L41) + +##### content + +> `readonly` **content**: `string` + +Defined in: [runtime/supervise/coordination-driver.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L42) + +##### toolCalls? + +> `readonly` `optional` **toolCalls?**: readonly [`DriverToolCall`](#drivertoolcall)[] + +Defined in: [runtime/supervise/coordination-driver.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L43) + +##### toolCallId? + +> `readonly` `optional` **toolCallId?**: `string` + +Defined in: [runtime/supervise/coordination-driver.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L44) + +##### name? + +> `readonly` `optional` **name?**: `string` + +Defined in: [runtime/supervise/coordination-driver.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L45) + +*** + +### DriverTurn + +Defined in: [runtime/supervise/coordination-driver.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L49) + +What the driver LLM returns each turn. No `toolCalls` => the driver is finished. + +#### Properties + +##### toolCalls? + +> `readonly` `optional` **toolCalls?**: readonly [`DriverToolCall`](#drivertoolcall)[] + +Defined in: [runtime/supervise/coordination-driver.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L50) + +##### content? + +> `readonly` `optional` **content?**: `string` + +Defined in: [runtime/supervise/coordination-driver.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L52) + +The driver's natural-language output — the answer when there are no tool calls. + +##### usage? + +> `readonly` `optional` **usage?**: `object` + +Defined in: [runtime/supervise/coordination-driver.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L56) + +The driver LLM's OWN token usage for THIS turn — metered against the conserved pool so the + driver's inference counts toward equal-k AND the in-loop budget guard. Omit for a scripted/ + mock turn (no real inference); production `routerDriverChat` forwards it from the router. + +###### input + +> `readonly` **input**: `number` + +###### output + +> `readonly` **output**: `number` + +##### costUsd? + +> `readonly` `optional` **costUsd?**: `number` + +Defined in: [runtime/supervise/coordination-driver.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L58) + +The turn's inference cost (usd), when the provider priced it. + +*** + +### DriverChat + +Defined in: [runtime/supervise/coordination-driver.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L62) + +The injected driver-LLM seam: one turn over the conversation + the coordination tool specs. + +#### Methods + +##### next() + +> **next**(`input`): `Promise`\<[`DriverTurn`](#driverturn)\> + +Defined in: [runtime/supervise/coordination-driver.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L63) + +###### Parameters + +###### input + +###### system + +`string` + +###### messages + +readonly [`DriverMessage`](#drivermessage)[] + +###### tools + +readonly `object`[] + +###### Returns + +`Promise`\<[`DriverTurn`](#driverturn)\> + +*** + +### CoordinationDriverOptions + +Defined in: [runtime/supervise/coordination-driver.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L70) + +#### Properties + +##### name + +> `readonly` **name**: `string` + +Defined in: [runtime/supervise/coordination-driver.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L71) + +##### chat + +> `readonly` **chat**: [`DriverChat`](#driverchat) + +Defined in: [runtime/supervise/coordination-driver.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L73) + +The driver-LLM seam (scripted mock offline; router tool-calling in production). + +##### blobs + +> `readonly` **blobs**: [`ResultBlobStore`](#resultblobstore) + +Defined in: [runtime/supervise/coordination-driver.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L75) + +Shared blob store — `observe_worker` reads settled outputs through it. + +##### makeWorkerAgent + +> `readonly` **makeWorkerAgent**: [`MakeWorkerAgent`](mcp.md#makeworkeragent) + +Defined in: [runtime/supervise/coordination-driver.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L77) + +Resolve a spawned `profile` to a worker LEAF or a driver child (the recursion seam). + +##### perWorker + +> `readonly` **perWorker**: [`Budget`](#budget-8) + +Defined in: [runtime/supervise/coordination-driver.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L79) + +Per-child budget reserved from the conserved pool on each spawn. + +##### systemPrompt + +> `readonly` **systemPrompt**: `string` \| ((`task`) => `string`) + +Defined in: [runtime/supervise/coordination-driver.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L82) + +The driver's stance — a string, or built from the task (the worker-driver prompt / + the generator). INJECTED so the prompt is a pluggable, optimizable role. + +##### maxTurns? + +> `readonly` `optional` **maxTurns?**: `number` + +Defined in: [runtime/supervise/coordination-driver.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L87) + +Max driver turns before the loop force-finalizes on the best settled child. Default 16. + `0` lifts the turn-COUNT cap: the loop is bounded instead by the conserved budget pool, + an absolute deadline, the driver's own stop, and abort (checked in-loop). A finite + anti-runaway tripwire still guards a degenerate driver that loops on a no-spawn tool. + +##### now? + +> `readonly` `optional` **now?**: () => `number` + +Defined in: [runtime/supervise/coordination-driver.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L90) + +Injected clock for the in-loop absolute-deadline guard — keeps the deadline check + deterministic in tests. Defaults to `Date.now`. + +###### Returns + +`number` + +*** + +### CoordinationMcpHandle + +Defined in: [runtime/supervise/coordination-mcp.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L33) + +#### Properties + +##### url + +> `readonly` **url**: `string` + +Defined in: [runtime/supervise/coordination-mcp.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L35) + +The URL an in-box harness mounts as `mcp.mcpServers.coordination.url`. + +##### port + +> `readonly` **port**: `number` + +Defined in: [runtime/supervise/coordination-mcp.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L36) + +##### history + +> **history**: () => readonly [`BusRecord`](#busrecord)\<[`CoordinationEvent`](mcp.md#coordinationevent)\>[] + +Defined in: [runtime/supervise/coordination-mcp.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L41) + +The full ordered bus-event log — observability audit + replay trail. + +The full ordered log of every bus event — UP (settled / question / finding) and DOWN + (steer / answer) — the observability audit + replay trail. Each record carries seq, + timestamp, and priority. + +###### Returns + +readonly [`BusRecord`](#busrecord)\<[`CoordinationEvent`](mcp.md#coordinationevent)\>[] + +##### stats + +> **stats**: () => [`BusStats`](#busstats) + +Defined in: [runtime/supervise/coordination-mcp.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L43) + +Bus throughput counters for live dashboards. + +Bus throughput counters (published / pulled / by-kind) for live dashboards. + +###### Returns + +[`BusStats`](#busstats) + +##### raiseFinding + +> **raiseFinding**: (`finding`) => `Promise`\<`void`\> + +Defined in: [runtime/supervise/coordination-mcp.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L45) + +Raise a `finding` on the bus from an online detector watching a worker's live pipe. + +Raise a `finding` on the bus from outside the settle hook — the seam an ONLINE detector + (mid-run, on the worker pipe) uses to tell the driver "this worker is looping/erroring" the + moment it happens, instead of only at settle. Queued for `await_event` + pass-through. + +###### Parameters + +###### finding + +`AnalystFindingEvent` + +###### Returns + +`Promise`\<`void`\> + +#### Methods + +##### settled() + +> **settled**(): readonly `object`[] + +Defined in: [runtime/supervise/coordination-mcp.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L38) + +The coordination tools' settled-worker ledger (for the driver's finalize). + +###### Returns + +readonly `object`[] + +##### isStopped() + +> **isStopped**(): `boolean` + +Defined in: [runtime/supervise/coordination-mcp.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L39) + +###### Returns + +`boolean` + +##### close() + +> **close**(): `Promise`\<`void`\> + +Defined in: [runtime/supervise/coordination-mcp.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L46) + +###### Returns + +`Promise`\<`void`\> + +*** + +### WatchTraceOptions + +Defined in: [runtime/supervise/detector-monitor.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/detector-monitor.ts#L22) + +#### Properties + +##### detectors? + +> `readonly` `optional` **detectors?**: readonly `StreamingDetector`[] + +Defined in: [runtime/supervise/detector-monitor.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/detector-monitor.ts#L24) + +The detectors to run online. Defaults to a stuck-loop + error-streak panel. + +##### onSignal? + +> `readonly` `optional` **onSignal?**: (`signal`, `span`) => `void` \| `Promise`\<`void`\> + +Defined in: [runtime/supervise/detector-monitor.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/detector-monitor.ts#L26) + +Fired for each signal a detector raises — the seam that raises a `finding` on the bus. + +###### Parameters + +###### signal + +`DetectorSignal` + +###### span + +`ToolSpan` + +###### Returns + +`void` \| `Promise`\<`void`\> + +*** + +### BusEvent + +Defined in: [runtime/supervise/event-bus.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L26) + +Every bus event is a discriminated union member keyed by `type`. + +#### Properties + +##### type + +> `readonly` **type**: `string` + +Defined in: [runtime/supervise/event-bus.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L27) + +*** + +### BusRecord + +Defined in: [runtime/supervise/event-bus.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L32) + +A published event stamped for ordering and observability. `seq` is the monotonic publish index; + `priority` drives pull order (higher = bumped ahead); `at` is the wall-clock publish time (ms). + +#### Type Parameters + +##### E + +`E` *extends* [`BusEvent`](#busevent) + +#### Properties + +##### seq + +> `readonly` **seq**: `number` + +Defined in: [runtime/supervise/event-bus.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L33) + +##### at + +> `readonly` **at**: `number` + +Defined in: [runtime/supervise/event-bus.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L34) + +##### priority + +> `readonly` **priority**: `number` + +Defined in: [runtime/supervise/event-bus.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L35) + +##### event + +> `readonly` **event**: `E` + +Defined in: [runtime/supervise/event-bus.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L36) + +*** + +### PublishOptions + +Defined in: [runtime/supervise/event-bus.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L39) + +#### Properties + +##### priority? + +> `readonly` `optional` **priority?**: `number` + +Defined in: [runtime/supervise/event-bus.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L42) + +Higher = pulled ahead of lower-priority queued events (default 0). A blocking question sets + this so it bumps to the front of the driver's inbox. + +##### queue? + +> `readonly` `optional` **queue?**: `boolean` + +Defined in: [runtime/supervise/event-bus.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L46) + +Whether the event enters the pull queue (default true). Set `false` for record-only events — + the parent→child down-leg (steer / answer / resume): they belong in `history()` and reach + `subscribe` observers, but the parent must never `pull` its own outbound message back. + +*** + +### BusStats + +Defined in: [runtime/supervise/event-bus.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L49) + +#### Properties + +##### published + +> `readonly` **published**: `number` + +Defined in: [runtime/supervise/event-bus.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L50) + +##### pulled + +> `readonly` **pulled**: `number` + +Defined in: [runtime/supervise/event-bus.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L51) + +##### byKind + +> `readonly` **byKind**: `Readonly`\<`Record`\<`string`, `number`\>\> + +Defined in: [runtime/supervise/event-bus.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L53) + +Count published per event `type`. + +*** + +### EventBus + +Defined in: [runtime/supervise/event-bus.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L56) + +#### Type Parameters + +##### E + +`E` *extends* [`BusEvent`](#busevent) + +#### Methods + +##### publish() + +> **publish**(`event`, `opts?`): `Promise`\<[`BusRecord`](#busrecord)\<`E`\>\> + +Defined in: [runtime/supervise/event-bus.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L59) + +Stamp + queue the event, then deliver the stamped record to every subscriber in order. + Returns the stamped record. + +###### Parameters + +###### event + +`E` + +###### opts? + +[`PublishOptions`](#publishoptions) + +###### Returns + +`Promise`\<[`BusRecord`](#busrecord)\<`E`\>\> + +##### pull() + +> **pull**(`kinds?`): `E` \| `undefined` + +Defined in: [runtime/supervise/event-bus.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L62) + +Remove and return the highest-priority QUEUED event whose type is in `kinds` (any if omitted), + ties broken FIFO by `seq`; `undefined` when nothing matches. + +###### Parameters + +###### kinds? + +readonly `E`\[`"type"`\][] + +###### Returns + +`E` \| `undefined` + +##### subscribe() + +> **subscribe**(`handler`): () => `void` + +Defined in: [runtime/supervise/event-bus.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L65) + +Register a pass-through handler; it receives the stamped record of every event published after + registration. Returns an unsubscribe fn. + +###### Parameters + +###### handler + +(`record`) => `void` \| `Promise`\<`void`\> + +###### Returns + +() => `void` + +##### pending() + +> **pending**(`kinds?`): `number` + +Defined in: [runtime/supervise/event-bus.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L67) + +Count of queued, not-yet-pulled events (filtered by `kinds` when given). + +###### Parameters + +###### kinds? + +readonly `E`\[`"type"`\][] + +###### Returns + +`number` + +##### history() + +> **history**(): readonly [`BusRecord`](#busrecord)\<`E`\>[] + +Defined in: [runtime/supervise/event-bus.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L69) + +The full ordered log of every event ever published (the audit/replay trail). + +###### Returns + +readonly [`BusRecord`](#busrecord)\<`E`\>[] + +##### stats() + +> **stats**(): [`BusStats`](#busstats) + +Defined in: [runtime/supervise/event-bus.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L71) + +Throughput counters for observability dashboards. + +###### Returns + +[`BusStats`](#busstats) + +*** + +### InboxMessage + +Defined in: [runtime/supervise/inbox.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L18) + +**`Experimental`** + +The worker-side receive end of the down-leg: a per-worker inbox an executor exposes as +`Executor.deliver`. The driver's `steer_worker` / `answer_question` land here, +and the worker's agent loop drains them at two points (Drew's two delivery modes): + + - QUEUED (default): the message accumulates and is FLUSHED at the next step boundary — folded + into the conversation before the next think. A worker is also forced to flush BEFORE it may + settle, so it can never finish while a steer/answer it never read is still pending. + - FORCEFUL (`interrupt: true`): trips `freshInterrupt()`'s signal so the loop can abort its + in-flight turn immediately, then re-plan with the message folded in — breaking the worker out + of a wrong path mid-task instead of waiting for it to finish the step. + +`deliver` never throws — a malformed message is ignored, per the `Executor.deliver` contract. + +#### Properties + +##### kind + +> `readonly` **kind**: `"steer"` \| `"answer"` + +Defined in: [runtime/supervise/inbox.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L19) + +**`Experimental`** + +##### text + +> `readonly` **text**: `string` + +Defined in: [runtime/supervise/inbox.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L20) + +**`Experimental`** + +##### interrupt + +> `readonly` **interrupt**: `boolean` + +Defined in: [runtime/supervise/inbox.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L22) + +**`Experimental`** + +Forceful messages abort the in-flight turn; queued ones wait for the boundary flush. + +##### questionId? + +> `readonly` `optional` **questionId?**: `string` + +Defined in: [runtime/supervise/inbox.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L24) + +**`Experimental`** + +Present for an `answer` — the question id it resolves. + +*** + +### Inbox + +Defined in: [runtime/supervise/inbox.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L27) + +#### Methods + +##### deliver() + +> **deliver**(`msg`): `void` + +Defined in: [runtime/supervise/inbox.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L29) + +The `Executor.deliver` implementation — accept a raw down-message from `Scope.send`. + +###### Parameters + +###### msg + +`unknown` + +###### Returns + +`void` + +##### drain() + +> **drain**(): [`InboxMessage`](#inboxmessage)[] + +Defined in: [runtime/supervise/inbox.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L31) + +Remove and return all pending messages (the flush). + +###### Returns + +[`InboxMessage`](#inboxmessage)[] + +##### pending() + +> **pending**(): `number` + +Defined in: [runtime/supervise/inbox.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L32) + +###### Returns + +`number` + +##### freshInterrupt() + +> **freshInterrupt**(): `AbortSignal` + +Defined in: [runtime/supervise/inbox.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L35) + +Open a fresh per-turn interrupt signal; a later forceful `deliver` aborts it. The loop links + this into the signal it passes to its inference call, then re-plans when it fires. + +###### Returns + +`AbortSignal` + +##### fold() + +> **fold**(`messages`): `string` + +Defined in: [runtime/supervise/inbox.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L37) + +Render drained messages as ONE operator turn to fold into the worker's conversation. + +###### Parameters + +###### messages + +readonly [`InboxMessage`](#inboxmessage)[] + +###### Returns + +`string` + +*** + +### CoderCheckInput + +Defined in: [runtime/supervise/patch-checks.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L26) + +**`Experimental`** + +The patch + its derived PASS signals the mechanical gate decides on. + +#### Properties + +##### patch + +> **patch**: `string` + +Defined in: [runtime/supervise/patch-checks.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L28) + +**`Experimental`** + +The unified diff produced by the run. + +##### testsPassed + +> **testsPassed**: `boolean` + +Defined in: [runtime/supervise/patch-checks.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L30) + +**`Experimental`** + +Did `testCmd` exit clean? + +##### typecheckPassed + +> **typecheckPassed**: `boolean` + +Defined in: [runtime/supervise/patch-checks.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L32) + +**`Experimental`** + +Did `typecheckCmd` exit clean? + +*** + +### CoderCheckConstraints + +Defined in: [runtime/supervise/patch-checks.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L36) + +**`Experimental`** + +The per-task constraints the mechanical gate enforces. + +#### Extended by + +- [`PatchDeliverableOptions`](#patchdeliverableoptions) + +#### Properties + +##### maxDiffLines? + +> `optional` **maxDiffLines?**: `number` + +Defined in: [runtime/supervise/patch-checks.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L38) + +**`Experimental`** + +Default 400. Hard cap; gate fails when exceeded. + +##### forbiddenPaths? + +> `optional` **forbiddenPaths?**: `string`[] + +Defined in: [runtime/supervise/patch-checks.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L40) + +**`Experimental`** + +Literal path prefixes the patch must not touch. + +*** + +### PatchDeliverableOptions + +Defined in: [runtime/supervise/patch-deliverable.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-deliverable.ts#L27) + +**`Experimental`** + +#### Extends + +- [`CoderCheckConstraints`](#codercheckconstraints) + +#### Extended by + +- [`WorktreeFanoutOptions`](#worktreefanoutoptions) + +#### Properties + +##### maxDiffLines? + +> `optional` **maxDiffLines?**: `number` + +Defined in: [runtime/supervise/patch-checks.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L38) + +**`Experimental`** + +Default 400. Hard cap; gate fails when exceeded. + +###### Inherited from + +[`CoderCheckConstraints`](#codercheckconstraints).[`maxDiffLines`](#maxdifflines) + +##### forbiddenPaths? + +> `optional` **forbiddenPaths?**: `string`[] + +Defined in: [runtime/supervise/patch-checks.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L40) + +**`Experimental`** + +Literal path prefixes the patch must not touch. + +###### Inherited from + +[`CoderCheckConstraints`](#codercheckconstraints).[`forbiddenPaths`](#forbiddenpaths) + +##### require? + +> `optional` **require?**: readonly (`"tests"` \| `"typecheck"`)[] + +Defined in: [runtime/supervise/patch-deliverable.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-deliverable.ts#L34) + +**`Experimental`** + +Which verification signals the gate REQUIRES to be present-and-passing. A required signal +that the artifact never derived (the command was not configured on the executor) fails the +gate closed. Unlisted signals default to passed-when-absent (the executor simply didn't run +that command). Default `[]` — gate on no-op / secret / forbidden / diff-size only. + +*** + +### InMemoryRunContextOptions + +Defined in: [runtime/supervise/run-context.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/run-context.ts#L32) + +Options for the in-memory run context. + +#### Properties + +##### withDriver? + +> `readonly` `optional` **withDriver?**: `boolean` + +Defined in: [runtime/supervise/run-context.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/run-context.ts#L39) + +Wrap the executor registry with `withDriverExecutor` so a spawned child marked +`role: 'driver'` resolves to the recursive driver-executor (agents driving agents +over a nested `Scope` on the same conserved pool). Leave `false` for a flat tree of +leaf workers. Default `false`. + +*** + +### InMemoryRunContext + +Defined in: [runtime/supervise/run-context.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/run-context.ts#L46) + +The bundle of stores a supervised run needs, shaped to spread into `SupervisorOpts`. +The fields are exactly `SupervisorOpts`' `journal` / `blobs` / `executors`. + +#### Properties + +##### journal + +> `readonly` **journal**: [`SpawnJournal`](#spawnjournal) + +Defined in: [runtime/supervise/run-context.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/run-context.ts#L47) + +##### blobs + +> `readonly` **blobs**: [`ResultBlobStore`](#resultblobstore) + +Defined in: [runtime/supervise/run-context.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/run-context.ts#L48) + +##### executors + +> `readonly` **executors**: [`ExecutorRegistry`](#executorregistry) + +Defined in: [runtime/supervise/run-context.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/run-context.ts#L49) + +*** + +### RouterSeam + +Defined in: [runtime/supervise/runtime.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L66) + +Router/inline connection seam. A direct OpenAI-compatible Router endpoint — +the cheapest leaf, no box, no tools. `model` overrides the profile's model +hint when present; otherwise the profile's `model.default` is required. + +#### Properties + +##### routerBaseUrl + +> **routerBaseUrl**: `string` + +Defined in: [runtime/supervise/runtime.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L67) + +##### routerKey + +> **routerKey**: `string` + +Defined in: [runtime/supervise/runtime.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L68) + +##### model? + +> `optional` **model?**: `string` + +Defined in: [runtime/supervise/runtime.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L69) + +*** + +### SandboxSeam + +Defined in: [runtime/supervise/runtime.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L79) + +Sandbox executor seam. The `sandboxClient` the composed `runLoop` creates +boxes through, plus the optional trace/run/lineage wiring forwarded into the +loop. `lineage` is opaque here (PR #150's `RunLoopOptions.lineage`): forwarded +forward-compatibly, never inspected — this executor does NOT reinvent +checkpoint/fork. + +#### Properties + +##### sandboxClient + +> **sandboxClient**: [`SandboxClient`](#sandboxclient-2) + +Defined in: [runtime/supervise/runtime.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L80) + +##### loopCtx? + +> `optional` **loopCtx?**: `Partial`\<`Omit`\<[`ExecCtx`](#execctx), `"signal"` \| `"sandboxClient"`\>\> + +Defined in: [runtime/supervise/runtime.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L82) + +Forwarded into the composed `runLoop`'s `ctx` (trace emitter, run handle, etc.). + +##### lineage? + +> `optional` **lineage?**: `unknown` + +Defined in: [runtime/supervise/runtime.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L84) + +PR #150 `RunLoopOptions.lineage` passthrough — opaque; forwarded, not parsed. + +##### maxIterations? + +> `optional` **maxIterations?**: `number` + +Defined in: [runtime/supervise/runtime.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L87) + +Hard cap on the composed loop's iterations. The budget pool reserves against + the spawn `Budget.maxIterations`; this is the leaf's own ceiling. Default 1. + +*** + +### CliSeam + +Defined in: [runtime/supervise/runtime.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L91) + +CLI subprocess seam. `bin` + `args` describe the Halo/RLM process to spawn. + +#### Properties + +##### bin + +> **bin**: `string` + +Defined in: [runtime/supervise/runtime.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L92) + +##### args? + +> `optional` **args?**: `string`[] + +Defined in: [runtime/supervise/runtime.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L93) + +##### env? + +> `optional` **env?**: `Record`\<`string`, `string`\> + +Defined in: [runtime/supervise/runtime.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L95) + +Extra environment for the subprocess (merged over `process.env`). + +##### cwd? + +> `optional` **cwd?**: `string` + +Defined in: [runtime/supervise/runtime.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L97) + +Working directory for the subprocess. + +*** + +### CliWorktreeSeam + +Defined in: [runtime/supervise/runtime.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L107) + +cli-worktree seam. A supervisor-authored `AgentProfile` driving a local coding-harness CLI +(claude / codex / opencode) on its own git worktree — the leaf `createWorktreeCliExecutor` +named as data. `harness` + `repoRoot` + `taskPrompt` are required; the authored +`profile.prompt.systemPrompt` + `profile.model.default` reach the harness via the §1.5 +`harnessInvocation` mapper. Everything else mirrors `WorktreeCliExecutorOptions`. + +#### Properties + +##### repoRoot + +> **repoRoot**: `string` + +Defined in: [runtime/supervise/runtime.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L108) + +##### harness + +> **harness**: [`LocalHarness`](mcp.md#localharness) + +Defined in: [runtime/supervise/runtime.ts:109](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L109) + +##### taskPrompt + +> **taskPrompt**: `string` + +Defined in: [runtime/supervise/runtime.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L110) + +##### runId? + +> `optional` **runId?**: `string` + +Defined in: [runtime/supervise/runtime.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L111) + +##### baseRef? + +> `optional` **baseRef?**: `string` + +Defined in: [runtime/supervise/runtime.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L112) + +##### harnessTimeoutMs? + +> `optional` **harnessTimeoutMs?**: `number` + +Defined in: [runtime/supervise/runtime.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L113) + +*** + +### BridgeSeam + +Defined in: [runtime/supervise/runtime.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L130) + +cli-bridge seam. A local OpenAI-compatible bridge that fronts harness CLIs +(claude-code / opencode / kimi / pi) behind one HTTP surface; `model` doubles +as the harness selector (e.g. `claude-code/sonnet`, `opencode//`). +`agentProfile` is the bridge-dialect profile (metadata.disallowedTools, mcp) +forwarded verbatim per request — how an arm disables native tools or injects +a provider search MCP. + +The executor opens a RESUMABLE cli-bridge session — structurally identical to the +sandbox executor's persistent box, just local. `sessionId` is the stable +caller-owned id cli-bridge maps to the harness's internal conversation id; a +follow-up steer/resume on the SAME id continues the SAME harness session (opencode +`-s`, claude `--resume`, …). Omit it and the executor mints a stable one per spawn. + +#### Properties + +##### bridgeUrl + +> **bridgeUrl**: `string` + +Defined in: [runtime/supervise/runtime.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L131) + +##### bridgeBearer + +> **bridgeBearer**: `string` + +Defined in: [runtime/supervise/runtime.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L132) + +##### model + +> **model**: `string` + +Defined in: [runtime/supervise/runtime.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L133) + +##### agentProfile? + +> `optional` **agentProfile?**: `Record`\<`string`, `unknown`\> + +Defined in: [runtime/supervise/runtime.ts:134](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L134) + +##### timeoutMs? + +> `optional` **timeoutMs?**: `number` + +Defined in: [runtime/supervise/runtime.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L135) + +##### sessionId? + +> `optional` **sessionId?**: `string` + +Defined in: [runtime/supervise/runtime.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L138) + +Stable, caller-owned cli-bridge session id for harness-side resume. Defaults + to a freshly minted per-spawn id so each worker is its own resumable session. + +##### maxTurns? + +> `optional` **maxTurns?**: `number` + +Defined in: [runtime/supervise/runtime.ts:141](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L141) + +Per-resume-turn inference cap before the worker settles on its last output. + Mirrors `routerToolsInlineExecutor.maxTurns`; default 200 (runaway backstop). + +*** + +### RouterToolsSeam + +Defined in: [runtime/supervise/runtime.ts:254](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L254) + +Router seam WITH tool use — the tool-using router backend. Same direct +OpenAI-compatible endpoint as `RouterSeam`, but each turn passes `tools`; when +the model emits tool_calls they run via `executeToolCall` ON THIS HOST and the +results fold back as `tool` messages, repeating until the model answers without +a tool or `maxTurns` is hit. A real agentic loop, OFF-BOX — no sandbox, so it +is unaffected by a box's egress allowlist. One turn = one completion = the +equal-compute unit. `executeToolCall` receives the task so per-task tool +surfaces (e.g. a gym keyed by task) can dispatch correctly. + +#### Properties + +##### routerBaseUrl + +> **routerBaseUrl**: `string` + +Defined in: [runtime/supervise/runtime.ts:255](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L255) + +##### routerKey + +> **routerKey**: `string` + +Defined in: [runtime/supervise/runtime.ts:256](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L256) + +##### model? + +> `optional` **model?**: `string` + +Defined in: [runtime/supervise/runtime.ts:257](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L257) + +##### tools + +> **tools**: readonly [`ToolSpec`](#toolspec)[] + +Defined in: [runtime/supervise/runtime.ts:258](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L258) + +##### executeToolCall + +> **executeToolCall**: (`name`, `args`, `task`) => `Promise`\<`string`\> + +Defined in: [runtime/supervise/runtime.ts:259](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L259) + +###### Parameters + +###### name + +`string` + +###### args + +`Record`\<`string`, `unknown`\> + +###### task + +`unknown` + +###### Returns + +`Promise`\<`string`\> + +##### onToolStep? + +> `optional` **onToolStep?**: (`step`) => `void` + +Defined in: [runtime/supervise/runtime.ts:262](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L262) + +Online observer of each tool step — the seam a `DetectorMonitor` taps to watch the live pipe + (raise a `finding` when the worker loops/errors). Called after every tool call resolves. + +###### Parameters + +###### step + +###### toolName + +`string` + +###### args + +`Record`\<`string`, `unknown`\> + +###### status + +`"error"` \| `"ok"` + +###### Returns + +`void` + +##### maxTurns? + +> `optional` **maxTurns?**: `number` + +Defined in: [runtime/supervise/runtime.ts:270](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L270) + +Max inference turns. Default 200 (runaway backstop — set far above any + legitimate workflow). For tighter per-workflow limits use a cost budget + or wall-clock deadline at the call site. + +*** + +### NestedScopeSeam + +Defined in: [runtime/supervise/scope.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/scope.ts#L151) + +The recursion seam value: mount a nested `Scope` for a driver child. `parentId` is the +driver child's own node id (so its children get `${nodeId}:s${ordinal}` ids and its +nested journal tree is namespaced under it); `root` is the journal tree key for the +nested tree (distinct from the parent's so cursor seqs never collide in the per-tree +guard). `depth` is `parent.depth + 1`. The nested scope shares the parent's `pool` +(conserved budget across depth), `journal`/`blobs` (one record), and `executors` (a +nested child resolves to leaf-or-driver through the same open registry). + +#### Properties + +##### depth + +> `readonly` **depth**: `number` + +Defined in: [runtime/supervise/scope.ts:153](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/scope.ts#L153) + +This scope's recursion depth — a nested scope runs at `depth + 1`. + +##### maxDepth? + +> `readonly` `optional` **maxDepth?**: `number` + +Defined in: [runtime/supervise/scope.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/scope.ts#L155) + +The runtime recursion-depth ceiling, paired with the conserved pool (R3). + +##### journalRoot + +> `readonly` **journalRoot**: `string` + +Defined in: [runtime/supervise/scope.ts:157](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/scope.ts#L157) + +The journal tree key the parent scope writes to (used to namespace nested trees). + +#### Methods + +##### mount() + +> **mount**(`nestedRoot`, `signal`): [`Scope`](#scope-1)\<`unknown`\> + +Defined in: [runtime/supervise/scope.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/scope.ts#L159) + +Mount a nested scope rooted at `nestedRoot`, parented at this driver child's node id. + +###### Parameters + +###### nestedRoot + +`string` + +###### signal + +`AbortSignal` + +###### Returns + +[`Scope`](#scope-1)\<`unknown`\> + +*** + +### ToolStepInput + +Defined in: [runtime/supervise/trace-source.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L23) + +#### Properties + +##### toolName + +> `readonly` **toolName**: `string` + +Defined in: [runtime/supervise/trace-source.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L24) + +##### args + +> `readonly` **args**: `unknown` + +Defined in: [runtime/supervise/trace-source.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L25) + +##### status? + +> `readonly` `optional` **status?**: `"error"` \| `"ok"` + +Defined in: [runtime/supervise/trace-source.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L26) + +##### result? + +> `readonly` `optional` **result?**: `unknown` + +Defined in: [runtime/supervise/trace-source.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L27) + +##### callId? + +> `readonly` `optional` **callId?**: `string` + +Defined in: [runtime/supervise/trace-source.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L30) + +Stable id of the tool call — used to de-duplicate the repeated state transitions a harness + streams for one call (opencode emits pending→running→completed, plus a `raw`-wrapped copy). + +*** + +### TraceSource + +Defined in: [runtime/supervise/trace-source.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L33) + +#### Methods + +##### onSpan() + +> **onSpan**(`handler`): () => `void` + +Defined in: [runtime/supervise/trace-source.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L36) + +Subscribe to tool spans as they are produced (ONLINE). Returns an unsubscribe. A source that + only exposes its trace at the end registers nothing and returns a no-op. + +###### Parameters + +###### handler + +(`span`) => `void` + +###### Returns + +() => `void` + +##### collect() + +> **collect**(): `Promise`\<`ToolSpan`[]\> + +Defined in: [runtime/supervise/trace-source.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L38) + +The full set of tool spans for the run (SETTLE / batch). Always available. + +###### Returns + +`Promise`\<`ToolSpan`[]\> + +*** + +### SessionMessageLike + +Defined in: [runtime/supervise/trace-source.ts:265](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L265) + +A harness session message carrying parts (the shape `box.messages()` returns). Structurally typed + so this works with the real `@tangle-network/sandbox` box AND a test double, no SDK import. + +#### Properties + +##### parts? + +> `readonly` `optional` **parts?**: readonly `unknown`[] + +Defined in: [runtime/supervise/trace-source.ts:266](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L266) + +*** + +### SessionTraceBox + +Defined in: [runtime/supervise/trace-source.ts:270](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L270) + +The minimal box surface this needs: list a session's messages (incl. mid-turn partials). + +#### Methods + +##### messages() + +> **messages**(`opts`): `Promise`\ + +Defined in: [runtime/supervise/trace-source.ts:271](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L271) + +###### Parameters + +###### opts + +###### sessionId + +`string` + +###### Returns + +`Promise`\ + +*** + +### TrajectoryAnalysis + +Defined in: [runtime/supervise/trajectory-recorder.ts:15](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trajectory-recorder.ts#L15) + +#### Properties + +##### trajectory + +> `readonly` **trajectory**: `Trajectory` + +Defined in: [runtime/supervise/trajectory-recorder.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trajectory-recorder.ts#L18) + +Structured run summary (tool-call count, step order). Steps carry a single timestamp, so per-span + duration is 0; loop/waste detection keys on call PATTERNS + cross-span windows, not durations. + +##### stuckLoop + +> `readonly` **stuckLoop**: `StuckLoopReport` + +Defined in: [runtime/supervise/trajectory-recorder.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trajectory-recorder.ts#L21) + +Full-run repeated-call view (total occurrences + window) — catches a loop the online consecutive + detector interleaves past. + +##### toolWaste + +> `readonly` **toolWaste**: `ToolWasteReport` + +Defined in: [runtime/supervise/trajectory-recorder.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trajectory-recorder.ts#L23) + +Wasted-vs-total tool-call ratio for the run. + +*** + +### Agent + +Defined in: [runtime/supervise/types.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L49) + +One self-similar atom. A leaf is an `Agent` that never calls `scope.spawn`; a driver +is an `Agent` whose `act` spawns children and reacts to them via `scope.next()`. An +analyst is an `Agent` whose task is "read these traces → findings" — `where` it runs +is its executor, not a separate type. + +`act` MUST be replay-safe: it may read `verdict`, `spent`, and `out` (rehydrated by +`outRef`) off each `Settled`; it MUST NOT read `Date.now`, `Math.random`, or any +unordered collection. `scope.next()` delivers strictly in recorded `seq` order. + +#### Type Parameters + +##### Task + +`Task` + +##### Out + +`Out` + +#### Properties + +##### name + +> `readonly` **name**: `string` + +Defined in: [runtime/supervise/types.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L50) + +#### Methods + +##### act() + +> **act**(`task`, `scope`): `Promise`\<`Out`\> + +Defined in: [runtime/supervise/types.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L51) + +###### Parameters + +###### task + +`Task` + +###### scope + +[`Scope`](#scope-1)\<`Out`\> + +###### Returns + +`Promise`\<`Out`\> + +*** + +### Executor + +Defined in: [runtime/supervise/types.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L70) + +The leaf runtime — ONE open interface, not a closed union. `execute` returns a +`Promise` for one-shot executors OR an `AsyncIterable` for +streaming ones; a streaming executor reports incremental normalized usage as it runs +(the budget pool reconciles against it) and exposes its terminal artifact via +`resultArtifact()`. Both shapes normalize usage to `UsageEvent` so the conserved pool +meters every runtime identically. + +Built-in implementations (in `runtime.ts`, NOT variants here): router/inline (a direct +Router/HTTP inference call, no box), sandbox (COMPOSES `runLoop` as a leaf, forwarding +PR #150's optional `lineage` passthrough — does NOT reinvent checkpoint/fork), cli +(Halo/RLM subprocess; `budgetExempt`, excluded from equal-k by construction). A user's +own agent (mastra/agno/raw HTTP/anything) is first-class by implementing this interface. + +#### Type Parameters + +##### Out + +`Out` + +#### Properties + +##### runtime + +> `readonly` **runtime**: [`Runtime`](#runtime-2) + +Defined in: [runtime/supervise/types.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L72) + +Stable runtime tag for traces + the equal-k exemption check. + +##### budgetExempt? + +> `readonly` `optional` **budgetExempt?**: `boolean` + +Defined in: [runtime/supervise/types.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L78) + +When true, this executor's spend is NOT metered against the conserved pool and its +iterations are excluded from the equal-k assertion (a `cli` subprocess without +token accounting). Fail-loud everywhere else: a metered executor MUST report usage. + +#### Methods + +##### execute() + +> **execute**(`task`, `signal`): `AsyncIterable`\<[`UsageEvent`](#usageevent), `any`, `any`\> \| `Promise`\<[`ExecutorResult`](#executorresult)\<`Out`\>\> + +Defined in: [runtime/supervise/types.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L84) + +One-shot → resolves a `ExecutorResult`; streaming → yields incremental `UsageEvent`s and +the terminal artifact is read from `resultArtifact()` after the stream drains. +`signal` is the spawn-scoped abort (chains the acquire lifecycle for sandbox). + +###### Parameters + +###### task + +`unknown` + +###### signal + +`AbortSignal` + +###### Returns + +`AsyncIterable`\<[`UsageEvent`](#usageevent), `any`, `any`\> \| `Promise`\<[`ExecutorResult`](#executorresult)\<`Out`\>\> + +##### deliver()? + +> `optional` **deliver**(`msg`): `void` + +Defined in: [runtime/supervise/types.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L95) + +Optional inbox: receive an out-of-band message from the driver mid-run (the `send`/`steer_worker` +verb). A streaming executor drains pending messages between turns and folds them into the next +step (a steer / interrupt / resume). A one-shot executor that can't be steered mid-flight omits +this; `Scope.send` then returns `false` for it. Never throws — a malformed message is the +executor's to ignore. + +###### Parameters + +###### msg + +`unknown` + +###### Returns + +`void` + +##### teardown() + +> **teardown**(`grace`): `Promise`\<\{ `destroyed`: `boolean`; \}\> + +Defined in: [runtime/supervise/types.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L100) + +Tear the executor's resources down. `grace` mirrors the OTP shutdown spec +(`'brutalKill'` = immediate, a number = ms grace, `'infinity'` = await clean exit). + +###### Parameters + +###### grace + +`number` \| `"brutalKill"` \| `"infinity"` + +###### Returns + +`Promise`\<\{ `destroyed`: `boolean`; \}\> + +##### resultArtifact() + +> **resultArtifact**(): `object` + +Defined in: [runtime/supervise/types.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L105) + +The replay source (B1): the content-addressed `outRef` + the materialized output the +driver branched on, its verdict, and the conserved spend. Read once, after settle. + +###### Returns + +`object` + +###### outRef + +> **outRef**: `string` + +###### out + +> **out**: `Out` + +###### verdict? + +> `optional` **verdict?**: `DefaultVerdict` + +###### spent + +> **spent**: [`Spend`](#spend) + +##### metered()? + +> `optional` **metered**(): [`Spend`](#spend) \| `undefined` + +Defined in: [runtime/supervise/types.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L114) + +A driver-executor's OWN-inference subtree total (rolled up from its nested tree's `metered` +events) — the parent scope journals it as a `metered` event for this node on settle, on BOTH +the done AND the down/crash paths, so a crashed sub-driver's partial inference still re-homes +(the pool already debited it via `observe`; the journal must match). NOT reconciled, so it never +trips the reservation clamp. Read on settle, valid after `execute` resolves OR throws. Leaf +executors omit it (returns `undefined`). + +###### Returns + +[`Spend`](#spend) \| `undefined` + +*** + +### ExecutorResult + +Defined in: [runtime/supervise/types.ts:118](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L118) + +Terminal artifact of a one-shot `Executor.execute`. + +#### Type Parameters + +##### Out + +`Out` + +#### Properties + +##### outRef + +> **outRef**: `string` + +Defined in: [runtime/supervise/types.ts:119](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L119) + +##### out + +> **out**: `Out` + +Defined in: [runtime/supervise/types.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L120) + +##### verdict? + +> `optional` **verdict?**: `DefaultVerdict` + +Defined in: [runtime/supervise/types.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L121) + +##### spent + +> **spent**: [`Spend`](#spend) + +Defined in: [runtime/supervise/types.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L122) + +*** + +### AgentSpec + +Defined in: [runtime/supervise/types.ts:152](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L152) + +`AgentProfile` does NOT carry a `harness`/backend field — `harness` lives on the +sandbox SDK's `BackendConfig`, not the portable profile. So an agent is mapped to its +executor through this MINIMAL wrapper, never by fabricating a field onto `AgentProfile`. + +Resolution (in `runtime.ts`): + - `executor` present → BYO: use it verbatim (a user's own `Executor`). + - `harness === null` → router/inline: a direct Router call, no box. + - `harness` is a `BackendType` → sandbox: compose `runLoop` against `profile` on that backend. +Fail loud on an unresolvable spec (no executor and an unknown harness). + +#### Properties + +##### profile + +> `readonly` **profile**: `AgentProfile` + +Defined in: [runtime/supervise/types.ts:153](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L153) + +##### harness + +> `readonly` **harness**: `BackendType` \| `null` + +Defined in: [runtime/supervise/types.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L155) + +`null` selects router/inline; a `BackendType` selects the sandboxed harness. + +##### executor? + +> `readonly` `optional` **executor?**: [`Executor`](#executor)\<`unknown`\> + +Defined in: [runtime/supervise/types.ts:157](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L157) + +Bring-your-own executor: when set, overrides harness-based resolution entirely. + +*** + +### ExecutorContext + +Defined in: [runtime/supervise/types.ts:170](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L170) + +Construction context handed to a `ExecutorFactory` — the seams a built-in needs + (sandbox client for the sandbox executor, router config for router/inline) without + the factory reaching into module globals. + +#### Properties + +##### signal + +> `readonly` **signal**: `AbortSignal` + +Defined in: [runtime/supervise/types.ts:171](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L171) + +##### seams + +> `readonly` **seams**: `Readonly`\<`Record`\<`string`, `unknown`\>\> + +Defined in: [runtime/supervise/types.ts:173](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L173) + +Opaque seams the registry threads through; a built-in narrows what it needs. + +*** + +### ExecutorRegistry + +Defined in: [runtime/supervise/types.ts:182](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L182) + +The OPEN resolver: maps an `AgentSpec` to a `ExecutorFactory`. The default +registry resolves the three built-ins AND accepts a BYO `executor`/factory; callers +register more runtimes by name. NOT a closed switch — registration is the extension +point, mirroring the open `Executor` interface. + +#### Methods + +##### register() + +> **register**\<`Out`\>(`runtime`, `factory`): `void` + +Defined in: [runtime/supervise/types.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L184) + +Register a factory for a named runtime. Throws on a duplicate name (fail loud). + +###### Type Parameters + +###### Out + +`Out` + +###### Parameters + +###### runtime + +[`Runtime`](#runtime-2) + +###### factory + +[`ExecutorFactory`](#executorfactory)\<`Out`\> + +###### Returns + +`void` + +##### resolve() + +> **resolve**\<`Out`\>(`spec`): \{ `succeeded`: `true`; `value`: [`ExecutorFactory`](#executorfactory)\<`Out`\>; \} \| \{ `succeeded`: `false`; `error`: `string`; \} + +Defined in: [runtime/supervise/types.ts:191](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L191) + +Resolve a spec to a factory. Precedence: a BYO `spec.executor` → a trivial factory +returning it; else `harness === null` → the `'router'` factory; else a registered +factory for the harness-derived runtime. Returns a typed outcome — the caller +inspects `succeeded` before `value` (no silent fallback). + +###### Type Parameters + +###### Out + +`Out` + +###### Parameters + +###### spec + +[`AgentSpec`](#agentspec) + +###### Returns + +\{ `succeeded`: `true`; `value`: [`ExecutorFactory`](#executorfactory)\<`Out`\>; \} \| \{ `succeeded`: `false`; `error`: `string`; \} + +*** + +### Budget + +Defined in: [runtime/supervise/types.ts:199](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L199) + +A budget envelope on a spawn or the root. All ceilings; the pool reserves against them. + +#### Properties + +##### maxIterations + +> `readonly` **maxIterations**: `number` + +Defined in: [runtime/supervise/types.ts:200](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L200) + +##### maxTokens + +> `readonly` **maxTokens**: `number` + +Defined in: [runtime/supervise/types.ts:201](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L201) + +##### maxUsd? + +> `readonly` `optional` **maxUsd?**: `number` + +Defined in: [runtime/supervise/types.ts:202](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L202) + +##### deadlineMs? + +> `readonly` `optional` **deadlineMs?**: `number` + +Defined in: [runtime/supervise/types.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L203) + +*** + +### Spend + +Defined in: [runtime/supervise/types.ts:208](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L208) + +Conserved spend, reconciled from the normalized `UsageEvent` stream. Tokens and usd + are separate channels (never folded). + +#### Properties + +##### iterations + +> **iterations**: `number` + +Defined in: [runtime/supervise/types.ts:209](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L209) + +##### tokens + +> **tokens**: [`LoopTokenUsage`](#looptokenusage) + +Defined in: [runtime/supervise/types.ts:210](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L210) + +##### usd + +> **usd**: `number` + +Defined in: [runtime/supervise/types.ts:211](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L211) + +##### ms + +> **ms**: `number` + +Defined in: [runtime/supervise/types.ts:212](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L212) + +*** + +### SpawnOpts + +Defined in: [runtime/supervise/types.ts:227](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L227) + +#### Properties + +##### budget + +> `readonly` **budget**: [`Budget`](#budget-8) + +Defined in: [runtime/supervise/types.ts:228](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L228) + +##### label + +> `readonly` **label**: `string` + +Defined in: [runtime/supervise/types.ts:229](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L229) + +##### restart? + +> `readonly` `optional` **restart?**: [`Restart`](#restart) + +Defined in: [runtime/supervise/types.ts:230](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L230) + +##### shutdown? + +> `readonly` `optional` **shutdown?**: `number` \| `"brutalKill"` \| `"infinity"` + +Defined in: [runtime/supervise/types.ts:232](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L232) + +Teardown grace handed to the executor when this node is reaped. + +*** + +### Handle + +Defined in: [runtime/supervise/types.ts:240](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L240) + +A live child handle. `abort()` is defined over the ACQUIRE lifecycle: it chains into +the `acquireSandbox` signal and reaps a find-by-name orphan box, so a node aborted +mid-acquire never leaks (M1). + +#### Type Parameters + +##### Out + +`Out` + +#### Properties + +##### id + +> `readonly` **id**: `string` + +Defined in: [runtime/supervise/types.ts:241](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L241) + +##### label + +> `readonly` **label**: `string` + +Defined in: [runtime/supervise/types.ts:242](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L242) + +##### status + +> `readonly` **status**: [`NodeStatus`](#nodestatus) + +Defined in: [runtime/supervise/types.ts:243](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L243) + +##### \_\_out? + +> `readonly` `optional` **\_\_out?**: `Out` + +Defined in: [runtime/supervise/types.ts:247](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L247) + +Phantom: binds the handle to the child's output type so `spawn` returns a + `Handle` distinct from a `Handle`. Type-only — never present at runtime. + +#### Methods + +##### abort() + +> **abort**(`reason?`): `void` + +Defined in: [runtime/supervise/types.ts:244](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L244) + +###### Parameters + +###### reason? + +`string` + +###### Returns + +`void` + +*** + +### Scope + +Defined in: [runtime/supervise/types.ts:283](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L283) + +The budget-conserving reactive scope an `Agent.act` runs inside. `spawn` reserves +budget atomically from the shared pool and fails closed when the pool cannot cover it. +`next()` waits for one settlement from this scope's live set; `view` reads live state, +not the replay log. + +#### Type Parameters + +##### Out + +`Out` + +#### Properties + +##### signal + +> `readonly` **signal**: `AbortSignal` + +Defined in: [runtime/supervise/types.ts:310](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L310) + +This scope's abort signal — aborted when the run is cancelled, a breaker trips, the pool + is exhausted, or a parent scope cascades. A long-running driver `act` over this scope reads + it to break promptly (the conserved pool + driver-stop are the other bounds). A nested + scope carries its own signal, chained off its driver child's abort. + +##### view + +> `readonly` **view**: [`TreeView`](#treeview) + +Defined in: [runtime/supervise/types.ts:324](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L324) + +The live tree — reads the in-memory nursery, not the journal. + +##### budget + +> `readonly` **budget**: `Readonly`\<\{ `tokensLeft`: `number`; `usdLeft`: `number`; `usdCapped`: `boolean`; `deadlineMs`: `number`; `reservedTokens`: `number`; \}\> + +Defined in: [runtime/supervise/types.ts:326](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L326) + +Conserved-pool readouts (post-reservation). + +#### Methods + +##### spawn() + +> **spawn**\<`C`\>(`agent`, `task`, `opts`): \{ `ok`: `true`; `handle`: [`Handle`](#handle-2)\<`C`\>; \} \| \{ `ok`: `false`; `reason`: `"budget-exhausted"` \| `"depth-exceeded"`; \} + +Defined in: [runtime/supervise/types.ts:289](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L289) + +Spawn a child. Reserves `opts.budget` from the conserved pool atomically; refunds the +unspent remainder on settle. Returns a typed outcome — fail-closed on an exhausted +pool or an exceeded depth ceiling (the caller inspects `ok` before `handle`). + +###### Type Parameters + +###### C + +`C` + +###### Parameters + +###### agent + +[`Agent`](#agent)\<`unknown`, `C`\> + +###### task + +`unknown` + +###### opts + +[`SpawnOpts`](#spawnopts) + +###### Returns + +\{ `ok`: `true`; `handle`: [`Handle`](#handle-2)\<`C`\>; \} \| \{ `ok`: `false`; `reason`: `"budget-exhausted"` \| `"depth-exceeded"`; \} + +##### next() + +> **next**(): `Promise`\<[`Settled`](#settled-2)\<`Out`\> \| `null`\> + +Defined in: [runtime/supervise/types.ts:296](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L296) + +ray.wait n=1 over this scope's in-memory live set; resolves as each child settles; + `null` when the live set is empty. + +###### Returns + +`Promise`\<[`Settled`](#settled-2)\<`Out`\> \| `null`\> + +##### send() + +> **send**(`nodeId`, `msg`): `boolean` + +Defined in: [runtime/supervise/types.ts:305](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L305) + +Steer a RUNNING child out-of-band — deliver a message to its executor's inbox (the driver's +`send` verb: next-instruction, interrupt, or resume). Returns `true` if the message was +delivered to a live child whose executor accepts delivery, `false` otherwise (unknown id, +already settled, or an executor with no inbox). The executor drains its inbox between turns; +a leaf that does not implement `deliver` simply cannot be steered mid-flight. In-process this +is a direct call; the sandbox/Agent-Bus transports surface the SAME verb as an MCP tool. + +###### Parameters + +###### nodeId + +`string` + +###### msg + +`unknown` + +###### Returns + +`boolean` + +##### meter() + +> **meter**(`spend`, `detail?`): `Promise`\<`void`\> + +Defined in: [runtime/supervise/types.ts:322](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L322) + +Meter the driver's OWN compute against the conserved pool — its inference turns, which are +real tokens/usd but not a spawned child (no reserve/reconcile). A direct `free → committed` +debit, so equal-k counts the driver's tokens AND the in-loop budget guard (`budget.tokensLeft`) +halts a driver that thinks the pool dry. `detail` rides an `agent.turn` trace event for live +observability (turn index, tool calls, cumulative spend). It also journals a `metered` event — +the durable twin of the pool debit (as `settled` is the twin of `reconcile`) — so every +journal-based cost reader (`spentFromJournal`, `trajectoryReport`) sums driver inference +automatically. A leaf never calls this; a driver meters each chat turn and awaits it (the +metered event is cost-critical, so it lands before the join-barrier roll-up). + +###### Parameters + +###### spend + +[`Spend`](#spend) + +###### detail? + +`Record`\<`string`, `unknown`\> + +###### Returns + +`Promise`\<`void`\> + +*** + +### NodeSnapshot + +Defined in: [runtime/supervise/types.ts:337](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L337) + +#### Properties + +##### id + +> `readonly` **id**: `string` + +Defined in: [runtime/supervise/types.ts:338](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L338) + +##### parent? + +> `readonly` `optional` **parent?**: `string` + +Defined in: [runtime/supervise/types.ts:339](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L339) + +##### label + +> `readonly` **label**: `string` + +Defined in: [runtime/supervise/types.ts:340](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L340) + +##### status + +> `readonly` **status**: [`NodeStatus`](#nodestatus) + +Defined in: [runtime/supervise/types.ts:341](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L341) + +##### runtime + +> `readonly` **runtime**: [`Runtime`](#runtime-2) + +Defined in: [runtime/supervise/types.ts:342](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L342) + +##### budget + +> `readonly` **budget**: [`Budget`](#budget-8) + +Defined in: [runtime/supervise/types.ts:343](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L343) + +##### spent + +> `readonly` **spent**: [`Spend`](#spend) + +Defined in: [runtime/supervise/types.ts:345](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L345) + +Conserved spend so far for this node. + +##### outRef? + +> `readonly` `optional` **outRef?**: `string` + +Defined in: [runtime/supervise/types.ts:347](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L347) + +`outRef` once the node is `done` (the replay/result pointer). + +*** + +### TreeView + +Defined in: [runtime/supervise/types.ts:351](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L351) + +The live tree — what `scope.view` / `RootHandle.view()` materialize for a viewer. + +#### Properties + +##### root + +> `readonly` **root**: `string` + +Defined in: [runtime/supervise/types.ts:352](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L352) + +##### nodes + +> `readonly` **nodes**: readonly [`NodeSnapshot`](#nodesnapshot)[] + +Defined in: [runtime/supervise/types.ts:353](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L353) + +##### inFlight + +> `readonly` **inFlight**: `number` + +Defined in: [runtime/supervise/types.ts:355](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L355) + +Count of nodes in `running` or `acquiring` — the "what's in flow?" answer. + +*** + +### SpawnJournal + +Defined in: [runtime/supervise/types.ts:406](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L406) + +The spawn-tree event source (mirrors `ConversationJournal`'s begin/append/load shape). +`loadTree` replays the full ordered event list for resume/replay; `appendEvent` is +called only AFTER the event is observed-committed (never speculative). + +#### Methods + +##### loadTree() + +> **loadTree**(`root`): `Promise`\<[`SpawnEvent`](#spawnevent)[] \| `undefined`\> + +Defined in: [runtime/supervise/types.ts:407](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L407) + +###### Parameters + +###### root + +`string` + +###### Returns + +`Promise`\<[`SpawnEvent`](#spawnevent)[] \| `undefined`\> + +##### beginTree() + +> **beginTree**(`root`, `at`): `Promise`\<`void`\> + +Defined in: [runtime/supervise/types.ts:408](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L408) + +###### Parameters + +###### root + +`string` + +###### at + +`string` + +###### Returns + +`Promise`\<`void`\> + +##### appendEvent() + +> **appendEvent**(`root`, `ev`): `Promise`\<`void`\> + +Defined in: [runtime/supervise/types.ts:409](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L409) + +###### Parameters + +###### root + +`string` + +###### ev + +[`SpawnEvent`](#spawnevent) + +###### Returns + +`Promise`\<`void`\> + +*** + +### ResultBlobStore + +Defined in: [runtime/supervise/types.ts:415](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L415) + +Content-addressed result blobs (the `outRef` → artifact map) backing the replay + invariant. Split from the journal so the journal stays small (decisions) and the + payloads (evidence) live where a viewer/replayer rehydrates them. + +#### Methods + +##### put() + +> **put**(`outRef`, `artifact`): `Promise`\<`void`\> + +Defined in: [runtime/supervise/types.ts:416](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L416) + +###### Parameters + +###### outRef + +`string` + +###### artifact + +`unknown` + +###### Returns + +`Promise`\<`void`\> + +##### get() + +> **get**(`outRef`): `Promise`\<`unknown`\> + +Defined in: [runtime/supervise/types.ts:417](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L417) + +###### Parameters + +###### outRef + +`string` + +###### Returns + +`Promise`\<`unknown`\> + +*** + +### Supervisor + +Defined in: [runtime/supervise/types.ts:427](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L427) + +Owns the conserved pool, the spawn log, the abort cascade, the OTP intensity breaker, +and the root handle. `run` executes the root `Agent` to completion; `attach` wires a +live `RootHandle` (the Q2 substrate the chat/pi-viz client later consumes). + +#### Type Parameters + +##### Task + +`Task` + +##### Out + +`Out` + +#### Methods + +##### run() + +> **run**(`root`, `task`, `opts`): `Promise`\<[`SupervisedResult`](#supervisedresult)\<`Out`\>\> + +Defined in: [runtime/supervise/types.ts:428](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L428) + +###### Parameters + +###### root + +[`Agent`](#agent)\<`Task`, `Out`\> + +###### task + +`Task` + +###### opts + +[`SupervisorOpts`](#supervisoropts) + +###### Returns + +`Promise`\<[`SupervisedResult`](#supervisedresult)\<`Out`\>\> + +##### attach() + +> **attach**(`h`): `void` + +Defined in: [runtime/supervise/types.ts:429](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L429) + +###### Parameters + +###### h + +[`RootHandle`](#roothandle)\<`Out`\> + +###### Returns + +`void` + +*** + +### SupervisorOpts + +Defined in: [runtime/supervise/types.ts:432](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L432) + +#### Properties + +##### budget + +> `readonly` **budget**: [`Budget`](#budget-8) + +Defined in: [runtime/supervise/types.ts:434](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L434) + +The root conserved-pool ceiling (tokens + usd + iterations + deadline). + +##### runId + +> `readonly` **runId**: `string` + +Defined in: [runtime/supervise/types.ts:436](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L436) + +Trace-correlation root + the journal/blob root key. + +##### journal + +> `readonly` **journal**: [`SpawnJournal`](#spawnjournal) + +Defined in: [runtime/supervise/types.ts:438](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L438) + +Event source — defaults to the in-memory journal in the impl; pass JSONL/FS for durability. + +##### blobs + +> `readonly` **blobs**: [`ResultBlobStore`](#resultblobstore) + +Defined in: [runtime/supervise/types.ts:440](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L440) + +Result payload store backing `outRef` rehydration. + +##### executors + +> `readonly` **executors**: [`ExecutorRegistry`](#executorregistry) + +Defined in: [runtime/supervise/types.ts:442](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L442) + +Executor resolution — the open registry mapping `AgentSpec` → `Executor`. + +##### maxDepth? + +> `readonly` `optional` **maxDepth?**: `number` + +Defined in: [runtime/supervise/types.ts:444](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L444) + +Runtime recursion-depth ceiling (paired with the conserved pool per R3). + +##### maxRestarts? + +> `readonly` `optional` **maxRestarts?**: `number` + +Defined in: [runtime/supervise/types.ts:449](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L449) + +OTP intensity breaker: more than `maxRestarts` child restarts within `withinMs` +trips the supervisor to `no-winner` rather than restarting forever. + +##### withinMs? + +> `readonly` `optional` **withinMs?**: `number` + +Defined in: [runtime/supervise/types.ts:450](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L450) + +##### now? + +> `readonly` `optional` **now?**: () => `number` + +Defined in: [runtime/supervise/types.ts:451](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L451) + +###### Returns + +`number` + +##### signal? + +> `readonly` `optional` **signal?**: `AbortSignal` + +Defined in: [runtime/supervise/types.ts:452](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L452) + +##### hooks? + +> `readonly` `optional` **hooks?**: [`RuntimeHooks`](index.md#runtimehooks) + +Defined in: [runtime/supervise/types.ts:455](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L455) + +Lifecycle stream sink, threaded into the root `Scope` so every `spawn`/settle emits on the + same `agent.spawn`/`agent.child` stream `runLoop` feeds — one observable recursive tree. + +*** + +### RootHandle + +Defined in: [runtime/supervise/types.ts:481](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L481) + +Live root handle — the substrate a chat/pi-viz client attaches to (Q2). `signal` + delivers an out-of-band message to the running root; `view()` materializes the tree. + +#### Type Parameters + +##### Out + +`Out` + +#### Properties + +##### \_\_out? + +> `readonly` `optional` **\_\_out?**: `Out` + +Defined in: [runtime/supervise/types.ts:487](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L487) + +Phantom: binds the handle to the supervised run's output type. Type-only — never + present at runtime; lets `attach(h: RootHandle)` stay output-typed. + +#### Methods + +##### view() + +> **view**(): [`TreeView`](#treeview) + +Defined in: [runtime/supervise/types.ts:482](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L482) + +###### Returns + +[`TreeView`](#treeview) + +##### signal() + +> **signal**(`msg`): `void` + +Defined in: [runtime/supervise/types.ts:483](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L483) + +###### Parameters + +###### msg + +[`RootSignal`](#rootsignal) + +###### Returns + +`void` + +##### abort() + +> **abort**(`reason?`): `void` + +Defined in: [runtime/supervise/types.ts:484](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L484) + +###### Parameters + +###### reason? + +`string` + +###### Returns + +`void` + +*** + +### WidenGate + +Defined in: [runtime/supervise/types.ts:507](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L507) + +The progressive-widening gate (MCTS-PW). Decides whether a settled child is +`promising` enough to spawn another under the remaining pool. DEFAULTS TO FLAT +(`shouldWiden` always false) so a gate run never widens and the selector≠judge +firewall conflict (R2) stays dormant. When widening IS enabled, `promising` MUST be +derived from TRACE findings (`analyses`), never raw `verdict` — or the gate carries +an explicit, argued `judgeExempt: true` (the documented escape hatch, off by default). + +#### Type Parameters + +##### Out + +`Out` + +#### Properties + +##### judgeExempt? + +> `readonly` `optional` **judgeExempt?**: `boolean` + +Defined in: [runtime/supervise/types.ts:512](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L512) + +When true, widening may read `verdict` directly (collides with the steer firewall — + must be explicitly argued per cell, never defaulted on). + +#### Methods + +##### shouldWiden() + +> **shouldWiden**(`settled`, `budget`): `boolean` + +Defined in: [runtime/supervise/types.ts:509](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L509) + +Default impl returns false for every settlement (flat — never widens). + +###### Parameters + +###### settled + +[`Settled`](#settled-2)\<`Out`\> + +###### budget + +`Readonly`\<\{ `tokensLeft`: `number`; `usdLeft`: `number`; `usdCapped`: `boolean`; `deadlineMs`: `number`; `reservedTokens`: `number`; \}\> + +###### Returns + +`boolean` + +*** + +### WorktreeCliExecutorOptions + +Defined in: [runtime/supervise/worktree-cli-executor.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L43) + +**`Experimental`** + +#### Properties + +##### repoRoot + +> **repoRoot**: `string` + +Defined in: [runtime/supervise/worktree-cli-executor.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L45) + +**`Experimental`** + +Absolute path to the git checkout the worktree is cut from. + +##### profile + +> **profile**: `AgentProfile` + +Defined in: [runtime/supervise/worktree-cli-executor.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L47) + +**`Experimental`** + +The SUPERVISOR-AUTHORED profile (the §1.5 payload: systemPrompt + model). + +##### harness + +> **harness**: [`LocalHarness`](mcp.md#localharness) + +Defined in: [runtime/supervise/worktree-cli-executor.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L49) + +**`Experimental`** + +Which local harness CLI drives this leaf (`claude` | `codex` | `opencode`). + +##### taskPrompt + +> **taskPrompt**: `string` + +Defined in: [runtime/supervise/worktree-cli-executor.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L51) + +**`Experimental`** + +The per-task instruction handed to the harness (composed under the system prompt). + +##### runId? + +> `optional` **runId?**: `string` + +Defined in: [runtime/supervise/worktree-cli-executor.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L53) + +**`Experimental`** + +Unique id for the worktree path + branch. Defaults to a fresh UUID. + +##### baseRef? + +> `optional` **baseRef?**: `string` + +Defined in: [runtime/supervise/worktree-cli-executor.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L55) + +**`Experimental`** + +Override the base ref the worktree is cut from (default `HEAD`). + +##### harnessTimeoutMs? + +> `optional` **harnessTimeoutMs?**: `number` + +Defined in: [runtime/supervise/worktree-cli-executor.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L57) + +**`Experimental`** + +Wall-clock cap per harness subprocess (ms). Default 5 min (the `runLocalHarness` default). + +##### testCmd? + +> `optional` **testCmd?**: `string` + +Defined in: [runtime/supervise/worktree-cli-executor.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L62) + +**`Experimental`** + +Shell command run in the live worktree to derive the tests-PASS signal (e.g. `pnpm test`). +Its exit code becomes `artifact.checks.tests.passed`. Omit to skip (no signal derived). + +##### typecheckCmd? + +> `optional` **typecheckCmd?**: `string` + +Defined in: [runtime/supervise/worktree-cli-executor.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L64) + +**`Experimental`** + +Shell command run in the live worktree to derive the typecheck-PASS signal (e.g. `pnpm typecheck`). + +##### checkTimeoutMs? + +> `optional` **checkTimeoutMs?**: `number` + +Defined in: [runtime/supervise/worktree-cli-executor.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L66) + +**`Experimental`** + +Wall-clock cap per verification command (ms). Default = `harnessTimeoutMs` or 5 min. + +##### runGit? + +> `optional` **runGit?**: [`GitRunner`](mcp.md#gitrunner) + +Defined in: [runtime/supervise/worktree-cli-executor.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L68) + +**`Experimental`** + +Test seam — inject a git runner so unit tests drive the worktree helpers without git. + +##### runHarness? + +> `optional` **runHarness?**: (`options`) => `Promise`\<[`LocalHarnessResult`](mcp.md#localharnessresult)\> + +Defined in: [runtime/supervise/worktree-cli-executor.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L70) + +**`Experimental`** + +Test seam — inject the harness runner so unit tests script a `LocalHarnessResult`. + +**`Experimental`** + +Spawn a local coding harness CLI as a subprocess + collect its output. + +NOT responsible for parsing the harness's output or extracting a diff — +the in-process executor's `streamPrompt` orchestrates `git diff` against +the worktree after this resolves. This function is intentionally narrow: +spawn, wait, capture, return. + +Fails loud — throws when: + - `cwd` doesn't exist (subprocess emits ENOENT; surfaced as Error) + - the harness binary is not on PATH (ENOENT) + +Does NOT throw when: + - the subprocess exits non-zero (`result.exitCode` carries the code) + - the subprocess is aborted / timed out (`result.killedBySignal` / + `result.timedOut` carries the reason) + +###### Parameters + +###### options + +[`RunLocalHarnessOptions`](mcp.md#runlocalharnessoptions) + +###### Returns + +`Promise`\<[`LocalHarnessResult`](mcp.md#localharnessresult)\> + +##### runCommand? + +> `optional` **runCommand?**: `WorktreeCheckRunner` + +Defined in: [runtime/supervise/worktree-cli-executor.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L73) + +**`Experimental`** + +Test seam — inject the verification-command runner so unit tests script test/typecheck + outcomes without spawning a real shell. Defaults to a `/bin/sh -c` spawn in the worktree. + +*** + +### AuthoredHarness + +Defined in: [runtime/supervise/worktree-fanout.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L30) + +**`Experimental`** + +One authored harness profile in a worktree fanout: the §1.5 profile + which local + harness CLI drives it. The supervisor authors `profile` per sub-task; `harness` chooses the leaf. + +#### Properties + +##### name + +> **name**: `string` + +Defined in: [runtime/supervise/worktree-fanout.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L32) + +**`Experimental`** + +A short label for the worktree branch + trace node. + +##### profile + +> **profile**: `AgentProfile` + +Defined in: [runtime/supervise/worktree-fanout.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L34) + +**`Experimental`** + +The supervisor-authored `AgentProfile` (systemPrompt + model reach the harness via §1.5). + +##### harness + +> **harness**: `"claude"` \| `"codex"` \| `"opencode"` + +Defined in: [runtime/supervise/worktree-fanout.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L36) + +**`Experimental`** + +Which local harness CLI drives this leaf. + +##### runId? + +> `optional` **runId?**: `string` + +Defined in: [runtime/supervise/worktree-fanout.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L38) + +**`Experimental`** + +Per-harness model/runId/baseRef overrides flow through the profile + these. + +##### baseRef? + +> `optional` **baseRef?**: `string` + +Defined in: [runtime/supervise/worktree-fanout.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L39) + +**`Experimental`** + +*** + +### WorktreeFanoutOptions + +Defined in: [runtime/supervise/worktree-fanout.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L43) + +**`Experimental`** + +#### Extends + +- [`PatchDeliverableOptions`](#patchdeliverableoptions) + +#### Properties + +##### maxDiffLines? + +> `optional` **maxDiffLines?**: `number` + +Defined in: [runtime/supervise/patch-checks.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L38) + +**`Experimental`** + +Default 400. Hard cap; gate fails when exceeded. + +###### Inherited from + +[`PatchDeliverableOptions`](#patchdeliverableoptions).[`maxDiffLines`](#maxdifflines-1) + +##### forbiddenPaths? + +> `optional` **forbiddenPaths?**: `string`[] + +Defined in: [runtime/supervise/patch-checks.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L40) + +**`Experimental`** + +Literal path prefixes the patch must not touch. + +###### Inherited from + +[`PatchDeliverableOptions`](#patchdeliverableoptions).[`forbiddenPaths`](#forbiddenpaths-1) + +##### require? + +> `optional` **require?**: readonly (`"tests"` \| `"typecheck"`)[] + +Defined in: [runtime/supervise/patch-deliverable.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-deliverable.ts#L34) + +**`Experimental`** + +Which verification signals the gate REQUIRES to be present-and-passing. A required signal +that the artifact never derived (the command was not configured on the executor) fails the +gate closed. Unlisted signals default to passed-when-absent (the executor simply didn't run +that command). Default `[]` — gate on no-op / secret / forbidden / diff-size only. + +###### Inherited from + +[`PatchDeliverableOptions`](#patchdeliverableoptions).[`require`](#require) + +##### repoRoot + +> **repoRoot**: `string` + +Defined in: [runtime/supervise/worktree-fanout.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L45) + +**`Experimental`** + +Absolute path to the git checkout each worktree is cut from. + +##### taskPrompt + +> **taskPrompt**: `string` + +Defined in: [runtime/supervise/worktree-fanout.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L47) + +**`Experimental`** + +The per-task instruction handed to every harness (composed under each profile's systemPrompt). + +##### harnesses + +> **harnesses**: readonly [`AuthoredHarness`](#authoredharness)[] + +Defined in: [runtime/supervise/worktree-fanout.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L49) + +**`Experimental`** + +The authored harness profiles — one fanout item (and one worktree-CLI leaf) each. + +##### deliverable? + +> `optional` **deliverable?**: [`DeliverableSpec`](#deliverablespec)\<`WorktreeHarnessResult`\> + +Defined in: [runtime/supervise/worktree-fanout.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L55) + +**`Experimental`** + +The completion check each leaf is gated on. Defaults to `patchDelivered(opts)` (the mechanical +no-op/secret/forbidden/diff-size + required test/typecheck gate). Pass any +`DeliverableSpec` to customize "is it delivered" as DATA. + +##### testCmd? + +> `optional` **testCmd?**: `string` + +Defined in: [runtime/supervise/worktree-fanout.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L57) + +**`Experimental`** + +Shell command run in each worktree to derive the tests-PASS signal. + +##### typecheckCmd? + +> `optional` **typecheckCmd?**: `string` + +Defined in: [runtime/supervise/worktree-fanout.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L59) + +**`Experimental`** + +Shell command run in each worktree to derive the typecheck-PASS signal. + +##### harnessTimeoutMs? + +> `optional` **harnessTimeoutMs?**: `number` + +Defined in: [runtime/supervise/worktree-fanout.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L61) + +**`Experimental`** + +Wall-clock cap per harness subprocess (ms). + +##### winnerStrategy? + +> `optional` **winnerStrategy?**: [`WinnerStrategy`](#winnerstrategy) + +Defined in: [runtime/supervise/worktree-fanout.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L63) + +**`Experimental`** + +Winner-selection strategy. Default `highest-score`. + +##### runGit? + +> `optional` **runGit?**: [`GitRunner`](mcp.md#gitrunner) + +Defined in: [runtime/supervise/worktree-fanout.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L66) + +**`Experimental`** + +Test seams forwarded to every worktree-CLI leaf (inject git/harness/command runners so the + whole fanout runs offline). Production callers leave these unset. + +##### runHarness? + +> `optional` **runHarness?**: (`options`) => `Promise`\<[`LocalHarnessResult`](mcp.md#localharnessresult)\> + +Defined in: [runtime/supervise/worktree-fanout.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L67) + +**`Experimental`** + +**`Experimental`** + +Spawn a local coding harness CLI as a subprocess + collect its output. + +NOT responsible for parsing the harness's output or extracting a diff — +the in-process executor's `streamPrompt` orchestrates `git diff` against +the worktree after this resolves. This function is intentionally narrow: +spawn, wait, capture, return. + +Fails loud — throws when: + - `cwd` doesn't exist (subprocess emits ENOENT; surfaced as Error) + - the harness binary is not on PATH (ENOENT) + +Does NOT throw when: + - the subprocess exits non-zero (`result.exitCode` carries the code) + - the subprocess is aborted / timed out (`result.killedBySignal` / + `result.timedOut` carries the reason) + +###### Parameters + +###### options + +[`RunLocalHarnessOptions`](mcp.md#runlocalharnessoptions) + +###### Returns + +`Promise`\<[`LocalHarnessResult`](mcp.md#localharnessresult)\> + +##### runCommand? + +> `optional` **runCommand?**: `WorktreeCheckRunner` + +Defined in: [runtime/supervise/worktree-fanout.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L68) + +**`Experimental`** + +*** + +### ValidationCtx + +Defined in: [runtime/types.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L32) + +**`Experimental`** + +#### Properties + +##### iteration + +> **iteration**: `number` + +Defined in: [runtime/types.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L34) + +**`Experimental`** + +Iteration index this output came from (0-based). + +##### box? + +> `optional` **box?**: `SandboxInstance` + +Defined in: [runtime/types.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L40) + +**`Experimental`** + +Live sandbox for this iteration. Validators that need execution-grounded +evidence can inspect files or run commands here instead of forcing callers +to bypass the loop kernel with raw Sandbox SDK orchestration. + +##### signal + +> **signal**: `AbortSignal` + +Defined in: [runtime/types.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L42) + +**`Experimental`** + +Cooperative cancellation channel. + +##### traceEmitter? + +> `optional` **traceEmitter?**: [`LoopTraceEmitter`](#looptraceemitter) + +Defined in: [runtime/types.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L48) + +**`Experimental`** + +Optional trace emitter. When set, validator implementations that make +LLM calls (e.g. an LLM-judge reviewer) emit spans into it. +The kernel passes `ctx.traceEmitter` from `ExecCtx` when available. + +*** + +### Validator + +Defined in: [runtime/types.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L52) + +**`Experimental`** + +#### Type Parameters + +##### Output + +`Output` + +##### Verdict + +`Verdict` = `DefaultVerdict` + +#### Methods + +##### validate() + +> **validate**(`output`, `ctx`): `Promise`\<`Verdict`\> + +Defined in: [runtime/types.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L53) + +**`Experimental`** + +###### Parameters + +###### output + +`Output` + +###### ctx + +[`ValidationCtx`](#validationctx) + +###### Returns + +`Promise`\<`Verdict`\> + +*** + +### AgentRunSpec + +Defined in: [runtime/types.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L67) + +**`Experimental`** + +Sandbox-SDK-shaped agent specification. + +The kernel uses `profile` to instantiate a sandbox per iteration, formats +`task` into a prompt via `taskToPrompt`, and merges `sandboxOverrides` into +the `CreateSandboxOptions` it passes to `client.create`. Heterogeneous +fanout supplies multiple `AgentRunSpec`s and the kernel round-robins +through them when the driver plans N tasks. + +#### Type Parameters + +##### Task + +`Task` + +#### Properties + +##### profile + +> **profile**: `AgentProfile` + +Defined in: [runtime/types.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L69) + +**`Experimental`** + +Sandbox SDK profile — what kind of agent runs the task. + +##### taskToPrompt + +> **taskToPrompt**: (`task`) => `string` + +Defined in: [runtime/types.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L71) + +**`Experimental`** + +Task → prompt formatter. Pure and deterministic. + +###### Parameters + +###### task + +`Task` + +###### Returns + +`string` + +##### prepareBox? + +> `optional` **prepareBox?**: (`box`, `ctx`) => `void` \| `Promise`\<`void`\> + +Defined in: [runtime/types.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L80) + +**`Experimental`** + +Optional pre-prompt sandbox provisioner. Runs after the sandbox is acquired +and before the first prompt is streamed into that box. Use this for +domain-agnostic setup such as repo snapshots, benchmark fixtures, policy +files, or seed datasets. The hook is part of the runtime surface so loop +consumers do not hand-roll Sandbox SDK orchestration just to prepare a +workspace before the agent sees it. + +###### Parameters + +###### box + +`SandboxInstance` + +###### ctx + +###### signal + +`AbortSignal` + +###### Returns + +`void` \| `Promise`\<`void`\> + +##### name? + +> `optional` **name?**: `string` + +Defined in: [runtime/types.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L85) + +**`Experimental`** + +Per-spec stable name. Surfaced in trace events and the default winner +selector tiebreak. Falls back to `profile.name ?? 'agent'`. + +##### sandboxOverrides? + +> `optional` **sandboxOverrides?**: `Partial`\<`Omit`\<`CreateSandboxOptions`, `"backend"`\>\> & `object` + +Defined in: [runtime/types.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L91) + +**`Experimental`** + +Optional sandbox-SDK `CreateSandboxOptions` overrides merged on top of +the kernel's defaults. `backend.profile` is set to `profile` by the +kernel and cannot be overridden here — use `profile` itself for that. + +###### Type Declaration + +###### backend? + +> `optional` **backend?**: `Omit`\<`BackendConfig`, `"profile"`\> + +*** + +### OutputAdapter + +Defined in: [runtime/types.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L105) + +**`Experimental`** + +Stream of `SandboxEvent`s → typed `Output`. + +Adapters are pure functions over the already-collected event array; they +do not receive the live AsyncIterable so they can be replayed against +persisted streams during tests / replays. + +#### Type Parameters + +##### Output + +`Output` + +#### Methods + +##### parse() + +> **parse**(`events`): `Output` + +Defined in: [runtime/types.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L106) + +**`Experimental`** + +###### Parameters + +###### events + +`SandboxEvent`[] + +###### Returns + +`Output` + +*** + +### LoopTokenUsage + +Defined in: [runtime/types.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L113) + +LLM token usage. Structurally matches agent-eval's `RunTokenUsage` / + `CampaignTokenUsage` ({ input, output }) so a loop result maps straight + onto `ctx.cost.observeTokens` in a `runProfileMatrix` dispatch — without + which the backend-integrity guard reads the run as a stub. + +#### Properties + +##### input + +> **input**: `number` + +Defined in: [runtime/types.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L114) + +##### output + +> **output**: `number` + +Defined in: [runtime/types.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L115) + +*** + +### Iteration + +Defined in: [runtime/types.ts:119](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L119) + +**`Experimental`** + +#### Type Parameters + +##### Task + +`Task` + +##### Output + +`Output` + +#### Properties + +##### index + +> **index**: `number` + +Defined in: [runtime/types.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L121) + +**`Experimental`** + +0-based iteration index assigned by the kernel. + +##### task + +> **task**: `Task` + +Defined in: [runtime/types.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L122) + +**`Experimental`** + +##### agentRunName + +> **agentRunName**: `string` + +Defined in: [runtime/types.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L124) + +**`Experimental`** + +Stable name of the `AgentRunSpec` that produced this iteration. + +##### output? + +> `optional` **output?**: `Output` + +Defined in: [runtime/types.ts:125](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L125) + +**`Experimental`** + +##### verdict? + +> `optional` **verdict?**: `DefaultVerdict` + +Defined in: [runtime/types.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L126) + +**`Experimental`** + +##### error? + +> `optional` **error?**: `Error` + +Defined in: [runtime/types.ts:127](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L127) + +**`Experimental`** + +##### events + +> **events**: `SandboxEvent`[] + +Defined in: [runtime/types.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L129) + +**`Experimental`** + +Raw sandbox event stream collected for this iteration. + +##### startedAt + +> **startedAt**: `number` + +Defined in: [runtime/types.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L130) + +**`Experimental`** + +##### endedAt + +> **endedAt**: `number` + +Defined in: [runtime/types.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L131) + +**`Experimental`** + +##### costUsd + +> **costUsd**: `number` + +Defined in: [runtime/types.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L132) + +**`Experimental`** + +##### tokenUsage + +> **tokenUsage**: [`LoopTokenUsage`](#looptokenusage) + +Defined in: [runtime/types.ts:134](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L134) + +**`Experimental`** + +Summed LLM token usage across every `llm_call` event in this iteration. + +*** + +### Driver + +Defined in: [runtime/types.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L138) + +**`Experimental`** + +#### Type Parameters + +##### Task + +`Task` + +##### Output + +`Output` + +##### Decision + +`Decision` + +#### Properties + +##### name? + +> `readonly` `optional` **name?**: `string` + +Defined in: [runtime/types.ts:142](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L142) + +**`Experimental`** + +Stable identifier surfaced in trace events. Default `'driver'`. + +#### Methods + +##### plan() + +> **plan**(`task`, `history`): `Promise`\<`Task`[]\> + +Defined in: [runtime/types.ts:147](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L147) + +**`Experimental`** + +Tasks to issue this iteration. `[task]` → refine; N copies → fanout; +`[]` → no more work this round (kernel proceeds to `decide`). + +###### Parameters + +###### task + +`Task` + +###### history + +readonly [`Iteration`](#iteration-1)\<`Task`, `Output`\>[] + +###### Returns + +`Promise`\<`Task`[]\> + +##### decide() + +> **decide**(`history`): `Decision` \| `Promise`\<`Decision`\> + +Defined in: [runtime/types.ts:154](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L154) + +**`Experimental`** + +Inspect history and return the next state. The kernel terminates the +loop when `decide` returns a value listed in `isTerminalDecision` +(`'stop' | 'pick-winner' | 'fail' | 'done'`), when `maxIterations` +is hit, or when the abort signal fires. + +###### Parameters + +###### history + +readonly [`Iteration`](#iteration-1)\<`Task`, `Output`\>[] + +###### Returns + +`Decision` \| `Promise`\<`Decision`\> + +##### describePlan()? + +> `optional` **describePlan**(): [`LoopPlanDescription`](#loopplandescription) \| `undefined` + +Defined in: [runtime/types.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L164) + +**`Experimental`** + +Optional: describe the move `plan()` just produced, for trace emission. +The kernel calls this immediately after `plan()` and emits the result in +the `loop.plan` event so a topology viewer can render the agent's chosen +move + rationale (not just the inferred fan-width). Drivers whose topology +is a pure function of count (refine/fanout-vote) omit it — the kernel +infers `moveKind` from the planned-task count. A driver that authors its +own topology returns its chosen move's kind + rationale here. + +###### Returns + +[`LoopPlanDescription`](#loopplandescription) \| `undefined` + +##### selectWinner()? + +> `optional` **selectWinner**(`history`): [`LoopWinner`](#loopwinner)\<`Task`, `Output`\> \| `undefined` + +Defined in: [runtime/types.ts:174](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L174) + +**`Experimental`** + +Optional: the driver AUTHORS the winner instead of the kernel's argmax. The +kernel consults this at finalize ONLY when the caller did not pass an explicit +`selectWinner` to runLoop. Return the driver-declared winner (e.g. from a +`select` topology move) or `undefined` to fall through to the default +(best-valid-score, earliest index). This is the SELECTOR role made +agent-authorable — the planner runs the selection, not the kernel. + +###### Parameters + +###### history + +readonly [`Iteration`](#iteration-1)\<`Task`, `Output`\>[] + +###### Returns + +[`LoopWinner`](#loopwinner)\<`Task`, `Output`\> \| `undefined` + +*** + +### LoopPlanDescription + +Defined in: [runtime/types.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L180) + +**`Experimental`** + +Driver-supplied description of the just-planned move. + +#### Properties + +##### kind + +> **kind**: `string` + +Defined in: [runtime/types.ts:182](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L182) + +**`Experimental`** + +Topology move this round — e.g. `'refine' | 'fanout' | 'verify' | 'stop'`. + +##### rationale? + +> `optional` **rationale?**: `string` + +Defined in: [runtime/types.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L184) + +**`Experimental`** + +Why the driver chose this move (the agent's rationale), when available. + +##### parentIndex? + +> `optional` **parentIndex?**: `number` + +Defined in: [runtime/types.ts:191](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L191) + +**`Experimental`** + +Iteration index this round branches FROM, when the driver declares it. +Overrides the kernel's inferred branch point — lets a planner that +branches off a specific (non-winner) iteration emit faithful edge lineage. +Omit to keep the inferred (best-valid / latest) branch point. + +*** + +### LoopWinner + +Defined in: [runtime/types.ts:195](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L195) + +**`Experimental`** + +#### Type Parameters + +##### Task + +`Task` + +##### Output + +`Output` + +#### Properties + +##### task + +> **task**: `Task` + +Defined in: [runtime/types.ts:196](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L196) + +**`Experimental`** + +##### output + +> **output**: `Output` + +Defined in: [runtime/types.ts:197](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L197) + +**`Experimental`** + +##### verdict? + +> `optional` **verdict?**: `DefaultVerdict` + +Defined in: [runtime/types.ts:198](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L198) + +**`Experimental`** + +##### iterationIndex + +> **iterationIndex**: `number` + +Defined in: [runtime/types.ts:199](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L199) + +**`Experimental`** + +##### agentRunName + +> **agentRunName**: `string` + +Defined in: [runtime/types.ts:200](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L200) + +**`Experimental`** + +*** + +### LoopResult + +Defined in: [runtime/types.ts:204](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L204) + +**`Experimental`** + +#### Type Parameters + +##### Task + +`Task` + +##### Output + +`Output` + +##### Decision + +`Decision` + +#### Properties + +##### decision + +> **decision**: `Decision` + +Defined in: [runtime/types.ts:205](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L205) + +**`Experimental`** + +##### iterations + +> **iterations**: [`Iteration`](#iteration-1)\<`Task`, `Output`\>[] + +Defined in: [runtime/types.ts:206](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L206) + +**`Experimental`** + +##### winner? + +> `optional` **winner?**: [`LoopWinner`](#loopwinner)\<`Task`, `Output`\> + +Defined in: [runtime/types.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L207) + +**`Experimental`** + +##### durationMs + +> **durationMs**: `number` + +Defined in: [runtime/types.ts:208](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L208) + +**`Experimental`** + +##### costUsd + +> **costUsd**: `number` + +Defined in: [runtime/types.ts:210](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L210) + +**`Experimental`** + +Sum of every iteration's `costUsd`. + +##### tokenUsage + +> **tokenUsage**: [`LoopTokenUsage`](#looptokenusage) + +Defined in: [runtime/types.ts:214](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L214) + +**`Experimental`** + +Sum of every iteration's token usage. Forward to + `ctx.cost.observeTokens` in a `runProfileMatrix` dispatch so the + integrity guard sees real LLM activity. + +*** + +### SandboxClient + +Defined in: [runtime/types.ts:230](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L230) + +**`Experimental`** + +Minimal sandbox client surface the kernel calls. Satisfied structurally by +`new Sandbox({ apiKey, baseUrl })` — declared as a structural type so +tests can pass a stub without instantiating the SDK. + +`describePlacement` is optional. When present, the kernel calls it after +each `create()` so the `loop.iteration.dispatch` trace event carries fleet +coordinates (fleetId + machineId) instead of just the sibling sandboxId. +Fleet-aware adapters set this; the raw `Sandbox` SDK class does not, and +the kernel falls back to `{ placement: 'sibling', sandboxId: box.id }`. + +#### Methods + +##### create() + +> **create**(`options?`): `Promise`\<`SandboxInstance`\> + +Defined in: [runtime/types.ts:231](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L231) + +**`Experimental`** + +###### Parameters + +###### options? + +`CreateSandboxOptions` + +###### Returns + +`Promise`\<`SandboxInstance`\> + +##### describePlacement()? + +> `optional` **describePlacement**(`box`): [`LoopSandboxPlacement`](#loopsandboxplacement) + +Defined in: [runtime/types.ts:232](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L232) + +**`Experimental`** + +###### Parameters + +###### box + +`SandboxInstance` + +###### Returns + +[`LoopSandboxPlacement`](#loopsandboxplacement) + +##### criuStatus()? + +> `optional` **criuStatus**(): `Promise`\<\{ `available`: `boolean`; `criuVersion?`: `string`; `reason?`: `string`; \}\> + +Defined in: [runtime/types.ts:243](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L243) + +**`Experimental`** + +Optional CRIU capability probe. When present and it resolves +`{ available: true }`, the loop's `lineage.fork` seam may checkpoint+fork a +parent box so a fanout's branches inherit a shared context prefix; absent or +`false`, the fanout degrades to independent fresh boxes. The kernel reads +this ONLY through the capability probe — it never branches on backend kind. +The raw `Sandbox` SDK class satisfies it; the loop's test fakes omit it +(⇒ `canFork = false`). + +###### Returns + +`Promise`\<\{ `available`: `boolean`; `criuVersion?`: `string`; `reason?`: `string`; \}\> + +*** + +### LoopLineageOptions + +Defined in: [runtime/types.ts:267](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L267) + +**`Experimental`** + +Opt-in box-lineage controls for `runLoop`. Default OFF — with both flags +unset the kernel's per-iteration behavior is byte-identical to acquiring a +fresh box, streaming once, and tearing it down. The independence of N fresh +boxes (e.g. `random@k`) is a compute-control invariant; these flags must +never apply to it. Enable them ONLY on a steered loop (refine / planner-driven +fanout) where reusing the parent's context is intended. + +Live-box footprint: the lineage keeps every box it starts or forks alive +across rounds so a later round can descend from it, and tears them down at +loop end. When the driver's branch point is kernel-inferred (no +`describePlan` — refine, fanout-vote), the kernel prunes boxes no future +round can reach after each round, so the live set tracks the active frontier. +When the driver authors its own branch point (`describePlan().parentIndex`), +it may descend from any prior +iteration, so no box is pruned and the live-box count rises to the total +iterations across all rounds. Size `forkFanout` runs accordingly (CRIU forks +are copy-on-write, but each is still a live box until loop end). + +#### Properties + +##### sessionContinuity? + +> `optional` **sessionContinuity?**: `boolean` + +Defined in: [runtime/types.ts:282](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L282) + +**`Experimental`** + +When true, a refine round (1 planned task) descending from a prior round +CONTINUES the parent iteration's session on the SAME box +(`streamPrompt({ sessionId })`) instead of acquiring a fresh box and +re-injecting prior context as prompt text. Round 0 (no parent) always +starts fresh. Usable on any single-task path, not just the refine driver. + +Requires a platform that honors a client-supplied `sessionId`. The lineage +mints the id and `continue` asserts the session is still live +(`box.session(id).status()`), failing loud if the platform dropped it — so a +non-honoring platform errors instead of silently running contextless turns. +Verify continuity against the live platform before enabling: the assertion +proves the session EXISTS server-side, not that prior turns replay into it. + +##### forkFanout? + +> `optional` **forkFanout?**: `boolean` + +Defined in: [runtime/types.ts:297](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L297) + +**`Experimental`** + +When true AND the platform reports CRIU fork support, a fanout round (N +planned tasks) descending from a prior round FORKS the parent iteration's +checkpoint so all N branches inherit a shared context prefix. Without fork +support it degrades to N independent fresh boxes (same result, no prefix). +Round 0 always starts fresh. NEVER set this for a `random@k` control arm — +forking would couple the independent samples. + +A real fork inherits the parent's IMAGE/PROFILE: per-branch `AgentRunSpec` +profiles are honored only on the degraded fresh-box path, so a +heterogeneous-profile fanout silently homogenizes to the parent's profile +when fork is available. Use this for same-profile branching; for +different-per-branch profiles use the unforked fanout path. + +##### streaming? + +> `optional` **streaming?**: `"sse"` \| `"poll"` + +Defined in: [runtime/types.ts:309](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L309) + +**`Experimental`** + +Per-turn sandbox streaming mode. Default `'sse'` (live `streamPrompt` — +low-latency, full per-token trace; best for interactive chat). `'poll'` +fire-and-detaches via `dispatchPrompt` and awaits the terminal result by +status-polling, so a long, quiet in-box turn (clone + build + test) never +holds a live stream a proxy idle-timeout can drop mid-execution. Lower trace +fidelity (one terminal event), so it is opt-in — intended for BATCH eval +runs, which don't need live streaming and were losing long turns to the +idle-drop. Applies to the default fresh-box path too, not only when +`sessionContinuity`/`forkFanout` are on. + +*** + +### LoopSandboxPlacement + +Defined in: [runtime/types.ts:313](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L313) + +**`Experimental`** + +#### Extended by + +- [`InProcessExecutorDescribePlacement`](mcp.md#inprocessexecutordescribeplacement) + +#### Properties + +##### kind + +> **kind**: `"sibling"` \| `"fleet"` + +Defined in: [runtime/types.ts:314](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L314) + +**`Experimental`** + +##### sandboxId? + +> `optional` **sandboxId?**: `string` + +Defined in: [runtime/types.ts:315](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L315) + +**`Experimental`** + +##### fleetId? + +> `optional` **fleetId?**: `string` + +Defined in: [runtime/types.ts:316](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L316) + +**`Experimental`** + +##### machineId? + +> `optional` **machineId?**: `string` + +Defined in: [runtime/types.ts:317](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L317) + +**`Experimental`** + +*** + +### LoopTraceEmitter + +Defined in: [runtime/types.ts:321](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L321) + +**`Experimental`** + +#### Methods + +##### emit() + +> **emit**(`event`): `void` \| `Promise`\<`void`\> + +Defined in: [runtime/types.ts:322](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L322) + +**`Experimental`** + +###### Parameters + +###### event + +[`LoopTraceEvent`](#looptraceevent) + +###### Returns + +`void` \| `Promise`\<`void`\> + +*** + +### LoopStartedPayload + +Defined in: [runtime/types.ts:357](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L357) + +**`Experimental`** + +#### Properties + +##### driver + +> **driver**: `string` + +Defined in: [runtime/types.ts:358](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L358) + +**`Experimental`** + +##### agentRunNames + +> **agentRunNames**: `string`[] + +Defined in: [runtime/types.ts:359](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L359) + +**`Experimental`** + +##### maxIterations + +> **maxIterations**: `number` + +Defined in: [runtime/types.ts:360](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L360) + +**`Experimental`** + +##### maxConcurrency + +> **maxConcurrency**: `number` + +Defined in: [runtime/types.ts:361](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L361) + +**`Experimental`** + +*** + +### LoopPlanPayload + +Defined in: [runtime/types.ts:372](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L372) + +**`Experimental`** + +Emitted once per `plan()` round, immediately after the driver plans. Carries +the topology move so a viewer renders WHAT the agent decided + WHY, not just +the inferred fan-width. `moveKind` is the driver's `describePlan().kind` when +provided, else inferred from `plannedCount` (0→stop, 1→refine, N→fanout). + +#### Properties + +##### roundIndex + +> **roundIndex**: `number` + +Defined in: [runtime/types.ts:374](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L374) + +**`Experimental`** + +0-based plan round (one per `plan()` call). + +##### plannedCount + +> **plannedCount**: `number` + +Defined in: [runtime/types.ts:376](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L376) + +**`Experimental`** + +Tasks the driver issued this round. + +##### moveKind + +> **moveKind**: `string` + +Defined in: [runtime/types.ts:378](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L378) + +**`Experimental`** + +Topology move — `'refine' | 'fanout' | 'verify' | 'stop'` etc. + +##### rationale? + +> `optional` **rationale?**: `string` + +Defined in: [runtime/types.ts:380](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L380) + +**`Experimental`** + +Driver rationale for the move, when available. + +##### parentIndex? + +> `optional` **parentIndex?**: `number` + +Defined in: [runtime/types.ts:386](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L386) + +**`Experimental`** + +Iteration index this round branched FROM (the edge source). `undefined` +for round 0 (root). Kernel-inferred branch point — the best-valid (else +latest) iteration so far — unless a driver later declares it explicitly. + +##### childIndices + +> **childIndices**: `number`[] + +Defined in: [runtime/types.ts:388](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L388) + +**`Experimental`** + +Iteration indices this round dispatched (the edge targets). + +*** + +### LoopIterationStartedPayload + +Defined in: [runtime/types.ts:392](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L392) + +**`Experimental`** + +#### Properties + +##### iterationIndex + +> **iterationIndex**: `number` + +Defined in: [runtime/types.ts:393](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L393) + +**`Experimental`** + +##### agentRunName + +> **agentRunName**: `string` + +Defined in: [runtime/types.ts:394](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L394) + +**`Experimental`** + +##### taskHash + +> **taskHash**: `string` + +Defined in: [runtime/types.ts:395](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L395) + +**`Experimental`** + +##### groupId? + +> `optional` **groupId?**: `number` + +Defined in: [runtime/types.ts:397](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L397) + +**`Experimental`** + +Plan round (== `LoopPlanPayload.roundIndex`) this iteration belongs to. + +##### parentIndex? + +> `optional` **parentIndex?**: `number` + +Defined in: [runtime/types.ts:399](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L399) + +**`Experimental`** + +Iteration this one was planned from; `undefined` ⇒ root. + +*** + +### LoopIterationDispatchPayload + +Defined in: [runtime/types.ts:410](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L410) + +**`Experimental`** + +Where the iteration's worker was placed. `sibling` = a fresh sandbox the +kernel created via `sandboxClient.create`. `fleet` = an existing machine in +a shared-workspace fleet — workers see the caller's filesystem and any diff +they write lands on it directly. + +#### Properties + +##### iterationIndex + +> **iterationIndex**: `number` + +Defined in: [runtime/types.ts:411](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L411) + +**`Experimental`** + +##### agentRunName + +> **agentRunName**: `string` + +Defined in: [runtime/types.ts:412](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L412) + +**`Experimental`** + +##### placement + +> **placement**: `"sibling"` \| `"fleet"` + +Defined in: [runtime/types.ts:413](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L413) + +**`Experimental`** + +##### sandboxId? + +> `optional` **sandboxId?**: `string` + +Defined in: [runtime/types.ts:415](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L415) + +**`Experimental`** + +Set on every placement. Lets analyst loops correlate per-iteration logs. + +##### fleetId? + +> `optional` **fleetId?**: `string` + +Defined in: [runtime/types.ts:417](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L417) + +**`Experimental`** + +Set only when `placement === 'fleet'`. + +##### machineId? + +> `optional` **machineId?**: `string` + +Defined in: [runtime/types.ts:419](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L419) + +**`Experimental`** + +Set only when `placement === 'fleet'`. + +##### groupId? + +> `optional` **groupId?**: `number` + +Defined in: [runtime/types.ts:421](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L421) + +**`Experimental`** + +Plan round this iteration belongs to. + +##### parentIndex? + +> `optional` **parentIndex?**: `number` + +Defined in: [runtime/types.ts:423](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L423) + +**`Experimental`** + +Iteration this one was planned from; `undefined` ⇒ root. + +*** + +### LoopIterationEndedPayload + +Defined in: [runtime/types.ts:427](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L427) + +**`Experimental`** + +#### Properties + +##### iterationIndex + +> **iterationIndex**: `number` + +Defined in: [runtime/types.ts:428](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L428) + +**`Experimental`** + +##### agentRunName + +> **agentRunName**: `string` + +Defined in: [runtime/types.ts:429](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L429) + +**`Experimental`** + +##### outputHash? + +> `optional` **outputHash?**: `string` + +Defined in: [runtime/types.ts:430](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L430) + +**`Experimental`** + +##### verdict? + +> `optional` **verdict?**: `DefaultVerdict` + +Defined in: [runtime/types.ts:431](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L431) + +**`Experimental`** + +##### error? + +> `optional` **error?**: `string` + +Defined in: [runtime/types.ts:432](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L432) + +**`Experimental`** + +##### costUsd + +> **costUsd**: `number` + +Defined in: [runtime/types.ts:433](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L433) + +**`Experimental`** + +##### durationMs + +> **durationMs**: `number` + +Defined in: [runtime/types.ts:434](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L434) + +**`Experimental`** + +##### tokenUsage? + +> `optional` **tokenUsage?**: [`LoopTokenUsage`](#looptokenusage) + +Defined in: [runtime/types.ts:437](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L437) + +**`Experimental`** + +Summed LLM token usage for this iteration — maps to gen_ai.usage.* on the + branch span. Omitted when no `llm_call` events carried token counts. + +##### groupId? + +> `optional` **groupId?**: `number` + +Defined in: [runtime/types.ts:439](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L439) + +**`Experimental`** + +Plan round this iteration belongs to. + +##### parentIndex? + +> `optional` **parentIndex?**: `number` + +Defined in: [runtime/types.ts:441](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L441) + +**`Experimental`** + +Iteration this one was planned from; `undefined` ⇒ root. + +##### outputPreview? + +> `optional` **outputPreview?**: `string` + +Defined in: [runtime/types.ts:444](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L444) + +**`Experimental`** + +Truncated string preview of the parsed output — for a viewer's drawer. + Bounded to ~280 chars; never the full payload. + +*** + +### LoopDecisionPayload + +Defined in: [runtime/types.ts:448](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L448) + +**`Experimental`** + +#### Properties + +##### decision + +> **decision**: `string` + +Defined in: [runtime/types.ts:449](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L449) + +**`Experimental`** + +##### historyLength + +> **historyLength**: `number` + +Defined in: [runtime/types.ts:450](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L450) + +**`Experimental`** + +*** + +### LoopEndedPayload + +Defined in: [runtime/types.ts:454](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L454) + +**`Experimental`** + +#### Properties + +##### winnerIterationIndex? + +> `optional` **winnerIterationIndex?**: `number` + +Defined in: [runtime/types.ts:455](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L455) + +**`Experimental`** + +##### totalCostUsd + +> **totalCostUsd**: `number` + +Defined in: [runtime/types.ts:456](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L456) + +**`Experimental`** + +##### durationMs + +> **durationMs**: `number` + +Defined in: [runtime/types.ts:457](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L457) + +**`Experimental`** + +##### iterations + +> **iterations**: `number` + +Defined in: [runtime/types.ts:458](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L458) + +**`Experimental`** + +*** + +### LoopTeardownFailedPayload + +Defined in: [runtime/types.ts:464](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L464) + +**`Experimental`** + +Emitted when a box's `delete()` throws or times out during teardown — the + loop swallows the failure (platform reaps on expiry) but surfaces it here so + a real leak (e.g. mid-loop auth expiry) is observable. + +#### Properties + +##### sandboxId? + +> `optional` **sandboxId?**: `string` + +Defined in: [runtime/types.ts:465](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L465) + +**`Experimental`** + +##### reason + +> **reason**: `string` + +Defined in: [runtime/types.ts:467](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L467) + +**`Experimental`** + +`'timeout'` or the delete error message. + +*** + +### ExecCtx + +Defined in: [runtime/types.ts:471](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L471) + +**`Experimental`** + +#### Properties + +##### sandboxClient + +> **sandboxClient**: [`SandboxClient`](#sandboxclient-2) + +Defined in: [runtime/types.ts:473](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L473) + +**`Experimental`** + +Sandbox SDK client — the kernel calls `.create()` per iteration. + +##### hooks? + +> `optional` **hooks?**: [`RuntimeHooks`](index.md#runtimehooks) + +Defined in: [runtime/types.ts:475](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L475) + +**`Experimental`** + +Optional runtime hooks. Execution-scoped; never part of `AgentProfile`. + +##### traceEmitter? + +> `optional` **traceEmitter?**: [`LoopTraceEmitter`](#looptraceemitter) + +Defined in: [runtime/types.ts:477](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L477) + +**`Experimental`** + +Optional trace emitter. When set, the kernel emits `loop.*` events. + +##### runHandle? + +> `optional` **runHandle?**: [`RuntimeRunHandle`](index.md#runtimerunhandle) + +Defined in: [runtime/types.ts:483](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L483) + +**`Experimental`** + +Optional production-run handle. When set, every synthesized `llm_call` +the kernel infers from a sandbox event stream is forwarded via +`runHandle.observe` so per-run cost aggregates pick up loop spend. + +##### signal? + +> `optional` **signal?**: `AbortSignal` + +Defined in: [runtime/types.ts:485](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L485) + +**`Experimental`** + +Cooperative cancellation signal. + +##### traceId? + +> `optional` **traceId?**: `string` + +Defined in: [runtime/types.ts:491](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L491) + +**`Experimental`** + +Trace id for OTEL correlation. When set alongside `traceEmitter`, the +exporter uses this as the parent trace for all emitted spans. Typically +inherited from TRACE_ID env var in MCP subprocess mode. + +##### parentSpanId? + +> `optional` **parentSpanId?**: `string` + +Defined in: [runtime/types.ts:496](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L496) + +**`Experimental`** + +Parent span id for OTEL correlation. Loop events become children of +this span. Typically inherited from PARENT_SPAN_ID env var. + +*** + +### VerifierEnvironmentOptions + +Defined in: [runtime/verifier-environment.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/verifier-environment.ts#L34) + +#### Properties + +##### name + +> **name**: `string` + +Defined in: [runtime/verifier-environment.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/verifier-environment.ts#L35) + +##### extraTools? + +> `optional` **extraTools?**: [`AgenticTool`](#agentictool)[] + +Defined in: [runtime/verifier-environment.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/verifier-environment.ts#L39) + +Extra domain tools (read-only helpers: calculator, retrieval, style lookup). + +#### Methods + +##### check() + +> **check**(`task`, `answer`): [`SurfaceScore`](#surfacescore) \| `Promise`\<[`SurfaceScore`](#surfacescore)\> + +Defined in: [runtime/verifier-environment.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/verifier-environment.ts#L37) + +The deployable check over a submitted answer. Graded via passes/total. + +###### Parameters + +###### task + +[`AgenticTask`](#agentictask) + +###### answer + +`string` + +###### Returns + +[`SurfaceScore`](#surfacescore) \| `Promise`\<[`SurfaceScore`](#surfacescore)\> + +##### callExtra()? + +> `optional` **callExtra**(`task`, `name`, `args`): `string` \| `Promise`\<`string`\> + +Defined in: [runtime/verifier-environment.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/verifier-environment.ts#L41) + +Executes the extra tools. Required when `extraTools` is set. + +###### Parameters + +###### task + +[`AgenticTask`](#agentictask) + +###### name + +`string` + +###### args + +`Record`\<`string`, `unknown`\> + +###### Returns + +`string` \| `Promise`\<`string`\> + +*** + +### WaterfallSpan + +Defined in: [runtime/waterfall.ts:11](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L11) + +#### Properties + +##### id + +> **id**: `string` + +Defined in: [runtime/waterfall.ts:12](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L12) + +##### label + +> **label**: `string` + +Defined in: [runtime/waterfall.ts:14](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L14) + +The spawn label (`shot:0`, `analyst:1`, a nested agent's label) — the row name. + +##### runId + +> **runId**: `string` + +Defined in: [runtime/waterfall.ts:15](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L15) + +##### parentId? + +> `optional` **parentId?**: `string` + +Defined in: [runtime/waterfall.ts:16](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L16) + +##### startMs + +> **startMs**: `number` + +Defined in: [runtime/waterfall.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L17) + +##### endMs? + +> `optional` **endMs?**: `number` + +Defined in: [runtime/waterfall.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L18) + +##### status + +> **status**: `"running"` \| `"done"` \| `"down"` + +Defined in: [runtime/waterfall.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L19) + +##### usd + +> **usd**: `number` + +Defined in: [runtime/waterfall.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L20) + +##### tokens + +> **tokens**: `object` + +Defined in: [runtime/waterfall.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L21) + +###### input + +> **input**: `number` + +###### output + +> **output**: `number` + +##### score? + +> `optional` **score?**: `number` + +Defined in: [runtime/waterfall.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L22) + +*** + +### WaterfallReport + +Defined in: [runtime/waterfall.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L25) + +#### Properties + +##### spans + +> **spans**: [`WaterfallSpan`](#waterfallspan)[] + +Defined in: [runtime/waterfall.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L26) + +##### totalMs + +> **totalMs**: `number` + +Defined in: [runtime/waterfall.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L28) + +Wall-clock of the observed window (first spawn → last settle). + +##### totalUsd + +> **totalUsd**: `number` + +Defined in: [runtime/waterfall.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L29) + +##### totalTokens + +> **totalTokens**: `object` + +Defined in: [runtime/waterfall.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L30) + +###### input + +> **input**: `number` + +###### output + +> **output**: `number` + +##### byKind + +> **byKind**: `Record`\<`string`, \{ `count`: `number`; `ms`: `number`; `usd`: `number`; `tokens`: \{ `input`: `number`; `output`: `number`; \}; \}\> + +Defined in: [runtime/waterfall.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L32) + +Rollup by label prefix (the part before ':') — shots vs analysts vs anything else. + +*** + +### WaterfallCollector + +Defined in: [runtime/waterfall.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L49) + +#### Properties + +##### hooks + +> **hooks**: [`RuntimeHooks`](index.md#runtimehooks) + +Defined in: [runtime/waterfall.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L51) + +Attach these to RunAgenticOptions.hooks / BenchmarkConfig.hooks. + +#### Methods + +##### report() + +> **report**(): [`WaterfallReport`](#waterfallreport) + +Defined in: [runtime/waterfall.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L52) + +###### Returns + +[`WaterfallReport`](#waterfallreport) + +##### render() + +> **render**(`opts?`): `string` + +Defined in: [runtime/waterfall.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L54) + +The text waterfall — one row per span, bars scaled to the observed window. + +###### Parameters + +###### opts? + +###### width? + +`number` + +###### maxRows? + +`number` + +###### Returns + +`string` + +##### reset() + +> **reset**(): `void` + +Defined in: [runtime/waterfall.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L55) + +###### Returns + +`void` + +*** + +### Workspace + +Defined in: [runtime/workspace.ts:11](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L11) + +#### Properties + +##### ref + +> `readonly` **ref**: `string` + +Defined in: [runtime/workspace.ts:12](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L12) + +#### Methods + +##### materialize() + +> **materialize**(`dir`): `Promise`\<`void`\> + +Defined in: [runtime/workspace.ts:13](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L13) + +###### Parameters + +###### dir + +`string` + +###### Returns + +`Promise`\<`void`\> + +##### commit() + +> **commit**(`dir`, `message`): `Promise`\<[`WorkspaceCommit`](#workspacecommit)\> + +Defined in: [runtime/workspace.ts:14](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L14) + +###### Parameters + +###### dir + +`string` + +###### message + +`string` + +###### Returns + +`Promise`\<[`WorkspaceCommit`](#workspacecommit)\> + +##### head() + +> **head**(): `Promise`\<`string`\> + +Defined in: [runtime/workspace.ts:15](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L15) + +###### Returns + +`Promise`\<`string`\> + +*** + +### GitWorkspaceOptions + +Defined in: [runtime/workspace.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L39) + +#### Properties + +##### ref + +> `readonly` **ref**: `string` + +Defined in: [runtime/workspace.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L40) + +##### shell? + +> `readonly` `optional` **shell?**: [`Shell`](#shell) + +Defined in: [runtime/workspace.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L41) + +##### branch? + +> `readonly` `optional` **branch?**: `string` + +Defined in: [runtime/workspace.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L42) + +##### noHooks? + +> `readonly` `optional` **noHooks?**: `boolean` + +Defined in: [runtime/workspace.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L43) + +*** + +### WorkspaceRun + +Defined in: [runtime/workspace.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L135) + +#### Type Parameters + +##### T + +`T` + +#### Properties + +##### valid + +> `readonly` **valid**: `boolean` + +Defined in: [runtime/workspace.ts:136](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L136) + +##### value + +> `readonly` **value**: `T` + +Defined in: [runtime/workspace.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L137) + +##### commit? + +> `readonly` `optional` **commit?**: [`WorkspaceCommit`](#workspacecommit) + +Defined in: [runtime/workspace.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L139) + +Present when a commit was attempted (valid, or `commitOnInvalid`). + +## Type Aliases + +### LoopOptionsForDispatch + +> **LoopOptionsForDispatch**\<`Task`, `Output`, `Decision`\> = `Omit`\<[`RunLoopOptions`](#runloopoptions)\<`Task`, `Output`, `Decision`\>, `"ctx"`\> + +Defined in: [runtime/loop-dispatch.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L44) + +runLoop options minus the `ctx` (loopDispatch builds the ctx). + +#### Type Parameters + +##### Task + +`Task` + +##### Output + +`Output` + +##### Decision + +`Decision` + +*** + +### Outcome + +> **Outcome**\<`D`\> = \{ `kind`: `"done"`; `deliverable`: `D`; \} \| \{ `kind`: `"blocked"`; `blockers`: `string`[]; \} + +Defined in: [runtime/personify/types.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L54) + +The terminal contract Drew wants: a loop returns a FINISHED deliverable, or the concrete +list of blockers that stopped it — never a half-done best-effort coercion. A `blocked` +outcome with an empty `blockers` list is a contract violation (a shape that can't finish +MUST name why); impls fail loud on it rather than emitting a vacuous block. + +`Outcome` is the `Out` type a personified `Agent`/`Supervisor` is parameterized by, so the +keystone's typed `SupervisedResult>` carries it end to end with no coercion. + +#### Type Parameters + +##### D + +`D` + +*** + +### DefinePersona + +> **DefinePersona** = \<`D`\>(`input`) => [`Persona`](#persona)\<`D`\> + +Defined in: [runtime/personify/types.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L143) + +Builds a frozen `Persona`, failing loud on the executors-supplied invariant (neither a + registry nor seams = an unresolvable persona). Pure — no I/O, no engine. + +#### Type Parameters + +##### D + +`D` = `unknown` + +#### Parameters + +##### input + +[`DefinePersonaInput`](#definepersonainput)\<`D`\> + +#### Returns + +[`Persona`](#persona)\<`D`\> + +*** + +### LoopShape + +> **LoopShape**\<`Task`, `D`\> = (`ctx`) => [`Agent`](#agent)\<`Task`, [`Outcome`](#outcome-1)\<`D`\>\> + +Defined in: [runtime/personify/types.ts:192](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L192) + +A reusable act-body factory. Given the persona's content + seams (`ShapeContext`), it +returns the root `Agent>` whose `act` decomposes the task, fans out +children through `scope.spawn`, verifies/selects across their settlements (selector≠judge: +via `settledToIteration` + `defaultSelectWinner`, never re-ranking behind the driver), and +synthesizes the terminal `Outcome`. The shape is STRUCTURE; the persona is CONTENT. + +#### Type Parameters + +##### Task + +`Task` + +##### D + +`D` + +#### Parameters + +##### ctx + +[`ShapeContext`](#shapecontext)\<`D`\> + +#### Returns + +[`Agent`](#agent)\<`Task`, [`Outcome`](#outcome-1)\<`D`\>\> + +*** + +### RunPersonified + +> **RunPersonified** = \<`Task`, `D`\>(`options`) => `Promise`\<[`SupervisedResult`](#supervisedresult)\<[`Outcome`](#outcome-1)\<`D`\>\>\> + +Defined in: [runtime/personify/types.ts:255](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L255) + +The composed run signature. + +#### Type Parameters + +##### Task + +`Task` + +##### D + +`D` + +#### Parameters + +##### options + +[`RunPersonifiedOptions`](#runpersonifiedoptions)\<`Task`, `D`\> + +#### Returns + +`Promise`\<[`SupervisedResult`](#supervisedresult)\<[`Outcome`](#outcome-1)\<`D`\>\>\> + +*** + +### CombinatorShape + +> **CombinatorShape**\<`Task`, `D`\> = [`LoopShape`](#loopshape)\<`Task`, `D`\> + +Defined in: [runtime/personify/wave-types.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L64) + +A combinator is just a `LoopShape`: a factory `(ShapeContext) => Agent` whose `Agent.act` +runs the combinator's structure over the `Scope` (spawn children, drain `next()`, select via +the single-sourced `settledToIteration`+`defaultSelectWinner`, synthesize an `Outcome`). +Aliased — NOT a new type — so a combinator stays a first-class shape the persona layer's +`runPersonified`/`ShapeRegistry` resolve with zero new machinery. The SHAPE is content-free; +the persona carries the domain. + +#### Type Parameters + +##### Task + +`Task` + +##### D + +`D` + +*** + +### Pipeline + +> **Pipeline** = \<`Task`, `D`\>(`stages`) => [`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +Defined in: [runtime/personify/wave-types.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L89) + +`pipeline(stages)` — build the sequential combinator from an ordered stage list. The first + stage's `StepIn` is the root `Task`; the last stage's `StepOut` is the deliverable `D`. + +#### Type Parameters + +##### Task + +`Task` + +##### D + +`D` + +#### Parameters + +##### stages + +`ReadonlyArray`\<[`PipelineStage`](#pipelinestage)\<`Task`, `unknown`, `unknown`\>\> + +#### Returns + +[`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +*** + +### FanoutWinnerSelector + +> **FanoutWinnerSelector**\<`D`\> = (`iterations`) => \{ `output?`: [`Outcome`](#outcome-1)\<`D`\>; \} \| `undefined` + +Defined in: [runtime/personify/wave-types.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L138) + +A winner-selection strategy: argmax/sort over the gathered child iterations (each output is the + child's `Outcome`), returning the chosen iteration or `undefined` when none qualifies. + +#### Type Parameters + +##### D + +`D` + +#### Parameters + +##### iterations + +[`Iteration`](#iteration-1)\<`unknown`, [`Outcome`](#outcome-1)\<`D`\>\>[] + +#### Returns + +\{ `output?`: [`Outcome`](#outcome-1)\<`D`\>; \} \| `undefined` + +*** + +### WinnerStrategy + +> **WinnerStrategy** = `"highest-score"` \| `"smallest-artifact"` \| `"first-valid"` + +Defined in: [runtime/personify/wave-types.ts:144](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L144) + +Built-in valid-only winner strategies for `selectValidWinner` (selector≠judge): best gated-valid + score, the smallest delivered artifact (via a `sizeOf` extractor), or the earliest valid. + +*** + +### Fanout + +> **Fanout** = \<`Task`, `Item`, `D`\>(`items`, `opts`) => [`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +Defined in: [runtime/personify/wave-types.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L155) + +`fanout(items, opts)` — build the fanout combinator over a static item list. + +#### Type Parameters + +##### Task + +`Task` + +##### Item + +`Item` + +##### D + +`D` + +#### Parameters + +##### items + +`ReadonlyArray`\<`Item`\> + +##### opts + +[`FanoutOptions`](#fanoutoptions)\<`Item`, `D`\> + +#### Returns + +[`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +*** + +### LoopUntil + +> **LoopUntil** = \<`Task`, `State`, `D`\>(`seed`, `spec`) => [`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +Defined in: [runtime/personify/wave-types.ts:193](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L193) + +`loopUntil(spec)` — build the iterative-deepening combinator. `seed` is the initial state. + +#### Type Parameters + +##### Task + +`Task` + +##### State + +`State` + +##### D + +`D` + +#### Parameters + +##### seed + +`State` + +##### spec + +[`LoopUntilSpec`](#loopuntilspec)\<`Task`, `State`, `D`\> + +#### Returns + +[`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +*** + +### Panel + +> **Panel** = \<`Task`, `Artifact`, `D`\>(`spec`) => [`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +Defined in: [runtime/personify/wave-types.ts:243](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L243) + +`panel(spec)` — build the M-judge write-only-merge combinator. + +#### Type Parameters + +##### Task + +`Task` + +##### Artifact + +`Artifact` + +##### D + +`D` + +#### Parameters + +##### spec + +[`PanelSpec`](#panelspec)\<`Artifact`, `D`\> + +#### Returns + +[`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +*** + +### Verify + +> **Verify** = \<`Task`, `Candidate`, `D`\>(`spec`) => [`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +Defined in: [runtime/personify/wave-types.ts:269](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L269) + +`verify(spec)` — build the 2-node implement→verifier-gate combinator. + +#### Type Parameters + +##### Task + +`Task` + +##### Candidate + +`Candidate` + +##### D + +`D` + +#### Parameters + +##### spec + +[`VerifySpec`](#verifyspec)\<`Task`, `Candidate`, `D`\> + +#### Returns + +[`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +*** + +### WidenDecision + +> **WidenDecision**\<`D`\> = \{ `kind`: `"widen"`; `toward`: [`WidenLineage`](#widenlineage)\<`D`\>; \} \| \{ `kind`: `"stop"`; `rationale?`: `string`; \} + +Defined in: [runtime/personify/wave-types.ts:323](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L323) + +A widening decision: extend one lineage by one child, or stop widening. `flatWidenGate` + always returns `{ kind: 'stop' }`. + +#### Type Parameters + +##### D + +`D` + +*** + +### Widen + +> **Widen** = \<`Task`, `Seed`, `D`\>(`spec`) => [`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +Defined in: [runtime/personify/wave-types.ts:335](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L335) + +`widen(spec)` — build the streaming progressive-widening combinator. + +#### Type Parameters + +##### Task + +`Task` + +##### Seed + +`Seed` + +##### D + +`D` + +#### Parameters + +##### spec + +[`WidenSpec`](#widenspec)\<`Seed`, `D`\> + +#### Returns + +[`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +*** + +### FlatWidenGate + +> **FlatWidenGate** = \<`D`\>() => [`ScopeWidenGate`](#scopewidengate)\<`D`\> + +Defined in: [runtime/personify/wave-types.ts:340](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L340) + +The flat default `ScopeWidenGate` factory contract — never widens, keeping the R2 firewall + conflict dormant. Exported so a gate run can pass it explicitly and a test can assert the + default is flat. + +#### Type Parameters + +##### D + +`D` + +#### Returns + +[`ScopeWidenGate`](#scopewidengate)\<`D`\> + +*** + +### AssertTraceDerivedFindings + +> **AssertTraceDerivedFindings** = (`findings`) => `void` + +Defined in: [runtime/personify/wave-types.ts:401](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L401) + +The firewall assertion contract, re-stated for the reactive seam (PORT of +`assertTraceDerivedFindings`). A PROVENANCE check, not a content check: span/event/artifact/ +finding refs and empty-evidence findings pass; only a `metric` ref whose uri is a +judge/verdict/score scheme is rejected. Fail loud — a tainted finding aborts. The impl lives in +`analyst.ts`; this type pins its signature so callers depend on the contract, not the impl. + +#### Parameters + +##### findings + +`ReadonlyArray`\<`AnalystFinding`\> + +#### Returns + +`void` + +*** + +### RenderCorpusToInstructions + +> **RenderCorpusToInstructions** = (`opts`) => `Promise`\<`AgentProfile`\> + +Defined in: [runtime/personify/wave-types.ts:492](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L492) + +`renderCorpusToInstructions(opts)` — the flywheel read-back projection. Async (queries the + durable corpus); returns a fresh `AgentProfile` with the accreted facts merged in. + +#### Parameters + +##### opts + +[`RenderCorpusToInstructionsOptions`](#rendercorpustoinstructionsoptions) + +#### Returns + +`Promise`\<`AgentProfile`\> + +*** + +### TrajectoryReportFn + +> **TrajectoryReportFn** = (`journal`, `blobs`, `root`, `options?`) => `Promise`\<[`TrajectoryReport`](#trajectoryreport-3)\> + +Defined in: [runtime/personify/wave-types.ts:551](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L551) + +`trajectoryReport(...)` — the tree+cost reconstructor. Async (reads journal + optionally blobs). + +#### Parameters + +##### journal + +[`SpawnJournal`](#spawnjournal) + +##### blobs + +[`ResultBlobStore`](#resultblobstore) + +##### root + +[`NodeId`](#nodeid-1) + +##### options? + +[`TrajectoryReportOptions`](#trajectoryreportoptions) + +#### Returns + +`Promise`\<[`TrajectoryReport`](#trajectoryreport-3)\> + +*** + +### EqualKOnCost + +> **EqualKOnCost** = (`arms`, `options?`) => [`EqualKVerdict`](#equalkverdict) + +Defined in: [runtime/personify/wave-types.ts:606](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L606) + +`equalKOnCost(arms, opts)` — the cross-arm equal-compute check on conserved cost. + +#### Parameters + +##### arms + +`ReadonlyArray`\<[`EqualKArm`](#equalkarm)\> + +##### options? + +[`EqualKOnCostOptions`](#equalkoncostoptions) + +#### Returns + +[`EqualKVerdict`](#equalkverdict) + +*** + +### Environment + +> **Environment** = [`AgenticSurface`](#agenticsurface) + +Defined in: [runtime/run-benchmark.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L30) + +A checkable task domain — implement these 5 hooks and the suite does the rest. The + same seam as `AgenticSurface`; `Environment` is the RL/gym-standard name for it. + +*** + +### Deliverable + +> **Deliverable**\<`Out`\> = \{ `kind`: `"events"`; `fromEvents`: (`events`) => `Out`; \} \| \{ `kind`: `"artifact"`; `path`: `string`; `fromArtifact`: (`raw`, `events`) => `Out`; \} + +Defined in: [runtime/sandbox-run.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L50) + +**`Experimental`** + +How a typed deliverable `Out` is materialized from a finished turn. +- `events` — pure parse over the event array (identical to `OutputAdapter`). +- `artifact` — read a file off the box AFTER the turn drains, then map it (+ the + events). For diffs/codebases/documents that don't fit the chat + stream. `path` relative ⇒ workspace root; absolute ⇒ container FS. + +#### Type Parameters + +##### Out + +`Out` + +*** + +### ChampionPolicy + +> **ChampionPolicy** = `"score"` \| `"costAware"` + +Defined in: [runtime/strategy-evolution.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L55) + +*** + +### BudgetReadout + +> **BudgetReadout** = `Readonly`\<\{ `tokensLeft`: `number`; `usdLeft`: `number`; `usdCapped`: `boolean`; `deadlineMs`: `number`; `reservedTokens`: `number`; \}\> + +Defined in: [runtime/supervise/budget.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L43) + +Post-reservation pool readout — the shape `Scope.budget` exposes. `tokensLeft`, + `usdLeft`, and `reservedTokens` reflect committed-but-unsettled reservations; + `deadlineMs` is the ABSOLUTE wall-clock deadline (0 when the root set none). + `usdCapped` distinguishes a real `usdLeft <= 0` exhaustion from an uncapped pool (which always + reads `usdLeft: 0`) — the in-loop guard needs it to bound a usd-capped driver. + +*** + +### ExecutorConfig + +> **ExecutorConfig** = `object` & [`RouterSeam`](#routerseam) \| `object` & [`RouterToolsSeam`](#routertoolsseam) \| `object` & [`BridgeSeam`](#bridgeseam) \| `object` & [`CliSeam`](#cliseam) \| `object` & [`CliWorktreeSeam`](#cliworktreeseam) \| `object` & [`SandboxSeam`](#sandboxseam) + +Defined in: [runtime/supervise/runtime.ts:1121](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L1121) + +Config for [createExecutor](#createexecutor): the backend is DATA — the cost dial a profile, +an experiment config, or a replay journal can name — not an import choice. Each +variant carries its backend's seam (router/router-tools/bridge/cli/cli-worktree/sandbox). + +*** + +### ToolPartDecoder + +> **ToolPartDecoder** = (`part`) => [`ToolStepInput`](#toolstepinput) \| `undefined` + +Defined in: [runtime/supervise/trace-source.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L60) + +Decode one harness message part into a tool step, or `undefined` if it is not a (completed) tool + call. ONE adapter per harness family — each owns its real wire shape; the flow downstream is + identical. Add a harness = add a decoder + register it; no other code changes. + +#### Parameters + +##### part + +`Record`\<`string`, `unknown`\> + +#### Returns + +[`ToolStepInput`](#toolstepinput) \| `undefined` + +*** + +### UsageEvent + +> **UsageEvent** = \{ `kind`: `"tokens"`; `input`: `number`; `output`: `number`; \} \| \{ `kind`: `"cost"`; `usd`: `number`; \} \| \{ `kind`: `"iteration"`; \} + +Defined in: [runtime/supervise/types.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L130) + +Normalized usage event — the single channel every executor reports through, so the +conserved pool meters all runtimes identically. `tokens` carries `LoopTokenUsage`'s +`{ input, output }`; `usd` is a SEPARATE channel (never folded into tokens). + +*** + +### Runtime + +> **Runtime** = `"router"` \| `"inline"` \| `"sandbox"` \| `"cli"` \| `string` & `object` + +Defined in: [runtime/supervise/types.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L137) + +The runtime tag of a `Executor` impl. Open by intent — `string` so a BYO executor + names its own runtime; the built-ins use these literals. + +*** + +### ExecutorFactory + +> **ExecutorFactory**\<`Out`\> = (`spec`, `ctx`) => [`Executor`](#executor)\<`Out`\> + +Defined in: [runtime/supervise/types.ts:165](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L165) + +Builds a fresh `Executor` for one spawn from the resolved spec. Per-spawn (not +shared) so each child owns its own box/abort/teardown lifecycle. A BYO factory lets a +user supply construction args without pre-instantiating. + +#### Type Parameters + +##### Out + +`Out` + +#### Parameters + +##### spec + +[`AgentSpec`](#agentspec) + +##### ctx + +[`ExecutorContext`](#executorcontext) + +#### Returns + +[`Executor`](#executor)\<`Out`\> + +*** + +### Restart + +> **Restart** = `"temporary"` \| `"transient"` \| `"permanent"` + +Defined in: [runtime/supervise/types.ts:218](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L218) + +OTP child-spec restart class. + +*** + +### NodeStatus + +> **NodeStatus** = `"pending"` \| `"acquiring"` \| `"running"` \| `"done"` \| `"failed"` \| `"cancelled"` + +Defined in: [runtime/supervise/types.ts:222](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L222) + +`'acquiring'` is first-class (M1): a node spends real time + reaps an orphan box + during sandbox acquire BEFORE it is `running`, so abort must be defined over it. + +*** + +### NodeId + +> **NodeId** = `string` + +Defined in: [runtime/supervise/types.ts:225](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L225) + +Deterministic node id — `${parent}:s${seq}` from the cursor order, never wall-clock. + +*** + +### Settled + +> **Settled**\<`Out`\> = \{ `kind`: `"done"`; `handle`: [`Handle`](#handle-2)\<`Out`\>; `out`: `Out`; `outRef`: `string`; `verdict?`: `DefaultVerdict`; `spent`: [`Spend`](#spend); `seq`: `number`; \} \| \{ `kind`: `"down"`; `handle`: [`Handle`](#handle-2)\<`Out`\>; `reason`: `string`; `infra`: `boolean`; `restartCount`: `number`; `seq`: `number`; \} + +Defined in: [runtime/supervise/types.ts:255](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L255) + +A settled child, delivered by `scope.next()`. `seq` is the monotonic cursor order +`next()` yielded this settlement (B2) — NOT wall-clock — and replay delivers strictly +in `seq` order. `outRef` rehydrates `out` from the `ResultBlobStore` on replay. + +#### Type Parameters + +##### Out + +`Out` + +#### Union Members + +##### Type Literal + +\{ `kind`: `"done"`; `handle`: [`Handle`](#handle-2)\<`Out`\>; `out`: `Out`; `outRef`: `string`; `verdict?`: `DefaultVerdict`; `spent`: [`Spend`](#spend); `seq`: `number`; \} + +*** + +##### Type Literal + +\{ `kind`: `"down"`; `handle`: [`Handle`](#handle-2)\<`Out`\>; `reason`: `string`; `infra`: `boolean`; `restartCount`: `number`; `seq`: `number`; \} + +###### kind + +> **kind**: `"down"` + +###### handle + +> **handle**: [`Handle`](#handle-2)\<`Out`\> + +###### reason + +> **reason**: `string` + +###### infra + +> **infra**: `boolean` + +True = infrastructure failure (excluded from merge `n` / equal-k), not a bad result. + +###### restartCount + +> **restartCount**: `number` + +###### seq + +> **seq**: `number` + +*** + +### SpawnEvent + +> **SpawnEvent** = \{ `kind`: `"spawned"`; `id`: [`NodeId`](#nodeid-1); `parent?`: [`NodeId`](#nodeid-1); `label`: `string`; `budget`: [`Budget`](#budget-8); `runtime`: [`Runtime`](#runtime-2); `seq`: `number`; `at`: `string`; \} \| \{ `kind`: `"settled"`; `id`: [`NodeId`](#nodeid-1); `status`: `"done"` \| `"down"`; `outRef?`: `string`; `verdict?`: `DefaultVerdict`; `spent`: [`Spend`](#spend); `infra?`: `boolean`; `seq`: `number`; `at`: `string`; \} \| \{ `kind`: `"cancelled"`; `id`: [`NodeId`](#nodeid-1); `reason`: `string`; `seq`: `number`; `at`: `string`; \} \| \{ `kind`: `"metered"`; `id`: [`NodeId`](#nodeid-1); `spend`: [`Spend`](#spend); `seq`: `number`; `at`: `string`; \} + +Defined in: [runtime/supervise/types.ts:362](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L362) + +Journaled spawn-tree events (B1/B2). `seq` is the cursor order; `at` is an ISO + timestamp for human inspection only (NOT a replay input). + +#### Union Members + +##### Type Literal + +\{ `kind`: `"spawned"`; `id`: [`NodeId`](#nodeid-1); `parent?`: [`NodeId`](#nodeid-1); `label`: `string`; `budget`: [`Budget`](#budget-8); `runtime`: [`Runtime`](#runtime-2); `seq`: `number`; `at`: `string`; \} + +*** + +##### Type Literal + +\{ `kind`: `"settled"`; `id`: [`NodeId`](#nodeid-1); `status`: `"done"` \| `"down"`; `outRef?`: `string`; `verdict?`: `DefaultVerdict`; `spent`: [`Spend`](#spend); `infra?`: `boolean`; `seq`: `number`; `at`: `string`; \} + +###### kind + +> **kind**: `"settled"` + +###### id + +> **id**: [`NodeId`](#nodeid-1) + +###### status + +> **status**: `"done"` \| `"down"` + +###### outRef? + +> `optional` **outRef?**: `string` + +Content-addressed result pointer; rehydrates `out` from `ResultBlobStore`. + +###### verdict? + +> `optional` **verdict?**: `DefaultVerdict` + +###### spent + +> **spent**: [`Spend`](#spend) + +###### infra? + +> `optional` **infra?**: `boolean` + +###### seq + +> **seq**: `number` + +###### at + +> **at**: `string` + +*** + +##### Type Literal + +\{ `kind`: `"cancelled"`; `id`: [`NodeId`](#nodeid-1); `reason`: `string`; `seq`: `number`; `at`: `string`; \} + +*** + +##### Type Literal + +\{ `kind`: `"metered"`; `id`: [`NodeId`](#nodeid-1); `spend`: [`Spend`](#spend); `seq`: `number`; `at`: `string`; \} + +###### kind + +> **kind**: `"metered"` + +A driver's OWN inference spend, journaled separately from spawned-child work — the journal + TWIN of `BudgetPool.observe`, exactly as `settled` is the twin of `reconcile`. So every + journal-based cost reader sums it automatically — the journal is the single cost ledger. + It carries spend only and is NOT a settlement: replay + `materializeTreeView` skip it for + structure, and its `seq` lives outside the cursor-uniqueness namespace. A + driver re-homes its nested subtree's metered total up to its parent (like settled spend), + so summing any sub-tree root yields that sub-tree's true driver-inference cost. + +###### id + +> **id**: [`NodeId`](#nodeid-1) + +###### spend + +> **spend**: [`Spend`](#spend) + +###### seq + +> **seq**: `number` + +###### at + +> **at**: `string` + +*** + +### SupervisedResult + +> **SupervisedResult**\<`Out`\> = \{ `kind`: `"winner"`; `out`: `Out`; `outRef`: `string`; `verdict?`: `DefaultVerdict`; `tree`: [`TreeView`](#treeview); `spentTotal`: [`Spend`](#spend); `spentBreakdown?`: \{ `driverInference`: [`Spend`](#spend); `childWork`: [`Spend`](#spend); \}; \} \| \{ `kind`: `"no-winner"`; `reason`: `"all-children-down"` \| `"budget-exhausted"` \| `"aborted"`; `tree`: [`TreeView`](#treeview); `downCount`: `number`; \} + +Defined in: [runtime/supervise/types.ts:459](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L459) + +Typed terminal result (M2) — a no-winner is NEVER coerced to a best-effort output. + +#### Type Parameters + +##### Out + +`Out` + +#### Union Members + +##### Type Literal + +\{ `kind`: `"winner"`; `out`: `Out`; `outRef`: `string`; `verdict?`: `DefaultVerdict`; `tree`: [`TreeView`](#treeview); `spentTotal`: [`Spend`](#spend); `spentBreakdown?`: \{ `driverInference`: [`Spend`](#spend); `childWork`: [`Spend`](#spend); \}; \} + +###### kind + +> **kind**: `"winner"` + +###### out + +> **out**: `Out` + +###### outRef + +> **outRef**: `string` + +###### verdict? + +> `optional` **verdict?**: `DefaultVerdict` + +###### tree + +> **tree**: [`TreeView`](#treeview) + +###### spentTotal + +> **spentTotal**: [`Spend`](#spend) + +###### spentBreakdown? + +> `optional` **spentBreakdown?**: `object` + +Where `spentTotal` went: `driverInference` = the drivers' own chat turns (metered via + `Scope.meter`); `childWork` = every spawned child's reconciled spend (the journal sum). + `driverInference + childWork === spentTotal`. Present whenever any driver metered. + +###### spentBreakdown.driverInference + +> **driverInference**: [`Spend`](#spend) + +###### spentBreakdown.childWork + +> **childWork**: [`Spend`](#spend) + +*** + +##### Type Literal + +\{ `kind`: `"no-winner"`; `reason`: `"all-children-down"` \| `"budget-exhausted"` \| `"aborted"`; `tree`: [`TreeView`](#treeview); `downCount`: `number`; \} + +*** + +### RootSignal + +> **RootSignal** = \{ `kind`: `"pause"`; \} \| \{ `kind`: `"resume"`; \} \| \{ `kind`: `"cancel"`; `reason?`: `string`; \} \| \{ `kind`: `"ask"`; `question`: `string`; \} + +Defined in: [runtime/supervise/types.ts:491](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L491) + +Out-of-band message to a running root. Open by intent — a client extends it. + +*** + +### WorktreePatchArtifact + +> **WorktreePatchArtifact** = `WorktreeHarnessResult` + +Defined in: [runtime/supervise/worktree-cli-executor.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L40) + +Terminal artifact of one worktree-CLI run — the canonical worktree-harness result (the captured + diff + the harness's run record + the derived checks). + +*** + +### LoopTraceEvent + +> **LoopTraceEvent** = \{ `kind`: `"loop.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`LoopStartedPayload`](#loopstartedpayload); \} \| \{ `kind`: `"loop.plan"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`LoopPlanPayload`](#loopplanpayload); \} \| \{ `kind`: `"loop.iteration.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`LoopIterationStartedPayload`](#loopiterationstartedpayload); \} \| \{ `kind`: `"loop.iteration.dispatch"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`LoopIterationDispatchPayload`](#loopiterationdispatchpayload); \} \| \{ `kind`: `"loop.iteration.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`LoopIterationEndedPayload`](#loopiterationendedpayload); \} \| \{ `kind`: `"loop.decision"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`LoopDecisionPayload`](#loopdecisionpayload); \} \| \{ `kind`: `"loop.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`LoopEndedPayload`](#loopendedpayload); \} \| \{ `kind`: `"loop.teardown.failed"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`LoopTeardownFailedPayload`](#loopteardownfailedpayload); \} + +Defined in: [runtime/types.ts:326](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L326) + +**`Experimental`** + +*** + +### Shell + +> **Shell** = (`args`, `cwd?`) => `Promise`\<\{ `stdout`: `string`; `stderr`: `string`; `code`: `number`; \}\> + +Defined in: [runtime/workspace.ts:2](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L2) + +Command runner seam. Host code can use `localShell`; sandbox code can wrap `box.exec`. + +#### Parameters + +##### args + +`ReadonlyArray`\<`string`\> + +##### cwd? + +`string` + +#### Returns + +`Promise`\<\{ `stdout`: `string`; `stderr`: `string`; `code`: `number`; \}\> + +*** + +### WorkspaceCommit + +> **WorkspaceCommit** = \{ `ok`: `true`; `rev`: `string`; \} \| \{ `ok`: `false`; `conflict`: `string`; \} + +Defined in: [runtime/workspace.ts:7](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L7) + +## Variables + +### defaultAuditorInstruction + +> `const` **defaultAuditorInstruction**: `string` + +Defined in: [runtime/audit-intent.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L65) + +*** + +### defaultAnalystInstruction + +> `const` **defaultAnalystInstruction**: `string` + +Defined in: [runtime/observe.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L57) + +The default observer instruction — exported so an optimizer can seed its population. + +*** + +### assertTraceDerivedFindings + +> `const` **assertTraceDerivedFindings**: [`AssertTraceDerivedFindings`](#asserttracederivedfindings-1) + +Defined in: [runtime/personify/analyst.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L46) + +*** + +### builtinShapes + +> `const` **builtinShapes**: [`ShapeRegistry`](#shaperegistry) + +Defined in: [runtime/personify/registry.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/registry.ts#L49) + +The default registry `runPersonified` resolves a shape name against. Empty by construction — + a caller registers its own composed shapes; the engine ships no domain shape. + +*** + +### strategyAuthorContract + +> `const` **strategyAuthorContract**: "\nYou author an OPTIMIZATION STRATEGY for an agentic loop system. A strategy decides how to\nspend a compute budget to beat a task's deployable check. You compose exactly two steps:\n\n shot(spec?: \{ handle?, messages?, steer?, persona?, tools? \}): Promise\\n Runs ONE worker attempt (a bounded tool loop) over an artifact.\n - omit handle =\> the shot opens its OWN fresh artifact and closes it after (a sample).\n - pass handle =\> the shot CONTINUES that artifact (state accumulates across shots).\n - messages =\> the carried conversation (pass the previous ShotResult.messages to continue).\n - steer =\> a corrective instruction injected before the shot.\n - persona =\> \{ systemPrompt?, model? \} — give THIS shot its own role and/or model\n (multi-agent strategies: a researcher shot then an engineer shot, a panel of k\n personas over one budget). On a fresh shot the systemPrompt replaces the task's; on\n a carried conversation it arrives as a hand-off message. Same conserved budget.\n - tools =\> string\[\] — restrict THIS shot to a subset of the task's tools by\n name (focus an explore shot on read-only tools, an execute shot on write tools).\n Restriction-only; unknown names make the shot fail. ALWAYS select from\n await listTools(handle) — never hardcode. Omitted =\> the shot sees every tool.\n ShotResult = \{ messages, score (0..1 on the task's check), passes, total, completions, toolErrors \}\n Returns null if the attempt failed infra-wise.\n\n critique(messages): Promise\\n A firewalled trace-analyst reads the attempt's trajectory and returns ONE corrective\n instruction (or null when it judges the work complete). Costs ~1 completion.\n\n consult(messages, instruction): Promise\\n The RAW analyst channel: the same firewalled critic answers YOUR instruction over the\n trajectory verbatim (no reformatting) — use it when you need a specific reply format\n (a decision, a prediction). Costs ~1 completion.\n\n surface.open(task) / surface.close(handle)\n Open a persistent artifact you manage yourself (remember to close in a finally).\n close is idempotent — closing an already-closed handle is a safe no-op.\n\n listTools(handle): Promise\\>\n The tools THIS task actually offers. TOOL SETS VARY PER TASK — if you restrict a\n shot with \`tools\`, you MUST pick names from await listTools(handle); hardcoding\n names from an example kills your shots on every task whose tools differ.\n\nRules:\n- ALWAYS await every shot/critique/surface call — a floating promise that rejects\n crashes the whole benchmark run.\n- Stay within ~budget total shots; every shot/critique spends from a conserved pool.\n- For a FRESH attempt OMIT \`messages\` entirely (never pass \`\[\]\` — an empty array is a\n fresh conversation too, but be explicit). To CONTINUE, pass the previous\n ShotResult.messages unchanged.\n- Return \{ score, resolved, completions, progression, shots \} — score = the BEST checkpoint\n you reached (keep-best, never final-state), progression = score after each shot.\n- The module must be EXACTLY this shape (no other imports, no commentary outside code):\n\nimport \{ defineStrategy \} from '@tangle-network/agent-runtime/loops'\nexport default defineStrategy('your-strategy-name', async (\{ surface, task, budget, shot, critique, listTools \}) =\> \{\n // your composition (listTools comes from the destructured context — it is NOT a global)\n\})\n" + +Defined in: [runtime/strategy-author.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L21) + +The compressed consumable a skill carries: everything an author needs to emit a loop. + +*** + +### sample + +> `const` **sample**: [`Strategy`](#strategy-3) + +Defined in: [runtime/strategy.ts:662](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L662) + +*** + +### refine + +> `const` **refine**: [`Strategy`](#strategy-3) + +Defined in: [runtime/strategy.ts:666](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L666) + +*** + +### adaptiveRefine + +> `const` **adaptiveRefine**: [`Strategy`](#strategy-3) + +Defined in: [runtime/strategy.ts:866](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L866) + +A NEW strategy, authored from the steps (~20 lines): refine, but when a steered shot + fails to improve the score it ABANDONS that line and restarts fresh (branch-when-stuck) + — the widen/MCTS idea the depth-stuck failure motivated. Scored keep-best (the best + checkpoint across all lines), the deployable metric. This is the "experts build BETTER + optimizations" path: a new technique, compact, with zero Supervisor ceremony. + +*** + +### sampleThenRefine + +> `const` **sampleThenRefine**: [`Strategy`](#strategy-3) + +Defined in: [runtime/strategy.ts:909](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L909) + +The explore-then-exploit MIX: spend ⌈budget/2⌉ on independent samples (kept open), + then refine the best-verifying line with the remaining budget. Sample's basin escape + + refine's accumulation — the third built-in, authored from the public steps. + +*** + +### driverRuntime + +> `const` **driverRuntime**: `"driver"` + +Defined in: [runtime/supervise/driver-executor.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/driver-executor.ts#L57) + +The runtime tag the registry maps a driver child to. + +*** + +### driverExecutorFactory + +> `const` **driverExecutorFactory**: [`ExecutorFactory`](#executorfactory)\<`unknown`\> + +Defined in: [runtime/supervise/driver-executor.ts:125](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/driver-executor.ts#L125) + +The recursive driver-executor factory. `withDriverExecutor` routes a child marked +`role: 'driver'` here; any other child resolves to a leaf built-in. On `execute`, it +reads the `nested-scope` seam the SCOPE seeded, mounts a nested `Scope` one `depth` +deeper over the shared pool/journal/blobs/registry, runs the driver +`Agent.act(task, nestedScope)`, and reports the conserved spend summed off the nested +tree's settled events — so the parent scope's reconcile rolls the whole sub-tree's spend +into the conserved total. + +A `down` from the nested driver (a thrown `act` or an aborted scope) propagates as a +thrown executor, which the parent scope types into a `down` settlement — the same +fail-loud-into-typed-down discipline a leaf gets. + +*** + +### cliWorktreeExecutor + +> `const` **cliWorktreeExecutor**: [`ExecutorFactory`](#executorfactory)\<`unknown`\> + +Defined in: [runtime/supervise/runtime.ts:1096](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L1096) + +The leaf `createWorktreeCliExecutor` as a backend-as-data factory: a supervisor-authored +`AgentProfile` driving claude / codex / opencode on its own worktree. `budgetExempt` like +the other CLI leaves; the authored systemPrompt + model reach the harness via §1.5. + +*** + +### nestedScopeSeamKey + +> `const` **nestedScopeSeamKey**: `"nested-scope"` = `'nested-scope'` + +Defined in: [runtime/supervise/scope.ts:140](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/scope.ts#L140) + +The recursion seam key. A `Scope` seeds a value of this on each child's +`ExecutorContext.seams` so a child whose executor is a DRIVER can mount a NESTED `Scope` +over the SAME conserved pool at `depth+1`. A leaf executor never reads it. Single-sourced +here so the scope and the driver-executor agree on the seam without a circular import. + +*** + +### decodeOpencodePart + +> `const` **decodeOpencodePart**: [`ToolPartDecoder`](#toolpartdecoder) + +Defined in: [runtime/supervise/trace-source.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L72) + +opencode parts ARE agent-interface's canonical `ToolPart` (`{ type:'tool', tool, callID?, + state: ToolState }`) — the shape every adc sdk-provider normalizes its harness output into. We + decode against that published type (single source of truth) rather than a re-derived shape; the + `ToolState` union drives the status mapping, so a status that adc adds/renames is a compile error + here, not a silent miss. The same call streams pending→running→terminal; only a terminal state + (`completed` / `error` / `failed`) is a finished call. + +*** + +### decodeAnthropicPart + +> `const` **decodeAnthropicPart**: [`ToolPartDecoder`](#toolpartdecoder) + +Defined in: [runtime/supervise/trace-source.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L91) + +Anthropic / claude-code (also kimi's tool_use variant): a `{ type:'tool_use', id|tool_use_id, + name|tool, input }` content block. CONFIRMED against the cli-bridge's authoritative parsers + (claude.ts reads `block.type==='tool_use', block.id, block.name, block.input`; kimi.ts adds the + `tool_use_id`/`tool` fallbacks) — the canonical readers of these harnesses' real native output. + +*** + +### decodeOpenAiPart + +> `const` **decodeOpenAiPart**: [`ToolPartDecoder`](#toolpartdecoder) + +Defined in: [runtime/supervise/trace-source.ts:109](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L109) + +OpenAI-compatible (router / kimi's top-level form / glm): `{ type:'function'|'tool_call', id, + function:{ name, arguments: } }`. CONFIRMED against the cli-bridge (kimi.ts surfaces + kimi's top-level `tool_calls:[{type:'function', id, function:{name,arguments}}]` exactly this way). + NOTE: codex does NOT emit structured tool calls (the bridge's codex.ts never yields `tool_calls` — + it runs shell internally and surfaces only text), so per-tool detection is unavailable for codex + from any path — a harness property, not a decoder gap. + +*** + +### toolPartDecoders + +> `const` **toolPartDecoders**: `Record`\<`string`, [`ToolPartDecoder`](#toolpartdecoder)\> + +Defined in: [runtime/supervise/trace-source.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L126) + +The harness → decoder registry. Add a harness by adding one entry. + +## Functions + +### contentAddress() + +> **contentAddress**(`artifact`): `string` + +Defined in: [durable/spawn-journal.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L48) + +Mint the content-addressed `outRef` for a result artifact: `sha256:` over a +stable JSON encoding. Producers call this to derive the `outRef` they journal and +`put`; the FS/in-mem stores re-derive it on `put` to verify the supplied ref +matches (fail loud on a mismatch — a forged ref breaks the replay invariant). + +Stable encoding: object keys are sorted recursively so two structurally-equal +artifacts hash identically regardless of key insertion order. + +#### Parameters + +##### artifact + +`unknown` + +#### Returns + +`string` + +*** + +### replaySpawnTree() + +> **replaySpawnTree**(`journal`, `blobs`, `root`): `Promise`\<[`Settled`](#settled-2)\<`unknown`\>[]\> + +Defined in: [durable/spawn-journal.ts:301](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L301) + +Re-feed a journaled spawn tree in strict `seq` order, rehydrating each settled +child's `out` from the blob store by `outRef`, and return the `Settled[]` exactly +as `scope.next()` originally delivered them. + +Determinism (B2): the events are sorted by `seq` BEFORE any blob `get`, so the +replay order is the recorded cursor order regardless of how fast each rehydration +resolves. `at` (wall-clock) is never a replay input. Fail loud on a tree that was +never begun, a settled-done event missing its `outRef`, or a blob the store can't +rehydrate — a silent gap would let `act` branch on the wrong evidence. + +#### Parameters + +##### journal + +[`SpawnJournal`](#spawnjournal) + +##### blobs + +[`ResultBlobStore`](#resultblobstore) + +##### root + +`string` + +#### Returns + +`Promise`\<[`Settled`](#settled-2)\<`unknown`\>[]\> + +*** + +### materializeTreeView() + +> **materializeTreeView**(`events`): [`TreeView`](#treeview) + +Defined in: [durable/spawn-journal.ts:383](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L383) + +Materialize the live tree (`TreeView`) from a journaled event list for resume. Folds +`spawned`/`settled`/`cancelled` into a per-node snapshot in `seq` order, then adds each +`metered` event's driver-inference spend onto its node in a separate additive pass — so the +resumed view matches what `scope.view` showed at the recorded cursor position. + +#### Parameters + +##### events + +[`SpawnEvent`](#spawnevent)[] + +#### Returns + +[`TreeView`](#treeview) + +*** + +### anytimeReport() + +> **anytimeReport**(`spans`, `opts?`): [`AnytimeReport`](#anytimereport) + +Defined in: [runtime/anytime.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L73) + +Derive anytime metrics from waterfall spans. `targets` are the satisficing score + bars (default [1] = fully resolved; COCO-style multi-target: [0.5, 0.8, 1]); + `targetFor` overrides the bar per task (task-specific satisfaction) — when set, the + per-task bar replaces every entry of `targets` for that task. + +#### Parameters + +##### spans + +[`WaterfallSpan`](#waterfallspan)[] + +##### opts? + +###### targets? + +`number`[] + +###### targetFor? + +(`taskId`) => `number` + +#### Returns + +[`AnytimeReport`](#anytimereport) + +*** + +### renderAnytimeTable() + +> **renderAnytimeTable**(`report`): `string` + +Defined in: [runtime/anytime.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L164) + +One row per (strategy, satisficing target): the shareable time-to-satisfactory table. + +#### Parameters + +##### report + +[`AnytimeReport`](#anytimereport) + +#### Returns + +`string` + +*** + +### auditIntent() + +> **auditIntent**(`input`, `opts`): `Promise`\<[`IntentAudit`](#intentaudit)\> + +Defined in: [runtime/audit-intent.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L108) + +#### Parameters + +##### input + +[`AuditIntentInput`](#auditintentinput) + +##### opts + +[`AuditIntentOptions`](#auditintentoptions) + +#### Returns + +`Promise`\<[`IntentAudit`](#intentaudit)\> + +*** + +### completionAuthorizes() + +> **completionAuthorizes**(`v`, `policy?`): `boolean` + +Defined in: [runtime/completion.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L62) + +#### Parameters + +##### v + +[`CompletionVerdict`](#completionverdict) + +##### policy? + +[`CompletionPolicy`](#completionpolicy) + +#### Returns + +`boolean` + +*** + +### stopSentinel() + +> **stopSentinel**(`seed`): `string` + +Defined in: [runtime/completion.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L73) + +A unique, attributable stop sentinel for a node (ralph-loop style). Deterministic from the +seed (no Math.random — reproducible + attributable to the node); the agent is instructed to +emit it VERBATIM when it judges itself done. Unguessable enough that content never trips it. + +#### Parameters + +##### seed + +`string` + +#### Returns + +`string` + +*** + +### sentinelCompletion() + +> **sentinelCompletion**\<`Task`\>(`sentinel`, `opts?`): [`CompletionAnalyst`](#completionanalyst)\<`Task`, `string`\> + +Defined in: [runtime/completion.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L86) + +Completion for a sandbox-agent node: done iff the latest output carries the node's stop +sentinel. PROBABILISTIC (the agent's own self-judgment) — the driver validates it. + +#### Type Parameters + +##### Task + +`Task` + +#### Parameters + +##### sentinel + +`string` + +##### opts? + +###### confidence? + +`number` + +#### Returns + +[`CompletionAnalyst`](#completionanalyst)\<`Task`, `string`\> + +*** + +### deterministicCompletion() + +> **deterministicCompletion**\<`Task`, `Output`\>(`check`): [`CompletionAnalyst`](#completionanalyst)\<`Task`, `Output`\> + +Defined in: [runtime/completion.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L111) + +Completion for a DETERMINISTIC check (build/test/lint/citation/proof): done iff the check +passes. Ground truth — the driver ends directly, no validation. The check reads the output +(a verifier), never the judge verdict — selector ≠ judge stays intact. + +#### Type Parameters + +##### Task + +`Task` + +##### Output + +`Output` + +#### Parameters + +##### check + +(`output`, `history`) => `object` + +#### Returns + +[`CompletionAnalyst`](#completionanalyst)\<`Task`, `Output`\> + +*** + +### harvestCorpus() + +> **harvestCorpus**(`opts`): `Promise`\<[`HarvestReport`](#harvestreport)\> + +Defined in: [runtime/harvest-corpus.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L62) + +#### Parameters + +##### opts + +[`HarvestCorpusOptions`](#harvestcorpusoptions) + +#### Returns + +`Promise`\<[`HarvestReport`](#harvestreport)\> + +*** + +### inlineSandboxClient() + +> **inlineSandboxClient**(`factory`): [`SandboxClient`](#sandboxclient-2) + +Defined in: [runtime/inline-sandbox-client.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/inline-sandbox-client.ts#L44) + +Adapt an `ExecutorFactory` into a `SandboxClient` for `runLoop`. The factory is +instantiated fresh per `streamPrompt` (mirrors the per-spawn executor lifecycle): +run once on the prompt, emit the terminal result event, tear down. + +#### Parameters + +##### factory + +[`ExecutorFactory`](#executorfactory)\<`unknown`\> + +#### Returns + +[`SandboxClient`](#sandboxclient-2) + +*** + +### loopDispatch() + +> **loopDispatch**\<`Task`, `Output`, `Decision`, `TScenario`, `TArtifact`\>(`opts`): `ProfileDispatchFn`\<`TScenario`, `TArtifact`\> + +Defined in: [runtime/loop-dispatch.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L114) + +Adapter for `runProfileMatrix` (profile is an axis). Returns a +`ProfileDispatchFn` that runs `runLoop` per (profile, scenario) cell and +reports usage automatically. + +#### Type Parameters + +##### Task + +`Task` + +##### Output + +`Output` + +##### Decision + +`Decision` + +##### TScenario + +`TScenario` *extends* `Scenario` + +##### TArtifact + +`TArtifact` + +#### Parameters + +##### opts + +[`LoopDispatchOptions`](#loopdispatchoptions)\<`Task`, `Output`, `Decision`, `TScenario`, `TArtifact`\> + +#### Returns + +`ProfileDispatchFn`\<`TScenario`, `TArtifact`\> + +*** + +### createMcpEnvironment() + +> **createMcpEnvironment**(`opts`): [`AgenticSurface`](#agenticsurface) + +Defined in: [runtime/mcp-environment.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L94) + +#### Parameters + +##### opts + +[`McpEnvironmentOptions`](#mcpenvironmentoptions) + +#### Returns + +[`AgenticSurface`](#agenticsurface) + +*** + +### observe() + +> **observe**(`input`, `opts`): `Promise`\<[`Observation`](#observation)\> + +Defined in: [runtime/observe.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L139) + +#### Parameters + +##### input + +[`ObserveInput`](#observeinput) + +##### opts + +[`ObserveOptions`](#observeoptions) + +#### Returns + +`Promise`\<[`Observation`](#observation)\> + +*** + +### renderReport() + +> **renderReport**(`findings`): `string` + +Defined in: [runtime/observe.ts:226](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L226) + +Operator-facing report, split by who should act. The agent block is the + steer; the operator block is the advice. + +#### Parameters + +##### findings + +readonly `AnalystFinding`[] + +#### Returns + +`string` + +*** + +### createScopeAnalyst() + +> **createScopeAnalyst**\<`D`\>(`scope`, `options`): [`ScopeAnalyst`](#scopeanalyst)\<`D`\> + +Defined in: [runtime/personify/analyst.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L96) + +Build a `ScopeAnalyst` that spawns the analyst agent through `Scope.spawn` (so its compute is +metered by the conserved pool), drains its single settlement, and enforces the trace-derived +firewall before returning. The `scope` is the SAME scope the combinator is draining its children +from — the analyst is spawned as a sibling and its result is read off `scope.next()` in cursor +order, replay-safe like any other child. + +Fail loud (no silent empty findings): + - the pool refuses the analyst spawn → `AnalystError` (the steer would otherwise run on nothing) + - the analyst settles `down` → `AnalystError` (a broken capture path, not a verdict) + - the analyst returns a non-array → `PlannerError` + - any finding cites judge-derived metric evidence → `PlannerError` via the firewall + +#### Type Parameters + +##### D + +`D` + +#### Parameters + +##### scope + +[`Scope`](#scope-1)\<[`Outcome`](#outcome-1)\<`D`\>\> + +##### options + +[`CreateScopeAnalystOptions`](#createscopeanalystoptions)\<`D`\> + +#### Returns + +[`ScopeAnalyst`](#scopeanalyst)\<`D`\> + +*** + +### registryScopeAnalyst() + +> **registryScopeAnalyst**\<`D`\>(`registry`, `buildInputs`): [`ScopeAnalyst`](#scopeanalyst)\<`D`\> + +Defined in: [runtime/personify/analyst.ts:202](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L202) + +A `ScopeAnalyst` backed by an `AnalystRegistry` — the panel-of-analysts seam. The registry merges +N analyst KINDS into one `AnalystRunResult.findings`; `analyze` runs it over the caller-projected +`{ runId, inputs }` and pipes the merged findings through the SAME `assertTraceDerivedFindings` +firewall `createScopeAnalyst` uses (single-sourced selector≠judge). Distinct from `panel()` +(judges-vs-one-artifact) — this is analysts-over-a-trace, the diagnosis side of the wire. + +Fail loud: a registry that throws propagates; a judge-derived finding aborts via the firewall. +The projection is the caller's (`buildInputs`) — if the scope settlements do not cleanly map to +the registry's `AnalystRunInputs`, that is a caller-side contract gap, surfaced there, not papered +over with a fabricated input here. + +#### Type Parameters + +##### D + +`D` + +#### Parameters + +##### registry + +[`AnalystRegistryLike`](analyst-loop.md#analystregistrylike) + +##### buildInputs + +(`input`) => [`RegistryAnalyzeProjection`](#registryanalyzeprojection) + +#### Returns + +[`ScopeAnalyst`](#scopeanalyst)\<`D`\> + +*** + +### buildSteerContext() + +> **buildSteerContext**\<`D`\>(`findings`, `settledSoFar`): [`SteerContext`](#steercontext)\<`D`\> + +Defined in: [runtime/personify/analyst.ts:230](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L230) + +Build the `SteerContext` a combinator reads to steer (its `loopUntil.until`, `widen` gate, any +future steer). One place enforces the firewall: `findings` is asserted trace-derived before it is +surfaced, and `lastValidScore` is provided for OBSERVABILITY only — a combinator that steers off +it re-introduces selector = judge, the coupling the architecture forbids. + +`findings` is re-asserted here even when it came from `createScopeAnalyst` (which already asserted +it): the assertion is cheap and idempotent, and a `SteerContext` may be built from findings that +arrived by another path (a caller-supplied diagnosis). Belt-and-suspenders on the one coupling +that must never leak. + +#### Type Parameters + +##### D + +`D` + +#### Parameters + +##### findings + +readonly `AnalystFinding`[] + +##### settledSoFar + +readonly [`Settled`](#settled-2)\<[`Outcome`](#outcome-1)\<`D`\>\>[] + +#### Returns + +[`SteerContext`](#steercontext)\<`D`\> + +*** + +### selectValidWinner() + +> **selectValidWinner**\<`D`\>(`opts?`): [`FanoutWinnerSelector`](#fanoutwinnerselector)\<`D`\> + +Defined in: [runtime/personify/combinators.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/combinators.ts#L58) + +The single content-free valid-only winner selector. Among the gated-VALID children only +(`verdict.valid === true`), pick by `strategy` — best score / smallest delivered artifact / +earliest — ties broken by earliest index; returns `undefined` when NONE is valid (an ungated +output can never win — the deliverable gate is the point). `sizeOf` (for `'smallest-artifact'`) +reads the child's settled deliverable — the raw value a leaf settles, or the unwrapped `Outcome` +a delegate path produces; a domain passes e.g. patch diff-lines. This is the de-duplicated home of +the selection logic previously copied per role. + +#### Type Parameters + +##### D + +`D` + +#### Parameters + +##### opts? + +###### strategy? + +[`WinnerStrategy`](#winnerstrategy) + +###### sizeOf? + +(`deliverable`) => `number` + +#### Returns + +[`FanoutWinnerSelector`](#fanoutwinnerselector)\<`D`\> + +*** + +### pipeline() + +> **pipeline**\<`Task`, `D`\>(`stages`): [`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +Defined in: [runtime/personify/combinators.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/combinators.ts#L100) + +`pipeline(stages)` — run the stages in order, feeding each stage's `done` deliverable into the +next stage's task. The first stage that ends `blocked` (a child that went down, a child the +pool would not admit, or a stage whose `collect` chose to block) short-circuits — its blockers +ARE the pipeline's blockers, never coerced past a failed stage. The terminal stage's `done` +deliverable is the pipeline's deliverable. + +#### Type Parameters + +##### Task + +`Task` + +##### D + +`D` + +#### Parameters + +##### stages + +readonly [`PipelineStage`](#pipelinestage)\<`Task`, `unknown`, `unknown`\>[] + +#### Returns + +[`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +*** + +### fanout() + +> **fanout**\<`Task`, `Item`, `D`\>(`items`, `opts`): [`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +Defined in: [runtime/personify/combinators.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/combinators.ts#L138) + +`fanout(items, opts)` — spawn one child per item in a single round (bounded by the conserved +pool's fail-closed admission), drain via `scope.next()`, then either synthesize over the +gathered settlements (one SEPARATE synthesis child) or return the best-valid child via the +single-sourced selector. A round that admitted zero children, or whose synthesis child could +not be admitted, is a concrete blocker. + +#### Type Parameters + +##### Task + +`Task` + +##### Item + +`Item` + +##### D + +`D` + +#### Parameters + +##### items + +readonly `Item`[] + +##### opts + +[`FanoutOptions`](#fanoutoptions)\<`Item`, `D`\> + +#### Returns + +[`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +*** + +### loopUntil() + +> **loopUntil**\<`Task`, `State`, `D`\>(`seed`, `spec`): [`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +Defined in: [runtime/personify/combinators.ts:221](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/combinators.ts#L221) + +`loopUntil(seed, spec)` — one `step` child per round; `fold` accumulates each settlement into +the running state; `until` (reading the round's trace findings, NOT a fresh raw verdict) is +the deployable stop. The conserved pool IS the loop bound: once `spawn` fails closed the loop +stops. A loop that exhausted the pool without `until` ever satisfying is a concrete blocker. + +When `ctx.analyst` is set, each round runs it over the children settled so far and steers +`until` on the resulting trace-derived findings (the analyst spawns into THIS scope, so its +compute is conserved-pooled — equal-k holds by construction). Absent an analyst the findings +argument is the empty array — never a fabricated finding (fail-loud honesty over a silent default). + +#### Type Parameters + +##### Task + +`Task` + +##### State + +`State` + +##### D + +`D` + +#### Parameters + +##### seed + +`State` + +##### spec + +[`LoopUntilSpec`](#loopuntilspec)\<`Task`, `State`, `D`\> + +#### Returns + +[`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +*** + +### panel() + +> **panel**\<`Task`, `Artifact`, `D`\>(`spec`): [`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +Defined in: [runtime/personify/combinators.ts:273](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/combinators.ts#L273) + +`panel(spec)` — spawn the M judge children over the SAME artifact, drain their settlements, +and fold them into a panel verdict via the pure WRITE-ONLY `merge` (a judge's output never +reaches another judge's task; the merge never spawns or re-ranks). A `down` judge carries no +verdict and is excluded from the merge denominator. A panel that admitted no judge is a +concrete blocker before `merge` is consulted. + +#### Type Parameters + +##### Task + +`Task` + +##### Artifact + +`Artifact` + +##### D + +`D` + +#### Parameters + +##### spec + +[`PanelSpec`](#panelspec)\<`Artifact`, `D`\> + +#### Returns + +[`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +*** + +### verify() + +> **verify**\<`Task`, `Candidate`, `D`\>(`spec`): [`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +Defined in: [runtime/personify/combinators.ts:333](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/combinators.ts#L333) + +`verify(spec)` — an IMPLEMENT child produces a candidate, then a SEPARATE VERIFIER child grades +it; only a `valid` verifier verdict ships. Any other outcome (implement down, verifier down, +verifier verdict absent or not `valid`) is a concrete blocker carrying the failure verbatim — +never a coerced "done". The implement child does not grade itself. + +#### Type Parameters + +##### Task + +`Task` + +##### Candidate + +`Candidate` + +##### D + +`D` + +#### Parameters + +##### spec + +[`VerifySpec`](#verifyspec)\<`Task`, `Candidate`, `D`\> + +#### Returns + +[`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +*** + +### widen() + +> **widen**\<`Task`, `Seed`, `D`\>(`spec`): [`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +Defined in: [runtime/personify/combinators.ts:387](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/combinators.ts#L387) + +`widen(spec)` — the streaming spawn-on-completion driver. Spawns the seed lineages, then REACTS +to each `scope.next()`: on every settled child it consults `spec.gate.decide` and, when the gate +returns `widen`, spawns AT MOST ONE more child toward the chosen lineage under the remaining +conserved pool. `promising` is derived from the round's trace findings (the analyst seam), +never a child's raw `verdict` — and the default gate (`flatWidenGate`) never widens, so the R2 +firewall stays dormant. Terminal selection is `spec.synthesize` over every settled lineage. + +When `ctx.analyst` is set, `decide` is consulted with that round's trace-derived findings; +absent an analyst the findings argument is the empty array a flat gate ignores. The analyst +spawns into THIS scope (conserved-pooled, so equal-k holds). Streaming caveat: a wired analyst +drains its own child off the SHARED cursor by id-match, so on a NON-flat gate (which spawns +widen children that are live concurrently) the analyst can consume a sibling's settlement before +the widen loop sees it. The shipped default (`flatWidenGate`) never widens, so no widen child is +ever live when the analyst runs and the wire is exact; a non-flat gate must drive the analyst on +a scope whose siblings are quiesced, or read findings without the shared-cursor drain. + +#### Type Parameters + +##### Task + +`Task` + +##### Seed + +`Seed` + +##### D + +`D` + +#### Parameters + +##### spec + +[`WidenSpec`](#widenspec)\<`Seed`, `D`\> + +#### Returns + +[`CombinatorShape`](#combinatorshape)\<`Task`, `D`\> + +*** + +### flatWidenGate() + +> **flatWidenGate**\<`D`\>(): [`ScopeWidenGate`](#scopewidengate)\<`D`\> + +Defined in: [runtime/personify/combinators.ts:450](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/combinators.ts#L450) + +The flat default `ScopeWidenGate` — never widens, keeping the R2 selector≠judge collision +dormant. A gate run passes this explicitly; a test asserts the default is flat. + +#### Type Parameters + +##### D + +`D` + +#### Returns + +[`ScopeWidenGate`](#scopewidengate)\<`D`\> + +*** + +### renderCorpusToInstructions() + +> **renderCorpusToInstructions**(`opts`): `Promise`\<`AgentProfile`\> + +Defined in: [runtime/personify/corpus.ts:301](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/corpus.ts#L301) + +The learning-flywheel READ side. Queries the corpus through `filter`, renders the matching facts +(most-confident first, capped by `maxLines`) into instruction lines, and returns a FRESH +`AgentProfile` with them merged in — never mutates the input profile. Default `target: 'prompt'` +appends the lines to `prompt.instructions[]` (the additive append-line seam); `target: +'resources'` folds them into the single-blob `resources.instructions` string (preserving any +existing blob, but failing loud on a non-string existing blob — a `resources.instructions` that +was already an `AgentProfileResourceRef` cannot be string-appended without dropping it). + +An empty query result returns a fresh COPY of the profile with no instruction change (a valid +"nothing learned yet" read, not an error). + +#### Parameters + +##### opts + +[`RenderCorpusToInstructionsOptions`](#rendercorpustoinstructionsoptions) + +#### Returns + +`Promise`\<`AgentProfile`\> + +*** + +### definePersona() + +> **definePersona**\<`D`\>(`input`): [`Persona`](#persona)\<`D`\> + +Defined in: [runtime/personify/persona.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/persona.ts#L56) + +Build a frozen `Persona`. Fails loud on the executors-supplied invariant: a persona with +neither a pre-built registry nor a seam bag cannot resolve its built-in runtimes, so it is +unrunnable — refuse it at definition time, not at the first spawn. Pure; no I/O. + +#### Type Parameters + +##### D + +`D` = `unknown` + +#### Parameters + +##### input + +[`DefinePersonaInput`](#definepersonainput)\<`D`\> + +#### Returns + +[`Persona`](#persona)\<`D`\> + +*** + +### runPersonified() + +> **runPersonified**\<`Task`, `D`\>(`options`): `Promise`\<[`SupervisedResult`](#supervisedresult)\<[`Outcome`](#outcome-1)\<`D`\>\>\> + +Defined in: [runtime/personify/persona.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/persona.ts#L131) + +Compose the persona + chosen shape onto a fresh keystone `Supervisor`. Resolves the shape +(a factory verbatim, or a registered name through `builtinShapes`), applies it to a +`ShapeContext`, and runs the resulting root `Agent` to a typed `SupervisedResult`. +Fail loud on an unknown shape name or an unresolvable persona registry — never a silent +default-shape fallback. + +#### Type Parameters + +##### Task + +`Task` + +##### D + +`D` + +#### Parameters + +##### options + +[`RunPersonifiedOptions`](#runpersonifiedoptions)\<`Task`, `D`\> + +#### Returns + +`Promise`\<[`SupervisedResult`](#supervisedresult)\<[`Outcome`](#outcome-1)\<`D`\>\>\> + +*** + +### createShapeRegistry() + +> **createShapeRegistry**(): [`ShapeRegistry`](#shaperegistry) + +Defined in: [runtime/personify/registry.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/registry.ts#L25) + +Build a fresh open `ShapeRegistry`. A factory is stored type-erased and re-cast on resolve — the +caller asserts the `` it expects, exactly as the executor registry stores its factories. + +#### Returns + +[`ShapeRegistry`](#shaperegistry) + +*** + +### registerShape() + +> **registerShape**\<`Task`, `D`\>(`name`, `factory`): `void` + +Defined in: [runtime/personify/registry.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/registry.ts#L53) + +Register a composed shape on the default `builtinShapes` registry — the one-call extension + point a caller invokes so its shape is resolvable by name with zero edits to the engine. + +#### Type Parameters + +##### Task + +`Task` + +##### D + +`D` + +#### Parameters + +##### name + +`string` + +##### factory + +[`LoopShape`](#loopshape)\<`Task`, `D`\> + +#### Returns + +`void` + +*** + +### trajectoryReport() + +> **trajectoryReport**(`journal`, `blobs`, `root`, `options?`): `Promise`\<[`TrajectoryReport`](#trajectoryreport-3)\> + +Defined in: [runtime/personify/trajectory.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/trajectory.ts#L52) + +Reconstruct the whole spawn tree for `root` with per-node + rolled-up `Spend`. Reads the +journal for structure + spend and, when `withOutputs`, the blob store for each `done` +node's artifact. Fail loud on a tree that was never journaled, a settle/cancel for an +un-spawned node (a corrupted log), or — under `withOutputs` — a `done` node whose blob the +store cannot rehydrate (a silent gap would mis-cost or mis-evidence the tree). + +#### Parameters + +##### journal + +[`SpawnJournal`](#spawnjournal) + +##### blobs + +[`ResultBlobStore`](#resultblobstore) + +##### root + +`string` + +##### options? + +[`TrajectoryReportOptions`](#trajectoryreportoptions) = `{}` + +#### Returns + +`Promise`\<[`TrajectoryReport`](#trajectoryreport-3)\> + +*** + +### equalKOnCost() + +> **equalKOnCost**(`arms`, `options?`): [`EqualKVerdict`](#equalkverdict) + +Defined in: [runtime/personify/trajectory.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/trajectory.ts#L143) + +Assert the arms are comparable at EQUAL conserved COST (tokens + usd), NOT raw iteration +count. Compares each arm's root-rolled-up `total` on the two conserved channels: an arm is +within-tolerance when the per-channel spread (max − min across arms) over the median is +`≤ tolerance`. Pure over the reports — no I/O. Fails loud on an empty arm list (nothing to +compare) so a vacuous "equal" is never returned. + +#### Parameters + +##### arms + +readonly [`EqualKArm`](#equalkarm)[] + +##### options? + +[`EqualKOnCostOptions`](#equalkoncostoptions) = `{}` + +#### Returns + +[`EqualKVerdict`](#equalkverdict) + +*** + +### promotionGate() + +> **promotionGate**(`opts`): [`PromotionVerdict`](#promotionverdict) + +Defined in: [runtime/promotion-gate.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L63) + +#### Parameters + +##### opts + +[`PromotionGateOptions`](#promotiongateoptions) + +#### Returns + +[`PromotionVerdict`](#promotionverdict) + +*** + +### reportLoopUsage() + +> **reportLoopUsage**\<`Task`, `Output`, `Decision`\>(`cost`, `result`, `source?`): `void` + +Defined in: [runtime/report-usage.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/report-usage.ts#L34) + +Forward a `LoopResult`'s aggregated cost + token usage into a campaign cost +meter so the backend-integrity guard sees real LLM activity. `source` +defaults to `'loop'`. + +#### Type Parameters + +##### Task + +`Task` + +##### Output + +`Output` + +##### Decision + +`Decision` + +#### Parameters + +##### cost + +[`UsageSink`](#usagesink) + +##### result + +`Pick`\<[`LoopResult`](#loopresult)\<`Task`, `Output`, `Decision`\>, `"costUsd"` \| `"tokenUsage"`\> + +##### source? + +`string` = `'loop'` + +#### Returns + +`void` + +*** + +### routerChatWithUsage() + +> **routerChatWithUsage**(`cfg`, `messages`, `opts?`): `Promise`\<[`RouterChatResult`](#routerchatresult)\> + +Defined in: [runtime/router-client.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L29) + +#### Parameters + +##### cfg + +[`RouterConfig`](#routerconfig) + +##### messages + +`object`[] + +##### opts? + +###### temperature? + +`number` + +###### signal? + +`AbortSignal` + +###### maxTokens? + +`number` + +#### Returns + +`Promise`\<[`RouterChatResult`](#routerchatresult)\> + +*** + +### routerChatWithTools() + +> **routerChatWithTools**(`cfg`, `messages`, `tools`, `opts?`): `Promise`\<[`RouterChatToolsResult`](#routerchattoolsresult)\> + +Defined in: [runtime/router-client.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L116) + +A router completion WITH tool-calling — the operator driver's LLM seam. Passes OpenAI-shape +`messages` (system/user/assistant-with-tool_calls/tool roles) + function `tools`, and returns the +assistant text plus the tool calls the model wants run. Same fail-loud + real-usage discipline as +`routerChatWithUsage`. `tool_choice: 'auto'` lets the model decide; the driver loops on the result. + +#### Parameters + +##### cfg + +[`RouterConfig`](#routerconfig) + +##### messages + +readonly `Record`\<`string`, `unknown`\>[] + +##### tools + +readonly `object`[] + +##### opts? + +###### temperature? + +`number` + +###### signal? + +`AbortSignal` + +###### toolChoice? + +`"auto"` \| `"none"` \| `"required"` + +###### maxTokens? + +`number` + +#### Returns + +`Promise`\<[`RouterChatToolsResult`](#routerchattoolsresult)\> + +*** + +### routerToolLoop() + +> **routerToolLoop**(`cfg`, `system`, `user`, `tools`, `execute`, `opts?`): `Promise`\<[`RouterToolLoopResult`](#routertoolloopresult)\> + +Defined in: [runtime/router-client.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L207) + +The tool-using router backend: a real agentic loop OVER the Tangle router (which +supports tool-calling), off-box — no sandbox. Each turn is one router completion +with `tools`; if the model emits tool_calls, `execute` runs them on the host and +their results are folded back as `tool` messages; the loop repeats until the +model answers without a tool call or the turn budget is hit. One turn = one +inference call, so `maxTurns` is the equal-compute unit against random@k. + +This is the depth substrate for agentic gates (the worker ACTS, observes the real +result, and continues) that the chat-only `routerChatWithUsage` cannot express. + +#### Parameters + +##### cfg + +[`RouterConfig`](#routerconfig) + +##### system + +`string` + +##### user + +`string` + +##### tools + +readonly [`ToolSpec`](#toolspec)[] + +##### execute + +(`name`, `args`) => `Promise`\<`string`\> + +##### opts? + +###### maxTurns? + +`number` + +###### temperature? + +`number` + +###### signal? + +`AbortSignal` + +###### maxTokens? + +`number` + +###### initialMessages? + +readonly `Record`\<`string`, `unknown`\>[] + +Seed the loop with an existing conversation (depth continuation) instead of + `[system, user]`. When set, `system`/`user` are ignored. The array is copied. + +#### Returns + +`Promise`\<[`RouterToolLoopResult`](#routertoolloopresult)\> + +*** + +### runBenchmark() + +> **runBenchmark**(`cfg`): `Promise`\<[`BenchmarkReport`](#benchmarkreport)\> + +Defined in: [runtime/run-benchmark.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L132) + +Run the requested strategies over the tasks, scored by the Environment's own check. + Resilient: a task whose rollouts fail (transient infra) is excluded from the stats but + reported in `perTask` with the error — never silently dropped. + +#### Parameters + +##### cfg + +[`BenchmarkConfig`](#benchmarkconfig) + +#### Returns + +`Promise`\<[`BenchmarkReport`](#benchmarkreport)\> + +*** + +### printBenchmarkReport() + +> **printBenchmarkReport**(`report`): `void` + +Defined in: [runtime/run-benchmark.ts:231](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L231) + +Pretty-print a report — the "free optimization" verdict, with the cost vector. + +#### Parameters + +##### report + +[`BenchmarkReport`](#benchmarkreport) + +#### Returns + +`void` + +*** + +### runLoop() + +> **runLoop**\<`Task`, `Output`, `Decision`\>(`options`): `Promise`\<[`LoopResult`](#loopresult)\<`Task`, `Output`, `Decision`\>\> + +Defined in: [runtime/run-loop.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L135) + +**`Experimental`** + +#### Type Parameters + +##### Task + +`Task` + +##### Output + +`Output` + +##### Decision + +`Decision` + +#### Parameters + +##### options + +[`RunLoopOptions`](#runloopoptions)\<`Task`, `Output`, `Decision`\> + +#### Returns + +`Promise`\<[`LoopResult`](#loopresult)\<`Task`, `Output`, `Decision`\>\> + +*** + +### createSandboxForSpec() + +> **createSandboxForSpec**\<`Task`\>(`client`, `spec`, `signal`): `Promise`\<`SandboxInstance`\> + +Defined in: [runtime/run-loop.ts:851](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L851) + +Instantiate a sandbox for an `AgentRunSpec`: sets `backend.profile` to the +spec's profile (inferring the backend type when the spec doesn't override +it) and merges `sandboxOverrides`. Shared by the loop kernel and the +`AgentRuntime.act` sandbox bridge so both boot the sandbox identically. + +#### Type Parameters + +##### Task + +`Task` + +#### Parameters + +##### client + +[`SandboxClient`](#sandboxclient-2) + +##### spec + +[`AgentRunSpec`](#agentrunspec)\<`Task`\> + +##### signal + +`AbortSignal` + +#### Returns + +`Promise`\<`SandboxInstance`\> + +*** + +### defaultSelectWinner() + +> **defaultSelectWinner**\<`Task`, `Output`\>(`iterations`): [`LoopWinner`](#loopwinner)\<`Task`, `Output`\> \| `undefined` + +Defined in: [runtime/run-loop.ts:983](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L983) + +The kernel's winner argmax — best-valid-score, ties broken by earliest index, +falling back to the best-scoring non-errored output when none is valid. Exported +so the `runProgram` tree executor selects across merged sub-loop iterations with +the SAME semantics the kernel uses at a single loop's finalize (one selector, not +a forked copy). + +#### Type Parameters + +##### Task + +`Task` + +##### Output + +`Output` + +#### Parameters + +##### iterations + +[`Iteration`](#iteration-1)\<`Task`, `Output`\>[] + +#### Returns + +[`LoopWinner`](#loopwinner)\<`Task`, `Output`\> \| `undefined` + +*** + +### acquireSandbox() + +> **acquireSandbox**(`client`, `options`, `acquire?`): `Promise`\<`SandboxInstance`\> + +Defined in: [runtime/sandbox-acquire.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-acquire.ts#L68) + +**`Experimental`** + +#### Parameters + +##### client + +[`SandboxClient`](#sandboxclient-2) + +##### options + +`CreateSandboxOptions` + +##### acquire? + +`AcquireOptions` = `{}` + +#### Returns + +`Promise`\<`SandboxInstance`\> + +*** + +### probeSandboxCapabilities() + +> **probeSandboxCapabilities**(`client`): `Promise`\<[`SandboxCapabilities`](#sandboxcapabilities)\> + +Defined in: [runtime/sandbox-capabilities.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-capabilities.ts#L45) + +**`Experimental`** + +Probe (and memoize per client) what the loop may rely on. A client without a +`criuStatus` method, or whose probe rejects, yields `canFork = false` — a +failed probe must never claim a capability the platform may not have. The +promise is cached so concurrent fanout branches share one round-trip. + +#### Parameters + +##### client + +[`SandboxClient`](#sandboxclient-2) + +#### Returns + +`Promise`\<[`SandboxCapabilities`](#sandboxcapabilities)\> + +*** + +### extractLlmCallEvent() + +> **extractLlmCallEvent**(`event`, `agentRunName`): RuntimeStreamEvent & \{ type: "llm\_call"; \} \| `undefined` + +Defined in: [runtime/sandbox-events.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-events.ts#L32) + +Extract a `RuntimeStreamEvent`-shaped `llm_call` from a sandbox event when +the event carries usage/cost data. Returns `undefined` for non-cost events +so the kernel can iterate the full stream without branching. + +Canonical cost-carrying types observed in the wild: + - `llm_call` — `data: { model, tokensIn, tokensOut, costUsd, ... }` + - `message.completed` / `result` — `data: { usage: { inputTokens, + outputTokens, totalCostUsd? } }` + - `cost.usage` / `usage` — same shape under a dedicated type + +Numeric coercion is strict: `Number.isFinite` gates every accumulator write +so a sentinel `NaN` from a misbehaving backend cannot poison the ledger. + +#### Parameters + +##### event + +`SandboxEvent` + +##### agentRunName + +`string` + +#### Returns + +RuntimeStreamEvent & \{ type: "llm\_call"; \} \| `undefined` + +*** + +### mapSandboxEvent() + +> **mapSandboxEvent**(`event`, `opts?`): [`RuntimeStreamEvent`](index.md#runtimestreamevent) \| `undefined` + +Defined in: [runtime/sandbox-events.ts:123](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-events.ts#L123) + +Project one `SandboxEvent` onto the `RuntimeStreamEvent` chat-UX vocabulary, +for runtimes that bridge a sandbox `streamPrompt` into the +`AgentRuntime.act` streaming contract. Returns `undefined` for events that +have no faithful projection — the raw stream is preserved separately for the +`OutputAdapter`, so an unmapped event never loses data. + +Mapped (the task-optional incremental variants — no synthesized task +lifecycle, no guessed tool-part shapes): + - `message.part.updated` text part → `text_delta` + - `message.part.updated` reasoning/thinking part → `reasoning_delta` + - cost-bearing events → `llm_call` (shared with the ledger extractor) + +The opencode backend emits incremental text as +`{ type: 'message.part.updated', data: { part: { type, text }, delta } }`; +`delta` is the increment, `part.text` the running accumulation. + +#### Parameters + +##### event + +`SandboxEvent` + +##### opts? + +###### agentRunName? + +`string` + +#### Returns + +[`RuntimeStreamEvent`](index.md#runtimestreamevent) \| `undefined` + +*** + +### createSandboxLineage() + +> **createSandboxLineage**(`client`, `capabilities`, `options?`): [`SandboxLineage`](#sandboxlineage) + +Defined in: [runtime/sandbox-lineage.ts:189](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L189) + +**`Experimental`** + +Build a lineage bound to one client + its probed capabilities. The +capabilities are passed in (not re-probed) so the kernel probes once per run +and the lineage stays a pure function of "what this platform can do". + +#### Parameters + +##### client + +[`SandboxClient`](#sandboxclient-2) + +##### capabilities + +[`SandboxCapabilities`](#sandboxcapabilities) + +##### options? + +###### maxConcurrency? + +`number` + +###### streaming? + +`"sse"` \| `"poll"` + +#### Returns + +[`SandboxLineage`](#sandboxlineage) + +*** + +### openSandboxRun() + +> **openSandboxRun**\<`Out`\>(`client`, `options`, `deliverable`): `Promise`\<[`SandboxRun`](#sandboxrun)\<`Out`\>\> + +Defined in: [runtime/sandbox-run.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L104) + +**`Experimental`** + +Open a sandbox run. Harness-agnostic: the harness lives in +`options.agentRun.sandboxOverrides.backend.type`, so opencode/codex/claude-code/ +kimi-code all flow through this one entrypoint with identical env/auth wiring. + +#### Type Parameters + +##### Out + +`Out` + +#### Parameters + +##### client + +[`SandboxClient`](#sandboxclient-2) + +##### options + +[`OpenSandboxRunOptions`](#opensandboxrunoptions) + +##### deliverable + +[`Deliverable`](#deliverable)\<`Out`\> + +#### Returns + +`Promise`\<[`SandboxRun`](#sandboxrun)\<`Out`\>\> + +*** + +### assertStrategyContract() + +> **assertStrategyContract**(`code`): `void` + +Defined in: [runtime/strategy-author.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L114) + +Static CONTRACT lint over an authored strategy module — the module-boundary + enforcement of the harness's two measurement invariants: + - author blindness: the only import allowed is the loops surface. A body that could + reach the filesystem, network, or process could read or mutate verifier/artifact + state outside the brokered shots, and the harness-verified score would stop + meaning "what the shots achieved". + - conserved dose: no out-of-band compute (fetch/require/eval) — every unit a + strategy spends is metered by the Supervisor's pool, which is what makes + equal-budget comparisons between strategies valid. + A lint, not a sandbox: its job is keeping the benchmark numbers interpretable. + +#### Parameters + +##### code + +`string` + +#### Returns + +`void` + +*** + +### authorStrategy() + +> **authorStrategy**(`opts`): `Promise`\<[`AuthoredStrategy`](#authoredstrategy)\> + +Defined in: [runtime/strategy-author.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L179) + +Author + load a strategy from losses. Throws when the author emits no loadable module; + with `fallbackModel` set, the named fallback gets one attempt first. + +#### Parameters + +##### opts + +[`AuthorStrategyOptions`](#authorstrategyoptions) + +#### Returns + +`Promise`\<[`AuthoredStrategy`](#authoredstrategy)\> + +*** + +### discriminatingMeans() + +> **discriminatingMeans**(`report`, `fieldOrder`): `Record`\<`string`, \{ `score`: `number`; `usd`: `number`; \}\> \| `null` + +Defined in: [runtime/strategy-evolution.ts:237](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L237) + +Strategy means recomputed over the DISCRIMINATING tasks only — tasks where the field + strategies did not all score identically. Zero-spread tasks (everyone 1.0, everyone + 0.0, everyone tied) carry no selection information; averaging over them dilutes real + differences toward zero. Search-side denoising only — the gate never uses this. + +#### Parameters + +##### report + +[`BenchmarkReport`](#benchmarkreport) + +##### fieldOrder + +`string`[] + +#### Returns + +`Record`\<`string`, \{ `score`: `number`; `usd`: `number`; \}\> \| `null` + +*** + +### pickChampion() + +> **pickChampion**(`means`, `fieldOrder`, `policy`, `epsilon`): [`ChampionPick`](#championpick) + +Defined in: [runtime/strategy-evolution.ts:262](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L262) + +The champion pick over a means table. 'score' takes the best mean score (ties → + field order). 'costAware' treats scores within `epsilon` of the best as tied and + takes the cheapest — the (score, $) Pareto rule collapsed to one pick. + +#### Parameters + +##### means + +`Record`\<`string`, \{ `score`: `number`; `usd`: `number`; \}\> + +##### fieldOrder + +`string`[] + +##### policy + +[`ChampionPolicy`](#championpolicy) + +##### epsilon + +`number` + +#### Returns + +[`ChampionPick`](#championpick) + +*** + +### selectChampion() + +> **selectChampion**(`report`, `fieldOrder`, `policy`, `epsilon`): [`ChampionPick`](#championpick) + +Defined in: [runtime/strategy-evolution.ts:285](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L285) + +Search-side champion selection over a tournament report. + +#### Parameters + +##### report + +[`BenchmarkReport`](#benchmarkreport) + +##### fieldOrder + +`string`[] + +##### policy + +[`ChampionPolicy`](#championpolicy) + +##### epsilon + +`number` + +#### Returns + +[`ChampionPick`](#championpick) + +*** + +### runStrategyEvolution() + +> **runStrategyEvolution**(`cfg`): `Promise`\<[`EvolutionReport`](#evolutionreport)\> + +Defined in: [runtime/strategy-evolution.ts:364](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L364) + +#### Parameters + +##### cfg + +[`StrategyEvolutionConfig`](#strategyevolutionconfig) + +#### Returns + +`Promise`\<[`EvolutionReport`](#evolutionreport)\> + +*** + +### depthDriver() + +> **depthDriver**(`surface`, `task`, `opts`, `cfg`): [`Agent`](#agent)\<`unknown`, [`Outcome`](#outcome-1)\<`unknown`\>\> + +Defined in: [runtime/strategy.ts:527](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L527) + +DEPTH: one persistent artifact, carried across analyst-steered shots. + +#### Parameters + +##### surface + +[`AgenticSurface`](#agenticsurface) + +##### task + +[`AgenticTask`](#agentictask) + +##### opts + +[`AgenticOptions`](#agenticoptions) + +##### cfg + +###### maxShots + +`number` + +#### Returns + +[`Agent`](#agent)\<`unknown`, [`Outcome`](#outcome-1)\<`unknown`\>\> + +*** + +### breadthDriver() + +> **breadthDriver**(`_surface`, `task`, `opts`, `cfg`): [`Agent`](#agent)\<`unknown`, [`Outcome`](#outcome-1)\<`unknown`\>\> + +Defined in: [runtime/strategy.ts:595](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L595) + +BREADTH: K independent rollouts (each own artifact), verifier picks the best. + +#### Parameters + +##### \_surface + +[`AgenticSurface`](#agenticsurface) + +##### task + +[`AgenticTask`](#agentictask) + +##### opts + +[`AgenticOptions`](#agenticoptions) + +##### cfg + +###### width + +`number` + +#### Returns + +[`Agent`](#agent)\<`unknown`, [`Outcome`](#outcome-1)\<`unknown`\>\> + +*** + +### defineStrategy() + +> **defineStrategy**(`name`, `run`): [`Strategy`](#strategy-3) + +Defined in: [runtime/strategy.ts:740](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L740) + +Author a Strategy from the composable steps — the open, compact way. + +#### Parameters + +##### name + +`string` + +##### run + +(`ctx`) => `Promise`\<[`StrategyResult`](#strategyresult)\> + +#### Returns + +[`Strategy`](#strategy-3) + +*** + +### runAgentic() + +> **runAgentic**(`opts`): `Promise`\<[`AgenticRunResult`](#agenticrunresult)\> + +Defined in: [runtime/strategy.ts:981](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L981) + +Run a Strategy through the keystone Supervisor — `Agent.act` over a conserved-budget Scope. + +#### Parameters + +##### opts + +[`RunAgenticOptions`](#runagenticoptions) + +#### Returns + +`Promise`\<[`AgenticRunResult`](#agenticrunresult)\> + +*** + +### asAuthoredProfile() + +> **asAuthoredProfile**(`raw`): [`AuthoredProfile`](#authoredprofile) \| `null` + +Defined in: [runtime/supervise/authoring.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/authoring.ts#L33) + +Narrow an untyped `spawn_worker` profile argument to an `AuthoredProfile`, or null if the + supervisor failed to author one (empty/placeholder profile — a skill violation worth catching). + +#### Parameters + +##### raw + +`unknown` + +#### Returns + +[`AuthoredProfile`](#authoredprofile) \| `null` + +*** + +### supervisorSkill() + +> **supervisorSkill**(`opts?`): `string` + +Defined in: [runtime/supervise/authoring.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/authoring.ts#L45) + +The supervisor SKILL — the how-to the supervisor reads (its system prompt). THE optimizable + surface: editing this changes how the supervisor designs every agent it spawns. + +#### Parameters + +##### opts? + +###### goal? + +`string` + +#### Returns + +`string` + +*** + +### authoredWorker() + +> **authoredWorker**(`profile`, `opts`): [`Agent`](#agent)\<`unknown`, `unknown`\> + +Defined in: [runtime/supervise/authoring.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/authoring.ts#L65) + +Build a worker AGENT from a profile the supervisor authored: the authored `systemPrompt` + + `model` shape the worker's one model call; the deliverable gates settlement (valid ⟺ delivered). + +#### Parameters + +##### profile + +[`AuthoredProfile`](#authoredprofile) + +##### opts + +###### cfg + +[`RouterConfig`](#routerconfig) + +###### taskPrompt + +`string` + +###### deliverable + +[`DeliverableSpec`](#deliverablespec) + +###### temperature? + +`number` + +#### Returns + +[`Agent`](#agent)\<`unknown`, `unknown`\> + +*** + +### spendFromUsageEvents() + +> **spendFromUsageEvents**(`events`): [`Spend`](#spend) + +Defined in: [runtime/supervise/budget.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L92) + +Fold a normalized `UsageEvent` array into a `Spend`. Tokens and usd are separate + channels; iterations come from `'iteration'` events. Pure; `ms` stays zero (the + pool does not read wall-clock). + +#### Parameters + +##### events + +[`UsageEvent`](#usageevent)[] + +#### Returns + +[`Spend`](#spend) + +*** + +### createBudgetPool() + +> **createBudgetPool**(`root`, `now?`): [`BudgetPool`](#budgetpool) + +Defined in: [runtime/supervise/budget.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L135) + +Create a conserved reservation pool from a root `Budget`. `now()` is injected so the +deadline readout is deterministic; defaults to `Date.now` for non-test callers. The +absolute deadline is fixed at construction (`now() + budget.deadlineMs`) so the +readout's `deadlineMs` is a stable wall-clock instant, not a shrinking remainder. + +#### Parameters + +##### root + +[`Budget`](#budget-8) + +##### now? + +() => `number` + +#### Returns + +[`BudgetPool`](#budgetpool) + +*** + +### gateOnDeliverable() + +> **gateOnDeliverable**\<`Out`\>(`inner`, `deliverable`): [`Executor`](#executor)\<`Out`\> + +Defined in: [runtime/supervise/completion-gate.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/completion-gate.ts#L44) + +Wrap an `Executor` so its settlement `valid` reflects the deliverable check, not the +inner verdict. Handles both `execute` shapes (one-shot `Promise` and +streaming `AsyncIterable` + `resultArtifact()`); the check runs once the inner +executor has produced its output. The inner `score` is preserved; only `valid` is gated. + +#### Type Parameters + +##### Out + +`Out` + +#### Parameters + +##### inner + +[`Executor`](#executor)\<`Out`\> + +##### deliverable + +[`DeliverableSpec`](#deliverablespec)\<`Out`\> + +#### Returns + +[`Executor`](#executor)\<`Out`\> + +*** + +### coordinationDriverAgent() + +> **coordinationDriverAgent**(`opts`): [`Agent`](#agent)\<`unknown`, `unknown`\> + +Defined in: [runtime/supervise/coordination-driver.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L124) + +Build the intelligent recursive driver. Its `act` is the LLM tool-loop; spawn it as a +`driverChild` (`driver-executor.ts`) to run it inside a nested scope, recursively. + +#### Parameters + +##### opts + +[`CoordinationDriverOptions`](#coordinationdriveroptions) + +#### Returns + +[`Agent`](#agent)\<`unknown`, `unknown`\> + +*** + +### serveCoordinationMcp() + +> **serveCoordinationMcp**(`opts`): `Promise`\<[`CoordinationMcpHandle`](#coordinationmcphandle)\> + +Defined in: [runtime/supervise/coordination-mcp.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L51) + +Stand up the coordination MCP over a live scope. The HOST address is `127.0.0.1` (the bridge runs + opencode locally, same host); pass `host` to bind elsewhere when the harness is remote. + +#### Parameters + +##### opts + +###### scope + +[`Scope`](#scope-1)\<`unknown`\> + +###### blobs + +[`ResultBlobStore`](#resultblobstore) + +###### makeWorkerAgent + +[`MakeWorkerAgent`](mcp.md#makeworkeragent) + +###### perWorker + +[`Budget`](#budget-8) + +###### port? + +`number` + +###### host? + +`string` + +###### analysts? + +[`AnalystRegistry`](mcp.md#analystregistry) + +Trace-analyst lenses the driver can run (`run_analyst`) or auto-fire on settle. + +###### analyzeOnSettle? + +readonly `string`[] + +Analyst kinds to auto-run when a worker settles `done` — findings flow up the bus. + +###### onEvent? + +(`event`) => `void` \| `Promise`\<`void`\> + +Pass-through subscriber for every bus event (settled / question / finding). + +###### questionPolicy? + +[`QuestionPolicy`](mcp.md#questionpolicy) + +#### Returns + +`Promise`\<[`CoordinationMcpHandle`](#coordinationmcphandle)\> + +*** + +### defaultToolDetectors() + +> **defaultToolDetectors**(): `StreamingDetector`[] + +Defined in: [runtime/supervise/detector-monitor.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/detector-monitor.ts#L37) + +The default online panel for a tool-call pipe: a worker repeating the same call, or hammering + consecutive errors. (No-progress needs a domain progress-probe, so it is opt-in, not default.) + + Coverage note: `repeated-action` works for EVERY harness (it needs only tool name + args, which + every adapter provides). `error-streak` needs per-call status — opencode carries it inline + (`state.status`, VALIDATED live), but claude-code/codex tool-call parts do NOT (their errors live + in separate result blocks not yet decoded), so error-streak is silent for those until result-block + decoding is added + live-validated. It is in the panel because it is correct where status exists. + +#### Returns + +`StreamingDetector`[] + +*** + +### watchTrace() + +> **watchTrace**(`source`, `opts?`): () => `void` + +Defined in: [runtime/supervise/detector-monitor.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/detector-monitor.ts#L43) + +Subscribe to a `TraceSource` and run the streaming detectors over its live spans. Returns an + unsubscribe. A defensive `argHash` failure (circular args) never throws out of the side-channel. + +#### Parameters + +##### source + +[`TraceSource`](#tracesource) + +##### opts? + +[`WatchTraceOptions`](#watchtraceoptions) = `{}` + +#### Returns + +() => `void` + +*** + +### driverChild() + +> **driverChild**\<`Out`\>(`name`, `driver`, `journal`): [`Agent`](#agent)\<`unknown`, `Out`\> + +Defined in: [runtime/supervise/driver-executor.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/driver-executor.ts#L77) + +Mark + carry a driver `Agent` so the recursive registry resolves it to the +driver-executor. The returned agent is SPAWNED (never run directly): its +`executorSpec` is marked `role: 'driver'` and carries the driver agent + the shared +journal so the executor can run its `act` inside a nested scope. `act` fails loud if +called directly — a driver child runs THROUGH its nested-scope executor, never as a root. + +#### Type Parameters + +##### Out + +`Out` + +#### Parameters + +##### name + +`string` + +##### driver + +[`Agent`](#agent)\<`unknown`, `Out`\> + +##### journal + +[`SpawnJournal`](#spawnjournal) + +#### Returns + +[`Agent`](#agent)\<`unknown`, `Out`\> + +*** + +### isDriverSpec() + +> **isDriverSpec**(`spec`): `spec is DriverSpec` + +Defined in: [runtime/supervise/driver-executor.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/driver-executor.ts#L100) + +True when a spec is a driver child (carries the role marker + a driver Agent). + +#### Parameters + +##### spec + +[`AgentSpec`](#agentspec) + +#### Returns + +`spec is DriverSpec` + +*** + +### withDriverExecutor() + +> **withDriverExecutor**(`base`): [`ExecutorRegistry`](#executorregistry) + +Defined in: [runtime/supervise/driver-executor.ts:211](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/driver-executor.ts#L211) + +Register the driver-executor so a child marked `role: 'driver'` resolves to it. The base +registry resolves by harness alone (it does not read `role`), so a recursive run needs a +registry that routes the driver tag here FIRST. Returns a registry decorator: a +driver-role spec → the driver-executor; everything else → the base registry's resolution +(leaf built-ins + BYO). + +#### Parameters + +##### base + +[`ExecutorRegistry`](#executorregistry) + +#### Returns + +[`ExecutorRegistry`](#executorregistry) + +*** + +### createEventBus() + +> **createEventBus**\<`E`\>(`now?`): [`EventBus`](#eventbus)\<`E`\> + +Defined in: [runtime/supervise/event-bus.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L74) + +#### Type Parameters + +##### E + +`E` *extends* [`BusEvent`](#busevent) + +#### Parameters + +##### now? + +() => `number` + +#### Returns + +[`EventBus`](#eventbus)\<`E`\> + +*** + +### createInbox() + +> **createInbox**(): [`Inbox`](#inbox) + +Defined in: [runtime/supervise/inbox.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L55) + +#### Returns + +[`Inbox`](#inbox) + +*** + +### touchedPathsFromPatch() + +> **touchedPathsFromPatch**(`patch`): `string`[] + +Defined in: [runtime/supervise/patch-checks.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L45) + +The unified-diff paths the patch touches — the `+++`/`---` headers, de-`a/`/`b/`-prefixed, + with `/dev/null` (a delete's other side) dropped. + +#### Parameters + +##### patch + +`string` + +#### Returns + +`string`[] + +*** + +### countDiffLines() + +> **countDiffLines**(`patch`): `number` + +Defined in: [runtime/supervise/patch-checks.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L59) + +Count the added/removed content lines in a unified diff (excludes the `+++`/`---` headers). + +#### Parameters + +##### patch + +`string` + +#### Returns + +`number` + +*** + +### isNonEmptyPatch() + +> **isNonEmptyPatch**(`patch`): `boolean` + +Defined in: [runtime/supervise/patch-checks.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L75) + +True when the patch actually changes something — at least one touched path AND non-blank body. + An empty patch can trivially "pass" tests/typecheck (nothing changed) yet does no work. + +#### Parameters + +##### patch + +`string` + +#### Returns + +`boolean` + +*** + +### touchesSecretPath() + +> **touchesSecretPath**(`patch`): `string`[] + +Defined in: [runtime/supervise/patch-checks.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L80) + +The credential-shaped paths the patch touches (always-on floor, independent of `forbiddenPaths`). + +#### Parameters + +##### patch + +`string` + +#### Returns + +`string`[] + +*** + +### runCoderChecks() + +> **runCoderChecks**(`input`, `constraints?`): `DefaultVerdict` + +Defined in: [runtime/supervise/patch-checks.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L96) + +**`Experimental`** + +The pure mechanical gate — the SINGLE source of the no-op / always-on secret-path floor / +diff-size / forbidden-path / test / typecheck checks. No I/O: it scores a patch + its +already-derived pass signals. + +Checks in order: (1) no-op rejection, (2) always-on secret-path floor (independent of +`forbiddenPaths`), (3) forbidden-path, (4) diff-size cap, (5) tests, (6) typecheck. +Aggregate score: `0.5*tests + 0.3*typecheck + 0.2*(1 - diffLines/maxDiff)`; `valid` is the +conjunction of all six. + +#### Parameters + +##### input + +[`CoderCheckInput`](#codercheckinput) + +##### constraints? + +[`CoderCheckConstraints`](#codercheckconstraints) = `{}` + +#### Returns + +`DefaultVerdict` + +*** + +### patchDelivered() + +> **patchDelivered**(`options?`): [`DeliverableSpec`](#deliverablespec)\<`WorktreeHarnessResult`\> + +Defined in: [runtime/supervise/patch-deliverable.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-deliverable.ts#L44) + +**`Experimental`** + +Build the `DeliverableSpec`: `check(artifact)` runs the shared mechanical +gate (`runCoderChecks`) over the captured patch + the worktree-derived pass signals and returns +whether the patch is DELIVERED (the `valid` conjunction). + +#### Parameters + +##### options? + +[`PatchDeliverableOptions`](#patchdeliverableoptions) = `{}` + +#### Returns + +[`DeliverableSpec`](#deliverablespec)\<`WorktreeHarnessResult`\> + +*** + +### routerDriverChat() + +> **routerDriverChat**(`c`, `opts?`): [`DriverChat`](#driverchat) + +Defined in: [runtime/supervise/router-driver-chat.ts:12](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/router-driver-chat.ts#L12) + +#### Parameters + +##### c + +[`RouterConfig`](#routerconfig) + +##### opts? + +###### temperature? + +`number` + +#### Returns + +[`DriverChat`](#driverchat) + +*** + +### createInMemoryRunContext() + +> **createInMemoryRunContext**(`opts?`): [`InMemoryRunContext`](#inmemoryruncontext) + +Defined in: [runtime/supervise/run-context.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/run-context.ts#L56) + +Build a fresh in-memory run context. Every call returns NEW stores (no shared global +state between runs), so two runs never cross-contaminate their journals/blobs. + +#### Parameters + +##### opts? + +[`InMemoryRunContextOptions`](#inmemoryruncontextoptions) = `{}` + +#### Returns + +[`InMemoryRunContext`](#inmemoryruncontext) + +*** + +### createExecutor() + +> **createExecutor**(`config`): [`ExecutorFactory`](#executorfactory)\<`unknown`\> + +Defined in: [runtime/supervise/runtime.ts:1137](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L1137) + +The single built-in executor factory. Picks a leaf backend by data (`config.backend`), +injects the matching seam, and delegates to that backend's built-in implementation. +The `Executor` port stays OPEN: bring-your-own agents implement `Executor` directly +and never pass through here. Use this (or `createExecutorRegistry`) instead of a +per-vendor adapter or a closed `inline|sandbox|cli` switch — those bypass the +`UsageEvent` reporting channel. + +#### Parameters + +##### config + +[`ExecutorConfig`](#executorconfig) + +#### Returns + +[`ExecutorFactory`](#executorfactory)\<`unknown`\> + +*** + +### createExecutorRegistry() + +> **createExecutorRegistry**(): [`ExecutorRegistry`](#executorregistry) + +Defined in: [runtime/supervise/runtime.ts:1175](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L1175) + +The open resolver/registry. Pre-registers the three built-ins under their +runtime tags (`'router'`, `'sandbox'`, `'cli'`) and accepts `register(name, +factory)` for any additional runtime — and a BYO `AgentSpec.executor` resolves +without touching the registry at all. NOT a closed switch; registration + BYO +ARE the extension points. + +`resolve` precedence (frozen in `ExecutorRegistry`): a BYO `spec.executor` → +`harness === null` → the `'router'` factory; else a registered factory for the +harness-derived runtime (`'sandbox'` for any `BackendType`); else fail loud. + +#### Returns + +[`ExecutorRegistry`](#executorregistry) + +*** + +### createScope() + +> **createScope**\<`Out`\>(`args`): [`Scope`](#scope-1)\<`Out`\> + +Defined in: [runtime/supervise/scope.ts:188](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/scope.ts#L188) + +#### Type Parameters + +##### Out + +`Out` + +#### Parameters + +##### args + +`ScopeArgs` + +#### Returns + +[`Scope`](#scope-1)\<`Out`\> + +*** + +### settledToIteration() + +> **settledToIteration**\<`Out`\>(`settled`): [`Iteration`](#iteration-1)\<`unknown`, `Out`\> + +Defined in: [runtime/supervise/scope.ts:648](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/scope.ts#L648) + +The step-8 merge-boundary adapter (M4): rehydrate a `Settled.done` into the kernel's +`Iteration` shape so `defaultSelectWinner` stays single-sourced — the supervisor selects +across settled children with the SAME argmax the loop kernel uses, not a forked copy. + +`index` is the cursor `seq` (the recorded, replay-stable order); `output`/`verdict`/ +`tokenUsage`/`costUsd` are read straight off the settlement (already rehydrated from the +`outRef` blob by `next()`). Events are empty — a settled child is an opaque leaf result, +not a sandbox event stream — and the timing/cost fields project its conserved `Spend`. +Fail loud on a `down` settlement: only a `done` child is an iteration. + +#### Type Parameters + +##### Out + +`Out` + +#### Parameters + +##### settled + +[`Settled`](#settled-2)\<`Out`\> + +#### Returns + +[`Iteration`](#iteration-1)\<`unknown`, `Out`\> + +*** + +### createSupervisor() + +> **createSupervisor**\<`Task`, `Out`\>(): [`Supervisor`](#supervisor)\<`Task`, `Out`\> + +Defined in: [runtime/supervise/supervisor.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/supervisor.ts#L64) + +#### Type Parameters + +##### Task + +`Task` + +##### Out + +`Out` + +#### Returns + +[`Supervisor`](#supervisor)\<`Task`, `Out`\> + +*** + +### createRootHandle() + +> **createRootHandle**\<`Out`\>(): [`RootHandle`](#roothandle)\<`Out`\> + +Defined in: [runtime/supervise/supervisor.ts:254](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/supervisor.ts#L254) + +Mint a `RootHandle` plus its supervisor-private control. The handle is the substrate a +chat/pi-viz client attaches to (Q2): `view()` reads the live tree, `signal()` delivers +an out-of-band message, `abort()` cascades. Before `run` binds it (and after `run` +unbinds it) the handle is fail-loud: a client that talks to a handle that is not +driving a live run gets a typed error, never a silent no-op. + +#### Type Parameters + +##### Out + +`Out` + +#### Returns + +[`RootHandle`](#roothandle)\<`Out`\> + +*** + +### toToolSpan() + +> **toToolSpan**(`input`, `runId`, `seq`, `at`): `ToolSpan` + +Defined in: [runtime/supervise/trace-source.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L42) + +Project a normalized tool step into the canonical agent-eval `ToolSpan`. + +#### Parameters + +##### input + +[`ToolStepInput`](#toolstepinput) + +##### runId + +`string` + +##### seq + +`number` + +##### at + +`number` + +#### Returns + +`ToolSpan` + +*** + +### decodeToolPart() + +> **decodeToolPart**(`part`, `harness?`): [`ToolStepInput`](#toolstepinput) \| `undefined` + +Defined in: [runtime/supervise/trace-source.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L138) + +Decode a part with a specific harness's adapter when known, else try every registered adapter + (the composite — robust to mixed/unknown streams). Never throws. + +#### Parameters + +##### part + +`unknown` + +##### harness? + +`string` + +#### Returns + +[`ToolStepInput`](#toolstepinput) \| `undefined` + +*** + +### createPushTraceSource() + +> **createPushTraceSource**(`opts?`): `object` + +Defined in: [runtime/supervise/trace-source.ts:163](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L163) + +A push source for OWNED tool loops (router-tools / cli-bridge tool dispatch): the loop calls + `record(step)` for each tool call; it becomes a span, fan-out to live subscribers + buffered for + `collect`. + +#### Parameters + +##### opts? + +###### runId? + +`string` + +###### now? + +() => `number` + +#### Returns + +`object` + +##### source + +> **source**: [`TraceSource`](#tracesource) + +##### record + +> **record**: (`input`) => `ToolSpan` + +###### Parameters + +###### input + +[`ToolStepInput`](#toolstepinput) + +###### Returns + +`ToolSpan` + +*** + +### createPartsTraceSource() + +> **createPartsTraceSource**(`opts`): [`TraceSource`](#tracesource) + +Defined in: [runtime/supervise/trace-source.ts:198](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L198) + +A source backed by harness message PARTS (sandbox session, cli-bridge). `collect` reads the full + part list and decodes the tool calls; `subscribe`, when given, streams parts live for online + detection. The caller supplies how to get parts (e.g. `box.session(id).messages()` flat-mapped to + parts) — keeping this module free of any substrate SDK. + +#### Parameters + +##### opts + +###### collectParts + +() => `Promise`\ + +###### subscribeParts? + +(`onPart`) => () => `void` + +###### harness? + +`string` + +The harness whose decoder to use (e.g. 'opencode'); omit to try every registered adapter. + +###### runId? + +`string` + +###### now? + +() => `number` + +#### Returns + +[`TraceSource`](#tracesource) + +*** + +### sandboxSessionTraceSource() + +> **sandboxSessionTraceSource**(`box`, `sessionId`, `opts?`): [`TraceSource`](#tracesource) + +Defined in: [runtime/supervise/trace-source.ts:278](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L278) + +The SANDBOX / fleet trace source: read a box session's message parts and decode the harness's tool + calls into spans. `collect` (settle) is the solid path — `box.messages({sessionId})` → parts → spans; + black-box harnesses aren't mid-step interruptible, so online steering is the owned-loop's job and a + live `subscribe` is opt-in (pass `subscribeParts` from `streamPrompt` when the harness streams parts). + +#### Parameters + +##### box + +[`SessionTraceBox`](#sessiontracebox) + +##### sessionId + +`string` + +##### opts? + +###### harness? + +`string` + +The box's harness (e.g. 'opencode', 'claude-code') → selects its decoder adapter. + +###### subscribeParts? + +(`onPart`) => () => `void` + +###### runId? + +`string` + +###### now? + +() => `number` + +#### Returns + +[`TraceSource`](#tracesource) + +*** + +### analyzeTrace() + +> **analyzeTrace**(`source`, `runId?`): `Promise`\<[`TrajectoryAnalysis`](#trajectoryanalysis)\> + +Defined in: [runtime/supervise/trajectory-recorder.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trajectory-recorder.ts#L27) + +Collect the source's spans and run the agent-eval batch analyzers over them under one `runId`. + +#### Parameters + +##### source + +[`TraceSource`](#tracesource) + +##### runId? + +`string` = `'worker'` + +#### Returns + +`Promise`\<[`TrajectoryAnalysis`](#trajectoryanalysis)\> + +*** + +### createWorktreeCliExecutor() + +> **createWorktreeCliExecutor**(`options`): [`Executor`](#executor)\<`WorktreeHarnessResult`\> + +Defined in: [runtime/supervise/worktree-cli-executor.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L85) + +**`Experimental`** + +Build a worktree-CLI leaf `Executor`. Per-spawn (a fresh worktree + abort + teardown each), so a +fanout of N profiles = N parallel worktrees that never clobber each other. + +Fail-loud: an empty `repoRoot`/`harness`/`taskPrompt` throws at construction. `resultArtifact()` +before `execute()` resolves throws. + +#### Parameters + +##### options + +[`WorktreeCliExecutorOptions`](#worktreecliexecutoroptions) + +#### Returns + +[`Executor`](#executor)\<`WorktreeHarnessResult`\> + +*** + +### worktreeFanout() + +> **worktreeFanout**\<`Task`\>(`options`): [`CombinatorShape`](#combinatorshape)\<`Task`, `WorktreeHarnessResult`\> + +Defined in: [runtime/supervise/worktree-fanout.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L78) + +**`Experimental`** + +Build the worktree fanout combinator. Run it with `runPersonified({ persona, shape, task, budget })` +— equal-k holds by construction (the conserved budget pool bounds the N leaves), and selection is +the shared valid-only `selectValidWinner` (never a judge). + +#### Type Parameters + +##### Task + +`Task` + +#### Parameters + +##### options + +[`WorktreeFanoutOptions`](#worktreefanoutoptions) + +#### Returns + +[`CombinatorShape`](#combinatorshape)\<`Task`, `WorktreeHarnessResult`\> + +*** + +### createVerifierEnvironment() + +> **createVerifierEnvironment**(`opts`): [`AgenticSurface`](#agenticsurface) + +Defined in: [runtime/verifier-environment.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/verifier-environment.ts#L67) + +#### Parameters + +##### opts + +[`VerifierEnvironmentOptions`](#verifierenvironmentoptions) + +#### Returns + +[`AgenticSurface`](#agenticsurface) + +*** + +### createWaterfallCollector() + +> **createWaterfallCollector**(): [`WaterfallCollector`](#waterfallcollector) + +Defined in: [runtime/waterfall.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L58) + +#### Returns + +[`WaterfallCollector`](#waterfallcollector) + +*** + +### localShell() + +> **localShell**(): [`Shell`](#shell) + +Defined in: [runtime/workspace.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L18) + +#### Returns + +[`Shell`](#shell) + +*** + +### gitWorkspace() + +> **gitWorkspace**(`opts`): [`Workspace`](#workspace) + +Defined in: [runtime/workspace.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L46) + +#### Parameters + +##### opts + +[`GitWorkspaceOptions`](#gitworkspaceoptions) + +#### Returns + +[`Workspace`](#workspace) + +*** + +### jjWorkspace() + +> **jjWorkspace**(`opts`): [`Workspace`](#workspace) + +Defined in: [runtime/workspace.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L90) + +A jj-backed `Workspace` (Jujutsu, colocated with git for the durable remote). + Same port, same `Shell` — a drop-in for `gitWorkspace`. jj suits agent loops: + no staging area, and a first-class operation log (native resume/undo). Live use + requires `jj` on the `Shell`'s host. + +#### Parameters + +##### opts + +[`GitWorkspaceOptions`](#gitworkspaceoptions) + +#### Returns + +[`Workspace`](#workspace) + +*** + +### runInWorkspace() + +> **runInWorkspace**\<`T`\>(`ws`, `body`, `opts?`): `Promise`\<[`WorkspaceRun`](#workspacerun)\<`T`\>\> + +Defined in: [runtime/workspace.ts:149](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L149) + +Run a worker `body` inside a FRESH clone of a shared `Workspace`, then commit its work back +so the next worker (or the supervisor) builds on it. This is the seam that turns isolated +per-worker cwds into one compounding artifact — `body` gets a real materialized dir, its +delivery is committed to the shared ref iff it's valid (a conflict is returned, never thrown). +The clone is removed after; durable state lives only in the ref. + +#### Type Parameters + +##### T + +`T` + +#### Parameters + +##### ws + +[`Workspace`](#workspace) + +##### body + +(`cwd`) => `Promise`\<\{ `valid`: `boolean`; `value`: `T`; `message?`: `string`; \}\> + +##### opts? + +###### tmpPrefix? + +`string` + +###### commitOnInvalid? + +`boolean` + +#### Returns + +`Promise`\<[`WorkspaceRun`](#workspacerun)\<`T`\>\> diff --git a/docs/api/runtime/README.md b/docs/api/runtime/README.md deleted file mode 100644 index b196290..0000000 --- a/docs/api/runtime/README.md +++ /dev/null @@ -1,379 +0,0 @@ -[**@tangle-network/agent-runtime**](../README.md) - -*** - -[@tangle-network/agent-runtime](../README.md) / runtime - -# runtime - -## Classes - -- [InMemoryResultBlobStore](classes/InMemoryResultBlobStore.md) -- [FileResultBlobStore](classes/FileResultBlobStore.md) -- [InMemorySpawnJournal](classes/InMemorySpawnJournal.md) -- [FileSpawnJournal](classes/FileSpawnJournal.md) -- [InMemoryCorpus](classes/InMemoryCorpus.md) -- [FileCorpus](classes/FileCorpus.md) - -## Interfaces - -- [WorktreeCommandResult](interfaces/WorktreeCommandResult.md) -- [AnytimeTaskCurve](interfaces/AnytimeTaskCurve.md) -- [AnytimeStrategySummary](interfaces/AnytimeStrategySummary.md) -- [AnytimeReport](interfaces/AnytimeReport.md) -- [AuditIntentInput](interfaces/AuditIntentInput.md) -- [AuditIntentOptions](interfaces/AuditIntentOptions.md) -- [IntentAudit](interfaces/IntentAudit.md) -- [CompletionEvidence](interfaces/CompletionEvidence.md) -- [CompletionVerdict](interfaces/CompletionVerdict.md) -- [CompletionAnalyst](interfaces/CompletionAnalyst.md) -- [CompletionPolicy](interfaces/CompletionPolicy.md) -- [HarvestCorpusOptions](interfaces/HarvestCorpusOptions.md) -- [HarvestFailure](interfaces/HarvestFailure.md) -- [HarvestReport](interfaces/HarvestReport.md) -- [LoopDispatchOptions](interfaces/LoopDispatchOptions.md) -- [McpEndpoint](interfaces/McpEndpoint.md) -- [McpEnvironmentOptions](interfaces/McpEnvironmentOptions.md) -- [ObserveInput](interfaces/ObserveInput.md) -- [ObserveOptions](interfaces/ObserveOptions.md) -- [Observation](interfaces/Observation.md) -- [CreateScopeAnalystOptions](interfaces/CreateScopeAnalystOptions.md) -- [RegistryAnalyzeProjection](interfaces/RegistryAnalyzeProjection.md) -- [Persona](interfaces/Persona.md) -- [PersonaContext](interfaces/PersonaContext.md) -- [PersonaExecutors](interfaces/PersonaExecutors.md) -- [DefinePersonaInput](interfaces/DefinePersonaInput.md) -- [ShapeBudget](interfaces/ShapeBudget.md) -- [ShapeContext](interfaces/ShapeContext.md) -- [ShapeRegistry](interfaces/ShapeRegistry.md) -- [RunPersonifiedOptions](interfaces/RunPersonifiedOptions.md) -- [PipelineStage](interfaces/PipelineStage.md) -- [FanoutOptions](interfaces/FanoutOptions.md) -- [FanoutSynthesis](interfaces/FanoutSynthesis.md) -- [LoopUntilSpec](interfaces/LoopUntilSpec.md) -- [LoopUntilState](interfaces/LoopUntilState.md) -- [PanelSpec](interfaces/PanelSpec.md) -- [PanelJudge](interfaces/PanelJudge.md) -- [PanelVerdict](interfaces/PanelVerdict.md) -- [VerifySpec](interfaces/VerifySpec.md) -- [WidenSpec](interfaces/WidenSpec.md) -- [ScopeWidenGate](interfaces/ScopeWidenGate.md) -- [WidenLineage](interfaces/WidenLineage.md) -- [ScopeAnalyst](interfaces/ScopeAnalyst.md) -- [ScopeAnalyzeInput](interfaces/ScopeAnalyzeInput.md) -- [SteerContext](interfaces/SteerContext.md) -- [CorpusRecord](interfaces/CorpusRecord.md) -- [CorpusFilter](interfaces/CorpusFilter.md) -- [Corpus](interfaces/Corpus.md) -- [RenderCorpusToInstructionsOptions](interfaces/RenderCorpusToInstructionsOptions.md) -- [TrajectoryNode](interfaces/TrajectoryNode.md) -- [TrajectoryReport](interfaces/TrajectoryReport.md) -- [TrajectoryReportOptions](interfaces/TrajectoryReportOptions.md) -- [EqualKArm](interfaces/EqualKArm.md) -- [EqualKVerdict](interfaces/EqualKVerdict.md) -- [EqualKOnCostOptions](interfaces/EqualKOnCostOptions.md) -- [PromotionGateOptions](interfaces/PromotionGateOptions.md) -- [PromotionVerdict](interfaces/PromotionVerdict.md) -- [UsageSink](interfaces/UsageSink.md) -- [RouterConfig](interfaces/RouterConfig.md) -- [RouterChatResult](interfaces/RouterChatResult.md) -- [RouterToolCall](interfaces/RouterToolCall.md) -- [RouterChatToolsResult](interfaces/RouterChatToolsResult.md) -- [ToolSpec](interfaces/ToolSpec.md) -- [RouterToolLoopResult](interfaces/RouterToolLoopResult.md) -- [BenchmarkConfig](interfaces/BenchmarkConfig.md) -- [BenchmarkLift](interfaces/BenchmarkLift.md) -- [BenchmarkCell](interfaces/BenchmarkCell.md) -- [BenchmarkTaskRow](interfaces/BenchmarkTaskRow.md) -- [BenchmarkStrategySummary](interfaces/BenchmarkStrategySummary.md) -- [BenchmarkReport](interfaces/BenchmarkReport.md) -- [RunLoopOptions](interfaces/RunLoopOptions.md) -- [SandboxCapabilities](interfaces/SandboxCapabilities.md) -- [CriuCapableClient](interfaces/CriuCapableClient.md) -- [SandboxLineageHandle](interfaces/SandboxLineageHandle.md) -- [SandboxLineage](interfaces/SandboxLineage.md) -- [CheckpointCapableBox](interfaces/CheckpointCapableBox.md) -- [ForkCapableBox](interfaces/ForkCapableBox.md) -- [SessionCapableBox](interfaces/SessionCapableBox.md) -- [TurnResult](interfaces/TurnResult.md) -- [SandboxRun](interfaces/SandboxRun.md) -- [OpenSandboxRunOptions](interfaces/OpenSandboxRunOptions.md) -- [AuthorStrategyOptions](interfaces/AuthorStrategyOptions.md) -- [AuthoredStrategy](interfaces/AuthoredStrategy.md) -- [EvolutionAuthor](interfaces/EvolutionAuthor.md) -- [StrategyEvolutionConfig](interfaces/StrategyEvolutionConfig.md) -- [ChampionPick](interfaces/ChampionPick.md) -- [EvolutionCandidate](interfaces/EvolutionCandidate.md) -- [EvolutionGeneration](interfaces/EvolutionGeneration.md) -- [EvolutionArchiveNode](interfaces/EvolutionArchiveNode.md) -- [EvolutionBandInfo](interfaces/EvolutionBandInfo.md) -- [EvolutionReport](interfaces/EvolutionReport.md) -- [AgenticTask](interfaces/AgenticTask.md) -- [ArtifactHandle](interfaces/ArtifactHandle.md) -- [AgenticTool](interfaces/AgenticTool.md) -- [SurfaceScore](interfaces/SurfaceScore.md) -- [AgenticSurface](interfaces/AgenticSurface.md) -- [AgenticOptions](interfaces/AgenticOptions.md) -- [AgenticRunResult](interfaces/AgenticRunResult.md) -- [Strategy](interfaces/Strategy.md) -- [ShotPersona](interfaces/ShotPersona.md) -- [ShotSpec](interfaces/ShotSpec.md) -- [StrategyResult](interfaces/StrategyResult.md) -- [StrategyCtx](interfaces/StrategyCtx.md) -- [RunAgenticOptions](interfaces/RunAgenticOptions.md) -- [AuthoredProfile](interfaces/AuthoredProfile.md) -- [ReservationTicket](interfaces/ReservationTicket.md) -- [BudgetPool](interfaces/BudgetPool.md) -- [DeliverableSpec](interfaces/DeliverableSpec.md) -- [DriverToolCall](interfaces/DriverToolCall.md) -- [DriverMessage](interfaces/DriverMessage.md) -- [DriverTurn](interfaces/DriverTurn.md) -- [DriverChat](interfaces/DriverChat.md) -- [CoordinationDriverOptions](interfaces/CoordinationDriverOptions.md) -- [CoordinationMcpHandle](interfaces/CoordinationMcpHandle.md) -- [WatchTraceOptions](interfaces/WatchTraceOptions.md) -- [BusEvent](interfaces/BusEvent.md) -- [BusRecord](interfaces/BusRecord.md) -- [PublishOptions](interfaces/PublishOptions.md) -- [BusStats](interfaces/BusStats.md) -- [EventBus](interfaces/EventBus.md) -- [InboxMessage](interfaces/InboxMessage.md) -- [Inbox](interfaces/Inbox.md) -- [CoderCheckInput](interfaces/CoderCheckInput.md) -- [CoderCheckConstraints](interfaces/CoderCheckConstraints.md) -- [PatchDeliverableOptions](interfaces/PatchDeliverableOptions.md) -- [InMemoryRunContextOptions](interfaces/InMemoryRunContextOptions.md) -- [InMemoryRunContext](interfaces/InMemoryRunContext.md) -- [RouterSeam](interfaces/RouterSeam.md) -- [SandboxSeam](interfaces/SandboxSeam.md) -- [CliSeam](interfaces/CliSeam.md) -- [CliWorktreeSeam](interfaces/CliWorktreeSeam.md) -- [BridgeSeam](interfaces/BridgeSeam.md) -- [RouterToolsSeam](interfaces/RouterToolsSeam.md) -- [NestedScopeSeam](interfaces/NestedScopeSeam.md) -- [ToolStepInput](interfaces/ToolStepInput.md) -- [TraceSource](interfaces/TraceSource.md) -- [SessionMessageLike](interfaces/SessionMessageLike.md) -- [SessionTraceBox](interfaces/SessionTraceBox.md) -- [TrajectoryAnalysis](interfaces/TrajectoryAnalysis.md) -- [Agent](interfaces/Agent.md) -- [Executor](interfaces/Executor.md) -- [ExecutorResult](interfaces/ExecutorResult.md) -- [AgentSpec](interfaces/AgentSpec.md) -- [ExecutorContext](interfaces/ExecutorContext.md) -- [ExecutorRegistry](interfaces/ExecutorRegistry.md) -- [Budget](interfaces/Budget.md) -- [Spend](interfaces/Spend.md) -- [SpawnOpts](interfaces/SpawnOpts.md) -- [Handle](interfaces/Handle.md) -- [Scope](interfaces/Scope.md) -- [NodeSnapshot](interfaces/NodeSnapshot.md) -- [TreeView](interfaces/TreeView.md) -- [SpawnJournal](interfaces/SpawnJournal.md) -- [ResultBlobStore](interfaces/ResultBlobStore.md) -- [Supervisor](interfaces/Supervisor.md) -- [SupervisorOpts](interfaces/SupervisorOpts.md) -- [RootHandle](interfaces/RootHandle.md) -- [WidenGate](interfaces/WidenGate.md) -- [WorktreeCliExecutorOptions](interfaces/WorktreeCliExecutorOptions.md) -- [AuthoredHarness](interfaces/AuthoredHarness.md) -- [WorktreeFanoutOptions](interfaces/WorktreeFanoutOptions.md) -- [ValidationCtx](interfaces/ValidationCtx.md) -- [Validator](interfaces/Validator.md) -- [AgentRunSpec](interfaces/AgentRunSpec.md) -- [OutputAdapter](interfaces/OutputAdapter.md) -- [LoopTokenUsage](interfaces/LoopTokenUsage.md) -- [Iteration](interfaces/Iteration.md) -- [Driver](interfaces/Driver.md) -- [LoopPlanDescription](interfaces/LoopPlanDescription.md) -- [LoopWinner](interfaces/LoopWinner.md) -- [LoopResult](interfaces/LoopResult.md) -- [SandboxClient](interfaces/SandboxClient.md) -- [LoopLineageOptions](interfaces/LoopLineageOptions.md) -- [LoopSandboxPlacement](interfaces/LoopSandboxPlacement.md) -- [LoopTraceEmitter](interfaces/LoopTraceEmitter.md) -- [LoopStartedPayload](interfaces/LoopStartedPayload.md) -- [LoopPlanPayload](interfaces/LoopPlanPayload.md) -- [LoopIterationStartedPayload](interfaces/LoopIterationStartedPayload.md) -- [LoopIterationDispatchPayload](interfaces/LoopIterationDispatchPayload.md) -- [LoopIterationEndedPayload](interfaces/LoopIterationEndedPayload.md) -- [LoopDecisionPayload](interfaces/LoopDecisionPayload.md) -- [LoopEndedPayload](interfaces/LoopEndedPayload.md) -- [LoopTeardownFailedPayload](interfaces/LoopTeardownFailedPayload.md) -- [ExecCtx](interfaces/ExecCtx.md) -- [VerifierEnvironmentOptions](interfaces/VerifierEnvironmentOptions.md) -- [WaterfallSpan](interfaces/WaterfallSpan.md) -- [WaterfallReport](interfaces/WaterfallReport.md) -- [WaterfallCollector](interfaces/WaterfallCollector.md) -- [Workspace](interfaces/Workspace.md) -- [GitWorkspaceOptions](interfaces/GitWorkspaceOptions.md) -- [WorkspaceRun](interfaces/WorkspaceRun.md) - -## Type Aliases - -- [LoopOptionsForDispatch](type-aliases/LoopOptionsForDispatch.md) -- [Outcome](type-aliases/Outcome.md) -- [DefinePersona](type-aliases/DefinePersona.md) -- [LoopShape](type-aliases/LoopShape.md) -- [RunPersonified](type-aliases/RunPersonified.md) -- [CombinatorShape](type-aliases/CombinatorShape.md) -- [Pipeline](type-aliases/Pipeline.md) -- [FanoutWinnerSelector](type-aliases/FanoutWinnerSelector.md) -- [WinnerStrategy](type-aliases/WinnerStrategy.md) -- [Fanout](type-aliases/Fanout.md) -- [LoopUntil](type-aliases/LoopUntil.md) -- [Panel](type-aliases/Panel.md) -- [Verify](type-aliases/Verify.md) -- [WidenDecision](type-aliases/WidenDecision.md) -- [Widen](type-aliases/Widen.md) -- [FlatWidenGate](type-aliases/FlatWidenGate.md) -- [AssertTraceDerivedFindings](type-aliases/AssertTraceDerivedFindings.md) -- [RenderCorpusToInstructions](type-aliases/RenderCorpusToInstructions.md) -- [TrajectoryReportFn](type-aliases/TrajectoryReportFn.md) -- [EqualKOnCost](type-aliases/EqualKOnCost.md) -- [Environment](type-aliases/Environment.md) -- [Deliverable](type-aliases/Deliverable.md) -- [ChampionPolicy](type-aliases/ChampionPolicy.md) -- [BudgetReadout](type-aliases/BudgetReadout.md) -- [ExecutorConfig](type-aliases/ExecutorConfig.md) -- [ToolPartDecoder](type-aliases/ToolPartDecoder.md) -- [UsageEvent](type-aliases/UsageEvent.md) -- [Runtime](type-aliases/Runtime.md) -- [ExecutorFactory](type-aliases/ExecutorFactory.md) -- [Restart](type-aliases/Restart.md) -- [NodeStatus](type-aliases/NodeStatus.md) -- [NodeId](type-aliases/NodeId.md) -- [Settled](type-aliases/Settled.md) -- [SpawnEvent](type-aliases/SpawnEvent.md) -- [SupervisedResult](type-aliases/SupervisedResult.md) -- [RootSignal](type-aliases/RootSignal.md) -- [WorktreePatchArtifact](type-aliases/WorktreePatchArtifact.md) -- [LoopTraceEvent](type-aliases/LoopTraceEvent.md) -- [Shell](type-aliases/Shell.md) -- [WorkspaceCommit](type-aliases/WorkspaceCommit.md) - -## Variables - -- [defaultAuditorInstruction](variables/defaultAuditorInstruction.md) -- [defaultAnalystInstruction](variables/defaultAnalystInstruction.md) -- [assertTraceDerivedFindings](variables/assertTraceDerivedFindings.md) -- [builtinShapes](variables/builtinShapes.md) -- [strategyAuthorContract](variables/strategyAuthorContract.md) -- [sample](variables/sample.md) -- [refine](variables/refine.md) -- [adaptiveRefine](variables/adaptiveRefine.md) -- [sampleThenRefine](variables/sampleThenRefine.md) -- [driverRuntime](variables/driverRuntime.md) -- [driverExecutorFactory](variables/driverExecutorFactory.md) -- [cliWorktreeExecutor](variables/cliWorktreeExecutor.md) -- [nestedScopeSeamKey](variables/nestedScopeSeamKey.md) -- [decodeOpencodePart](variables/decodeOpencodePart.md) -- [decodeAnthropicPart](variables/decodeAnthropicPart.md) -- [decodeOpenAiPart](variables/decodeOpenAiPart.md) -- [toolPartDecoders](variables/toolPartDecoders.md) - -## Functions - -- [contentAddress](functions/contentAddress.md) -- [replaySpawnTree](functions/replaySpawnTree.md) -- [materializeTreeView](functions/materializeTreeView.md) -- [anytimeReport](functions/anytimeReport.md) -- [renderAnytimeTable](functions/renderAnytimeTable.md) -- [auditIntent](functions/auditIntent.md) -- [completionAuthorizes](functions/completionAuthorizes.md) -- [stopSentinel](functions/stopSentinel.md) -- [sentinelCompletion](functions/sentinelCompletion.md) -- [deterministicCompletion](functions/deterministicCompletion.md) -- [harvestCorpus](functions/harvestCorpus.md) -- [inlineSandboxClient](functions/inlineSandboxClient.md) -- [loopDispatch](functions/loopDispatch.md) -- [createMcpEnvironment](functions/createMcpEnvironment.md) -- [observe](functions/observe.md) -- [renderReport](functions/renderReport.md) -- [createScopeAnalyst](functions/createScopeAnalyst.md) -- [registryScopeAnalyst](functions/registryScopeAnalyst.md) -- [buildSteerContext](functions/buildSteerContext.md) -- [selectValidWinner](functions/selectValidWinner.md) -- [pipeline](functions/pipeline.md) -- [fanout](functions/fanout.md) -- [loopUntil](functions/loopUntil.md) -- [panel](functions/panel.md) -- [verify](functions/verify.md) -- [widen](functions/widen.md) -- [flatWidenGate](functions/flatWidenGate.md) -- [renderCorpusToInstructions](functions/renderCorpusToInstructions.md) -- [definePersona](functions/definePersona.md) -- [runPersonified](functions/runPersonified.md) -- [createShapeRegistry](functions/createShapeRegistry.md) -- [registerShape](functions/registerShape.md) -- [trajectoryReport](functions/trajectoryReport.md) -- [equalKOnCost](functions/equalKOnCost.md) -- [promotionGate](functions/promotionGate.md) -- [reportLoopUsage](functions/reportLoopUsage.md) -- [routerChatWithUsage](functions/routerChatWithUsage.md) -- [routerChatWithTools](functions/routerChatWithTools.md) -- [routerToolLoop](functions/routerToolLoop.md) -- [runBenchmark](functions/runBenchmark.md) -- [printBenchmarkReport](functions/printBenchmarkReport.md) -- [runLoop](functions/runLoop.md) -- [createSandboxForSpec](functions/createSandboxForSpec.md) -- [defaultSelectWinner](functions/defaultSelectWinner.md) -- [acquireSandbox](functions/acquireSandbox.md) -- [probeSandboxCapabilities](functions/probeSandboxCapabilities.md) -- [extractLlmCallEvent](functions/extractLlmCallEvent.md) -- [mapSandboxEvent](functions/mapSandboxEvent.md) -- [createSandboxLineage](functions/createSandboxLineage.md) -- [openSandboxRun](functions/openSandboxRun.md) -- [assertStrategyContract](functions/assertStrategyContract.md) -- [authorStrategy](functions/authorStrategy.md) -- [discriminatingMeans](functions/discriminatingMeans.md) -- [pickChampion](functions/pickChampion.md) -- [selectChampion](functions/selectChampion.md) -- [runStrategyEvolution](functions/runStrategyEvolution.md) -- [depthDriver](functions/depthDriver.md) -- [breadthDriver](functions/breadthDriver.md) -- [defineStrategy](functions/defineStrategy.md) -- [runAgentic](functions/runAgentic.md) -- [asAuthoredProfile](functions/asAuthoredProfile.md) -- [supervisorSkill](functions/supervisorSkill.md) -- [authoredWorker](functions/authoredWorker.md) -- [spendFromUsageEvents](functions/spendFromUsageEvents.md) -- [createBudgetPool](functions/createBudgetPool.md) -- [gateOnDeliverable](functions/gateOnDeliverable.md) -- [coordinationDriverAgent](functions/coordinationDriverAgent.md) -- [serveCoordinationMcp](functions/serveCoordinationMcp.md) -- [defaultToolDetectors](functions/defaultToolDetectors.md) -- [watchTrace](functions/watchTrace.md) -- [driverChild](functions/driverChild.md) -- [isDriverSpec](functions/isDriverSpec.md) -- [withDriverExecutor](functions/withDriverExecutor.md) -- [createEventBus](functions/createEventBus.md) -- [createInbox](functions/createInbox.md) -- [touchedPathsFromPatch](functions/touchedPathsFromPatch.md) -- [countDiffLines](functions/countDiffLines.md) -- [isNonEmptyPatch](functions/isNonEmptyPatch.md) -- [touchesSecretPath](functions/touchesSecretPath.md) -- [runCoderChecks](functions/runCoderChecks.md) -- [patchDelivered](functions/patchDelivered.md) -- [routerDriverChat](functions/routerDriverChat.md) -- [createInMemoryRunContext](functions/createInMemoryRunContext.md) -- [createExecutor](functions/createExecutor.md) -- [createExecutorRegistry](functions/createExecutorRegistry.md) -- [createScope](functions/createScope.md) -- [settledToIteration](functions/settledToIteration.md) -- [createSupervisor](functions/createSupervisor.md) -- [createRootHandle](functions/createRootHandle.md) -- [toToolSpan](functions/toToolSpan.md) -- [decodeToolPart](functions/decodeToolPart.md) -- [createPushTraceSource](functions/createPushTraceSource.md) -- [createPartsTraceSource](functions/createPartsTraceSource.md) -- [sandboxSessionTraceSource](functions/sandboxSessionTraceSource.md) -- [analyzeTrace](functions/analyzeTrace.md) -- [createWorktreeCliExecutor](functions/createWorktreeCliExecutor.md) -- [worktreeFanout](functions/worktreeFanout.md) -- [createVerifierEnvironment](functions/createVerifierEnvironment.md) -- [createWaterfallCollector](functions/createWaterfallCollector.md) -- [localShell](functions/localShell.md) -- [gitWorkspace](functions/gitWorkspace.md) -- [jjWorkspace](functions/jjWorkspace.md) -- [runInWorkspace](functions/runInWorkspace.md) diff --git a/docs/api/runtime/classes/FileCorpus.md b/docs/api/runtime/classes/FileCorpus.md deleted file mode 100644 index 2fd6455..0000000 --- a/docs/api/runtime/classes/FileCorpus.md +++ /dev/null @@ -1,89 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / FileCorpus - -# Class: FileCorpus - -Defined in: [runtime/personify/corpus.ts:202](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/corpus.ts#L202) - -JSONL on disk — one validated `CorpusRecord` per line, append-only. `query` replays the whole -file, validating every line (a malformed line fails loud — a corrupted corpus must never read -back silently) and folding by `id`: a later identical line dedups, a later conflicting line -under the same `id` is a corruption (fail loud). `append` first replays to enforce the same -idempotence/conflict contract as the in-mem impl, then fsyncs the new line so a crash between -writes never loses an acknowledged fact. Shares the JSONL append-line spine with the spawn -journal, but the interface stays separate (a learned fact is not a replay record). - -## Implements - -- [`Corpus`](../interfaces/Corpus.md) - -## Constructors - -### Constructor - -> **new FileCorpus**(`path`): `FileCorpus` - -Defined in: [runtime/personify/corpus.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/corpus.ts#L203) - -#### Parameters - -##### path - -`string` - -#### Returns - -`FileCorpus` - -## Methods - -### append() - -> **append**(`record`): `Promise`\<\{ `succeeded`: `true`; \} \| \{ `succeeded`: `false`; `error`: `string`; \}\> - -Defined in: [runtime/personify/corpus.ts:205](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/corpus.ts#L205) - -Append one accreted fact. Idempotent on an identical record; returns a typed outcome — - inspect `succeeded` before treating it as durable (no silent write-through on conflict). - -#### Parameters - -##### record - -[`CorpusRecord`](../interfaces/CorpusRecord.md) - -#### Returns - -`Promise`\<\{ `succeeded`: `true`; \} \| \{ `succeeded`: `false`; `error`: `string`; \}\> - -#### Implementation of - -[`Corpus`](../interfaces/Corpus.md).[`append`](../interfaces/Corpus.md#append) - -*** - -### query() - -> **query**(`filter`): `Promise`\ - -Defined in: [runtime/personify/corpus.ts:233](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/corpus.ts#L233) - -Query accreted facts by filter — most-confident first. Returns the matching records (an - empty array when none match is a valid result, NOT an error). - -#### Parameters - -##### filter - -[`CorpusFilter`](../interfaces/CorpusFilter.md) - -#### Returns - -`Promise`\ - -#### Implementation of - -[`Corpus`](../interfaces/Corpus.md).[`query`](../interfaces/Corpus.md#query) diff --git a/docs/api/runtime/classes/FileResultBlobStore.md b/docs/api/runtime/classes/FileResultBlobStore.md deleted file mode 100644 index 374de30..0000000 --- a/docs/api/runtime/classes/FileResultBlobStore.md +++ /dev/null @@ -1,83 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / FileResultBlobStore - -# Class: FileResultBlobStore - -Defined in: [durable/spawn-journal.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L87) - -FS `ResultBlobStore`. One JSON file per artifact under `dir`, named by a -filesystem-safe encoding of the `outRef` (`sha256:` → `sha256-.json`). -`put` fsyncs so a crash between writes never loses an acknowledged blob. - -## Implements - -- [`ResultBlobStore`](../interfaces/ResultBlobStore.md) - -## Constructors - -### Constructor - -> **new FileResultBlobStore**(`dir`): `FileResultBlobStore` - -Defined in: [durable/spawn-journal.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L88) - -#### Parameters - -##### dir - -`string` - -#### Returns - -`FileResultBlobStore` - -## Methods - -### put() - -> **put**(`outRef`, `artifact`): `Promise`\<`void`\> - -Defined in: [durable/spawn-journal.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L90) - -#### Parameters - -##### outRef - -`string` - -##### artifact - -`unknown` - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`ResultBlobStore`](../interfaces/ResultBlobStore.md).[`put`](../interfaces/ResultBlobStore.md#put) - -*** - -### get() - -> **get**(`outRef`): `Promise`\<`unknown`\> - -Defined in: [durable/spawn-journal.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L103) - -#### Parameters - -##### outRef - -`string` - -#### Returns - -`Promise`\<`unknown`\> - -#### Implementation of - -[`ResultBlobStore`](../interfaces/ResultBlobStore.md).[`get`](../interfaces/ResultBlobStore.md#get) diff --git a/docs/api/runtime/classes/FileSpawnJournal.md b/docs/api/runtime/classes/FileSpawnJournal.md deleted file mode 100644 index b680d53..0000000 --- a/docs/api/runtime/classes/FileSpawnJournal.md +++ /dev/null @@ -1,111 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / FileSpawnJournal - -# Class: FileSpawnJournal - -Defined in: [durable/spawn-journal.ts:178](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L178) - -JSONL on disk. One line per record: the first record is `begin`, subsequent records -are `event` envelopes wrapping a `SpawnEvent`. `loadTree` replays the whole file, -filtering by `root`, and applies the same begin-precedes-events + unique-seq -corruption guards as the in-memory impl. Each append fsyncs so a crash between -writes never loses an acknowledged event. - -## Implements - -- [`SpawnJournal`](../interfaces/SpawnJournal.md) - -## Constructors - -### Constructor - -> **new FileSpawnJournal**(`path`): `FileSpawnJournal` - -Defined in: [durable/spawn-journal.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L179) - -#### Parameters - -##### path - -`string` - -#### Returns - -`FileSpawnJournal` - -## Methods - -### loadTree() - -> **loadTree**(`root`): `Promise`\<[`SpawnEvent`](../type-aliases/SpawnEvent.md)[] \| `undefined`\> - -Defined in: [durable/spawn-journal.ts:181](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L181) - -#### Parameters - -##### root - -`string` - -#### Returns - -`Promise`\<[`SpawnEvent`](../type-aliases/SpawnEvent.md)[] \| `undefined`\> - -#### Implementation of - -[`SpawnJournal`](../interfaces/SpawnJournal.md).[`loadTree`](../interfaces/SpawnJournal.md#loadtree) - -*** - -### beginTree() - -> **beginTree**(`root`, `at`): `Promise`\<`void`\> - -Defined in: [durable/spawn-journal.ts:211](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L211) - -#### Parameters - -##### root - -`string` - -##### at - -`string` - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`SpawnJournal`](../interfaces/SpawnJournal.md).[`beginTree`](../interfaces/SpawnJournal.md#begintree) - -*** - -### appendEvent() - -> **appendEvent**(`root`, `ev`): `Promise`\<`void`\> - -Defined in: [durable/spawn-journal.ts:224](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L224) - -#### Parameters - -##### root - -`string` - -##### ev - -[`SpawnEvent`](../type-aliases/SpawnEvent.md) - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`SpawnJournal`](../interfaces/SpawnJournal.md).[`appendEvent`](../interfaces/SpawnJournal.md#appendevent) diff --git a/docs/api/runtime/classes/InMemoryCorpus.md b/docs/api/runtime/classes/InMemoryCorpus.md deleted file mode 100644 index d08a5ea..0000000 --- a/docs/api/runtime/classes/InMemoryCorpus.md +++ /dev/null @@ -1,77 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / InMemoryCorpus - -# Class: InMemoryCorpus - -Defined in: [runtime/personify/corpus.ts:161](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/corpus.ts#L161) - -In-memory `Corpus`. Keyed by record `id`; `append` validates the record, is idempotent on an -identical re-append, and returns a typed `{ succeeded: false }` on a conflicting re-append under -the same `id` (never overwrites). `query` routes through the single-sourced `applyFilter`. - -## Implements - -- [`Corpus`](../interfaces/Corpus.md) - -## Constructors - -### Constructor - -> **new InMemoryCorpus**(): `InMemoryCorpus` - -#### Returns - -`InMemoryCorpus` - -## Methods - -### append() - -> **append**(`record`): `Promise`\<\{ `succeeded`: `true`; \} \| \{ `succeeded`: `false`; `error`: `string`; \}\> - -Defined in: [runtime/personify/corpus.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/corpus.ts#L164) - -Append one accreted fact. Idempotent on an identical record; returns a typed outcome — - inspect `succeeded` before treating it as durable (no silent write-through on conflict). - -#### Parameters - -##### record - -[`CorpusRecord`](../interfaces/CorpusRecord.md) - -#### Returns - -`Promise`\<\{ `succeeded`: `true`; \} \| \{ `succeeded`: `false`; `error`: `string`; \}\> - -#### Implementation of - -[`Corpus`](../interfaces/Corpus.md).[`append`](../interfaces/Corpus.md#append) - -*** - -### query() - -> **query**(`filter`): `Promise`\ - -Defined in: [runtime/personify/corpus.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/corpus.ts#L186) - -Query accreted facts by filter — most-confident first. Returns the matching records (an - empty array when none match is a valid result, NOT an error). - -#### Parameters - -##### filter - -[`CorpusFilter`](../interfaces/CorpusFilter.md) - -#### Returns - -`Promise`\ - -#### Implementation of - -[`Corpus`](../interfaces/Corpus.md).[`query`](../interfaces/Corpus.md#query) diff --git a/docs/api/runtime/classes/InMemoryResultBlobStore.md b/docs/api/runtime/classes/InMemoryResultBlobStore.md deleted file mode 100644 index 820fd6c..0000000 --- a/docs/api/runtime/classes/InMemoryResultBlobStore.md +++ /dev/null @@ -1,75 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / InMemoryResultBlobStore - -# Class: InMemoryResultBlobStore - -Defined in: [durable/spawn-journal.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L69) - -In-memory `ResultBlobStore`. Content-addressed: `put` verifies the supplied -`outRef` matches the artifact's hash so a stale/forged ref fails loud rather than -silently rehydrating the wrong payload. Idempotent on an identical re-put. - -## Implements - -- [`ResultBlobStore`](../interfaces/ResultBlobStore.md) - -## Constructors - -### Constructor - -> **new InMemoryResultBlobStore**(): `InMemoryResultBlobStore` - -#### Returns - -`InMemoryResultBlobStore` - -## Methods - -### put() - -> **put**(`outRef`, `artifact`): `Promise`\<`void`\> - -Defined in: [durable/spawn-journal.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L72) - -#### Parameters - -##### outRef - -`string` - -##### artifact - -`unknown` - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`ResultBlobStore`](../interfaces/ResultBlobStore.md).[`put`](../interfaces/ResultBlobStore.md#put) - -*** - -### get() - -> **get**(`outRef`): `Promise`\<`unknown`\> - -Defined in: [durable/spawn-journal.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L77) - -#### Parameters - -##### outRef - -`string` - -#### Returns - -`Promise`\<`unknown`\> - -#### Implementation of - -[`ResultBlobStore`](../interfaces/ResultBlobStore.md).[`get`](../interfaces/ResultBlobStore.md#get) diff --git a/docs/api/runtime/classes/InMemorySpawnJournal.md b/docs/api/runtime/classes/InMemorySpawnJournal.md deleted file mode 100644 index 12f9995..0000000 --- a/docs/api/runtime/classes/InMemorySpawnJournal.md +++ /dev/null @@ -1,103 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / InMemorySpawnJournal - -# Class: InMemorySpawnJournal - -Defined in: [durable/spawn-journal.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L139) - -In-memory `SpawnJournal`. Appends are observed-committed only; the impl enforces -the corruption guards a durable replay rests on: - - an event before `beginTree` is a corrupted tree (fail loud), - - a duplicate `seq` within a tree is a corrupted cursor (fail loud) — two - settlements cannot share the cursor position replay orders by. - -## Implements - -- [`SpawnJournal`](../interfaces/SpawnJournal.md) - -## Constructors - -### Constructor - -> **new InMemorySpawnJournal**(): `InMemorySpawnJournal` - -#### Returns - -`InMemorySpawnJournal` - -## Methods - -### loadTree() - -> **loadTree**(`root`): `Promise`\<[`SpawnEvent`](../type-aliases/SpawnEvent.md)[] \| `undefined`\> - -Defined in: [durable/spawn-journal.ts:142](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L142) - -#### Parameters - -##### root - -`string` - -#### Returns - -`Promise`\<[`SpawnEvent`](../type-aliases/SpawnEvent.md)[] \| `undefined`\> - -#### Implementation of - -[`SpawnJournal`](../interfaces/SpawnJournal.md).[`loadTree`](../interfaces/SpawnJournal.md#loadtree) - -*** - -### beginTree() - -> **beginTree**(`root`, `at`): `Promise`\<`void`\> - -Defined in: [durable/spawn-journal.ts:148](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L148) - -#### Parameters - -##### root - -`string` - -##### at - -`string` - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`SpawnJournal`](../interfaces/SpawnJournal.md).[`beginTree`](../interfaces/SpawnJournal.md#begintree) - -*** - -### appendEvent() - -> **appendEvent**(`root`, `ev`): `Promise`\<`void`\> - -Defined in: [durable/spawn-journal.ts:161](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L161) - -#### Parameters - -##### root - -`string` - -##### ev - -[`SpawnEvent`](../type-aliases/SpawnEvent.md) - -#### Returns - -`Promise`\<`void`\> - -#### Implementation of - -[`SpawnJournal`](../interfaces/SpawnJournal.md).[`appendEvent`](../interfaces/SpawnJournal.md#appendevent) diff --git a/docs/api/runtime/functions/acquireSandbox.md b/docs/api/runtime/functions/acquireSandbox.md deleted file mode 100644 index 5236ce5..0000000 --- a/docs/api/runtime/functions/acquireSandbox.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / acquireSandbox - -# Function: acquireSandbox() - -> **acquireSandbox**(`client`, `options`, `acquire?`): `Promise`\<`SandboxInstance`\> - -Defined in: [runtime/sandbox-acquire.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-acquire.ts#L68) - -**`Experimental`** - -## Parameters - -### client - -[`SandboxClient`](../interfaces/SandboxClient.md) - -### options - -`CreateSandboxOptions` - -### acquire? - -`AcquireOptions` = `{}` - -## Returns - -`Promise`\<`SandboxInstance`\> diff --git a/docs/api/runtime/functions/analyzeTrace.md b/docs/api/runtime/functions/analyzeTrace.md deleted file mode 100644 index 4d2e802..0000000 --- a/docs/api/runtime/functions/analyzeTrace.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / analyzeTrace - -# Function: analyzeTrace() - -> **analyzeTrace**(`source`, `runId?`): `Promise`\<[`TrajectoryAnalysis`](../interfaces/TrajectoryAnalysis.md)\> - -Defined in: [runtime/supervise/trajectory-recorder.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trajectory-recorder.ts#L27) - -Collect the source's spans and run the agent-eval batch analyzers over them under one `runId`. - -## Parameters - -### source - -[`TraceSource`](../interfaces/TraceSource.md) - -### runId? - -`string` = `'worker'` - -## Returns - -`Promise`\<[`TrajectoryAnalysis`](../interfaces/TrajectoryAnalysis.md)\> diff --git a/docs/api/runtime/functions/anytimeReport.md b/docs/api/runtime/functions/anytimeReport.md deleted file mode 100644 index 58eacf2..0000000 --- a/docs/api/runtime/functions/anytimeReport.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / anytimeReport - -# Function: anytimeReport() - -> **anytimeReport**(`spans`, `opts?`): [`AnytimeReport`](../interfaces/AnytimeReport.md) - -Defined in: [runtime/anytime.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L73) - -Derive anytime metrics from waterfall spans. `targets` are the satisficing score - bars (default [1] = fully resolved; COCO-style multi-target: [0.5, 0.8, 1]); - `targetFor` overrides the bar per task (task-specific satisfaction) — when set, the - per-task bar replaces every entry of `targets` for that task. - -## Parameters - -### spans - -[`WaterfallSpan`](../interfaces/WaterfallSpan.md)[] - -### opts? - -#### targets? - -`number`[] - -#### targetFor? - -(`taskId`) => `number` - -## Returns - -[`AnytimeReport`](../interfaces/AnytimeReport.md) diff --git a/docs/api/runtime/functions/asAuthoredProfile.md b/docs/api/runtime/functions/asAuthoredProfile.md deleted file mode 100644 index 80f8c6a..0000000 --- a/docs/api/runtime/functions/asAuthoredProfile.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / asAuthoredProfile - -# Function: asAuthoredProfile() - -> **asAuthoredProfile**(`raw`): [`AuthoredProfile`](../interfaces/AuthoredProfile.md) \| `null` - -Defined in: [runtime/supervise/authoring.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/authoring.ts#L33) - -Narrow an untyped `spawn_worker` profile argument to an `AuthoredProfile`, or null if the - supervisor failed to author one (empty/placeholder profile — a skill violation worth catching). - -## Parameters - -### raw - -`unknown` - -## Returns - -[`AuthoredProfile`](../interfaces/AuthoredProfile.md) \| `null` diff --git a/docs/api/runtime/functions/assertStrategyContract.md b/docs/api/runtime/functions/assertStrategyContract.md deleted file mode 100644 index f330e12..0000000 --- a/docs/api/runtime/functions/assertStrategyContract.md +++ /dev/null @@ -1,32 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / assertStrategyContract - -# Function: assertStrategyContract() - -> **assertStrategyContract**(`code`): `void` - -Defined in: [runtime/strategy-author.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L114) - -Static CONTRACT lint over an authored strategy module — the module-boundary - enforcement of the harness's two measurement invariants: - - author blindness: the only import allowed is the loops surface. A body that could - reach the filesystem, network, or process could read or mutate verifier/artifact - state outside the brokered shots, and the harness-verified score would stop - meaning "what the shots achieved". - - conserved dose: no out-of-band compute (fetch/require/eval) — every unit a - strategy spends is metered by the Supervisor's pool, which is what makes - equal-budget comparisons between strategies valid. - A lint, not a sandbox: its job is keeping the benchmark numbers interpretable. - -## Parameters - -### code - -`string` - -## Returns - -`void` diff --git a/docs/api/runtime/functions/auditIntent.md b/docs/api/runtime/functions/auditIntent.md deleted file mode 100644 index d941644..0000000 --- a/docs/api/runtime/functions/auditIntent.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / auditIntent - -# Function: auditIntent() - -> **auditIntent**(`input`, `opts`): `Promise`\<[`IntentAudit`](../interfaces/IntentAudit.md)\> - -Defined in: [runtime/audit-intent.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L108) - -## Parameters - -### input - -[`AuditIntentInput`](../interfaces/AuditIntentInput.md) - -### opts - -[`AuditIntentOptions`](../interfaces/AuditIntentOptions.md) - -## Returns - -`Promise`\<[`IntentAudit`](../interfaces/IntentAudit.md)\> diff --git a/docs/api/runtime/functions/authorStrategy.md b/docs/api/runtime/functions/authorStrategy.md deleted file mode 100644 index 7cf7ada..0000000 --- a/docs/api/runtime/functions/authorStrategy.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / authorStrategy - -# Function: authorStrategy() - -> **authorStrategy**(`opts`): `Promise`\<[`AuthoredStrategy`](../interfaces/AuthoredStrategy.md)\> - -Defined in: [runtime/strategy-author.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L179) - -Author + load a strategy from losses. Throws when the author emits no loadable module; - with `fallbackModel` set, the named fallback gets one attempt first. - -## Parameters - -### opts - -[`AuthorStrategyOptions`](../interfaces/AuthorStrategyOptions.md) - -## Returns - -`Promise`\<[`AuthoredStrategy`](../interfaces/AuthoredStrategy.md)\> diff --git a/docs/api/runtime/functions/authoredWorker.md b/docs/api/runtime/functions/authoredWorker.md deleted file mode 100644 index 3edd13d..0000000 --- a/docs/api/runtime/functions/authoredWorker.md +++ /dev/null @@ -1,42 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / authoredWorker - -# Function: authoredWorker() - -> **authoredWorker**(`profile`, `opts`): [`Agent`](../interfaces/Agent.md)\<`unknown`, `unknown`\> - -Defined in: [runtime/supervise/authoring.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/authoring.ts#L65) - -Build a worker AGENT from a profile the supervisor authored: the authored `systemPrompt` + - `model` shape the worker's one model call; the deliverable gates settlement (valid ⟺ delivered). - -## Parameters - -### profile - -[`AuthoredProfile`](../interfaces/AuthoredProfile.md) - -### opts - -#### cfg - -[`RouterConfig`](../interfaces/RouterConfig.md) - -#### taskPrompt - -`string` - -#### deliverable - -[`DeliverableSpec`](../interfaces/DeliverableSpec.md) - -#### temperature? - -`number` - -## Returns - -[`Agent`](../interfaces/Agent.md)\<`unknown`, `unknown`\> diff --git a/docs/api/runtime/functions/breadthDriver.md b/docs/api/runtime/functions/breadthDriver.md deleted file mode 100644 index 3b1a328..0000000 --- a/docs/api/runtime/functions/breadthDriver.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / breadthDriver - -# Function: breadthDriver() - -> **breadthDriver**(`_surface`, `task`, `opts`, `cfg`): [`Agent`](../interfaces/Agent.md)\<`unknown`, [`Outcome`](../type-aliases/Outcome.md)\<`unknown`\>\> - -Defined in: [runtime/strategy.ts:595](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L595) - -BREADTH: K independent rollouts (each own artifact), verifier picks the best. - -## Parameters - -### \_surface - -[`AgenticSurface`](../interfaces/AgenticSurface.md) - -### task - -[`AgenticTask`](../interfaces/AgenticTask.md) - -### opts - -[`AgenticOptions`](../interfaces/AgenticOptions.md) - -### cfg - -#### width - -`number` - -## Returns - -[`Agent`](../interfaces/Agent.md)\<`unknown`, [`Outcome`](../type-aliases/Outcome.md)\<`unknown`\>\> diff --git a/docs/api/runtime/functions/buildSteerContext.md b/docs/api/runtime/functions/buildSteerContext.md deleted file mode 100644 index bb1d76c..0000000 --- a/docs/api/runtime/functions/buildSteerContext.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / buildSteerContext - -# Function: buildSteerContext() - -> **buildSteerContext**\<`D`\>(`findings`, `settledSoFar`): [`SteerContext`](../interfaces/SteerContext.md)\<`D`\> - -Defined in: [runtime/personify/analyst.ts:230](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L230) - -Build the `SteerContext` a combinator reads to steer (its `loopUntil.until`, `widen` gate, any -future steer). One place enforces the firewall: `findings` is asserted trace-derived before it is -surfaced, and `lastValidScore` is provided for OBSERVABILITY only — a combinator that steers off -it re-introduces selector = judge, the coupling the architecture forbids. - -`findings` is re-asserted here even when it came from `createScopeAnalyst` (which already asserted -it): the assertion is cheap and idempotent, and a `SteerContext` may be built from findings that -arrived by another path (a caller-supplied diagnosis). Belt-and-suspenders on the one coupling -that must never leak. - -## Type Parameters - -### D - -`D` - -## Parameters - -### findings - -readonly `AnalystFinding`[] - -### settledSoFar - -readonly [`Settled`](../type-aliases/Settled.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`D`\>\>[] - -## Returns - -[`SteerContext`](../interfaces/SteerContext.md)\<`D`\> diff --git a/docs/api/runtime/functions/completionAuthorizes.md b/docs/api/runtime/functions/completionAuthorizes.md deleted file mode 100644 index bf459b1..0000000 --- a/docs/api/runtime/functions/completionAuthorizes.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / completionAuthorizes - -# Function: completionAuthorizes() - -> **completionAuthorizes**(`v`, `policy?`): `boolean` - -Defined in: [runtime/completion.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L62) - -## Parameters - -### v - -[`CompletionVerdict`](../interfaces/CompletionVerdict.md) - -### policy? - -[`CompletionPolicy`](../interfaces/CompletionPolicy.md) - -## Returns - -`boolean` diff --git a/docs/api/runtime/functions/contentAddress.md b/docs/api/runtime/functions/contentAddress.md deleted file mode 100644 index e2f91b2..0000000 --- a/docs/api/runtime/functions/contentAddress.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / contentAddress - -# Function: contentAddress() - -> **contentAddress**(`artifact`): `string` - -Defined in: [durable/spawn-journal.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L48) - -Mint the content-addressed `outRef` for a result artifact: `sha256:` over a -stable JSON encoding. Producers call this to derive the `outRef` they journal and -`put`; the FS/in-mem stores re-derive it on `put` to verify the supplied ref -matches (fail loud on a mismatch — a forged ref breaks the replay invariant). - -Stable encoding: object keys are sorted recursively so two structurally-equal -artifacts hash identically regardless of key insertion order. - -## Parameters - -### artifact - -`unknown` - -## Returns - -`string` diff --git a/docs/api/runtime/functions/coordinationDriverAgent.md b/docs/api/runtime/functions/coordinationDriverAgent.md deleted file mode 100644 index fb4a674..0000000 --- a/docs/api/runtime/functions/coordinationDriverAgent.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / coordinationDriverAgent - -# Function: coordinationDriverAgent() - -> **coordinationDriverAgent**(`opts`): [`Agent`](../interfaces/Agent.md)\<`unknown`, `unknown`\> - -Defined in: [runtime/supervise/coordination-driver.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L124) - -Build the intelligent recursive driver. Its `act` is the LLM tool-loop; spawn it as a -`driverChild` (`driver-executor.ts`) to run it inside a nested scope, recursively. - -## Parameters - -### opts - -[`CoordinationDriverOptions`](../interfaces/CoordinationDriverOptions.md) - -## Returns - -[`Agent`](../interfaces/Agent.md)\<`unknown`, `unknown`\> diff --git a/docs/api/runtime/functions/countDiffLines.md b/docs/api/runtime/functions/countDiffLines.md deleted file mode 100644 index dc31cf4..0000000 --- a/docs/api/runtime/functions/countDiffLines.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / countDiffLines - -# Function: countDiffLines() - -> **countDiffLines**(`patch`): `number` - -Defined in: [runtime/supervise/patch-checks.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L59) - -Count the added/removed content lines in a unified diff (excludes the `+++`/`---` headers). - -## Parameters - -### patch - -`string` - -## Returns - -`number` diff --git a/docs/api/runtime/functions/createBudgetPool.md b/docs/api/runtime/functions/createBudgetPool.md deleted file mode 100644 index 1657c9b..0000000 --- a/docs/api/runtime/functions/createBudgetPool.md +++ /dev/null @@ -1,30 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createBudgetPool - -# Function: createBudgetPool() - -> **createBudgetPool**(`root`, `now?`): [`BudgetPool`](../interfaces/BudgetPool.md) - -Defined in: [runtime/supervise/budget.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L135) - -Create a conserved reservation pool from a root `Budget`. `now()` is injected so the -deadline readout is deterministic; defaults to `Date.now` for non-test callers. The -absolute deadline is fixed at construction (`now() + budget.deadlineMs`) so the -readout's `deadlineMs` is a stable wall-clock instant, not a shrinking remainder. - -## Parameters - -### root - -[`Budget`](../interfaces/Budget.md) - -### now? - -() => `number` - -## Returns - -[`BudgetPool`](../interfaces/BudgetPool.md) diff --git a/docs/api/runtime/functions/createEventBus.md b/docs/api/runtime/functions/createEventBus.md deleted file mode 100644 index 14eedba..0000000 --- a/docs/api/runtime/functions/createEventBus.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createEventBus - -# Function: createEventBus() - -> **createEventBus**\<`E`\>(`now?`): [`EventBus`](../interfaces/EventBus.md)\<`E`\> - -Defined in: [runtime/supervise/event-bus.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L74) - -## Type Parameters - -### E - -`E` *extends* [`BusEvent`](../interfaces/BusEvent.md) - -## Parameters - -### now? - -() => `number` - -## Returns - -[`EventBus`](../interfaces/EventBus.md)\<`E`\> diff --git a/docs/api/runtime/functions/createExecutor.md b/docs/api/runtime/functions/createExecutor.md deleted file mode 100644 index a4217da..0000000 --- a/docs/api/runtime/functions/createExecutor.md +++ /dev/null @@ -1,28 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createExecutor - -# Function: createExecutor() - -> **createExecutor**(`config`): [`ExecutorFactory`](../type-aliases/ExecutorFactory.md)\<`unknown`\> - -Defined in: [runtime/supervise/runtime.ts:1137](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L1137) - -The single built-in executor factory. Picks a leaf backend by data (`config.backend`), -injects the matching seam, and delegates to that backend's built-in implementation. -The `Executor` port stays OPEN: bring-your-own agents implement `Executor` directly -and never pass through here. Use this (or `createExecutorRegistry`) instead of a -per-vendor adapter or a closed `inline|sandbox|cli` switch — those bypass the -`UsageEvent` reporting channel. - -## Parameters - -### config - -[`ExecutorConfig`](../type-aliases/ExecutorConfig.md) - -## Returns - -[`ExecutorFactory`](../type-aliases/ExecutorFactory.md)\<`unknown`\> diff --git a/docs/api/runtime/functions/createExecutorRegistry.md b/docs/api/runtime/functions/createExecutorRegistry.md deleted file mode 100644 index 1322f88..0000000 --- a/docs/api/runtime/functions/createExecutorRegistry.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createExecutorRegistry - -# Function: createExecutorRegistry() - -> **createExecutorRegistry**(): [`ExecutorRegistry`](../interfaces/ExecutorRegistry.md) - -Defined in: [runtime/supervise/runtime.ts:1175](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L1175) - -The open resolver/registry. Pre-registers the three built-ins under their -runtime tags (`'router'`, `'sandbox'`, `'cli'`) and accepts `register(name, -factory)` for any additional runtime — and a BYO `AgentSpec.executor` resolves -without touching the registry at all. NOT a closed switch; registration + BYO -ARE the extension points. - -`resolve` precedence (frozen in `ExecutorRegistry`): a BYO `spec.executor` → -`harness === null` → the `'router'` factory; else a registered factory for the -harness-derived runtime (`'sandbox'` for any `BackendType`); else fail loud. - -## Returns - -[`ExecutorRegistry`](../interfaces/ExecutorRegistry.md) diff --git a/docs/api/runtime/functions/createInMemoryRunContext.md b/docs/api/runtime/functions/createInMemoryRunContext.md deleted file mode 100644 index ee6fa29..0000000 --- a/docs/api/runtime/functions/createInMemoryRunContext.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createInMemoryRunContext - -# Function: createInMemoryRunContext() - -> **createInMemoryRunContext**(`opts?`): [`InMemoryRunContext`](../interfaces/InMemoryRunContext.md) - -Defined in: [runtime/supervise/run-context.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/run-context.ts#L56) - -Build a fresh in-memory run context. Every call returns NEW stores (no shared global -state between runs), so two runs never cross-contaminate their journals/blobs. - -## Parameters - -### opts? - -[`InMemoryRunContextOptions`](../interfaces/InMemoryRunContextOptions.md) = `{}` - -## Returns - -[`InMemoryRunContext`](../interfaces/InMemoryRunContext.md) diff --git a/docs/api/runtime/functions/createInbox.md b/docs/api/runtime/functions/createInbox.md deleted file mode 100644 index 3310ada..0000000 --- a/docs/api/runtime/functions/createInbox.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createInbox - -# Function: createInbox() - -> **createInbox**(): [`Inbox`](../interfaces/Inbox.md) - -Defined in: [runtime/supervise/inbox.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L55) - -## Returns - -[`Inbox`](../interfaces/Inbox.md) diff --git a/docs/api/runtime/functions/createMcpEnvironment.md b/docs/api/runtime/functions/createMcpEnvironment.md deleted file mode 100644 index 41f29ae..0000000 --- a/docs/api/runtime/functions/createMcpEnvironment.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createMcpEnvironment - -# Function: createMcpEnvironment() - -> **createMcpEnvironment**(`opts`): [`AgenticSurface`](../interfaces/AgenticSurface.md) - -Defined in: [runtime/mcp-environment.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L94) - -## Parameters - -### opts - -[`McpEnvironmentOptions`](../interfaces/McpEnvironmentOptions.md) - -## Returns - -[`AgenticSurface`](../interfaces/AgenticSurface.md) diff --git a/docs/api/runtime/functions/createPartsTraceSource.md b/docs/api/runtime/functions/createPartsTraceSource.md deleted file mode 100644 index dc17da9..0000000 --- a/docs/api/runtime/functions/createPartsTraceSource.md +++ /dev/null @@ -1,46 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createPartsTraceSource - -# Function: createPartsTraceSource() - -> **createPartsTraceSource**(`opts`): [`TraceSource`](../interfaces/TraceSource.md) - -Defined in: [runtime/supervise/trace-source.ts:198](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L198) - -A source backed by harness message PARTS (sandbox session, cli-bridge). `collect` reads the full - part list and decodes the tool calls; `subscribe`, when given, streams parts live for online - detection. The caller supplies how to get parts (e.g. `box.session(id).messages()` flat-mapped to - parts) — keeping this module free of any substrate SDK. - -## Parameters - -### opts - -#### collectParts - -() => `Promise`\ - -#### subscribeParts? - -(`onPart`) => () => `void` - -#### harness? - -`string` - -The harness whose decoder to use (e.g. 'opencode'); omit to try every registered adapter. - -#### runId? - -`string` - -#### now? - -() => `number` - -## Returns - -[`TraceSource`](../interfaces/TraceSource.md) diff --git a/docs/api/runtime/functions/createPushTraceSource.md b/docs/api/runtime/functions/createPushTraceSource.md deleted file mode 100644 index 712bf99..0000000 --- a/docs/api/runtime/functions/createPushTraceSource.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createPushTraceSource - -# Function: createPushTraceSource() - -> **createPushTraceSource**(`opts?`): `object` - -Defined in: [runtime/supervise/trace-source.ts:163](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L163) - -A push source for OWNED tool loops (router-tools / cli-bridge tool dispatch): the loop calls - `record(step)` for each tool call; it becomes a span, fan-out to live subscribers + buffered for - `collect`. - -## Parameters - -### opts? - -#### runId? - -`string` - -#### now? - -() => `number` - -## Returns - -`object` - -### source - -> **source**: [`TraceSource`](../interfaces/TraceSource.md) - -### record - -> **record**: (`input`) => `ToolSpan` - -#### Parameters - -##### input - -[`ToolStepInput`](../interfaces/ToolStepInput.md) - -#### Returns - -`ToolSpan` diff --git a/docs/api/runtime/functions/createRootHandle.md b/docs/api/runtime/functions/createRootHandle.md deleted file mode 100644 index 0da44dc..0000000 --- a/docs/api/runtime/functions/createRootHandle.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createRootHandle - -# Function: createRootHandle() - -> **createRootHandle**\<`Out`\>(): [`RootHandle`](../interfaces/RootHandle.md)\<`Out`\> - -Defined in: [runtime/supervise/supervisor.ts:254](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/supervisor.ts#L254) - -Mint a `RootHandle` plus its supervisor-private control. The handle is the substrate a -chat/pi-viz client attaches to (Q2): `view()` reads the live tree, `signal()` delivers -an out-of-band message, `abort()` cascades. Before `run` binds it (and after `run` -unbinds it) the handle is fail-loud: a client that talks to a handle that is not -driving a live run gets a typed error, never a silent no-op. - -## Type Parameters - -### Out - -`Out` - -## Returns - -[`RootHandle`](../interfaces/RootHandle.md)\<`Out`\> diff --git a/docs/api/runtime/functions/createSandboxForSpec.md b/docs/api/runtime/functions/createSandboxForSpec.md deleted file mode 100644 index 2028302..0000000 --- a/docs/api/runtime/functions/createSandboxForSpec.md +++ /dev/null @@ -1,40 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createSandboxForSpec - -# Function: createSandboxForSpec() - -> **createSandboxForSpec**\<`Task`\>(`client`, `spec`, `signal`): `Promise`\<`SandboxInstance`\> - -Defined in: [runtime/run-loop.ts:851](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L851) - -Instantiate a sandbox for an `AgentRunSpec`: sets `backend.profile` to the -spec's profile (inferring the backend type when the spec doesn't override -it) and merges `sandboxOverrides`. Shared by the loop kernel and the -`AgentRuntime.act` sandbox bridge so both boot the sandbox identically. - -## Type Parameters - -### Task - -`Task` - -## Parameters - -### client - -[`SandboxClient`](../interfaces/SandboxClient.md) - -### spec - -[`AgentRunSpec`](../interfaces/AgentRunSpec.md)\<`Task`\> - -### signal - -`AbortSignal` - -## Returns - -`Promise`\<`SandboxInstance`\> diff --git a/docs/api/runtime/functions/createSandboxLineage.md b/docs/api/runtime/functions/createSandboxLineage.md deleted file mode 100644 index 73af0d1..0000000 --- a/docs/api/runtime/functions/createSandboxLineage.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createSandboxLineage - -# Function: createSandboxLineage() - -> **createSandboxLineage**(`client`, `capabilities`, `options?`): [`SandboxLineage`](../interfaces/SandboxLineage.md) - -Defined in: [runtime/sandbox-lineage.ts:189](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L189) - -**`Experimental`** - -Build a lineage bound to one client + its probed capabilities. The -capabilities are passed in (not re-probed) so the kernel probes once per run -and the lineage stays a pure function of "what this platform can do". - -## Parameters - -### client - -[`SandboxClient`](../interfaces/SandboxClient.md) - -### capabilities - -[`SandboxCapabilities`](../interfaces/SandboxCapabilities.md) - -### options? - -#### maxConcurrency? - -`number` - -#### streaming? - -`"sse"` \| `"poll"` - -## Returns - -[`SandboxLineage`](../interfaces/SandboxLineage.md) diff --git a/docs/api/runtime/functions/createScope.md b/docs/api/runtime/functions/createScope.md deleted file mode 100644 index 354e098..0000000 --- a/docs/api/runtime/functions/createScope.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createScope - -# Function: createScope() - -> **createScope**\<`Out`\>(`args`): [`Scope`](../interfaces/Scope.md)\<`Out`\> - -Defined in: [runtime/supervise/scope.ts:188](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/scope.ts#L188) - -## Type Parameters - -### Out - -`Out` - -## Parameters - -### args - -`ScopeArgs` - -## Returns - -[`Scope`](../interfaces/Scope.md)\<`Out`\> diff --git a/docs/api/runtime/functions/createScopeAnalyst.md b/docs/api/runtime/functions/createScopeAnalyst.md deleted file mode 100644 index 9b5b2f5..0000000 --- a/docs/api/runtime/functions/createScopeAnalyst.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createScopeAnalyst - -# Function: createScopeAnalyst() - -> **createScopeAnalyst**\<`D`\>(`scope`, `options`): [`ScopeAnalyst`](../interfaces/ScopeAnalyst.md)\<`D`\> - -Defined in: [runtime/personify/analyst.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L96) - -Build a `ScopeAnalyst` that spawns the analyst agent through `Scope.spawn` (so its compute is -metered by the conserved pool), drains its single settlement, and enforces the trace-derived -firewall before returning. The `scope` is the SAME scope the combinator is draining its children -from — the analyst is spawned as a sibling and its result is read off `scope.next()` in cursor -order, replay-safe like any other child. - -Fail loud (no silent empty findings): - - the pool refuses the analyst spawn → `AnalystError` (the steer would otherwise run on nothing) - - the analyst settles `down` → `AnalystError` (a broken capture path, not a verdict) - - the analyst returns a non-array → `PlannerError` - - any finding cites judge-derived metric evidence → `PlannerError` via the firewall - -## Type Parameters - -### D - -`D` - -## Parameters - -### scope - -[`Scope`](../interfaces/Scope.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`D`\>\> - -### options - -[`CreateScopeAnalystOptions`](../interfaces/CreateScopeAnalystOptions.md)\<`D`\> - -## Returns - -[`ScopeAnalyst`](../interfaces/ScopeAnalyst.md)\<`D`\> diff --git a/docs/api/runtime/functions/createShapeRegistry.md b/docs/api/runtime/functions/createShapeRegistry.md deleted file mode 100644 index b60af86..0000000 --- a/docs/api/runtime/functions/createShapeRegistry.md +++ /dev/null @@ -1,18 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createShapeRegistry - -# Function: createShapeRegistry() - -> **createShapeRegistry**(): [`ShapeRegistry`](../interfaces/ShapeRegistry.md) - -Defined in: [runtime/personify/registry.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/registry.ts#L25) - -Build a fresh open `ShapeRegistry`. A factory is stored type-erased and re-cast on resolve — the -caller asserts the `` it expects, exactly as the executor registry stores its factories. - -## Returns - -[`ShapeRegistry`](../interfaces/ShapeRegistry.md) diff --git a/docs/api/runtime/functions/createSupervisor.md b/docs/api/runtime/functions/createSupervisor.md deleted file mode 100644 index d37ad53..0000000 --- a/docs/api/runtime/functions/createSupervisor.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createSupervisor - -# Function: createSupervisor() - -> **createSupervisor**\<`Task`, `Out`\>(): [`Supervisor`](../interfaces/Supervisor.md)\<`Task`, `Out`\> - -Defined in: [runtime/supervise/supervisor.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/supervisor.ts#L64) - -## Type Parameters - -### Task - -`Task` - -### Out - -`Out` - -## Returns - -[`Supervisor`](../interfaces/Supervisor.md)\<`Task`, `Out`\> diff --git a/docs/api/runtime/functions/createVerifierEnvironment.md b/docs/api/runtime/functions/createVerifierEnvironment.md deleted file mode 100644 index c43882f..0000000 --- a/docs/api/runtime/functions/createVerifierEnvironment.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createVerifierEnvironment - -# Function: createVerifierEnvironment() - -> **createVerifierEnvironment**(`opts`): [`AgenticSurface`](../interfaces/AgenticSurface.md) - -Defined in: [runtime/verifier-environment.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/verifier-environment.ts#L67) - -## Parameters - -### opts - -[`VerifierEnvironmentOptions`](../interfaces/VerifierEnvironmentOptions.md) - -## Returns - -[`AgenticSurface`](../interfaces/AgenticSurface.md) diff --git a/docs/api/runtime/functions/createWaterfallCollector.md b/docs/api/runtime/functions/createWaterfallCollector.md deleted file mode 100644 index c36c033..0000000 --- a/docs/api/runtime/functions/createWaterfallCollector.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createWaterfallCollector - -# Function: createWaterfallCollector() - -> **createWaterfallCollector**(): [`WaterfallCollector`](../interfaces/WaterfallCollector.md) - -Defined in: [runtime/waterfall.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L58) - -## Returns - -[`WaterfallCollector`](../interfaces/WaterfallCollector.md) diff --git a/docs/api/runtime/functions/createWorktreeCliExecutor.md b/docs/api/runtime/functions/createWorktreeCliExecutor.md deleted file mode 100644 index a448fb4..0000000 --- a/docs/api/runtime/functions/createWorktreeCliExecutor.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / createWorktreeCliExecutor - -# Function: createWorktreeCliExecutor() - -> **createWorktreeCliExecutor**(`options`): [`Executor`](../interfaces/Executor.md)\<`WorktreeHarnessResult`\> - -Defined in: [runtime/supervise/worktree-cli-executor.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L85) - -**`Experimental`** - -Build a worktree-CLI leaf `Executor`. Per-spawn (a fresh worktree + abort + teardown each), so a -fanout of N profiles = N parallel worktrees that never clobber each other. - -Fail-loud: an empty `repoRoot`/`harness`/`taskPrompt` throws at construction. `resultArtifact()` -before `execute()` resolves throws. - -## Parameters - -### options - -[`WorktreeCliExecutorOptions`](../interfaces/WorktreeCliExecutorOptions.md) - -## Returns - -[`Executor`](../interfaces/Executor.md)\<`WorktreeHarnessResult`\> diff --git a/docs/api/runtime/functions/decodeToolPart.md b/docs/api/runtime/functions/decodeToolPart.md deleted file mode 100644 index 5a52794..0000000 --- a/docs/api/runtime/functions/decodeToolPart.md +++ /dev/null @@ -1,28 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / decodeToolPart - -# Function: decodeToolPart() - -> **decodeToolPart**(`part`, `harness?`): [`ToolStepInput`](../interfaces/ToolStepInput.md) \| `undefined` - -Defined in: [runtime/supervise/trace-source.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L138) - -Decode a part with a specific harness's adapter when known, else try every registered adapter - (the composite — robust to mixed/unknown streams). Never throws. - -## Parameters - -### part - -`unknown` - -### harness? - -`string` - -## Returns - -[`ToolStepInput`](../interfaces/ToolStepInput.md) \| `undefined` diff --git a/docs/api/runtime/functions/defaultSelectWinner.md b/docs/api/runtime/functions/defaultSelectWinner.md deleted file mode 100644 index 8ee33e2..0000000 --- a/docs/api/runtime/functions/defaultSelectWinner.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / defaultSelectWinner - -# Function: defaultSelectWinner() - -> **defaultSelectWinner**\<`Task`, `Output`\>(`iterations`): [`LoopWinner`](../interfaces/LoopWinner.md)\<`Task`, `Output`\> \| `undefined` - -Defined in: [runtime/run-loop.ts:983](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L983) - -The kernel's winner argmax — best-valid-score, ties broken by earliest index, -falling back to the best-scoring non-errored output when none is valid. Exported -so the `runProgram` tree executor selects across merged sub-loop iterations with -the SAME semantics the kernel uses at a single loop's finalize (one selector, not -a forked copy). - -## Type Parameters - -### Task - -`Task` - -### Output - -`Output` - -## Parameters - -### iterations - -[`Iteration`](../interfaces/Iteration.md)\<`Task`, `Output`\>[] - -## Returns - -[`LoopWinner`](../interfaces/LoopWinner.md)\<`Task`, `Output`\> \| `undefined` diff --git a/docs/api/runtime/functions/defaultToolDetectors.md b/docs/api/runtime/functions/defaultToolDetectors.md deleted file mode 100644 index c8c4828..0000000 --- a/docs/api/runtime/functions/defaultToolDetectors.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / defaultToolDetectors - -# Function: defaultToolDetectors() - -> **defaultToolDetectors**(): `StreamingDetector`[] - -Defined in: [runtime/supervise/detector-monitor.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/detector-monitor.ts#L37) - -The default online panel for a tool-call pipe: a worker repeating the same call, or hammering - consecutive errors. (No-progress needs a domain progress-probe, so it is opt-in, not default.) - - Coverage note: `repeated-action` works for EVERY harness (it needs only tool name + args, which - every adapter provides). `error-streak` needs per-call status — opencode carries it inline - (`state.status`, VALIDATED live), but claude-code/codex tool-call parts do NOT (their errors live - in separate result blocks not yet decoded), so error-streak is silent for those until result-block - decoding is added + live-validated. It is in the panel because it is correct where status exists. - -## Returns - -`StreamingDetector`[] diff --git a/docs/api/runtime/functions/definePersona.md b/docs/api/runtime/functions/definePersona.md deleted file mode 100644 index 65b8d89..0000000 --- a/docs/api/runtime/functions/definePersona.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / definePersona - -# Function: definePersona() - -> **definePersona**\<`D`\>(`input`): [`Persona`](../interfaces/Persona.md)\<`D`\> - -Defined in: [runtime/personify/persona.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/persona.ts#L56) - -Build a frozen `Persona`. Fails loud on the executors-supplied invariant: a persona with -neither a pre-built registry nor a seam bag cannot resolve its built-in runtimes, so it is -unrunnable — refuse it at definition time, not at the first spawn. Pure; no I/O. - -## Type Parameters - -### D - -`D` = `unknown` - -## Parameters - -### input - -[`DefinePersonaInput`](../interfaces/DefinePersonaInput.md)\<`D`\> - -## Returns - -[`Persona`](../interfaces/Persona.md)\<`D`\> diff --git a/docs/api/runtime/functions/defineStrategy.md b/docs/api/runtime/functions/defineStrategy.md deleted file mode 100644 index 092e480..0000000 --- a/docs/api/runtime/functions/defineStrategy.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / defineStrategy - -# Function: defineStrategy() - -> **defineStrategy**(`name`, `run`): [`Strategy`](../interfaces/Strategy.md) - -Defined in: [runtime/strategy.ts:740](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L740) - -Author a Strategy from the composable steps — the open, compact way. - -## Parameters - -### name - -`string` - -### run - -(`ctx`) => `Promise`\<[`StrategyResult`](../interfaces/StrategyResult.md)\> - -## Returns - -[`Strategy`](../interfaces/Strategy.md) diff --git a/docs/api/runtime/functions/depthDriver.md b/docs/api/runtime/functions/depthDriver.md deleted file mode 100644 index 0e88616..0000000 --- a/docs/api/runtime/functions/depthDriver.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / depthDriver - -# Function: depthDriver() - -> **depthDriver**(`surface`, `task`, `opts`, `cfg`): [`Agent`](../interfaces/Agent.md)\<`unknown`, [`Outcome`](../type-aliases/Outcome.md)\<`unknown`\>\> - -Defined in: [runtime/strategy.ts:527](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L527) - -DEPTH: one persistent artifact, carried across analyst-steered shots. - -## Parameters - -### surface - -[`AgenticSurface`](../interfaces/AgenticSurface.md) - -### task - -[`AgenticTask`](../interfaces/AgenticTask.md) - -### opts - -[`AgenticOptions`](../interfaces/AgenticOptions.md) - -### cfg - -#### maxShots - -`number` - -## Returns - -[`Agent`](../interfaces/Agent.md)\<`unknown`, [`Outcome`](../type-aliases/Outcome.md)\<`unknown`\>\> diff --git a/docs/api/runtime/functions/deterministicCompletion.md b/docs/api/runtime/functions/deterministicCompletion.md deleted file mode 100644 index b77e403..0000000 --- a/docs/api/runtime/functions/deterministicCompletion.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / deterministicCompletion - -# Function: deterministicCompletion() - -> **deterministicCompletion**\<`Task`, `Output`\>(`check`): [`CompletionAnalyst`](../interfaces/CompletionAnalyst.md)\<`Task`, `Output`\> - -Defined in: [runtime/completion.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L111) - -Completion for a DETERMINISTIC check (build/test/lint/citation/proof): done iff the check -passes. Ground truth — the driver ends directly, no validation. The check reads the output -(a verifier), never the judge verdict — selector ≠ judge stays intact. - -## Type Parameters - -### Task - -`Task` - -### Output - -`Output` - -## Parameters - -### check - -(`output`, `history`) => `object` - -## Returns - -[`CompletionAnalyst`](../interfaces/CompletionAnalyst.md)\<`Task`, `Output`\> diff --git a/docs/api/runtime/functions/discriminatingMeans.md b/docs/api/runtime/functions/discriminatingMeans.md deleted file mode 100644 index 39ece32..0000000 --- a/docs/api/runtime/functions/discriminatingMeans.md +++ /dev/null @@ -1,30 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / discriminatingMeans - -# Function: discriminatingMeans() - -> **discriminatingMeans**(`report`, `fieldOrder`): `Record`\<`string`, \{ `score`: `number`; `usd`: `number`; \}\> \| `null` - -Defined in: [runtime/strategy-evolution.ts:237](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L237) - -Strategy means recomputed over the DISCRIMINATING tasks only — tasks where the field - strategies did not all score identically. Zero-spread tasks (everyone 1.0, everyone - 0.0, everyone tied) carry no selection information; averaging over them dilutes real - differences toward zero. Search-side denoising only — the gate never uses this. - -## Parameters - -### report - -[`BenchmarkReport`](../interfaces/BenchmarkReport.md) - -### fieldOrder - -`string`[] - -## Returns - -`Record`\<`string`, \{ `score`: `number`; `usd`: `number`; \}\> \| `null` diff --git a/docs/api/runtime/functions/driverChild.md b/docs/api/runtime/functions/driverChild.md deleted file mode 100644 index ca95a29..0000000 --- a/docs/api/runtime/functions/driverChild.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / driverChild - -# Function: driverChild() - -> **driverChild**\<`Out`\>(`name`, `driver`, `journal`): [`Agent`](../interfaces/Agent.md)\<`unknown`, `Out`\> - -Defined in: [runtime/supervise/driver-executor.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/driver-executor.ts#L77) - -Mark + carry a driver `Agent` so the recursive registry resolves it to the -driver-executor. The returned agent is SPAWNED (never run directly): its -`executorSpec` is marked `role: 'driver'` and carries the driver agent + the shared -journal so the executor can run its `act` inside a nested scope. `act` fails loud if -called directly — a driver child runs THROUGH its nested-scope executor, never as a root. - -## Type Parameters - -### Out - -`Out` - -## Parameters - -### name - -`string` - -### driver - -[`Agent`](../interfaces/Agent.md)\<`unknown`, `Out`\> - -### journal - -[`SpawnJournal`](../interfaces/SpawnJournal.md) - -## Returns - -[`Agent`](../interfaces/Agent.md)\<`unknown`, `Out`\> diff --git a/docs/api/runtime/functions/equalKOnCost.md b/docs/api/runtime/functions/equalKOnCost.md deleted file mode 100644 index a5c347d..0000000 --- a/docs/api/runtime/functions/equalKOnCost.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / equalKOnCost - -# Function: equalKOnCost() - -> **equalKOnCost**(`arms`, `options?`): [`EqualKVerdict`](../interfaces/EqualKVerdict.md) - -Defined in: [runtime/personify/trajectory.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/trajectory.ts#L143) - -Assert the arms are comparable at EQUAL conserved COST (tokens + usd), NOT raw iteration -count. Compares each arm's root-rolled-up `total` on the two conserved channels: an arm is -within-tolerance when the per-channel spread (max − min across arms) over the median is -`≤ tolerance`. Pure over the reports — no I/O. Fails loud on an empty arm list (nothing to -compare) so a vacuous "equal" is never returned. - -## Parameters - -### arms - -readonly [`EqualKArm`](../interfaces/EqualKArm.md)[] - -### options? - -[`EqualKOnCostOptions`](../interfaces/EqualKOnCostOptions.md) = `{}` - -## Returns - -[`EqualKVerdict`](../interfaces/EqualKVerdict.md) diff --git a/docs/api/runtime/functions/extractLlmCallEvent.md b/docs/api/runtime/functions/extractLlmCallEvent.md deleted file mode 100644 index 9534ee1..0000000 --- a/docs/api/runtime/functions/extractLlmCallEvent.md +++ /dev/null @@ -1,38 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / extractLlmCallEvent - -# Function: extractLlmCallEvent() - -> **extractLlmCallEvent**(`event`, `agentRunName`): RuntimeStreamEvent & \{ type: "llm\_call"; \} \| `undefined` - -Defined in: [runtime/sandbox-events.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-events.ts#L32) - -Extract a `RuntimeStreamEvent`-shaped `llm_call` from a sandbox event when -the event carries usage/cost data. Returns `undefined` for non-cost events -so the kernel can iterate the full stream without branching. - -Canonical cost-carrying types observed in the wild: - - `llm_call` — `data: { model, tokensIn, tokensOut, costUsd, ... }` - - `message.completed` / `result` — `data: { usage: { inputTokens, - outputTokens, totalCostUsd? } }` - - `cost.usage` / `usage` — same shape under a dedicated type - -Numeric coercion is strict: `Number.isFinite` gates every accumulator write -so a sentinel `NaN` from a misbehaving backend cannot poison the ledger. - -## Parameters - -### event - -`SandboxEvent` - -### agentRunName - -`string` - -## Returns - -RuntimeStreamEvent & \{ type: "llm\_call"; \} \| `undefined` diff --git a/docs/api/runtime/functions/fanout.md b/docs/api/runtime/functions/fanout.md deleted file mode 100644 index 1ac43a7..0000000 --- a/docs/api/runtime/functions/fanout.md +++ /dev/null @@ -1,45 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / fanout - -# Function: fanout() - -> **fanout**\<`Task`, `Item`, `D`\>(`items`, `opts`): [`CombinatorShape`](../type-aliases/CombinatorShape.md)\<`Task`, `D`\> - -Defined in: [runtime/personify/combinators.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/combinators.ts#L138) - -`fanout(items, opts)` — spawn one child per item in a single round (bounded by the conserved -pool's fail-closed admission), drain via `scope.next()`, then either synthesize over the -gathered settlements (one SEPARATE synthesis child) or return the best-valid child via the -single-sourced selector. A round that admitted zero children, or whose synthesis child could -not be admitted, is a concrete blocker. - -## Type Parameters - -### Task - -`Task` - -### Item - -`Item` - -### D - -`D` - -## Parameters - -### items - -readonly `Item`[] - -### opts - -[`FanoutOptions`](../interfaces/FanoutOptions.md)\<`Item`, `D`\> - -## Returns - -[`CombinatorShape`](../type-aliases/CombinatorShape.md)\<`Task`, `D`\> diff --git a/docs/api/runtime/functions/flatWidenGate.md b/docs/api/runtime/functions/flatWidenGate.md deleted file mode 100644 index 6283154..0000000 --- a/docs/api/runtime/functions/flatWidenGate.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / flatWidenGate - -# Function: flatWidenGate() - -> **flatWidenGate**\<`D`\>(): [`ScopeWidenGate`](../interfaces/ScopeWidenGate.md)\<`D`\> - -Defined in: [runtime/personify/combinators.ts:450](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/combinators.ts#L450) - -The flat default `ScopeWidenGate` — never widens, keeping the R2 selector≠judge collision -dormant. A gate run passes this explicitly; a test asserts the default is flat. - -## Type Parameters - -### D - -`D` - -## Returns - -[`ScopeWidenGate`](../interfaces/ScopeWidenGate.md)\<`D`\> diff --git a/docs/api/runtime/functions/gateOnDeliverable.md b/docs/api/runtime/functions/gateOnDeliverable.md deleted file mode 100644 index 6e74d5b..0000000 --- a/docs/api/runtime/functions/gateOnDeliverable.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / gateOnDeliverable - -# Function: gateOnDeliverable() - -> **gateOnDeliverable**\<`Out`\>(`inner`, `deliverable`): [`Executor`](../interfaces/Executor.md)\<`Out`\> - -Defined in: [runtime/supervise/completion-gate.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/completion-gate.ts#L44) - -Wrap an `Executor` so its settlement `valid` reflects the deliverable check, not the -inner verdict. Handles both `execute` shapes (one-shot `Promise` and -streaming `AsyncIterable` + `resultArtifact()`); the check runs once the inner -executor has produced its output. The inner `score` is preserved; only `valid` is gated. - -## Type Parameters - -### Out - -`Out` - -## Parameters - -### inner - -[`Executor`](../interfaces/Executor.md)\<`Out`\> - -### deliverable - -[`DeliverableSpec`](../interfaces/DeliverableSpec.md)\<`Out`\> - -## Returns - -[`Executor`](../interfaces/Executor.md)\<`Out`\> diff --git a/docs/api/runtime/functions/gitWorkspace.md b/docs/api/runtime/functions/gitWorkspace.md deleted file mode 100644 index fadc15a..0000000 --- a/docs/api/runtime/functions/gitWorkspace.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / gitWorkspace - -# Function: gitWorkspace() - -> **gitWorkspace**(`opts`): [`Workspace`](../interfaces/Workspace.md) - -Defined in: [runtime/workspace.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L46) - -## Parameters - -### opts - -[`GitWorkspaceOptions`](../interfaces/GitWorkspaceOptions.md) - -## Returns - -[`Workspace`](../interfaces/Workspace.md) diff --git a/docs/api/runtime/functions/harvestCorpus.md b/docs/api/runtime/functions/harvestCorpus.md deleted file mode 100644 index 4f3b3d7..0000000 --- a/docs/api/runtime/functions/harvestCorpus.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / harvestCorpus - -# Function: harvestCorpus() - -> **harvestCorpus**(`opts`): `Promise`\<[`HarvestReport`](../interfaces/HarvestReport.md)\> - -Defined in: [runtime/harvest-corpus.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L62) - -## Parameters - -### opts - -[`HarvestCorpusOptions`](../interfaces/HarvestCorpusOptions.md) - -## Returns - -`Promise`\<[`HarvestReport`](../interfaces/HarvestReport.md)\> diff --git a/docs/api/runtime/functions/inlineSandboxClient.md b/docs/api/runtime/functions/inlineSandboxClient.md deleted file mode 100644 index 3d87418..0000000 --- a/docs/api/runtime/functions/inlineSandboxClient.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / inlineSandboxClient - -# Function: inlineSandboxClient() - -> **inlineSandboxClient**(`factory`): [`SandboxClient`](../interfaces/SandboxClient.md) - -Defined in: [runtime/inline-sandbox-client.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/inline-sandbox-client.ts#L44) - -Adapt an `ExecutorFactory` into a `SandboxClient` for `runLoop`. The factory is -instantiated fresh per `streamPrompt` (mirrors the per-spawn executor lifecycle): -run once on the prompt, emit the terminal result event, tear down. - -## Parameters - -### factory - -[`ExecutorFactory`](../type-aliases/ExecutorFactory.md)\<`unknown`\> - -## Returns - -[`SandboxClient`](../interfaces/SandboxClient.md) diff --git a/docs/api/runtime/functions/isDriverSpec.md b/docs/api/runtime/functions/isDriverSpec.md deleted file mode 100644 index 0ed5a53..0000000 --- a/docs/api/runtime/functions/isDriverSpec.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / isDriverSpec - -# Function: isDriverSpec() - -> **isDriverSpec**(`spec`): `spec is DriverSpec` - -Defined in: [runtime/supervise/driver-executor.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/driver-executor.ts#L100) - -True when a spec is a driver child (carries the role marker + a driver Agent). - -## Parameters - -### spec - -[`AgentSpec`](../interfaces/AgentSpec.md) - -## Returns - -`spec is DriverSpec` diff --git a/docs/api/runtime/functions/isNonEmptyPatch.md b/docs/api/runtime/functions/isNonEmptyPatch.md deleted file mode 100644 index a366e2f..0000000 --- a/docs/api/runtime/functions/isNonEmptyPatch.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / isNonEmptyPatch - -# Function: isNonEmptyPatch() - -> **isNonEmptyPatch**(`patch`): `boolean` - -Defined in: [runtime/supervise/patch-checks.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L75) - -True when the patch actually changes something — at least one touched path AND non-blank body. - An empty patch can trivially "pass" tests/typecheck (nothing changed) yet does no work. - -## Parameters - -### patch - -`string` - -## Returns - -`boolean` diff --git a/docs/api/runtime/functions/jjWorkspace.md b/docs/api/runtime/functions/jjWorkspace.md deleted file mode 100644 index 4416d9c..0000000 --- a/docs/api/runtime/functions/jjWorkspace.md +++ /dev/null @@ -1,26 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / jjWorkspace - -# Function: jjWorkspace() - -> **jjWorkspace**(`opts`): [`Workspace`](../interfaces/Workspace.md) - -Defined in: [runtime/workspace.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L90) - -A jj-backed `Workspace` (Jujutsu, colocated with git for the durable remote). - Same port, same `Shell` — a drop-in for `gitWorkspace`. jj suits agent loops: - no staging area, and a first-class operation log (native resume/undo). Live use - requires `jj` on the `Shell`'s host. - -## Parameters - -### opts - -[`GitWorkspaceOptions`](../interfaces/GitWorkspaceOptions.md) - -## Returns - -[`Workspace`](../interfaces/Workspace.md) diff --git a/docs/api/runtime/functions/localShell.md b/docs/api/runtime/functions/localShell.md deleted file mode 100644 index c7c1505..0000000 --- a/docs/api/runtime/functions/localShell.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / localShell - -# Function: localShell() - -> **localShell**(): [`Shell`](../type-aliases/Shell.md) - -Defined in: [runtime/workspace.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L18) - -## Returns - -[`Shell`](../type-aliases/Shell.md) diff --git a/docs/api/runtime/functions/loopDispatch.md b/docs/api/runtime/functions/loopDispatch.md deleted file mode 100644 index 162501b..0000000 --- a/docs/api/runtime/functions/loopDispatch.md +++ /dev/null @@ -1,47 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / loopDispatch - -# Function: loopDispatch() - -> **loopDispatch**\<`Task`, `Output`, `Decision`, `TScenario`, `TArtifact`\>(`opts`): `ProfileDispatchFn`\<`TScenario`, `TArtifact`\> - -Defined in: [runtime/loop-dispatch.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L114) - -Adapter for `runProfileMatrix` (profile is an axis). Returns a -`ProfileDispatchFn` that runs `runLoop` per (profile, scenario) cell and -reports usage automatically. - -## Type Parameters - -### Task - -`Task` - -### Output - -`Output` - -### Decision - -`Decision` - -### TScenario - -`TScenario` *extends* `Scenario` - -### TArtifact - -`TArtifact` - -## Parameters - -### opts - -[`LoopDispatchOptions`](../interfaces/LoopDispatchOptions.md)\<`Task`, `Output`, `Decision`, `TScenario`, `TArtifact`\> - -## Returns - -`ProfileDispatchFn`\<`TScenario`, `TArtifact`\> diff --git a/docs/api/runtime/functions/loopUntil.md b/docs/api/runtime/functions/loopUntil.md deleted file mode 100644 index 79be9f6..0000000 --- a/docs/api/runtime/functions/loopUntil.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / loopUntil - -# Function: loopUntil() - -> **loopUntil**\<`Task`, `State`, `D`\>(`seed`, `spec`): [`CombinatorShape`](../type-aliases/CombinatorShape.md)\<`Task`, `D`\> - -Defined in: [runtime/personify/combinators.ts:221](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/combinators.ts#L221) - -`loopUntil(seed, spec)` — one `step` child per round; `fold` accumulates each settlement into -the running state; `until` (reading the round's trace findings, NOT a fresh raw verdict) is -the deployable stop. The conserved pool IS the loop bound: once `spawn` fails closed the loop -stops. A loop that exhausted the pool without `until` ever satisfying is a concrete blocker. - -When `ctx.analyst` is set, each round runs it over the children settled so far and steers -`until` on the resulting trace-derived findings (the analyst spawns into THIS scope, so its -compute is conserved-pooled — equal-k holds by construction). Absent an analyst the findings -argument is the empty array — never a fabricated finding (fail-loud honesty over a silent default). - -## Type Parameters - -### Task - -`Task` - -### State - -`State` - -### D - -`D` - -## Parameters - -### seed - -`State` - -### spec - -[`LoopUntilSpec`](../interfaces/LoopUntilSpec.md)\<`Task`, `State`, `D`\> - -## Returns - -[`CombinatorShape`](../type-aliases/CombinatorShape.md)\<`Task`, `D`\> diff --git a/docs/api/runtime/functions/mapSandboxEvent.md b/docs/api/runtime/functions/mapSandboxEvent.md deleted file mode 100644 index ed044f6..0000000 --- a/docs/api/runtime/functions/mapSandboxEvent.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / mapSandboxEvent - -# Function: mapSandboxEvent() - -> **mapSandboxEvent**(`event`, `opts?`): [`RuntimeStreamEvent`](../../index/type-aliases/RuntimeStreamEvent.md) \| `undefined` - -Defined in: [runtime/sandbox-events.ts:123](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-events.ts#L123) - -Project one `SandboxEvent` onto the `RuntimeStreamEvent` chat-UX vocabulary, -for runtimes that bridge a sandbox `streamPrompt` into the -`AgentRuntime.act` streaming contract. Returns `undefined` for events that -have no faithful projection — the raw stream is preserved separately for the -`OutputAdapter`, so an unmapped event never loses data. - -Mapped (the task-optional incremental variants — no synthesized task -lifecycle, no guessed tool-part shapes): - - `message.part.updated` text part → `text_delta` - - `message.part.updated` reasoning/thinking part → `reasoning_delta` - - cost-bearing events → `llm_call` (shared with the ledger extractor) - -The opencode backend emits incremental text as -`{ type: 'message.part.updated', data: { part: { type, text }, delta } }`; -`delta` is the increment, `part.text` the running accumulation. - -## Parameters - -### event - -`SandboxEvent` - -### opts? - -#### agentRunName? - -`string` - -## Returns - -[`RuntimeStreamEvent`](../../index/type-aliases/RuntimeStreamEvent.md) \| `undefined` diff --git a/docs/api/runtime/functions/materializeTreeView.md b/docs/api/runtime/functions/materializeTreeView.md deleted file mode 100644 index be9fbb2..0000000 --- a/docs/api/runtime/functions/materializeTreeView.md +++ /dev/null @@ -1,26 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / materializeTreeView - -# Function: materializeTreeView() - -> **materializeTreeView**(`events`): [`TreeView`](../interfaces/TreeView.md) - -Defined in: [durable/spawn-journal.ts:383](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L383) - -Materialize the live tree (`TreeView`) from a journaled event list for resume. Folds -`spawned`/`settled`/`cancelled` into a per-node snapshot in `seq` order, then adds each -`metered` event's driver-inference spend onto its node in a separate additive pass — so the -resumed view matches what `scope.view` showed at the recorded cursor position. - -## Parameters - -### events - -[`SpawnEvent`](../type-aliases/SpawnEvent.md)[] - -## Returns - -[`TreeView`](../interfaces/TreeView.md) diff --git a/docs/api/runtime/functions/observe.md b/docs/api/runtime/functions/observe.md deleted file mode 100644 index 508fa3b..0000000 --- a/docs/api/runtime/functions/observe.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / observe - -# Function: observe() - -> **observe**(`input`, `opts`): `Promise`\<[`Observation`](../interfaces/Observation.md)\> - -Defined in: [runtime/observe.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L139) - -## Parameters - -### input - -[`ObserveInput`](../interfaces/ObserveInput.md) - -### opts - -[`ObserveOptions`](../interfaces/ObserveOptions.md) - -## Returns - -`Promise`\<[`Observation`](../interfaces/Observation.md)\> diff --git a/docs/api/runtime/functions/openSandboxRun.md b/docs/api/runtime/functions/openSandboxRun.md deleted file mode 100644 index 8a59b4c..0000000 --- a/docs/api/runtime/functions/openSandboxRun.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / openSandboxRun - -# Function: openSandboxRun() - -> **openSandboxRun**\<`Out`\>(`client`, `options`, `deliverable`): `Promise`\<[`SandboxRun`](../interfaces/SandboxRun.md)\<`Out`\>\> - -Defined in: [runtime/sandbox-run.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L104) - -**`Experimental`** - -Open a sandbox run. Harness-agnostic: the harness lives in -`options.agentRun.sandboxOverrides.backend.type`, so opencode/codex/claude-code/ -kimi-code all flow through this one entrypoint with identical env/auth wiring. - -## Type Parameters - -### Out - -`Out` - -## Parameters - -### client - -[`SandboxClient`](../interfaces/SandboxClient.md) - -### options - -[`OpenSandboxRunOptions`](../interfaces/OpenSandboxRunOptions.md) - -### deliverable - -[`Deliverable`](../type-aliases/Deliverable.md)\<`Out`\> - -## Returns - -`Promise`\<[`SandboxRun`](../interfaces/SandboxRun.md)\<`Out`\>\> diff --git a/docs/api/runtime/functions/panel.md b/docs/api/runtime/functions/panel.md deleted file mode 100644 index 5437b26..0000000 --- a/docs/api/runtime/functions/panel.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / panel - -# Function: panel() - -> **panel**\<`Task`, `Artifact`, `D`\>(`spec`): [`CombinatorShape`](../type-aliases/CombinatorShape.md)\<`Task`, `D`\> - -Defined in: [runtime/personify/combinators.ts:273](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/combinators.ts#L273) - -`panel(spec)` — spawn the M judge children over the SAME artifact, drain their settlements, -and fold them into a panel verdict via the pure WRITE-ONLY `merge` (a judge's output never -reaches another judge's task; the merge never spawns or re-ranks). A `down` judge carries no -verdict and is excluded from the merge denominator. A panel that admitted no judge is a -concrete blocker before `merge` is consulted. - -## Type Parameters - -### Task - -`Task` - -### Artifact - -`Artifact` - -### D - -`D` - -## Parameters - -### spec - -[`PanelSpec`](../interfaces/PanelSpec.md)\<`Artifact`, `D`\> - -## Returns - -[`CombinatorShape`](../type-aliases/CombinatorShape.md)\<`Task`, `D`\> diff --git a/docs/api/runtime/functions/patchDelivered.md b/docs/api/runtime/functions/patchDelivered.md deleted file mode 100644 index 88877af..0000000 --- a/docs/api/runtime/functions/patchDelivered.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / patchDelivered - -# Function: patchDelivered() - -> **patchDelivered**(`options?`): [`DeliverableSpec`](../interfaces/DeliverableSpec.md)\<`WorktreeHarnessResult`\> - -Defined in: [runtime/supervise/patch-deliverable.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-deliverable.ts#L44) - -**`Experimental`** - -Build the `DeliverableSpec`: `check(artifact)` runs the shared mechanical -gate (`runCoderChecks`) over the captured patch + the worktree-derived pass signals and returns -whether the patch is DELIVERED (the `valid` conjunction). - -## Parameters - -### options? - -[`PatchDeliverableOptions`](../interfaces/PatchDeliverableOptions.md) = `{}` - -## Returns - -[`DeliverableSpec`](../interfaces/DeliverableSpec.md)\<`WorktreeHarnessResult`\> diff --git a/docs/api/runtime/functions/pickChampion.md b/docs/api/runtime/functions/pickChampion.md deleted file mode 100644 index 3880a3c..0000000 --- a/docs/api/runtime/functions/pickChampion.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / pickChampion - -# Function: pickChampion() - -> **pickChampion**(`means`, `fieldOrder`, `policy`, `epsilon`): [`ChampionPick`](../interfaces/ChampionPick.md) - -Defined in: [runtime/strategy-evolution.ts:262](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L262) - -The champion pick over a means table. 'score' takes the best mean score (ties → - field order). 'costAware' treats scores within `epsilon` of the best as tied and - takes the cheapest — the (score, $) Pareto rule collapsed to one pick. - -## Parameters - -### means - -`Record`\<`string`, \{ `score`: `number`; `usd`: `number`; \}\> - -### fieldOrder - -`string`[] - -### policy - -[`ChampionPolicy`](../type-aliases/ChampionPolicy.md) - -### epsilon - -`number` - -## Returns - -[`ChampionPick`](../interfaces/ChampionPick.md) diff --git a/docs/api/runtime/functions/pipeline.md b/docs/api/runtime/functions/pipeline.md deleted file mode 100644 index 335467d..0000000 --- a/docs/api/runtime/functions/pipeline.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / pipeline - -# Function: pipeline() - -> **pipeline**\<`Task`, `D`\>(`stages`): [`CombinatorShape`](../type-aliases/CombinatorShape.md)\<`Task`, `D`\> - -Defined in: [runtime/personify/combinators.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/combinators.ts#L100) - -`pipeline(stages)` — run the stages in order, feeding each stage's `done` deliverable into the -next stage's task. The first stage that ends `blocked` (a child that went down, a child the -pool would not admit, or a stage whose `collect` chose to block) short-circuits — its blockers -ARE the pipeline's blockers, never coerced past a failed stage. The terminal stage's `done` -deliverable is the pipeline's deliverable. - -## Type Parameters - -### Task - -`Task` - -### D - -`D` - -## Parameters - -### stages - -readonly [`PipelineStage`](../interfaces/PipelineStage.md)\<`Task`, `unknown`, `unknown`\>[] - -## Returns - -[`CombinatorShape`](../type-aliases/CombinatorShape.md)\<`Task`, `D`\> diff --git a/docs/api/runtime/functions/printBenchmarkReport.md b/docs/api/runtime/functions/printBenchmarkReport.md deleted file mode 100644 index 1fc5684..0000000 --- a/docs/api/runtime/functions/printBenchmarkReport.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / printBenchmarkReport - -# Function: printBenchmarkReport() - -> **printBenchmarkReport**(`report`): `void` - -Defined in: [runtime/run-benchmark.ts:231](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L231) - -Pretty-print a report — the "free optimization" verdict, with the cost vector. - -## Parameters - -### report - -[`BenchmarkReport`](../interfaces/BenchmarkReport.md) - -## Returns - -`void` diff --git a/docs/api/runtime/functions/probeSandboxCapabilities.md b/docs/api/runtime/functions/probeSandboxCapabilities.md deleted file mode 100644 index 6148bc1..0000000 --- a/docs/api/runtime/functions/probeSandboxCapabilities.md +++ /dev/null @@ -1,28 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / probeSandboxCapabilities - -# Function: probeSandboxCapabilities() - -> **probeSandboxCapabilities**(`client`): `Promise`\<[`SandboxCapabilities`](../interfaces/SandboxCapabilities.md)\> - -Defined in: [runtime/sandbox-capabilities.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-capabilities.ts#L45) - -**`Experimental`** - -Probe (and memoize per client) what the loop may rely on. A client without a -`criuStatus` method, or whose probe rejects, yields `canFork = false` — a -failed probe must never claim a capability the platform may not have. The -promise is cached so concurrent fanout branches share one round-trip. - -## Parameters - -### client - -[`SandboxClient`](../interfaces/SandboxClient.md) - -## Returns - -`Promise`\<[`SandboxCapabilities`](../interfaces/SandboxCapabilities.md)\> diff --git a/docs/api/runtime/functions/promotionGate.md b/docs/api/runtime/functions/promotionGate.md deleted file mode 100644 index 09653a6..0000000 --- a/docs/api/runtime/functions/promotionGate.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / promotionGate - -# Function: promotionGate() - -> **promotionGate**(`opts`): [`PromotionVerdict`](../interfaces/PromotionVerdict.md) - -Defined in: [runtime/promotion-gate.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L63) - -## Parameters - -### opts - -[`PromotionGateOptions`](../interfaces/PromotionGateOptions.md) - -## Returns - -[`PromotionVerdict`](../interfaces/PromotionVerdict.md) diff --git a/docs/api/runtime/functions/registerShape.md b/docs/api/runtime/functions/registerShape.md deleted file mode 100644 index ec48f31..0000000 --- a/docs/api/runtime/functions/registerShape.md +++ /dev/null @@ -1,38 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / registerShape - -# Function: registerShape() - -> **registerShape**\<`Task`, `D`\>(`name`, `factory`): `void` - -Defined in: [runtime/personify/registry.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/registry.ts#L53) - -Register a composed shape on the default `builtinShapes` registry — the one-call extension - point a caller invokes so its shape is resolvable by name with zero edits to the engine. - -## Type Parameters - -### Task - -`Task` - -### D - -`D` - -## Parameters - -### name - -`string` - -### factory - -[`LoopShape`](../type-aliases/LoopShape.md)\<`Task`, `D`\> - -## Returns - -`void` diff --git a/docs/api/runtime/functions/registryScopeAnalyst.md b/docs/api/runtime/functions/registryScopeAnalyst.md deleted file mode 100644 index 9a9a5b2..0000000 --- a/docs/api/runtime/functions/registryScopeAnalyst.md +++ /dev/null @@ -1,42 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / registryScopeAnalyst - -# Function: registryScopeAnalyst() - -> **registryScopeAnalyst**\<`D`\>(`registry`, `buildInputs`): [`ScopeAnalyst`](../interfaces/ScopeAnalyst.md)\<`D`\> - -Defined in: [runtime/personify/analyst.ts:202](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L202) - -A `ScopeAnalyst` backed by an `AnalystRegistry` — the panel-of-analysts seam. The registry merges -N analyst KINDS into one `AnalystRunResult.findings`; `analyze` runs it over the caller-projected -`{ runId, inputs }` and pipes the merged findings through the SAME `assertTraceDerivedFindings` -firewall `createScopeAnalyst` uses (single-sourced selector≠judge). Distinct from `panel()` -(judges-vs-one-artifact) — this is analysts-over-a-trace, the diagnosis side of the wire. - -Fail loud: a registry that throws propagates; a judge-derived finding aborts via the firewall. -The projection is the caller's (`buildInputs`) — if the scope settlements do not cleanly map to -the registry's `AnalystRunInputs`, that is a caller-side contract gap, surfaced there, not papered -over with a fabricated input here. - -## Type Parameters - -### D - -`D` - -## Parameters - -### registry - -[`AnalystRegistryLike`](../../analyst-loop/interfaces/AnalystRegistryLike.md) - -### buildInputs - -(`input`) => [`RegistryAnalyzeProjection`](../interfaces/RegistryAnalyzeProjection.md) - -## Returns - -[`ScopeAnalyst`](../interfaces/ScopeAnalyst.md)\<`D`\> diff --git a/docs/api/runtime/functions/renderAnytimeTable.md b/docs/api/runtime/functions/renderAnytimeTable.md deleted file mode 100644 index 2cd6b63..0000000 --- a/docs/api/runtime/functions/renderAnytimeTable.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / renderAnytimeTable - -# Function: renderAnytimeTable() - -> **renderAnytimeTable**(`report`): `string` - -Defined in: [runtime/anytime.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L164) - -One row per (strategy, satisficing target): the shareable time-to-satisfactory table. - -## Parameters - -### report - -[`AnytimeReport`](../interfaces/AnytimeReport.md) - -## Returns - -`string` diff --git a/docs/api/runtime/functions/renderCorpusToInstructions.md b/docs/api/runtime/functions/renderCorpusToInstructions.md deleted file mode 100644 index 3443210..0000000 --- a/docs/api/runtime/functions/renderCorpusToInstructions.md +++ /dev/null @@ -1,32 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / renderCorpusToInstructions - -# Function: renderCorpusToInstructions() - -> **renderCorpusToInstructions**(`opts`): `Promise`\<`AgentProfile`\> - -Defined in: [runtime/personify/corpus.ts:301](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/corpus.ts#L301) - -The learning-flywheel READ side. Queries the corpus through `filter`, renders the matching facts -(most-confident first, capped by `maxLines`) into instruction lines, and returns a FRESH -`AgentProfile` with them merged in — never mutates the input profile. Default `target: 'prompt'` -appends the lines to `prompt.instructions[]` (the additive append-line seam); `target: -'resources'` folds them into the single-blob `resources.instructions` string (preserving any -existing blob, but failing loud on a non-string existing blob — a `resources.instructions` that -was already an `AgentProfileResourceRef` cannot be string-appended without dropping it). - -An empty query result returns a fresh COPY of the profile with no instruction change (a valid -"nothing learned yet" read, not an error). - -## Parameters - -### opts - -[`RenderCorpusToInstructionsOptions`](../interfaces/RenderCorpusToInstructionsOptions.md) - -## Returns - -`Promise`\<`AgentProfile`\> diff --git a/docs/api/runtime/functions/renderReport.md b/docs/api/runtime/functions/renderReport.md deleted file mode 100644 index 2ba640f..0000000 --- a/docs/api/runtime/functions/renderReport.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / renderReport - -# Function: renderReport() - -> **renderReport**(`findings`): `string` - -Defined in: [runtime/observe.ts:226](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L226) - -Operator-facing report, split by who should act. The agent block is the - steer; the operator block is the advice. - -## Parameters - -### findings - -readonly `AnalystFinding`[] - -## Returns - -`string` diff --git a/docs/api/runtime/functions/replaySpawnTree.md b/docs/api/runtime/functions/replaySpawnTree.md deleted file mode 100644 index 09442ed..0000000 --- a/docs/api/runtime/functions/replaySpawnTree.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / replaySpawnTree - -# Function: replaySpawnTree() - -> **replaySpawnTree**(`journal`, `blobs`, `root`): `Promise`\<[`Settled`](../type-aliases/Settled.md)\<`unknown`\>[]\> - -Defined in: [durable/spawn-journal.ts:301](https://github.com/tangle-network/agent-runtime/blob/main/src/durable/spawn-journal.ts#L301) - -Re-feed a journaled spawn tree in strict `seq` order, rehydrating each settled -child's `out` from the blob store by `outRef`, and return the `Settled[]` exactly -as `scope.next()` originally delivered them. - -Determinism (B2): the events are sorted by `seq` BEFORE any blob `get`, so the -replay order is the recorded cursor order regardless of how fast each rehydration -resolves. `at` (wall-clock) is never a replay input. Fail loud on a tree that was -never begun, a settled-done event missing its `outRef`, or a blob the store can't -rehydrate — a silent gap would let `act` branch on the wrong evidence. - -## Parameters - -### journal - -[`SpawnJournal`](../interfaces/SpawnJournal.md) - -### blobs - -[`ResultBlobStore`](../interfaces/ResultBlobStore.md) - -### root - -`string` - -## Returns - -`Promise`\<[`Settled`](../type-aliases/Settled.md)\<`unknown`\>[]\> diff --git a/docs/api/runtime/functions/reportLoopUsage.md b/docs/api/runtime/functions/reportLoopUsage.md deleted file mode 100644 index 133a947..0000000 --- a/docs/api/runtime/functions/reportLoopUsage.md +++ /dev/null @@ -1,47 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / reportLoopUsage - -# Function: reportLoopUsage() - -> **reportLoopUsage**\<`Task`, `Output`, `Decision`\>(`cost`, `result`, `source?`): `void` - -Defined in: [runtime/report-usage.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/report-usage.ts#L34) - -Forward a `LoopResult`'s aggregated cost + token usage into a campaign cost -meter so the backend-integrity guard sees real LLM activity. `source` -defaults to `'loop'`. - -## Type Parameters - -### Task - -`Task` - -### Output - -`Output` - -### Decision - -`Decision` - -## Parameters - -### cost - -[`UsageSink`](../interfaces/UsageSink.md) - -### result - -`Pick`\<[`LoopResult`](../interfaces/LoopResult.md)\<`Task`, `Output`, `Decision`\>, `"costUsd"` \| `"tokenUsage"`\> - -### source? - -`string` = `'loop'` - -## Returns - -`void` diff --git a/docs/api/runtime/functions/routerChatWithTools.md b/docs/api/runtime/functions/routerChatWithTools.md deleted file mode 100644 index bb11fef..0000000 --- a/docs/api/runtime/functions/routerChatWithTools.md +++ /dev/null @@ -1,52 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / routerChatWithTools - -# Function: routerChatWithTools() - -> **routerChatWithTools**(`cfg`, `messages`, `tools`, `opts?`): `Promise`\<[`RouterChatToolsResult`](../interfaces/RouterChatToolsResult.md)\> - -Defined in: [runtime/router-client.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L116) - -A router completion WITH tool-calling — the operator driver's LLM seam. Passes OpenAI-shape -`messages` (system/user/assistant-with-tool_calls/tool roles) + function `tools`, and returns the -assistant text plus the tool calls the model wants run. Same fail-loud + real-usage discipline as -`routerChatWithUsage`. `tool_choice: 'auto'` lets the model decide; the driver loops on the result. - -## Parameters - -### cfg - -[`RouterConfig`](../interfaces/RouterConfig.md) - -### messages - -readonly `Record`\<`string`, `unknown`\>[] - -### tools - -readonly `object`[] - -### opts? - -#### temperature? - -`number` - -#### signal? - -`AbortSignal` - -#### toolChoice? - -`"auto"` \| `"none"` \| `"required"` - -#### maxTokens? - -`number` - -## Returns - -`Promise`\<[`RouterChatToolsResult`](../interfaces/RouterChatToolsResult.md)\> diff --git a/docs/api/runtime/functions/routerChatWithUsage.md b/docs/api/runtime/functions/routerChatWithUsage.md deleted file mode 100644 index 9aa99ec..0000000 --- a/docs/api/runtime/functions/routerChatWithUsage.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / routerChatWithUsage - -# Function: routerChatWithUsage() - -> **routerChatWithUsage**(`cfg`, `messages`, `opts?`): `Promise`\<[`RouterChatResult`](../interfaces/RouterChatResult.md)\> - -Defined in: [runtime/router-client.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L29) - -## Parameters - -### cfg - -[`RouterConfig`](../interfaces/RouterConfig.md) - -### messages - -`object`[] - -### opts? - -#### temperature? - -`number` - -#### signal? - -`AbortSignal` - -#### maxTokens? - -`number` - -## Returns - -`Promise`\<[`RouterChatResult`](../interfaces/RouterChatResult.md)\> diff --git a/docs/api/runtime/functions/routerDriverChat.md b/docs/api/runtime/functions/routerDriverChat.md deleted file mode 100644 index a881741..0000000 --- a/docs/api/runtime/functions/routerDriverChat.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / routerDriverChat - -# Function: routerDriverChat() - -> **routerDriverChat**(`c`, `opts?`): [`DriverChat`](../interfaces/DriverChat.md) - -Defined in: [runtime/supervise/router-driver-chat.ts:12](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/router-driver-chat.ts#L12) - -## Parameters - -### c - -[`RouterConfig`](../interfaces/RouterConfig.md) - -### opts? - -#### temperature? - -`number` - -## Returns - -[`DriverChat`](../interfaces/DriverChat.md) diff --git a/docs/api/runtime/functions/routerToolLoop.md b/docs/api/runtime/functions/routerToolLoop.md deleted file mode 100644 index 184823e..0000000 --- a/docs/api/runtime/functions/routerToolLoop.md +++ /dev/null @@ -1,72 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / routerToolLoop - -# Function: routerToolLoop() - -> **routerToolLoop**(`cfg`, `system`, `user`, `tools`, `execute`, `opts?`): `Promise`\<[`RouterToolLoopResult`](../interfaces/RouterToolLoopResult.md)\> - -Defined in: [runtime/router-client.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L207) - -The tool-using router backend: a real agentic loop OVER the Tangle router (which -supports tool-calling), off-box — no sandbox. Each turn is one router completion -with `tools`; if the model emits tool_calls, `execute` runs them on the host and -their results are folded back as `tool` messages; the loop repeats until the -model answers without a tool call or the turn budget is hit. One turn = one -inference call, so `maxTurns` is the equal-compute unit against random@k. - -This is the depth substrate for agentic gates (the worker ACTS, observes the real -result, and continues) that the chat-only `routerChatWithUsage` cannot express. - -## Parameters - -### cfg - -[`RouterConfig`](../interfaces/RouterConfig.md) - -### system - -`string` - -### user - -`string` - -### tools - -readonly [`ToolSpec`](../interfaces/ToolSpec.md)[] - -### execute - -(`name`, `args`) => `Promise`\<`string`\> - -### opts? - -#### maxTurns? - -`number` - -#### temperature? - -`number` - -#### signal? - -`AbortSignal` - -#### maxTokens? - -`number` - -#### initialMessages? - -readonly `Record`\<`string`, `unknown`\>[] - -Seed the loop with an existing conversation (depth continuation) instead of - `[system, user]`. When set, `system`/`user` are ignored. The array is copied. - -## Returns - -`Promise`\<[`RouterToolLoopResult`](../interfaces/RouterToolLoopResult.md)\> diff --git a/docs/api/runtime/functions/runAgentic.md b/docs/api/runtime/functions/runAgentic.md deleted file mode 100644 index c220acd..0000000 --- a/docs/api/runtime/functions/runAgentic.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / runAgentic - -# Function: runAgentic() - -> **runAgentic**(`opts`): `Promise`\<[`AgenticRunResult`](../interfaces/AgenticRunResult.md)\> - -Defined in: [runtime/strategy.ts:981](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L981) - -Run a Strategy through the keystone Supervisor — `Agent.act` over a conserved-budget Scope. - -## Parameters - -### opts - -[`RunAgenticOptions`](../interfaces/RunAgenticOptions.md) - -## Returns - -`Promise`\<[`AgenticRunResult`](../interfaces/AgenticRunResult.md)\> diff --git a/docs/api/runtime/functions/runBenchmark.md b/docs/api/runtime/functions/runBenchmark.md deleted file mode 100644 index 41d79a2..0000000 --- a/docs/api/runtime/functions/runBenchmark.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / runBenchmark - -# Function: runBenchmark() - -> **runBenchmark**(`cfg`): `Promise`\<[`BenchmarkReport`](../interfaces/BenchmarkReport.md)\> - -Defined in: [runtime/run-benchmark.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L132) - -Run the requested strategies over the tasks, scored by the Environment's own check. - Resilient: a task whose rollouts fail (transient infra) is excluded from the stats but - reported in `perTask` with the error — never silently dropped. - -## Parameters - -### cfg - -[`BenchmarkConfig`](../interfaces/BenchmarkConfig.md) - -## Returns - -`Promise`\<[`BenchmarkReport`](../interfaces/BenchmarkReport.md)\> diff --git a/docs/api/runtime/functions/runCoderChecks.md b/docs/api/runtime/functions/runCoderChecks.md deleted file mode 100644 index 5a9c246..0000000 --- a/docs/api/runtime/functions/runCoderChecks.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / runCoderChecks - -# Function: runCoderChecks() - -> **runCoderChecks**(`input`, `constraints?`): `DefaultVerdict` - -Defined in: [runtime/supervise/patch-checks.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L96) - -**`Experimental`** - -The pure mechanical gate — the SINGLE source of the no-op / always-on secret-path floor / -diff-size / forbidden-path / test / typecheck checks. No I/O: it scores a patch + its -already-derived pass signals. - -Checks in order: (1) no-op rejection, (2) always-on secret-path floor (independent of -`forbiddenPaths`), (3) forbidden-path, (4) diff-size cap, (5) tests, (6) typecheck. -Aggregate score: `0.5*tests + 0.3*typecheck + 0.2*(1 - diffLines/maxDiff)`; `valid` is the -conjunction of all six. - -## Parameters - -### input - -[`CoderCheckInput`](../interfaces/CoderCheckInput.md) - -### constraints? - -[`CoderCheckConstraints`](../interfaces/CoderCheckConstraints.md) = `{}` - -## Returns - -`DefaultVerdict` diff --git a/docs/api/runtime/functions/runInWorkspace.md b/docs/api/runtime/functions/runInWorkspace.md deleted file mode 100644 index c5d731d..0000000 --- a/docs/api/runtime/functions/runInWorkspace.md +++ /dev/null @@ -1,47 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / runInWorkspace - -# Function: runInWorkspace() - -> **runInWorkspace**\<`T`\>(`ws`, `body`, `opts?`): `Promise`\<[`WorkspaceRun`](../interfaces/WorkspaceRun.md)\<`T`\>\> - -Defined in: [runtime/workspace.ts:149](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L149) - -Run a worker `body` inside a FRESH clone of a shared `Workspace`, then commit its work back -so the next worker (or the supervisor) builds on it. This is the seam that turns isolated -per-worker cwds into one compounding artifact — `body` gets a real materialized dir, its -delivery is committed to the shared ref iff it's valid (a conflict is returned, never thrown). -The clone is removed after; durable state lives only in the ref. - -## Type Parameters - -### T - -`T` - -## Parameters - -### ws - -[`Workspace`](../interfaces/Workspace.md) - -### body - -(`cwd`) => `Promise`\<\{ `valid`: `boolean`; `value`: `T`; `message?`: `string`; \}\> - -### opts? - -#### tmpPrefix? - -`string` - -#### commitOnInvalid? - -`boolean` - -## Returns - -`Promise`\<[`WorkspaceRun`](../interfaces/WorkspaceRun.md)\<`T`\>\> diff --git a/docs/api/runtime/functions/runLoop.md b/docs/api/runtime/functions/runLoop.md deleted file mode 100644 index 1b05fdc..0000000 --- a/docs/api/runtime/functions/runLoop.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / runLoop - -# Function: runLoop() - -> **runLoop**\<`Task`, `Output`, `Decision`\>(`options`): `Promise`\<[`LoopResult`](../interfaces/LoopResult.md)\<`Task`, `Output`, `Decision`\>\> - -Defined in: [runtime/run-loop.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L135) - -**`Experimental`** - -## Type Parameters - -### Task - -`Task` - -### Output - -`Output` - -### Decision - -`Decision` - -## Parameters - -### options - -[`RunLoopOptions`](../interfaces/RunLoopOptions.md)\<`Task`, `Output`, `Decision`\> - -## Returns - -`Promise`\<[`LoopResult`](../interfaces/LoopResult.md)\<`Task`, `Output`, `Decision`\>\> diff --git a/docs/api/runtime/functions/runPersonified.md b/docs/api/runtime/functions/runPersonified.md deleted file mode 100644 index 6b0a9d7..0000000 --- a/docs/api/runtime/functions/runPersonified.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / runPersonified - -# Function: runPersonified() - -> **runPersonified**\<`Task`, `D`\>(`options`): `Promise`\<[`SupervisedResult`](../type-aliases/SupervisedResult.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`D`\>\>\> - -Defined in: [runtime/personify/persona.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/persona.ts#L131) - -Compose the persona + chosen shape onto a fresh keystone `Supervisor`. Resolves the shape -(a factory verbatim, or a registered name through `builtinShapes`), applies it to a -`ShapeContext`, and runs the resulting root `Agent` to a typed `SupervisedResult`. -Fail loud on an unknown shape name or an unresolvable persona registry — never a silent -default-shape fallback. - -## Type Parameters - -### Task - -`Task` - -### D - -`D` - -## Parameters - -### options - -[`RunPersonifiedOptions`](../interfaces/RunPersonifiedOptions.md)\<`Task`, `D`\> - -## Returns - -`Promise`\<[`SupervisedResult`](../type-aliases/SupervisedResult.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`D`\>\>\> diff --git a/docs/api/runtime/functions/runStrategyEvolution.md b/docs/api/runtime/functions/runStrategyEvolution.md deleted file mode 100644 index 4c58fec..0000000 --- a/docs/api/runtime/functions/runStrategyEvolution.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / runStrategyEvolution - -# Function: runStrategyEvolution() - -> **runStrategyEvolution**(`cfg`): `Promise`\<[`EvolutionReport`](../interfaces/EvolutionReport.md)\> - -Defined in: [runtime/strategy-evolution.ts:364](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L364) - -## Parameters - -### cfg - -[`StrategyEvolutionConfig`](../interfaces/StrategyEvolutionConfig.md) - -## Returns - -`Promise`\<[`EvolutionReport`](../interfaces/EvolutionReport.md)\> diff --git a/docs/api/runtime/functions/sandboxSessionTraceSource.md b/docs/api/runtime/functions/sandboxSessionTraceSource.md deleted file mode 100644 index d829a2d..0000000 --- a/docs/api/runtime/functions/sandboxSessionTraceSource.md +++ /dev/null @@ -1,50 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / sandboxSessionTraceSource - -# Function: sandboxSessionTraceSource() - -> **sandboxSessionTraceSource**(`box`, `sessionId`, `opts?`): [`TraceSource`](../interfaces/TraceSource.md) - -Defined in: [runtime/supervise/trace-source.ts:278](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L278) - -The SANDBOX / fleet trace source: read a box session's message parts and decode the harness's tool - calls into spans. `collect` (settle) is the solid path — `box.messages({sessionId})` → parts → spans; - black-box harnesses aren't mid-step interruptible, so online steering is the owned-loop's job and a - live `subscribe` is opt-in (pass `subscribeParts` from `streamPrompt` when the harness streams parts). - -## Parameters - -### box - -[`SessionTraceBox`](../interfaces/SessionTraceBox.md) - -### sessionId - -`string` - -### opts? - -#### harness? - -`string` - -The box's harness (e.g. 'opencode', 'claude-code') → selects its decoder adapter. - -#### subscribeParts? - -(`onPart`) => () => `void` - -#### runId? - -`string` - -#### now? - -() => `number` - -## Returns - -[`TraceSource`](../interfaces/TraceSource.md) diff --git a/docs/api/runtime/functions/selectChampion.md b/docs/api/runtime/functions/selectChampion.md deleted file mode 100644 index 26003af..0000000 --- a/docs/api/runtime/functions/selectChampion.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / selectChampion - -# Function: selectChampion() - -> **selectChampion**(`report`, `fieldOrder`, `policy`, `epsilon`): [`ChampionPick`](../interfaces/ChampionPick.md) - -Defined in: [runtime/strategy-evolution.ts:285](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L285) - -Search-side champion selection over a tournament report. - -## Parameters - -### report - -[`BenchmarkReport`](../interfaces/BenchmarkReport.md) - -### fieldOrder - -`string`[] - -### policy - -[`ChampionPolicy`](../type-aliases/ChampionPolicy.md) - -### epsilon - -`number` - -## Returns - -[`ChampionPick`](../interfaces/ChampionPick.md) diff --git a/docs/api/runtime/functions/selectValidWinner.md b/docs/api/runtime/functions/selectValidWinner.md deleted file mode 100644 index 01a2075..0000000 --- a/docs/api/runtime/functions/selectValidWinner.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / selectValidWinner - -# Function: selectValidWinner() - -> **selectValidWinner**\<`D`\>(`opts?`): [`FanoutWinnerSelector`](../type-aliases/FanoutWinnerSelector.md)\<`D`\> - -Defined in: [runtime/personify/combinators.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/combinators.ts#L58) - -The single content-free valid-only winner selector. Among the gated-VALID children only -(`verdict.valid === true`), pick by `strategy` — best score / smallest delivered artifact / -earliest — ties broken by earliest index; returns `undefined` when NONE is valid (an ungated -output can never win — the deliverable gate is the point). `sizeOf` (for `'smallest-artifact'`) -reads the child's settled deliverable — the raw value a leaf settles, or the unwrapped `Outcome` -a delegate path produces; a domain passes e.g. patch diff-lines. This is the de-duplicated home of -the selection logic previously copied per role. - -## Type Parameters - -### D - -`D` - -## Parameters - -### opts? - -#### strategy? - -[`WinnerStrategy`](../type-aliases/WinnerStrategy.md) - -#### sizeOf? - -(`deliverable`) => `number` - -## Returns - -[`FanoutWinnerSelector`](../type-aliases/FanoutWinnerSelector.md)\<`D`\> diff --git a/docs/api/runtime/functions/sentinelCompletion.md b/docs/api/runtime/functions/sentinelCompletion.md deleted file mode 100644 index 394dab4..0000000 --- a/docs/api/runtime/functions/sentinelCompletion.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / sentinelCompletion - -# Function: sentinelCompletion() - -> **sentinelCompletion**\<`Task`\>(`sentinel`, `opts?`): [`CompletionAnalyst`](../interfaces/CompletionAnalyst.md)\<`Task`, `string`\> - -Defined in: [runtime/completion.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L86) - -Completion for a sandbox-agent node: done iff the latest output carries the node's stop -sentinel. PROBABILISTIC (the agent's own self-judgment) — the driver validates it. - -## Type Parameters - -### Task - -`Task` - -## Parameters - -### sentinel - -`string` - -### opts? - -#### confidence? - -`number` - -## Returns - -[`CompletionAnalyst`](../interfaces/CompletionAnalyst.md)\<`Task`, `string`\> diff --git a/docs/api/runtime/functions/serveCoordinationMcp.md b/docs/api/runtime/functions/serveCoordinationMcp.md deleted file mode 100644 index 5b527fa..0000000 --- a/docs/api/runtime/functions/serveCoordinationMcp.md +++ /dev/null @@ -1,68 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / serveCoordinationMcp - -# Function: serveCoordinationMcp() - -> **serveCoordinationMcp**(`opts`): `Promise`\<[`CoordinationMcpHandle`](../interfaces/CoordinationMcpHandle.md)\> - -Defined in: [runtime/supervise/coordination-mcp.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L51) - -Stand up the coordination MCP over a live scope. The HOST address is `127.0.0.1` (the bridge runs - opencode locally, same host); pass `host` to bind elsewhere when the harness is remote. - -## Parameters - -### opts - -#### scope - -[`Scope`](../interfaces/Scope.md)\<`unknown`\> - -#### blobs - -[`ResultBlobStore`](../interfaces/ResultBlobStore.md) - -#### makeWorkerAgent - -[`MakeWorkerAgent`](../../mcp/type-aliases/MakeWorkerAgent.md) - -#### perWorker - -[`Budget`](../interfaces/Budget.md) - -#### port? - -`number` - -#### host? - -`string` - -#### analysts? - -[`AnalystRegistry`](../../mcp/interfaces/AnalystRegistry.md) - -Trace-analyst lenses the driver can run (`run_analyst`) or auto-fire on settle. - -#### analyzeOnSettle? - -readonly `string`[] - -Analyst kinds to auto-run when a worker settles `done` — findings flow up the bus. - -#### onEvent? - -(`event`) => `void` \| `Promise`\<`void`\> - -Pass-through subscriber for every bus event (settled / question / finding). - -#### questionPolicy? - -[`QuestionPolicy`](../../mcp/type-aliases/QuestionPolicy.md) - -## Returns - -`Promise`\<[`CoordinationMcpHandle`](../interfaces/CoordinationMcpHandle.md)\> diff --git a/docs/api/runtime/functions/settledToIteration.md b/docs/api/runtime/functions/settledToIteration.md deleted file mode 100644 index dd53ba0..0000000 --- a/docs/api/runtime/functions/settledToIteration.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / settledToIteration - -# Function: settledToIteration() - -> **settledToIteration**\<`Out`\>(`settled`): [`Iteration`](../interfaces/Iteration.md)\<`unknown`, `Out`\> - -Defined in: [runtime/supervise/scope.ts:648](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/scope.ts#L648) - -The step-8 merge-boundary adapter (M4): rehydrate a `Settled.done` into the kernel's -`Iteration` shape so `defaultSelectWinner` stays single-sourced — the supervisor selects -across settled children with the SAME argmax the loop kernel uses, not a forked copy. - -`index` is the cursor `seq` (the recorded, replay-stable order); `output`/`verdict`/ -`tokenUsage`/`costUsd` are read straight off the settlement (already rehydrated from the -`outRef` blob by `next()`). Events are empty — a settled child is an opaque leaf result, -not a sandbox event stream — and the timing/cost fields project its conserved `Spend`. -Fail loud on a `down` settlement: only a `done` child is an iteration. - -## Type Parameters - -### Out - -`Out` - -## Parameters - -### settled - -[`Settled`](../type-aliases/Settled.md)\<`Out`\> - -## Returns - -[`Iteration`](../interfaces/Iteration.md)\<`unknown`, `Out`\> diff --git a/docs/api/runtime/functions/spendFromUsageEvents.md b/docs/api/runtime/functions/spendFromUsageEvents.md deleted file mode 100644 index 820b0dc..0000000 --- a/docs/api/runtime/functions/spendFromUsageEvents.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / spendFromUsageEvents - -# Function: spendFromUsageEvents() - -> **spendFromUsageEvents**(`events`): [`Spend`](../interfaces/Spend.md) - -Defined in: [runtime/supervise/budget.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L92) - -Fold a normalized `UsageEvent` array into a `Spend`. Tokens and usd are separate - channels; iterations come from `'iteration'` events. Pure; `ms` stays zero (the - pool does not read wall-clock). - -## Parameters - -### events - -[`UsageEvent`](../type-aliases/UsageEvent.md)[] - -## Returns - -[`Spend`](../interfaces/Spend.md) diff --git a/docs/api/runtime/functions/stopSentinel.md b/docs/api/runtime/functions/stopSentinel.md deleted file mode 100644 index 1117f4e..0000000 --- a/docs/api/runtime/functions/stopSentinel.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / stopSentinel - -# Function: stopSentinel() - -> **stopSentinel**(`seed`): `string` - -Defined in: [runtime/completion.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L73) - -A unique, attributable stop sentinel for a node (ralph-loop style). Deterministic from the -seed (no Math.random — reproducible + attributable to the node); the agent is instructed to -emit it VERBATIM when it judges itself done. Unguessable enough that content never trips it. - -## Parameters - -### seed - -`string` - -## Returns - -`string` diff --git a/docs/api/runtime/functions/supervisorSkill.md b/docs/api/runtime/functions/supervisorSkill.md deleted file mode 100644 index e5a7721..0000000 --- a/docs/api/runtime/functions/supervisorSkill.md +++ /dev/null @@ -1,26 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / supervisorSkill - -# Function: supervisorSkill() - -> **supervisorSkill**(`opts?`): `string` - -Defined in: [runtime/supervise/authoring.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/authoring.ts#L45) - -The supervisor SKILL — the how-to the supervisor reads (its system prompt). THE optimizable - surface: editing this changes how the supervisor designs every agent it spawns. - -## Parameters - -### opts? - -#### goal? - -`string` - -## Returns - -`string` diff --git a/docs/api/runtime/functions/toToolSpan.md b/docs/api/runtime/functions/toToolSpan.md deleted file mode 100644 index 4420bc2..0000000 --- a/docs/api/runtime/functions/toToolSpan.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / toToolSpan - -# Function: toToolSpan() - -> **toToolSpan**(`input`, `runId`, `seq`, `at`): `ToolSpan` - -Defined in: [runtime/supervise/trace-source.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L42) - -Project a normalized tool step into the canonical agent-eval `ToolSpan`. - -## Parameters - -### input - -[`ToolStepInput`](../interfaces/ToolStepInput.md) - -### runId - -`string` - -### seq - -`number` - -### at - -`number` - -## Returns - -`ToolSpan` diff --git a/docs/api/runtime/functions/touchedPathsFromPatch.md b/docs/api/runtime/functions/touchedPathsFromPatch.md deleted file mode 100644 index 36a2ef1..0000000 --- a/docs/api/runtime/functions/touchedPathsFromPatch.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / touchedPathsFromPatch - -# Function: touchedPathsFromPatch() - -> **touchedPathsFromPatch**(`patch`): `string`[] - -Defined in: [runtime/supervise/patch-checks.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L45) - -The unified-diff paths the patch touches — the `+++`/`---` headers, de-`a/`/`b/`-prefixed, - with `/dev/null` (a delete's other side) dropped. - -## Parameters - -### patch - -`string` - -## Returns - -`string`[] diff --git a/docs/api/runtime/functions/touchesSecretPath.md b/docs/api/runtime/functions/touchesSecretPath.md deleted file mode 100644 index a629ebc..0000000 --- a/docs/api/runtime/functions/touchesSecretPath.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / touchesSecretPath - -# Function: touchesSecretPath() - -> **touchesSecretPath**(`patch`): `string`[] - -Defined in: [runtime/supervise/patch-checks.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L80) - -The credential-shaped paths the patch touches (always-on floor, independent of `forbiddenPaths`). - -## Parameters - -### patch - -`string` - -## Returns - -`string`[] diff --git a/docs/api/runtime/functions/trajectoryReport.md b/docs/api/runtime/functions/trajectoryReport.md deleted file mode 100644 index 9d496d9..0000000 --- a/docs/api/runtime/functions/trajectoryReport.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / trajectoryReport - -# Function: trajectoryReport() - -> **trajectoryReport**(`journal`, `blobs`, `root`, `options?`): `Promise`\<[`TrajectoryReport`](../interfaces/TrajectoryReport.md)\> - -Defined in: [runtime/personify/trajectory.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/trajectory.ts#L52) - -Reconstruct the whole spawn tree for `root` with per-node + rolled-up `Spend`. Reads the -journal for structure + spend and, when `withOutputs`, the blob store for each `done` -node's artifact. Fail loud on a tree that was never journaled, a settle/cancel for an -un-spawned node (a corrupted log), or — under `withOutputs` — a `done` node whose blob the -store cannot rehydrate (a silent gap would mis-cost or mis-evidence the tree). - -## Parameters - -### journal - -[`SpawnJournal`](../interfaces/SpawnJournal.md) - -### blobs - -[`ResultBlobStore`](../interfaces/ResultBlobStore.md) - -### root - -`string` - -### options? - -[`TrajectoryReportOptions`](../interfaces/TrajectoryReportOptions.md) = `{}` - -## Returns - -`Promise`\<[`TrajectoryReport`](../interfaces/TrajectoryReport.md)\> diff --git a/docs/api/runtime/functions/verify.md b/docs/api/runtime/functions/verify.md deleted file mode 100644 index aecd9fd..0000000 --- a/docs/api/runtime/functions/verify.md +++ /dev/null @@ -1,40 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / verify - -# Function: verify() - -> **verify**\<`Task`, `Candidate`, `D`\>(`spec`): [`CombinatorShape`](../type-aliases/CombinatorShape.md)\<`Task`, `D`\> - -Defined in: [runtime/personify/combinators.ts:333](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/combinators.ts#L333) - -`verify(spec)` — an IMPLEMENT child produces a candidate, then a SEPARATE VERIFIER child grades -it; only a `valid` verifier verdict ships. Any other outcome (implement down, verifier down, -verifier verdict absent or not `valid`) is a concrete blocker carrying the failure verbatim — -never a coerced "done". The implement child does not grade itself. - -## Type Parameters - -### Task - -`Task` - -### Candidate - -`Candidate` - -### D - -`D` - -## Parameters - -### spec - -[`VerifySpec`](../interfaces/VerifySpec.md)\<`Task`, `Candidate`, `D`\> - -## Returns - -[`CombinatorShape`](../type-aliases/CombinatorShape.md)\<`Task`, `D`\> diff --git a/docs/api/runtime/functions/watchTrace.md b/docs/api/runtime/functions/watchTrace.md deleted file mode 100644 index 446c8a9..0000000 --- a/docs/api/runtime/functions/watchTrace.md +++ /dev/null @@ -1,28 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / watchTrace - -# Function: watchTrace() - -> **watchTrace**(`source`, `opts?`): () => `void` - -Defined in: [runtime/supervise/detector-monitor.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/detector-monitor.ts#L43) - -Subscribe to a `TraceSource` and run the streaming detectors over its live spans. Returns an - unsubscribe. A defensive `argHash` failure (circular args) never throws out of the side-channel. - -## Parameters - -### source - -[`TraceSource`](../interfaces/TraceSource.md) - -### opts? - -[`WatchTraceOptions`](../interfaces/WatchTraceOptions.md) = `{}` - -## Returns - -() => `void` diff --git a/docs/api/runtime/functions/widen.md b/docs/api/runtime/functions/widen.md deleted file mode 100644 index a071a2f..0000000 --- a/docs/api/runtime/functions/widen.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / widen - -# Function: widen() - -> **widen**\<`Task`, `Seed`, `D`\>(`spec`): [`CombinatorShape`](../type-aliases/CombinatorShape.md)\<`Task`, `D`\> - -Defined in: [runtime/personify/combinators.ts:387](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/combinators.ts#L387) - -`widen(spec)` — the streaming spawn-on-completion driver. Spawns the seed lineages, then REACTS -to each `scope.next()`: on every settled child it consults `spec.gate.decide` and, when the gate -returns `widen`, spawns AT MOST ONE more child toward the chosen lineage under the remaining -conserved pool. `promising` is derived from the round's trace findings (the analyst seam), -never a child's raw `verdict` — and the default gate (`flatWidenGate`) never widens, so the R2 -firewall stays dormant. Terminal selection is `spec.synthesize` over every settled lineage. - -When `ctx.analyst` is set, `decide` is consulted with that round's trace-derived findings; -absent an analyst the findings argument is the empty array a flat gate ignores. The analyst -spawns into THIS scope (conserved-pooled, so equal-k holds). Streaming caveat: a wired analyst -drains its own child off the SHARED cursor by id-match, so on a NON-flat gate (which spawns -widen children that are live concurrently) the analyst can consume a sibling's settlement before -the widen loop sees it. The shipped default (`flatWidenGate`) never widens, so no widen child is -ever live when the analyst runs and the wire is exact; a non-flat gate must drive the analyst on -a scope whose siblings are quiesced, or read findings without the shared-cursor drain. - -## Type Parameters - -### Task - -`Task` - -### Seed - -`Seed` - -### D - -`D` - -## Parameters - -### spec - -[`WidenSpec`](../interfaces/WidenSpec.md)\<`Seed`, `D`\> - -## Returns - -[`CombinatorShape`](../type-aliases/CombinatorShape.md)\<`Task`, `D`\> diff --git a/docs/api/runtime/functions/withDriverExecutor.md b/docs/api/runtime/functions/withDriverExecutor.md deleted file mode 100644 index d85abea..0000000 --- a/docs/api/runtime/functions/withDriverExecutor.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / withDriverExecutor - -# Function: withDriverExecutor() - -> **withDriverExecutor**(`base`): [`ExecutorRegistry`](../interfaces/ExecutorRegistry.md) - -Defined in: [runtime/supervise/driver-executor.ts:211](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/driver-executor.ts#L211) - -Register the driver-executor so a child marked `role: 'driver'` resolves to it. The base -registry resolves by harness alone (it does not read `role`), so a recursive run needs a -registry that routes the driver tag here FIRST. Returns a registry decorator: a -driver-role spec → the driver-executor; everything else → the base registry's resolution -(leaf built-ins + BYO). - -## Parameters - -### base - -[`ExecutorRegistry`](../interfaces/ExecutorRegistry.md) - -## Returns - -[`ExecutorRegistry`](../interfaces/ExecutorRegistry.md) diff --git a/docs/api/runtime/functions/worktreeFanout.md b/docs/api/runtime/functions/worktreeFanout.md deleted file mode 100644 index 0d7f00b..0000000 --- a/docs/api/runtime/functions/worktreeFanout.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / worktreeFanout - -# Function: worktreeFanout() - -> **worktreeFanout**\<`Task`\>(`options`): [`CombinatorShape`](../type-aliases/CombinatorShape.md)\<`Task`, `WorktreeHarnessResult`\> - -Defined in: [runtime/supervise/worktree-fanout.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L78) - -**`Experimental`** - -Build the worktree fanout combinator. Run it with `runPersonified({ persona, shape, task, budget })` -— equal-k holds by construction (the conserved budget pool bounds the N leaves), and selection is -the shared valid-only `selectValidWinner` (never a judge). - -## Type Parameters - -### Task - -`Task` - -## Parameters - -### options - -[`WorktreeFanoutOptions`](../interfaces/WorktreeFanoutOptions.md) - -## Returns - -[`CombinatorShape`](../type-aliases/CombinatorShape.md)\<`Task`, `WorktreeHarnessResult`\> diff --git a/docs/api/runtime/interfaces/Agent.md b/docs/api/runtime/interfaces/Agent.md deleted file mode 100644 index c72d955..0000000 --- a/docs/api/runtime/interfaces/Agent.md +++ /dev/null @@ -1,58 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Agent - -# Interface: Agent\ - -Defined in: [runtime/supervise/types.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L49) - -One self-similar atom. A leaf is an `Agent` that never calls `scope.spawn`; a driver -is an `Agent` whose `act` spawns children and reacts to them via `scope.next()`. An -analyst is an `Agent` whose task is "read these traces → findings" — `where` it runs -is its executor, not a separate type. - -`act` MUST be replay-safe: it may read `verdict`, `spent`, and `out` (rehydrated by -`outRef`) off each `Settled`; it MUST NOT read `Date.now`, `Math.random`, or any -unordered collection. `scope.next()` delivers strictly in recorded `seq` order. - -## Type Parameters - -### Task - -`Task` - -### Out - -`Out` - -## Properties - -### name - -> `readonly` **name**: `string` - -Defined in: [runtime/supervise/types.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L50) - -## Methods - -### act() - -> **act**(`task`, `scope`): `Promise`\<`Out`\> - -Defined in: [runtime/supervise/types.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L51) - -#### Parameters - -##### task - -`Task` - -##### scope - -[`Scope`](Scope.md)\<`Out`\> - -#### Returns - -`Promise`\<`Out`\> diff --git a/docs/api/runtime/interfaces/AgentRunSpec.md b/docs/api/runtime/interfaces/AgentRunSpec.md deleted file mode 100644 index 258aa6c..0000000 --- a/docs/api/runtime/interfaces/AgentRunSpec.md +++ /dev/null @@ -1,125 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AgentRunSpec - -# Interface: AgentRunSpec\ - -Defined in: [runtime/types.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L67) - -**`Experimental`** - -Sandbox-SDK-shaped agent specification. - -The kernel uses `profile` to instantiate a sandbox per iteration, formats -`task` into a prompt via `taskToPrompt`, and merges `sandboxOverrides` into -the `CreateSandboxOptions` it passes to `client.create`. Heterogeneous -fanout supplies multiple `AgentRunSpec`s and the kernel round-robins -through them when the driver plans N tasks. - -## Type Parameters - -### Task - -`Task` - -## Properties - -### profile - -> **profile**: `AgentProfile` - -Defined in: [runtime/types.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L69) - -**`Experimental`** - -Sandbox SDK profile — what kind of agent runs the task. - -*** - -### taskToPrompt - -> **taskToPrompt**: (`task`) => `string` - -Defined in: [runtime/types.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L71) - -**`Experimental`** - -Task → prompt formatter. Pure and deterministic. - -#### Parameters - -##### task - -`Task` - -#### Returns - -`string` - -*** - -### prepareBox? - -> `optional` **prepareBox?**: (`box`, `ctx`) => `void` \| `Promise`\<`void`\> - -Defined in: [runtime/types.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L80) - -**`Experimental`** - -Optional pre-prompt sandbox provisioner. Runs after the sandbox is acquired -and before the first prompt is streamed into that box. Use this for -domain-agnostic setup such as repo snapshots, benchmark fixtures, policy -files, or seed datasets. The hook is part of the runtime surface so loop -consumers do not hand-roll Sandbox SDK orchestration just to prepare a -workspace before the agent sees it. - -#### Parameters - -##### box - -`SandboxInstance` - -##### ctx - -###### signal - -`AbortSignal` - -#### Returns - -`void` \| `Promise`\<`void`\> - -*** - -### name? - -> `optional` **name?**: `string` - -Defined in: [runtime/types.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L85) - -**`Experimental`** - -Per-spec stable name. Surfaced in trace events and the default winner -selector tiebreak. Falls back to `profile.name ?? 'agent'`. - -*** - -### sandboxOverrides? - -> `optional` **sandboxOverrides?**: `Partial`\<`Omit`\<`CreateSandboxOptions`, `"backend"`\>\> & `object` - -Defined in: [runtime/types.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L91) - -**`Experimental`** - -Optional sandbox-SDK `CreateSandboxOptions` overrides merged on top of -the kernel's defaults. `backend.profile` is set to `profile` by the -kernel and cannot be overridden here — use `profile` itself for that. - -#### Type Declaration - -##### backend? - -> `optional` **backend?**: `Omit`\<`BackendConfig`, `"profile"`\> diff --git a/docs/api/runtime/interfaces/AgentSpec.md b/docs/api/runtime/interfaces/AgentSpec.md deleted file mode 100644 index d1047a9..0000000 --- a/docs/api/runtime/interfaces/AgentSpec.md +++ /dev/null @@ -1,47 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AgentSpec - -# Interface: AgentSpec - -Defined in: [runtime/supervise/types.ts:152](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L152) - -`AgentProfile` does NOT carry a `harness`/backend field — `harness` lives on the -sandbox SDK's `BackendConfig`, not the portable profile. So an agent is mapped to its -executor through this MINIMAL wrapper, never by fabricating a field onto `AgentProfile`. - -Resolution (in `runtime.ts`): - - `executor` present → BYO: use it verbatim (a user's own `Executor`). - - `harness === null` → router/inline: a direct Router call, no box. - - `harness` is a `BackendType` → sandbox: compose `runLoop` against `profile` on that backend. -Fail loud on an unresolvable spec (no executor and an unknown harness). - -## Properties - -### profile - -> `readonly` **profile**: `AgentProfile` - -Defined in: [runtime/supervise/types.ts:153](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L153) - -*** - -### harness - -> `readonly` **harness**: `BackendType` \| `null` - -Defined in: [runtime/supervise/types.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L155) - -`null` selects router/inline; a `BackendType` selects the sandboxed harness. - -*** - -### executor? - -> `readonly` `optional` **executor?**: [`Executor`](Executor.md)\<`unknown`\> - -Defined in: [runtime/supervise/types.ts:157](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L157) - -Bring-your-own executor: when set, overrides harness-based resolution entirely. diff --git a/docs/api/runtime/interfaces/AgenticOptions.md b/docs/api/runtime/interfaces/AgenticOptions.md deleted file mode 100644 index 6f06e99..0000000 --- a/docs/api/runtime/interfaces/AgenticOptions.md +++ /dev/null @@ -1,110 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AgenticOptions - -# Interface: AgenticOptions - -Defined in: [runtime/strategy.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L85) - -## Extended by - -- [`RunAgenticOptions`](RunAgenticOptions.md) - -## Properties - -### routerBaseUrl - -> **routerBaseUrl**: `string` - -Defined in: [runtime/strategy.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L86) - -*** - -### routerKey - -> **routerKey**: `string` - -Defined in: [runtime/strategy.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L87) - -*** - -### model - -> **model**: `string` - -Defined in: [runtime/strategy.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L88) - -*** - -### temperature? - -> `optional` **temperature?**: `number` - -Defined in: [runtime/strategy.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L89) - -*** - -### maxTokens? - -> `optional` **maxTokens?**: `number` - -Defined in: [runtime/strategy.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L92) - -Completion cap per worker turn — REQUIRED for thinking models (they burn unbounded - budgets on reasoning and return empty content without it). Omitted ⇒ provider default. - -*** - -### innerTurns? - -> `optional` **innerTurns?**: `number` - -Defined in: [runtime/strategy.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L94) - -Turns the agent may take within ONE shot before the driver intervenes. - -*** - -### analystInstruction? - -> `optional` **analystInstruction?**: `string` - -Defined in: [runtime/strategy.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L97) - -The depth STEERER's analyst instruction (observe()'s system prompt). The knob a - prompt optimizer (GEPA) tunes — the analyst IS the steerer. Omitted ⇒ the default. - -*** - -### analystModel? - -> `optional` **analystModel?**: `string` - -Defined in: [runtime/strategy.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L100) - -The critic's model — lets the analyst be a stronger (or cheaper) model than the - worker. Omitted ⇒ the worker's `model`. - -*** - -### corpus? - -> `optional` **corpus?**: [`Corpus`](Corpus.md) - -Defined in: [runtime/strategy.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L104) - -Across-run learning: when set, the analyst's observe() pass appends trace-derived - facts here (the flywheel write side). Priming (the read side) is the caller's move — - query the corpus and fold facts into the task's systemPrompt before runAgentic. - -*** - -### corpusTags? - -> `optional` **corpusTags?**: `string`[] - -Defined in: [runtime/strategy.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L106) - -Tags written onto learned facts (and used by the caller's priming query). diff --git a/docs/api/runtime/interfaces/AgenticRunResult.md b/docs/api/runtime/interfaces/AgenticRunResult.md deleted file mode 100644 index 30cb5d0..0000000 --- a/docs/api/runtime/interfaces/AgenticRunResult.md +++ /dev/null @@ -1,96 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AgenticRunResult - -# Interface: AgenticRunResult - -Defined in: [runtime/strategy.ts:505](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L505) - -## Properties - -### mode - -> **mode**: `string` - -Defined in: [runtime/strategy.ts:507](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L507) - -The strategy name (built-in 'depth'/'breadth' or a custom strategy's name). - -*** - -### score - -> **score**: `number` - -Defined in: [runtime/strategy.ts:508](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L508) - -*** - -### resolved - -> **resolved**: `boolean` - -Defined in: [runtime/strategy.ts:509](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L509) - -*** - -### completions - -> **completions**: `number` - -Defined in: [runtime/strategy.ts:510](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L510) - -*** - -### progression - -> **progression**: `number`[] - -Defined in: [runtime/strategy.ts:512](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L512) - -DEPTH: score after each shot — the progress-over-rounds curve. BREADTH: best-so-far per rollout. - -*** - -### shots - -> **shots**: `number` - -Defined in: [runtime/strategy.ts:513](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L513) - -*** - -### usd - -> **usd**: `number` - -Defined in: [runtime/strategy.ts:516](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L516) - -The cost vector, stamped by `runAgentic` from the Supervisor's conserved pool: real - router tokens, priced usd (0 when the model is unpriced — never fabricated), wall ms. - -*** - -### ms - -> **ms**: `number` - -Defined in: [runtime/strategy.ts:517](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L517) - -*** - -### tokens - -> **tokens**: `object` - -Defined in: [runtime/strategy.ts:518](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L518) - -#### input - -> **input**: `number` - -#### output - -> **output**: `number` diff --git a/docs/api/runtime/interfaces/AgenticSurface.md b/docs/api/runtime/interfaces/AgenticSurface.md deleted file mode 100644 index 6a473c2..0000000 --- a/docs/api/runtime/interfaces/AgenticSurface.md +++ /dev/null @@ -1,125 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AgenticSurface - -# Interface: AgenticSurface - -Defined in: [runtime/strategy.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L76) - -A stateful, checkable environment an agent operates over with tools. Open behind one interface. - -## Properties - -### name - -> `readonly` **name**: `string` - -Defined in: [runtime/strategy.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L77) - -## Methods - -### open() - -> **open**(`task`): `Promise`\<[`ArtifactHandle`](ArtifactHandle.md)\> - -Defined in: [runtime/strategy.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L78) - -#### Parameters - -##### task - -[`AgenticTask`](AgenticTask.md) - -#### Returns - -`Promise`\<[`ArtifactHandle`](ArtifactHandle.md)\> - -*** - -### tools() - -> **tools**(`task`, `handle`): `Promise`\<[`AgenticTool`](AgenticTool.md)[]\> - -Defined in: [runtime/strategy.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L79) - -#### Parameters - -##### task - -[`AgenticTask`](AgenticTask.md) - -##### handle - -[`ArtifactHandle`](ArtifactHandle.md) - -#### Returns - -`Promise`\<[`AgenticTool`](AgenticTool.md)[]\> - -*** - -### call() - -> **call**(`handle`, `name`, `args`): `Promise`\<`string`\> - -Defined in: [runtime/strategy.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L80) - -#### Parameters - -##### handle - -[`ArtifactHandle`](ArtifactHandle.md) - -##### name - -`string` - -##### args - -`Record`\<`string`, `unknown`\> - -#### Returns - -`Promise`\<`string`\> - -*** - -### score() - -> **score**(`task`, `handle`): `Promise`\<[`SurfaceScore`](SurfaceScore.md)\> - -Defined in: [runtime/strategy.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L81) - -#### Parameters - -##### task - -[`AgenticTask`](AgenticTask.md) - -##### handle - -[`ArtifactHandle`](ArtifactHandle.md) - -#### Returns - -`Promise`\<[`SurfaceScore`](SurfaceScore.md)\> - -*** - -### close() - -> **close**(`handle`): `Promise`\<`void`\> - -Defined in: [runtime/strategy.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L82) - -#### Parameters - -##### handle - -[`ArtifactHandle`](ArtifactHandle.md) - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/runtime/interfaces/AgenticTask.md b/docs/api/runtime/interfaces/AgenticTask.md deleted file mode 100644 index e6a03b7..0000000 --- a/docs/api/runtime/interfaces/AgenticTask.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AgenticTask - -# Interface: AgenticTask - -Defined in: [runtime/strategy.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L48) - -## Properties - -### id - -> `readonly` **id**: `string` - -Defined in: [runtime/strategy.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L49) - -*** - -### systemPrompt - -> `readonly` **systemPrompt**: `string` - -Defined in: [runtime/strategy.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L50) - -*** - -### userPrompt - -> `readonly` **userPrompt**: `string` - -Defined in: [runtime/strategy.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L51) - -*** - -### meta? - -> `readonly` `optional` **meta?**: `Record`\<`string`, `unknown`\> - -Defined in: [runtime/strategy.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L53) - -Opaque domain payload the surface reads (EOPS: servers/verifiers/tools). Drivers never read it. diff --git a/docs/api/runtime/interfaces/AgenticTool.md b/docs/api/runtime/interfaces/AgenticTool.md deleted file mode 100644 index eac11b2..0000000 --- a/docs/api/runtime/interfaces/AgenticTool.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AgenticTool - -# Interface: AgenticTool - -Defined in: [runtime/strategy.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L63) - -## Properties - -### type - -> `readonly` **type**: `"function"` - -Defined in: [runtime/strategy.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L64) - -*** - -### function - -> `readonly` **function**: `object` - -Defined in: [runtime/strategy.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L65) - -#### name - -> **name**: `string` - -#### description? - -> `optional` **description?**: `string` - -#### parameters - -> **parameters**: `Record`\<`string`, `unknown`\> diff --git a/docs/api/runtime/interfaces/AnytimeReport.md b/docs/api/runtime/interfaces/AnytimeReport.md deleted file mode 100644 index 368b02e..0000000 --- a/docs/api/runtime/interfaces/AnytimeReport.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AnytimeReport - -# Interface: AnytimeReport - -Defined in: [runtime/anytime.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L55) - -## Properties - -### targets - -> **targets**: `number`[] - -Defined in: [runtime/anytime.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L56) - -*** - -### perTask - -> **perTask**: [`AnytimeTaskCurve`](AnytimeTaskCurve.md)[] - -Defined in: [runtime/anytime.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L57) - -*** - -### perStrategy - -> **perStrategy**: [`AnytimeStrategySummary`](AnytimeStrategySummary.md)[] - -Defined in: [runtime/anytime.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L59) - -One summary per (strategy, target) pair — the COCO-style multi-target view. diff --git a/docs/api/runtime/interfaces/AnytimeStrategySummary.md b/docs/api/runtime/interfaces/AnytimeStrategySummary.md deleted file mode 100644 index 9ac7efd..0000000 --- a/docs/api/runtime/interfaces/AnytimeStrategySummary.md +++ /dev/null @@ -1,101 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AnytimeStrategySummary - -# Interface: AnytimeStrategySummary - -Defined in: [runtime/anytime.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L36) - -## Properties - -### strategy - -> **strategy**: `string` - -Defined in: [runtime/anytime.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L37) - -*** - -### target - -> **target**: `number` - -Defined in: [runtime/anytime.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L39) - -The satisficing target this row summarizes. - -*** - -### tasks - -> **tasks**: `number` - -Defined in: [runtime/anytime.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L40) - -*** - -### reachedTarget - -> **reachedTarget**: `number` - -Defined in: [runtime/anytime.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L41) - -*** - -### medianTttMs - -> **medianTttMs**: `number` \| `null` - -Defined in: [runtime/anytime.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L43) - -Median time-to-target over the tasks that reached it (null when none did). - -*** - -### medianShotsToTarget - -> **medianShotsToTarget**: `number` \| `null` - -Defined in: [runtime/anytime.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L44) - -*** - -### ertMs - -> **ertMs**: `number` \| `null` - -Defined in: [runtime/anytime.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L46) - -COCO ERT: Σ all task wall-time (incl. failures) / #successes. Null when 0 succeed. - -*** - -### erUsd - -> **erUsd**: `number` \| `null` - -Defined in: [runtime/anytime.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L48) - -Same construction over dollars: Σ all spend / #successes. - -*** - -### curveByShot - -> **curveByShot**: `number`[] - -Defined in: [runtime/anytime.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L50) - -Mean best-so-far score by shot index (the anytime curve, averaged over tasks). - -*** - -### auc - -> **auc**: `number` - -Defined in: [runtime/anytime.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L52) - -Area under the per-shot anytime curve, normalized to [0,1]. diff --git a/docs/api/runtime/interfaces/AnytimeTaskCurve.md b/docs/api/runtime/interfaces/AnytimeTaskCurve.md deleted file mode 100644 index e7a1d61..0000000 --- a/docs/api/runtime/interfaces/AnytimeTaskCurve.md +++ /dev/null @@ -1,59 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AnytimeTaskCurve - -# Interface: AnytimeTaskCurve - -Defined in: [runtime/anytime.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L25) - -## Properties - -### taskId - -> **taskId**: `string` - -Defined in: [runtime/anytime.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L26) - -*** - -### strategy - -> **strategy**: `string` - -Defined in: [runtime/anytime.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L27) - -*** - -### points - -> **points**: `object`[] - -Defined in: [runtime/anytime.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L30) - -Best-so-far after each settled shot: elapsed ms from the task's first spawn, - cumulative usd, and the running max score. - -#### elapsedMs - -> **elapsedMs**: `number` - -#### cumUsd - -> **cumUsd**: `number` - -#### best - -> **best**: `number` - -*** - -### hits - -> **hits**: `Record`\<`string`, \{ `ms`: `number`; `shots`: `number`; `usd`: `number`; \} \| `null`\> - -Defined in: [runtime/anytime.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/anytime.ts#L33) - -Per satisficing target (keyed by the target value as a string): the first point - where best ≥ target, or null when never reached within budget. diff --git a/docs/api/runtime/interfaces/ArtifactHandle.md b/docs/api/runtime/interfaces/ArtifactHandle.md deleted file mode 100644 index 0d01542..0000000 --- a/docs/api/runtime/interfaces/ArtifactHandle.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ArtifactHandle - -# Interface: ArtifactHandle - -Defined in: [runtime/strategy.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L56) - -## Properties - -### id - -> `readonly` **id**: `string` - -Defined in: [runtime/strategy.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L57) - -*** - -### surface - -> `readonly` **surface**: `string` - -Defined in: [runtime/strategy.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L58) - -*** - -### ctx? - -> `readonly` `optional` **ctx?**: `unknown` - -Defined in: [runtime/strategy.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L60) - -Opaque per-artifact context the surface stashes (EOPS: the seeded gym server + db id). diff --git a/docs/api/runtime/interfaces/AuditIntentInput.md b/docs/api/runtime/interfaces/AuditIntentInput.md deleted file mode 100644 index c5b5f96..0000000 --- a/docs/api/runtime/interfaces/AuditIntentInput.md +++ /dev/null @@ -1,58 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AuditIntentInput - -# Interface: AuditIntentInput - -Defined in: [runtime/audit-intent.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L29) - -## Properties - -### declaredIntent - -> **declaredIntent**: `string` - -Defined in: [runtime/audit-intent.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L31) - -The declared intent: the task text / acceptance criteria the agent was given. - -*** - -### trace - -> **trace**: readonly `unknown`[] - -Defined in: [runtime/audit-intent.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L33) - -The trajectory so far — tool calls + results + assistant turns (any event shapes). - -*** - -### userIntent? - -> `optional` **userIntent?**: `string` - -Defined in: [runtime/audit-intent.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L35) - -The principal's actual intent when it differs from the literal task (the contract). - -*** - -### metaIntent? - -> `optional` **metaIntent?**: `string` - -Defined in: [runtime/audit-intent.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L38) - -The loop-level purpose (meta-intent): what the WHOLE run is for — lets the auditor - flag locally-sensible work that serves the wrong larger objective. - -*** - -### runId? - -> `optional` **runId?**: `string` - -Defined in: [runtime/audit-intent.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L39) diff --git a/docs/api/runtime/interfaces/AuditIntentOptions.md b/docs/api/runtime/interfaces/AuditIntentOptions.md deleted file mode 100644 index d0c5045..0000000 --- a/docs/api/runtime/interfaces/AuditIntentOptions.md +++ /dev/null @@ -1,53 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AuditIntentOptions - -# Interface: AuditIntentOptions - -Defined in: [runtime/audit-intent.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L42) - -## Properties - -### chat - -> **chat**: `ChatClient` - -Defined in: [runtime/audit-intent.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L43) - -*** - -### model? - -> `optional` **model?**: `string` - -Defined in: [runtime/audit-intent.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L44) - -*** - -### auditorInstruction? - -> `optional` **auditorInstruction?**: `string` - -Defined in: [runtime/audit-intent.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L46) - -Override the auditor instruction (optimizable like any analyst prompt). - -*** - -### maxTraceLines? - -> `optional` **maxTraceLines?**: `number` - -Defined in: [runtime/audit-intent.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L48) - -Cap trace lines fed to the auditor. Default 80. - -*** - -### signal? - -> `optional` **signal?**: `AbortSignal` - -Defined in: [runtime/audit-intent.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L49) diff --git a/docs/api/runtime/interfaces/AuthorStrategyOptions.md b/docs/api/runtime/interfaces/AuthorStrategyOptions.md deleted file mode 100644 index bfea5d1..0000000 --- a/docs/api/runtime/interfaces/AuthorStrategyOptions.md +++ /dev/null @@ -1,118 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AuthorStrategyOptions - -# Interface: AuthorStrategyOptions - -Defined in: [runtime/strategy-author.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L77) - -## Properties - -### chat - -> **chat**: `ChatClient` - -Defined in: [runtime/strategy-author.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L79) - -The model-call seam (agent-eval `createChatClient`). - -*** - -### model? - -> `optional` **model?**: `string` - -Defined in: [runtime/strategy-author.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L80) - -*** - -### fallbackModel? - -> `optional` **fallbackModel?**: `string` - -Defined in: [runtime/strategy-author.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L85) - -A NAMED fallback author tried once when the primary call fails or returns no code - block (thinking models time out at the edge on long authoring prompts, or return - empty content without `maxTokens`). Opt-in — absent means the primary's failure - propagates. - -*** - -### contract? - -> `optional` **contract?**: `string` - -Defined in: [runtime/strategy-author.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L89) - -The contract text shown to the author. Default `strategyAuthorContract`. The - meta-optimization coordinate: a GEPA/skill loop can evolve this text and gate each - variant on the same frozen holdout as any strategy. - -*** - -### environmentName - -> **environmentName**: `string` - -Defined in: [runtime/strategy-author.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L91) - -The environment the losses came from (orientation only — never the verifiers). - -*** - -### lossesJson - -> **lossesJson**: `string` - -Defined in: [runtime/strategy-author.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L93) - -The per-task losses table (e.g. JSON.stringify(report.perTask)) — the gradient. - -*** - -### budget - -> **budget**: `number` - -Defined in: [runtime/strategy-author.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L95) - -The budget the strategy must respect (shots/width). - -*** - -### outDir - -> **outDir**: `string` - -Defined in: [runtime/strategy-author.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L97) - -Where the authored module file is written (created if missing). - -*** - -### temperature? - -> `optional` **temperature?**: `number` - -Defined in: [runtime/strategy-author.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L98) - -*** - -### maxTokens? - -> `optional` **maxTokens?**: `number` - -Defined in: [runtime/strategy-author.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L100) - -Completion cap — required by thinking-model authors that stream reasoning first. - -*** - -### signal? - -> `optional` **signal?**: `AbortSignal` - -Defined in: [runtime/strategy-author.ts:101](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L101) diff --git a/docs/api/runtime/interfaces/AuthoredHarness.md b/docs/api/runtime/interfaces/AuthoredHarness.md deleted file mode 100644 index 250d37c..0000000 --- a/docs/api/runtime/interfaces/AuthoredHarness.md +++ /dev/null @@ -1,72 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AuthoredHarness - -# Interface: AuthoredHarness - -Defined in: [runtime/supervise/worktree-fanout.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L30) - -**`Experimental`** - -One authored harness profile in a worktree fanout: the §1.5 profile + which local - harness CLI drives it. The supervisor authors `profile` per sub-task; `harness` chooses the leaf. - -## Properties - -### name - -> **name**: `string` - -Defined in: [runtime/supervise/worktree-fanout.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L32) - -**`Experimental`** - -A short label for the worktree branch + trace node. - -*** - -### profile - -> **profile**: `AgentProfile` - -Defined in: [runtime/supervise/worktree-fanout.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L34) - -**`Experimental`** - -The supervisor-authored `AgentProfile` (systemPrompt + model reach the harness via §1.5). - -*** - -### harness - -> **harness**: `"claude"` \| `"codex"` \| `"opencode"` - -Defined in: [runtime/supervise/worktree-fanout.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L36) - -**`Experimental`** - -Which local harness CLI drives this leaf. - -*** - -### runId? - -> `optional` **runId?**: `string` - -Defined in: [runtime/supervise/worktree-fanout.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L38) - -**`Experimental`** - -Per-harness model/runId/baseRef overrides flow through the profile + these. - -*** - -### baseRef? - -> `optional` **baseRef?**: `string` - -Defined in: [runtime/supervise/worktree-fanout.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L39) - -**`Experimental`** diff --git a/docs/api/runtime/interfaces/AuthoredProfile.md b/docs/api/runtime/interfaces/AuthoredProfile.md deleted file mode 100644 index aee1eec..0000000 --- a/docs/api/runtime/interfaces/AuthoredProfile.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AuthoredProfile - -# Interface: AuthoredProfile - -Defined in: [runtime/supervise/authoring.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/authoring.ts#L23) - -What the supervisor AUTHORS per sub-task — a worker recipe (a partial `AgentProfile`). - -## Properties - -### name - -> **name**: `string` - -Defined in: [runtime/supervise/authoring.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/authoring.ts#L24) - -*** - -### systemPrompt - -> **systemPrompt**: `string` - -Defined in: [runtime/supervise/authoring.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/authoring.ts#L26) - -The rich, task-specific instructions the supervisor wrote for THIS worker. - -*** - -### model? - -> `optional` **model?**: `string` - -Defined in: [runtime/supervise/authoring.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/authoring.ts#L28) - -The model the supervisor chose for this sub-task (falls back to the run default). diff --git a/docs/api/runtime/interfaces/AuthoredStrategy.md b/docs/api/runtime/interfaces/AuthoredStrategy.md deleted file mode 100644 index 3a4bdc4..0000000 --- a/docs/api/runtime/interfaces/AuthoredStrategy.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AuthoredStrategy - -# Interface: AuthoredStrategy - -Defined in: [runtime/strategy-author.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L137) - -## Properties - -### strategy - -> **strategy**: [`Strategy`](Strategy.md) - -Defined in: [runtime/strategy-author.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L138) - -*** - -### file - -> **file**: `string` - -Defined in: [runtime/strategy-author.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L139) - -*** - -### code - -> **code**: `string` - -Defined in: [runtime/strategy-author.ts:140](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L140) diff --git a/docs/api/runtime/interfaces/BenchmarkCell.md b/docs/api/runtime/interfaces/BenchmarkCell.md deleted file mode 100644 index e6f907c..0000000 --- a/docs/api/runtime/interfaces/BenchmarkCell.md +++ /dev/null @@ -1,69 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / BenchmarkCell - -# Interface: BenchmarkCell - -Defined in: [runtime/run-benchmark.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L63) - -One strategy's outcome on one task — the per-task cell an optimizer consumes. - -## Properties - -### score - -> **score**: `number` - -Defined in: [runtime/run-benchmark.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L64) - -*** - -### resolved - -> **resolved**: `boolean` - -Defined in: [runtime/run-benchmark.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L65) - -*** - -### progression - -> **progression**: `number`[] - -Defined in: [runtime/run-benchmark.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L67) - -The progress curve (refine: score per shot; sample: best-so-far per rollout). - -*** - -### usd - -> **usd**: `number` - -Defined in: [runtime/run-benchmark.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L68) - -*** - -### ms - -> **ms**: `number` - -Defined in: [runtime/run-benchmark.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L69) - -*** - -### tokens - -> **tokens**: `object` - -Defined in: [runtime/run-benchmark.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L70) - -#### input - -> **input**: `number` - -#### output - -> **output**: `number` diff --git a/docs/api/runtime/interfaces/BenchmarkConfig.md b/docs/api/runtime/interfaces/BenchmarkConfig.md deleted file mode 100644 index 3209fd3..0000000 --- a/docs/api/runtime/interfaces/BenchmarkConfig.md +++ /dev/null @@ -1,110 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / BenchmarkConfig - -# Interface: BenchmarkConfig - -Defined in: [runtime/run-benchmark.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L32) - -## Properties - -### environment - -> **environment**: [`AgenticSurface`](AgenticSurface.md) - -Defined in: [runtime/run-benchmark.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L34) - -The task domain (5 hooks). - -*** - -### tasks - -> **tasks**: [`AgenticTask`](AgenticTask.md)[] - -Defined in: [runtime/run-benchmark.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L36) - -The tasks to score across. - -*** - -### worker - -> **worker**: [`AgenticOptions`](AgenticOptions.md) - -Defined in: [runtime/run-benchmark.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L38) - -The worker: model + router + (optional) the critic's instruction (the steerer knob). - -*** - -### strategies? - -> `optional` **strategies?**: [`Strategy`](Strategy.md)[] - -Defined in: [runtime/run-benchmark.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L41) - -Which strategies to compare. Pass the built-ins (`refine`, `sample`) or your own. - Default: [sample, refine]. - -*** - -### budget? - -> `optional` **budget?**: `number` - -Defined in: [runtime/run-benchmark.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L43) - -Shots (refine) / width (sample) — the equal compute budget per strategy. Default 3. - -*** - -### concurrency? - -> `optional` **concurrency?**: `number` - -Defined in: [runtime/run-benchmark.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L45) - -Tasks scored in parallel. Default 3. - -*** - -### onTask? - -> `optional` **onTask?**: (`row`, `done`, `total`) => `void` - -Defined in: [runtime/run-benchmark.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L48) - -Progress hook — fires as each task settles (the live-monitoring seam: append to a - progress file, render a tree, stream to a dashboard). `done` counts settled tasks. - -#### Parameters - -##### row - -[`BenchmarkTaskRow`](BenchmarkTaskRow.md) - -##### done - -`number` - -##### total - -`number` - -#### Returns - -`void` - -*** - -### hooks? - -> `optional` **hooks?**: [`RuntimeHooks`](../../index/interfaces/RuntimeHooks.md) - -Defined in: [runtime/run-benchmark.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L51) - -Lifecycle observability — every spawn/settle of every cell's shots/analysts streams - here live (the watchdog/route-auditor seam, passed through to `runAgentic`). diff --git a/docs/api/runtime/interfaces/BenchmarkLift.md b/docs/api/runtime/interfaces/BenchmarkLift.md deleted file mode 100644 index 500ec6f..0000000 --- a/docs/api/runtime/interfaces/BenchmarkLift.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / BenchmarkLift - -# Interface: BenchmarkLift - -Defined in: [runtime/run-benchmark.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L54) - -## Properties - -### mean - -> **mean**: `number` - -Defined in: [runtime/run-benchmark.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L56) - -Mean of paired deltas (refine − sample). - -*** - -### low - -> **low**: `number` - -Defined in: [runtime/run-benchmark.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L57) - -*** - -### high - -> **high**: `number` - -Defined in: [runtime/run-benchmark.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L58) - -*** - -### n - -> **n**: `number` - -Defined in: [runtime/run-benchmark.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L59) diff --git a/docs/api/runtime/interfaces/BenchmarkReport.md b/docs/api/runtime/interfaces/BenchmarkReport.md deleted file mode 100644 index 52e1b2d..0000000 --- a/docs/api/runtime/interfaces/BenchmarkReport.md +++ /dev/null @@ -1,67 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / BenchmarkReport - -# Interface: BenchmarkReport - -Defined in: [runtime/run-benchmark.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L95) - -## Properties - -### n - -> **n**: `number` - -Defined in: [runtime/run-benchmark.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L96) - -*** - -### excluded - -> **excluded**: `number` - -Defined in: [runtime/run-benchmark.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L97) - -*** - -### perStrategy - -> **perStrategy**: `Record`\<`string`, [`BenchmarkStrategySummary`](BenchmarkStrategySummary.md)\> - -Defined in: [runtime/run-benchmark.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L99) - -Per-strategy means (keyed by strategy.name). - -*** - -### perTask - -> **perTask**: [`BenchmarkTaskRow`](BenchmarkTaskRow.md)[] - -Defined in: [runtime/run-benchmark.ts:102](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L102) - -The full per-task × per-strategy table — the LOSSES an optimizer (GEPA, a - strategy-author, an operator) consumes. Includes errored tasks with the reason. - -*** - -### pareto - -> **pareto**: `string`[] - -Defined in: [runtime/run-benchmark.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L105) - -The non-dominated strategies on (score ↑, $/task ↓) — collapse-last, per the canon: - a strategy that ties on score at half the cost WINS and a scalar would hide it. - -*** - -### refineVsSample? - -> `optional` **refineVsSample?**: [`BenchmarkLift`](BenchmarkLift.md) - -Defined in: [runtime/run-benchmark.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L107) - -The headline when both `refine` and `sample` ran: paired-bootstrap lift of refine over sample. diff --git a/docs/api/runtime/interfaces/BenchmarkStrategySummary.md b/docs/api/runtime/interfaces/BenchmarkStrategySummary.md deleted file mode 100644 index 9432846..0000000 --- a/docs/api/runtime/interfaces/BenchmarkStrategySummary.md +++ /dev/null @@ -1,47 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / BenchmarkStrategySummary - -# Interface: BenchmarkStrategySummary - -Defined in: [runtime/run-benchmark.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L85) - -## Properties - -### score - -> **score**: `number` - -Defined in: [runtime/run-benchmark.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L87) - -Mean verifier score (0..1). - -*** - -### resolved - -> **resolved**: `number` - -Defined in: [runtime/run-benchmark.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L89) - -Fraction of tasks fully resolved. - -*** - -### usd - -> **usd**: `number` - -Defined in: [runtime/run-benchmark.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L91) - -Mean cost vector per task. - -*** - -### ms - -> **ms**: `number` - -Defined in: [runtime/run-benchmark.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L92) diff --git a/docs/api/runtime/interfaces/BenchmarkTaskRow.md b/docs/api/runtime/interfaces/BenchmarkTaskRow.md deleted file mode 100644 index a483155..0000000 --- a/docs/api/runtime/interfaces/BenchmarkTaskRow.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / BenchmarkTaskRow - -# Interface: BenchmarkTaskRow - -Defined in: [runtime/run-benchmark.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L73) - -## Properties - -### taskId - -> **taskId**: `string` - -Defined in: [runtime/run-benchmark.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L74) - -*** - -### cells? - -> `optional` **cells?**: `Record`\<`string`, [`BenchmarkCell`](BenchmarkCell.md)\> - -Defined in: [runtime/run-benchmark.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L76) - -Per-strategy cells; absent when the task errored before completing all strategies. - -*** - -### errors? - -> `optional` **errors?**: `Record`\<`string`, `string`\> - -Defined in: [runtime/run-benchmark.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L80) - -Per-strategy failures on this task: the strategy competed, threw, and scored an - honest zero — it loses, it does not poison the row. The message is kept so a later - generation's author can see WHY a candidate died. - -*** - -### error? - -> `optional` **error?**: `string` - -Defined in: [runtime/run-benchmark.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L82) - -Why the task was excluded (infra/setup failure) — never silently dropped. diff --git a/docs/api/runtime/interfaces/BridgeSeam.md b/docs/api/runtime/interfaces/BridgeSeam.md deleted file mode 100644 index f3d97ed..0000000 --- a/docs/api/runtime/interfaces/BridgeSeam.md +++ /dev/null @@ -1,84 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / BridgeSeam - -# Interface: BridgeSeam - -Defined in: [runtime/supervise/runtime.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L130) - -cli-bridge seam. A local OpenAI-compatible bridge that fronts harness CLIs -(claude-code / opencode / kimi / pi) behind one HTTP surface; `model` doubles -as the harness selector (e.g. `claude-code/sonnet`, `opencode//`). -`agentProfile` is the bridge-dialect profile (metadata.disallowedTools, mcp) -forwarded verbatim per request — how an arm disables native tools or injects -a provider search MCP. - -The executor opens a RESUMABLE cli-bridge session — structurally identical to the -sandbox executor's persistent box, just local. `sessionId` is the stable -caller-owned id cli-bridge maps to the harness's internal conversation id; a -follow-up steer/resume on the SAME id continues the SAME harness session (opencode -`-s`, claude `--resume`, …). Omit it and the executor mints a stable one per spawn. - -## Properties - -### bridgeUrl - -> **bridgeUrl**: `string` - -Defined in: [runtime/supervise/runtime.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L131) - -*** - -### bridgeBearer - -> **bridgeBearer**: `string` - -Defined in: [runtime/supervise/runtime.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L132) - -*** - -### model - -> **model**: `string` - -Defined in: [runtime/supervise/runtime.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L133) - -*** - -### agentProfile? - -> `optional` **agentProfile?**: `Record`\<`string`, `unknown`\> - -Defined in: [runtime/supervise/runtime.ts:134](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L134) - -*** - -### timeoutMs? - -> `optional` **timeoutMs?**: `number` - -Defined in: [runtime/supervise/runtime.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L135) - -*** - -### sessionId? - -> `optional` **sessionId?**: `string` - -Defined in: [runtime/supervise/runtime.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L138) - -Stable, caller-owned cli-bridge session id for harness-side resume. Defaults - to a freshly minted per-spawn id so each worker is its own resumable session. - -*** - -### maxTurns? - -> `optional` **maxTurns?**: `number` - -Defined in: [runtime/supervise/runtime.ts:141](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L141) - -Per-resume-turn inference cap before the worker settles on its last output. - Mirrors `routerToolsInlineExecutor.maxTurns`; default 200 (runaway backstop). diff --git a/docs/api/runtime/interfaces/Budget.md b/docs/api/runtime/interfaces/Budget.md deleted file mode 100644 index 0cb083c..0000000 --- a/docs/api/runtime/interfaces/Budget.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Budget - -# Interface: Budget - -Defined in: [runtime/supervise/types.ts:199](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L199) - -A budget envelope on a spawn or the root. All ceilings; the pool reserves against them. - -## Properties - -### maxIterations - -> `readonly` **maxIterations**: `number` - -Defined in: [runtime/supervise/types.ts:200](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L200) - -*** - -### maxTokens - -> `readonly` **maxTokens**: `number` - -Defined in: [runtime/supervise/types.ts:201](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L201) - -*** - -### maxUsd? - -> `readonly` `optional` **maxUsd?**: `number` - -Defined in: [runtime/supervise/types.ts:202](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L202) - -*** - -### deadlineMs? - -> `readonly` `optional` **deadlineMs?**: `number` - -Defined in: [runtime/supervise/types.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L203) diff --git a/docs/api/runtime/interfaces/BudgetPool.md b/docs/api/runtime/interfaces/BudgetPool.md deleted file mode 100644 index ceaee29..0000000 --- a/docs/api/runtime/interfaces/BudgetPool.md +++ /dev/null @@ -1,136 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / BudgetPool - -# Interface: BudgetPool - -Defined in: [runtime/supervise/budget.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L51) - -## Methods - -### reserve() - -> **reserve**(`b`): \{ `ok`: `true`; `ticket`: [`ReservationTicket`](ReservationTicket.md); \} \| \{ `ok`: `false`; `reason`: `"budget-exhausted"`; \} - -Defined in: [runtime/supervise/budget.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L57) - -Atomically reserve a child's full ceiling from the free balance. Fails closed -({ ok: false }) when the pool can't cover tokens, usd, or iterations — the -caller inspects `ok` before `ticket`. - -#### Parameters - -##### b - -[`Budget`](Budget.md) - -#### Returns - -\{ `ok`: `true`; `ticket`: [`ReservationTicket`](ReservationTicket.md); \} \| \{ `ok`: `false`; `reason`: `"budget-exhausted"`; \} - -*** - -### reconcile() - -> **reconcile**(`ticket`, `spent`): `void` - -Defined in: [runtime/supervise/budget.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L65) - -Release a reservation: commit the actual `spent`, refund the unspent remainder -to the free pool. Throws on an unknown or already-reconciled ticket (fail loud — -a double refund would silently break conservation). - -#### Parameters - -##### ticket - -[`ReservationTicket`](ReservationTicket.md) - -##### spent - -[`Spend`](Spend.md) - -#### Returns - -`void` - -*** - -### spendFrom() - -> **spendFrom**(`events`): `Promise`\<[`Spend`](Spend.md)\> - -Defined in: [runtime/supervise/budget.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L69) - -Fold a normalized `UsageEvent` stream (or array) into a `Spend`. Tokens via - `addTokenUsage`, usd on its own channel, iterations from `'iteration'` events. - `ms` is left zero — wall-clock duration is the caller's to record, not the pool's. - -#### Parameters - -##### events - -`AsyncIterable`\<[`UsageEvent`](../type-aliases/UsageEvent.md), `any`, `any`\> \| [`UsageEvent`](../type-aliases/UsageEvent.md)[] - -#### Returns - -`Promise`\<[`Spend`](Spend.md)\> - -*** - -### readout() - -> **readout**(): [`BudgetReadout`](../type-aliases/BudgetReadout.md) - -Defined in: [runtime/supervise/budget.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L71) - -The current readout, reflecting all outstanding reservations. - -#### Returns - -[`BudgetReadout`](../type-aliases/BudgetReadout.md) - -*** - -### observe() - -> **observe**(`spend`): `void` - -Defined in: [runtime/supervise/budget.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L82) - -Record OBSERVED spend that did NOT go through reserve/reconcile — the driver's OWN inference -(its chat turns), which is real compute but not a spawned child. A direct `free → committed` -debit, so `total ≡ free + reserved + committed` is preserved: equal-k counts the driver's -tokens and the in-loop budget guard (`readout().tokensLeft`) sees them. `free` may go negative -when a run overspends — that is honest (the readout then signals exhaustion). It never throws: -the spend already happened, so accounting records reality; the in-loop guard prevents MORE. -The DURABLE record is the journal's `metered` event (written by `Scope.meter`); this debit -only makes the live `readout()` reflect driver inference for the in-loop guard. - -#### Parameters - -##### spend - -[`Spend`](Spend.md) - -#### Returns - -`void` - -*** - -### assertNoOpenTickets() - -> **assertNoOpenTickets**(): `void` - -Defined in: [runtime/supervise/budget.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L86) - -Fail loud if any reservation is still open — the conserved-pool leak detector. Called at the - supervisor's join barrier: once every child has settled, no ticket may remain (a leaked - reservation would silently break `total ≡ free + reserved + committed`). - -#### Returns - -`void` diff --git a/docs/api/runtime/interfaces/BusEvent.md b/docs/api/runtime/interfaces/BusEvent.md deleted file mode 100644 index f673b82..0000000 --- a/docs/api/runtime/interfaces/BusEvent.md +++ /dev/null @@ -1,19 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / BusEvent - -# Interface: BusEvent - -Defined in: [runtime/supervise/event-bus.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L26) - -Every bus event is a discriminated union member keyed by `type`. - -## Properties - -### type - -> `readonly` **type**: `string` - -Defined in: [runtime/supervise/event-bus.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L27) diff --git a/docs/api/runtime/interfaces/BusRecord.md b/docs/api/runtime/interfaces/BusRecord.md deleted file mode 100644 index f0f71fe..0000000 --- a/docs/api/runtime/interfaces/BusRecord.md +++ /dev/null @@ -1,50 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / BusRecord - -# Interface: BusRecord\ - -Defined in: [runtime/supervise/event-bus.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L32) - -A published event stamped for ordering and observability. `seq` is the monotonic publish index; - `priority` drives pull order (higher = bumped ahead); `at` is the wall-clock publish time (ms). - -## Type Parameters - -### E - -`E` *extends* [`BusEvent`](BusEvent.md) - -## Properties - -### seq - -> `readonly` **seq**: `number` - -Defined in: [runtime/supervise/event-bus.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L33) - -*** - -### at - -> `readonly` **at**: `number` - -Defined in: [runtime/supervise/event-bus.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L34) - -*** - -### priority - -> `readonly` **priority**: `number` - -Defined in: [runtime/supervise/event-bus.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L35) - -*** - -### event - -> `readonly` **event**: `E` - -Defined in: [runtime/supervise/event-bus.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L36) diff --git a/docs/api/runtime/interfaces/BusStats.md b/docs/api/runtime/interfaces/BusStats.md deleted file mode 100644 index d180da6..0000000 --- a/docs/api/runtime/interfaces/BusStats.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / BusStats - -# Interface: BusStats - -Defined in: [runtime/supervise/event-bus.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L49) - -## Properties - -### published - -> `readonly` **published**: `number` - -Defined in: [runtime/supervise/event-bus.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L50) - -*** - -### pulled - -> `readonly` **pulled**: `number` - -Defined in: [runtime/supervise/event-bus.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L51) - -*** - -### byKind - -> `readonly` **byKind**: `Readonly`\<`Record`\<`string`, `number`\>\> - -Defined in: [runtime/supervise/event-bus.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L53) - -Count published per event `type`. diff --git a/docs/api/runtime/interfaces/ChampionPick.md b/docs/api/runtime/interfaces/ChampionPick.md deleted file mode 100644 index ea75690..0000000 --- a/docs/api/runtime/interfaces/ChampionPick.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ChampionPick - -# Interface: ChampionPick - -Defined in: [runtime/strategy-evolution.ts:152](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L152) - -## Properties - -### name - -> **name**: `string` - -Defined in: [runtime/strategy-evolution.ts:153](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L153) - -*** - -### score - -> **score**: `number` - -Defined in: [runtime/strategy-evolution.ts:154](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L154) - -*** - -### usd - -> **usd**: `number` - -Defined in: [runtime/strategy-evolution.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L155) diff --git a/docs/api/runtime/interfaces/CheckpointCapableBox.md b/docs/api/runtime/interfaces/CheckpointCapableBox.md deleted file mode 100644 index 3f7e0c8..0000000 --- a/docs/api/runtime/interfaces/CheckpointCapableBox.md +++ /dev/null @@ -1,42 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / CheckpointCapableBox - -# Interface: CheckpointCapableBox - -Defined in: [runtime/sandbox-lineage.ts:375](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L375) - -**`Experimental`** - -Loop-side widening of the box's optional checkpoint method. The -`SandboxClient`/`SandboxInstance` surface the kernel relies on does not -require checkpointing; this reads it optionally so the lineage can probe-gate -without importing sandbox-backend specifics. - -## Properties - -### checkpoint? - -> `optional` **checkpoint?**: (`options?`) => `Promise`\<\{ `checkpointId`: `string`; \}\> - -Defined in: [runtime/sandbox-lineage.ts:376](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L376) - -**`Experimental`** - -#### Parameters - -##### options? - -###### leaveRunning? - -`boolean` - -###### tags? - -`string`[] - -#### Returns - -`Promise`\<\{ `checkpointId`: `string`; \}\> diff --git a/docs/api/runtime/interfaces/CliSeam.md b/docs/api/runtime/interfaces/CliSeam.md deleted file mode 100644 index b959627..0000000 --- a/docs/api/runtime/interfaces/CliSeam.md +++ /dev/null @@ -1,47 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / CliSeam - -# Interface: CliSeam - -Defined in: [runtime/supervise/runtime.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L91) - -CLI subprocess seam. `bin` + `args` describe the Halo/RLM process to spawn. - -## Properties - -### bin - -> **bin**: `string` - -Defined in: [runtime/supervise/runtime.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L92) - -*** - -### args? - -> `optional` **args?**: `string`[] - -Defined in: [runtime/supervise/runtime.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L93) - -*** - -### env? - -> `optional` **env?**: `Record`\<`string`, `string`\> - -Defined in: [runtime/supervise/runtime.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L95) - -Extra environment for the subprocess (merged over `process.env`). - -*** - -### cwd? - -> `optional` **cwd?**: `string` - -Defined in: [runtime/supervise/runtime.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L97) - -Working directory for the subprocess. diff --git a/docs/api/runtime/interfaces/CliWorktreeSeam.md b/docs/api/runtime/interfaces/CliWorktreeSeam.md deleted file mode 100644 index b7ecb22..0000000 --- a/docs/api/runtime/interfaces/CliWorktreeSeam.md +++ /dev/null @@ -1,63 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / CliWorktreeSeam - -# Interface: CliWorktreeSeam - -Defined in: [runtime/supervise/runtime.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L107) - -cli-worktree seam. A supervisor-authored `AgentProfile` driving a local coding-harness CLI -(claude / codex / opencode) on its own git worktree — the leaf `createWorktreeCliExecutor` -named as data. `harness` + `repoRoot` + `taskPrompt` are required; the authored -`profile.prompt.systemPrompt` + `profile.model.default` reach the harness via the §1.5 -`harnessInvocation` mapper. Everything else mirrors `WorktreeCliExecutorOptions`. - -## Properties - -### repoRoot - -> **repoRoot**: `string` - -Defined in: [runtime/supervise/runtime.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L108) - -*** - -### harness - -> **harness**: [`LocalHarness`](../../mcp/type-aliases/LocalHarness.md) - -Defined in: [runtime/supervise/runtime.ts:109](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L109) - -*** - -### taskPrompt - -> **taskPrompt**: `string` - -Defined in: [runtime/supervise/runtime.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L110) - -*** - -### runId? - -> `optional` **runId?**: `string` - -Defined in: [runtime/supervise/runtime.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L111) - -*** - -### baseRef? - -> `optional` **baseRef?**: `string` - -Defined in: [runtime/supervise/runtime.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L112) - -*** - -### harnessTimeoutMs? - -> `optional` **harnessTimeoutMs?**: `number` - -Defined in: [runtime/supervise/runtime.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L113) diff --git a/docs/api/runtime/interfaces/CoderCheckConstraints.md b/docs/api/runtime/interfaces/CoderCheckConstraints.md deleted file mode 100644 index 9b24792..0000000 --- a/docs/api/runtime/interfaces/CoderCheckConstraints.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / CoderCheckConstraints - -# Interface: CoderCheckConstraints - -Defined in: [runtime/supervise/patch-checks.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L36) - -**`Experimental`** - -The per-task constraints the mechanical gate enforces. - -## Extended by - -- [`PatchDeliverableOptions`](PatchDeliverableOptions.md) - -## Properties - -### maxDiffLines? - -> `optional` **maxDiffLines?**: `number` - -Defined in: [runtime/supervise/patch-checks.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L38) - -**`Experimental`** - -Default 400. Hard cap; gate fails when exceeded. - -*** - -### forbiddenPaths? - -> `optional` **forbiddenPaths?**: `string`[] - -Defined in: [runtime/supervise/patch-checks.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L40) - -**`Experimental`** - -Literal path prefixes the patch must not touch. diff --git a/docs/api/runtime/interfaces/CoderCheckInput.md b/docs/api/runtime/interfaces/CoderCheckInput.md deleted file mode 100644 index c02c77e..0000000 --- a/docs/api/runtime/interfaces/CoderCheckInput.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / CoderCheckInput - -# Interface: CoderCheckInput - -Defined in: [runtime/supervise/patch-checks.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L26) - -**`Experimental`** - -The patch + its derived PASS signals the mechanical gate decides on. - -## Properties - -### patch - -> **patch**: `string` - -Defined in: [runtime/supervise/patch-checks.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L28) - -**`Experimental`** - -The unified diff produced by the run. - -*** - -### testsPassed - -> **testsPassed**: `boolean` - -Defined in: [runtime/supervise/patch-checks.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L30) - -**`Experimental`** - -Did `testCmd` exit clean? - -*** - -### typecheckPassed - -> **typecheckPassed**: `boolean` - -Defined in: [runtime/supervise/patch-checks.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L32) - -**`Experimental`** - -Did `typecheckCmd` exit clean? diff --git a/docs/api/runtime/interfaces/CompletionAnalyst.md b/docs/api/runtime/interfaces/CompletionAnalyst.md deleted file mode 100644 index e4d5400..0000000 --- a/docs/api/runtime/interfaces/CompletionAnalyst.md +++ /dev/null @@ -1,46 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / CompletionAnalyst - -# Interface: CompletionAnalyst\ - -Defined in: [runtime/completion.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L48) - -Reads a node's trace → a completion verdict. Same input shape as the `analyze` hook, so - ONE analyst node can back both channels (findings for steer, a verdict for stop). - -## Type Parameters - -### Task - -`Task` - -### Output - -`Output` - -## Methods - -### assess() - -> **assess**(`input`): [`CompletionVerdict`](CompletionVerdict.md) \| `Promise`\<[`CompletionVerdict`](CompletionVerdict.md)\> - -Defined in: [runtime/completion.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L49) - -#### Parameters - -##### input - -###### task - -`Task` - -###### history - -readonly [`Iteration`](Iteration.md)\<`Task`, `Output`\>[] - -#### Returns - -[`CompletionVerdict`](CompletionVerdict.md) \| `Promise`\<[`CompletionVerdict`](CompletionVerdict.md)\> diff --git a/docs/api/runtime/interfaces/CompletionEvidence.md b/docs/api/runtime/interfaces/CompletionEvidence.md deleted file mode 100644 index b65ad38..0000000 --- a/docs/api/runtime/interfaces/CompletionEvidence.md +++ /dev/null @@ -1,28 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / CompletionEvidence - -# Interface: CompletionEvidence - -Defined in: [runtime/completion.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L29) - -Trace-derived evidence for a completion claim — an artifact (output) or a verifier metric, - never the judge's own verdict. Mirrors the steer-firewall's provenance discipline. - -## Properties - -### kind - -> **kind**: `"artifact"` \| `"metric"` - -Defined in: [runtime/completion.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L30) - -*** - -### uri - -> **uri**: `string` - -Defined in: [runtime/completion.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L31) diff --git a/docs/api/runtime/interfaces/CompletionPolicy.md b/docs/api/runtime/interfaces/CompletionPolicy.md deleted file mode 100644 index ce9f4d0..0000000 --- a/docs/api/runtime/interfaces/CompletionPolicy.md +++ /dev/null @@ -1,22 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / CompletionPolicy - -# Interface: CompletionPolicy - -Defined in: [runtime/completion.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L57) - -When a verdict authorizes the driver to END. Deterministic → trust (ground truth); - probabilistic → validate by confidence threshold (the driver's check). - -## Properties - -### minConfidence? - -> `optional` **minConfidence?**: `number` - -Defined in: [runtime/completion.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L59) - -Minimum confidence a PROBABILISTIC verdict must clear to end. Default 0.8. diff --git a/docs/api/runtime/interfaces/CompletionVerdict.md b/docs/api/runtime/interfaces/CompletionVerdict.md deleted file mode 100644 index 8db9080..0000000 --- a/docs/api/runtime/interfaces/CompletionVerdict.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / CompletionVerdict - -# Interface: CompletionVerdict - -Defined in: [runtime/completion.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L35) - -The "is it done?" verdict an analyst returns to the parent. - -## Properties - -### done - -> **done**: `boolean` - -Defined in: [runtime/completion.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L36) - -*** - -### determinism - -> **determinism**: `"deterministic"` \| `"probabilistic"` - -Defined in: [runtime/completion.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L38) - -How verifiable the claim is — sets whether the driver trusts it or validates it. - -*** - -### reasons? - -> `optional` **reasons?**: `string` - -Defined in: [runtime/completion.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L40) - -Why the analyst believes it is (or isn't) done — what the driver validates. - -*** - -### confidence? - -> `optional` **confidence?**: `number` - -Defined in: [runtime/completion.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L42) - -0..1, for probabilistic verdicts; the driver's validation threshold reads this. - -*** - -### evidence? - -> `optional` **evidence?**: readonly [`CompletionEvidence`](CompletionEvidence.md)[] - -Defined in: [runtime/completion.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/completion.ts#L43) diff --git a/docs/api/runtime/interfaces/CoordinationDriverOptions.md b/docs/api/runtime/interfaces/CoordinationDriverOptions.md deleted file mode 100644 index b041593..0000000 --- a/docs/api/runtime/interfaces/CoordinationDriverOptions.md +++ /dev/null @@ -1,96 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / CoordinationDriverOptions - -# Interface: CoordinationDriverOptions - -Defined in: [runtime/supervise/coordination-driver.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L70) - -## Properties - -### name - -> `readonly` **name**: `string` - -Defined in: [runtime/supervise/coordination-driver.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L71) - -*** - -### chat - -> `readonly` **chat**: [`DriverChat`](DriverChat.md) - -Defined in: [runtime/supervise/coordination-driver.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L73) - -The driver-LLM seam (scripted mock offline; router tool-calling in production). - -*** - -### blobs - -> `readonly` **blobs**: [`ResultBlobStore`](ResultBlobStore.md) - -Defined in: [runtime/supervise/coordination-driver.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L75) - -Shared blob store — `observe_worker` reads settled outputs through it. - -*** - -### makeWorkerAgent - -> `readonly` **makeWorkerAgent**: [`MakeWorkerAgent`](../../mcp/type-aliases/MakeWorkerAgent.md) - -Defined in: [runtime/supervise/coordination-driver.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L77) - -Resolve a spawned `profile` to a worker LEAF or a driver child (the recursion seam). - -*** - -### perWorker - -> `readonly` **perWorker**: [`Budget`](Budget.md) - -Defined in: [runtime/supervise/coordination-driver.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L79) - -Per-child budget reserved from the conserved pool on each spawn. - -*** - -### systemPrompt - -> `readonly` **systemPrompt**: `string` \| ((`task`) => `string`) - -Defined in: [runtime/supervise/coordination-driver.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L82) - -The driver's stance — a string, or built from the task (the worker-driver prompt / - the generator). INJECTED so the prompt is a pluggable, optimizable role. - -*** - -### maxTurns? - -> `readonly` `optional` **maxTurns?**: `number` - -Defined in: [runtime/supervise/coordination-driver.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L87) - -Max driver turns before the loop force-finalizes on the best settled child. Default 16. - `0` lifts the turn-COUNT cap: the loop is bounded instead by the conserved budget pool, - an absolute deadline, the driver's own stop, and abort (checked in-loop). A finite - anti-runaway tripwire still guards a degenerate driver that loops on a no-spawn tool. - -*** - -### now? - -> `readonly` `optional` **now?**: () => `number` - -Defined in: [runtime/supervise/coordination-driver.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L90) - -Injected clock for the in-loop absolute-deadline guard — keeps the deadline check - deterministic in tests. Defaults to `Date.now`. - -#### Returns - -`number` diff --git a/docs/api/runtime/interfaces/CoordinationMcpHandle.md b/docs/api/runtime/interfaces/CoordinationMcpHandle.md deleted file mode 100644 index 5bf1bd8..0000000 --- a/docs/api/runtime/interfaces/CoordinationMcpHandle.md +++ /dev/null @@ -1,123 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / CoordinationMcpHandle - -# Interface: CoordinationMcpHandle - -Defined in: [runtime/supervise/coordination-mcp.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L33) - -## Properties - -### url - -> `readonly` **url**: `string` - -Defined in: [runtime/supervise/coordination-mcp.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L35) - -The URL an in-box harness mounts as `mcp.mcpServers.coordination.url`. - -*** - -### port - -> `readonly` **port**: `number` - -Defined in: [runtime/supervise/coordination-mcp.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L36) - -*** - -### history - -> **history**: () => readonly [`BusRecord`](BusRecord.md)\<[`CoordinationEvent`](../../mcp/type-aliases/CoordinationEvent.md)\>[] - -Defined in: [runtime/supervise/coordination-mcp.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L41) - -The full ordered bus-event log — observability audit + replay trail. - -The full ordered log of every bus event — UP (settled / question / finding) and DOWN - (steer / answer) — the observability audit + replay trail. Each record carries seq, - timestamp, and priority. - -#### Returns - -readonly [`BusRecord`](BusRecord.md)\<[`CoordinationEvent`](../../mcp/type-aliases/CoordinationEvent.md)\>[] - -*** - -### stats - -> **stats**: () => [`BusStats`](BusStats.md) - -Defined in: [runtime/supervise/coordination-mcp.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L43) - -Bus throughput counters for live dashboards. - -Bus throughput counters (published / pulled / by-kind) for live dashboards. - -#### Returns - -[`BusStats`](BusStats.md) - -*** - -### raiseFinding - -> **raiseFinding**: (`finding`) => `Promise`\<`void`\> - -Defined in: [runtime/supervise/coordination-mcp.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L45) - -Raise a `finding` on the bus from an online detector watching a worker's live pipe. - -Raise a `finding` on the bus from outside the settle hook — the seam an ONLINE detector - (mid-run, on the worker pipe) uses to tell the driver "this worker is looping/erroring" the - moment it happens, instead of only at settle. Queued for `await_event` + pass-through. - -#### Parameters - -##### finding - -`AnalystFindingEvent` - -#### Returns - -`Promise`\<`void`\> - -## Methods - -### settled() - -> **settled**(): readonly `object`[] - -Defined in: [runtime/supervise/coordination-mcp.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L38) - -The coordination tools' settled-worker ledger (for the driver's finalize). - -#### Returns - -readonly `object`[] - -*** - -### isStopped() - -> **isStopped**(): `boolean` - -Defined in: [runtime/supervise/coordination-mcp.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L39) - -#### Returns - -`boolean` - -*** - -### close() - -> **close**(): `Promise`\<`void`\> - -Defined in: [runtime/supervise/coordination-mcp.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-mcp.ts#L46) - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/runtime/interfaces/Corpus.md b/docs/api/runtime/interfaces/Corpus.md deleted file mode 100644 index ef08b24..0000000 --- a/docs/api/runtime/interfaces/Corpus.md +++ /dev/null @@ -1,60 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Corpus - -# Interface: Corpus - -Defined in: [runtime/personify/wave-types.ts:458](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L458) - -The durable cross-run corpus — the learning-flywheel store. DISTINCT from `SpawnJournal` -(per-run decisions, replay) and `ResultBlobStore` (per-run payloads): `Corpus` holds accreted -FACTS across runs that the next run reads back. `InMemoryCorpus` + `FileCorpus` (JSONL) impls -live in `corpus.ts` and MAY share a storage spine with the JSONL journal, but the INTERFACE is -separate so a consumer never confuses a replay record with a learned fact. - -Fail-loud, typed-outcome boundary: `append` is idempotent on an identical record (same `id` + -`claim`); a conflicting re-append under the same `id` is a typed error, never a silent overwrite. - -## Methods - -### append() - -> **append**(`record`): `Promise`\<\{ `succeeded`: `true`; \} \| \{ `succeeded`: `false`; `error`: `string`; \}\> - -Defined in: [runtime/personify/wave-types.ts:461](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L461) - -Append one accreted fact. Idempotent on an identical record; returns a typed outcome — - inspect `succeeded` before treating it as durable (no silent write-through on conflict). - -#### Parameters - -##### record - -[`CorpusRecord`](CorpusRecord.md) - -#### Returns - -`Promise`\<\{ `succeeded`: `true`; \} \| \{ `succeeded`: `false`; `error`: `string`; \}\> - -*** - -### query() - -> **query**(`filter`): `Promise`\ - -Defined in: [runtime/personify/wave-types.ts:464](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L464) - -Query accreted facts by filter — most-confident first. Returns the matching records (an - empty array when none match is a valid result, NOT an error). - -#### Parameters - -##### filter - -[`CorpusFilter`](CorpusFilter.md) - -#### Returns - -`Promise`\ diff --git a/docs/api/runtime/interfaces/CorpusFilter.md b/docs/api/runtime/interfaces/CorpusFilter.md deleted file mode 100644 index 21b4c0a..0000000 --- a/docs/api/runtime/interfaces/CorpusFilter.md +++ /dev/null @@ -1,59 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / CorpusFilter - -# Interface: CorpusFilter - -Defined in: [runtime/personify/wave-types.ts:436](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L436) - -A corpus query filter — every field is an AND-narrowing; an omitted field does not constrain. - -## Properties - -### area? - -> `readonly` `optional` **area?**: `string` - -Defined in: [runtime/personify/wave-types.ts:437](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L437) - -*** - -### tags? - -> `readonly` `optional` **tags?**: readonly `string`[] - -Defined in: [runtime/personify/wave-types.ts:439](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L439) - -Match records carrying ALL of these tags. - -*** - -### minConfidence? - -> `readonly` `optional` **minConfidence?**: `number` - -Defined in: [runtime/personify/wave-types.ts:441](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L441) - -Minimum confidence a record must clear to be returned (the render gate). - -*** - -### runId? - -> `readonly` `optional` **runId?**: `string` - -Defined in: [runtime/personify/wave-types.ts:443](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L443) - -Only records from this run (rare — usually a cross-run read). - -*** - -### limit? - -> `readonly` `optional` **limit?**: `number` - -Defined in: [runtime/personify/wave-types.ts:445](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L445) - -Cap the result count (most-confident first in the impl). diff --git a/docs/api/runtime/interfaces/CorpusRecord.md b/docs/api/runtime/interfaces/CorpusRecord.md deleted file mode 100644 index 798fbb2..0000000 --- a/docs/api/runtime/interfaces/CorpusRecord.md +++ /dev/null @@ -1,111 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / CorpusRecord - -# Interface: CorpusRecord - -Defined in: [runtime/personify/wave-types.ts:414](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L414) - -One accreted fact in the cross-run corpus — the learning-flywheel's durable unit. DISTINCT from -a `SpawnEvent` (a per-run decision record): a `CorpusRecord` is a fact a run LEARNED that a -FUTURE run should read back (the world-model for story 5). It is content the next persona reads, -not a replay input. Tagged + scored so `query`/`renderCorpusToInstructions` can project the -relevant, high-confidence subset. - -## Properties - -### schemaVersion - -> `readonly` **schemaVersion**: `"1.0.0"` - -Defined in: [runtime/personify/wave-types.ts:415](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L415) - -*** - -### id - -> `readonly` **id**: `string` - -Defined in: [runtime/personify/wave-types.ts:417](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L417) - -Stable id over identity-defining fields (claim + tags) so a re-learned fact dedups. - -*** - -### runId - -> `readonly` **runId**: `string` - -Defined in: [runtime/personify/wave-types.ts:419](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L419) - -The run that produced this fact (the journal `runId`/`root`) — provenance back to the trace. - -*** - -### producedAt - -> `readonly` **producedAt**: `string` - -Defined in: [runtime/personify/wave-types.ts:420](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L420) - -*** - -### area - -> `readonly` **area**: `string` - -Defined in: [runtime/personify/wave-types.ts:422](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L422) - -Coarse classification the query/render filters on (free-form, mirrors `AnalystFinding.area`). - -*** - -### claim - -> `readonly` **claim**: `string` - -Defined in: [runtime/personify/wave-types.ts:424](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L424) - -The accreted fact — the instruction-shaped statement the next run reads back. - -*** - -### rationale? - -> `readonly` `optional` **rationale?**: `string` - -Defined in: [runtime/personify/wave-types.ts:426](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L426) - -Optional supporting detail the renderer may include under the claim. - -*** - -### tags - -> `readonly` **tags**: readonly `string`[] - -Defined in: [runtime/personify/wave-types.ts:428](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L428) - -Free-form tags for `query` filtering (domain, persona, surface). - -*** - -### confidence - -> `readonly` **confidence**: `number` - -Defined in: [runtime/personify/wave-types.ts:430](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L430) - -0..1 — the producing run's confidence in this fact (the render threshold reads it). - -*** - -### evidence? - -> `readonly` `optional` **evidence?**: readonly `object`[] - -Defined in: [runtime/personify/wave-types.ts:432](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L432) - -Optional provenance back into the run that learned it (a finding id / outRef / span). diff --git a/docs/api/runtime/interfaces/CreateScopeAnalystOptions.md b/docs/api/runtime/interfaces/CreateScopeAnalystOptions.md deleted file mode 100644 index ed69caa..0000000 --- a/docs/api/runtime/interfaces/CreateScopeAnalystOptions.md +++ /dev/null @@ -1,74 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / CreateScopeAnalystOptions - -# Interface: CreateScopeAnalystOptions\ - -Defined in: [runtime/personify/analyst.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L68) - -The analyst run an `Agent` performs over the children settled so far. -The combinator supplies the analyst's task projection (how to frame the drained settlements as -the analyst's input) — the analyst's `act` reads the trace and returns its raw findings; the -firewall is enforced afterwards by `createScopeAnalyst`, not by the analyst itself. - -## Type Parameters - -### D - -`D` - -## Properties - -### analyst - -> `readonly` **analyst**: [`Agent`](Agent.md)\<`unknown`, readonly `AnalystFinding`[]\> - -Defined in: [runtime/personify/analyst.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L72) - -The analyst agent the combinator spawns over the trace. `harness` is the persona's choice - (`null` for an inline router analyst, a `BackendType` for a sandboxed one). Its `act` returns - the RAW findings; this module asserts the firewall on them before returning. - -*** - -### budget - -> `readonly` **budget**: [`Budget`](Budget.md) - -Defined in: [runtime/personify/analyst.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L78) - -The conserved budget reserved for one analyst spawn. The pool reserves against it and fails - closed; an analyst that cannot be admitted is a fail-loud abort, never silent empty findings. - -*** - -### label? - -> `readonly` `optional` **label?**: `string` - -Defined in: [runtime/personify/analyst.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L80) - -Trace/journal label for the spawned analyst child. Default `'analyst'`. - -## Methods - -### buildTask() - -> **buildTask**(`input`): `unknown` - -Defined in: [runtime/personify/analyst.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L75) - -Build the analyst agent's task from the analyze input (the root-task framing + the children - drained so far). Pure projection — the analyst interprets it, this never reads it. - -#### Parameters - -##### input - -[`ScopeAnalyzeInput`](ScopeAnalyzeInput.md)\<`D`\> - -#### Returns - -`unknown` diff --git a/docs/api/runtime/interfaces/CriuCapableClient.md b/docs/api/runtime/interfaces/CriuCapableClient.md deleted file mode 100644 index 4b18d41..0000000 --- a/docs/api/runtime/interfaces/CriuCapableClient.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / CriuCapableClient - -# Interface: CriuCapableClient - -Defined in: [runtime/sandbox-capabilities.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-capabilities.ts#L73) - -**`Experimental`** - -Narrowed view of the optional CRIU probe. The loop-side `SandboxClient` -does not require `criuStatus`; this widens it optionally so the probe can be -read without importing sandbox-backend specifics. - -## Properties - -### criuStatus? - -> `optional` **criuStatus?**: () => `Promise`\<\{ `available`: `boolean`; `criuVersion?`: `string`; `reason?`: `string`; \}\> - -Defined in: [runtime/sandbox-capabilities.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-capabilities.ts#L74) - -**`Experimental`** - -#### Returns - -`Promise`\<\{ `available`: `boolean`; `criuVersion?`: `string`; `reason?`: `string`; \}\> diff --git a/docs/api/runtime/interfaces/DefinePersonaInput.md b/docs/api/runtime/interfaces/DefinePersonaInput.md deleted file mode 100644 index 305494f..0000000 --- a/docs/api/runtime/interfaces/DefinePersonaInput.md +++ /dev/null @@ -1,77 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / DefinePersonaInput - -# Interface: DefinePersonaInput\ - -Defined in: [runtime/personify/types.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L129) - -The minimal input to build a `Persona`. Mirrors `Persona` but lets the builder default - the executors-supplied invariant check and freeze the record. - -## Type Parameters - -### D - -`D` = `unknown` - -## Properties - -### name - -> `readonly` **name**: `string` - -Defined in: [runtime/personify/types.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L130) - -*** - -### root - -> `readonly` **root**: [`AgentSpec`](AgentSpec.md) - -Defined in: [runtime/personify/types.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L131) - -*** - -### directive - -> `readonly` **directive**: `string` - -Defined in: [runtime/personify/types.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L132) - -*** - -### context - -> `readonly` **context**: [`PersonaContext`](PersonaContext.md) - -Defined in: [runtime/personify/types.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L133) - -*** - -### executors - -> `readonly` **executors**: [`PersonaExecutors`](PersonaExecutors.md) - -Defined in: [runtime/personify/types.ts:134](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L134) - -*** - -### extensions? - -> `readonly` `optional` **extensions?**: `Readonly`\<`Record`\<`string`, `unknown`\>\> - -Defined in: [runtime/personify/types.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L135) - -*** - -### \_\_deliverable? - -> `readonly` `optional` **\_\_deliverable?**: `D` - -Defined in: [runtime/personify/types.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L138) - -Phantom: pins the input's deliverable type so `definePersona` returns a `Persona` - the caller's shape must agree with. Type-only — never supplied at a call site. diff --git a/docs/api/runtime/interfaces/DeliverableSpec.md b/docs/api/runtime/interfaces/DeliverableSpec.md deleted file mode 100644 index f96d2b5..0000000 --- a/docs/api/runtime/interfaces/DeliverableSpec.md +++ /dev/null @@ -1,50 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / DeliverableSpec - -# Interface: DeliverableSpec\ - -Defined in: [runtime/supervise/completion-gate.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/completion-gate.ts#L31) - -The deployable completion oracle passed to [gateOnDeliverable](../functions/gateOnDeliverable.md): a `check` that -decides DELIVERED (settles `valid` ⟺ it resolves true) plus an optional `describe` of -what the spawn was supposed to produce. The check reads the child's output — never the -model judging itself. - -## Type Parameters - -### Out - -`Out` = `unknown` - -## Properties - -### check - -> **check**: (`out`) => `boolean` \| `Promise`\<`boolean`\> - -Defined in: [runtime/supervise/completion-gate.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/completion-gate.ts#L33) - -The deployable check that decides DELIVERED. `settled.valid ⟺ this resolves true`. - -#### Parameters - -##### out - -`Out` - -#### Returns - -`boolean` \| `Promise`\<`boolean`\> - -*** - -### describe? - -> `optional` **describe?**: `string` - -Defined in: [runtime/supervise/completion-gate.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/completion-gate.ts#L35) - -What the spawn was supposed to produce — surfaced in traces/reports. diff --git a/docs/api/runtime/interfaces/Driver.md b/docs/api/runtime/interfaces/Driver.md deleted file mode 100644 index 74b5565..0000000 --- a/docs/api/runtime/interfaces/Driver.md +++ /dev/null @@ -1,138 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Driver - -# Interface: Driver\ - -Defined in: [runtime/types.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L138) - -**`Experimental`** - -## Type Parameters - -### Task - -`Task` - -### Output - -`Output` - -### Decision - -`Decision` - -## Properties - -### name? - -> `readonly` `optional` **name?**: `string` - -Defined in: [runtime/types.ts:142](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L142) - -**`Experimental`** - -Stable identifier surfaced in trace events. Default `'driver'`. - -## Methods - -### plan() - -> **plan**(`task`, `history`): `Promise`\<`Task`[]\> - -Defined in: [runtime/types.ts:147](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L147) - -**`Experimental`** - -Tasks to issue this iteration. `[task]` → refine; N copies → fanout; -`[]` → no more work this round (kernel proceeds to `decide`). - -#### Parameters - -##### task - -`Task` - -##### history - -readonly [`Iteration`](Iteration.md)\<`Task`, `Output`\>[] - -#### Returns - -`Promise`\<`Task`[]\> - -*** - -### decide() - -> **decide**(`history`): `Decision` \| `Promise`\<`Decision`\> - -Defined in: [runtime/types.ts:154](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L154) - -**`Experimental`** - -Inspect history and return the next state. The kernel terminates the -loop when `decide` returns a value listed in `isTerminalDecision` -(`'stop' | 'pick-winner' | 'fail' | 'done'`), when `maxIterations` -is hit, or when the abort signal fires. - -#### Parameters - -##### history - -readonly [`Iteration`](Iteration.md)\<`Task`, `Output`\>[] - -#### Returns - -`Decision` \| `Promise`\<`Decision`\> - -*** - -### describePlan()? - -> `optional` **describePlan**(): [`LoopPlanDescription`](LoopPlanDescription.md) \| `undefined` - -Defined in: [runtime/types.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L164) - -**`Experimental`** - -Optional: describe the move `plan()` just produced, for trace emission. -The kernel calls this immediately after `plan()` and emits the result in -the `loop.plan` event so a topology viewer can render the agent's chosen -move + rationale (not just the inferred fan-width). Drivers whose topology -is a pure function of count (refine/fanout-vote) omit it — the kernel -infers `moveKind` from the planned-task count. A driver that authors its -own topology returns its chosen move's kind + rationale here. - -#### Returns - -[`LoopPlanDescription`](LoopPlanDescription.md) \| `undefined` - -*** - -### selectWinner()? - -> `optional` **selectWinner**(`history`): [`LoopWinner`](LoopWinner.md)\<`Task`, `Output`\> \| `undefined` - -Defined in: [runtime/types.ts:174](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L174) - -**`Experimental`** - -Optional: the driver AUTHORS the winner instead of the kernel's argmax. The -kernel consults this at finalize ONLY when the caller did not pass an explicit -`selectWinner` to runLoop. Return the driver-declared winner (e.g. from a -`select` topology move) or `undefined` to fall through to the default -(best-valid-score, earliest index). This is the SELECTOR role made -agent-authorable — the planner runs the selection, not the kernel. - -#### Parameters - -##### history - -readonly [`Iteration`](Iteration.md)\<`Task`, `Output`\>[] - -#### Returns - -[`LoopWinner`](LoopWinner.md)\<`Task`, `Output`\> \| `undefined` diff --git a/docs/api/runtime/interfaces/DriverChat.md b/docs/api/runtime/interfaces/DriverChat.md deleted file mode 100644 index 490b7ed..0000000 --- a/docs/api/runtime/interfaces/DriverChat.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / DriverChat - -# Interface: DriverChat - -Defined in: [runtime/supervise/coordination-driver.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L62) - -The injected driver-LLM seam: one turn over the conversation + the coordination tool specs. - -## Methods - -### next() - -> **next**(`input`): `Promise`\<[`DriverTurn`](DriverTurn.md)\> - -Defined in: [runtime/supervise/coordination-driver.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L63) - -#### Parameters - -##### input - -###### system - -`string` - -###### messages - -readonly [`DriverMessage`](DriverMessage.md)[] - -###### tools - -readonly `object`[] - -#### Returns - -`Promise`\<[`DriverTurn`](DriverTurn.md)\> diff --git a/docs/api/runtime/interfaces/DriverMessage.md b/docs/api/runtime/interfaces/DriverMessage.md deleted file mode 100644 index 3e1d3c4..0000000 --- a/docs/api/runtime/interfaces/DriverMessage.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / DriverMessage - -# Interface: DriverMessage - -Defined in: [runtime/supervise/coordination-driver.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L40) - -A turn in the driver↔tools conversation. Tool results ride back as `role: 'tool'`. - -## Properties - -### role - -> `readonly` **role**: `"tool"` \| `"user"` \| `"assistant"` - -Defined in: [runtime/supervise/coordination-driver.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L41) - -*** - -### content - -> `readonly` **content**: `string` - -Defined in: [runtime/supervise/coordination-driver.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L42) - -*** - -### toolCalls? - -> `readonly` `optional` **toolCalls?**: readonly [`DriverToolCall`](DriverToolCall.md)[] - -Defined in: [runtime/supervise/coordination-driver.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L43) - -*** - -### toolCallId? - -> `readonly` `optional` **toolCallId?**: `string` - -Defined in: [runtime/supervise/coordination-driver.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L44) - -*** - -### name? - -> `readonly` `optional` **name?**: `string` - -Defined in: [runtime/supervise/coordination-driver.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L45) diff --git a/docs/api/runtime/interfaces/DriverToolCall.md b/docs/api/runtime/interfaces/DriverToolCall.md deleted file mode 100644 index 1fe4784..0000000 --- a/docs/api/runtime/interfaces/DriverToolCall.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / DriverToolCall - -# Interface: DriverToolCall - -Defined in: [runtime/supervise/coordination-driver.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L33) - -One tool call the driver LLM asks for this turn. - -## Properties - -### id? - -> `readonly` `optional` **id?**: `string` - -Defined in: [runtime/supervise/coordination-driver.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L34) - -*** - -### name - -> `readonly` **name**: `string` - -Defined in: [runtime/supervise/coordination-driver.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L35) - -*** - -### arguments - -> `readonly` **arguments**: `Record`\<`string`, `unknown`\> - -Defined in: [runtime/supervise/coordination-driver.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L36) diff --git a/docs/api/runtime/interfaces/DriverTurn.md b/docs/api/runtime/interfaces/DriverTurn.md deleted file mode 100644 index f67a64a..0000000 --- a/docs/api/runtime/interfaces/DriverTurn.md +++ /dev/null @@ -1,59 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / DriverTurn - -# Interface: DriverTurn - -Defined in: [runtime/supervise/coordination-driver.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L49) - -What the driver LLM returns each turn. No `toolCalls` => the driver is finished. - -## Properties - -### toolCalls? - -> `readonly` `optional` **toolCalls?**: readonly [`DriverToolCall`](DriverToolCall.md)[] - -Defined in: [runtime/supervise/coordination-driver.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L50) - -*** - -### content? - -> `readonly` `optional` **content?**: `string` - -Defined in: [runtime/supervise/coordination-driver.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L52) - -The driver's natural-language output — the answer when there are no tool calls. - -*** - -### usage? - -> `readonly` `optional` **usage?**: `object` - -Defined in: [runtime/supervise/coordination-driver.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L56) - -The driver LLM's OWN token usage for THIS turn — metered against the conserved pool so the - driver's inference counts toward equal-k AND the in-loop budget guard. Omit for a scripted/ - mock turn (no real inference); production `routerDriverChat` forwards it from the router. - -#### input - -> `readonly` **input**: `number` - -#### output - -> `readonly` **output**: `number` - -*** - -### costUsd? - -> `readonly` `optional` **costUsd?**: `number` - -Defined in: [runtime/supervise/coordination-driver.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/coordination-driver.ts#L58) - -The turn's inference cost (usd), when the provider priced it. diff --git a/docs/api/runtime/interfaces/EqualKArm.md b/docs/api/runtime/interfaces/EqualKArm.md deleted file mode 100644 index 63e875d..0000000 --- a/docs/api/runtime/interfaces/EqualKArm.md +++ /dev/null @@ -1,32 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / EqualKArm - -# Interface: EqualKArm - -Defined in: [runtime/personify/wave-types.ts:566](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L566) - -One arm of an equal-k comparison — a labeled trajectory (a `TrajectoryReport` is one arm's whole -run). The arm's conserved COST is `report.total` (tokens + usd), which the sandbox executor -already reports INCLUSIVE of a leaf's internal sub-agent fanout — so comparing arms on this cost -(not raw `iterations`) closes the leaf-fanout confound: a treatment arm whose leaf fanned out -internally is charged for that fanout in `total.tokens`/`total.usd`, not hidden behind one -iteration count. - -## Properties - -### label - -> `readonly` **label**: `string` - -Defined in: [runtime/personify/wave-types.ts:567](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L567) - -*** - -### report - -> `readonly` **report**: [`TrajectoryReport`](TrajectoryReport.md) - -Defined in: [runtime/personify/wave-types.ts:568](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L568) diff --git a/docs/api/runtime/interfaces/EqualKOnCostOptions.md b/docs/api/runtime/interfaces/EqualKOnCostOptions.md deleted file mode 100644 index 6c5141f..0000000 --- a/docs/api/runtime/interfaces/EqualKOnCostOptions.md +++ /dev/null @@ -1,26 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / EqualKOnCostOptions - -# Interface: EqualKOnCostOptions - -Defined in: [runtime/personify/wave-types.ts:599](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L599) - -`equalKOnCost(arms, { tolerance? })` — assert arms are comparable at EQUAL conserved COST -(tokens + usd), NOT raw iteration count. The conserved-pool guarantees `Σk` equal by -construction WITHIN one supervised run; this checks it ACROSS arms (separate runs) where the -pool cannot, so a cross-arm gate comparison can prove equal compute before claiming a win. The -impl lives in `trajectory.ts`. Pure over the reports — no I/O. - -## Properties - -### tolerance? - -> `readonly` `optional` **tolerance?**: `number` - -Defined in: [runtime/personify/wave-types.ts:602](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L602) - -Max fractional spread (spread/median) per channel for arms to count as equal-k. Default in - the impl (e.g. 0.05). A tighter tolerance = a stricter equal-compute claim. diff --git a/docs/api/runtime/interfaces/EqualKVerdict.md b/docs/api/runtime/interfaces/EqualKVerdict.md deleted file mode 100644 index cdbf1da..0000000 --- a/docs/api/runtime/interfaces/EqualKVerdict.md +++ /dev/null @@ -1,60 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / EqualKVerdict - -# Interface: EqualKVerdict - -Defined in: [runtime/personify/wave-types.ts:577](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L577) - -The equal-k-on-cost verdict: whether every arm spent within `tolerance` of the others on the -CONSERVED cost channels (tokens + usd), so a downstream metric comparison is "at equal k". Per- -arm cost is surfaced so a caller can see HOW close. `withinTolerance: false` means the arms are -NOT comparable at equal compute — a confound to report, not a result to publish. - -## Properties - -### withinTolerance - -> `readonly` **withinTolerance**: `boolean` - -Defined in: [runtime/personify/wave-types.ts:578](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L578) - -*** - -### arms - -> `readonly` **arms**: readonly `object`[] - -Defined in: [runtime/personify/wave-types.ts:580](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L580) - -Per-arm conserved cost (the basis: tokens total + usd). - -*** - -### spread - -> `readonly` **spread**: `object` - -Defined in: [runtime/personify/wave-types.ts:587](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L587) - -The realized spread on each channel (max − min across arms), for the report. - -#### tokens - -> `readonly` **tokens**: `number` - -#### usd - -> `readonly` **usd**: `number` - -*** - -### tolerance - -> `readonly` **tolerance**: `number` - -Defined in: [runtime/personify/wave-types.ts:589](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L589) - -The fractional tolerance the check used (spread / median ≤ tolerance per channel). diff --git a/docs/api/runtime/interfaces/EventBus.md b/docs/api/runtime/interfaces/EventBus.md deleted file mode 100644 index fdf9efe..0000000 --- a/docs/api/runtime/interfaces/EventBus.md +++ /dev/null @@ -1,130 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / EventBus - -# Interface: EventBus\ - -Defined in: [runtime/supervise/event-bus.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L56) - -## Type Parameters - -### E - -`E` *extends* [`BusEvent`](BusEvent.md) - -## Methods - -### publish() - -> **publish**(`event`, `opts?`): `Promise`\<[`BusRecord`](BusRecord.md)\<`E`\>\> - -Defined in: [runtime/supervise/event-bus.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L59) - -Stamp + queue the event, then deliver the stamped record to every subscriber in order. - Returns the stamped record. - -#### Parameters - -##### event - -`E` - -##### opts? - -[`PublishOptions`](PublishOptions.md) - -#### Returns - -`Promise`\<[`BusRecord`](BusRecord.md)\<`E`\>\> - -*** - -### pull() - -> **pull**(`kinds?`): `E` \| `undefined` - -Defined in: [runtime/supervise/event-bus.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L62) - -Remove and return the highest-priority QUEUED event whose type is in `kinds` (any if omitted), - ties broken FIFO by `seq`; `undefined` when nothing matches. - -#### Parameters - -##### kinds? - -readonly `E`\[`"type"`\][] - -#### Returns - -`E` \| `undefined` - -*** - -### subscribe() - -> **subscribe**(`handler`): () => `void` - -Defined in: [runtime/supervise/event-bus.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L65) - -Register a pass-through handler; it receives the stamped record of every event published after - registration. Returns an unsubscribe fn. - -#### Parameters - -##### handler - -(`record`) => `void` \| `Promise`\<`void`\> - -#### Returns - -() => `void` - -*** - -### pending() - -> **pending**(`kinds?`): `number` - -Defined in: [runtime/supervise/event-bus.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L67) - -Count of queued, not-yet-pulled events (filtered by `kinds` when given). - -#### Parameters - -##### kinds? - -readonly `E`\[`"type"`\][] - -#### Returns - -`number` - -*** - -### history() - -> **history**(): readonly [`BusRecord`](BusRecord.md)\<`E`\>[] - -Defined in: [runtime/supervise/event-bus.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L69) - -The full ordered log of every event ever published (the audit/replay trail). - -#### Returns - -readonly [`BusRecord`](BusRecord.md)\<`E`\>[] - -*** - -### stats() - -> **stats**(): [`BusStats`](BusStats.md) - -Defined in: [runtime/supervise/event-bus.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L71) - -Throughput counters for observability dashboards. - -#### Returns - -[`BusStats`](BusStats.md) diff --git a/docs/api/runtime/interfaces/EvolutionArchiveNode.md b/docs/api/runtime/interfaces/EvolutionArchiveNode.md deleted file mode 100644 index 5bf51cd..0000000 --- a/docs/api/runtime/interfaces/EvolutionArchiveNode.md +++ /dev/null @@ -1,78 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / EvolutionArchiveNode - -# Interface: EvolutionArchiveNode - -Defined in: [runtime/strategy-evolution.ts:174](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L174) - -## Properties - -### name - -> **name**: `string` - -Defined in: [runtime/strategy-evolution.ts:175](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L175) - -*** - -### source - -> **source**: `"baseline"` \| `"authored"` - -Defined in: [runtime/strategy-evolution.ts:176](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L176) - -*** - -### generation - -> **generation**: `number` - -Defined in: [runtime/strategy-evolution.ts:177](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L177) - -*** - -### parent? - -> `optional` **parent?**: `string` - -Defined in: [runtime/strategy-evolution.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L179) - -The champion whose tournament losses this candidate was authored from. - -*** - -### gzipBits? - -> `optional` **gzipBits?**: `number` - -Defined in: [runtime/strategy-evolution.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L180) - -*** - -### file? - -> `optional` **file?**: `string` - -Defined in: [runtime/strategy-evolution.ts:181](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L181) - -*** - -### score - -> **score**: `number` - -Defined in: [runtime/strategy-evolution.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L184) - -Latest measured tournament result — 0 until the node's first tournament settles - (an authored node is created before its generation's benchmark runs). - -*** - -### usd - -> **usd**: `number` - -Defined in: [runtime/strategy-evolution.ts:185](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L185) diff --git a/docs/api/runtime/interfaces/EvolutionAuthor.md b/docs/api/runtime/interfaces/EvolutionAuthor.md deleted file mode 100644 index 6ec2307..0000000 --- a/docs/api/runtime/interfaces/EvolutionAuthor.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / EvolutionAuthor - -# Interface: EvolutionAuthor - -Defined in: [runtime/strategy-evolution.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L46) - -## Properties - -### chat - -> **chat**: `ChatClient` - -Defined in: [runtime/strategy-evolution.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L48) - -The model-call seam (agent-eval `createChatClient`). - -*** - -### model? - -> `optional` **model?**: `string` - -Defined in: [runtime/strategy-evolution.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L49) - -*** - -### fallbackModel? - -> `optional` **fallbackModel?**: `string` - -Defined in: [runtime/strategy-evolution.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L50) - -*** - -### temperature? - -> `optional` **temperature?**: `number` - -Defined in: [runtime/strategy-evolution.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L51) - -*** - -### maxTokens? - -> `optional` **maxTokens?**: `number` - -Defined in: [runtime/strategy-evolution.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L52) diff --git a/docs/api/runtime/interfaces/EvolutionBandInfo.md b/docs/api/runtime/interfaces/EvolutionBandInfo.md deleted file mode 100644 index bba19f5..0000000 --- a/docs/api/runtime/interfaces/EvolutionBandInfo.md +++ /dev/null @@ -1,47 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / EvolutionBandInfo - -# Interface: EvolutionBandInfo - -Defined in: [runtime/strategy-evolution.ts:204](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L204) - -## Properties - -### screened - -> **screened**: `number` - -Defined in: [runtime/strategy-evolution.ts:206](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L206) - -Tasks screened by the reference on the holdout pool. - -*** - -### inBand - -> **inBand**: `number` - -Defined in: [runtime/strategy-evolution.ts:208](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L208) - -Tasks kept (reference score ≤ maxRefScore) before truncating to holdoutN. - -*** - -### refScores - -> **refScores**: `object`[] - -Defined in: [runtime/strategy-evolution.ts:210](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L210) - -Reference scores per screened task (the screening record). - -#### taskId - -> **taskId**: `string` - -#### score - -> **score**: `number` diff --git a/docs/api/runtime/interfaces/EvolutionCandidate.md b/docs/api/runtime/interfaces/EvolutionCandidate.md deleted file mode 100644 index 082c219..0000000 --- a/docs/api/runtime/interfaces/EvolutionCandidate.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / EvolutionCandidate - -# Interface: EvolutionCandidate - -Defined in: [runtime/strategy-evolution.ts:158](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L158) - -## Properties - -### name - -> **name**: `string` - -Defined in: [runtime/strategy-evolution.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L159) - -*** - -### file? - -> `optional` **file?**: `string` - -Defined in: [runtime/strategy-evolution.ts:160](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L160) - -*** - -### gzipBits? - -> `optional` **gzipBits?**: `number` - -Defined in: [runtime/strategy-evolution.ts:161](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L161) - -*** - -### codeChars? - -> `optional` **codeChars?**: `number` - -Defined in: [runtime/strategy-evolution.ts:162](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L162) - -*** - -### error? - -> `optional` **error?**: `string` - -Defined in: [runtime/strategy-evolution.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L164) - -Present when this author attempt failed (recorded, never silent). diff --git a/docs/api/runtime/interfaces/EvolutionGeneration.md b/docs/api/runtime/interfaces/EvolutionGeneration.md deleted file mode 100644 index e1ca996..0000000 --- a/docs/api/runtime/interfaces/EvolutionGeneration.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / EvolutionGeneration - -# Interface: EvolutionGeneration - -Defined in: [runtime/strategy-evolution.ts:167](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L167) - -## Properties - -### generation - -> **generation**: `number` - -Defined in: [runtime/strategy-evolution.ts:168](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L168) - -*** - -### candidates - -> **candidates**: [`EvolutionCandidate`](EvolutionCandidate.md)[] - -Defined in: [runtime/strategy-evolution.ts:169](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L169) - -*** - -### report - -> **report**: [`BenchmarkReport`](BenchmarkReport.md) - -Defined in: [runtime/strategy-evolution.ts:170](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L170) - -*** - -### champion - -> **champion**: [`ChampionPick`](ChampionPick.md) - -Defined in: [runtime/strategy-evolution.ts:171](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L171) diff --git a/docs/api/runtime/interfaces/EvolutionReport.md b/docs/api/runtime/interfaces/EvolutionReport.md deleted file mode 100644 index 531be1a..0000000 --- a/docs/api/runtime/interfaces/EvolutionReport.md +++ /dev/null @@ -1,115 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / EvolutionReport - -# Interface: EvolutionReport - -Defined in: [runtime/strategy-evolution.ts:213](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L213) - -## Properties - -### gen0 - -> **gen0**: [`BenchmarkReport`](BenchmarkReport.md) - -Defined in: [runtime/strategy-evolution.ts:214](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L214) - -*** - -### gen0Champion - -> **gen0Champion**: [`ChampionPick`](ChampionPick.md) - -Defined in: [runtime/strategy-evolution.ts:215](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L215) - -*** - -### generations - -> **generations**: [`EvolutionGeneration`](EvolutionGeneration.md)[] - -Defined in: [runtime/strategy-evolution.ts:216](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L216) - -*** - -### archive - -> **archive**: [`EvolutionArchiveNode`](EvolutionArchiveNode.md)[] - -Defined in: [runtime/strategy-evolution.ts:217](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L217) - -*** - -### finalChampion - -> **finalChampion**: [`ChampionPick`](ChampionPick.md) - -Defined in: [runtime/strategy-evolution.ts:218](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L218) - -*** - -### holdout - -> **holdout**: [`BenchmarkReport`](BenchmarkReport.md) - -Defined in: [runtime/strategy-evolution.ts:219](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L219) - -*** - -### verdict - -> **verdict**: [`PromotionVerdict`](PromotionVerdict.md) - -Defined in: [runtime/strategy-evolution.ts:220](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L220) - -*** - -### band? - -> `optional` **band?**: [`EvolutionBandInfo`](EvolutionBandInfo.md) - -Defined in: [runtime/strategy-evolution.ts:223](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L223) - -Present when band screening ran — the verdict's estimand is then "paired lift on - headroom tasks" (band membership fixed by the reference screen, pre-registered). - -*** - -### reproduction? - -> `optional` **reproduction?**: `ReproductionCheck` - -Defined in: [runtime/strategy-evolution.ts:225](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L225) - -Present when reproducerCheck ran (final champion was authored). - -*** - -### trajectory - -> **trajectory**: `object`[] - -Defined in: [runtime/strategy-evolution.ts:230](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L230) - -SEARCH TELEMETRY, not evidence: each entry is that generation's own train-slice - re-measurement, so cross-generation deltas mix true drift with run-to-run variance - (entries are unpaired across generations). The only evidence-grade comparison in - this report is `verdict` — both finalists measured fresh, paired, on the holdout. - -#### generation - -> **generation**: `number` - -#### champion - -> **champion**: `string` - -#### score - -> **score**: `number` - -#### usd - -> **usd**: `number` diff --git a/docs/api/runtime/interfaces/ExecCtx.md b/docs/api/runtime/interfaces/ExecCtx.md deleted file mode 100644 index f33581d..0000000 --- a/docs/api/runtime/interfaces/ExecCtx.md +++ /dev/null @@ -1,100 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ExecCtx - -# Interface: ExecCtx - -Defined in: [runtime/types.ts:471](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L471) - -**`Experimental`** - -## Properties - -### sandboxClient - -> **sandboxClient**: [`SandboxClient`](SandboxClient.md) - -Defined in: [runtime/types.ts:473](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L473) - -**`Experimental`** - -Sandbox SDK client — the kernel calls `.create()` per iteration. - -*** - -### hooks? - -> `optional` **hooks?**: [`RuntimeHooks`](../../index/interfaces/RuntimeHooks.md) - -Defined in: [runtime/types.ts:475](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L475) - -**`Experimental`** - -Optional runtime hooks. Execution-scoped; never part of `AgentProfile`. - -*** - -### traceEmitter? - -> `optional` **traceEmitter?**: [`LoopTraceEmitter`](LoopTraceEmitter.md) - -Defined in: [runtime/types.ts:477](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L477) - -**`Experimental`** - -Optional trace emitter. When set, the kernel emits `loop.*` events. - -*** - -### runHandle? - -> `optional` **runHandle?**: [`RuntimeRunHandle`](../../index/interfaces/RuntimeRunHandle.md) - -Defined in: [runtime/types.ts:483](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L483) - -**`Experimental`** - -Optional production-run handle. When set, every synthesized `llm_call` -the kernel infers from a sandbox event stream is forwarded via -`runHandle.observe` so per-run cost aggregates pick up loop spend. - -*** - -### signal? - -> `optional` **signal?**: `AbortSignal` - -Defined in: [runtime/types.ts:485](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L485) - -**`Experimental`** - -Cooperative cancellation signal. - -*** - -### traceId? - -> `optional` **traceId?**: `string` - -Defined in: [runtime/types.ts:491](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L491) - -**`Experimental`** - -Trace id for OTEL correlation. When set alongside `traceEmitter`, the -exporter uses this as the parent trace for all emitted spans. Typically -inherited from TRACE_ID env var in MCP subprocess mode. - -*** - -### parentSpanId? - -> `optional` **parentSpanId?**: `string` - -Defined in: [runtime/types.ts:496](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L496) - -**`Experimental`** - -Parent span id for OTEL correlation. Loop events become children of -this span. Typically inherited from PARENT_SPAN_ID env var. diff --git a/docs/api/runtime/interfaces/Executor.md b/docs/api/runtime/interfaces/Executor.md deleted file mode 100644 index 5d74554..0000000 --- a/docs/api/runtime/interfaces/Executor.md +++ /dev/null @@ -1,171 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Executor - -# Interface: Executor\ - -Defined in: [runtime/supervise/types.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L70) - -The leaf runtime — ONE open interface, not a closed union. `execute` returns a -`Promise` for one-shot executors OR an `AsyncIterable` for -streaming ones; a streaming executor reports incremental normalized usage as it runs -(the budget pool reconciles against it) and exposes its terminal artifact via -`resultArtifact()`. Both shapes normalize usage to `UsageEvent` so the conserved pool -meters every runtime identically. - -Built-in implementations (in `runtime.ts`, NOT variants here): router/inline (a direct -Router/HTTP inference call, no box), sandbox (COMPOSES `runLoop` as a leaf, forwarding -PR #150's optional `lineage` passthrough — does NOT reinvent checkpoint/fork), cli -(Halo/RLM subprocess; `budgetExempt`, excluded from equal-k by construction). A user's -own agent (mastra/agno/raw HTTP/anything) is first-class by implementing this interface. - -## Type Parameters - -### Out - -`Out` - -## Properties - -### runtime - -> `readonly` **runtime**: [`Runtime`](../type-aliases/Runtime.md) - -Defined in: [runtime/supervise/types.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L72) - -Stable runtime tag for traces + the equal-k exemption check. - -*** - -### budgetExempt? - -> `readonly` `optional` **budgetExempt?**: `boolean` - -Defined in: [runtime/supervise/types.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L78) - -When true, this executor's spend is NOT metered against the conserved pool and its -iterations are excluded from the equal-k assertion (a `cli` subprocess without -token accounting). Fail-loud everywhere else: a metered executor MUST report usage. - -## Methods - -### execute() - -> **execute**(`task`, `signal`): `AsyncIterable`\<[`UsageEvent`](../type-aliases/UsageEvent.md), `any`, `any`\> \| `Promise`\<[`ExecutorResult`](ExecutorResult.md)\<`Out`\>\> - -Defined in: [runtime/supervise/types.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L84) - -One-shot → resolves a `ExecutorResult`; streaming → yields incremental `UsageEvent`s and -the terminal artifact is read from `resultArtifact()` after the stream drains. -`signal` is the spawn-scoped abort (chains the acquire lifecycle for sandbox). - -#### Parameters - -##### task - -`unknown` - -##### signal - -`AbortSignal` - -#### Returns - -`AsyncIterable`\<[`UsageEvent`](../type-aliases/UsageEvent.md), `any`, `any`\> \| `Promise`\<[`ExecutorResult`](ExecutorResult.md)\<`Out`\>\> - -*** - -### deliver()? - -> `optional` **deliver**(`msg`): `void` - -Defined in: [runtime/supervise/types.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L95) - -Optional inbox: receive an out-of-band message from the driver mid-run (the `send`/`steer_worker` -verb). A streaming executor drains pending messages between turns and folds them into the next -step (a steer / interrupt / resume). A one-shot executor that can't be steered mid-flight omits -this; `Scope.send` then returns `false` for it. Never throws — a malformed message is the -executor's to ignore. - -#### Parameters - -##### msg - -`unknown` - -#### Returns - -`void` - -*** - -### teardown() - -> **teardown**(`grace`): `Promise`\<\{ `destroyed`: `boolean`; \}\> - -Defined in: [runtime/supervise/types.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L100) - -Tear the executor's resources down. `grace` mirrors the OTP shutdown spec -(`'brutalKill'` = immediate, a number = ms grace, `'infinity'` = await clean exit). - -#### Parameters - -##### grace - -`number` \| `"brutalKill"` \| `"infinity"` - -#### Returns - -`Promise`\<\{ `destroyed`: `boolean`; \}\> - -*** - -### resultArtifact() - -> **resultArtifact**(): `object` - -Defined in: [runtime/supervise/types.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L105) - -The replay source (B1): the content-addressed `outRef` + the materialized output the -driver branched on, its verdict, and the conserved spend. Read once, after settle. - -#### Returns - -`object` - -##### outRef - -> **outRef**: `string` - -##### out - -> **out**: `Out` - -##### verdict? - -> `optional` **verdict?**: `DefaultVerdict` - -##### spent - -> **spent**: [`Spend`](Spend.md) - -*** - -### metered()? - -> `optional` **metered**(): [`Spend`](Spend.md) \| `undefined` - -Defined in: [runtime/supervise/types.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L114) - -A driver-executor's OWN-inference subtree total (rolled up from its nested tree's `metered` -events) — the parent scope journals it as a `metered` event for this node on settle, on BOTH -the done AND the down/crash paths, so a crashed sub-driver's partial inference still re-homes -(the pool already debited it via `observe`; the journal must match). NOT reconciled, so it never -trips the reservation clamp. Read on settle, valid after `execute` resolves OR throws. Leaf -executors omit it (returns `undefined`). - -#### Returns - -[`Spend`](Spend.md) \| `undefined` diff --git a/docs/api/runtime/interfaces/ExecutorContext.md b/docs/api/runtime/interfaces/ExecutorContext.md deleted file mode 100644 index c4fc65d..0000000 --- a/docs/api/runtime/interfaces/ExecutorContext.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ExecutorContext - -# Interface: ExecutorContext - -Defined in: [runtime/supervise/types.ts:170](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L170) - -Construction context handed to a `ExecutorFactory` — the seams a built-in needs - (sandbox client for the sandbox executor, router config for router/inline) without - the factory reaching into module globals. - -## Properties - -### signal - -> `readonly` **signal**: `AbortSignal` - -Defined in: [runtime/supervise/types.ts:171](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L171) - -*** - -### seams - -> `readonly` **seams**: `Readonly`\<`Record`\<`string`, `unknown`\>\> - -Defined in: [runtime/supervise/types.ts:173](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L173) - -Opaque seams the registry threads through; a built-in narrows what it needs. diff --git a/docs/api/runtime/interfaces/ExecutorRegistry.md b/docs/api/runtime/interfaces/ExecutorRegistry.md deleted file mode 100644 index 9daa368..0000000 --- a/docs/api/runtime/interfaces/ExecutorRegistry.md +++ /dev/null @@ -1,73 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ExecutorRegistry - -# Interface: ExecutorRegistry - -Defined in: [runtime/supervise/types.ts:182](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L182) - -The OPEN resolver: maps an `AgentSpec` to a `ExecutorFactory`. The default -registry resolves the three built-ins AND accepts a BYO `executor`/factory; callers -register more runtimes by name. NOT a closed switch — registration is the extension -point, mirroring the open `Executor` interface. - -## Methods - -### register() - -> **register**\<`Out`\>(`runtime`, `factory`): `void` - -Defined in: [runtime/supervise/types.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L184) - -Register a factory for a named runtime. Throws on a duplicate name (fail loud). - -#### Type Parameters - -##### Out - -`Out` - -#### Parameters - -##### runtime - -[`Runtime`](../type-aliases/Runtime.md) - -##### factory - -[`ExecutorFactory`](../type-aliases/ExecutorFactory.md)\<`Out`\> - -#### Returns - -`void` - -*** - -### resolve() - -> **resolve**\<`Out`\>(`spec`): \{ `succeeded`: `true`; `value`: [`ExecutorFactory`](../type-aliases/ExecutorFactory.md)\<`Out`\>; \} \| \{ `succeeded`: `false`; `error`: `string`; \} - -Defined in: [runtime/supervise/types.ts:191](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L191) - -Resolve a spec to a factory. Precedence: a BYO `spec.executor` → a trivial factory -returning it; else `harness === null` → the `'router'` factory; else a registered -factory for the harness-derived runtime. Returns a typed outcome — the caller -inspects `succeeded` before `value` (no silent fallback). - -#### Type Parameters - -##### Out - -`Out` - -#### Parameters - -##### spec - -[`AgentSpec`](AgentSpec.md) - -#### Returns - -\{ `succeeded`: `true`; `value`: [`ExecutorFactory`](../type-aliases/ExecutorFactory.md)\<`Out`\>; \} \| \{ `succeeded`: `false`; `error`: `string`; \} diff --git a/docs/api/runtime/interfaces/ExecutorResult.md b/docs/api/runtime/interfaces/ExecutorResult.md deleted file mode 100644 index b4460eb..0000000 --- a/docs/api/runtime/interfaces/ExecutorResult.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ExecutorResult - -# Interface: ExecutorResult\ - -Defined in: [runtime/supervise/types.ts:118](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L118) - -Terminal artifact of a one-shot `Executor.execute`. - -## Type Parameters - -### Out - -`Out` - -## Properties - -### outRef - -> **outRef**: `string` - -Defined in: [runtime/supervise/types.ts:119](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L119) - -*** - -### out - -> **out**: `Out` - -Defined in: [runtime/supervise/types.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L120) - -*** - -### verdict? - -> `optional` **verdict?**: `DefaultVerdict` - -Defined in: [runtime/supervise/types.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L121) - -*** - -### spent - -> **spent**: [`Spend`](Spend.md) - -Defined in: [runtime/supervise/types.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L122) diff --git a/docs/api/runtime/interfaces/FanoutOptions.md b/docs/api/runtime/interfaces/FanoutOptions.md deleted file mode 100644 index 30dd758..0000000 --- a/docs/api/runtime/interfaces/FanoutOptions.md +++ /dev/null @@ -1,142 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / FanoutOptions - -# Interface: FanoutOptions\ - -Defined in: [runtime/personify/wave-types.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L105) - -`fanout(items, { synthesize? })` — N children spawned in one round (one per item, bounded by -the conserved pool's fail-closed admission), drained via `scope.next()`, then optionally a -single SYNTHESIS child over the gathered results. Without `synthesize`, the combinator returns -the best-valid child via the single-sourced selector (selector≠judge). A round that admitted -zero children, or whose synthesis child could not be admitted, is a concrete blocker. - -No domain: a "research sweep over angles" is `fanout(angles, { synthesize: cite })` under a -research persona; a "fanout-vote" is `fanout(copies)` with the default selector. The item list -+ the synthesis posture are the SHAPE's args; the prompt that turns an item into work is the -persona's. - -## Type Parameters - -### Item - -`Item` - -### D - -`D` - -## Properties - -### synthesize? - -> `optional` **synthesize?**: [`FanoutSynthesis`](FanoutSynthesis.md)\<`D`\> - -Defined in: [runtime/personify/wave-types.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L124) - -Optional synthesis over the gathered child results: when present, the combinator spawns ONE -synthesis child whose task is built from the drained settlements, and its `done` output is -the deliverable. When absent, the deliverable is the best-valid child via `defaultSelectWinner`. -The synthesis child is a SEPARATE keystone agent (not a re-rank behind the driver). - -*** - -### selectWinner? - -> `optional` **selectWinner?**: [`FanoutWinnerSelector`](../type-aliases/FanoutWinnerSelector.md)\<`D`\> - -Defined in: [runtime/personify/wave-types.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L133) - -Winner-selection strategy among the gathered `done` children when there is no `synthesize`. -Receives the SAME `Iteration[]` the default selector reads (each child's output is its -`Outcome`), so a strategy is a thin re-sort (smallest-diff, highest-readiness, first-valid -…) over the candidates — NEVER a re-rank behind a judge. Default = `defaultSelectWinner` -semantics (best-valid-score, ties→earliest). Mutually exclusive with `synthesize` (a -synthesis child IS the selection); supplying both is a config error. - -## Methods - -### itemTask() - -> **itemTask**(`item`, `index`, `ctx`): `unknown` - -Defined in: [runtime/personify/wave-types.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L108) - -One child task per item: `item` + the index discriminator. The persona's directive/context - is threaded in by the combinator; this only supplies the per-item discriminator. - -#### Parameters - -##### item - -`Item` - -##### index - -`number` - -##### ctx - -[`ShapeContext`](ShapeContext.md)\<`D`\> - -#### Returns - -`unknown` - -*** - -### label()? - -> `optional` **label**(`item`, `index`): `string` - -Defined in: [runtime/personify/wave-types.ts:110](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L110) - -Per-item child label (defaults to `item:` in the impl). - -#### Parameters - -##### item - -`Item` - -##### index - -`number` - -#### Returns - -`string` - -*** - -### itemSpec()? - -> `optional` **itemSpec**(`item`, `index`, `ctx`): [`AgentSpec`](AgentSpec.md) - -Defined in: [runtime/personify/wave-types.ts:117](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L117) - -Optional per-item `AgentSpec` override. When set, each item's child is spawned against the -returned spec instead of `persona.root` — the seam a heterogeneous fanout uses to give each -item a DISTINCT executor (e.g. N authored harness profiles, each on its own worktree-CLI -leaf). Absent ⇒ every item runs against the persona's root spec (the homogeneous default). - -#### Parameters - -##### item - -`Item` - -##### index - -`number` - -##### ctx - -[`ShapeContext`](ShapeContext.md)\<`D`\> - -#### Returns - -[`AgentSpec`](AgentSpec.md) diff --git a/docs/api/runtime/interfaces/FanoutSynthesis.md b/docs/api/runtime/interfaces/FanoutSynthesis.md deleted file mode 100644 index e8637af..0000000 --- a/docs/api/runtime/interfaces/FanoutSynthesis.md +++ /dev/null @@ -1,59 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / FanoutSynthesis - -# Interface: FanoutSynthesis\ - -Defined in: [runtime/personify/wave-types.ts:149](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L149) - -How a fanout's synthesis child is built + read. `synthesisTask` projects the drained child - settlements into the synthesis child's task; `collect` reads its settled output into the - deliverable `Outcome`. - -## Type Parameters - -### D - -`D` - -## Methods - -### synthesisTask() - -> **synthesisTask**(`gathered`, `ctx`): `unknown` - -Defined in: [runtime/personify/wave-types.ts:150](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L150) - -#### Parameters - -##### gathered - -readonly [`Settled`](../type-aliases/Settled.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`D`\>\>[] - -##### ctx - -[`ShapeContext`](ShapeContext.md)\<`D`\> - -#### Returns - -`unknown` - -*** - -### collect() - -> **collect**(`settled`): [`Outcome`](../type-aliases/Outcome.md)\<`D`\> - -Defined in: [runtime/personify/wave-types.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L151) - -#### Parameters - -##### settled - -[`Settled`](../type-aliases/Settled.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`D`\>\> - -#### Returns - -[`Outcome`](../type-aliases/Outcome.md)\<`D`\> diff --git a/docs/api/runtime/interfaces/ForkCapableBox.md b/docs/api/runtime/interfaces/ForkCapableBox.md deleted file mode 100644 index ba6887d..0000000 --- a/docs/api/runtime/interfaces/ForkCapableBox.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ForkCapableBox - -# Interface: ForkCapableBox - -Defined in: [runtime/sandbox-lineage.ts:382](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L382) - -**`Experimental`** - -Loop-side widening of the box's optional fork method. - -## Properties - -### fork? - -> `optional` **fork?**: (`checkpointId`, `options?`) => `Promise`\<`SandboxInstance`\> - -Defined in: [runtime/sandbox-lineage.ts:383](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L383) - -**`Experimental`** - -#### Parameters - -##### checkpointId - -`string` - -##### options? - -###### name? - -`string` - -#### Returns - -`Promise`\<`SandboxInstance`\> diff --git a/docs/api/runtime/interfaces/GitWorkspaceOptions.md b/docs/api/runtime/interfaces/GitWorkspaceOptions.md deleted file mode 100644 index 9f59581..0000000 --- a/docs/api/runtime/interfaces/GitWorkspaceOptions.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / GitWorkspaceOptions - -# Interface: GitWorkspaceOptions - -Defined in: [runtime/workspace.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L39) - -## Properties - -### ref - -> `readonly` **ref**: `string` - -Defined in: [runtime/workspace.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L40) - -*** - -### shell? - -> `readonly` `optional` **shell?**: [`Shell`](../type-aliases/Shell.md) - -Defined in: [runtime/workspace.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L41) - -*** - -### branch? - -> `readonly` `optional` **branch?**: `string` - -Defined in: [runtime/workspace.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L42) - -*** - -### noHooks? - -> `readonly` `optional` **noHooks?**: `boolean` - -Defined in: [runtime/workspace.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L43) diff --git a/docs/api/runtime/interfaces/Handle.md b/docs/api/runtime/interfaces/Handle.md deleted file mode 100644 index 285e15b..0000000 --- a/docs/api/runtime/interfaces/Handle.md +++ /dev/null @@ -1,72 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Handle - -# Interface: Handle\ - -Defined in: [runtime/supervise/types.ts:240](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L240) - -A live child handle. `abort()` is defined over the ACQUIRE lifecycle: it chains into -the `acquireSandbox` signal and reaps a find-by-name orphan box, so a node aborted -mid-acquire never leaks (M1). - -## Type Parameters - -### Out - -`Out` - -## Properties - -### id - -> `readonly` **id**: `string` - -Defined in: [runtime/supervise/types.ts:241](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L241) - -*** - -### label - -> `readonly` **label**: `string` - -Defined in: [runtime/supervise/types.ts:242](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L242) - -*** - -### status - -> `readonly` **status**: [`NodeStatus`](../type-aliases/NodeStatus.md) - -Defined in: [runtime/supervise/types.ts:243](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L243) - -*** - -### \_\_out? - -> `readonly` `optional` **\_\_out?**: `Out` - -Defined in: [runtime/supervise/types.ts:247](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L247) - -Phantom: binds the handle to the child's output type so `spawn` returns a - `Handle` distinct from a `Handle`. Type-only — never present at runtime. - -## Methods - -### abort() - -> **abort**(`reason?`): `void` - -Defined in: [runtime/supervise/types.ts:244](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L244) - -#### Parameters - -##### reason? - -`string` - -#### Returns - -`void` diff --git a/docs/api/runtime/interfaces/HarvestCorpusOptions.md b/docs/api/runtime/interfaces/HarvestCorpusOptions.md deleted file mode 100644 index efd707e..0000000 --- a/docs/api/runtime/interfaces/HarvestCorpusOptions.md +++ /dev/null @@ -1,95 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / HarvestCorpusOptions - -# Interface: HarvestCorpusOptions - -Defined in: [runtime/harvest-corpus.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L28) - -## Properties - -### runs - -> **runs**: `AsyncIterable`\<[`ObserveInput`](ObserveInput.md), `any`, `any`\> \| `Iterable`\<[`ObserveInput`](ObserveInput.md), `any`, `any`\> - -Defined in: [runtime/harvest-corpus.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L30) - -The completed runs to analyze — map your store's rows to `ObserveInput`. - -*** - -### chat - -> **chat**: `ChatClient` - -Defined in: [runtime/harvest-corpus.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L32) - -The model-call seam (agent-eval `createChatClient`). - -*** - -### model? - -> `optional` **model?**: `string` - -Defined in: [runtime/harvest-corpus.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L33) - -*** - -### corpus - -> **corpus**: [`Corpus`](Corpus.md) - -Defined in: [runtime/harvest-corpus.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L35) - -The durable corpus the facts accrete into. - -*** - -### tags? - -> `optional` **tags?**: readonly `string`[] - -Defined in: [runtime/harvest-corpus.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L37) - -Tags written onto learned facts (the product/domain key the read side queries by). - -*** - -### analystInstruction? - -> `optional` **analystInstruction?**: `string` - -Defined in: [runtime/harvest-corpus.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L39) - -Override the analyst instruction (the GEPA-tunable knob). - -*** - -### concurrency? - -> `optional` **concurrency?**: `number` - -Defined in: [runtime/harvest-corpus.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L41) - -Runs analyzed in parallel. Default 4. - -*** - -### maxRuns? - -> `optional` **maxRuns?**: `number` - -Defined in: [runtime/harvest-corpus.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L43) - -Hard cap on runs consumed from the stream (a cost guard for unbounded stores). - -*** - -### signal? - -> `optional` **signal?**: `AbortSignal` - -Defined in: [runtime/harvest-corpus.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L44) diff --git a/docs/api/runtime/interfaces/HarvestFailure.md b/docs/api/runtime/interfaces/HarvestFailure.md deleted file mode 100644 index 998900f..0000000 --- a/docs/api/runtime/interfaces/HarvestFailure.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / HarvestFailure - -# Interface: HarvestFailure - -Defined in: [runtime/harvest-corpus.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L47) - -## Properties - -### runId - -> **runId**: `string` - -Defined in: [runtime/harvest-corpus.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L48) - -*** - -### error - -> **error**: `string` - -Defined in: [runtime/harvest-corpus.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L49) diff --git a/docs/api/runtime/interfaces/HarvestReport.md b/docs/api/runtime/interfaces/HarvestReport.md deleted file mode 100644 index 9955ff5..0000000 --- a/docs/api/runtime/interfaces/HarvestReport.md +++ /dev/null @@ -1,47 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / HarvestReport - -# Interface: HarvestReport - -Defined in: [runtime/harvest-corpus.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L52) - -## Properties - -### runsObserved - -> **runsObserved**: `number` - -Defined in: [runtime/harvest-corpus.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L53) - -*** - -### findings - -> **findings**: `number` - -Defined in: [runtime/harvest-corpus.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L55) - -Total findings the analyst produced (including ones already known). - -*** - -### learned - -> **learned**: `number` - -Defined in: [runtime/harvest-corpus.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L57) - -NEW facts actually appended (idempotent dedup excludes re-learned ones). - -*** - -### failures - -> **failures**: [`HarvestFailure`](HarvestFailure.md)[] - -Defined in: [runtime/harvest-corpus.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/harvest-corpus.ts#L59) - -Per-run analysis failures — reported, never silently dropped. diff --git a/docs/api/runtime/interfaces/InMemoryRunContext.md b/docs/api/runtime/interfaces/InMemoryRunContext.md deleted file mode 100644 index c97cd2f..0000000 --- a/docs/api/runtime/interfaces/InMemoryRunContext.md +++ /dev/null @@ -1,36 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / InMemoryRunContext - -# Interface: InMemoryRunContext - -Defined in: [runtime/supervise/run-context.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/run-context.ts#L46) - -The bundle of stores a supervised run needs, shaped to spread into `SupervisorOpts`. -The fields are exactly `SupervisorOpts`' `journal` / `blobs` / `executors`. - -## Properties - -### journal - -> `readonly` **journal**: [`SpawnJournal`](SpawnJournal.md) - -Defined in: [runtime/supervise/run-context.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/run-context.ts#L47) - -*** - -### blobs - -> `readonly` **blobs**: [`ResultBlobStore`](ResultBlobStore.md) - -Defined in: [runtime/supervise/run-context.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/run-context.ts#L48) - -*** - -### executors - -> `readonly` **executors**: [`ExecutorRegistry`](ExecutorRegistry.md) - -Defined in: [runtime/supervise/run-context.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/run-context.ts#L49) diff --git a/docs/api/runtime/interfaces/InMemoryRunContextOptions.md b/docs/api/runtime/interfaces/InMemoryRunContextOptions.md deleted file mode 100644 index 071b93b..0000000 --- a/docs/api/runtime/interfaces/InMemoryRunContextOptions.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / InMemoryRunContextOptions - -# Interface: InMemoryRunContextOptions - -Defined in: [runtime/supervise/run-context.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/run-context.ts#L32) - -Options for the in-memory run context. - -## Properties - -### withDriver? - -> `readonly` `optional` **withDriver?**: `boolean` - -Defined in: [runtime/supervise/run-context.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/run-context.ts#L39) - -Wrap the executor registry with `withDriverExecutor` so a spawned child marked -`role: 'driver'` resolves to the recursive driver-executor (agents driving agents -over a nested `Scope` on the same conserved pool). Leave `false` for a flat tree of -leaf workers. Default `false`. diff --git a/docs/api/runtime/interfaces/Inbox.md b/docs/api/runtime/interfaces/Inbox.md deleted file mode 100644 index 043f41c..0000000 --- a/docs/api/runtime/interfaces/Inbox.md +++ /dev/null @@ -1,90 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Inbox - -# Interface: Inbox - -Defined in: [runtime/supervise/inbox.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L27) - -## Methods - -### deliver() - -> **deliver**(`msg`): `void` - -Defined in: [runtime/supervise/inbox.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L29) - -The `Executor.deliver` implementation — accept a raw down-message from `Scope.send`. - -#### Parameters - -##### msg - -`unknown` - -#### Returns - -`void` - -*** - -### drain() - -> **drain**(): [`InboxMessage`](InboxMessage.md)[] - -Defined in: [runtime/supervise/inbox.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L31) - -Remove and return all pending messages (the flush). - -#### Returns - -[`InboxMessage`](InboxMessage.md)[] - -*** - -### pending() - -> **pending**(): `number` - -Defined in: [runtime/supervise/inbox.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L32) - -#### Returns - -`number` - -*** - -### freshInterrupt() - -> **freshInterrupt**(): `AbortSignal` - -Defined in: [runtime/supervise/inbox.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L35) - -Open a fresh per-turn interrupt signal; a later forceful `deliver` aborts it. The loop links - this into the signal it passes to its inference call, then re-plans when it fires. - -#### Returns - -`AbortSignal` - -*** - -### fold() - -> **fold**(`messages`): `string` - -Defined in: [runtime/supervise/inbox.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L37) - -Render drained messages as ONE operator turn to fold into the worker's conversation. - -#### Parameters - -##### messages - -readonly [`InboxMessage`](InboxMessage.md)[] - -#### Returns - -`string` diff --git a/docs/api/runtime/interfaces/InboxMessage.md b/docs/api/runtime/interfaces/InboxMessage.md deleted file mode 100644 index 41bd2df..0000000 --- a/docs/api/runtime/interfaces/InboxMessage.md +++ /dev/null @@ -1,68 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / InboxMessage - -# Interface: InboxMessage - -Defined in: [runtime/supervise/inbox.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L18) - -**`Experimental`** - -The worker-side receive end of the down-leg: a per-worker inbox an executor exposes as -`Executor.deliver`. The driver's `steer_worker` / `answer_question` land here, -and the worker's agent loop drains them at two points (Drew's two delivery modes): - - - QUEUED (default): the message accumulates and is FLUSHED at the next step boundary — folded - into the conversation before the next think. A worker is also forced to flush BEFORE it may - settle, so it can never finish while a steer/answer it never read is still pending. - - FORCEFUL (`interrupt: true`): trips `freshInterrupt()`'s signal so the loop can abort its - in-flight turn immediately, then re-plan with the message folded in — breaking the worker out - of a wrong path mid-task instead of waiting for it to finish the step. - -`deliver` never throws — a malformed message is ignored, per the `Executor.deliver` contract. - -## Properties - -### kind - -> `readonly` **kind**: `"steer"` \| `"answer"` - -Defined in: [runtime/supervise/inbox.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L19) - -**`Experimental`** - -*** - -### text - -> `readonly` **text**: `string` - -Defined in: [runtime/supervise/inbox.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L20) - -**`Experimental`** - -*** - -### interrupt - -> `readonly` **interrupt**: `boolean` - -Defined in: [runtime/supervise/inbox.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L22) - -**`Experimental`** - -Forceful messages abort the in-flight turn; queued ones wait for the boundary flush. - -*** - -### questionId? - -> `readonly` `optional` **questionId?**: `string` - -Defined in: [runtime/supervise/inbox.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/inbox.ts#L24) - -**`Experimental`** - -Present for an `answer` — the question id it resolves. diff --git a/docs/api/runtime/interfaces/IntentAudit.md b/docs/api/runtime/interfaces/IntentAudit.md deleted file mode 100644 index a0507cc..0000000 --- a/docs/api/runtime/interfaces/IntentAudit.md +++ /dev/null @@ -1,65 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / IntentAudit - -# Interface: IntentAudit - -Defined in: [runtime/audit-intent.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L52) - -## Properties - -### revealedIntent - -> **revealedIntent**: `string` - -Defined in: [runtime/audit-intent.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L54) - -What the agent's actions reveal it is actually optimizing — one sentence. - -*** - -### verdict - -> **verdict**: `"aligned"` \| `"drifting"` \| `"diverged"` - -Defined in: [runtime/audit-intent.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L55) - -*** - -### evidence - -> **evidence**: `string` - -Defined in: [runtime/audit-intent.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L57) - -Trajectory-grounded evidence for the verdict (specific calls/patterns). - -*** - -### recommendation - -> **recommendation**: `"abort"` \| `"continue"` \| `"steer"` - -Defined in: [runtime/audit-intent.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L59) - -The single recommended intervention. - -*** - -### steer? - -> `optional` **steer?**: `string` - -Defined in: [runtime/audit-intent.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L61) - -When recommendation is 'steer': the corrective instruction to inject. - -*** - -### confidence - -> **confidence**: `number` - -Defined in: [runtime/audit-intent.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L62) diff --git a/docs/api/runtime/interfaces/Iteration.md b/docs/api/runtime/interfaces/Iteration.md deleted file mode 100644 index acc68ad..0000000 --- a/docs/api/runtime/interfaces/Iteration.md +++ /dev/null @@ -1,139 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Iteration - -# Interface: Iteration\ - -Defined in: [runtime/types.ts:119](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L119) - -**`Experimental`** - -## Type Parameters - -### Task - -`Task` - -### Output - -`Output` - -## Properties - -### index - -> **index**: `number` - -Defined in: [runtime/types.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L121) - -**`Experimental`** - -0-based iteration index assigned by the kernel. - -*** - -### task - -> **task**: `Task` - -Defined in: [runtime/types.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L122) - -**`Experimental`** - -*** - -### agentRunName - -> **agentRunName**: `string` - -Defined in: [runtime/types.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L124) - -**`Experimental`** - -Stable name of the `AgentRunSpec` that produced this iteration. - -*** - -### output? - -> `optional` **output?**: `Output` - -Defined in: [runtime/types.ts:125](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L125) - -**`Experimental`** - -*** - -### verdict? - -> `optional` **verdict?**: `DefaultVerdict` - -Defined in: [runtime/types.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L126) - -**`Experimental`** - -*** - -### error? - -> `optional` **error?**: `Error` - -Defined in: [runtime/types.ts:127](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L127) - -**`Experimental`** - -*** - -### events - -> **events**: `SandboxEvent`[] - -Defined in: [runtime/types.ts:129](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L129) - -**`Experimental`** - -Raw sandbox event stream collected for this iteration. - -*** - -### startedAt - -> **startedAt**: `number` - -Defined in: [runtime/types.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L130) - -**`Experimental`** - -*** - -### endedAt - -> **endedAt**: `number` - -Defined in: [runtime/types.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L131) - -**`Experimental`** - -*** - -### costUsd - -> **costUsd**: `number` - -Defined in: [runtime/types.ts:132](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L132) - -**`Experimental`** - -*** - -### tokenUsage - -> **tokenUsage**: [`LoopTokenUsage`](LoopTokenUsage.md) - -Defined in: [runtime/types.ts:134](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L134) - -**`Experimental`** - -Summed LLM token usage across every `llm_call` event in this iteration. diff --git a/docs/api/runtime/interfaces/LoopDecisionPayload.md b/docs/api/runtime/interfaces/LoopDecisionPayload.md deleted file mode 100644 index 7f804c8..0000000 --- a/docs/api/runtime/interfaces/LoopDecisionPayload.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopDecisionPayload - -# Interface: LoopDecisionPayload - -Defined in: [runtime/types.ts:448](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L448) - -**`Experimental`** - -## Properties - -### decision - -> **decision**: `string` - -Defined in: [runtime/types.ts:449](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L449) - -**`Experimental`** - -*** - -### historyLength - -> **historyLength**: `number` - -Defined in: [runtime/types.ts:450](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L450) - -**`Experimental`** diff --git a/docs/api/runtime/interfaces/LoopDispatchOptions.md b/docs/api/runtime/interfaces/LoopDispatchOptions.md deleted file mode 100644 index f6a6130..0000000 --- a/docs/api/runtime/interfaces/LoopDispatchOptions.md +++ /dev/null @@ -1,110 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopDispatchOptions - -# Interface: LoopDispatchOptions\ - -Defined in: [runtime/loop-dispatch.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L49) - -## Type Parameters - -### Task - -`Task` - -### Output - -`Output` - -### Decision - -`Decision` - -### TScenario - -`TScenario` *extends* `Scenario` - -### TArtifact - -`TArtifact` - -## Properties - -### sandboxClient - -> **sandboxClient**: [`SandboxClient`](SandboxClient.md) - -Defined in: [runtime/loop-dispatch.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L57) - -Sandbox client used for every cell's `runLoop`. Supplied once. - -*** - -### toLoopOptions - -> **toLoopOptions**: (`scenario`, `profile`) => [`LoopOptionsForDispatch`](../type-aliases/LoopOptionsForDispatch.md)\<`Task`, `Output`, `Decision`\> - -Defined in: [runtime/loop-dispatch.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L60) - -Build the per-cell runLoop options from the scenario (+ profile, when - used with `runProfileMatrix`). - -#### Parameters - -##### scenario - -`TScenario` - -##### profile - -`AgentProfile` - -#### Returns - -[`LoopOptionsForDispatch`](../type-aliases/LoopOptionsForDispatch.md)\<`Task`, `Output`, `Decision`\> - -*** - -### toArtifact? - -> `optional` **toArtifact?**: (`result`) => `TArtifact` - -Defined in: [runtime/loop-dispatch.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L68) - -Map the finished loop to the artifact the judges score. Default: - `result.winner?.output`. A loop with no winner yields `undefined` (judges - skip the cell) — but the loop's token usage is STILL reported, so the - integrity guard sees real activity. - -#### Parameters - -##### result - -[`LoopResult`](LoopResult.md)\<`Task`, `Output`, `Decision`\> - -#### Returns - -`TArtifact` - -*** - -### forwardTrace? - -> `optional` **forwardTrace?**: `boolean` - -Defined in: [runtime/loop-dispatch.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L71) - -Forward `loop.*` trace events into the campaign's scoped trace so loop - spans correlate with the cell. Default true. - -*** - -### costSource? - -> `optional` **costSource?**: `string` - -Defined in: [runtime/loop-dispatch.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L73) - -Cost-meter source label for the loop's spend. Default `'loop'`. diff --git a/docs/api/runtime/interfaces/LoopEndedPayload.md b/docs/api/runtime/interfaces/LoopEndedPayload.md deleted file mode 100644 index ce4d0fc..0000000 --- a/docs/api/runtime/interfaces/LoopEndedPayload.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopEndedPayload - -# Interface: LoopEndedPayload - -Defined in: [runtime/types.ts:454](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L454) - -**`Experimental`** - -## Properties - -### winnerIterationIndex? - -> `optional` **winnerIterationIndex?**: `number` - -Defined in: [runtime/types.ts:455](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L455) - -**`Experimental`** - -*** - -### totalCostUsd - -> **totalCostUsd**: `number` - -Defined in: [runtime/types.ts:456](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L456) - -**`Experimental`** - -*** - -### durationMs - -> **durationMs**: `number` - -Defined in: [runtime/types.ts:457](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L457) - -**`Experimental`** - -*** - -### iterations - -> **iterations**: `number` - -Defined in: [runtime/types.ts:458](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L458) - -**`Experimental`** diff --git a/docs/api/runtime/interfaces/LoopIterationDispatchPayload.md b/docs/api/runtime/interfaces/LoopIterationDispatchPayload.md deleted file mode 100644 index fed3e18..0000000 --- a/docs/api/runtime/interfaces/LoopIterationDispatchPayload.md +++ /dev/null @@ -1,106 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopIterationDispatchPayload - -# Interface: LoopIterationDispatchPayload - -Defined in: [runtime/types.ts:410](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L410) - -**`Experimental`** - -Where the iteration's worker was placed. `sibling` = a fresh sandbox the -kernel created via `sandboxClient.create`. `fleet` = an existing machine in -a shared-workspace fleet — workers see the caller's filesystem and any diff -they write lands on it directly. - -## Properties - -### iterationIndex - -> **iterationIndex**: `number` - -Defined in: [runtime/types.ts:411](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L411) - -**`Experimental`** - -*** - -### agentRunName - -> **agentRunName**: `string` - -Defined in: [runtime/types.ts:412](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L412) - -**`Experimental`** - -*** - -### placement - -> **placement**: `"sibling"` \| `"fleet"` - -Defined in: [runtime/types.ts:413](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L413) - -**`Experimental`** - -*** - -### sandboxId? - -> `optional` **sandboxId?**: `string` - -Defined in: [runtime/types.ts:415](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L415) - -**`Experimental`** - -Set on every placement. Lets analyst loops correlate per-iteration logs. - -*** - -### fleetId? - -> `optional` **fleetId?**: `string` - -Defined in: [runtime/types.ts:417](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L417) - -**`Experimental`** - -Set only when `placement === 'fleet'`. - -*** - -### machineId? - -> `optional` **machineId?**: `string` - -Defined in: [runtime/types.ts:419](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L419) - -**`Experimental`** - -Set only when `placement === 'fleet'`. - -*** - -### groupId? - -> `optional` **groupId?**: `number` - -Defined in: [runtime/types.ts:421](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L421) - -**`Experimental`** - -Plan round this iteration belongs to. - -*** - -### parentIndex? - -> `optional` **parentIndex?**: `number` - -Defined in: [runtime/types.ts:423](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L423) - -**`Experimental`** - -Iteration this one was planned from; `undefined` ⇒ root. diff --git a/docs/api/runtime/interfaces/LoopIterationEndedPayload.md b/docs/api/runtime/interfaces/LoopIterationEndedPayload.md deleted file mode 100644 index a1f601b..0000000 --- a/docs/api/runtime/interfaces/LoopIterationEndedPayload.md +++ /dev/null @@ -1,131 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopIterationEndedPayload - -# Interface: LoopIterationEndedPayload - -Defined in: [runtime/types.ts:427](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L427) - -**`Experimental`** - -## Properties - -### iterationIndex - -> **iterationIndex**: `number` - -Defined in: [runtime/types.ts:428](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L428) - -**`Experimental`** - -*** - -### agentRunName - -> **agentRunName**: `string` - -Defined in: [runtime/types.ts:429](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L429) - -**`Experimental`** - -*** - -### outputHash? - -> `optional` **outputHash?**: `string` - -Defined in: [runtime/types.ts:430](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L430) - -**`Experimental`** - -*** - -### verdict? - -> `optional` **verdict?**: `DefaultVerdict` - -Defined in: [runtime/types.ts:431](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L431) - -**`Experimental`** - -*** - -### error? - -> `optional` **error?**: `string` - -Defined in: [runtime/types.ts:432](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L432) - -**`Experimental`** - -*** - -### costUsd - -> **costUsd**: `number` - -Defined in: [runtime/types.ts:433](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L433) - -**`Experimental`** - -*** - -### durationMs - -> **durationMs**: `number` - -Defined in: [runtime/types.ts:434](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L434) - -**`Experimental`** - -*** - -### tokenUsage? - -> `optional` **tokenUsage?**: [`LoopTokenUsage`](LoopTokenUsage.md) - -Defined in: [runtime/types.ts:437](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L437) - -**`Experimental`** - -Summed LLM token usage for this iteration — maps to gen_ai.usage.* on the - branch span. Omitted when no `llm_call` events carried token counts. - -*** - -### groupId? - -> `optional` **groupId?**: `number` - -Defined in: [runtime/types.ts:439](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L439) - -**`Experimental`** - -Plan round this iteration belongs to. - -*** - -### parentIndex? - -> `optional` **parentIndex?**: `number` - -Defined in: [runtime/types.ts:441](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L441) - -**`Experimental`** - -Iteration this one was planned from; `undefined` ⇒ root. - -*** - -### outputPreview? - -> `optional` **outputPreview?**: `string` - -Defined in: [runtime/types.ts:444](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L444) - -**`Experimental`** - -Truncated string preview of the parsed output — for a viewer's drawer. - Bounded to ~280 chars; never the full payload. diff --git a/docs/api/runtime/interfaces/LoopIterationStartedPayload.md b/docs/api/runtime/interfaces/LoopIterationStartedPayload.md deleted file mode 100644 index 3e24608..0000000 --- a/docs/api/runtime/interfaces/LoopIterationStartedPayload.md +++ /dev/null @@ -1,65 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopIterationStartedPayload - -# Interface: LoopIterationStartedPayload - -Defined in: [runtime/types.ts:392](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L392) - -**`Experimental`** - -## Properties - -### iterationIndex - -> **iterationIndex**: `number` - -Defined in: [runtime/types.ts:393](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L393) - -**`Experimental`** - -*** - -### agentRunName - -> **agentRunName**: `string` - -Defined in: [runtime/types.ts:394](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L394) - -**`Experimental`** - -*** - -### taskHash - -> **taskHash**: `string` - -Defined in: [runtime/types.ts:395](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L395) - -**`Experimental`** - -*** - -### groupId? - -> `optional` **groupId?**: `number` - -Defined in: [runtime/types.ts:397](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L397) - -**`Experimental`** - -Plan round (== `LoopPlanPayload.roundIndex`) this iteration belongs to. - -*** - -### parentIndex? - -> `optional` **parentIndex?**: `number` - -Defined in: [runtime/types.ts:399](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L399) - -**`Experimental`** - -Iteration this one was planned from; `undefined` ⇒ root. diff --git a/docs/api/runtime/interfaces/LoopLineageOptions.md b/docs/api/runtime/interfaces/LoopLineageOptions.md deleted file mode 100644 index 1d0b8cf..0000000 --- a/docs/api/runtime/interfaces/LoopLineageOptions.md +++ /dev/null @@ -1,95 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopLineageOptions - -# Interface: LoopLineageOptions - -Defined in: [runtime/types.ts:267](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L267) - -**`Experimental`** - -Opt-in box-lineage controls for `runLoop`. Default OFF — with both flags -unset the kernel's per-iteration behavior is byte-identical to acquiring a -fresh box, streaming once, and tearing it down. The independence of N fresh -boxes (e.g. `random@k`) is a compute-control invariant; these flags must -never apply to it. Enable them ONLY on a steered loop (refine / planner-driven -fanout) where reusing the parent's context is intended. - -Live-box footprint: the lineage keeps every box it starts or forks alive -across rounds so a later round can descend from it, and tears them down at -loop end. When the driver's branch point is kernel-inferred (no -`describePlan` — refine, fanout-vote), the kernel prunes boxes no future -round can reach after each round, so the live set tracks the active frontier. -When the driver authors its own branch point (`describePlan().parentIndex`), -it may descend from any prior -iteration, so no box is pruned and the live-box count rises to the total -iterations across all rounds. Size `forkFanout` runs accordingly (CRIU forks -are copy-on-write, but each is still a live box until loop end). - -## Properties - -### sessionContinuity? - -> `optional` **sessionContinuity?**: `boolean` - -Defined in: [runtime/types.ts:282](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L282) - -**`Experimental`** - -When true, a refine round (1 planned task) descending from a prior round -CONTINUES the parent iteration's session on the SAME box -(`streamPrompt({ sessionId })`) instead of acquiring a fresh box and -re-injecting prior context as prompt text. Round 0 (no parent) always -starts fresh. Usable on any single-task path, not just the refine driver. - -Requires a platform that honors a client-supplied `sessionId`. The lineage -mints the id and `continue` asserts the session is still live -(`box.session(id).status()`), failing loud if the platform dropped it — so a -non-honoring platform errors instead of silently running contextless turns. -Verify continuity against the live platform before enabling: the assertion -proves the session EXISTS server-side, not that prior turns replay into it. - -*** - -### forkFanout? - -> `optional` **forkFanout?**: `boolean` - -Defined in: [runtime/types.ts:297](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L297) - -**`Experimental`** - -When true AND the platform reports CRIU fork support, a fanout round (N -planned tasks) descending from a prior round FORKS the parent iteration's -checkpoint so all N branches inherit a shared context prefix. Without fork -support it degrades to N independent fresh boxes (same result, no prefix). -Round 0 always starts fresh. NEVER set this for a `random@k` control arm — -forking would couple the independent samples. - -A real fork inherits the parent's IMAGE/PROFILE: per-branch `AgentRunSpec` -profiles are honored only on the degraded fresh-box path, so a -heterogeneous-profile fanout silently homogenizes to the parent's profile -when fork is available. Use this for same-profile branching; for -different-per-branch profiles use the unforked fanout path. - -*** - -### streaming? - -> `optional` **streaming?**: `"sse"` \| `"poll"` - -Defined in: [runtime/types.ts:309](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L309) - -**`Experimental`** - -Per-turn sandbox streaming mode. Default `'sse'` (live `streamPrompt` — -low-latency, full per-token trace; best for interactive chat). `'poll'` -fire-and-detaches via `dispatchPrompt` and awaits the terminal result by -status-polling, so a long, quiet in-box turn (clone + build + test) never -holds a live stream a proxy idle-timeout can drop mid-execution. Lower trace -fidelity (one terminal event), so it is opt-in — intended for BATCH eval -runs, which don't need live streaming and were losing long turns to the -idle-drop. Applies to the default fresh-box path too, not only when -`sessionContinuity`/`forkFanout` are on. diff --git a/docs/api/runtime/interfaces/LoopPlanDescription.md b/docs/api/runtime/interfaces/LoopPlanDescription.md deleted file mode 100644 index a17e56e..0000000 --- a/docs/api/runtime/interfaces/LoopPlanDescription.md +++ /dev/null @@ -1,52 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopPlanDescription - -# Interface: LoopPlanDescription - -Defined in: [runtime/types.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L180) - -**`Experimental`** - -Driver-supplied description of the just-planned move. - -## Properties - -### kind - -> **kind**: `string` - -Defined in: [runtime/types.ts:182](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L182) - -**`Experimental`** - -Topology move this round — e.g. `'refine' | 'fanout' | 'verify' | 'stop'`. - -*** - -### rationale? - -> `optional` **rationale?**: `string` - -Defined in: [runtime/types.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L184) - -**`Experimental`** - -Why the driver chose this move (the agent's rationale), when available. - -*** - -### parentIndex? - -> `optional` **parentIndex?**: `number` - -Defined in: [runtime/types.ts:191](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L191) - -**`Experimental`** - -Iteration index this round branches FROM, when the driver declares it. -Overrides the kernel's inferred branch point — lets a planner that -branches off a specific (non-winner) iteration emit faithful edge lineage. -Omit to keep the inferred (best-valid / latest) branch point. diff --git a/docs/api/runtime/interfaces/LoopPlanPayload.md b/docs/api/runtime/interfaces/LoopPlanPayload.md deleted file mode 100644 index c8364a9..0000000 --- a/docs/api/runtime/interfaces/LoopPlanPayload.md +++ /dev/null @@ -1,90 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopPlanPayload - -# Interface: LoopPlanPayload - -Defined in: [runtime/types.ts:372](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L372) - -**`Experimental`** - -Emitted once per `plan()` round, immediately after the driver plans. Carries -the topology move so a viewer renders WHAT the agent decided + WHY, not just -the inferred fan-width. `moveKind` is the driver's `describePlan().kind` when -provided, else inferred from `plannedCount` (0→stop, 1→refine, N→fanout). - -## Properties - -### roundIndex - -> **roundIndex**: `number` - -Defined in: [runtime/types.ts:374](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L374) - -**`Experimental`** - -0-based plan round (one per `plan()` call). - -*** - -### plannedCount - -> **plannedCount**: `number` - -Defined in: [runtime/types.ts:376](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L376) - -**`Experimental`** - -Tasks the driver issued this round. - -*** - -### moveKind - -> **moveKind**: `string` - -Defined in: [runtime/types.ts:378](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L378) - -**`Experimental`** - -Topology move — `'refine' | 'fanout' | 'verify' | 'stop'` etc. - -*** - -### rationale? - -> `optional` **rationale?**: `string` - -Defined in: [runtime/types.ts:380](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L380) - -**`Experimental`** - -Driver rationale for the move, when available. - -*** - -### parentIndex? - -> `optional` **parentIndex?**: `number` - -Defined in: [runtime/types.ts:386](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L386) - -**`Experimental`** - -Iteration index this round branched FROM (the edge source). `undefined` -for round 0 (root). Kernel-inferred branch point — the best-valid (else -latest) iteration so far — unless a driver later declares it explicitly. - -*** - -### childIndices - -> **childIndices**: `number`[] - -Defined in: [runtime/types.ts:388](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L388) - -**`Experimental`** - -Iteration indices this round dispatched (the edge targets). diff --git a/docs/api/runtime/interfaces/LoopResult.md b/docs/api/runtime/interfaces/LoopResult.md deleted file mode 100644 index 0f27892..0000000 --- a/docs/api/runtime/interfaces/LoopResult.md +++ /dev/null @@ -1,91 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopResult - -# Interface: LoopResult\ - -Defined in: [runtime/types.ts:204](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L204) - -**`Experimental`** - -## Type Parameters - -### Task - -`Task` - -### Output - -`Output` - -### Decision - -`Decision` - -## Properties - -### decision - -> **decision**: `Decision` - -Defined in: [runtime/types.ts:205](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L205) - -**`Experimental`** - -*** - -### iterations - -> **iterations**: [`Iteration`](Iteration.md)\<`Task`, `Output`\>[] - -Defined in: [runtime/types.ts:206](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L206) - -**`Experimental`** - -*** - -### winner? - -> `optional` **winner?**: [`LoopWinner`](LoopWinner.md)\<`Task`, `Output`\> - -Defined in: [runtime/types.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L207) - -**`Experimental`** - -*** - -### durationMs - -> **durationMs**: `number` - -Defined in: [runtime/types.ts:208](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L208) - -**`Experimental`** - -*** - -### costUsd - -> **costUsd**: `number` - -Defined in: [runtime/types.ts:210](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L210) - -**`Experimental`** - -Sum of every iteration's `costUsd`. - -*** - -### tokenUsage - -> **tokenUsage**: [`LoopTokenUsage`](LoopTokenUsage.md) - -Defined in: [runtime/types.ts:214](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L214) - -**`Experimental`** - -Sum of every iteration's token usage. Forward to - `ctx.cost.observeTokens` in a `runProfileMatrix` dispatch so the - integrity guard sees real LLM activity. diff --git a/docs/api/runtime/interfaces/LoopSandboxPlacement.md b/docs/api/runtime/interfaces/LoopSandboxPlacement.md deleted file mode 100644 index e2cc147..0000000 --- a/docs/api/runtime/interfaces/LoopSandboxPlacement.md +++ /dev/null @@ -1,55 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopSandboxPlacement - -# Interface: LoopSandboxPlacement - -Defined in: [runtime/types.ts:313](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L313) - -**`Experimental`** - -## Extended by - -- [`InProcessExecutorDescribePlacement`](../../mcp/interfaces/InProcessExecutorDescribePlacement.md) - -## Properties - -### kind - -> **kind**: `"sibling"` \| `"fleet"` - -Defined in: [runtime/types.ts:314](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L314) - -**`Experimental`** - -*** - -### sandboxId? - -> `optional` **sandboxId?**: `string` - -Defined in: [runtime/types.ts:315](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L315) - -**`Experimental`** - -*** - -### fleetId? - -> `optional` **fleetId?**: `string` - -Defined in: [runtime/types.ts:316](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L316) - -**`Experimental`** - -*** - -### machineId? - -> `optional` **machineId?**: `string` - -Defined in: [runtime/types.ts:317](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L317) - -**`Experimental`** diff --git a/docs/api/runtime/interfaces/LoopStartedPayload.md b/docs/api/runtime/interfaces/LoopStartedPayload.md deleted file mode 100644 index 0426b84..0000000 --- a/docs/api/runtime/interfaces/LoopStartedPayload.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopStartedPayload - -# Interface: LoopStartedPayload - -Defined in: [runtime/types.ts:357](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L357) - -**`Experimental`** - -## Properties - -### driver - -> **driver**: `string` - -Defined in: [runtime/types.ts:358](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L358) - -**`Experimental`** - -*** - -### agentRunNames - -> **agentRunNames**: `string`[] - -Defined in: [runtime/types.ts:359](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L359) - -**`Experimental`** - -*** - -### maxIterations - -> **maxIterations**: `number` - -Defined in: [runtime/types.ts:360](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L360) - -**`Experimental`** - -*** - -### maxConcurrency - -> **maxConcurrency**: `number` - -Defined in: [runtime/types.ts:361](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L361) - -**`Experimental`** diff --git a/docs/api/runtime/interfaces/LoopTeardownFailedPayload.md b/docs/api/runtime/interfaces/LoopTeardownFailedPayload.md deleted file mode 100644 index bbd9db7..0000000 --- a/docs/api/runtime/interfaces/LoopTeardownFailedPayload.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopTeardownFailedPayload - -# Interface: LoopTeardownFailedPayload - -Defined in: [runtime/types.ts:464](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L464) - -**`Experimental`** - -Emitted when a box's `delete()` throws or times out during teardown — the - loop swallows the failure (platform reaps on expiry) but surfaces it here so - a real leak (e.g. mid-loop auth expiry) is observable. - -## Properties - -### sandboxId? - -> `optional` **sandboxId?**: `string` - -Defined in: [runtime/types.ts:465](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L465) - -**`Experimental`** - -*** - -### reason - -> **reason**: `string` - -Defined in: [runtime/types.ts:467](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L467) - -**`Experimental`** - -`'timeout'` or the delete error message. diff --git a/docs/api/runtime/interfaces/LoopTokenUsage.md b/docs/api/runtime/interfaces/LoopTokenUsage.md deleted file mode 100644 index b725f63..0000000 --- a/docs/api/runtime/interfaces/LoopTokenUsage.md +++ /dev/null @@ -1,30 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopTokenUsage - -# Interface: LoopTokenUsage - -Defined in: [runtime/types.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L113) - -LLM token usage. Structurally matches agent-eval's `RunTokenUsage` / - `CampaignTokenUsage` ({ input, output }) so a loop result maps straight - onto `ctx.cost.observeTokens` in a `runProfileMatrix` dispatch — without - which the backend-integrity guard reads the run as a stub. - -## Properties - -### input - -> **input**: `number` - -Defined in: [runtime/types.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L114) - -*** - -### output - -> **output**: `number` - -Defined in: [runtime/types.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L115) diff --git a/docs/api/runtime/interfaces/LoopTraceEmitter.md b/docs/api/runtime/interfaces/LoopTraceEmitter.md deleted file mode 100644 index 43be3c6..0000000 --- a/docs/api/runtime/interfaces/LoopTraceEmitter.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopTraceEmitter - -# Interface: LoopTraceEmitter - -Defined in: [runtime/types.ts:321](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L321) - -**`Experimental`** - -## Methods - -### emit() - -> **emit**(`event`): `void` \| `Promise`\<`void`\> - -Defined in: [runtime/types.ts:322](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L322) - -**`Experimental`** - -#### Parameters - -##### event - -[`LoopTraceEvent`](../type-aliases/LoopTraceEvent.md) - -#### Returns - -`void` \| `Promise`\<`void`\> diff --git a/docs/api/runtime/interfaces/LoopUntilSpec.md b/docs/api/runtime/interfaces/LoopUntilSpec.md deleted file mode 100644 index cc56722..0000000 --- a/docs/api/runtime/interfaces/LoopUntilSpec.md +++ /dev/null @@ -1,130 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopUntilSpec - -# Interface: LoopUntilSpec\ - -Defined in: [runtime/personify/wave-types.ts:170](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L170) - -`loopUntil({ until, step })` — iterative deepening inside the conserved pool: spawn one `step` -child per round, ask `until` whether the accumulated state satisfies the goal, and stop when it -does OR when the pool can no longer admit a step (budget IS the loop bound — no unbounded -while). The deployable, non-oracle stop: `until` is the satisfiability gate, read from trace -findings + accumulated deliverables, never a fresh raw verdict the loop minted to stop itself. - -No domain: "refine until tests pass" is `loopUntil` with a coder persona + a `step` that edits -and an `until` that reads the test-finding; the combinator owns only the round/stop wiring. - -## Type Parameters - -### Task - -`Task` - -### State - -`State` - -### D - -`D` - -## Methods - -### step() - -> **step**(`rootTask`, `state`, `ctx`): `unknown` - -Defined in: [runtime/personify/wave-types.ts:172](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L172) - -Build the next step child's task from the root task + the state accumulated so far. - -#### Parameters - -##### rootTask - -`Task` - -##### state - -[`LoopUntilState`](LoopUntilState.md)\<`State`\> - -##### ctx - -[`ShapeContext`](ShapeContext.md)\<`D`\> - -#### Returns - -`unknown` - -*** - -### fold() - -> **fold**(`prior`, `settled`): [`LoopUntilState`](LoopUntilState.md)\<`State`\> - -Defined in: [runtime/personify/wave-types.ts:174](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L174) - -Fold one settled step into the accumulated state (the loop's running deliverable candidate). - -#### Parameters - -##### prior - -[`LoopUntilState`](LoopUntilState.md)\<`State`\> - -##### settled - -[`Settled`](../type-aliases/Settled.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`D`\>\> - -#### Returns - -[`LoopUntilState`](LoopUntilState.md)\<`State`\> - -*** - -### until() - -> **until**(`state`, `findings`): [`Outcome`](../type-aliases/Outcome.md)\<`D`\> \| `null` - -Defined in: [runtime/personify/wave-types.ts:180](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L180) - -The satisfiability gate: given the accumulated state + the round's trace findings, has the -goal been reached? Returns the terminal deliverable when satisfied, or `null` to keep going. -Reads `findings` (trace-derived), NOT a raw verdict score — the deployable-stop discipline. - -#### Parameters - -##### state - -[`LoopUntilState`](LoopUntilState.md)\<`State`\> - -##### findings - -readonly `AnalystFinding`[] - -#### Returns - -[`Outcome`](../type-aliases/Outcome.md)\<`D`\> \| `null` - -*** - -### label()? - -> `optional` **label**(`round`): `string` - -Defined in: [runtime/personify/wave-types.ts:182](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L182) - -Per-round step label (defaults to `step:` in the impl). - -#### Parameters - -##### round - -`number` - -#### Returns - -`string` diff --git a/docs/api/runtime/interfaces/LoopUntilState.md b/docs/api/runtime/interfaces/LoopUntilState.md deleted file mode 100644 index ff3818b..0000000 --- a/docs/api/runtime/interfaces/LoopUntilState.md +++ /dev/null @@ -1,34 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopUntilState - -# Interface: LoopUntilState\ - -Defined in: [runtime/personify/wave-types.ts:187](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L187) - -The accumulated state `loopUntil` threads across rounds — the running candidate + the round - index, so `step`/`fold`/`until` are pure functions of it (replay-safe, no wall-clock). - -## Type Parameters - -### State - -`State` - -## Properties - -### round - -> `readonly` **round**: `number` - -Defined in: [runtime/personify/wave-types.ts:188](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L188) - -*** - -### value - -> `readonly` **value**: `State` - -Defined in: [runtime/personify/wave-types.ts:189](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L189) diff --git a/docs/api/runtime/interfaces/LoopWinner.md b/docs/api/runtime/interfaces/LoopWinner.md deleted file mode 100644 index e9cd246..0000000 --- a/docs/api/runtime/interfaces/LoopWinner.md +++ /dev/null @@ -1,71 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopWinner - -# Interface: LoopWinner\ - -Defined in: [runtime/types.ts:195](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L195) - -**`Experimental`** - -## Type Parameters - -### Task - -`Task` - -### Output - -`Output` - -## Properties - -### task - -> **task**: `Task` - -Defined in: [runtime/types.ts:196](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L196) - -**`Experimental`** - -*** - -### output - -> **output**: `Output` - -Defined in: [runtime/types.ts:197](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L197) - -**`Experimental`** - -*** - -### verdict? - -> `optional` **verdict?**: `DefaultVerdict` - -Defined in: [runtime/types.ts:198](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L198) - -**`Experimental`** - -*** - -### iterationIndex - -> **iterationIndex**: `number` - -Defined in: [runtime/types.ts:199](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L199) - -**`Experimental`** - -*** - -### agentRunName - -> **agentRunName**: `string` - -Defined in: [runtime/types.ts:200](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L200) - -**`Experimental`** diff --git a/docs/api/runtime/interfaces/McpEndpoint.md b/docs/api/runtime/interfaces/McpEndpoint.md deleted file mode 100644 index b9c6f15..0000000 --- a/docs/api/runtime/interfaces/McpEndpoint.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / McpEndpoint - -# Interface: McpEndpoint - -Defined in: [runtime/mcp-environment.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L25) - -Where a handle's MCP server lives; headers carry per-artifact scoping. - -## Properties - -### url - -> **url**: `string` - -Defined in: [runtime/mcp-environment.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L26) - -*** - -### headers? - -> `optional` **headers?**: `Record`\<`string`, `string`\> - -Defined in: [runtime/mcp-environment.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L27) diff --git a/docs/api/runtime/interfaces/McpEnvironmentOptions.md b/docs/api/runtime/interfaces/McpEnvironmentOptions.md deleted file mode 100644 index f04e73b..0000000 --- a/docs/api/runtime/interfaces/McpEnvironmentOptions.md +++ /dev/null @@ -1,115 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / McpEnvironmentOptions - -# Interface: McpEnvironmentOptions - -Defined in: [runtime/mcp-environment.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L30) - -## Properties - -### name - -> **name**: `string` - -Defined in: [runtime/mcp-environment.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L31) - -*** - -### maxResultChars? - -> `optional` **maxResultChars?**: `number` - -Defined in: [runtime/mcp-environment.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L41) - -Cap on a tool result's text fed back to the worker. Default 1500 chars. - -## Methods - -### open() - -> **open**(`task`): `Promise`\<\{ `handle`: [`ArtifactHandle`](ArtifactHandle.md); `endpoint`: [`McpEndpoint`](McpEndpoint.md); \}\> - -Defined in: [runtime/mcp-environment.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L33) - -Create/seed the per-task artifact; return its handle + the MCP endpoint scoped to it. - -#### Parameters - -##### task - -[`AgenticTask`](AgenticTask.md) - -#### Returns - -`Promise`\<\{ `handle`: [`ArtifactHandle`](ArtifactHandle.md); `endpoint`: [`McpEndpoint`](McpEndpoint.md); \}\> - -*** - -### score() - -> **score**(`task`, `handle`): `Promise`\<[`SurfaceScore`](SurfaceScore.md)\> - -Defined in: [runtime/mcp-environment.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L35) - -The deployable check over the artifact's current state. - -#### Parameters - -##### task - -[`AgenticTask`](AgenticTask.md) - -##### handle - -[`ArtifactHandle`](ArtifactHandle.md) - -#### Returns - -`Promise`\<[`SurfaceScore`](SurfaceScore.md)\> - -*** - -### close()? - -> `optional` **close**(`handle`): `Promise`\<`void`\> - -Defined in: [runtime/mcp-environment.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L37) - -Teardown (delete the seeded artifact). Optional — omit for stateless servers. - -#### Parameters - -##### handle - -[`ArtifactHandle`](ArtifactHandle.md) - -#### Returns - -`Promise`\<`void`\> - -*** - -### selectTools()? - -> `optional` **selectTools**(`task`, `all`): [`AgenticTool`](AgenticTool.md)[] - -Defined in: [runtime/mcp-environment.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/mcp-environment.ts#L39) - -Restrict/order the server's tools per task (e.g. the task's selected_tools). Default: all. - -#### Parameters - -##### task - -[`AgenticTask`](AgenticTask.md) - -##### all - -[`AgenticTool`](AgenticTool.md)[] - -#### Returns - -[`AgenticTool`](AgenticTool.md)[] diff --git a/docs/api/runtime/interfaces/NestedScopeSeam.md b/docs/api/runtime/interfaces/NestedScopeSeam.md deleted file mode 100644 index 01f9782..0000000 --- a/docs/api/runtime/interfaces/NestedScopeSeam.md +++ /dev/null @@ -1,71 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / NestedScopeSeam - -# Interface: NestedScopeSeam - -Defined in: [runtime/supervise/scope.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/scope.ts#L151) - -The recursion seam value: mount a nested `Scope` for a driver child. `parentId` is the -driver child's own node id (so its children get `${nodeId}:s${ordinal}` ids and its -nested journal tree is namespaced under it); `root` is the journal tree key for the -nested tree (distinct from the parent's so cursor seqs never collide in the per-tree -guard). `depth` is `parent.depth + 1`. The nested scope shares the parent's `pool` -(conserved budget across depth), `journal`/`blobs` (one record), and `executors` (a -nested child resolves to leaf-or-driver through the same open registry). - -## Properties - -### depth - -> `readonly` **depth**: `number` - -Defined in: [runtime/supervise/scope.ts:153](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/scope.ts#L153) - -This scope's recursion depth — a nested scope runs at `depth + 1`. - -*** - -### maxDepth? - -> `readonly` `optional` **maxDepth?**: `number` - -Defined in: [runtime/supervise/scope.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/scope.ts#L155) - -The runtime recursion-depth ceiling, paired with the conserved pool (R3). - -*** - -### journalRoot - -> `readonly` **journalRoot**: `string` - -Defined in: [runtime/supervise/scope.ts:157](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/scope.ts#L157) - -The journal tree key the parent scope writes to (used to namespace nested trees). - -## Methods - -### mount() - -> **mount**(`nestedRoot`, `signal`): [`Scope`](Scope.md)\<`unknown`\> - -Defined in: [runtime/supervise/scope.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/scope.ts#L159) - -Mount a nested scope rooted at `nestedRoot`, parented at this driver child's node id. - -#### Parameters - -##### nestedRoot - -`string` - -##### signal - -`AbortSignal` - -#### Returns - -[`Scope`](Scope.md)\<`unknown`\> diff --git a/docs/api/runtime/interfaces/NodeSnapshot.md b/docs/api/runtime/interfaces/NodeSnapshot.md deleted file mode 100644 index 31748da..0000000 --- a/docs/api/runtime/interfaces/NodeSnapshot.md +++ /dev/null @@ -1,77 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / NodeSnapshot - -# Interface: NodeSnapshot - -Defined in: [runtime/supervise/types.ts:337](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L337) - -## Properties - -### id - -> `readonly` **id**: `string` - -Defined in: [runtime/supervise/types.ts:338](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L338) - -*** - -### parent? - -> `readonly` `optional` **parent?**: `string` - -Defined in: [runtime/supervise/types.ts:339](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L339) - -*** - -### label - -> `readonly` **label**: `string` - -Defined in: [runtime/supervise/types.ts:340](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L340) - -*** - -### status - -> `readonly` **status**: [`NodeStatus`](../type-aliases/NodeStatus.md) - -Defined in: [runtime/supervise/types.ts:341](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L341) - -*** - -### runtime - -> `readonly` **runtime**: [`Runtime`](../type-aliases/Runtime.md) - -Defined in: [runtime/supervise/types.ts:342](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L342) - -*** - -### budget - -> `readonly` **budget**: [`Budget`](Budget.md) - -Defined in: [runtime/supervise/types.ts:343](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L343) - -*** - -### spent - -> `readonly` **spent**: [`Spend`](Spend.md) - -Defined in: [runtime/supervise/types.ts:345](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L345) - -Conserved spend so far for this node. - -*** - -### outRef? - -> `readonly` `optional` **outRef?**: `string` - -Defined in: [runtime/supervise/types.ts:347](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L347) - -`outRef` once the node is `done` (the replay/result pointer). diff --git a/docs/api/runtime/interfaces/Observation.md b/docs/api/runtime/interfaces/Observation.md deleted file mode 100644 index 694de42..0000000 --- a/docs/api/runtime/interfaces/Observation.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Observation - -# Interface: Observation - -Defined in: [runtime/observe.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L64) - -## Properties - -### findings - -> **findings**: `AnalystFinding`[] - -Defined in: [runtime/observe.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L65) - -*** - -### learned - -> **learned**: [`CorpusRecord`](CorpusRecord.md)[] - -Defined in: [runtime/observe.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L67) - -Facts persisted to the corpus (empty when no corpus was supplied). - -*** - -### report - -> **report**: `string` - -Defined in: [runtime/observe.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L69) - -Operator-facing markdown: what the observer noticed + what to change. diff --git a/docs/api/runtime/interfaces/ObserveInput.md b/docs/api/runtime/interfaces/ObserveInput.md deleted file mode 100644 index 72644fa..0000000 --- a/docs/api/runtime/interfaces/ObserveInput.md +++ /dev/null @@ -1,60 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ObserveInput - -# Interface: ObserveInput - -Defined in: [runtime/observe.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L23) - -## Properties - -### task - -> **task**: `string` - -Defined in: [runtime/observe.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L25) - -What the worker was asked to do. - -*** - -### output - -> **output**: `string` - -Defined in: [runtime/observe.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L27) - -What it produced (its final answer / artifact summary). - -*** - -### trace - -> **trace**: readonly `unknown`[] - -Defined in: [runtime/observe.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L29) - -The worker's trace — any event array (sandbox events, tool-call records). - -*** - -### outcome? - -> `optional` **outcome?**: `"failed"` \| `"unknown"` \| `"passed"` - -Defined in: [runtime/observe.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L32) - -Terminal status only (passed/failed/unknown) — NOT a judge score; the - observer never reads the verdict, it reads behavior. - -*** - -### runId? - -> `optional` **runId?**: `string` - -Defined in: [runtime/observe.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L34) - -Provenance back to the run. diff --git a/docs/api/runtime/interfaces/ObserveOptions.md b/docs/api/runtime/interfaces/ObserveOptions.md deleted file mode 100644 index 7024763..0000000 --- a/docs/api/runtime/interfaces/ObserveOptions.md +++ /dev/null @@ -1,79 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ObserveOptions - -# Interface: ObserveOptions - -Defined in: [runtime/observe.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L37) - -## Properties - -### chat - -> **chat**: `ChatClient` - -Defined in: [runtime/observe.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L39) - -The model-call seam (agent-eval `createChatClient`: router / cli-bridge / …). - -*** - -### model? - -> `optional` **model?**: `string` - -Defined in: [runtime/observe.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L40) - -*** - -### corpus? - -> `optional` **corpus?**: [`Corpus`](Corpus.md) - -Defined in: [runtime/observe.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L42) - -When set, learned facts are appended (idempotent) for the next run to read. - -*** - -### tags? - -> `optional` **tags?**: readonly `string`[] - -Defined in: [runtime/observe.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L44) - -Tags written onto learned facts + used by the next run's corpus query. - -*** - -### signal? - -> `optional` **signal?**: `AbortSignal` - -Defined in: [runtime/observe.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L45) - -*** - -### maxTraceLines? - -> `optional` **maxTraceLines?**: `number` - -Defined in: [runtime/observe.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L47) - -Cap the trace lines fed to the observer (keeps the call cheap). Default 80. - -*** - -### analystInstruction? - -> `optional` **analystInstruction?**: `string` - -Defined in: [runtime/observe.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L53) - -Override the analyst's system instruction — the prompt that turns a trace into - findings + recommended_actions. The analyst IS the steerer, so this is the knob a - prompt optimizer (GEPA) tunes. Omitted ⇒ the default observer instruction. The - firewall (trace-only, never the verdict) is structural (input has no score), so a - custom instruction cannot break it. diff --git a/docs/api/runtime/interfaces/OpenSandboxRunOptions.md b/docs/api/runtime/interfaces/OpenSandboxRunOptions.md deleted file mode 100644 index 635abf5..0000000 --- a/docs/api/runtime/interfaces/OpenSandboxRunOptions.md +++ /dev/null @@ -1,110 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / OpenSandboxRunOptions - -# Interface: OpenSandboxRunOptions - -Defined in: [runtime/sandbox-run.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L79) - -**`Experimental`** - -## Properties - -### agentRun - -> **agentRun**: [`AgentRunSpec`](AgentRunSpec.md)\<`string`\> - -Defined in: [runtime/sandbox-run.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L81) - -**`Experimental`** - -Profile + sandbox env/overrides. `sandboxOverrides.backend.type` is the harness. - -*** - -### signal - -> **signal**: `AbortSignal` - -Defined in: [runtime/sandbox-run.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L82) - -**`Experimental`** - -*** - -### hooks? - -> `optional` **hooks?**: [`RuntimeHooks`](../../index/interfaces/RuntimeHooks.md) - -Defined in: [runtime/sandbox-run.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L84) - -**`Experimental`** - -Optional execution-scoped observers. Hook failures never fail the run. - -*** - -### runId? - -> `optional` **runId?**: `string` - -Defined in: [runtime/sandbox-run.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L86) - -**`Experimental`** - -Stable run id for trace joins. Defaults to a short runtime-minted id. - -*** - -### scenarioId? - -> `optional` **scenarioId?**: `string` - -Defined in: [runtime/sandbox-run.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L88) - -**`Experimental`** - -Optional benchmark/scenario id carried into emitted hook events. - -*** - -### now? - -> `optional` **now?**: () => `number` - -Defined in: [runtime/sandbox-run.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L90) - -**`Experimental`** - -Test seam for deterministic hook timestamps. Defaults to `Date.now`. - -#### Returns - -`number` - -*** - -### maxConcurrency? - -> `optional` **maxConcurrency?**: `number` - -Defined in: [runtime/sandbox-run.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L92) - -**`Experimental`** - -Bounds box-creation bursts inside lineage fanout. Default from lineage. - -*** - -### readRetryDelayMs? - -> `optional` **readRetryDelayMs?**: `number` - -Defined in: [runtime/sandbox-run.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L95) - -**`Experimental`** - -Base backoff (ms) for retrying a transient artifact `fs.read` failure; the i-th - retry waits `readRetryDelayMs * i`. Default 1000. Set 0 to disable the wait (tests). diff --git a/docs/api/runtime/interfaces/OutputAdapter.md b/docs/api/runtime/interfaces/OutputAdapter.md deleted file mode 100644 index 1f877bc..0000000 --- a/docs/api/runtime/interfaces/OutputAdapter.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / OutputAdapter - -# Interface: OutputAdapter\ - -Defined in: [runtime/types.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L105) - -**`Experimental`** - -Stream of `SandboxEvent`s → typed `Output`. - -Adapters are pure functions over the already-collected event array; they -do not receive the live AsyncIterable so they can be replayed against -persisted streams during tests / replays. - -## Type Parameters - -### Output - -`Output` - -## Methods - -### parse() - -> **parse**(`events`): `Output` - -Defined in: [runtime/types.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L106) - -**`Experimental`** - -#### Parameters - -##### events - -`SandboxEvent`[] - -#### Returns - -`Output` diff --git a/docs/api/runtime/interfaces/PanelJudge.md b/docs/api/runtime/interfaces/PanelJudge.md deleted file mode 100644 index 20048e4..0000000 --- a/docs/api/runtime/interfaces/PanelJudge.md +++ /dev/null @@ -1,30 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / PanelJudge - -# Interface: PanelJudge - -Defined in: [runtime/personify/wave-types.ts:225](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L225) - -One judge in a panel — a labeled persona-derived judge child. Content (the rubric) lives in - the judge's profile; this carries only the label + the optional weight the merge may read. - -## Properties - -### label - -> `readonly` **label**: `string` - -Defined in: [runtime/personify/wave-types.ts:226](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L226) - -*** - -### weight? - -> `readonly` `optional` **weight?**: `number` - -Defined in: [runtime/personify/wave-types.ts:228](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L228) - -Optional merge weight (a write-only hint the `merge` fold may use; default-equal in the impl). diff --git a/docs/api/runtime/interfaces/PanelSpec.md b/docs/api/runtime/interfaces/PanelSpec.md deleted file mode 100644 index df85bb1..0000000 --- a/docs/api/runtime/interfaces/PanelSpec.md +++ /dev/null @@ -1,94 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / PanelSpec - -# Interface: PanelSpec\ - -Defined in: [runtime/personify/wave-types.ts:208](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L208) - -`panel(judges)` — M judges over ONE artifact, merged WRITE-ONLY (selector≠judge taken to its -limit). The combinator spawns the M judge children over the same input artifact, drains their -settlements, and MERGES their findings into a panel verdict via `merge` — a pure WRITE-ONLY -fold (a judge's output is never fed back to steer another judge, and the merge never re-ranks -the children behind the driver). The merged verdict gates the deliverable. - -No domain: a "code review panel" and an "essay rubric panel" are the same `panel` shape under -different personas; the rubric lives in each judge persona's profile, not the combinator. - -## Type Parameters - -### Artifact - -`Artifact` - -### D - -`D` - -## Properties - -### judges - -> `readonly` **judges**: readonly [`PanelJudge`](PanelJudge.md)[] - -Defined in: [runtime/personify/wave-types.ts:212](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L212) - -The M judge child specs: each is a persona-derived child (a narrower judge profile). The - combinator spawns one child per entry over the SAME `artifact` and never lets one judge's - output reach another's task (write-only). - -## Methods - -### judgeTask() - -> **judgeTask**(`artifact`, `judge`, `ctx`): `unknown` - -Defined in: [runtime/personify/wave-types.ts:214](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L214) - -Build one judge child's task from the shared artifact under review + the judge descriptor. - -#### Parameters - -##### artifact - -`Artifact` - -##### judge - -[`PanelJudge`](PanelJudge.md) - -##### ctx - -[`ShapeContext`](ShapeContext.md)\<`D`\> - -#### Returns - -`unknown` - -*** - -### merge() - -> **merge**(`verdicts`, `artifact`): [`Outcome`](../type-aliases/Outcome.md)\<`D`\> - -Defined in: [runtime/personify/wave-types.ts:220](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L220) - -Write-only merge: fold the M settled judge verdicts into the panel's terminal `Outcome`. -Pure over the drained settlements — it MUST NOT spawn, re-judge, or feed one verdict into -another. A panel that reached no quorum is a concrete blocker (fail loud, never a vacuous done). - -#### Parameters - -##### verdicts - -readonly [`PanelVerdict`](PanelVerdict.md)[] - -##### artifact - -`Artifact` - -#### Returns - -[`Outcome`](../type-aliases/Outcome.md)\<`D`\> diff --git a/docs/api/runtime/interfaces/PanelVerdict.md b/docs/api/runtime/interfaces/PanelVerdict.md deleted file mode 100644 index 2e15f4a..0000000 --- a/docs/api/runtime/interfaces/PanelVerdict.md +++ /dev/null @@ -1,48 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / PanelVerdict - -# Interface: PanelVerdict - -Defined in: [runtime/personify/wave-types.ts:233](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L233) - -One judge child's settled verdict, surfaced to the write-only `merge`. `down` judges carry no - verdict (excluded from the merge `n`, like an infra-errored cell). - -## Properties - -### judge - -> `readonly` **judge**: [`PanelJudge`](PanelJudge.md) - -Defined in: [runtime/personify/wave-types.ts:234](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L234) - -*** - -### verdict? - -> `readonly` `optional` **verdict?**: `DefaultVerdict` - -Defined in: [runtime/personify/wave-types.ts:235](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L235) - -*** - -### output? - -> `readonly` `optional` **output?**: `unknown` - -Defined in: [runtime/personify/wave-types.ts:237](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L237) - -The judge child's raw output — what it was asked to assess, for a merge that quotes it. - -*** - -### down - -> `readonly` **down**: `boolean` - -Defined in: [runtime/personify/wave-types.ts:239](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L239) - -True when the judge child went `down` (no usable verdict — kept out of the merge denominator). diff --git a/docs/api/runtime/interfaces/PatchDeliverableOptions.md b/docs/api/runtime/interfaces/PatchDeliverableOptions.md deleted file mode 100644 index e080363..0000000 --- a/docs/api/runtime/interfaces/PatchDeliverableOptions.md +++ /dev/null @@ -1,66 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / PatchDeliverableOptions - -# Interface: PatchDeliverableOptions - -Defined in: [runtime/supervise/patch-deliverable.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-deliverable.ts#L27) - -**`Experimental`** - -## Extends - -- [`CoderCheckConstraints`](CoderCheckConstraints.md) - -## Extended by - -- [`WorktreeFanoutOptions`](WorktreeFanoutOptions.md) - -## Properties - -### maxDiffLines? - -> `optional` **maxDiffLines?**: `number` - -Defined in: [runtime/supervise/patch-checks.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L38) - -**`Experimental`** - -Default 400. Hard cap; gate fails when exceeded. - -#### Inherited from - -[`CoderCheckConstraints`](CoderCheckConstraints.md).[`maxDiffLines`](CoderCheckConstraints.md#maxdifflines) - -*** - -### forbiddenPaths? - -> `optional` **forbiddenPaths?**: `string`[] - -Defined in: [runtime/supervise/patch-checks.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L40) - -**`Experimental`** - -Literal path prefixes the patch must not touch. - -#### Inherited from - -[`CoderCheckConstraints`](CoderCheckConstraints.md).[`forbiddenPaths`](CoderCheckConstraints.md#forbiddenpaths) - -*** - -### require? - -> `optional` **require?**: readonly (`"tests"` \| `"typecheck"`)[] - -Defined in: [runtime/supervise/patch-deliverable.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-deliverable.ts#L34) - -**`Experimental`** - -Which verification signals the gate REQUIRES to be present-and-passing. A required signal -that the artifact never derived (the command was not configured on the executor) fails the -gate closed. Unlisted signals default to passed-when-absent (the executor simply didn't run -that command). Default `[]` — gate on no-op / secret / forbidden / diff-size only. diff --git a/docs/api/runtime/interfaces/Persona.md b/docs/api/runtime/interfaces/Persona.md deleted file mode 100644 index c148a00..0000000 --- a/docs/api/runtime/interfaces/Persona.md +++ /dev/null @@ -1,105 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Persona - -# Interface: Persona\ - -Defined in: [runtime/personify/types.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L70) - -The "act like X" record. A thin composition over the keystone's `AgentSpec`: it pairs the -root spec (the executor mapping for the root agent the shape builds) with the CONTENT a -shape consumes — the goal framing (`directive`) and who the loop is acting as (`context`). - -The framework never reads `directive`/`context` semantically; it threads them to the shape -verbatim through `ShapeContext`. This is the rule the mandate names: the FRAMEWORK is -structure, the PERSONA carries model/prompt/tools/directive. No model name, prompt, or -persona string is ever hardcoded in a shape or the engine. - -`D` is the deliverable type this persona's loops produce; it flows into `Outcome`. - -## Type Parameters - -### D - -`D` = `unknown` - -## Properties - -### name - -> `readonly` **name**: `string` - -Defined in: [runtime/personify/types.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L72) - -Stable persona name — used as the trace/journal label root, never as content. - -*** - -### root - -> `readonly` **root**: [`AgentSpec`](AgentSpec.md) - -Defined in: [runtime/personify/types.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L78) - -The root agent's executor mapping (profile + harness + optional BYO executor). The -shape's root `Agent` carries THIS as its `executorSpec`; child specs the shape spawns -are derived from / resolved against the same persona registry (see `ShapeContext`). - -*** - -### directive - -> `readonly` **directive**: `string` - -Defined in: [runtime/personify/types.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L80) - -The goal framing handed to the shape — the "what to achieve", not "how". - -*** - -### context - -> `readonly` **context**: [`PersonaContext`](PersonaContext.md) - -Defined in: [runtime/personify/types.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L83) - -Who the loop is acting as — the opaque persona context blob the shape may inject into - child tasks. Opaque to the framework; only the persona's profiles/prompts interpret it. - -*** - -### executors - -> `readonly` **executors**: [`PersonaExecutors`](PersonaExecutors.md) - -Defined in: [runtime/personify/types.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L91) - -The executor seams (router endpoint+key, sandbox client, cli bin) the built-in runtimes -read off `ExecutorContext.seams`, OR a fully pre-configured registry. The supervisor -threads an EMPTY seam bag to the root scope, so a persona that uses built-in metered -runtimes MUST supply a registry whose factories close over their seams (or BYO executors -on each `AgentSpec`). Carried here so `runPersonified` can build `SupervisorOpts.executors`. - -*** - -### extensions? - -> `readonly` `optional` **extensions?**: `Readonly`\<`Record`\<`string`, `unknown`\>\> - -Defined in: [runtime/personify/types.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L96) - -Forward-compatible extension bag — a later world-model / memory / tool-budget field is an -additive key here, never a breaking change to the `Persona` shape. Opaque to the engine. - -*** - -### \_\_deliverable? - -> `readonly` `optional` **\_\_deliverable?**: `D` - -Defined in: [runtime/personify/types.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L99) - -Phantom: binds the persona to its deliverable type so `runPersonified` infers `D` from - the persona and the chosen shape must agree. Type-only — never present at runtime. diff --git a/docs/api/runtime/interfaces/PersonaContext.md b/docs/api/runtime/interfaces/PersonaContext.md deleted file mode 100644 index 17a40bf..0000000 --- a/docs/api/runtime/interfaces/PersonaContext.md +++ /dev/null @@ -1,38 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / PersonaContext - -# Interface: PersonaContext - -Defined in: [runtime/personify/types.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L104) - -The persona context blob — who the loop is acting as. Open by intent: a persona names its - own role/audience/constraints; the framework treats it as opaque content. - -## Indexable - -> \[`key`: `string`\]: `unknown` - -Open content bag — persona-specific fields a shape's child tasks may carry. - -## Properties - -### role - -> `readonly` **role**: `string` - -Defined in: [runtime/personify/types.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L106) - -The role the loop embodies ("senior staff engineer", "equity research analyst", …). - -*** - -### notes? - -> `readonly` `optional` **notes?**: `string` - -Defined in: [runtime/personify/types.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L108) - -Optional freeform framing the persona's prompts/profiles consume. diff --git a/docs/api/runtime/interfaces/PersonaExecutors.md b/docs/api/runtime/interfaces/PersonaExecutors.md deleted file mode 100644 index 4bc72c0..0000000 --- a/docs/api/runtime/interfaces/PersonaExecutors.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / PersonaExecutors - -# Interface: PersonaExecutors - -Defined in: [runtime/personify/types.ts:118](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L118) - -How a persona supplies executor resolution. Either a pre-built registry (factories already -closed over their seams) OR the raw seam bag the engine uses to construct a registry + -thread the seams onto each spawn. Exactly one is required — fail loud if neither is set. - -## Properties - -### registry? - -> `readonly` `optional` **registry?**: [`ExecutorRegistry`](ExecutorRegistry.md) - -Defined in: [runtime/personify/types.ts:120](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L120) - -A registry whose factories already capture their seams. Highest precedence. - -*** - -### seams? - -> `readonly` `optional` **seams?**: `Readonly`\<`Record`\<`string`, `unknown`\>\> - -Defined in: [runtime/personify/types.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L122) - -Raw seams to thread onto built-in runtimes (`router`/`sandbox`/`cli` keys). diff --git a/docs/api/runtime/interfaces/PipelineStage.md b/docs/api/runtime/interfaces/PipelineStage.md deleted file mode 100644 index 355d99f..0000000 --- a/docs/api/runtime/interfaces/PipelineStage.md +++ /dev/null @@ -1,92 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / PipelineStage - -# Interface: PipelineStage\ - -Defined in: [runtime/personify/wave-types.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L76) - -`pipeline(stages)` — sequential composition: each stage's `Outcome.deliverable` feeds the next -stage's task (via `feed`). The first `blocked` stage short-circuits the whole pipeline (its -blockers ARE the pipeline's blockers — never coerced past a failed stage). The terminal -stage's `done` deliverable is the pipeline's deliverable. Spawns one child per stage in order; -a stage that the conserved pool cannot admit is a concrete blocker. - -No domain: "code build test" is `pipeline([plan, implement, integrate])` under a coder persona, -not a named shape. A stage names only its label + how to derive its task from the prior output. - -## Type Parameters - -### Task - -`Task` - -### StepIn - -`StepIn` - -### StepOut - -`StepOut` - -## Properties - -### label - -> `readonly` **label**: `string` - -Defined in: [runtime/personify/wave-types.ts:78](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L78) - -Trace/journal label for this stage's spawned child. - -## Methods - -### feed() - -> **feed**(`prior`, `ctx`, `rootTask`): `unknown` - -Defined in: [runtime/personify/wave-types.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L81) - -Derive this stage's task from the prior stage's deliverable (or the root task for stage 0). - Pure projection — the framework never interprets the result; the resolved leaf does. - -#### Parameters - -##### prior - -`StepIn` - -##### ctx - -[`ShapeContext`](ShapeContext.md)\<`unknown`\> - -##### rootTask - -`Task` - -#### Returns - -`unknown` - -*** - -### collect() - -> **collect**(`settled`): [`Outcome`](../type-aliases/Outcome.md)\<`StepOut`\> - -Defined in: [runtime/personify/wave-types.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L84) - -Read this stage's settled child output into the typed `StepOut` the next stage feeds on. - Fail loud (return a `blocked`) when the child produced nothing usable for the next stage. - -#### Parameters - -##### settled - -[`Settled`](../type-aliases/Settled.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`StepOut`\>\> - -#### Returns - -[`Outcome`](../type-aliases/Outcome.md)\<`StepOut`\> diff --git a/docs/api/runtime/interfaces/PromotionGateOptions.md b/docs/api/runtime/interfaces/PromotionGateOptions.md deleted file mode 100644 index 304e379..0000000 --- a/docs/api/runtime/interfaces/PromotionGateOptions.md +++ /dev/null @@ -1,111 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / PromotionGateOptions - -# Interface: PromotionGateOptions - -Defined in: [runtime/promotion-gate.ts:13](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L13) - -## Properties - -### report - -> **report**: [`BenchmarkReport`](BenchmarkReport.md) - -Defined in: [runtime/promotion-gate.ts:15](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L15) - -The HOLDOUT report — must carry per-task cells for both strategy names. - -*** - -### incumbent - -> **incumbent**: `string` - -Defined in: [runtime/promotion-gate.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L17) - -The incumbent champion's strategy name. - -*** - -### candidate - -> **candidate**: `string` - -Defined in: [runtime/promotion-gate.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L19) - -The challenger's strategy name. - -*** - -### mode? - -> `optional` **mode?**: `"superiority"` \| `"non-inferiority"` - -Defined in: [runtime/promotion-gate.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L24) - -'superiority' (default): the candidate must score significantly BETTER. - 'non-inferiority': the candidate must prove its score is not worse than the - incumbent by more than `scoreTolerance` AND its cost savings are significant — - the gate for "same quality, cheaper" claims. - -*** - -### scoreTolerance? - -> `optional` **scoreTolerance?**: `number` - -Defined in: [runtime/promotion-gate.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L26) - -non-inferiority: the score CI lower bound must clear −scoreTolerance. Default 0.05. - -*** - -### deltaThreshold? - -> `optional` **deltaThreshold?**: `number` - -Defined in: [runtime/promotion-gate.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L28) - -The CI lower bound on the paired lift must EXCEED this (score scale). Default 0. - -*** - -### minPairedTasks? - -> `optional` **minPairedTasks?**: `number` - -Defined in: [runtime/promotion-gate.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L31) - -Minimum paired tasks before significance can be claimed. Default 6 — below that - the bootstrap CI is too wide to separate a real lift from the per-task noise. - -*** - -### statistic? - -> `optional` **statistic?**: `"mean"` \| `"median"` - -Defined in: [runtime/promotion-gate.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L33) - -Bootstrap statistic over the paired deltas. Default 'mean'. - -*** - -### seed? - -> `optional` **seed?**: `number` - -Defined in: [runtime/promotion-gate.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L35) - -Fixed by the substrate by default — the same report always yields the same verdict. - -*** - -### resamples? - -> `optional` **resamples?**: `number` - -Defined in: [runtime/promotion-gate.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L36) diff --git a/docs/api/runtime/interfaces/PromotionVerdict.md b/docs/api/runtime/interfaces/PromotionVerdict.md deleted file mode 100644 index aa5aa1c..0000000 --- a/docs/api/runtime/interfaces/PromotionVerdict.md +++ /dev/null @@ -1,124 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / PromotionVerdict - -# Interface: PromotionVerdict - -Defined in: [runtime/promotion-gate.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L39) - -## Properties - -### promoted - -> **promoted**: `boolean` - -Defined in: [runtime/promotion-gate.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L40) - -*** - -### reason - -> **reason**: `"identical-champion"` \| `"few-tasks"` \| `"no-margin"` \| `"significant"` \| `"non-inferior-and-cheaper"` \| `"non-inferiority-unproven"` \| `"not-cheaper"` - -Defined in: [runtime/promotion-gate.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L41) - -*** - -### mode - -> **mode**: `"superiority"` \| `"non-inferiority"` - -Defined in: [runtime/promotion-gate.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L49) - -*** - -### n - -> **n**: `number` - -Defined in: [runtime/promotion-gate.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L51) - -Paired tasks that carried both strategies' cells. - -*** - -### lift - -> **lift**: `object` - -Defined in: [runtime/promotion-gate.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L53) - -Paired (candidate − incumbent) lift across the holdout tasks. - -#### mean - -> **mean**: `number` - -#### median - -> **median**: `number` - -#### low - -> **low**: `number` - -#### high - -> **high**: `number` - -*** - -### costSavings? - -> `optional` **costSavings?**: `object` - -Defined in: [runtime/promotion-gate.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L56) - -non-inferiority mode: paired (incumbent − candidate) cost SAVINGS per task (usd) — - positive means the candidate is cheaper; significant iff the CI low clears zero. - -#### mean - -> **mean**: `number` - -#### median - -> **median**: `number` - -#### low - -> **low**: `number` - -#### high - -> **high**: `number` - -*** - -### latency? - -> `optional` **latency?**: `object` - -Defined in: [runtime/promotion-gate.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/promotion-gate.ts#L60) - -Paired (candidate − incumbent) wall-clock per task (ms) — negative = the candidate - is FASTER. Informational in every mode (never gates); the latency answer to "what - does this win actually cost the user?". - -#### mean - -> **mean**: `number` - -#### median - -> **median**: `number` - -#### low - -> **low**: `number` - -#### high - -> **high**: `number` diff --git a/docs/api/runtime/interfaces/PublishOptions.md b/docs/api/runtime/interfaces/PublishOptions.md deleted file mode 100644 index 80d7381..0000000 --- a/docs/api/runtime/interfaces/PublishOptions.md +++ /dev/null @@ -1,32 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / PublishOptions - -# Interface: PublishOptions - -Defined in: [runtime/supervise/event-bus.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L39) - -## Properties - -### priority? - -> `readonly` `optional` **priority?**: `number` - -Defined in: [runtime/supervise/event-bus.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L42) - -Higher = pulled ahead of lower-priority queued events (default 0). A blocking question sets - this so it bumps to the front of the driver's inbox. - -*** - -### queue? - -> `readonly` `optional` **queue?**: `boolean` - -Defined in: [runtime/supervise/event-bus.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/event-bus.ts#L46) - -Whether the event enters the pull queue (default true). Set `false` for record-only events — - the parent→child down-leg (steer / answer / resume): they belong in `history()` and reach - `subscribe` observers, but the parent must never `pull` its own outbound message back. diff --git a/docs/api/runtime/interfaces/RegistryAnalyzeProjection.md b/docs/api/runtime/interfaces/RegistryAnalyzeProjection.md deleted file mode 100644 index ca92dc7..0000000 --- a/docs/api/runtime/interfaces/RegistryAnalyzeProjection.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / RegistryAnalyzeProjection - -# Interface: RegistryAnalyzeProjection - -Defined in: [runtime/personify/analyst.ts:183](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L183) - -Project a `ScopeAnalyzeInput` into the `AnalystRegistry.run` arguments. The registry runs over a -`runId` + `AnalystRunInputs` (a trace store / run record / artifact dir), NOT in-memory scope -settlements — so the CALLER owns the projection from the combinator's drained children to the -registry's inputs (e.g. the trace store the run already wrote). This adapter never invents that -bridge; it only runs the projected inputs and firewalls the merged findings. - -## Properties - -### runId - -> `readonly` **runId**: `string` - -Defined in: [runtime/personify/analyst.ts:184](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L184) - -*** - -### inputs - -> `readonly` **inputs**: `AnalystRunInputs` - -Defined in: [runtime/personify/analyst.ts:185](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L185) - -*** - -### opts? - -> `readonly` `optional` **opts?**: `object` - -Defined in: [runtime/personify/analyst.ts:187](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L187) - -Optional `run` opts (e.g. `priorFindings`) forwarded verbatim to the registry. - -#### Index Signature - -\[`k`: `string`\]: `unknown` - -#### priorFindings? - -> `optional` **priorFindings?**: readonly `AnalystFinding`[] \| `Record`\<`string`, readonly `AnalystFinding`[]\> diff --git a/docs/api/runtime/interfaces/RenderCorpusToInstructionsOptions.md b/docs/api/runtime/interfaces/RenderCorpusToInstructionsOptions.md deleted file mode 100644 index b098a5e..0000000 --- a/docs/api/runtime/interfaces/RenderCorpusToInstructionsOptions.md +++ /dev/null @@ -1,66 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / RenderCorpusToInstructionsOptions - -# Interface: RenderCorpusToInstructionsOptions - -Defined in: [runtime/personify/wave-types.ts:478](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L478) - -Project accreted corpus facts into an `AgentProfile`'s instruction seams — the learning-flywheel -READ side. Reads the corpus through `filter`, renders the matching facts into instruction lines, -and returns a NEW profile with them merged into `prompt.instructions` (the append-line seam) so -the next run's persona reads the accreted world-model. Pure projection over the queried records; -never mutates the input profile (returns a fresh one). The impl lives in `corpus.ts`. - -`resources.instructions` is `string | AgentProfileResourceRef`; `prompt.instructions` is -`string[]`. The render targets `prompt.instructions` (additive lines) by default; a caller that -wants the single-blob `resources.instructions` form passes `target: 'resources'`. - -## Properties - -### corpus - -> `readonly` **corpus**: [`Corpus`](Corpus.md) - -Defined in: [runtime/personify/wave-types.ts:479](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L479) - -*** - -### filter - -> `readonly` **filter**: [`CorpusFilter`](CorpusFilter.md) - -Defined in: [runtime/personify/wave-types.ts:480](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L480) - -*** - -### profile - -> `readonly` **profile**: `AgentProfile` - -Defined in: [runtime/personify/wave-types.ts:482](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L482) - -The profile to project the facts into. The result is a fresh profile — the input is unchanged. - -*** - -### target? - -> `readonly` `optional` **target?**: `"resources"` \| `"prompt"` - -Defined in: [runtime/personify/wave-types.ts:485](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L485) - -Where the rendered facts land: appended to `prompt.instructions[]` (default) or folded into - the single-blob `resources.instructions` string. - -*** - -### maxLines? - -> `readonly` `optional` **maxLines?**: `number` - -Defined in: [runtime/personify/wave-types.ts:487](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L487) - -Optional cap on rendered lines (most-confident first), independent of the query `limit`. diff --git a/docs/api/runtime/interfaces/ReservationTicket.md b/docs/api/runtime/interfaces/ReservationTicket.md deleted file mode 100644 index 21bf059..0000000 --- a/docs/api/runtime/interfaces/ReservationTicket.md +++ /dev/null @@ -1,40 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ReservationTicket - -# Interface: ReservationTicket - -Defined in: [runtime/supervise/budget.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L29) - -Opaque, single-use reservation handle returned by `reserve` and consumed by - `reconcile`. Carries the reserved ceilings so reconciliation needs no lookup. - -## Properties - -### id - -> `readonly` **id**: `number` - -Defined in: [runtime/supervise/budget.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L30) - -*** - -### reserved - -> `readonly` **reserved**: `object` - -Defined in: [runtime/supervise/budget.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L31) - -#### tokens - -> `readonly` **tokens**: `number` - -#### usd - -> `readonly` **usd**: `number` - -#### iterations - -> `readonly` **iterations**: `number` diff --git a/docs/api/runtime/interfaces/ResultBlobStore.md b/docs/api/runtime/interfaces/ResultBlobStore.md deleted file mode 100644 index 4a26f0f..0000000 --- a/docs/api/runtime/interfaces/ResultBlobStore.md +++ /dev/null @@ -1,53 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ResultBlobStore - -# Interface: ResultBlobStore - -Defined in: [runtime/supervise/types.ts:415](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L415) - -Content-addressed result blobs (the `outRef` → artifact map) backing the replay - invariant. Split from the journal so the journal stays small (decisions) and the - payloads (evidence) live where a viewer/replayer rehydrates them. - -## Methods - -### put() - -> **put**(`outRef`, `artifact`): `Promise`\<`void`\> - -Defined in: [runtime/supervise/types.ts:416](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L416) - -#### Parameters - -##### outRef - -`string` - -##### artifact - -`unknown` - -#### Returns - -`Promise`\<`void`\> - -*** - -### get() - -> **get**(`outRef`): `Promise`\<`unknown`\> - -Defined in: [runtime/supervise/types.ts:417](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L417) - -#### Parameters - -##### outRef - -`string` - -#### Returns - -`Promise`\<`unknown`\> diff --git a/docs/api/runtime/interfaces/RootHandle.md b/docs/api/runtime/interfaces/RootHandle.md deleted file mode 100644 index a6034b5..0000000 --- a/docs/api/runtime/interfaces/RootHandle.md +++ /dev/null @@ -1,77 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / RootHandle - -# Interface: RootHandle\ - -Defined in: [runtime/supervise/types.ts:481](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L481) - -Live root handle — the substrate a chat/pi-viz client attaches to (Q2). `signal` - delivers an out-of-band message to the running root; `view()` materializes the tree. - -## Type Parameters - -### Out - -`Out` - -## Properties - -### \_\_out? - -> `readonly` `optional` **\_\_out?**: `Out` - -Defined in: [runtime/supervise/types.ts:487](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L487) - -Phantom: binds the handle to the supervised run's output type. Type-only — never - present at runtime; lets `attach(h: RootHandle)` stay output-typed. - -## Methods - -### view() - -> **view**(): [`TreeView`](TreeView.md) - -Defined in: [runtime/supervise/types.ts:482](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L482) - -#### Returns - -[`TreeView`](TreeView.md) - -*** - -### signal() - -> **signal**(`msg`): `void` - -Defined in: [runtime/supervise/types.ts:483](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L483) - -#### Parameters - -##### msg - -[`RootSignal`](../type-aliases/RootSignal.md) - -#### Returns - -`void` - -*** - -### abort() - -> **abort**(`reason?`): `void` - -Defined in: [runtime/supervise/types.ts:484](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L484) - -#### Parameters - -##### reason? - -`string` - -#### Returns - -`void` diff --git a/docs/api/runtime/interfaces/RouterChatResult.md b/docs/api/runtime/interfaces/RouterChatResult.md deleted file mode 100644 index 3b90695..0000000 --- a/docs/api/runtime/interfaces/RouterChatResult.md +++ /dev/null @@ -1,45 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / RouterChatResult - -# Interface: RouterChatResult - -Defined in: [runtime/router-client.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L21) - -## Properties - -### content - -> **content**: `string` - -Defined in: [runtime/router-client.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L22) - -*** - -### usage? - -> `optional` **usage?**: `object` - -Defined in: [runtime/router-client.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L24) - -REAL usage, or undefined when the provider reported none. - -#### input - -> **input**: `number` - -#### output - -> **output**: `number` - -*** - -### costUsd? - -> `optional` **costUsd?**: `number` - -Defined in: [runtime/router-client.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L26) - -Derived from usage via `estimateCost` when the model is priced; else undefined. diff --git a/docs/api/runtime/interfaces/RouterChatToolsResult.md b/docs/api/runtime/interfaces/RouterChatToolsResult.md deleted file mode 100644 index e96f3d4..0000000 --- a/docs/api/runtime/interfaces/RouterChatToolsResult.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / RouterChatToolsResult - -# Interface: RouterChatToolsResult - -Defined in: [runtime/router-client.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L103) - -## Properties - -### content - -> **content**: `string` \| `null` - -Defined in: [runtime/router-client.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L104) - -*** - -### toolCalls - -> **toolCalls**: [`RouterToolCall`](RouterToolCall.md)[] - -Defined in: [runtime/router-client.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L105) - -*** - -### usage? - -> `optional` **usage?**: `object` - -Defined in: [runtime/router-client.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L106) - -#### input - -> **input**: `number` - -#### output - -> **output**: `number` - -*** - -### costUsd? - -> `optional` **costUsd?**: `number` - -Defined in: [runtime/router-client.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L107) diff --git a/docs/api/runtime/interfaces/RouterConfig.md b/docs/api/runtime/interfaces/RouterConfig.md deleted file mode 100644 index aee1750..0000000 --- a/docs/api/runtime/interfaces/RouterConfig.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / RouterConfig - -# Interface: RouterConfig - -Defined in: [runtime/router-client.ts:15](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L15) - -## Properties - -### routerBaseUrl - -> **routerBaseUrl**: `string` - -Defined in: [runtime/router-client.ts:16](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L16) - -*** - -### routerKey - -> **routerKey**: `string` - -Defined in: [runtime/router-client.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L17) - -*** - -### model - -> **model**: `string` - -Defined in: [runtime/router-client.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L18) diff --git a/docs/api/runtime/interfaces/RouterSeam.md b/docs/api/runtime/interfaces/RouterSeam.md deleted file mode 100644 index 8420a3a..0000000 --- a/docs/api/runtime/interfaces/RouterSeam.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / RouterSeam - -# Interface: RouterSeam - -Defined in: [runtime/supervise/runtime.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L66) - -Router/inline connection seam. A direct OpenAI-compatible Router endpoint — -the cheapest leaf, no box, no tools. `model` overrides the profile's model -hint when present; otherwise the profile's `model.default` is required. - -## Properties - -### routerBaseUrl - -> **routerBaseUrl**: `string` - -Defined in: [runtime/supervise/runtime.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L67) - -*** - -### routerKey - -> **routerKey**: `string` - -Defined in: [runtime/supervise/runtime.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L68) - -*** - -### model? - -> `optional` **model?**: `string` - -Defined in: [runtime/supervise/runtime.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L69) diff --git a/docs/api/runtime/interfaces/RouterToolCall.md b/docs/api/runtime/interfaces/RouterToolCall.md deleted file mode 100644 index 0302780..0000000 --- a/docs/api/runtime/interfaces/RouterToolCall.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / RouterToolCall - -# Interface: RouterToolCall - -Defined in: [runtime/router-client.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L96) - -A tool-call the model emitted (provider-neutral; mirrors the runtime's ToolCallRequest). - -## Properties - -### id - -> **id**: `string` - -Defined in: [runtime/router-client.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L97) - -*** - -### name - -> **name**: `string` - -Defined in: [runtime/router-client.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L98) - -*** - -### arguments - -> **arguments**: `string` - -Defined in: [runtime/router-client.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L100) - -Raw JSON arguments string as emitted by the model. diff --git a/docs/api/runtime/interfaces/RouterToolLoopResult.md b/docs/api/runtime/interfaces/RouterToolLoopResult.md deleted file mode 100644 index 9ea4d85..0000000 --- a/docs/api/runtime/interfaces/RouterToolLoopResult.md +++ /dev/null @@ -1,87 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / RouterToolLoopResult - -# Interface: RouterToolLoopResult - -Defined in: [runtime/router-client.ts:181](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L181) - -## Properties - -### final - -> **final**: `string` - -Defined in: [runtime/router-client.ts:183](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L183) - -The model's final assistant text (the turn where it stopped calling tools, or the budget turn). - -*** - -### turns - -> **turns**: `number` - -Defined in: [runtime/router-client.ts:185](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L185) - -Inference turns spent (≤ maxTurns) — the equal-budget unit vs random@k. - -*** - -### toolCalls - -> **toolCalls**: `number` - -Defined in: [runtime/router-client.ts:186](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L186) - -*** - -### toolTrace - -> **toolTrace**: `object`[] - -Defined in: [runtime/router-client.ts:189](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L189) - -The behavior trace: each tool call + its result, in order. What a trace-analyst - steerer reads (behavior, never the verdict) to diagnose + redirect the next shot. - -#### name - -> **name**: `string` - -#### args - -> **args**: `string` - -#### result - -> **result**: `string` - -*** - -### usage - -> **usage**: `object` - -Defined in: [runtime/router-client.ts:190](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L190) - -#### input - -> **input**: `number` - -#### output - -> **output**: `number` - -*** - -### messages - -> **messages**: `Record`\<`string`, `unknown`\>[] - -Defined in: [runtime/router-client.ts:193](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L193) - -The full conversation after the loop (seed + every assistant/tool turn). Lets a caller - CARRY the messages into the next shot (depth continuation) and read the trajectory. diff --git a/docs/api/runtime/interfaces/RouterToolsSeam.md b/docs/api/runtime/interfaces/RouterToolsSeam.md deleted file mode 100644 index 8d8f527..0000000 --- a/docs/api/runtime/interfaces/RouterToolsSeam.md +++ /dev/null @@ -1,119 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / RouterToolsSeam - -# Interface: RouterToolsSeam - -Defined in: [runtime/supervise/runtime.ts:254](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L254) - -Router seam WITH tool use — the tool-using router backend. Same direct -OpenAI-compatible endpoint as `RouterSeam`, but each turn passes `tools`; when -the model emits tool_calls they run via `executeToolCall` ON THIS HOST and the -results fold back as `tool` messages, repeating until the model answers without -a tool or `maxTurns` is hit. A real agentic loop, OFF-BOX — no sandbox, so it -is unaffected by a box's egress allowlist. One turn = one completion = the -equal-compute unit. `executeToolCall` receives the task so per-task tool -surfaces (e.g. a gym keyed by task) can dispatch correctly. - -## Properties - -### routerBaseUrl - -> **routerBaseUrl**: `string` - -Defined in: [runtime/supervise/runtime.ts:255](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L255) - -*** - -### routerKey - -> **routerKey**: `string` - -Defined in: [runtime/supervise/runtime.ts:256](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L256) - -*** - -### model? - -> `optional` **model?**: `string` - -Defined in: [runtime/supervise/runtime.ts:257](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L257) - -*** - -### tools - -> **tools**: readonly [`ToolSpec`](ToolSpec.md)[] - -Defined in: [runtime/supervise/runtime.ts:258](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L258) - -*** - -### executeToolCall - -> **executeToolCall**: (`name`, `args`, `task`) => `Promise`\<`string`\> - -Defined in: [runtime/supervise/runtime.ts:259](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L259) - -#### Parameters - -##### name - -`string` - -##### args - -`Record`\<`string`, `unknown`\> - -##### task - -`unknown` - -#### Returns - -`Promise`\<`string`\> - -*** - -### onToolStep? - -> `optional` **onToolStep?**: (`step`) => `void` - -Defined in: [runtime/supervise/runtime.ts:262](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L262) - -Online observer of each tool step — the seam a `DetectorMonitor` taps to watch the live pipe - (raise a `finding` when the worker loops/errors). Called after every tool call resolves. - -#### Parameters - -##### step - -###### toolName - -`string` - -###### args - -`Record`\<`string`, `unknown`\> - -###### status - -`"error"` \| `"ok"` - -#### Returns - -`void` - -*** - -### maxTurns? - -> `optional` **maxTurns?**: `number` - -Defined in: [runtime/supervise/runtime.ts:270](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L270) - -Max inference turns. Default 200 (runaway backstop — set far above any - legitimate workflow). For tighter per-workflow limits use a cost budget - or wall-clock deadline at the call site. diff --git a/docs/api/runtime/interfaces/RunAgenticOptions.md b/docs/api/runtime/interfaces/RunAgenticOptions.md deleted file mode 100644 index 1ec7d82..0000000 --- a/docs/api/runtime/interfaces/RunAgenticOptions.md +++ /dev/null @@ -1,215 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / RunAgenticOptions - -# Interface: RunAgenticOptions - -Defined in: [runtime/strategy.ts:965](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L965) - -## Extends - -- [`AgenticOptions`](AgenticOptions.md) - -## Properties - -### routerBaseUrl - -> **routerBaseUrl**: `string` - -Defined in: [runtime/strategy.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L86) - -#### Inherited from - -[`AgenticOptions`](AgenticOptions.md).[`routerBaseUrl`](AgenticOptions.md#routerbaseurl) - -*** - -### routerKey - -> **routerKey**: `string` - -Defined in: [runtime/strategy.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L87) - -#### Inherited from - -[`AgenticOptions`](AgenticOptions.md).[`routerKey`](AgenticOptions.md#routerkey) - -*** - -### model - -> **model**: `string` - -Defined in: [runtime/strategy.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L88) - -#### Inherited from - -[`AgenticOptions`](AgenticOptions.md).[`model`](AgenticOptions.md#model) - -*** - -### temperature? - -> `optional` **temperature?**: `number` - -Defined in: [runtime/strategy.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L89) - -#### Inherited from - -[`AgenticOptions`](AgenticOptions.md).[`temperature`](AgenticOptions.md#temperature) - -*** - -### maxTokens? - -> `optional` **maxTokens?**: `number` - -Defined in: [runtime/strategy.ts:92](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L92) - -Completion cap per worker turn — REQUIRED for thinking models (they burn unbounded - budgets on reasoning and return empty content without it). Omitted ⇒ provider default. - -#### Inherited from - -[`AgenticOptions`](AgenticOptions.md).[`maxTokens`](AgenticOptions.md#maxtokens) - -*** - -### innerTurns? - -> `optional` **innerTurns?**: `number` - -Defined in: [runtime/strategy.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L94) - -Turns the agent may take within ONE shot before the driver intervenes. - -#### Inherited from - -[`AgenticOptions`](AgenticOptions.md).[`innerTurns`](AgenticOptions.md#innerturns) - -*** - -### analystInstruction? - -> `optional` **analystInstruction?**: `string` - -Defined in: [runtime/strategy.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L97) - -The depth STEERER's analyst instruction (observe()'s system prompt). The knob a - prompt optimizer (GEPA) tunes — the analyst IS the steerer. Omitted ⇒ the default. - -#### Inherited from - -[`AgenticOptions`](AgenticOptions.md).[`analystInstruction`](AgenticOptions.md#analystinstruction) - -*** - -### analystModel? - -> `optional` **analystModel?**: `string` - -Defined in: [runtime/strategy.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L100) - -The critic's model — lets the analyst be a stronger (or cheaper) model than the - worker. Omitted ⇒ the worker's `model`. - -#### Inherited from - -[`AgenticOptions`](AgenticOptions.md).[`analystModel`](AgenticOptions.md#analystmodel) - -*** - -### corpus? - -> `optional` **corpus?**: [`Corpus`](Corpus.md) - -Defined in: [runtime/strategy.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L104) - -Across-run learning: when set, the analyst's observe() pass appends trace-derived - facts here (the flywheel write side). Priming (the read side) is the caller's move — - query the corpus and fold facts into the task's systemPrompt before runAgentic. - -#### Inherited from - -[`AgenticOptions`](AgenticOptions.md).[`corpus`](AgenticOptions.md#corpus) - -*** - -### corpusTags? - -> `optional` **corpusTags?**: `string`[] - -Defined in: [runtime/strategy.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L106) - -Tags written onto learned facts (and used by the caller's priming query). - -#### Inherited from - -[`AgenticOptions`](AgenticOptions.md).[`corpusTags`](AgenticOptions.md#corpustags) - -*** - -### surface - -> **surface**: [`AgenticSurface`](AgenticSurface.md) - -Defined in: [runtime/strategy.ts:966](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L966) - -*** - -### task - -> **task**: [`AgenticTask`](AgenticTask.md) - -Defined in: [runtime/strategy.ts:967](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L967) - -*** - -### hooks? - -> `optional` **hooks?**: [`RuntimeHooks`](../../index/interfaces/RuntimeHooks.md) - -Defined in: [runtime/strategy.ts:970](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L970) - -Lifecycle observability — every spawn/settle (shots, analysts) streams here live. - The seam online watchdogs/route-auditors subscribe to. - -*** - -### strategy? - -> `optional` **strategy?**: [`Strategy`](Strategy.md) - -Defined in: [runtime/strategy.ts:972](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L972) - -A Strategy (the open way) — author/pass your own. Overrides `mode` when present. - -*** - -### mode? - -> `optional` **mode?**: `"depth"` \| `"breadth"` - -Defined in: [runtime/strategy.ts:974](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L974) - -Built-in shorthand: 'depth'→refine, 'breadth'→sample. Default 'depth'. - -*** - -### budget - -> **budget**: `number` - -Defined in: [runtime/strategy.ts:976](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L976) - -budget: refine→max shots; sample→rollout width. - -*** - -### rootBudget? - -> `optional` **rootBudget?**: [`Budget`](Budget.md) - -Defined in: [runtime/strategy.ts:977](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L977) diff --git a/docs/api/runtime/interfaces/RunLoopOptions.md b/docs/api/runtime/interfaces/RunLoopOptions.md deleted file mode 100644 index 4a7db49..0000000 --- a/docs/api/runtime/interfaces/RunLoopOptions.md +++ /dev/null @@ -1,231 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / RunLoopOptions - -# Interface: RunLoopOptions\ - -Defined in: [runtime/run-loop.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L69) - -**`Experimental`** - -## Type Parameters - -### Task - -`Task` - -### Output - -`Output` - -### Decision - -`Decision` - -## Properties - -### driver - -> **driver**: [`Driver`](Driver.md)\<`Task`, `Output`, `Decision`\> - -Defined in: [runtime/run-loop.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L70) - -**`Experimental`** - -*** - -### agentRun? - -> `optional` **agentRun?**: [`AgentRunSpec`](AgentRunSpec.md)\<`Task`\> - -Defined in: [runtime/run-loop.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L75) - -**`Experimental`** - -Single agent spec — every iteration uses this profile. Mutually -exclusive with `agentRuns`. - -*** - -### agentRuns? - -> `optional` **agentRuns?**: [`AgentRunSpec`](AgentRunSpec.md)\<`Task`\>[] - -Defined in: [runtime/run-loop.ts:81](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L81) - -**`Experimental`** - -Multiple specs for heterogeneous fanout. The kernel round-robins -through them when the driver plans N tasks. Mutually exclusive with -`agentRun`. - -*** - -### output - -> **output**: [`OutputAdapter`](OutputAdapter.md)\<`Output`\> - -Defined in: [runtime/run-loop.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L82) - -**`Experimental`** - -*** - -### validator? - -> `optional` **validator?**: [`Validator`](Validator.md)\<`Output`, `DefaultVerdict`\> - -Defined in: [runtime/run-loop.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L83) - -**`Experimental`** - -*** - -### task - -> **task**: `Task` - -Defined in: [runtime/run-loop.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L84) - -**`Experimental`** - -*** - -### ctx - -> **ctx**: [`ExecCtx`](ExecCtx.md) - -Defined in: [runtime/run-loop.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L85) - -**`Experimental`** - -*** - -### maxIterations? - -> `optional` **maxIterations?**: `number` - -Defined in: [runtime/run-loop.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L87) - -**`Experimental`** - -Default 10. Hard cap on total iterations across all `plan()` rounds. - -*** - -### maxConcurrency? - -> `optional` **maxConcurrency?**: `number` - -Defined in: [runtime/run-loop.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L89) - -**`Experimental`** - -Default 4. In-flight worker cap within a single `plan()` batch. - -*** - -### runId? - -> `optional` **runId?**: `string` - -Defined in: [runtime/run-loop.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L94) - -**`Experimental`** - -Pre-allocated id for trace correlation. Default = `loop-${random}`. -Surfaces as `runId` on every emitted `LoopTraceEvent`. - -*** - -### now? - -> `optional` **now?**: () => `number` - -Defined in: [runtime/run-loop.ts:99](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L99) - -**`Experimental`** - -Clock override; default `Date.now`. Deterministic tests pass a -monotonic counter to stabilize iteration timing fields. - -#### Returns - -`number` - -*** - -### selectWinner? - -> `optional` **selectWinner?**: (`iterations`) => [`LoopWinner`](LoopWinner.md)\<`Task`, `Output`\> \| `undefined` - -Defined in: [runtime/run-loop.ts:104](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L104) - -**`Experimental`** - -Override the default winner selector (highest-valid-score, ties broken -by earliest iteration). - -#### Parameters - -##### iterations - -[`Iteration`](Iteration.md)\<`Task`, `Output`\>[] - -#### Returns - -[`LoopWinner`](LoopWinner.md)\<`Task`, `Output`\> \| `undefined` - -*** - -### onWorkerBox? - -> `optional` **onWorkerBox?**: (`box`) => `void` - -Defined in: [runtime/run-loop.ts:119](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L119) - -**`Experimental`** - -Same-sandbox driver mode — a kernel→caller out-channel, not a value handed -in. When set, the kernel keeps each finished worker box alive across the -`plan()` boundary and hands it here, so a same-sandbox planner -(one that reuses the worker's box) can stream its move INTO the -worker's live box — steering from the worker's real filesystem and state, -not just a history summary. The kernel owns teardown: every box kept alive -this way is destroyed at loop end (and the callback is invoked with -`undefined` then as a teardown sentinel). Without it, worker boxes are torn -down per-iteration (default) and a same-sandbox planner has nothing to -reuse. Intended for single-worker (refine) loops: under fanout every box is -still kept for teardown, but only the last-finishing box is handed here, so -a planner sees an arbitrary branch's filesystem — pair it with refine. - -#### Parameters - -##### box - -`SandboxInstance` \| `undefined` - -#### Returns - -`void` - -*** - -### lineage? - -> `optional` **lineage?**: [`LoopLineageOptions`](LoopLineageOptions.md) - -Defined in: [runtime/run-loop.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-loop.ts#L131) - -**`Experimental`** - -Opt-in box-lineage controls. Default OFF — unset means every iteration -acquires a fresh box, streams once, and tears it down (today's behavior, -byte-identical). With `sessionContinuity` on, a refine round continues the -parent iteration's session on its live box; with `forkFanout` on (and a -fork-capable platform), a fanout round forks the parent's checkpoint so the -branches share a context prefix. The lineage owns every box it starts or -forks and tears them all down at loop end — so these paths are mutually -exclusive with `onWorkerBox`, which claims the same box-ownership channel. diff --git a/docs/api/runtime/interfaces/RunPersonifiedOptions.md b/docs/api/runtime/interfaces/RunPersonifiedOptions.md deleted file mode 100644 index a970f34..0000000 --- a/docs/api/runtime/interfaces/RunPersonifiedOptions.md +++ /dev/null @@ -1,179 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / RunPersonifiedOptions - -# Interface: RunPersonifiedOptions\ - -Defined in: [runtime/personify/types.ts:222](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L222) - -The end-to-end entrypoint. Builds the persona's root `Agent` from the chosen shape, then -runs it through a fresh `createSupervisor` over the persona's executors + the supplied -budget/journal/blobs. Returns the keystone's typed `SupervisedResult>` — a -`winner` carries the synthesized `Outcome`; a `no-winner` is never coerced into one. - -`shape` is either a resolved `LoopShape` or a registered shape NAME (resolved through the -default registry). The journal/blobs default to in-memory impls in the engine when omitted -(durable FS impls are passed explicitly for a persisted run). - -## Type Parameters - -### Task - -`Task` - -### D - -`D` - -## Properties - -### persona - -> `readonly` **persona**: [`Persona`](Persona.md)\<`D`\> - -Defined in: [runtime/personify/types.ts:223](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L223) - -*** - -### shape - -> `readonly` **shape**: `string` \| [`LoopShape`](../type-aliases/LoopShape.md)\<`Task`, `D`\> - -Defined in: [runtime/personify/types.ts:225](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L225) - -A resolved shape factory OR a registered shape name. - -*** - -### task - -> `readonly` **task**: `Task` - -Defined in: [runtime/personify/types.ts:226](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L226) - -*** - -### budget - -> `readonly` **budget**: [`Budget`](Budget.md) - -Defined in: [runtime/personify/types.ts:227](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L227) - -*** - -### shapeBudget? - -> `readonly` `optional` **shapeBudget?**: `Partial`\<[`ShapeBudget`](ShapeBudget.md)\> - -Defined in: [runtime/personify/types.ts:229](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L229) - -Per-child sizing + fanout width handed to the shape. Defaults derive from `budget`. - -*** - -### runId? - -> `readonly` `optional` **runId?**: `string` - -Defined in: [runtime/personify/types.ts:231](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L231) - -Trace/journal root key. Defaults to the persona name + a run discriminator in the engine. - -*** - -### journal? - -> `readonly` `optional` **journal?**: [`SpawnJournal`](SpawnJournal.md) - -Defined in: [runtime/personify/types.ts:232](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L232) - -*** - -### blobs? - -> `readonly` `optional` **blobs?**: [`ResultBlobStore`](ResultBlobStore.md) - -Defined in: [runtime/personify/types.ts:233](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L233) - -*** - -### maxDepth? - -> `readonly` `optional` **maxDepth?**: `number` - -Defined in: [runtime/personify/types.ts:235](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L235) - -Runtime recursion-depth ceiling, paired with the conserved pool. - -*** - -### maxRestarts? - -> `readonly` `optional` **maxRestarts?**: `number` - -Defined in: [runtime/personify/types.ts:237](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L237) - -OTP intensity breaker bounds, forwarded to the supervisor verbatim. - -*** - -### withinMs? - -> `readonly` `optional` **withinMs?**: `number` - -Defined in: [runtime/personify/types.ts:238](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L238) - -*** - -### handle? - -> `readonly` `optional` **handle?**: [`RootHandle`](RootHandle.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`D`\>\> - -Defined in: [runtime/personify/types.ts:240](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L240) - -A live root handle to attach (view/signal/abort) before the run starts. - -*** - -### now? - -> `readonly` `optional` **now?**: () => `number` - -Defined in: [runtime/personify/types.ts:241](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L241) - -#### Returns - -`number` - -*** - -### signal? - -> `readonly` `optional` **signal?**: `AbortSignal` - -Defined in: [runtime/personify/types.ts:242](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L242) - -*** - -### analyst? - -> `readonly` `optional` **analyst?**: [`ScopeAnalyst`](ScopeAnalyst.md)\<`D`\> - -Defined in: [runtime/personify/types.ts:245](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L245) - -Optional scope analyst threaded into the shape's ShapeContext so loopUntil/widen steer - on trace-derived findings instead of the dormant empty default. - -*** - -### hooks? - -> `readonly` `optional` **hooks?**: [`RuntimeHooks`](../../index/interfaces/RuntimeHooks.md) - -Defined in: [runtime/personify/types.ts:251](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L251) - -Lifecycle stream sink, forwarded to `SupervisorOpts.hooks` so the root `Scope`'s -`agent.spawn`/`agent.child` events flow to an observer (e.g. the Intelligence SDK's -trace export). Absent ⇒ no stream (the run is silent, as today). diff --git a/docs/api/runtime/interfaces/SandboxCapabilities.md b/docs/api/runtime/interfaces/SandboxCapabilities.md deleted file mode 100644 index 6d8fe41..0000000 --- a/docs/api/runtime/interfaces/SandboxCapabilities.md +++ /dev/null @@ -1,30 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / SandboxCapabilities - -# Interface: SandboxCapabilities - -Defined in: [runtime/sandbox-capabilities.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-capabilities.ts#L26) - -**`Experimental`** - -What the loop kernel is allowed to know about a sandbox backend: a single -capability bit, never the backend's identity. `canFork` gates the -checkpoint+fork fanout path; everything else (session continuation) is a -universal SDK feature that needs no probe. - -## Properties - -### canFork - -> **canFork**: `boolean` - -Defined in: [runtime/sandbox-capabilities.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-capabilities.ts#L32) - -**`Experimental`** - -True only when `client.criuStatus()` returned `{ available: true }`. When -false, a fork-enabled fanout degrades to independent fresh boxes — same -result, no shared context prefix. diff --git a/docs/api/runtime/interfaces/SandboxClient.md b/docs/api/runtime/interfaces/SandboxClient.md deleted file mode 100644 index 6ac4289..0000000 --- a/docs/api/runtime/interfaces/SandboxClient.md +++ /dev/null @@ -1,83 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / SandboxClient - -# Interface: SandboxClient - -Defined in: [runtime/types.ts:230](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L230) - -**`Experimental`** - -Minimal sandbox client surface the kernel calls. Satisfied structurally by -`new Sandbox({ apiKey, baseUrl })` — declared as a structural type so -tests can pass a stub without instantiating the SDK. - -`describePlacement` is optional. When present, the kernel calls it after -each `create()` so the `loop.iteration.dispatch` trace event carries fleet -coordinates (fleetId + machineId) instead of just the sibling sandboxId. -Fleet-aware adapters set this; the raw `Sandbox` SDK class does not, and -the kernel falls back to `{ placement: 'sibling', sandboxId: box.id }`. - -## Methods - -### create() - -> **create**(`options?`): `Promise`\<`SandboxInstance`\> - -Defined in: [runtime/types.ts:231](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L231) - -**`Experimental`** - -#### Parameters - -##### options? - -`CreateSandboxOptions` - -#### Returns - -`Promise`\<`SandboxInstance`\> - -*** - -### describePlacement()? - -> `optional` **describePlacement**(`box`): [`LoopSandboxPlacement`](LoopSandboxPlacement.md) - -Defined in: [runtime/types.ts:232](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L232) - -**`Experimental`** - -#### Parameters - -##### box - -`SandboxInstance` - -#### Returns - -[`LoopSandboxPlacement`](LoopSandboxPlacement.md) - -*** - -### criuStatus()? - -> `optional` **criuStatus**(): `Promise`\<\{ `available`: `boolean`; `criuVersion?`: `string`; `reason?`: `string`; \}\> - -Defined in: [runtime/types.ts:243](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L243) - -**`Experimental`** - -Optional CRIU capability probe. When present and it resolves -`{ available: true }`, the loop's `lineage.fork` seam may checkpoint+fork a -parent box so a fanout's branches inherit a shared context prefix; absent or -`false`, the fanout degrades to independent fresh boxes. The kernel reads -this ONLY through the capability probe — it never branches on backend kind. -The raw `Sandbox` SDK class satisfies it; the loop's test fakes omit it -(⇒ `canFork = false`). - -#### Returns - -`Promise`\<\{ `available`: `boolean`; `criuVersion?`: `string`; `reason?`: `string`; \}\> diff --git a/docs/api/runtime/interfaces/SandboxLineage.md b/docs/api/runtime/interfaces/SandboxLineage.md deleted file mode 100644 index 6c15068..0000000 --- a/docs/api/runtime/interfaces/SandboxLineage.md +++ /dev/null @@ -1,163 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / SandboxLineage - -# Interface: SandboxLineage - -Defined in: [runtime/sandbox-lineage.ts:131](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L131) - -**`Experimental`** - -Owns box + session handles for one loop run and offers the three -capability-gated lifecycle moves. Construct via `createSandboxLineage`. - -## Methods - -### start() - -> **start**(`spec`, `prompt`, `signal`): `Promise`\<\{ `handle`: [`SandboxLineageHandle`](SandboxLineageHandle.md); `events`: `AsyncIterable`\<`SandboxEvent`\>; \}\> - -Defined in: [runtime/sandbox-lineage.ts:136](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L136) - -**`Experimental`** - -Acquire a fresh box and begin a new session on it. Returns the handle and -the live `streamPrompt` iterable for the first turn (caller drains it). - -#### Parameters - -##### spec - -[`AgentRunSpec`](AgentRunSpec.md)\<`unknown`\> - -##### prompt - -`string` - -##### signal - -`AbortSignal` - -#### Returns - -`Promise`\<\{ `handle`: [`SandboxLineageHandle`](SandboxLineageHandle.md); `events`: `AsyncIterable`\<`SandboxEvent`\>; \}\> - -*** - -### continue() - -> **continue**(`handle`, `prompt`, `signal`): `Promise`\<`AsyncIterable`\<`SandboxEvent`, `any`, `any`\>\> - -Defined in: [runtime/sandbox-lineage.ts:148](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L148) - -**`Experimental`** - -Continue an existing handle's session with one more turn on the SAME box. -The prior context is server-side; `prompt` is only the new turn. Asserts the -session is still known to the sandbox first (fail-loud) so a platform that -silently dropped the client-minted session id surfaces as an error instead -of a contextless turn the caller mistakes for a real continuation. - -#### Parameters - -##### handle - -[`SandboxLineageHandle`](SandboxLineageHandle.md) - -##### prompt - -`string` - -##### signal - -`AbortSignal` - -#### Returns - -`Promise`\<`AsyncIterable`\<`SandboxEvent`, `any`, `any`\>\> - -*** - -### fork() - -> **fork**(`parent`, `prompts`, `specs`, `signal`): `Promise`\<`object`[]\> - -Defined in: [runtime/sandbox-lineage.ts:164](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L164) - -**`Experimental`** - -Branch `count` children from `parent`. When the platform can fork, each -child inherits `parent`'s checkpoint — and therefore the parent's IMAGE and -PROFILE: under a real fork `specs[i]` does NOT re-select a per-branch -profile (the SDK forks the running box, it can't swap the image). `specs[i]` -picks the per-branch profile ONLY on the degraded fresh-box path (no CRIU). -A heterogeneous-profile fanout therefore homogenizes to the parent's profile -when fork is available — pass a single shared spec for forked fanouts, or -use `random@k` (no fork) when branches must differ. Each child's first turn -streams `prompts[i]`. Child-box creation is bounded by `maxConcurrency`. - -#### Parameters - -##### parent - -[`SandboxLineageHandle`](SandboxLineageHandle.md) - -##### prompts - -`string`[] - -##### specs - -[`AgentRunSpec`](AgentRunSpec.md)\<`unknown`\>[] - -##### signal - -`AbortSignal` - -#### Returns - -`Promise`\<`object`[]\> - -*** - -### prune() - -> **prune**(`keep`): `Promise`\<`void`\> - -Defined in: [runtime/sandbox-lineage.ts:177](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L177) - -**`Experimental`** - -Destroy every owned box whose handle is NOT in `keep`, freeing it before -loop end. The kernel calls this after a round when it can prove no future -round will descend from the pruned boxes (deterministic, monotonic branch -selection); boxes still reachable as a future branch source are retained. -Best-effort, bounded, parallel — a failed delete never throws. - -#### Parameters - -##### keep - -`Iterable`\<[`SandboxLineageHandle`](SandboxLineageHandle.md)\> - -#### Returns - -`Promise`\<`void`\> - -*** - -### teardown() - -> **teardown**(): `Promise`\<`void`\> - -Defined in: [runtime/sandbox-lineage.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L179) - -**`Experimental`** - -Destroy every box this lineage owns. Best-effort, bounded, parallel. - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/runtime/interfaces/SandboxLineageHandle.md b/docs/api/runtime/interfaces/SandboxLineageHandle.md deleted file mode 100644 index 978f0ca..0000000 --- a/docs/api/runtime/interfaces/SandboxLineageHandle.md +++ /dev/null @@ -1,42 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / SandboxLineageHandle - -# Interface: SandboxLineageHandle - -Defined in: [runtime/sandbox-lineage.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L113) - -**`Experimental`** - -A live box plus the session that threads its iterations together. Handed back -by `start`/`fork`, passed into `continue`/`fork` to descend from. Opaque to -the kernel beyond `box` (for placement/teardown) and `sessionId` (trace). - -## Properties - -### box - -> **box**: `SandboxInstance` - -Defined in: [runtime/sandbox-lineage.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L115) - -**`Experimental`** - -The owned, running sandbox this handle drives. - -*** - -### sessionId - -> **sessionId**: `string` - -Defined in: [runtime/sandbox-lineage.ts:122](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L122) - -**`Experimental`** - -Stable session id threaded through this box's `streamPrompt` calls. Minted -by the lineage on `start`; reused on `continue` so the server continues the -same conversation. A forked handle starts a fresh session on its new box — -the shared context comes from the checkpoint, not a shared session id. diff --git a/docs/api/runtime/interfaces/SandboxRun.md b/docs/api/runtime/interfaces/SandboxRun.md deleted file mode 100644 index 7e50b1b..0000000 --- a/docs/api/runtime/interfaces/SandboxRun.md +++ /dev/null @@ -1,98 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / SandboxRun - -# Interface: SandboxRun\ - -Defined in: [runtime/sandbox-run.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L68) - -**`Experimental`** - -A live run over ONE persistent artifact (box + session). Close it - when done — `close()` tears the box down. - -## Type Parameters - -### Out - -`Out` - -## Properties - -### box - -> `readonly` **box**: `SandboxInstance` - -Defined in: [runtime/sandbox-run.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L69) - -**`Experimental`** - -*** - -### sessionId - -> `readonly` **sessionId**: `string` - -Defined in: [runtime/sandbox-run.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L70) - -**`Experimental`** - -## Methods - -### start() - -> **start**(`prompt`): `Promise`\<[`TurnResult`](TurnResult.md)\<`Out`\>\> - -Defined in: [runtime/sandbox-run.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L72) - -**`Experimental`** - -First turn over the fresh box (mints the session). Throws if already started. - -#### Parameters - -##### prompt - -`string` - -#### Returns - -`Promise`\<[`TurnResult`](TurnResult.md)\<`Out`\>\> - -*** - -### resume() - -> **resume**(`prompt`): `Promise`\<[`TurnResult`](TurnResult.md)\<`Out`\>\> - -Defined in: [runtime/sandbox-run.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L74) - -**`Experimental`** - -Continue THE SAME session over THE SAME artifact — a resumed turn/rollout. - -#### Parameters - -##### prompt - -`string` - -#### Returns - -`Promise`\<[`TurnResult`](TurnResult.md)\<`Out`\>\> - -*** - -### close() - -> **close**(): `Promise`\<`void`\> - -Defined in: [runtime/sandbox-run.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L75) - -**`Experimental`** - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/runtime/interfaces/SandboxSeam.md b/docs/api/runtime/interfaces/SandboxSeam.md deleted file mode 100644 index 5c8a549..0000000 --- a/docs/api/runtime/interfaces/SandboxSeam.md +++ /dev/null @@ -1,54 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / SandboxSeam - -# Interface: SandboxSeam - -Defined in: [runtime/supervise/runtime.ts:79](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L79) - -Sandbox executor seam. The `sandboxClient` the composed `runLoop` creates -boxes through, plus the optional trace/run/lineage wiring forwarded into the -loop. `lineage` is opaque here (PR #150's `RunLoopOptions.lineage`): forwarded -forward-compatibly, never inspected — this executor does NOT reinvent -checkpoint/fork. - -## Properties - -### sandboxClient - -> **sandboxClient**: [`SandboxClient`](SandboxClient.md) - -Defined in: [runtime/supervise/runtime.ts:80](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L80) - -*** - -### loopCtx? - -> `optional` **loopCtx?**: `Partial`\<`Omit`\<[`ExecCtx`](ExecCtx.md), `"signal"` \| `"sandboxClient"`\>\> - -Defined in: [runtime/supervise/runtime.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L82) - -Forwarded into the composed `runLoop`'s `ctx` (trace emitter, run handle, etc.). - -*** - -### lineage? - -> `optional` **lineage?**: `unknown` - -Defined in: [runtime/supervise/runtime.ts:84](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L84) - -PR #150 `RunLoopOptions.lineage` passthrough — opaque; forwarded, not parsed. - -*** - -### maxIterations? - -> `optional` **maxIterations?**: `number` - -Defined in: [runtime/supervise/runtime.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L87) - -Hard cap on the composed loop's iterations. The budget pool reserves against - the spawn `Budget.maxIterations`; this is the leaf's own ceiling. Default 1. diff --git a/docs/api/runtime/interfaces/Scope.md b/docs/api/runtime/interfaces/Scope.md deleted file mode 100644 index bd74006..0000000 --- a/docs/api/runtime/interfaces/Scope.md +++ /dev/null @@ -1,165 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Scope - -# Interface: Scope\ - -Defined in: [runtime/supervise/types.ts:283](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L283) - -The budget-conserving reactive scope an `Agent.act` runs inside. `spawn` reserves -budget atomically from the shared pool and fails closed when the pool cannot cover it. -`next()` waits for one settlement from this scope's live set; `view` reads live state, -not the replay log. - -## Type Parameters - -### Out - -`Out` - -## Properties - -### signal - -> `readonly` **signal**: `AbortSignal` - -Defined in: [runtime/supervise/types.ts:310](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L310) - -This scope's abort signal — aborted when the run is cancelled, a breaker trips, the pool - is exhausted, or a parent scope cascades. A long-running driver `act` over this scope reads - it to break promptly (the conserved pool + driver-stop are the other bounds). A nested - scope carries its own signal, chained off its driver child's abort. - -*** - -### view - -> `readonly` **view**: [`TreeView`](TreeView.md) - -Defined in: [runtime/supervise/types.ts:324](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L324) - -The live tree — reads the in-memory nursery, not the journal. - -*** - -### budget - -> `readonly` **budget**: `Readonly`\<\{ `tokensLeft`: `number`; `usdLeft`: `number`; `usdCapped`: `boolean`; `deadlineMs`: `number`; `reservedTokens`: `number`; \}\> - -Defined in: [runtime/supervise/types.ts:326](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L326) - -Conserved-pool readouts (post-reservation). - -## Methods - -### spawn() - -> **spawn**\<`C`\>(`agent`, `task`, `opts`): \{ `ok`: `true`; `handle`: [`Handle`](Handle.md)\<`C`\>; \} \| \{ `ok`: `false`; `reason`: `"budget-exhausted"` \| `"depth-exceeded"`; \} - -Defined in: [runtime/supervise/types.ts:289](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L289) - -Spawn a child. Reserves `opts.budget` from the conserved pool atomically; refunds the -unspent remainder on settle. Returns a typed outcome — fail-closed on an exhausted -pool or an exceeded depth ceiling (the caller inspects `ok` before `handle`). - -#### Type Parameters - -##### C - -`C` - -#### Parameters - -##### agent - -[`Agent`](Agent.md)\<`unknown`, `C`\> - -##### task - -`unknown` - -##### opts - -[`SpawnOpts`](SpawnOpts.md) - -#### Returns - -\{ `ok`: `true`; `handle`: [`Handle`](Handle.md)\<`C`\>; \} \| \{ `ok`: `false`; `reason`: `"budget-exhausted"` \| `"depth-exceeded"`; \} - -*** - -### next() - -> **next**(): `Promise`\<[`Settled`](../type-aliases/Settled.md)\<`Out`\> \| `null`\> - -Defined in: [runtime/supervise/types.ts:296](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L296) - -ray.wait n=1 over this scope's in-memory live set; resolves as each child settles; - `null` when the live set is empty. - -#### Returns - -`Promise`\<[`Settled`](../type-aliases/Settled.md)\<`Out`\> \| `null`\> - -*** - -### send() - -> **send**(`nodeId`, `msg`): `boolean` - -Defined in: [runtime/supervise/types.ts:305](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L305) - -Steer a RUNNING child out-of-band — deliver a message to its executor's inbox (the driver's -`send` verb: next-instruction, interrupt, or resume). Returns `true` if the message was -delivered to a live child whose executor accepts delivery, `false` otherwise (unknown id, -already settled, or an executor with no inbox). The executor drains its inbox between turns; -a leaf that does not implement `deliver` simply cannot be steered mid-flight. In-process this -is a direct call; the sandbox/Agent-Bus transports surface the SAME verb as an MCP tool. - -#### Parameters - -##### nodeId - -`string` - -##### msg - -`unknown` - -#### Returns - -`boolean` - -*** - -### meter() - -> **meter**(`spend`, `detail?`): `Promise`\<`void`\> - -Defined in: [runtime/supervise/types.ts:322](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L322) - -Meter the driver's OWN compute against the conserved pool — its inference turns, which are -real tokens/usd but not a spawned child (no reserve/reconcile). A direct `free → committed` -debit, so equal-k counts the driver's tokens AND the in-loop budget guard (`budget.tokensLeft`) -halts a driver that thinks the pool dry. `detail` rides an `agent.turn` trace event for live -observability (turn index, tool calls, cumulative spend). It also journals a `metered` event — -the durable twin of the pool debit (as `settled` is the twin of `reconcile`) — so every -journal-based cost reader (`spentFromJournal`, `trajectoryReport`) sums driver inference -automatically. A leaf never calls this; a driver meters each chat turn and awaits it (the -metered event is cost-critical, so it lands before the join-barrier roll-up). - -#### Parameters - -##### spend - -[`Spend`](Spend.md) - -##### detail? - -`Record`\<`string`, `unknown`\> - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/runtime/interfaces/ScopeAnalyst.md b/docs/api/runtime/interfaces/ScopeAnalyst.md deleted file mode 100644 index b6187d5..0000000 --- a/docs/api/runtime/interfaces/ScopeAnalyst.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ScopeAnalyst - -# Interface: ScopeAnalyst\ - -Defined in: [runtime/personify/wave-types.ts:358](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L358) - -The reactive analyst seam — the PORT of the round-synchronous driver's `analyze` hook -(dynamic.ts) onto the reactive `Scope`. The old driver wired the analyst at round -boundaries (`plan` ran the analyst over `history` BEFORE the planner); the reactive `Scope` has -no rounds, so this carries the wire across: a combinator's `act` asks the `ScopeAnalyst` to turn -the settled children SO FAR into `AnalystFinding[]`, and steers from THOSE findings. - -The firewall is preserved (selector≠judge): `analyze` runs the trace-derived analyst and the -impl asserts `assertTraceDerivedFindings` semantics — a finding citing judge/verdict/score -`metric` evidence aborts the round. The steer decision reads `findings`, NEVER the children's -raw `verdict`. Fail loud — a throwing or non-array analyst aborts (no silent empty findings). - -## Type Parameters - -### D - -`D` - -## Methods - -### analyze() - -> **analyze**(`input`): `Promise`\ - -Defined in: [runtime/personify/wave-types.ts:365](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L365) - -Turn the children settled so far into trace-derived findings. `settledSoFar` is the cursor- -ordered settlement list a combinator has drained (the reactive analogue of the old driver's -`history`). The impl runs the analyst, then enforces the trace-derived firewall before -returning — a judge-derived finding is rejected, not filtered. - -#### Parameters - -##### input - -[`ScopeAnalyzeInput`](ScopeAnalyzeInput.md)\<`D`\> - -#### Returns - -`Promise`\ diff --git a/docs/api/runtime/interfaces/ScopeAnalyzeInput.md b/docs/api/runtime/interfaces/ScopeAnalyzeInput.md deleted file mode 100644 index 7bc9257..0000000 --- a/docs/api/runtime/interfaces/ScopeAnalyzeInput.md +++ /dev/null @@ -1,47 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ScopeAnalyzeInput - -# Interface: ScopeAnalyzeInput\ - -Defined in: [runtime/personify/wave-types.ts:369](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L369) - -Input to a `ScopeAnalyst.analyze` — the root task framing + the children settled so far. - -## Type Parameters - -### D - -`D` - -## Properties - -### task - -> `readonly` **task**: `unknown` - -Defined in: [runtime/personify/wave-types.ts:371](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L371) - -Opaque root-task framing (whatever the combinator was invoked with). - -*** - -### settledSoFar - -> `readonly` **settledSoFar**: readonly [`Settled`](../type-aliases/Settled.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`D`\>\>[] - -Defined in: [runtime/personify/wave-types.ts:373](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L373) - -The children this combinator has drained off `scope.next()`, in cursor order. - -*** - -### nodeId - -> `readonly` **nodeId**: `string` - -Defined in: [runtime/personify/wave-types.ts:375](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L375) - -This combinator's scope id (the trace-correlation root for the analyst). diff --git a/docs/api/runtime/interfaces/ScopeWidenGate.md b/docs/api/runtime/interfaces/ScopeWidenGate.md deleted file mode 100644 index 5c86200..0000000 --- a/docs/api/runtime/interfaces/ScopeWidenGate.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ScopeWidenGate - -# Interface: ScopeWidenGate\ - -Defined in: [runtime/personify/wave-types.ts:310](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L310) - -The runtime widening gate (the reactive analogue of the keystone's `WidenGate`, lifted to read -trace FINDINGS instead of a raw verdict). `decide` is consulted per settled child; it MUST -derive `promising` from `findings`, never from `settled.verdict`, unless `judgeExempt` is -explicitly argued (the documented off-by-default escape hatch). Flat default never widens. - -## Type Parameters - -### D - -`D` - -## Properties - -### judgeExempt? - -> `readonly` `optional` **judgeExempt?**: `boolean` - -Defined in: [runtime/personify/wave-types.ts:318](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L318) - -When true, `decide` may read `settled.verdict` directly — collides with the steer firewall, - so it must be argued per cell, never defaulted on (mirrors the keystone `WidenGate`). - -## Methods - -### decide() - -> **decide**(`settled`, `findings`, `budget`): [`WidenDecision`](../type-aliases/WidenDecision.md)\<`D`\> - -Defined in: [runtime/personify/wave-types.ts:311](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L311) - -#### Parameters - -##### settled - -[`Settled`](../type-aliases/Settled.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`D`\>\> - -##### findings - -readonly `AnalystFinding`[] - -##### budget - -`Readonly`\<\{ `tokensLeft`: `number`; `usdLeft`: `number`; `usdCapped`: `boolean`; `deadlineMs`: `number`; `reservedTokens`: `number`; \}\> - -#### Returns - -[`WidenDecision`](../type-aliases/WidenDecision.md)\<`D`\> diff --git a/docs/api/runtime/interfaces/SessionCapableBox.md b/docs/api/runtime/interfaces/SessionCapableBox.md deleted file mode 100644 index ff4929a..0000000 --- a/docs/api/runtime/interfaces/SessionCapableBox.md +++ /dev/null @@ -1,44 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / SessionCapableBox - -# Interface: SessionCapableBox - -Defined in: [runtime/sandbox-lineage.ts:393](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L393) - -**`Experimental`** - -Loop-side widening of the box's optional session accessor. The real -`SandboxInstance` exposes `session(id).status()`; the loop reads it optionally -so `continue` can assert session liveness without requiring it of the test -fakes. `status()` resolves `null` when the id is unknown to the sandbox. - -## Properties - -### session? - -> `optional` **session?**: (`id`) => `object` - -Defined in: [runtime/sandbox-lineage.ts:394](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-lineage.ts#L394) - -**`Experimental`** - -#### Parameters - -##### id - -`string` - -#### Returns - -`object` - -##### status - -> **status**: () => `Promise`\<`unknown`\> - -###### Returns - -`Promise`\<`unknown`\> diff --git a/docs/api/runtime/interfaces/SessionMessageLike.md b/docs/api/runtime/interfaces/SessionMessageLike.md deleted file mode 100644 index 94ae0a9..0000000 --- a/docs/api/runtime/interfaces/SessionMessageLike.md +++ /dev/null @@ -1,20 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / SessionMessageLike - -# Interface: SessionMessageLike - -Defined in: [runtime/supervise/trace-source.ts:265](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L265) - -A harness session message carrying parts (the shape `box.messages()` returns). Structurally typed - so this works with the real `@tangle-network/sandbox` box AND a test double, no SDK import. - -## Properties - -### parts? - -> `readonly` `optional` **parts?**: readonly `unknown`[] - -Defined in: [runtime/supervise/trace-source.ts:266](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L266) diff --git a/docs/api/runtime/interfaces/SessionTraceBox.md b/docs/api/runtime/interfaces/SessionTraceBox.md deleted file mode 100644 index f810a6c..0000000 --- a/docs/api/runtime/interfaces/SessionTraceBox.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / SessionTraceBox - -# Interface: SessionTraceBox - -Defined in: [runtime/supervise/trace-source.ts:270](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L270) - -The minimal box surface this needs: list a session's messages (incl. mid-turn partials). - -## Methods - -### messages() - -> **messages**(`opts`): `Promise`\ - -Defined in: [runtime/supervise/trace-source.ts:271](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L271) - -#### Parameters - -##### opts - -###### sessionId - -`string` - -#### Returns - -`Promise`\ diff --git a/docs/api/runtime/interfaces/ShapeBudget.md b/docs/api/runtime/interfaces/ShapeBudget.md deleted file mode 100644 index fdb3815..0000000 --- a/docs/api/runtime/interfaces/ShapeBudget.md +++ /dev/null @@ -1,34 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ShapeBudget - -# Interface: ShapeBudget - -Defined in: [runtime/personify/types.ts:153](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L153) - -Budget knobs a shape reads to size its fanout/children WITHOUT owning the conserved pool. -The root budget lives on `SupervisorOpts.budget`; the shape only needs the per-child -sizing hints + the fanout width it is allowed to open. All ceilings — the pool reserves -against them and fails closed, so an over-eager shape can never overspend. - -## Properties - -### perChild - -> `readonly` **perChild**: [`Budget`](Budget.md) - -Defined in: [runtime/personify/types.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L155) - -Per-child spawn budget the shape reserves for each leaf/sub-loop it opens. - -*** - -### fanout - -> `readonly` **fanout**: `number` - -Defined in: [runtime/personify/types.ts:157](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L157) - -Max children a fanout step may open in one round (the shape's structural width). diff --git a/docs/api/runtime/interfaces/ShapeContext.md b/docs/api/runtime/interfaces/ShapeContext.md deleted file mode 100644 index cdac693..0000000 --- a/docs/api/runtime/interfaces/ShapeContext.md +++ /dev/null @@ -1,100 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ShapeContext - -# Interface: ShapeContext\ - -Defined in: [runtime/personify/types.ts:167](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L167) - -The construction context a `LoopShape` factory receives. Carries the persona's resolved -executor seams + the budget knobs, plus the ONE helper a shape needs to spawn a child -through the keystone: `spawnChild` resolves an `AgentSpec` (or a persona-derived child -profile) into an `Agent` the shape hands to `scope.spawn`. The shape never touches the -registry directly — it asks the context, keeping resolution single-sourced. - -## Type Parameters - -### D - -`D` = `unknown` - -## Properties - -### persona - -> `readonly` **persona**: [`Persona`](Persona.md)\<`D`\> - -Defined in: [runtime/personify/types.ts:168](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L168) - -*** - -### budget - -> `readonly` **budget**: [`ShapeBudget`](ShapeBudget.md) - -Defined in: [runtime/personify/types.ts:169](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L169) - -*** - -### analyst? - -> `readonly` `optional` **analyst?**: [`ScopeAnalyst`](ScopeAnalyst.md)\<`D`\> - -Defined in: [runtime/personify/types.ts:182](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L182) - -The scope analyst (selector≠judge firewall) the combinator steers from. Absent ⇒ the - dormant default (empty findings → gates read deliverables/state only). - -## Methods - -### spawnChild() - -> **spawnChild**(`name`, `spec`): [`Agent`](Agent.md)\<`unknown`, [`Outcome`](../type-aliases/Outcome.md)\<`D`\>\> - -Defined in: [runtime/personify/types.ts:176](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L176) - -Wrap an `AgentSpec` into a leaf `Agent` carrying it as `executorSpec`, so the shape can -`scope.spawn(spawnChild(spec), task, opts)`. `name` labels the child for traces. The -returned agent's `act` is never invoked by the keystone (it is spawned, not run) — the -spec drives the resolved `Executor`; `act` exists only to satisfy the `Agent` shape. - -#### Parameters - -##### name - -`string` - -##### spec - -[`AgentSpec`](AgentSpec.md) - -#### Returns - -[`Agent`](Agent.md)\<`unknown`, [`Outcome`](../type-aliases/Outcome.md)\<`D`\>\> - -*** - -### childSpec() - -> **childSpec**(`profile`, `harness?`): [`AgentSpec`](AgentSpec.md) - -Defined in: [runtime/personify/types.ts:179](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L179) - -Derive a child `AgentSpec` from the persona's root spec with an overridden profile — - the seam a shape uses to give a worker a narrower role/prompt than the root persona. - -#### Parameters - -##### profile - -`AgentProfile` - -##### harness? - -`BackendType` \| `null` - -#### Returns - -[`AgentSpec`](AgentSpec.md) diff --git a/docs/api/runtime/interfaces/ShapeRegistry.md b/docs/api/runtime/interfaces/ShapeRegistry.md deleted file mode 100644 index 814cc34..0000000 --- a/docs/api/runtime/interfaces/ShapeRegistry.md +++ /dev/null @@ -1,87 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ShapeRegistry - -# Interface: ShapeRegistry - -Defined in: [runtime/personify/types.ts:201](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L201) - -The open shape registry — the extension point that makes a new loop-shape ONE file + one -`registerShape` call with zero edits elsewhere. `resolve` returns a typed outcome (inspect -`succeeded` before `value`); `register` fails loud on a duplicate name. - -## Methods - -### register() - -> **register**\<`Task`, `D`\>(`name`, `factory`): `void` - -Defined in: [runtime/personify/types.ts:202](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L202) - -#### Type Parameters - -##### Task - -`Task` - -##### D - -`D` - -#### Parameters - -##### name - -`string` - -##### factory - -[`LoopShape`](../type-aliases/LoopShape.md)\<`Task`, `D`\> - -#### Returns - -`void` - -*** - -### resolve() - -> **resolve**\<`Task`, `D`\>(`name`): \{ `succeeded`: `true`; `value`: [`LoopShape`](../type-aliases/LoopShape.md)\<`Task`, `D`\>; \} \| \{ `succeeded`: `false`; `error`: `string`; \} - -Defined in: [runtime/personify/types.ts:203](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L203) - -#### Type Parameters - -##### Task - -`Task` - -##### D - -`D` - -#### Parameters - -##### name - -`string` - -#### Returns - -\{ `succeeded`: `true`; `value`: [`LoopShape`](../type-aliases/LoopShape.md)\<`Task`, `D`\>; \} \| \{ `succeeded`: `false`; `error`: `string`; \} - -*** - -### names() - -> **names**(): `string`[] - -Defined in: [runtime/personify/types.ts:207](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L207) - -The registered shape names — for diagnostics + a fail-loud "unknown shape" message. - -#### Returns - -`string`[] diff --git a/docs/api/runtime/interfaces/ShotPersona.md b/docs/api/runtime/interfaces/ShotPersona.md deleted file mode 100644 index 4a8f00f..0000000 --- a/docs/api/runtime/interfaces/ShotPersona.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ShotPersona - -# Interface: ShotPersona - -Defined in: [runtime/strategy.ts:682](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L682) - -A role for one shot — multi-agent loops (researcher + engineer, a panel of k - researchers) give each shot its own system prompt and optionally its own model. - -## Properties - -### systemPrompt? - -> `optional` **systemPrompt?**: `string` - -Defined in: [runtime/strategy.ts:685](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L685) - -Replaces the task's systemPrompt for a FRESH shot; on a carried conversation it is - injected as a hand-off message (the transcript's earlier roles stay intact). - -*** - -### model? - -> `optional` **model?**: `string` - -Defined in: [runtime/strategy.ts:687](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L687) - -Per-shot model override (e.g. a stronger model for the engineer shot). diff --git a/docs/api/runtime/interfaces/ShotSpec.md b/docs/api/runtime/interfaces/ShotSpec.md deleted file mode 100644 index 3570134..0000000 --- a/docs/api/runtime/interfaces/ShotSpec.md +++ /dev/null @@ -1,54 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ShotSpec - -# Interface: ShotSpec - -Defined in: [runtime/strategy.ts:690](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L690) - -## Properties - -### handle? - -> `optional` **handle?**: [`ArtifactHandle`](ArtifactHandle.md) - -Defined in: [runtime/strategy.ts:692](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L692) - -present ⇒ continue this artifact (depth); absent ⇒ the shot opens a fresh one (sample/restart). - -*** - -### messages? - -> `optional` **messages?**: `Msg`[] - -Defined in: [runtime/strategy.ts:693](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L693) - -*** - -### steer? - -> `optional` **steer?**: `string` - -Defined in: [runtime/strategy.ts:694](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L694) - -*** - -### persona? - -> `optional` **persona?**: [`ShotPersona`](ShotPersona.md) - -Defined in: [runtime/strategy.ts:695](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L695) - -*** - -### tools? - -> `optional` **tools?**: `string`[] - -Defined in: [runtime/strategy.ts:698](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L698) - -Restrict THIS shot to a subset of the domain's tools (by name) — focus a shot on - the relevant capabilities. Restriction-only; unknown names throw. Omitted ⇒ all. diff --git a/docs/api/runtime/interfaces/SpawnJournal.md b/docs/api/runtime/interfaces/SpawnJournal.md deleted file mode 100644 index 0dfea5c..0000000 --- a/docs/api/runtime/interfaces/SpawnJournal.md +++ /dev/null @@ -1,75 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / SpawnJournal - -# Interface: SpawnJournal - -Defined in: [runtime/supervise/types.ts:406](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L406) - -The spawn-tree event source (mirrors `ConversationJournal`'s begin/append/load shape). -`loadTree` replays the full ordered event list for resume/replay; `appendEvent` is -called only AFTER the event is observed-committed (never speculative). - -## Methods - -### loadTree() - -> **loadTree**(`root`): `Promise`\<[`SpawnEvent`](../type-aliases/SpawnEvent.md)[] \| `undefined`\> - -Defined in: [runtime/supervise/types.ts:407](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L407) - -#### Parameters - -##### root - -`string` - -#### Returns - -`Promise`\<[`SpawnEvent`](../type-aliases/SpawnEvent.md)[] \| `undefined`\> - -*** - -### beginTree() - -> **beginTree**(`root`, `at`): `Promise`\<`void`\> - -Defined in: [runtime/supervise/types.ts:408](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L408) - -#### Parameters - -##### root - -`string` - -##### at - -`string` - -#### Returns - -`Promise`\<`void`\> - -*** - -### appendEvent() - -> **appendEvent**(`root`, `ev`): `Promise`\<`void`\> - -Defined in: [runtime/supervise/types.ts:409](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L409) - -#### Parameters - -##### root - -`string` - -##### ev - -[`SpawnEvent`](../type-aliases/SpawnEvent.md) - -#### Returns - -`Promise`\<`void`\> diff --git a/docs/api/runtime/interfaces/SpawnOpts.md b/docs/api/runtime/interfaces/SpawnOpts.md deleted file mode 100644 index 5b3b240..0000000 --- a/docs/api/runtime/interfaces/SpawnOpts.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / SpawnOpts - -# Interface: SpawnOpts - -Defined in: [runtime/supervise/types.ts:227](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L227) - -## Properties - -### budget - -> `readonly` **budget**: [`Budget`](Budget.md) - -Defined in: [runtime/supervise/types.ts:228](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L228) - -*** - -### label - -> `readonly` **label**: `string` - -Defined in: [runtime/supervise/types.ts:229](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L229) - -*** - -### restart? - -> `readonly` `optional` **restart?**: [`Restart`](../type-aliases/Restart.md) - -Defined in: [runtime/supervise/types.ts:230](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L230) - -*** - -### shutdown? - -> `readonly` `optional` **shutdown?**: `number` \| `"brutalKill"` \| `"infinity"` - -Defined in: [runtime/supervise/types.ts:232](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L232) - -Teardown grace handed to the executor when this node is reaped. diff --git a/docs/api/runtime/interfaces/Spend.md b/docs/api/runtime/interfaces/Spend.md deleted file mode 100644 index 5c2e9df..0000000 --- a/docs/api/runtime/interfaces/Spend.md +++ /dev/null @@ -1,44 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Spend - -# Interface: Spend - -Defined in: [runtime/supervise/types.ts:208](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L208) - -Conserved spend, reconciled from the normalized `UsageEvent` stream. Tokens and usd - are separate channels (never folded). - -## Properties - -### iterations - -> **iterations**: `number` - -Defined in: [runtime/supervise/types.ts:209](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L209) - -*** - -### tokens - -> **tokens**: [`LoopTokenUsage`](LoopTokenUsage.md) - -Defined in: [runtime/supervise/types.ts:210](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L210) - -*** - -### usd - -> **usd**: `number` - -Defined in: [runtime/supervise/types.ts:211](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L211) - -*** - -### ms - -> **ms**: `number` - -Defined in: [runtime/supervise/types.ts:212](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L212) diff --git a/docs/api/runtime/interfaces/SteerContext.md b/docs/api/runtime/interfaces/SteerContext.md deleted file mode 100644 index 6723a05..0000000 --- a/docs/api/runtime/interfaces/SteerContext.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / SteerContext - -# Interface: SteerContext\ - -Defined in: [runtime/personify/wave-types.ts:386](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L386) - -How a combinator's `act` consumes findings to steer — the SINGLE firewalled steer surface a -reactive combinator reads. `loopUntil.until`, `widen` gate, and any future steer all funnel -through a `SteerContext` so the firewall is enforced in one place: `findings` is trace-derived -(the analyst already asserted it), and a combinator MUST NOT reach back to `settled.verdict` -for the steer decision. `lastValidScore` is provided for OBSERVABILITY only (rendering/traces), -explicitly NOT for steering — reading it to steer is the coupling the architecture forbids. - -## Type Parameters - -### D - -`D` - -## Properties - -### findings - -> `readonly` **findings**: readonly `AnalystFinding`[] - -Defined in: [runtime/personify/wave-types.ts:387](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L387) - -*** - -### settledSoFar - -> `readonly` **settledSoFar**: readonly [`Settled`](../type-aliases/Settled.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`D`\>\>[] - -Defined in: [runtime/personify/wave-types.ts:388](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L388) - -*** - -### lastValidScore? - -> `readonly` `optional` **lastValidScore?**: `number` - -Defined in: [runtime/personify/wave-types.ts:391](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L391) - -Observability-only: the best valid score seen so far. Rendering/trace use ONLY — steering - off this re-introduces selector=judge. Marked so a reviewer catches a misuse. diff --git a/docs/api/runtime/interfaces/Strategy.md b/docs/api/runtime/interfaces/Strategy.md deleted file mode 100644 index 7fcf517..0000000 --- a/docs/api/runtime/interfaces/Strategy.md +++ /dev/null @@ -1,56 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Strategy - -# Interface: Strategy - -Defined in: [runtime/strategy.ts:652](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L652) - -A Strategy is HOW you spend the compute budget to beat the Environment's check — it -builds the driver `Agent` the Supervisor runs. This is the OPEN extension point: a dev -authors their own by implementing `driver()` to return an Agent whose `act()` spawns -shots/analysts via `scope.spawn` / `scope.next` / `scope.send`. The two built-ins are -the reference implementations to copy: - sample — K INDEPENDENT attempts, keep the best-verifying (best-of-N / resample). - refine — attempt → observe() reads the trace → steer the next → repeat (iterate). -(A multi-agent "team" is just a Strategy whose driver spawns several different agents.) - -## Properties - -### name - -> `readonly` **name**: `string` - -Defined in: [runtime/strategy.ts:653](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L653) - -## Methods - -### driver() - -> **driver**(`surface`, `task`, `opts`, `budget`): [`Agent`](Agent.md)\<`unknown`, [`Outcome`](../type-aliases/Outcome.md)\<`unknown`\>\> - -Defined in: [runtime/strategy.ts:654](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L654) - -#### Parameters - -##### surface - -[`AgenticSurface`](AgenticSurface.md) - -##### task - -[`AgenticTask`](AgenticTask.md) - -##### opts - -[`AgenticOptions`](AgenticOptions.md) - -##### budget - -`number` - -#### Returns - -[`Agent`](Agent.md)\<`unknown`, [`Outcome`](../type-aliases/Outcome.md)\<`unknown`\>\> diff --git a/docs/api/runtime/interfaces/StrategyCtx.md b/docs/api/runtime/interfaces/StrategyCtx.md deleted file mode 100644 index 944c686..0000000 --- a/docs/api/runtime/interfaces/StrategyCtx.md +++ /dev/null @@ -1,142 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / StrategyCtx - -# Interface: StrategyCtx - -Defined in: [runtime/strategy.ts:717](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L717) - -What a strategy body composes with: the artifact lifecycle, the budget, and the two steps. - -## Properties - -### surface - -> `readonly` **surface**: `StrategyArtifacts` - -Defined in: [runtime/strategy.ts:719](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L719) - -Open/close artifacts the body manages itself (e.g. one persistent handle for depth). - -*** - -### task - -> `readonly` **task**: [`AgenticTask`](AgenticTask.md) - -Defined in: [runtime/strategy.ts:720](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L720) - -*** - -### opts - -> `readonly` **opts**: [`AgenticOptions`](AgenticOptions.md) - -Defined in: [runtime/strategy.ts:721](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L721) - -*** - -### budget - -> `readonly` **budget**: `number` - -Defined in: [runtime/strategy.ts:722](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L722) - -*** - -### scope - -> `readonly` **scope**: [`Scope`](Scope.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`unknown`\>\> - -Defined in: [runtime/strategy.ts:723](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L723) - -## Methods - -### shot() - -> **shot**(`spec?`): `Promise`\<`ShotResult` \| `null`\> - -Defined in: [runtime/strategy.ts:725](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L725) - -Run ONE worker shot; its harness-scored result, or null if it went down. - -#### Parameters - -##### spec? - -[`ShotSpec`](ShotSpec.md) - -#### Returns - -`Promise`\<`ShotResult` \| `null`\> - -*** - -### critique() - -> **critique**(`messages`): `Promise`\<`string` \| `null`\> - -Defined in: [runtime/strategy.ts:727](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L727) - -The firewalled critic reads the trajectory → a steer string, or null on COMPLETE/down. - -#### Parameters - -##### messages - -`Msg`[] - -#### Returns - -`Promise`\<`string` \| `null`\> - -*** - -### consult() - -> **consult**(`messages`, `instruction`): `Promise`\<`string` \| `null`\> - -Defined in: [runtime/strategy.ts:732](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L732) - -The RAW analyst channel: the firewalled critic answers `instruction` over the - trajectory verbatim — no findings extraction, so verdict-shaped formats - (CONTINUE/STOP decisions, calibrated predictions) survive. Same firewall: - trajectory in, never scores. Null when the analyst went down. - -#### Parameters - -##### messages - -`Msg`[] - -##### instruction - -`string` - -#### Returns - -`Promise`\<`string` \| `null`\> - -*** - -### listTools() - -> **listTools**(`handle`): `Promise`\<`object`[]\> - -Defined in: [runtime/strategy.ts:736](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L736) - -The tools THIS artifact's task actually offers (names + descriptions only — never - the implementations). Tool sets vary per task on heterogeneous domains; a strategy - that restricts shots MUST select from this list, never from hardcoded names. - -#### Parameters - -##### handle - -[`ArtifactHandle`](ArtifactHandle.md) - -#### Returns - -`Promise`\<`object`[]\> diff --git a/docs/api/runtime/interfaces/StrategyEvolutionConfig.md b/docs/api/runtime/interfaces/StrategyEvolutionConfig.md deleted file mode 100644 index faf8c13..0000000 --- a/docs/api/runtime/interfaces/StrategyEvolutionConfig.md +++ /dev/null @@ -1,345 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / StrategyEvolutionConfig - -# Interface: StrategyEvolutionConfig - -Defined in: [runtime/strategy-evolution.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L57) - -## Properties - -### environment - -> **environment**: [`AgenticSurface`](AgenticSurface.md) - -Defined in: [runtime/strategy-evolution.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L58) - -*** - -### tasks - -> **tasks**: (`offset`, `n`) => `Promise`\<[`AgenticTask`](AgenticTask.md)[]\> - -Defined in: [runtime/strategy-evolution.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L62) - -Task supply by DISJOINT slice: `(offset, n)` must return n tasks unique to that - offset range. Train draws [0, trainN); the holdout draws [trainN + holdoutOffset, - …) — tasks the search never touched. - -#### Parameters - -##### offset - -`number` - -##### n - -`number` - -#### Returns - -`Promise`\<[`AgenticTask`](AgenticTask.md)[]\> - -*** - -### trainN - -> **trainN**: `number` - -Defined in: [runtime/strategy-evolution.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L63) - -*** - -### holdoutN - -> **holdoutN**: `number` - -Defined in: [runtime/strategy-evolution.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L64) - -*** - -### holdoutOffset? - -> `optional` **holdoutOffset?**: `number` - -Defined in: [runtime/strategy-evolution.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L66) - -Extra offset past the train slice for the holdout draw (rotate across runs). - -*** - -### worker - -> **worker**: [`AgenticOptions`](AgenticOptions.md) - -Defined in: [runtime/strategy-evolution.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L67) - -*** - -### author - -> **author**: [`EvolutionAuthor`](EvolutionAuthor.md) - -Defined in: [runtime/strategy-evolution.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L68) - -*** - -### budget? - -> `optional` **budget?**: `number` - -Defined in: [runtime/strategy-evolution.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L70) - -Rollouts (sample) / shots (refine) per strategy per task. Default 3. - -*** - -### concurrency? - -> `optional` **concurrency?**: `number` - -Defined in: [runtime/strategy-evolution.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L71) - -*** - -### generations? - -> `optional` **generations?**: `number` - -Defined in: [runtime/strategy-evolution.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L73) - -Author→tournament rounds after gen0. Default 2. - -*** - -### populationSize? - -> `optional` **populationSize?**: `number` - -Defined in: [runtime/strategy-evolution.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L75) - -Authored candidates per generation. Default 2. - -*** - -### baselines? - -> `optional` **baselines?**: [`Strategy`](Strategy.md)[] - -Defined in: [runtime/strategy-evolution.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L77) - -The gen0 field. Default [sample, refine, sampleThenRefine]. - -*** - -### objective? - -> `optional` **objective?**: `"score"` \| `"cost"` - -Defined in: [runtime/strategy-evolution.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L83) - -What "better" means for PROMOTION. 'score' (default): the candidate must beat the - incumbent's score (superiority gate). 'cost': the candidate must prove score - NON-INFERIORITY (not worse by more than `scoreTolerance`) plus significant cost - savings — the "same quality, cheaper" objective. The author is told the objective - and sees per-task spend either way. - -*** - -### scoreTolerance? - -> `optional` **scoreTolerance?**: `number` - -Defined in: [runtime/strategy-evolution.ts:85](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L85) - -Cost objective: the score CI lower bound must clear −scoreTolerance. Default 0.05. - -*** - -### champion? - -> `optional` **champion?**: [`ChampionPolicy`](../type-aliases/ChampionPolicy.md) - -Defined in: [runtime/strategy-evolution.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L87) - -Search-side champion selection. Default 'costAware'. - -*** - -### championEpsilon? - -> `optional` **championEpsilon?**: `number` - -Defined in: [runtime/strategy-evolution.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L89) - -Score band treated as a tie under 'costAware'. Default 0.01. - -*** - -### outDir - -> **outDir**: `string` - -Defined in: [runtime/strategy-evolution.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L91) - -Where authored modules are written. - -*** - -### minPairedTasks? - -> `optional` **minPairedTasks?**: `number` - -Defined in: [runtime/strategy-evolution.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L93) - -Promotion-gate evidence floor (paired holdout tasks). - -*** - -### band? - -> `optional` **band?**: `object` - -Defined in: [runtime/strategy-evolution.ts:102](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L102) - -BAND-AWARE scoring — concentrate the measurement where lift is possible. - Holdout: draw `holdoutPoolN` candidate tasks and run `baselines[0]` once at the run - budget as an INDEPENDENT reference screen; keep tasks scoring ≤ `maxRefScore` - (headroom exists) and take the first `holdoutN`. Band membership is decided before - either finalist touches a task and both finalists then face the SAME tasks — the - estimand becomes "paired lift on headroom tasks", pre-registered by this config. - Train: champion selection ignores zero-spread tasks (every field strategy scored - identically — zero selection information, pure noise dilution). - -#### holdoutPoolN - -> **holdoutPoolN**: `number` - -#### maxRefScore? - -> `optional` **maxRefScore?**: `number` - -Keep holdout tasks where the reference scores ≤ this. Default 0.99 — drop only - tasks the reference already solves fully (no headroom, a candidate can only tie). - -*** - -### lossesDetail? - -> `optional` **lossesDetail?**: `"exact"` \| `"binary"` - -Defined in: [runtime/strategy-evolution.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L111) - -What the author learns from a tournament. 'exact' (default) = scores + progressions - per task; 'binary' = pass/fail only — the leakage-bounded channel (one bit per cell - per generation reaches the author from the evaluation data). - -*** - -### reproducerCheck? - -> `optional` **reproducerCheck?**: `object` - -Defined in: [runtime/strategy-evolution.ts:118](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L118) - -Reproducer certification (arXiv:2606.11045): when the final champion is AUTHORED, - compress it to a short natural-language summary, have a fresh author re-implement - from the summary alone (no losses, no code), and score the reproduction on the same - holdout. A reproduction gap is an overfitting signal (their detector: 100% - sensitivity / 91% specificity in the ML-agent setting) — recorded on the report, - never gate-blocking in v1. - -#### summaryMaxWords? - -> `optional` **summaryMaxWords?**: `number` - -Word budget for the strategy summary. Default 64. - -#### tolerance? - -> `optional` **tolerance?**: `number` - -Reproduction counts as faithful when reproducedScore ≥ championScore − tolerance. - Default 0.05. - -*** - -### checkpoint? - -> `optional` **checkpoint?**: `object` - -Defined in: [runtime/strategy-evolution.ts:128](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L128) - -Endurance: write the run state after every completed phase; with `resume`, a - restart skips completed phases (authored modules re-imported from their files). - Worst case after a mid-run death is re-paying ONE phase, never the run. - -#### path - -> **path**: `string` - -#### resume? - -> `optional` **resume?**: `boolean` - -*** - -### onPhase? - -> `optional` **onPhase?**: (`phase`) => `Promise`\<`void`\> - -Defined in: [runtime/strategy-evolution.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L135) - -Called before each benchmark phase (gen0, gen1…, band-screen, holdout, reproduce). - The seam for environment recycling — no artifacts span phases, so a runner may - recreate a wedge-prone environment container here. - -#### Parameters - -##### phase - -`string` - -#### Returns - -`Promise`\<`void`\> - -*** - -### onTask? - -> `optional` **onTask?**: (`phase`, `row`, `done`, `total`) => `void` - -Defined in: [runtime/strategy-evolution.ts:136](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L136) - -#### Parameters - -##### phase - -`string` - -##### row - -[`BenchmarkTaskRow`](BenchmarkTaskRow.md) - -##### done - -`number` - -##### total - -`number` - -#### Returns - -`void` - -*** - -### hooks? - -> `optional` **hooks?**: [`RuntimeHooks`](../../index/interfaces/RuntimeHooks.md) - -Defined in: [runtime/strategy-evolution.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L137) diff --git a/docs/api/runtime/interfaces/StrategyResult.md b/docs/api/runtime/interfaces/StrategyResult.md deleted file mode 100644 index 834084d..0000000 --- a/docs/api/runtime/interfaces/StrategyResult.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / StrategyResult - -# Interface: StrategyResult - -Defined in: [runtime/strategy.ts:700](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L700) - -## Properties - -### score - -> **score**: `number` - -Defined in: [runtime/strategy.ts:701](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L701) - -*** - -### resolved - -> **resolved**: `boolean` - -Defined in: [runtime/strategy.ts:702](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L702) - -*** - -### completions - -> **completions**: `number` - -Defined in: [runtime/strategy.ts:703](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L703) - -*** - -### progression - -> **progression**: `number`[] - -Defined in: [runtime/strategy.ts:704](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L704) - -*** - -### shots - -> **shots**: `number` - -Defined in: [runtime/strategy.ts:705](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L705) diff --git a/docs/api/runtime/interfaces/Supervisor.md b/docs/api/runtime/interfaces/Supervisor.md deleted file mode 100644 index 9abc102..0000000 --- a/docs/api/runtime/interfaces/Supervisor.md +++ /dev/null @@ -1,67 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Supervisor - -# Interface: Supervisor\ - -Defined in: [runtime/supervise/types.ts:427](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L427) - -Owns the conserved pool, the spawn log, the abort cascade, the OTP intensity breaker, -and the root handle. `run` executes the root `Agent` to completion; `attach` wires a -live `RootHandle` (the Q2 substrate the chat/pi-viz client later consumes). - -## Type Parameters - -### Task - -`Task` - -### Out - -`Out` - -## Methods - -### run() - -> **run**(`root`, `task`, `opts`): `Promise`\<[`SupervisedResult`](../type-aliases/SupervisedResult.md)\<`Out`\>\> - -Defined in: [runtime/supervise/types.ts:428](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L428) - -#### Parameters - -##### root - -[`Agent`](Agent.md)\<`Task`, `Out`\> - -##### task - -`Task` - -##### opts - -[`SupervisorOpts`](SupervisorOpts.md) - -#### Returns - -`Promise`\<[`SupervisedResult`](../type-aliases/SupervisedResult.md)\<`Out`\>\> - -*** - -### attach() - -> **attach**(`h`): `void` - -Defined in: [runtime/supervise/types.ts:429](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L429) - -#### Parameters - -##### h - -[`RootHandle`](RootHandle.md)\<`Out`\> - -#### Returns - -`void` diff --git a/docs/api/runtime/interfaces/SupervisorOpts.md b/docs/api/runtime/interfaces/SupervisorOpts.md deleted file mode 100644 index af1a898..0000000 --- a/docs/api/runtime/interfaces/SupervisorOpts.md +++ /dev/null @@ -1,119 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / SupervisorOpts - -# Interface: SupervisorOpts - -Defined in: [runtime/supervise/types.ts:432](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L432) - -## Properties - -### budget - -> `readonly` **budget**: [`Budget`](Budget.md) - -Defined in: [runtime/supervise/types.ts:434](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L434) - -The root conserved-pool ceiling (tokens + usd + iterations + deadline). - -*** - -### runId - -> `readonly` **runId**: `string` - -Defined in: [runtime/supervise/types.ts:436](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L436) - -Trace-correlation root + the journal/blob root key. - -*** - -### journal - -> `readonly` **journal**: [`SpawnJournal`](SpawnJournal.md) - -Defined in: [runtime/supervise/types.ts:438](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L438) - -Event source — defaults to the in-memory journal in the impl; pass JSONL/FS for durability. - -*** - -### blobs - -> `readonly` **blobs**: [`ResultBlobStore`](ResultBlobStore.md) - -Defined in: [runtime/supervise/types.ts:440](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L440) - -Result payload store backing `outRef` rehydration. - -*** - -### executors - -> `readonly` **executors**: [`ExecutorRegistry`](ExecutorRegistry.md) - -Defined in: [runtime/supervise/types.ts:442](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L442) - -Executor resolution — the open registry mapping `AgentSpec` → `Executor`. - -*** - -### maxDepth? - -> `readonly` `optional` **maxDepth?**: `number` - -Defined in: [runtime/supervise/types.ts:444](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L444) - -Runtime recursion-depth ceiling (paired with the conserved pool per R3). - -*** - -### maxRestarts? - -> `readonly` `optional` **maxRestarts?**: `number` - -Defined in: [runtime/supervise/types.ts:449](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L449) - -OTP intensity breaker: more than `maxRestarts` child restarts within `withinMs` -trips the supervisor to `no-winner` rather than restarting forever. - -*** - -### withinMs? - -> `readonly` `optional` **withinMs?**: `number` - -Defined in: [runtime/supervise/types.ts:450](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L450) - -*** - -### now? - -> `readonly` `optional` **now?**: () => `number` - -Defined in: [runtime/supervise/types.ts:451](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L451) - -#### Returns - -`number` - -*** - -### signal? - -> `readonly` `optional` **signal?**: `AbortSignal` - -Defined in: [runtime/supervise/types.ts:452](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L452) - -*** - -### hooks? - -> `readonly` `optional` **hooks?**: [`RuntimeHooks`](../../index/interfaces/RuntimeHooks.md) - -Defined in: [runtime/supervise/types.ts:455](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L455) - -Lifecycle stream sink, threaded into the root `Scope` so every `spawn`/settle emits on the - same `agent.spawn`/`agent.child` stream `runLoop` feeds — one observable recursive tree. diff --git a/docs/api/runtime/interfaces/SurfaceScore.md b/docs/api/runtime/interfaces/SurfaceScore.md deleted file mode 100644 index d34a5cb..0000000 --- a/docs/api/runtime/interfaces/SurfaceScore.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / SurfaceScore - -# Interface: SurfaceScore - -Defined in: [runtime/strategy.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L68) - -## Properties - -### passes - -> **passes**: `number` - -Defined in: [runtime/strategy.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L69) - -*** - -### total - -> **total**: `number` - -Defined in: [runtime/strategy.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L70) - -*** - -### errored - -> **errored**: `number` - -Defined in: [runtime/strategy.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L72) - -Checks excluded as malformed (data defect, not the agent). `total === 0` ⇒ unscoreable. diff --git a/docs/api/runtime/interfaces/ToolSpec.md b/docs/api/runtime/interfaces/ToolSpec.md deleted file mode 100644 index beb1462..0000000 --- a/docs/api/runtime/interfaces/ToolSpec.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ToolSpec - -# Interface: ToolSpec - -Defined in: [runtime/router-client.ts:176](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L176) - -## Properties - -### type - -> **type**: `"function"` - -Defined in: [runtime/router-client.ts:177](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L177) - -*** - -### function - -> **function**: `object` - -Defined in: [runtime/router-client.ts:178](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/router-client.ts#L178) - -#### name - -> **name**: `string` - -#### description? - -> `optional` **description?**: `string` - -#### parameters - -> **parameters**: `unknown` diff --git a/docs/api/runtime/interfaces/ToolStepInput.md b/docs/api/runtime/interfaces/ToolStepInput.md deleted file mode 100644 index f605470..0000000 --- a/docs/api/runtime/interfaces/ToolStepInput.md +++ /dev/null @@ -1,52 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ToolStepInput - -# Interface: ToolStepInput - -Defined in: [runtime/supervise/trace-source.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L23) - -## Properties - -### toolName - -> `readonly` **toolName**: `string` - -Defined in: [runtime/supervise/trace-source.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L24) - -*** - -### args - -> `readonly` **args**: `unknown` - -Defined in: [runtime/supervise/trace-source.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L25) - -*** - -### status? - -> `readonly` `optional` **status?**: `"error"` \| `"ok"` - -Defined in: [runtime/supervise/trace-source.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L26) - -*** - -### result? - -> `readonly` `optional` **result?**: `unknown` - -Defined in: [runtime/supervise/trace-source.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L27) - -*** - -### callId? - -> `readonly` `optional` **callId?**: `string` - -Defined in: [runtime/supervise/trace-source.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L30) - -Stable id of the tool call — used to de-duplicate the repeated state transitions a harness - streams for one call (opencode emits pending→running→completed, plus a `raw`-wrapped copy). diff --git a/docs/api/runtime/interfaces/TraceSource.md b/docs/api/runtime/interfaces/TraceSource.md deleted file mode 100644 index 19b8a2a..0000000 --- a/docs/api/runtime/interfaces/TraceSource.md +++ /dev/null @@ -1,44 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / TraceSource - -# Interface: TraceSource - -Defined in: [runtime/supervise/trace-source.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L33) - -## Methods - -### onSpan() - -> **onSpan**(`handler`): () => `void` - -Defined in: [runtime/supervise/trace-source.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L36) - -Subscribe to tool spans as they are produced (ONLINE). Returns an unsubscribe. A source that - only exposes its trace at the end registers nothing and returns a no-op. - -#### Parameters - -##### handler - -(`span`) => `void` - -#### Returns - -() => `void` - -*** - -### collect() - -> **collect**(): `Promise`\<`ToolSpan`[]\> - -Defined in: [runtime/supervise/trace-source.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L38) - -The full set of tool spans for the run (SETTLE / batch). Always available. - -#### Returns - -`Promise`\<`ToolSpan`[]\> diff --git a/docs/api/runtime/interfaces/TrajectoryAnalysis.md b/docs/api/runtime/interfaces/TrajectoryAnalysis.md deleted file mode 100644 index 8170f40..0000000 --- a/docs/api/runtime/interfaces/TrajectoryAnalysis.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / TrajectoryAnalysis - -# Interface: TrajectoryAnalysis - -Defined in: [runtime/supervise/trajectory-recorder.ts:15](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trajectory-recorder.ts#L15) - -## Properties - -### trajectory - -> `readonly` **trajectory**: `Trajectory` - -Defined in: [runtime/supervise/trajectory-recorder.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trajectory-recorder.ts#L18) - -Structured run summary (tool-call count, step order). Steps carry a single timestamp, so per-span - duration is 0; loop/waste detection keys on call PATTERNS + cross-span windows, not durations. - -*** - -### stuckLoop - -> `readonly` **stuckLoop**: `StuckLoopReport` - -Defined in: [runtime/supervise/trajectory-recorder.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trajectory-recorder.ts#L21) - -Full-run repeated-call view (total occurrences + window) — catches a loop the online consecutive - detector interleaves past. - -*** - -### toolWaste - -> `readonly` **toolWaste**: `ToolWasteReport` - -Defined in: [runtime/supervise/trajectory-recorder.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trajectory-recorder.ts#L23) - -Wasted-vs-total tool-call ratio for the run. diff --git a/docs/api/runtime/interfaces/TrajectoryNode.md b/docs/api/runtime/interfaces/TrajectoryNode.md deleted file mode 100644 index 88b74b9..0000000 --- a/docs/api/runtime/interfaces/TrajectoryNode.md +++ /dev/null @@ -1,113 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / TrajectoryNode - -# Interface: TrajectoryNode - -Defined in: [runtime/personify/wave-types.ts:506](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L506) - -One node in the reconstructed trajectory tree — a driver OR a leaf, with its OWN spend and the -spend ROLLED UP over its subtree. Reconstructed from the `SpawnJournal` (structure + per-node -`Spend`) + the `ResultBlobStore` (the `out` artifact, rehydrated by `outRef`). The realized tree -shape: `parent`/`children` are the actual spawn edges the run took, not a planned topology. - -## Properties - -### id - -> `readonly` **id**: `string` - -Defined in: [runtime/personify/wave-types.ts:507](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L507) - -*** - -### parent? - -> `readonly` `optional` **parent?**: `string` - -Defined in: [runtime/personify/wave-types.ts:508](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L508) - -*** - -### children - -> `readonly` **children**: readonly `string`[] - -Defined in: [runtime/personify/wave-types.ts:509](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L509) - -*** - -### label - -> `readonly` **label**: `string` - -Defined in: [runtime/personify/wave-types.ts:510](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L510) - -*** - -### runtime - -> `readonly` **runtime**: `string` - -Defined in: [runtime/personify/wave-types.ts:511](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L511) - -*** - -### status - -> `readonly` **status**: `"failed"` \| `"cancelled"` \| `"pending"` \| `"done"` - -Defined in: [runtime/personify/wave-types.ts:513](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L513) - -Terminal status the journal recorded for this node. - -*** - -### ownSpend - -> `readonly` **ownSpend**: [`Spend`](Spend.md) - -Defined in: [runtime/personify/wave-types.ts:515](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L515) - -This node's OWN conserved spend (from its `settled` event). - -*** - -### rolledUpSpend - -> `readonly` **rolledUpSpend**: [`Spend`](Spend.md) - -Defined in: [runtime/personify/wave-types.ts:518](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L518) - -This node's spend PLUS every descendant's — the rolled-up subtree cost. The cost a parent - "really" consumed inclusive of its children's fanout (the equal-k-on-cost basis). - -*** - -### verdict? - -> `readonly` `optional` **verdict?**: `DefaultVerdict` - -Defined in: [runtime/personify/wave-types.ts:520](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L520) - -The node's verdict, when its settlement carried one (observability — NOT a steer input). - -*** - -### output? - -> `readonly` `optional` **output?**: `unknown` - -Defined in: [runtime/personify/wave-types.ts:522](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L522) - -The rehydrated output artifact, when `withOutputs` was requested + the blob resolved. - -*** - -### outRef? - -> `readonly` `optional` **outRef?**: `string` - -Defined in: [runtime/personify/wave-types.ts:523](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L523) diff --git a/docs/api/runtime/interfaces/TrajectoryReport.md b/docs/api/runtime/interfaces/TrajectoryReport.md deleted file mode 100644 index 37fae58..0000000 --- a/docs/api/runtime/interfaces/TrajectoryReport.md +++ /dev/null @@ -1,50 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / TrajectoryReport - -# Interface: TrajectoryReport - -Defined in: [runtime/personify/wave-types.ts:528](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L528) - -The whole reconstructed trajectory — the realized tree + its root-rolled-up total. The - per-node + rolled-up `Spend` is the evidence both the trace viewer and `equalKOnCost` read. - -## Properties - -### root - -> `readonly` **root**: `string` - -Defined in: [runtime/personify/wave-types.ts:529](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L529) - -*** - -### nodes - -> `readonly` **nodes**: readonly [`TrajectoryNode`](TrajectoryNode.md)[] - -Defined in: [runtime/personify/wave-types.ts:531](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L531) - -Every node, in cursor/spawn order — the realized tree (`parent`/`children` are the real edges). - -*** - -### total - -> `readonly` **total**: [`Spend`](Spend.md) - -Defined in: [runtime/personify/wave-types.ts:533](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L533) - -The root's rolled-up spend — the whole run's conserved total (tokens + usd + iterations + ms). - -*** - -### statusCounts - -> `readonly` **statusCounts**: `Readonly`\<`Record`\<[`TrajectoryNode`](TrajectoryNode.md)\[`"status"`\], `number`\>\> - -Defined in: [runtime/personify/wave-types.ts:535](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L535) - -Count of nodes by terminal status — a quick "how did the tree end" readout. diff --git a/docs/api/runtime/interfaces/TrajectoryReportOptions.md b/docs/api/runtime/interfaces/TrajectoryReportOptions.md deleted file mode 100644 index be6b92f..0000000 --- a/docs/api/runtime/interfaces/TrajectoryReportOptions.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / TrajectoryReportOptions - -# Interface: TrajectoryReportOptions - -Defined in: [runtime/personify/wave-types.ts:545](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L545) - -`trajectoryReport(journal, blobs, root, { withOutputs? })` — reconstruct the whole tree with -per-node + rolled-up `Spend`. Reads the journal for structure + spend and (when `withOutputs`) -the blob store for each `done` node's artifact. Fail loud on a tree that was never journaled or -a `done` node whose blob the store cannot rehydrate (a silent gap would mis-cost the tree). The -impl lives in `trajectory.ts`. - -## Properties - -### withOutputs? - -> `readonly` `optional` **withOutputs?**: `boolean` - -Defined in: [runtime/personify/wave-types.ts:547](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L547) - -Rehydrate each `done` node's `output` from the blob store. Off by default (cost-only report). diff --git a/docs/api/runtime/interfaces/TreeView.md b/docs/api/runtime/interfaces/TreeView.md deleted file mode 100644 index efbfda0..0000000 --- a/docs/api/runtime/interfaces/TreeView.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / TreeView - -# Interface: TreeView - -Defined in: [runtime/supervise/types.ts:351](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L351) - -The live tree — what `scope.view` / `RootHandle.view()` materialize for a viewer. - -## Properties - -### root - -> `readonly` **root**: `string` - -Defined in: [runtime/supervise/types.ts:352](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L352) - -*** - -### nodes - -> `readonly` **nodes**: readonly [`NodeSnapshot`](NodeSnapshot.md)[] - -Defined in: [runtime/supervise/types.ts:353](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L353) - -*** - -### inFlight - -> `readonly` **inFlight**: `number` - -Defined in: [runtime/supervise/types.ts:355](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L355) - -Count of nodes in `running` or `acquiring` — the "what's in flow?" answer. diff --git a/docs/api/runtime/interfaces/TurnResult.md b/docs/api/runtime/interfaces/TurnResult.md deleted file mode 100644 index e33246e..0000000 --- a/docs/api/runtime/interfaces/TurnResult.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / TurnResult - -# Interface: TurnResult\ - -Defined in: [runtime/sandbox-run.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L60) - -**`Experimental`** - -One finished turn over the artifact. A failed FS read is surfaced in `readError` -(never masked as an empty deliverable) so a caller distinguishes "agent produced -nothing" from a transport/FS fault. - -## Type Parameters - -### Out - -`Out` - -## Properties - -### out - -> **out**: `Out` - -Defined in: [runtime/sandbox-run.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L61) - -**`Experimental`** - -*** - -### events - -> **events**: `SandboxEvent`[] - -Defined in: [runtime/sandbox-run.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L62) - -**`Experimental`** - -*** - -### readError? - -> `optional` **readError?**: `string` - -Defined in: [runtime/sandbox-run.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L63) - -**`Experimental`** diff --git a/docs/api/runtime/interfaces/UsageSink.md b/docs/api/runtime/interfaces/UsageSink.md deleted file mode 100644 index 10450a6..0000000 --- a/docs/api/runtime/interfaces/UsageSink.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / UsageSink - -# Interface: UsageSink - -Defined in: [runtime/report-usage.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/report-usage.ts#L24) - -The slice of an agent-eval campaign `DispatchContext.cost` this needs. - -## Methods - -### observe() - -> **observe**(`amountUsd`, `source`): `void` - -Defined in: [runtime/report-usage.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/report-usage.ts#L25) - -#### Parameters - -##### amountUsd - -`number` - -##### source - -`string` - -#### Returns - -`void` - -*** - -### observeTokens() - -> **observeTokens**(`usage`): `void` - -Defined in: [runtime/report-usage.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/report-usage.ts#L26) - -#### Parameters - -##### usage - -[`LoopTokenUsage`](LoopTokenUsage.md) - -#### Returns - -`void` diff --git a/docs/api/runtime/interfaces/ValidationCtx.md b/docs/api/runtime/interfaces/ValidationCtx.md deleted file mode 100644 index 7bc8b0f..0000000 --- a/docs/api/runtime/interfaces/ValidationCtx.md +++ /dev/null @@ -1,63 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ValidationCtx - -# Interface: ValidationCtx - -Defined in: [runtime/types.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L32) - -**`Experimental`** - -## Properties - -### iteration - -> **iteration**: `number` - -Defined in: [runtime/types.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L34) - -**`Experimental`** - -Iteration index this output came from (0-based). - -*** - -### box? - -> `optional` **box?**: `SandboxInstance` - -Defined in: [runtime/types.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L40) - -**`Experimental`** - -Live sandbox for this iteration. Validators that need execution-grounded -evidence can inspect files or run commands here instead of forcing callers -to bypass the loop kernel with raw Sandbox SDK orchestration. - -*** - -### signal - -> **signal**: `AbortSignal` - -Defined in: [runtime/types.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L42) - -**`Experimental`** - -Cooperative cancellation channel. - -*** - -### traceEmitter? - -> `optional` **traceEmitter?**: [`LoopTraceEmitter`](LoopTraceEmitter.md) - -Defined in: [runtime/types.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L48) - -**`Experimental`** - -Optional trace emitter. When set, validator implementations that make -LLM calls (e.g. an LLM-judge reviewer) emit spans into it. -The kernel passes `ctx.traceEmitter` from `ExecCtx` when available. diff --git a/docs/api/runtime/interfaces/Validator.md b/docs/api/runtime/interfaces/Validator.md deleted file mode 100644 index 381485d..0000000 --- a/docs/api/runtime/interfaces/Validator.md +++ /dev/null @@ -1,45 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Validator - -# Interface: Validator\ - -Defined in: [runtime/types.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L52) - -**`Experimental`** - -## Type Parameters - -### Output - -`Output` - -### Verdict - -`Verdict` = `DefaultVerdict` - -## Methods - -### validate() - -> **validate**(`output`, `ctx`): `Promise`\<`Verdict`\> - -Defined in: [runtime/types.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L53) - -**`Experimental`** - -#### Parameters - -##### output - -`Output` - -##### ctx - -[`ValidationCtx`](ValidationCtx.md) - -#### Returns - -`Promise`\<`Verdict`\> diff --git a/docs/api/runtime/interfaces/VerifierEnvironmentOptions.md b/docs/api/runtime/interfaces/VerifierEnvironmentOptions.md deleted file mode 100644 index 991ff92..0000000 --- a/docs/api/runtime/interfaces/VerifierEnvironmentOptions.md +++ /dev/null @@ -1,79 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / VerifierEnvironmentOptions - -# Interface: VerifierEnvironmentOptions - -Defined in: [runtime/verifier-environment.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/verifier-environment.ts#L34) - -## Properties - -### name - -> **name**: `string` - -Defined in: [runtime/verifier-environment.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/verifier-environment.ts#L35) - -*** - -### extraTools? - -> `optional` **extraTools?**: [`AgenticTool`](AgenticTool.md)[] - -Defined in: [runtime/verifier-environment.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/verifier-environment.ts#L39) - -Extra domain tools (read-only helpers: calculator, retrieval, style lookup). - -## Methods - -### check() - -> **check**(`task`, `answer`): [`SurfaceScore`](SurfaceScore.md) \| `Promise`\<[`SurfaceScore`](SurfaceScore.md)\> - -Defined in: [runtime/verifier-environment.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/verifier-environment.ts#L37) - -The deployable check over a submitted answer. Graded via passes/total. - -#### Parameters - -##### task - -[`AgenticTask`](AgenticTask.md) - -##### answer - -`string` - -#### Returns - -[`SurfaceScore`](SurfaceScore.md) \| `Promise`\<[`SurfaceScore`](SurfaceScore.md)\> - -*** - -### callExtra()? - -> `optional` **callExtra**(`task`, `name`, `args`): `string` \| `Promise`\<`string`\> - -Defined in: [runtime/verifier-environment.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/verifier-environment.ts#L41) - -Executes the extra tools. Required when `extraTools` is set. - -#### Parameters - -##### task - -[`AgenticTask`](AgenticTask.md) - -##### name - -`string` - -##### args - -`Record`\<`string`, `unknown`\> - -#### Returns - -`string` \| `Promise`\<`string`\> diff --git a/docs/api/runtime/interfaces/VerifySpec.md b/docs/api/runtime/interfaces/VerifySpec.md deleted file mode 100644 index c673c63..0000000 --- a/docs/api/runtime/interfaces/VerifySpec.md +++ /dev/null @@ -1,123 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / VerifySpec - -# Interface: VerifySpec\ - -Defined in: [runtime/personify/wave-types.ts:256](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L256) - -`verify({ implement, verifier })` — the 2-node sequential gate: an IMPLEMENT child produces a -candidate, then a SEPARATE VERIFIER child's verdict GATES shippability. A `valid` verifier -verdict ships the implement deliverable; any other outcome (implement down, verifier down, -invalid verdict) becomes a concrete blocker carrying the failure verbatim — never a coerced -"done". The verifier is a distinct keystone agent (selector≠judge: the implement child does -not grade itself). - -No domain: "write code then run the test gate" and "draft then fact-check" are the same `verify` -shape under different personas; the gate rubric is the verifier persona's, not the combinator's. - -## Type Parameters - -### Task - -`Task` - -### Candidate - -`Candidate` - -### D - -`D` - -## Properties - -### implementLabel? - -> `readonly` `optional` **implementLabel?**: `string` - -Defined in: [runtime/personify/wave-types.ts:264](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L264) - -Implement / verifier child labels (default `implement` / `verify` in the impl). - -*** - -### verifierLabel? - -> `readonly` `optional` **verifierLabel?**: `string` - -Defined in: [runtime/personify/wave-types.ts:265](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L265) - -## Methods - -### implement() - -> **implement**(`rootTask`, `ctx`): `unknown` - -Defined in: [runtime/personify/wave-types.ts:258](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L258) - -Build the implement child's task from the root task. - -#### Parameters - -##### rootTask - -`Task` - -##### ctx - -[`ShapeContext`](ShapeContext.md)\<`D`\> - -#### Returns - -`unknown` - -*** - -### verifier() - -> **verifier**(`candidate`, `ctx`): `unknown` - -Defined in: [runtime/personify/wave-types.ts:260](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L260) - -Build the verifier child's task from the implement child's settled candidate. - -#### Parameters - -##### candidate - -[`Settled`](../type-aliases/Settled.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`Candidate`\>\> - -##### ctx - -[`ShapeContext`](ShapeContext.md)\<`D`\> - -#### Returns - -`unknown` - -*** - -### collect() - -> **collect**(`candidate`, `verdict`): [`Outcome`](../type-aliases/Outcome.md)\<`D`\> - -Defined in: [runtime/personify/wave-types.ts:262](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L262) - -Project the gated (verifier-`valid`) candidate into the terminal deliverable. - -#### Parameters - -##### candidate - -[`Settled`](../type-aliases/Settled.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`Candidate`\>\> - -##### verdict - -`DefaultVerdict` - -#### Returns - -[`Outcome`](../type-aliases/Outcome.md)\<`D`\> diff --git a/docs/api/runtime/interfaces/WatchTraceOptions.md b/docs/api/runtime/interfaces/WatchTraceOptions.md deleted file mode 100644 index c692517..0000000 --- a/docs/api/runtime/interfaces/WatchTraceOptions.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / WatchTraceOptions - -# Interface: WatchTraceOptions - -Defined in: [runtime/supervise/detector-monitor.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/detector-monitor.ts#L22) - -## Properties - -### detectors? - -> `readonly` `optional` **detectors?**: readonly `StreamingDetector`[] - -Defined in: [runtime/supervise/detector-monitor.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/detector-monitor.ts#L24) - -The detectors to run online. Defaults to a stuck-loop + error-streak panel. - -*** - -### onSignal? - -> `readonly` `optional` **onSignal?**: (`signal`, `span`) => `void` \| `Promise`\<`void`\> - -Defined in: [runtime/supervise/detector-monitor.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/detector-monitor.ts#L26) - -Fired for each signal a detector raises — the seam that raises a `finding` on the bus. - -#### Parameters - -##### signal - -`DetectorSignal` - -##### span - -`ToolSpan` - -#### Returns - -`void` \| `Promise`\<`void`\> diff --git a/docs/api/runtime/interfaces/WaterfallCollector.md b/docs/api/runtime/interfaces/WaterfallCollector.md deleted file mode 100644 index 7188589..0000000 --- a/docs/api/runtime/interfaces/WaterfallCollector.md +++ /dev/null @@ -1,69 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / WaterfallCollector - -# Interface: WaterfallCollector - -Defined in: [runtime/waterfall.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L49) - -## Properties - -### hooks - -> **hooks**: [`RuntimeHooks`](../../index/interfaces/RuntimeHooks.md) - -Defined in: [runtime/waterfall.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L51) - -Attach these to RunAgenticOptions.hooks / BenchmarkConfig.hooks. - -## Methods - -### report() - -> **report**(): [`WaterfallReport`](WaterfallReport.md) - -Defined in: [runtime/waterfall.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L52) - -#### Returns - -[`WaterfallReport`](WaterfallReport.md) - -*** - -### render() - -> **render**(`opts?`): `string` - -Defined in: [runtime/waterfall.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L54) - -The text waterfall — one row per span, bars scaled to the observed window. - -#### Parameters - -##### opts? - -###### width? - -`number` - -###### maxRows? - -`number` - -#### Returns - -`string` - -*** - -### reset() - -> **reset**(): `void` - -Defined in: [runtime/waterfall.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L55) - -#### Returns - -`void` diff --git a/docs/api/runtime/interfaces/WaterfallReport.md b/docs/api/runtime/interfaces/WaterfallReport.md deleted file mode 100644 index 39af574..0000000 --- a/docs/api/runtime/interfaces/WaterfallReport.md +++ /dev/null @@ -1,61 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / WaterfallReport - -# Interface: WaterfallReport - -Defined in: [runtime/waterfall.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L25) - -## Properties - -### spans - -> **spans**: [`WaterfallSpan`](WaterfallSpan.md)[] - -Defined in: [runtime/waterfall.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L26) - -*** - -### totalMs - -> **totalMs**: `number` - -Defined in: [runtime/waterfall.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L28) - -Wall-clock of the observed window (first spawn → last settle). - -*** - -### totalUsd - -> **totalUsd**: `number` - -Defined in: [runtime/waterfall.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L29) - -*** - -### totalTokens - -> **totalTokens**: `object` - -Defined in: [runtime/waterfall.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L30) - -#### input - -> **input**: `number` - -#### output - -> **output**: `number` - -*** - -### byKind - -> **byKind**: `Record`\<`string`, \{ `count`: `number`; `ms`: `number`; `usd`: `number`; `tokens`: \{ `input`: `number`; `output`: `number`; \}; \}\> - -Defined in: [runtime/waterfall.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L32) - -Rollup by label prefix (the part before ':') — shots vs analysts vs anything else. diff --git a/docs/api/runtime/interfaces/WaterfallSpan.md b/docs/api/runtime/interfaces/WaterfallSpan.md deleted file mode 100644 index 99aaf31..0000000 --- a/docs/api/runtime/interfaces/WaterfallSpan.md +++ /dev/null @@ -1,99 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / WaterfallSpan - -# Interface: WaterfallSpan - -Defined in: [runtime/waterfall.ts:11](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L11) - -## Properties - -### id - -> **id**: `string` - -Defined in: [runtime/waterfall.ts:12](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L12) - -*** - -### label - -> **label**: `string` - -Defined in: [runtime/waterfall.ts:14](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L14) - -The spawn label (`shot:0`, `analyst:1`, a nested agent's label) — the row name. - -*** - -### runId - -> **runId**: `string` - -Defined in: [runtime/waterfall.ts:15](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L15) - -*** - -### parentId? - -> `optional` **parentId?**: `string` - -Defined in: [runtime/waterfall.ts:16](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L16) - -*** - -### startMs - -> **startMs**: `number` - -Defined in: [runtime/waterfall.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L17) - -*** - -### endMs? - -> `optional` **endMs?**: `number` - -Defined in: [runtime/waterfall.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L18) - -*** - -### status - -> **status**: `"running"` \| `"done"` \| `"down"` - -Defined in: [runtime/waterfall.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L19) - -*** - -### usd - -> **usd**: `number` - -Defined in: [runtime/waterfall.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L20) - -*** - -### tokens - -> **tokens**: `object` - -Defined in: [runtime/waterfall.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L21) - -#### input - -> **input**: `number` - -#### output - -> **output**: `number` - -*** - -### score? - -> `optional` **score?**: `number` - -Defined in: [runtime/waterfall.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/waterfall.ts#L22) diff --git a/docs/api/runtime/interfaces/WidenGate.md b/docs/api/runtime/interfaces/WidenGate.md deleted file mode 100644 index 50a9ffa..0000000 --- a/docs/api/runtime/interfaces/WidenGate.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / WidenGate - -# Interface: WidenGate\ - -Defined in: [runtime/supervise/types.ts:507](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L507) - -The progressive-widening gate (MCTS-PW). Decides whether a settled child is -`promising` enough to spawn another under the remaining pool. DEFAULTS TO FLAT -(`shouldWiden` always false) so a gate run never widens and the selector≠judge -firewall conflict (R2) stays dormant. When widening IS enabled, `promising` MUST be -derived from TRACE findings (`analyses`), never raw `verdict` — or the gate carries -an explicit, argued `judgeExempt: true` (the documented escape hatch, off by default). - -## Type Parameters - -### Out - -`Out` - -## Properties - -### judgeExempt? - -> `readonly` `optional` **judgeExempt?**: `boolean` - -Defined in: [runtime/supervise/types.ts:512](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L512) - -When true, widening may read `verdict` directly (collides with the steer firewall — - must be explicitly argued per cell, never defaulted on). - -## Methods - -### shouldWiden() - -> **shouldWiden**(`settled`, `budget`): `boolean` - -Defined in: [runtime/supervise/types.ts:509](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L509) - -Default impl returns false for every settlement (flat — never widens). - -#### Parameters - -##### settled - -[`Settled`](../type-aliases/Settled.md)\<`Out`\> - -##### budget - -`Readonly`\<\{ `tokensLeft`: `number`; `usdLeft`: `number`; `usdCapped`: `boolean`; `deadlineMs`: `number`; `reservedTokens`: `number`; \}\> - -#### Returns - -`boolean` diff --git a/docs/api/runtime/interfaces/WidenLineage.md b/docs/api/runtime/interfaces/WidenLineage.md deleted file mode 100644 index c5943c6..0000000 --- a/docs/api/runtime/interfaces/WidenLineage.md +++ /dev/null @@ -1,62 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / WidenLineage - -# Interface: WidenLineage\ - -Defined in: [runtime/personify/wave-types.ts:329](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L329) - -A lineage the gate may widen toward — the settled child that looked promising + the findings - that justified it (the trace-derived provenance the firewall requires). - -## Type Parameters - -### D - -`D` - -## Properties - -### settled - -> `readonly` **settled**: `object` - -Defined in: [runtime/personify/wave-types.ts:330](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L330) - -#### kind - -> **kind**: `"done"` - -#### handle - -> **handle**: [`Handle`](Handle.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`D`\>\> - -#### out - -> **out**: [`Outcome`](../type-aliases/Outcome.md) - -#### outRef - -> **outRef**: `string` - -#### verdict? - -> `optional` **verdict?**: `DefaultVerdict` - -#### spent - -> **spent**: [`Spend`](Spend.md) - -#### seq - -> **seq**: `number` - -*** - -### findings - -> `readonly` **findings**: readonly `AnalystFinding`[] - -Defined in: [runtime/personify/wave-types.ts:331](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L331) diff --git a/docs/api/runtime/interfaces/WidenSpec.md b/docs/api/runtime/interfaces/WidenSpec.md deleted file mode 100644 index e81b4b5..0000000 --- a/docs/api/runtime/interfaces/WidenSpec.md +++ /dev/null @@ -1,129 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / WidenSpec - -# Interface: WidenSpec\ - -Defined in: [runtime/personify/wave-types.ts:286](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L286) - -`widen({ gate })` (G5) — the STREAMING spawn-on-completion driver. Unlike the static-fanout -combinators above, the widener REACTS to each `scope.next()`: as each child settles it consults -the `WidenGate` and, when a lineage is `promising`, widens by AT MOST ONE child toward it under -the remaining conserved pool. Defaults to FLAT (the gate never widens) so a gate run stays -non-widening and the R2 selector≠judge collision is dormant. `promising` is derived from the -round's analyst FINDINGS (via `ScopeAnalyst`, §2), NOT a child's raw `verdict` — the firewall. - -This is the progressive-widening (MCTS-PW) combinator: the one shape whose breadth is decided -at runtime from the diagnosis, not fixed at spawn. It is the mechanism the diverse-strategy-vs- -blind GATE is run with — kept FLAT by default until that gate returns positive (don't build -mechanism ahead of the gate). - -## Type Parameters - -### Seed - -`Seed` - -### D - -`D` - -## Properties - -### seeds - -> `readonly` **seeds**: readonly `Seed`[] - -Defined in: [runtime/personify/wave-types.ts:289](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L289) - -The initial children to spawn before any widening — the seed lineages the gate widens from. - One child task per seed; bounded by the conserved pool's fail-closed admission. - -*** - -### gate - -> `readonly` **gate**: [`ScopeWidenGate`](ScopeWidenGate.md)\<`D`\> - -Defined in: [runtime/personify/wave-types.ts:296](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L296) - -The progressive-widening gate. Consulted on EVERY settled child with the round's -trace-derived `findings`; returns a widen decision (spawn one more toward a lineage) or a -stop. DEFAULTS to flat via `flatWidenGate` — never widens, so the firewall stays dormant. - -## Methods - -### seedTask() - -> **seedTask**(`seed`, `index`, `ctx`): `unknown` - -Defined in: [runtime/personify/wave-types.ts:290](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L290) - -#### Parameters - -##### seed - -`Seed` - -##### index - -`number` - -##### ctx - -[`ShapeContext`](ShapeContext.md)\<`D`\> - -#### Returns - -`unknown` - -*** - -### widenTask() - -> **widenTask**(`toward`, `ctx`): `unknown` - -Defined in: [runtime/personify/wave-types.ts:298](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L298) - -Build the widened child's task from the lineage the gate chose to extend. - -#### Parameters - -##### toward - -[`WidenLineage`](WidenLineage.md)\<`D`\> - -##### ctx - -[`ShapeContext`](ShapeContext.md)\<`D`\> - -#### Returns - -`unknown` - -*** - -### synthesize() - -> **synthesize**(`gathered`, `ctx`): [`Outcome`](../type-aliases/Outcome.md)\<`D`\> - -Defined in: [runtime/personify/wave-types.ts:301](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L301) - -Synthesize the terminal deliverable from every settled lineage (selector≠judge: the - single-sourced selector over the gathered children, never a re-judge). - -#### Parameters - -##### gathered - -readonly [`Settled`](../type-aliases/Settled.md)\<[`Outcome`](../type-aliases/Outcome.md)\<`D`\>\>[] - -##### ctx - -[`ShapeContext`](ShapeContext.md)\<`D`\> - -#### Returns - -[`Outcome`](../type-aliases/Outcome.md)\<`D`\> diff --git a/docs/api/runtime/interfaces/Workspace.md b/docs/api/runtime/interfaces/Workspace.md deleted file mode 100644 index b60230a..0000000 --- a/docs/api/runtime/interfaces/Workspace.md +++ /dev/null @@ -1,69 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Workspace - -# Interface: Workspace - -Defined in: [runtime/workspace.ts:11](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L11) - -## Properties - -### ref - -> `readonly` **ref**: `string` - -Defined in: [runtime/workspace.ts:12](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L12) - -## Methods - -### materialize() - -> **materialize**(`dir`): `Promise`\<`void`\> - -Defined in: [runtime/workspace.ts:13](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L13) - -#### Parameters - -##### dir - -`string` - -#### Returns - -`Promise`\<`void`\> - -*** - -### commit() - -> **commit**(`dir`, `message`): `Promise`\<[`WorkspaceCommit`](../type-aliases/WorkspaceCommit.md)\> - -Defined in: [runtime/workspace.ts:14](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L14) - -#### Parameters - -##### dir - -`string` - -##### message - -`string` - -#### Returns - -`Promise`\<[`WorkspaceCommit`](../type-aliases/WorkspaceCommit.md)\> - -*** - -### head() - -> **head**(): `Promise`\<`string`\> - -Defined in: [runtime/workspace.ts:15](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L15) - -#### Returns - -`Promise`\<`string`\> diff --git a/docs/api/runtime/interfaces/WorkspaceRun.md b/docs/api/runtime/interfaces/WorkspaceRun.md deleted file mode 100644 index adf9449..0000000 --- a/docs/api/runtime/interfaces/WorkspaceRun.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / WorkspaceRun - -# Interface: WorkspaceRun\ - -Defined in: [runtime/workspace.ts:135](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L135) - -## Type Parameters - -### T - -`T` - -## Properties - -### valid - -> `readonly` **valid**: `boolean` - -Defined in: [runtime/workspace.ts:136](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L136) - -*** - -### value - -> `readonly` **value**: `T` - -Defined in: [runtime/workspace.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L137) - -*** - -### commit? - -> `readonly` `optional` **commit?**: [`WorkspaceCommit`](../type-aliases/WorkspaceCommit.md) - -Defined in: [runtime/workspace.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L139) - -Present when a commit was attempted (valid, or `commitOnInvalid`). diff --git a/docs/api/runtime/interfaces/WorktreeCliExecutorOptions.md b/docs/api/runtime/interfaces/WorktreeCliExecutorOptions.md deleted file mode 100644 index a466ed5..0000000 --- a/docs/api/runtime/interfaces/WorktreeCliExecutorOptions.md +++ /dev/null @@ -1,197 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / WorktreeCliExecutorOptions - -# Interface: WorktreeCliExecutorOptions - -Defined in: [runtime/supervise/worktree-cli-executor.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L43) - -**`Experimental`** - -## Properties - -### repoRoot - -> **repoRoot**: `string` - -Defined in: [runtime/supervise/worktree-cli-executor.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L45) - -**`Experimental`** - -Absolute path to the git checkout the worktree is cut from. - -*** - -### profile - -> **profile**: `AgentProfile` - -Defined in: [runtime/supervise/worktree-cli-executor.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L47) - -**`Experimental`** - -The SUPERVISOR-AUTHORED profile (the §1.5 payload: systemPrompt + model). - -*** - -### harness - -> **harness**: [`LocalHarness`](../../mcp/type-aliases/LocalHarness.md) - -Defined in: [runtime/supervise/worktree-cli-executor.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L49) - -**`Experimental`** - -Which local harness CLI drives this leaf (`claude` | `codex` | `opencode`). - -*** - -### taskPrompt - -> **taskPrompt**: `string` - -Defined in: [runtime/supervise/worktree-cli-executor.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L51) - -**`Experimental`** - -The per-task instruction handed to the harness (composed under the system prompt). - -*** - -### runId? - -> `optional` **runId?**: `string` - -Defined in: [runtime/supervise/worktree-cli-executor.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L53) - -**`Experimental`** - -Unique id for the worktree path + branch. Defaults to a fresh UUID. - -*** - -### baseRef? - -> `optional` **baseRef?**: `string` - -Defined in: [runtime/supervise/worktree-cli-executor.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L55) - -**`Experimental`** - -Override the base ref the worktree is cut from (default `HEAD`). - -*** - -### harnessTimeoutMs? - -> `optional` **harnessTimeoutMs?**: `number` - -Defined in: [runtime/supervise/worktree-cli-executor.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L57) - -**`Experimental`** - -Wall-clock cap per harness subprocess (ms). Default 5 min (the `runLocalHarness` default). - -*** - -### testCmd? - -> `optional` **testCmd?**: `string` - -Defined in: [runtime/supervise/worktree-cli-executor.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L62) - -**`Experimental`** - -Shell command run in the live worktree to derive the tests-PASS signal (e.g. `pnpm test`). -Its exit code becomes `artifact.checks.tests.passed`. Omit to skip (no signal derived). - -*** - -### typecheckCmd? - -> `optional` **typecheckCmd?**: `string` - -Defined in: [runtime/supervise/worktree-cli-executor.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L64) - -**`Experimental`** - -Shell command run in the live worktree to derive the typecheck-PASS signal (e.g. `pnpm typecheck`). - -*** - -### checkTimeoutMs? - -> `optional` **checkTimeoutMs?**: `number` - -Defined in: [runtime/supervise/worktree-cli-executor.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L66) - -**`Experimental`** - -Wall-clock cap per verification command (ms). Default = `harnessTimeoutMs` or 5 min. - -*** - -### runGit? - -> `optional` **runGit?**: [`GitRunner`](../../mcp/type-aliases/GitRunner.md) - -Defined in: [runtime/supervise/worktree-cli-executor.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L68) - -**`Experimental`** - -Test seam — inject a git runner so unit tests drive the worktree helpers without git. - -*** - -### runHarness? - -> `optional` **runHarness?**: (`options`) => `Promise`\<[`LocalHarnessResult`](../../mcp/interfaces/LocalHarnessResult.md)\> - -Defined in: [runtime/supervise/worktree-cli-executor.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L70) - -**`Experimental`** - -Test seam — inject the harness runner so unit tests script a `LocalHarnessResult`. - -**`Experimental`** - -Spawn a local coding harness CLI as a subprocess + collect its output. - -NOT responsible for parsing the harness's output or extracting a diff — -the in-process executor's `streamPrompt` orchestrates `git diff` against -the worktree after this resolves. This function is intentionally narrow: -spawn, wait, capture, return. - -Fails loud — throws when: - - `cwd` doesn't exist (subprocess emits ENOENT; surfaced as Error) - - the harness binary is not on PATH (ENOENT) - -Does NOT throw when: - - the subprocess exits non-zero (`result.exitCode` carries the code) - - the subprocess is aborted / timed out (`result.killedBySignal` / - `result.timedOut` carries the reason) - -#### Parameters - -##### options - -[`RunLocalHarnessOptions`](../../mcp/interfaces/RunLocalHarnessOptions.md) - -#### Returns - -`Promise`\<[`LocalHarnessResult`](../../mcp/interfaces/LocalHarnessResult.md)\> - -*** - -### runCommand? - -> `optional` **runCommand?**: `WorktreeCheckRunner` - -Defined in: [runtime/supervise/worktree-cli-executor.ts:73](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L73) - -**`Experimental`** - -Test seam — inject the verification-command runner so unit tests script test/typecheck - outcomes without spawning a real shell. Defaults to a `/bin/sh -c` spawn in the worktree. diff --git a/docs/api/runtime/interfaces/WorktreeCommandResult.md b/docs/api/runtime/interfaces/WorktreeCommandResult.md deleted file mode 100644 index 9f1afea..0000000 --- a/docs/api/runtime/interfaces/WorktreeCommandResult.md +++ /dev/null @@ -1,51 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / WorktreeCommandResult - -# Interface: WorktreeCommandResult - -Defined in: [mcp/worktree-harness.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree-harness.ts#L39) - -Outcome of one verification command run in the worktree (test or typecheck). - -## Properties - -### command - -> **command**: `string` - -Defined in: [mcp/worktree-harness.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree-harness.ts#L41) - -The shell command line that was run. - -*** - -### passed - -> **passed**: `boolean` - -Defined in: [mcp/worktree-harness.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree-harness.ts#L43) - -Did the command exit 0? The PASS signal a deliverable gate / coder output reads. - -*** - -### exitCode - -> **exitCode**: `number` \| `null` - -Defined in: [mcp/worktree-harness.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree-harness.ts#L45) - -OS exit code, or `null` when killed before exit. - -*** - -### output - -> **output**: `string` - -Defined in: [mcp/worktree-harness.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/worktree-harness.ts#L47) - -Combined stdout+stderr (capped) — surfaced in traces for diagnosis. diff --git a/docs/api/runtime/interfaces/WorktreeFanoutOptions.md b/docs/api/runtime/interfaces/WorktreeFanoutOptions.md deleted file mode 100644 index d1acf10..0000000 --- a/docs/api/runtime/interfaces/WorktreeFanoutOptions.md +++ /dev/null @@ -1,225 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / WorktreeFanoutOptions - -# Interface: WorktreeFanoutOptions - -Defined in: [runtime/supervise/worktree-fanout.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L43) - -**`Experimental`** - -## Extends - -- [`PatchDeliverableOptions`](PatchDeliverableOptions.md) - -## Properties - -### maxDiffLines? - -> `optional` **maxDiffLines?**: `number` - -Defined in: [runtime/supervise/patch-checks.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L38) - -**`Experimental`** - -Default 400. Hard cap; gate fails when exceeded. - -#### Inherited from - -[`PatchDeliverableOptions`](PatchDeliverableOptions.md).[`maxDiffLines`](PatchDeliverableOptions.md#maxdifflines) - -*** - -### forbiddenPaths? - -> `optional` **forbiddenPaths?**: `string`[] - -Defined in: [runtime/supervise/patch-checks.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-checks.ts#L40) - -**`Experimental`** - -Literal path prefixes the patch must not touch. - -#### Inherited from - -[`PatchDeliverableOptions`](PatchDeliverableOptions.md).[`forbiddenPaths`](PatchDeliverableOptions.md#forbiddenpaths) - -*** - -### require? - -> `optional` **require?**: readonly (`"tests"` \| `"typecheck"`)[] - -Defined in: [runtime/supervise/patch-deliverable.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/patch-deliverable.ts#L34) - -**`Experimental`** - -Which verification signals the gate REQUIRES to be present-and-passing. A required signal -that the artifact never derived (the command was not configured on the executor) fails the -gate closed. Unlisted signals default to passed-when-absent (the executor simply didn't run -that command). Default `[]` — gate on no-op / secret / forbidden / diff-size only. - -#### Inherited from - -[`PatchDeliverableOptions`](PatchDeliverableOptions.md).[`require`](PatchDeliverableOptions.md#require) - -*** - -### repoRoot - -> **repoRoot**: `string` - -Defined in: [runtime/supervise/worktree-fanout.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L45) - -**`Experimental`** - -Absolute path to the git checkout each worktree is cut from. - -*** - -### taskPrompt - -> **taskPrompt**: `string` - -Defined in: [runtime/supervise/worktree-fanout.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L47) - -**`Experimental`** - -The per-task instruction handed to every harness (composed under each profile's systemPrompt). - -*** - -### harnesses - -> **harnesses**: readonly [`AuthoredHarness`](AuthoredHarness.md)[] - -Defined in: [runtime/supervise/worktree-fanout.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L49) - -**`Experimental`** - -The authored harness profiles — one fanout item (and one worktree-CLI leaf) each. - -*** - -### deliverable? - -> `optional` **deliverable?**: [`DeliverableSpec`](DeliverableSpec.md)\<`WorktreeHarnessResult`\> - -Defined in: [runtime/supervise/worktree-fanout.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L55) - -**`Experimental`** - -The completion check each leaf is gated on. Defaults to `patchDelivered(opts)` (the mechanical -no-op/secret/forbidden/diff-size + required test/typecheck gate). Pass any -`DeliverableSpec` to customize "is it delivered" as DATA. - -*** - -### testCmd? - -> `optional` **testCmd?**: `string` - -Defined in: [runtime/supervise/worktree-fanout.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L57) - -**`Experimental`** - -Shell command run in each worktree to derive the tests-PASS signal. - -*** - -### typecheckCmd? - -> `optional` **typecheckCmd?**: `string` - -Defined in: [runtime/supervise/worktree-fanout.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L59) - -**`Experimental`** - -Shell command run in each worktree to derive the typecheck-PASS signal. - -*** - -### harnessTimeoutMs? - -> `optional` **harnessTimeoutMs?**: `number` - -Defined in: [runtime/supervise/worktree-fanout.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L61) - -**`Experimental`** - -Wall-clock cap per harness subprocess (ms). - -*** - -### winnerStrategy? - -> `optional` **winnerStrategy?**: [`WinnerStrategy`](../type-aliases/WinnerStrategy.md) - -Defined in: [runtime/supervise/worktree-fanout.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L63) - -**`Experimental`** - -Winner-selection strategy. Default `highest-score`. - -*** - -### runGit? - -> `optional` **runGit?**: [`GitRunner`](../../mcp/type-aliases/GitRunner.md) - -Defined in: [runtime/supervise/worktree-fanout.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L66) - -**`Experimental`** - -Test seams forwarded to every worktree-CLI leaf (inject git/harness/command runners so the - whole fanout runs offline). Production callers leave these unset. - -*** - -### runHarness? - -> `optional` **runHarness?**: (`options`) => `Promise`\<[`LocalHarnessResult`](../../mcp/interfaces/LocalHarnessResult.md)\> - -Defined in: [runtime/supervise/worktree-fanout.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L67) - -**`Experimental`** - -**`Experimental`** - -Spawn a local coding harness CLI as a subprocess + collect its output. - -NOT responsible for parsing the harness's output or extracting a diff — -the in-process executor's `streamPrompt` orchestrates `git diff` against -the worktree after this resolves. This function is intentionally narrow: -spawn, wait, capture, return. - -Fails loud — throws when: - - `cwd` doesn't exist (subprocess emits ENOENT; surfaced as Error) - - the harness binary is not on PATH (ENOENT) - -Does NOT throw when: - - the subprocess exits non-zero (`result.exitCode` carries the code) - - the subprocess is aborted / timed out (`result.killedBySignal` / - `result.timedOut` carries the reason) - -#### Parameters - -##### options - -[`RunLocalHarnessOptions`](../../mcp/interfaces/RunLocalHarnessOptions.md) - -#### Returns - -`Promise`\<[`LocalHarnessResult`](../../mcp/interfaces/LocalHarnessResult.md)\> - -*** - -### runCommand? - -> `optional` **runCommand?**: `WorktreeCheckRunner` - -Defined in: [runtime/supervise/worktree-fanout.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-fanout.ts#L68) - -**`Experimental`** diff --git a/docs/api/runtime/type-aliases/AssertTraceDerivedFindings.md b/docs/api/runtime/type-aliases/AssertTraceDerivedFindings.md deleted file mode 100644 index d4a2366..0000000 --- a/docs/api/runtime/type-aliases/AssertTraceDerivedFindings.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / AssertTraceDerivedFindings - -# Type Alias: AssertTraceDerivedFindings - -> **AssertTraceDerivedFindings** = (`findings`) => `void` - -Defined in: [runtime/personify/wave-types.ts:401](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L401) - -The firewall assertion contract, re-stated for the reactive seam (PORT of -`assertTraceDerivedFindings`). A PROVENANCE check, not a content check: span/event/artifact/ -finding refs and empty-evidence findings pass; only a `metric` ref whose uri is a -judge/verdict/score scheme is rejected. Fail loud — a tainted finding aborts. The impl lives in -`analyst.ts`; this type pins its signature so callers depend on the contract, not the impl. - -## Parameters - -### findings - -`ReadonlyArray`\<`AnalystFinding`\> - -## Returns - -`void` diff --git a/docs/api/runtime/type-aliases/BudgetReadout.md b/docs/api/runtime/type-aliases/BudgetReadout.md deleted file mode 100644 index bb02688..0000000 --- a/docs/api/runtime/type-aliases/BudgetReadout.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / BudgetReadout - -# Type Alias: BudgetReadout - -> **BudgetReadout** = `Readonly`\<\{ `tokensLeft`: `number`; `usdLeft`: `number`; `usdCapped`: `boolean`; `deadlineMs`: `number`; `reservedTokens`: `number`; \}\> - -Defined in: [runtime/supervise/budget.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/budget.ts#L43) - -Post-reservation pool readout — the shape `Scope.budget` exposes. `tokensLeft`, - `usdLeft`, and `reservedTokens` reflect committed-but-unsettled reservations; - `deadlineMs` is the ABSOLUTE wall-clock deadline (0 when the root set none). - `usdCapped` distinguishes a real `usdLeft <= 0` exhaustion from an uncapped pool (which always - reads `usdLeft: 0`) — the in-loop guard needs it to bound a usd-capped driver. diff --git a/docs/api/runtime/type-aliases/ChampionPolicy.md b/docs/api/runtime/type-aliases/ChampionPolicy.md deleted file mode 100644 index 7643a54..0000000 --- a/docs/api/runtime/type-aliases/ChampionPolicy.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ChampionPolicy - -# Type Alias: ChampionPolicy - -> **ChampionPolicy** = `"score"` \| `"costAware"` - -Defined in: [runtime/strategy-evolution.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-evolution.ts#L55) diff --git a/docs/api/runtime/type-aliases/CombinatorShape.md b/docs/api/runtime/type-aliases/CombinatorShape.md deleted file mode 100644 index 30a6fb1..0000000 --- a/docs/api/runtime/type-aliases/CombinatorShape.md +++ /dev/null @@ -1,28 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / CombinatorShape - -# Type Alias: CombinatorShape\ - -> **CombinatorShape**\<`Task`, `D`\> = [`LoopShape`](LoopShape.md)\<`Task`, `D`\> - -Defined in: [runtime/personify/wave-types.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L64) - -A combinator is just a `LoopShape`: a factory `(ShapeContext) => Agent` whose `Agent.act` -runs the combinator's structure over the `Scope` (spawn children, drain `next()`, select via -the single-sourced `settledToIteration`+`defaultSelectWinner`, synthesize an `Outcome`). -Aliased — NOT a new type — so a combinator stays a first-class shape the persona layer's -`runPersonified`/`ShapeRegistry` resolve with zero new machinery. The SHAPE is content-free; -the persona carries the domain. - -## Type Parameters - -### Task - -`Task` - -### D - -`D` diff --git a/docs/api/runtime/type-aliases/DefinePersona.md b/docs/api/runtime/type-aliases/DefinePersona.md deleted file mode 100644 index 6cca0b5..0000000 --- a/docs/api/runtime/type-aliases/DefinePersona.md +++ /dev/null @@ -1,30 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / DefinePersona - -# Type Alias: DefinePersona - -> **DefinePersona** = \<`D`\>(`input`) => [`Persona`](../interfaces/Persona.md)\<`D`\> - -Defined in: [runtime/personify/types.ts:143](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L143) - -Builds a frozen `Persona`, failing loud on the executors-supplied invariant (neither a - registry nor seams = an unresolvable persona). Pure — no I/O, no engine. - -## Type Parameters - -### D - -`D` = `unknown` - -## Parameters - -### input - -[`DefinePersonaInput`](../interfaces/DefinePersonaInput.md)\<`D`\> - -## Returns - -[`Persona`](../interfaces/Persona.md)\<`D`\> diff --git a/docs/api/runtime/type-aliases/Deliverable.md b/docs/api/runtime/type-aliases/Deliverable.md deleted file mode 100644 index bf7d8f5..0000000 --- a/docs/api/runtime/type-aliases/Deliverable.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Deliverable - -# Type Alias: Deliverable\ - -> **Deliverable**\<`Out`\> = \{ `kind`: `"events"`; `fromEvents`: (`events`) => `Out`; \} \| \{ `kind`: `"artifact"`; `path`: `string`; `fromArtifact`: (`raw`, `events`) => `Out`; \} - -Defined in: [runtime/sandbox-run.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/sandbox-run.ts#L50) - -**`Experimental`** - -How a typed deliverable `Out` is materialized from a finished turn. -- `events` — pure parse over the event array (identical to `OutputAdapter`). -- `artifact` — read a file off the box AFTER the turn drains, then map it (+ the - events). For diffs/codebases/documents that don't fit the chat - stream. `path` relative ⇒ workspace root; absolute ⇒ container FS. - -## Type Parameters - -### Out - -`Out` diff --git a/docs/api/runtime/type-aliases/Environment.md b/docs/api/runtime/type-aliases/Environment.md deleted file mode 100644 index 0abc466..0000000 --- a/docs/api/runtime/type-aliases/Environment.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Environment - -# Type Alias: Environment - -> **Environment** = [`AgenticSurface`](../interfaces/AgenticSurface.md) - -Defined in: [runtime/run-benchmark.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/run-benchmark.ts#L30) - -A checkable task domain — implement these 5 hooks and the suite does the rest. The - same seam as `AgenticSurface`; `Environment` is the RL/gym-standard name for it. diff --git a/docs/api/runtime/type-aliases/EqualKOnCost.md b/docs/api/runtime/type-aliases/EqualKOnCost.md deleted file mode 100644 index 889a9b2..0000000 --- a/docs/api/runtime/type-aliases/EqualKOnCost.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / EqualKOnCost - -# Type Alias: EqualKOnCost - -> **EqualKOnCost** = (`arms`, `options?`) => [`EqualKVerdict`](../interfaces/EqualKVerdict.md) - -Defined in: [runtime/personify/wave-types.ts:606](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L606) - -`equalKOnCost(arms, opts)` — the cross-arm equal-compute check on conserved cost. - -## Parameters - -### arms - -`ReadonlyArray`\<[`EqualKArm`](../interfaces/EqualKArm.md)\> - -### options? - -[`EqualKOnCostOptions`](../interfaces/EqualKOnCostOptions.md) - -## Returns - -[`EqualKVerdict`](../interfaces/EqualKVerdict.md) diff --git a/docs/api/runtime/type-aliases/ExecutorConfig.md b/docs/api/runtime/type-aliases/ExecutorConfig.md deleted file mode 100644 index 3463d43..0000000 --- a/docs/api/runtime/type-aliases/ExecutorConfig.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ExecutorConfig - -# Type Alias: ExecutorConfig - -> **ExecutorConfig** = `object` & [`RouterSeam`](../interfaces/RouterSeam.md) \| `object` & [`RouterToolsSeam`](../interfaces/RouterToolsSeam.md) \| `object` & [`BridgeSeam`](../interfaces/BridgeSeam.md) \| `object` & [`CliSeam`](../interfaces/CliSeam.md) \| `object` & [`CliWorktreeSeam`](../interfaces/CliWorktreeSeam.md) \| `object` & [`SandboxSeam`](../interfaces/SandboxSeam.md) - -Defined in: [runtime/supervise/runtime.ts:1121](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L1121) - -Config for [createExecutor](../functions/createExecutor.md): the backend is DATA — the cost dial a profile, -an experiment config, or a replay journal can name — not an import choice. Each -variant carries its backend's seam (router/router-tools/bridge/cli/cli-worktree/sandbox). diff --git a/docs/api/runtime/type-aliases/ExecutorFactory.md b/docs/api/runtime/type-aliases/ExecutorFactory.md deleted file mode 100644 index 4cd4a8a..0000000 --- a/docs/api/runtime/type-aliases/ExecutorFactory.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ExecutorFactory - -# Type Alias: ExecutorFactory\ - -> **ExecutorFactory**\<`Out`\> = (`spec`, `ctx`) => [`Executor`](../interfaces/Executor.md)\<`Out`\> - -Defined in: [runtime/supervise/types.ts:165](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L165) - -Builds a fresh `Executor` for one spawn from the resolved spec. Per-spawn (not -shared) so each child owns its own box/abort/teardown lifecycle. A BYO factory lets a -user supply construction args without pre-instantiating. - -## Type Parameters - -### Out - -`Out` - -## Parameters - -### spec - -[`AgentSpec`](../interfaces/AgentSpec.md) - -### ctx - -[`ExecutorContext`](../interfaces/ExecutorContext.md) - -## Returns - -[`Executor`](../interfaces/Executor.md)\<`Out`\> diff --git a/docs/api/runtime/type-aliases/Fanout.md b/docs/api/runtime/type-aliases/Fanout.md deleted file mode 100644 index b1c95a3..0000000 --- a/docs/api/runtime/type-aliases/Fanout.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Fanout - -# Type Alias: Fanout - -> **Fanout** = \<`Task`, `Item`, `D`\>(`items`, `opts`) => [`CombinatorShape`](CombinatorShape.md)\<`Task`, `D`\> - -Defined in: [runtime/personify/wave-types.ts:155](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L155) - -`fanout(items, opts)` — build the fanout combinator over a static item list. - -## Type Parameters - -### Task - -`Task` - -### Item - -`Item` - -### D - -`D` - -## Parameters - -### items - -`ReadonlyArray`\<`Item`\> - -### opts - -[`FanoutOptions`](../interfaces/FanoutOptions.md)\<`Item`, `D`\> - -## Returns - -[`CombinatorShape`](CombinatorShape.md)\<`Task`, `D`\> diff --git a/docs/api/runtime/type-aliases/FanoutWinnerSelector.md b/docs/api/runtime/type-aliases/FanoutWinnerSelector.md deleted file mode 100644 index b84cd20..0000000 --- a/docs/api/runtime/type-aliases/FanoutWinnerSelector.md +++ /dev/null @@ -1,30 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / FanoutWinnerSelector - -# Type Alias: FanoutWinnerSelector\ - -> **FanoutWinnerSelector**\<`D`\> = (`iterations`) => \{ `output?`: [`Outcome`](Outcome.md)\<`D`\>; \} \| `undefined` - -Defined in: [runtime/personify/wave-types.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L138) - -A winner-selection strategy: argmax/sort over the gathered child iterations (each output is the - child's `Outcome`), returning the chosen iteration or `undefined` when none qualifies. - -## Type Parameters - -### D - -`D` - -## Parameters - -### iterations - -[`Iteration`](../interfaces/Iteration.md)\<`unknown`, [`Outcome`](Outcome.md)\<`D`\>\>[] - -## Returns - -\{ `output?`: [`Outcome`](Outcome.md)\<`D`\>; \} \| `undefined` diff --git a/docs/api/runtime/type-aliases/FlatWidenGate.md b/docs/api/runtime/type-aliases/FlatWidenGate.md deleted file mode 100644 index 4c72a83..0000000 --- a/docs/api/runtime/type-aliases/FlatWidenGate.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / FlatWidenGate - -# Type Alias: FlatWidenGate - -> **FlatWidenGate** = \<`D`\>() => [`ScopeWidenGate`](../interfaces/ScopeWidenGate.md)\<`D`\> - -Defined in: [runtime/personify/wave-types.ts:340](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L340) - -The flat default `ScopeWidenGate` factory contract — never widens, keeping the R2 firewall - conflict dormant. Exported so a gate run can pass it explicitly and a test can assert the - default is flat. - -## Type Parameters - -### D - -`D` - -## Returns - -[`ScopeWidenGate`](../interfaces/ScopeWidenGate.md)\<`D`\> diff --git a/docs/api/runtime/type-aliases/LoopOptionsForDispatch.md b/docs/api/runtime/type-aliases/LoopOptionsForDispatch.md deleted file mode 100644 index dfa4078..0000000 --- a/docs/api/runtime/type-aliases/LoopOptionsForDispatch.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopOptionsForDispatch - -# Type Alias: LoopOptionsForDispatch\ - -> **LoopOptionsForDispatch**\<`Task`, `Output`, `Decision`\> = `Omit`\<[`RunLoopOptions`](../interfaces/RunLoopOptions.md)\<`Task`, `Output`, `Decision`\>, `"ctx"`\> - -Defined in: [runtime/loop-dispatch.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L44) - -runLoop options minus the `ctx` (loopDispatch builds the ctx). - -## Type Parameters - -### Task - -`Task` - -### Output - -`Output` - -### Decision - -`Decision` diff --git a/docs/api/runtime/type-aliases/LoopShape.md b/docs/api/runtime/type-aliases/LoopShape.md deleted file mode 100644 index d5bdbe3..0000000 --- a/docs/api/runtime/type-aliases/LoopShape.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopShape - -# Type Alias: LoopShape\ - -> **LoopShape**\<`Task`, `D`\> = (`ctx`) => [`Agent`](../interfaces/Agent.md)\<`Task`, [`Outcome`](Outcome.md)\<`D`\>\> - -Defined in: [runtime/personify/types.ts:192](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L192) - -A reusable act-body factory. Given the persona's content + seams (`ShapeContext`), it -returns the root `Agent>` whose `act` decomposes the task, fans out -children through `scope.spawn`, verifies/selects across their settlements (selector≠judge: -via `settledToIteration` + `defaultSelectWinner`, never re-ranking behind the driver), and -synthesizes the terminal `Outcome`. The shape is STRUCTURE; the persona is CONTENT. - -## Type Parameters - -### Task - -`Task` - -### D - -`D` - -## Parameters - -### ctx - -[`ShapeContext`](../interfaces/ShapeContext.md)\<`D`\> - -## Returns - -[`Agent`](../interfaces/Agent.md)\<`Task`, [`Outcome`](Outcome.md)\<`D`\>\> diff --git a/docs/api/runtime/type-aliases/LoopTraceEvent.md b/docs/api/runtime/type-aliases/LoopTraceEvent.md deleted file mode 100644 index e06179c..0000000 --- a/docs/api/runtime/type-aliases/LoopTraceEvent.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopTraceEvent - -# Type Alias: LoopTraceEvent - -> **LoopTraceEvent** = \{ `kind`: `"loop.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`LoopStartedPayload`](../interfaces/LoopStartedPayload.md); \} \| \{ `kind`: `"loop.plan"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`LoopPlanPayload`](../interfaces/LoopPlanPayload.md); \} \| \{ `kind`: `"loop.iteration.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`LoopIterationStartedPayload`](../interfaces/LoopIterationStartedPayload.md); \} \| \{ `kind`: `"loop.iteration.dispatch"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`LoopIterationDispatchPayload`](../interfaces/LoopIterationDispatchPayload.md); \} \| \{ `kind`: `"loop.iteration.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`LoopIterationEndedPayload`](../interfaces/LoopIterationEndedPayload.md); \} \| \{ `kind`: `"loop.decision"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`LoopDecisionPayload`](../interfaces/LoopDecisionPayload.md); \} \| \{ `kind`: `"loop.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`LoopEndedPayload`](../interfaces/LoopEndedPayload.md); \} \| \{ `kind`: `"loop.teardown.failed"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`LoopTeardownFailedPayload`](../interfaces/LoopTeardownFailedPayload.md); \} - -Defined in: [runtime/types.ts:326](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L326) - -**`Experimental`** diff --git a/docs/api/runtime/type-aliases/LoopUntil.md b/docs/api/runtime/type-aliases/LoopUntil.md deleted file mode 100644 index f5e97b4..0000000 --- a/docs/api/runtime/type-aliases/LoopUntil.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / LoopUntil - -# Type Alias: LoopUntil - -> **LoopUntil** = \<`Task`, `State`, `D`\>(`seed`, `spec`) => [`CombinatorShape`](CombinatorShape.md)\<`Task`, `D`\> - -Defined in: [runtime/personify/wave-types.ts:193](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L193) - -`loopUntil(spec)` — build the iterative-deepening combinator. `seed` is the initial state. - -## Type Parameters - -### Task - -`Task` - -### State - -`State` - -### D - -`D` - -## Parameters - -### seed - -`State` - -### spec - -[`LoopUntilSpec`](../interfaces/LoopUntilSpec.md)\<`Task`, `State`, `D`\> - -## Returns - -[`CombinatorShape`](CombinatorShape.md)\<`Task`, `D`\> diff --git a/docs/api/runtime/type-aliases/NodeId.md b/docs/api/runtime/type-aliases/NodeId.md deleted file mode 100644 index db5fdff..0000000 --- a/docs/api/runtime/type-aliases/NodeId.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / NodeId - -# Type Alias: NodeId - -> **NodeId** = `string` - -Defined in: [runtime/supervise/types.ts:225](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L225) - -Deterministic node id — `${parent}:s${seq}` from the cursor order, never wall-clock. diff --git a/docs/api/runtime/type-aliases/NodeStatus.md b/docs/api/runtime/type-aliases/NodeStatus.md deleted file mode 100644 index 1923077..0000000 --- a/docs/api/runtime/type-aliases/NodeStatus.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / NodeStatus - -# Type Alias: NodeStatus - -> **NodeStatus** = `"pending"` \| `"acquiring"` \| `"running"` \| `"done"` \| `"failed"` \| `"cancelled"` - -Defined in: [runtime/supervise/types.ts:222](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L222) - -`'acquiring'` is first-class (M1): a node spends real time + reaps an orphan box - during sandbox acquire BEFORE it is `running`, so abort must be defined over it. diff --git a/docs/api/runtime/type-aliases/Outcome.md b/docs/api/runtime/type-aliases/Outcome.md deleted file mode 100644 index 7d891da..0000000 --- a/docs/api/runtime/type-aliases/Outcome.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Outcome - -# Type Alias: Outcome\ - -> **Outcome**\<`D`\> = \{ `kind`: `"done"`; `deliverable`: `D`; \} \| \{ `kind`: `"blocked"`; `blockers`: `string`[]; \} - -Defined in: [runtime/personify/types.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L54) - -The terminal contract Drew wants: a loop returns a FINISHED deliverable, or the concrete -list of blockers that stopped it — never a half-done best-effort coercion. A `blocked` -outcome with an empty `blockers` list is a contract violation (a shape that can't finish -MUST name why); impls fail loud on it rather than emitting a vacuous block. - -`Outcome` is the `Out` type a personified `Agent`/`Supervisor` is parameterized by, so the -keystone's typed `SupervisedResult>` carries it end to end with no coercion. - -## Type Parameters - -### D - -`D` diff --git a/docs/api/runtime/type-aliases/Panel.md b/docs/api/runtime/type-aliases/Panel.md deleted file mode 100644 index 61a03cd..0000000 --- a/docs/api/runtime/type-aliases/Panel.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Panel - -# Type Alias: Panel - -> **Panel** = \<`Task`, `Artifact`, `D`\>(`spec`) => [`CombinatorShape`](CombinatorShape.md)\<`Task`, `D`\> - -Defined in: [runtime/personify/wave-types.ts:243](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L243) - -`panel(spec)` — build the M-judge write-only-merge combinator. - -## Type Parameters - -### Task - -`Task` - -### Artifact - -`Artifact` - -### D - -`D` - -## Parameters - -### spec - -[`PanelSpec`](../interfaces/PanelSpec.md)\<`Artifact`, `D`\> - -## Returns - -[`CombinatorShape`](CombinatorShape.md)\<`Task`, `D`\> diff --git a/docs/api/runtime/type-aliases/Pipeline.md b/docs/api/runtime/type-aliases/Pipeline.md deleted file mode 100644 index 328ba3a..0000000 --- a/docs/api/runtime/type-aliases/Pipeline.md +++ /dev/null @@ -1,34 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Pipeline - -# Type Alias: Pipeline - -> **Pipeline** = \<`Task`, `D`\>(`stages`) => [`CombinatorShape`](CombinatorShape.md)\<`Task`, `D`\> - -Defined in: [runtime/personify/wave-types.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L89) - -`pipeline(stages)` — build the sequential combinator from an ordered stage list. The first - stage's `StepIn` is the root `Task`; the last stage's `StepOut` is the deliverable `D`. - -## Type Parameters - -### Task - -`Task` - -### D - -`D` - -## Parameters - -### stages - -`ReadonlyArray`\<[`PipelineStage`](../interfaces/PipelineStage.md)\<`Task`, `unknown`, `unknown`\>\> - -## Returns - -[`CombinatorShape`](CombinatorShape.md)\<`Task`, `D`\> diff --git a/docs/api/runtime/type-aliases/RenderCorpusToInstructions.md b/docs/api/runtime/type-aliases/RenderCorpusToInstructions.md deleted file mode 100644 index b72bde0..0000000 --- a/docs/api/runtime/type-aliases/RenderCorpusToInstructions.md +++ /dev/null @@ -1,24 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / RenderCorpusToInstructions - -# Type Alias: RenderCorpusToInstructions - -> **RenderCorpusToInstructions** = (`opts`) => `Promise`\<`AgentProfile`\> - -Defined in: [runtime/personify/wave-types.ts:492](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L492) - -`renderCorpusToInstructions(opts)` — the flywheel read-back projection. Async (queries the - durable corpus); returns a fresh `AgentProfile` with the accreted facts merged in. - -## Parameters - -### opts - -[`RenderCorpusToInstructionsOptions`](../interfaces/RenderCorpusToInstructionsOptions.md) - -## Returns - -`Promise`\<`AgentProfile`\> diff --git a/docs/api/runtime/type-aliases/Restart.md b/docs/api/runtime/type-aliases/Restart.md deleted file mode 100644 index cd846c0..0000000 --- a/docs/api/runtime/type-aliases/Restart.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Restart - -# Type Alias: Restart - -> **Restart** = `"temporary"` \| `"transient"` \| `"permanent"` - -Defined in: [runtime/supervise/types.ts:218](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L218) - -OTP child-spec restart class. diff --git a/docs/api/runtime/type-aliases/RootSignal.md b/docs/api/runtime/type-aliases/RootSignal.md deleted file mode 100644 index 24b7565..0000000 --- a/docs/api/runtime/type-aliases/RootSignal.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / RootSignal - -# Type Alias: RootSignal - -> **RootSignal** = \{ `kind`: `"pause"`; \} \| \{ `kind`: `"resume"`; \} \| \{ `kind`: `"cancel"`; `reason?`: `string`; \} \| \{ `kind`: `"ask"`; `question`: `string`; \} - -Defined in: [runtime/supervise/types.ts:491](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L491) - -Out-of-band message to a running root. Open by intent — a client extends it. diff --git a/docs/api/runtime/type-aliases/RunPersonified.md b/docs/api/runtime/type-aliases/RunPersonified.md deleted file mode 100644 index 4d22794..0000000 --- a/docs/api/runtime/type-aliases/RunPersonified.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / RunPersonified - -# Type Alias: RunPersonified - -> **RunPersonified** = \<`Task`, `D`\>(`options`) => `Promise`\<[`SupervisedResult`](SupervisedResult.md)\<[`Outcome`](Outcome.md)\<`D`\>\>\> - -Defined in: [runtime/personify/types.ts:255](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/types.ts#L255) - -The composed run signature. - -## Type Parameters - -### Task - -`Task` - -### D - -`D` - -## Parameters - -### options - -[`RunPersonifiedOptions`](../interfaces/RunPersonifiedOptions.md)\<`Task`, `D`\> - -## Returns - -`Promise`\<[`SupervisedResult`](SupervisedResult.md)\<[`Outcome`](Outcome.md)\<`D`\>\>\> diff --git a/docs/api/runtime/type-aliases/Runtime.md b/docs/api/runtime/type-aliases/Runtime.md deleted file mode 100644 index 8b535a0..0000000 --- a/docs/api/runtime/type-aliases/Runtime.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Runtime - -# Type Alias: Runtime - -> **Runtime** = `"router"` \| `"inline"` \| `"sandbox"` \| `"cli"` \| `string` & `object` - -Defined in: [runtime/supervise/types.ts:137](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L137) - -The runtime tag of a `Executor` impl. Open by intent — `string` so a BYO executor - names its own runtime; the built-ins use these literals. diff --git a/docs/api/runtime/type-aliases/Settled.md b/docs/api/runtime/type-aliases/Settled.md deleted file mode 100644 index 4ab42a3..0000000 --- a/docs/api/runtime/type-aliases/Settled.md +++ /dev/null @@ -1,59 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Settled - -# Type Alias: Settled\ - -> **Settled**\<`Out`\> = \{ `kind`: `"done"`; `handle`: [`Handle`](../interfaces/Handle.md)\<`Out`\>; `out`: `Out`; `outRef`: `string`; `verdict?`: `DefaultVerdict`; `spent`: [`Spend`](../interfaces/Spend.md); `seq`: `number`; \} \| \{ `kind`: `"down"`; `handle`: [`Handle`](../interfaces/Handle.md)\<`Out`\>; `reason`: `string`; `infra`: `boolean`; `restartCount`: `number`; `seq`: `number`; \} - -Defined in: [runtime/supervise/types.ts:255](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L255) - -A settled child, delivered by `scope.next()`. `seq` is the monotonic cursor order -`next()` yielded this settlement (B2) — NOT wall-clock — and replay delivers strictly -in `seq` order. `outRef` rehydrates `out` from the `ResultBlobStore` on replay. - -## Type Parameters - -### Out - -`Out` - -## Union Members - -### Type Literal - -\{ `kind`: `"done"`; `handle`: [`Handle`](../interfaces/Handle.md)\<`Out`\>; `out`: `Out`; `outRef`: `string`; `verdict?`: `DefaultVerdict`; `spent`: [`Spend`](../interfaces/Spend.md); `seq`: `number`; \} - -*** - -### Type Literal - -\{ `kind`: `"down"`; `handle`: [`Handle`](../interfaces/Handle.md)\<`Out`\>; `reason`: `string`; `infra`: `boolean`; `restartCount`: `number`; `seq`: `number`; \} - -#### kind - -> **kind**: `"down"` - -#### handle - -> **handle**: [`Handle`](../interfaces/Handle.md)\<`Out`\> - -#### reason - -> **reason**: `string` - -#### infra - -> **infra**: `boolean` - -True = infrastructure failure (excluded from merge `n` / equal-k), not a bad result. - -#### restartCount - -> **restartCount**: `number` - -#### seq - -> **seq**: `number` diff --git a/docs/api/runtime/type-aliases/Shell.md b/docs/api/runtime/type-aliases/Shell.md deleted file mode 100644 index 2c89e00..0000000 --- a/docs/api/runtime/type-aliases/Shell.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Shell - -# Type Alias: Shell - -> **Shell** = (`args`, `cwd?`) => `Promise`\<\{ `stdout`: `string`; `stderr`: `string`; `code`: `number`; \}\> - -Defined in: [runtime/workspace.ts:2](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L2) - -Command runner seam. Host code can use `localShell`; sandbox code can wrap `box.exec`. - -## Parameters - -### args - -`ReadonlyArray`\<`string`\> - -### cwd? - -`string` - -## Returns - -`Promise`\<\{ `stdout`: `string`; `stderr`: `string`; `code`: `number`; \}\> diff --git a/docs/api/runtime/type-aliases/SpawnEvent.md b/docs/api/runtime/type-aliases/SpawnEvent.md deleted file mode 100644 index 2047022..0000000 --- a/docs/api/runtime/type-aliases/SpawnEvent.md +++ /dev/null @@ -1,104 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / SpawnEvent - -# Type Alias: SpawnEvent - -> **SpawnEvent** = \{ `kind`: `"spawned"`; `id`: [`NodeId`](NodeId.md); `parent?`: [`NodeId`](NodeId.md); `label`: `string`; `budget`: [`Budget`](../interfaces/Budget.md); `runtime`: [`Runtime`](Runtime.md); `seq`: `number`; `at`: `string`; \} \| \{ `kind`: `"settled"`; `id`: [`NodeId`](NodeId.md); `status`: `"done"` \| `"down"`; `outRef?`: `string`; `verdict?`: `DefaultVerdict`; `spent`: [`Spend`](../interfaces/Spend.md); `infra?`: `boolean`; `seq`: `number`; `at`: `string`; \} \| \{ `kind`: `"cancelled"`; `id`: [`NodeId`](NodeId.md); `reason`: `string`; `seq`: `number`; `at`: `string`; \} \| \{ `kind`: `"metered"`; `id`: [`NodeId`](NodeId.md); `spend`: [`Spend`](../interfaces/Spend.md); `seq`: `number`; `at`: `string`; \} - -Defined in: [runtime/supervise/types.ts:362](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L362) - -Journaled spawn-tree events (B1/B2). `seq` is the cursor order; `at` is an ISO - timestamp for human inspection only (NOT a replay input). - -## Union Members - -### Type Literal - -\{ `kind`: `"spawned"`; `id`: [`NodeId`](NodeId.md); `parent?`: [`NodeId`](NodeId.md); `label`: `string`; `budget`: [`Budget`](../interfaces/Budget.md); `runtime`: [`Runtime`](Runtime.md); `seq`: `number`; `at`: `string`; \} - -*** - -### Type Literal - -\{ `kind`: `"settled"`; `id`: [`NodeId`](NodeId.md); `status`: `"done"` \| `"down"`; `outRef?`: `string`; `verdict?`: `DefaultVerdict`; `spent`: [`Spend`](../interfaces/Spend.md); `infra?`: `boolean`; `seq`: `number`; `at`: `string`; \} - -#### kind - -> **kind**: `"settled"` - -#### id - -> **id**: [`NodeId`](NodeId.md) - -#### status - -> **status**: `"done"` \| `"down"` - -#### outRef? - -> `optional` **outRef?**: `string` - -Content-addressed result pointer; rehydrates `out` from `ResultBlobStore`. - -#### verdict? - -> `optional` **verdict?**: `DefaultVerdict` - -#### spent - -> **spent**: [`Spend`](../interfaces/Spend.md) - -#### infra? - -> `optional` **infra?**: `boolean` - -#### seq - -> **seq**: `number` - -#### at - -> **at**: `string` - -*** - -### Type Literal - -\{ `kind`: `"cancelled"`; `id`: [`NodeId`](NodeId.md); `reason`: `string`; `seq`: `number`; `at`: `string`; \} - -*** - -### Type Literal - -\{ `kind`: `"metered"`; `id`: [`NodeId`](NodeId.md); `spend`: [`Spend`](../interfaces/Spend.md); `seq`: `number`; `at`: `string`; \} - -#### kind - -> **kind**: `"metered"` - -A driver's OWN inference spend, journaled separately from spawned-child work — the journal - TWIN of `BudgetPool.observe`, exactly as `settled` is the twin of `reconcile`. So every - journal-based cost reader sums it automatically — the journal is the single cost ledger. - It carries spend only and is NOT a settlement: replay + `materializeTreeView` skip it for - structure, and its `seq` lives outside the cursor-uniqueness namespace. A - driver re-homes its nested subtree's metered total up to its parent (like settled spend), - so summing any sub-tree root yields that sub-tree's true driver-inference cost. - -#### id - -> **id**: [`NodeId`](NodeId.md) - -#### spend - -> **spend**: [`Spend`](../interfaces/Spend.md) - -#### seq - -> **seq**: `number` - -#### at - -> **at**: `string` diff --git a/docs/api/runtime/type-aliases/SupervisedResult.md b/docs/api/runtime/type-aliases/SupervisedResult.md deleted file mode 100644 index 4183803..0000000 --- a/docs/api/runtime/type-aliases/SupervisedResult.md +++ /dev/null @@ -1,71 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / SupervisedResult - -# Type Alias: SupervisedResult\ - -> **SupervisedResult**\<`Out`\> = \{ `kind`: `"winner"`; `out`: `Out`; `outRef`: `string`; `verdict?`: `DefaultVerdict`; `tree`: [`TreeView`](../interfaces/TreeView.md); `spentTotal`: [`Spend`](../interfaces/Spend.md); `spentBreakdown?`: \{ `driverInference`: [`Spend`](../interfaces/Spend.md); `childWork`: [`Spend`](../interfaces/Spend.md); \}; \} \| \{ `kind`: `"no-winner"`; `reason`: `"all-children-down"` \| `"budget-exhausted"` \| `"aborted"`; `tree`: [`TreeView`](../interfaces/TreeView.md); `downCount`: `number`; \} - -Defined in: [runtime/supervise/types.ts:459](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L459) - -Typed terminal result (M2) — a no-winner is NEVER coerced to a best-effort output. - -## Type Parameters - -### Out - -`Out` - -## Union Members - -### Type Literal - -\{ `kind`: `"winner"`; `out`: `Out`; `outRef`: `string`; `verdict?`: `DefaultVerdict`; `tree`: [`TreeView`](../interfaces/TreeView.md); `spentTotal`: [`Spend`](../interfaces/Spend.md); `spentBreakdown?`: \{ `driverInference`: [`Spend`](../interfaces/Spend.md); `childWork`: [`Spend`](../interfaces/Spend.md); \}; \} - -#### kind - -> **kind**: `"winner"` - -#### out - -> **out**: `Out` - -#### outRef - -> **outRef**: `string` - -#### verdict? - -> `optional` **verdict?**: `DefaultVerdict` - -#### tree - -> **tree**: [`TreeView`](../interfaces/TreeView.md) - -#### spentTotal - -> **spentTotal**: [`Spend`](../interfaces/Spend.md) - -#### spentBreakdown? - -> `optional` **spentBreakdown?**: `object` - -Where `spentTotal` went: `driverInference` = the drivers' own chat turns (metered via - `Scope.meter`); `childWork` = every spawned child's reconciled spend (the journal sum). - `driverInference + childWork === spentTotal`. Present whenever any driver metered. - -##### spentBreakdown.driverInference - -> **driverInference**: [`Spend`](../interfaces/Spend.md) - -##### spentBreakdown.childWork - -> **childWork**: [`Spend`](../interfaces/Spend.md) - -*** - -### Type Literal - -\{ `kind`: `"no-winner"`; `reason`: `"all-children-down"` \| `"budget-exhausted"` \| `"aborted"`; `tree`: [`TreeView`](../interfaces/TreeView.md); `downCount`: `number`; \} diff --git a/docs/api/runtime/type-aliases/ToolPartDecoder.md b/docs/api/runtime/type-aliases/ToolPartDecoder.md deleted file mode 100644 index 9b56c02..0000000 --- a/docs/api/runtime/type-aliases/ToolPartDecoder.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / ToolPartDecoder - -# Type Alias: ToolPartDecoder - -> **ToolPartDecoder** = (`part`) => [`ToolStepInput`](../interfaces/ToolStepInput.md) \| `undefined` - -Defined in: [runtime/supervise/trace-source.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L60) - -Decode one harness message part into a tool step, or `undefined` if it is not a (completed) tool - call. ONE adapter per harness family — each owns its real wire shape; the flow downstream is - identical. Add a harness = add a decoder + register it; no other code changes. - -## Parameters - -### part - -`Record`\<`string`, `unknown`\> - -## Returns - -[`ToolStepInput`](../interfaces/ToolStepInput.md) \| `undefined` diff --git a/docs/api/runtime/type-aliases/TrajectoryReportFn.md b/docs/api/runtime/type-aliases/TrajectoryReportFn.md deleted file mode 100644 index fd5d605..0000000 --- a/docs/api/runtime/type-aliases/TrajectoryReportFn.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / TrajectoryReportFn - -# Type Alias: TrajectoryReportFn - -> **TrajectoryReportFn** = (`journal`, `blobs`, `root`, `options?`) => `Promise`\<[`TrajectoryReport`](../interfaces/TrajectoryReport.md)\> - -Defined in: [runtime/personify/wave-types.ts:551](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L551) - -`trajectoryReport(...)` — the tree+cost reconstructor. Async (reads journal + optionally blobs). - -## Parameters - -### journal - -[`SpawnJournal`](../interfaces/SpawnJournal.md) - -### blobs - -[`ResultBlobStore`](../interfaces/ResultBlobStore.md) - -### root - -[`NodeId`](NodeId.md) - -### options? - -[`TrajectoryReportOptions`](../interfaces/TrajectoryReportOptions.md) - -## Returns - -`Promise`\<[`TrajectoryReport`](../interfaces/TrajectoryReport.md)\> diff --git a/docs/api/runtime/type-aliases/UsageEvent.md b/docs/api/runtime/type-aliases/UsageEvent.md deleted file mode 100644 index e0f7d68..0000000 --- a/docs/api/runtime/type-aliases/UsageEvent.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / UsageEvent - -# Type Alias: UsageEvent - -> **UsageEvent** = \{ `kind`: `"tokens"`; `input`: `number`; `output`: `number`; \} \| \{ `kind`: `"cost"`; `usd`: `number`; \} \| \{ `kind`: `"iteration"`; \} - -Defined in: [runtime/supervise/types.ts:130](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/types.ts#L130) - -Normalized usage event — the single channel every executor reports through, so the -conserved pool meters all runtimes identically. `tokens` carries `LoopTokenUsage`'s -`{ input, output }`; `usd` is a SEPARATE channel (never folded into tokens). diff --git a/docs/api/runtime/type-aliases/Verify.md b/docs/api/runtime/type-aliases/Verify.md deleted file mode 100644 index 134f5a5..0000000 --- a/docs/api/runtime/type-aliases/Verify.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Verify - -# Type Alias: Verify - -> **Verify** = \<`Task`, `Candidate`, `D`\>(`spec`) => [`CombinatorShape`](CombinatorShape.md)\<`Task`, `D`\> - -Defined in: [runtime/personify/wave-types.ts:269](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L269) - -`verify(spec)` — build the 2-node implement→verifier-gate combinator. - -## Type Parameters - -### Task - -`Task` - -### Candidate - -`Candidate` - -### D - -`D` - -## Parameters - -### spec - -[`VerifySpec`](../interfaces/VerifySpec.md)\<`Task`, `Candidate`, `D`\> - -## Returns - -[`CombinatorShape`](CombinatorShape.md)\<`Task`, `D`\> diff --git a/docs/api/runtime/type-aliases/Widen.md b/docs/api/runtime/type-aliases/Widen.md deleted file mode 100644 index d5cee69..0000000 --- a/docs/api/runtime/type-aliases/Widen.md +++ /dev/null @@ -1,37 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / Widen - -# Type Alias: Widen - -> **Widen** = \<`Task`, `Seed`, `D`\>(`spec`) => [`CombinatorShape`](CombinatorShape.md)\<`Task`, `D`\> - -Defined in: [runtime/personify/wave-types.ts:335](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L335) - -`widen(spec)` — build the streaming progressive-widening combinator. - -## Type Parameters - -### Task - -`Task` - -### Seed - -`Seed` - -### D - -`D` - -## Parameters - -### spec - -[`WidenSpec`](../interfaces/WidenSpec.md)\<`Seed`, `D`\> - -## Returns - -[`CombinatorShape`](CombinatorShape.md)\<`Task`, `D`\> diff --git a/docs/api/runtime/type-aliases/WidenDecision.md b/docs/api/runtime/type-aliases/WidenDecision.md deleted file mode 100644 index 8ae8f08..0000000 --- a/docs/api/runtime/type-aliases/WidenDecision.md +++ /dev/null @@ -1,20 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / WidenDecision - -# Type Alias: WidenDecision\ - -> **WidenDecision**\<`D`\> = \{ `kind`: `"widen"`; `toward`: [`WidenLineage`](../interfaces/WidenLineage.md)\<`D`\>; \} \| \{ `kind`: `"stop"`; `rationale?`: `string`; \} - -Defined in: [runtime/personify/wave-types.ts:323](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L323) - -A widening decision: extend one lineage by one child, or stop widening. `flatWidenGate` - always returns `{ kind: 'stop' }`. - -## Type Parameters - -### D - -`D` diff --git a/docs/api/runtime/type-aliases/WinnerStrategy.md b/docs/api/runtime/type-aliases/WinnerStrategy.md deleted file mode 100644 index e80e859..0000000 --- a/docs/api/runtime/type-aliases/WinnerStrategy.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / WinnerStrategy - -# Type Alias: WinnerStrategy - -> **WinnerStrategy** = `"highest-score"` \| `"smallest-artifact"` \| `"first-valid"` - -Defined in: [runtime/personify/wave-types.ts:144](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/wave-types.ts#L144) - -Built-in valid-only winner strategies for `selectValidWinner` (selector≠judge): best gated-valid - score, the smallest delivered artifact (via a `sizeOf` extractor), or the earliest valid. diff --git a/docs/api/runtime/type-aliases/WorkspaceCommit.md b/docs/api/runtime/type-aliases/WorkspaceCommit.md deleted file mode 100644 index d554f43..0000000 --- a/docs/api/runtime/type-aliases/WorkspaceCommit.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / WorkspaceCommit - -# Type Alias: WorkspaceCommit - -> **WorkspaceCommit** = \{ `ok`: `true`; `rev`: `string`; \} \| \{ `ok`: `false`; `conflict`: `string`; \} - -Defined in: [runtime/workspace.ts:7](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/workspace.ts#L7) diff --git a/docs/api/runtime/type-aliases/WorktreePatchArtifact.md b/docs/api/runtime/type-aliases/WorktreePatchArtifact.md deleted file mode 100644 index 2c76d4b..0000000 --- a/docs/api/runtime/type-aliases/WorktreePatchArtifact.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / WorktreePatchArtifact - -# Type Alias: WorktreePatchArtifact - -> **WorktreePatchArtifact** = `WorktreeHarnessResult` - -Defined in: [runtime/supervise/worktree-cli-executor.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/worktree-cli-executor.ts#L40) - -Terminal artifact of one worktree-CLI run — the canonical worktree-harness result (the captured - diff + the harness's run record + the derived checks). diff --git a/docs/api/runtime/variables/adaptiveRefine.md b/docs/api/runtime/variables/adaptiveRefine.md deleted file mode 100644 index 0dbf8f5..0000000 --- a/docs/api/runtime/variables/adaptiveRefine.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / adaptiveRefine - -# Variable: adaptiveRefine - -> `const` **adaptiveRefine**: [`Strategy`](../interfaces/Strategy.md) - -Defined in: [runtime/strategy.ts:866](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L866) - -A NEW strategy, authored from the steps (~20 lines): refine, but when a steered shot - fails to improve the score it ABANDONS that line and restarts fresh (branch-when-stuck) - — the widen/MCTS idea the depth-stuck failure motivated. Scored keep-best (the best - checkpoint across all lines), the deployable metric. This is the "experts build BETTER - optimizations" path: a new technique, compact, with zero Supervisor ceremony. diff --git a/docs/api/runtime/variables/assertTraceDerivedFindings.md b/docs/api/runtime/variables/assertTraceDerivedFindings.md deleted file mode 100644 index 1197b09..0000000 --- a/docs/api/runtime/variables/assertTraceDerivedFindings.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / assertTraceDerivedFindings - -# Variable: assertTraceDerivedFindings - -> `const` **assertTraceDerivedFindings**: [`AssertTraceDerivedFindings`](../type-aliases/AssertTraceDerivedFindings.md) - -Defined in: [runtime/personify/analyst.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/analyst.ts#L46) diff --git a/docs/api/runtime/variables/builtinShapes.md b/docs/api/runtime/variables/builtinShapes.md deleted file mode 100644 index 91c79fc..0000000 --- a/docs/api/runtime/variables/builtinShapes.md +++ /dev/null @@ -1,14 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / builtinShapes - -# Variable: builtinShapes - -> `const` **builtinShapes**: [`ShapeRegistry`](../interfaces/ShapeRegistry.md) - -Defined in: [runtime/personify/registry.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/personify/registry.ts#L49) - -The default registry `runPersonified` resolves a shape name against. Empty by construction — - a caller registers its own composed shapes; the engine ships no domain shape. diff --git a/docs/api/runtime/variables/cliWorktreeExecutor.md b/docs/api/runtime/variables/cliWorktreeExecutor.md deleted file mode 100644 index b8c49e7..0000000 --- a/docs/api/runtime/variables/cliWorktreeExecutor.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / cliWorktreeExecutor - -# Variable: cliWorktreeExecutor - -> `const` **cliWorktreeExecutor**: [`ExecutorFactory`](../type-aliases/ExecutorFactory.md)\<`unknown`\> - -Defined in: [runtime/supervise/runtime.ts:1096](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/runtime.ts#L1096) - -The leaf `createWorktreeCliExecutor` as a backend-as-data factory: a supervisor-authored -`AgentProfile` driving claude / codex / opencode on its own worktree. `budgetExempt` like -the other CLI leaves; the authored systemPrompt + model reach the harness via §1.5. diff --git a/docs/api/runtime/variables/decodeAnthropicPart.md b/docs/api/runtime/variables/decodeAnthropicPart.md deleted file mode 100644 index c834b12..0000000 --- a/docs/api/runtime/variables/decodeAnthropicPart.md +++ /dev/null @@ -1,16 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / decodeAnthropicPart - -# Variable: decodeAnthropicPart - -> `const` **decodeAnthropicPart**: [`ToolPartDecoder`](../type-aliases/ToolPartDecoder.md) - -Defined in: [runtime/supervise/trace-source.ts:91](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L91) - -Anthropic / claude-code (also kimi's tool_use variant): a `{ type:'tool_use', id|tool_use_id, - name|tool, input }` content block. CONFIRMED against the cli-bridge's authoritative parsers - (claude.ts reads `block.type==='tool_use', block.id, block.name, block.input`; kimi.ts adds the - `tool_use_id`/`tool` fallbacks) — the canonical readers of these harnesses' real native output. diff --git a/docs/api/runtime/variables/decodeOpenAiPart.md b/docs/api/runtime/variables/decodeOpenAiPart.md deleted file mode 100644 index 16c6cfb..0000000 --- a/docs/api/runtime/variables/decodeOpenAiPart.md +++ /dev/null @@ -1,18 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / decodeOpenAiPart - -# Variable: decodeOpenAiPart - -> `const` **decodeOpenAiPart**: [`ToolPartDecoder`](../type-aliases/ToolPartDecoder.md) - -Defined in: [runtime/supervise/trace-source.ts:109](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L109) - -OpenAI-compatible (router / kimi's top-level form / glm): `{ type:'function'|'tool_call', id, - function:{ name, arguments: } }`. CONFIRMED against the cli-bridge (kimi.ts surfaces - kimi's top-level `tool_calls:[{type:'function', id, function:{name,arguments}}]` exactly this way). - NOTE: codex does NOT emit structured tool calls (the bridge's codex.ts never yields `tool_calls` — - it runs shell internally and surfaces only text), so per-tool detection is unavailable for codex - from any path — a harness property, not a decoder gap. diff --git a/docs/api/runtime/variables/decodeOpencodePart.md b/docs/api/runtime/variables/decodeOpencodePart.md deleted file mode 100644 index e11add5..0000000 --- a/docs/api/runtime/variables/decodeOpencodePart.md +++ /dev/null @@ -1,18 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / decodeOpencodePart - -# Variable: decodeOpencodePart - -> `const` **decodeOpencodePart**: [`ToolPartDecoder`](../type-aliases/ToolPartDecoder.md) - -Defined in: [runtime/supervise/trace-source.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L72) - -opencode parts ARE agent-interface's canonical `ToolPart` (`{ type:'tool', tool, callID?, - state: ToolState }`) — the shape every adc sdk-provider normalizes its harness output into. We - decode against that published type (single source of truth) rather than a re-derived shape; the - `ToolState` union drives the status mapping, so a status that adc adds/renames is a compile error - here, not a silent miss. The same call streams pending→running→terminal; only a terminal state - (`completed` / `error` / `failed`) is a finished call. diff --git a/docs/api/runtime/variables/defaultAnalystInstruction.md b/docs/api/runtime/variables/defaultAnalystInstruction.md deleted file mode 100644 index 95342f3..0000000 --- a/docs/api/runtime/variables/defaultAnalystInstruction.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / defaultAnalystInstruction - -# Variable: defaultAnalystInstruction - -> `const` **defaultAnalystInstruction**: `string` - -Defined in: [runtime/observe.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/observe.ts#L57) - -The default observer instruction — exported so an optimizer can seed its population. diff --git a/docs/api/runtime/variables/defaultAuditorInstruction.md b/docs/api/runtime/variables/defaultAuditorInstruction.md deleted file mode 100644 index e379d70..0000000 --- a/docs/api/runtime/variables/defaultAuditorInstruction.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / defaultAuditorInstruction - -# Variable: defaultAuditorInstruction - -> `const` **defaultAuditorInstruction**: `string` - -Defined in: [runtime/audit-intent.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/audit-intent.ts#L65) diff --git a/docs/api/runtime/variables/driverExecutorFactory.md b/docs/api/runtime/variables/driverExecutorFactory.md deleted file mode 100644 index 1aefbad..0000000 --- a/docs/api/runtime/variables/driverExecutorFactory.md +++ /dev/null @@ -1,23 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / driverExecutorFactory - -# Variable: driverExecutorFactory - -> `const` **driverExecutorFactory**: [`ExecutorFactory`](../type-aliases/ExecutorFactory.md)\<`unknown`\> - -Defined in: [runtime/supervise/driver-executor.ts:125](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/driver-executor.ts#L125) - -The recursive driver-executor factory. `withDriverExecutor` routes a child marked -`role: 'driver'` here; any other child resolves to a leaf built-in. On `execute`, it -reads the `nested-scope` seam the SCOPE seeded, mounts a nested `Scope` one `depth` -deeper over the shared pool/journal/blobs/registry, runs the driver -`Agent.act(task, nestedScope)`, and reports the conserved spend summed off the nested -tree's settled events — so the parent scope's reconcile rolls the whole sub-tree's spend -into the conserved total. - -A `down` from the nested driver (a thrown `act` or an aborted scope) propagates as a -thrown executor, which the parent scope types into a `down` settlement — the same -fail-loud-into-typed-down discipline a leaf gets. diff --git a/docs/api/runtime/variables/driverRuntime.md b/docs/api/runtime/variables/driverRuntime.md deleted file mode 100644 index d26723f..0000000 --- a/docs/api/runtime/variables/driverRuntime.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / driverRuntime - -# Variable: driverRuntime - -> `const` **driverRuntime**: `"driver"` - -Defined in: [runtime/supervise/driver-executor.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/driver-executor.ts#L57) - -The runtime tag the registry maps a driver child to. diff --git a/docs/api/runtime/variables/nestedScopeSeamKey.md b/docs/api/runtime/variables/nestedScopeSeamKey.md deleted file mode 100644 index 6c3b039..0000000 --- a/docs/api/runtime/variables/nestedScopeSeamKey.md +++ /dev/null @@ -1,16 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / nestedScopeSeamKey - -# Variable: nestedScopeSeamKey - -> `const` **nestedScopeSeamKey**: `"nested-scope"` = `'nested-scope'` - -Defined in: [runtime/supervise/scope.ts:140](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/scope.ts#L140) - -The recursion seam key. A `Scope` seeds a value of this on each child's -`ExecutorContext.seams` so a child whose executor is a DRIVER can mount a NESTED `Scope` -over the SAME conserved pool at `depth+1`. A leaf executor never reads it. Single-sourced -here so the scope and the driver-executor agree on the seam without a circular import. diff --git a/docs/api/runtime/variables/refine.md b/docs/api/runtime/variables/refine.md deleted file mode 100644 index 0bb91db..0000000 --- a/docs/api/runtime/variables/refine.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / refine - -# Variable: refine - -> `const` **refine**: [`Strategy`](../interfaces/Strategy.md) - -Defined in: [runtime/strategy.ts:666](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L666) diff --git a/docs/api/runtime/variables/sample.md b/docs/api/runtime/variables/sample.md deleted file mode 100644 index 56045fe..0000000 --- a/docs/api/runtime/variables/sample.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / sample - -# Variable: sample - -> `const` **sample**: [`Strategy`](../interfaces/Strategy.md) - -Defined in: [runtime/strategy.ts:662](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L662) diff --git a/docs/api/runtime/variables/sampleThenRefine.md b/docs/api/runtime/variables/sampleThenRefine.md deleted file mode 100644 index d5a0240..0000000 --- a/docs/api/runtime/variables/sampleThenRefine.md +++ /dev/null @@ -1,15 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / sampleThenRefine - -# Variable: sampleThenRefine - -> `const` **sampleThenRefine**: [`Strategy`](../interfaces/Strategy.md) - -Defined in: [runtime/strategy.ts:909](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy.ts#L909) - -The explore-then-exploit MIX: spend ⌈budget/2⌉ on independent samples (kept open), - then refine the best-verifying line with the remaining budget. Sample's basin escape + - refine's accumulation — the third built-in, authored from the public steps. diff --git a/docs/api/runtime/variables/strategyAuthorContract.md b/docs/api/runtime/variables/strategyAuthorContract.md deleted file mode 100644 index e4d9a4f..0000000 --- a/docs/api/runtime/variables/strategyAuthorContract.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / strategyAuthorContract - -# Variable: strategyAuthorContract - -> `const` **strategyAuthorContract**: "\nYou author an OPTIMIZATION STRATEGY for an agentic loop system. A strategy decides how to\nspend a compute budget to beat a task's deployable check. You compose exactly two steps:\n\n shot(spec?: \{ handle?, messages?, steer?, persona?, tools? \}): Promise\\n Runs ONE worker attempt (a bounded tool loop) over an artifact.\n - omit handle =\> the shot opens its OWN fresh artifact and closes it after (a sample).\n - pass handle =\> the shot CONTINUES that artifact (state accumulates across shots).\n - messages =\> the carried conversation (pass the previous ShotResult.messages to continue).\n - steer =\> a corrective instruction injected before the shot.\n - persona =\> \{ systemPrompt?, model? \} — give THIS shot its own role and/or model\n (multi-agent strategies: a researcher shot then an engineer shot, a panel of k\n personas over one budget). On a fresh shot the systemPrompt replaces the task's; on\n a carried conversation it arrives as a hand-off message. Same conserved budget.\n - tools =\> string\[\] — restrict THIS shot to a subset of the task's tools by\n name (focus an explore shot on read-only tools, an execute shot on write tools).\n Restriction-only; unknown names make the shot fail. ALWAYS select from\n await listTools(handle) — never hardcode. Omitted =\> the shot sees every tool.\n ShotResult = \{ messages, score (0..1 on the task's check), passes, total, completions, toolErrors \}\n Returns null if the attempt failed infra-wise.\n\n critique(messages): Promise\\n A firewalled trace-analyst reads the attempt's trajectory and returns ONE corrective\n instruction (or null when it judges the work complete). Costs ~1 completion.\n\n consult(messages, instruction): Promise\\n The RAW analyst channel: the same firewalled critic answers YOUR instruction over the\n trajectory verbatim (no reformatting) — use it when you need a specific reply format\n (a decision, a prediction). Costs ~1 completion.\n\n surface.open(task) / surface.close(handle)\n Open a persistent artifact you manage yourself (remember to close in a finally).\n close is idempotent — closing an already-closed handle is a safe no-op.\n\n listTools(handle): Promise\\>\n The tools THIS task actually offers. TOOL SETS VARY PER TASK — if you restrict a\n shot with \`tools\`, you MUST pick names from await listTools(handle); hardcoding\n names from an example kills your shots on every task whose tools differ.\n\nRules:\n- ALWAYS await every shot/critique/surface call — a floating promise that rejects\n crashes the whole benchmark run.\n- Stay within ~budget total shots; every shot/critique spends from a conserved pool.\n- For a FRESH attempt OMIT \`messages\` entirely (never pass \`\[\]\` — an empty array is a\n fresh conversation too, but be explicit). To CONTINUE, pass the previous\n ShotResult.messages unchanged.\n- Return \{ score, resolved, completions, progression, shots \} — score = the BEST checkpoint\n you reached (keep-best, never final-state), progression = score after each shot.\n- The module must be EXACTLY this shape (no other imports, no commentary outside code):\n\nimport \{ defineStrategy \} from '@tangle-network/agent-runtime/loops'\nexport default defineStrategy('your-strategy-name', async (\{ surface, task, budget, shot, critique, listTools \}) =\> \{\n // your composition (listTools comes from the destructured context — it is NOT a global)\n\})\n" - -Defined in: [runtime/strategy-author.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/strategy-author.ts#L21) - -The compressed consumable a skill carries: everything an author needs to emit a loop. diff --git a/docs/api/runtime/variables/toolPartDecoders.md b/docs/api/runtime/variables/toolPartDecoders.md deleted file mode 100644 index 6a1281d..0000000 --- a/docs/api/runtime/variables/toolPartDecoders.md +++ /dev/null @@ -1,13 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [runtime](../README.md) / toolPartDecoders - -# Variable: toolPartDecoders - -> `const` **toolPartDecoders**: `Record`\<`string`, [`ToolPartDecoder`](../type-aliases/ToolPartDecoder.md)\> - -Defined in: [runtime/supervise/trace-source.ts:126](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/supervise/trace-source.ts#L126) - -The harness → decoder registry. Add a harness by adding one entry. diff --git a/docs/api/topology.md b/docs/api/topology.md new file mode 100644 index 0000000..f62d23a --- /dev/null +++ b/docs/api/topology.md @@ -0,0 +1,473 @@ +[**@tangle-network/agent-runtime**](README.md) + +*** + +[@tangle-network/agent-runtime](README.md) / topology + +# topology + +## Interfaces + +### ReplayEvent + +Defined in: [topology/replay.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L18) + +One normalized animation frame — a node appearing, settling, or stepping, at a wall-clock ms. + +#### Properties + +##### t + +> **t**: `number` + +Defined in: [topology/replay.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L19) + +##### kind + +> **kind**: `"root"` \| `"spawn"` \| `"settle"` \| `"step"` + +Defined in: [topology/replay.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L20) + +##### id + +> **id**: `string` + +Defined in: [topology/replay.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L21) + +##### parentId? + +> `optional` **parentId?**: `string` + +Defined in: [topology/replay.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L22) + +##### label? + +> `optional` **label?**: `string` + +Defined in: [topology/replay.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L23) + +##### runtime? + +> `optional` **runtime?**: `string` + +Defined in: [topology/replay.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L24) + +##### depth? + +> `optional` **depth?**: `number` + +Defined in: [topology/replay.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L25) + +##### status? + +> `optional` **status?**: `"running"` \| `"done"` \| `"down"` + +Defined in: [topology/replay.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L26) + +##### valid? + +> `optional` **valid?**: `boolean` + +Defined in: [topology/replay.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L28) + +The completion-oracle signal: delivered ⟺ a deployable check passed (not self-report). + +##### score? + +> `optional` **score?**: `number` + +Defined in: [topology/replay.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L29) + +##### reason? + +> `optional` **reason?**: `string` + +Defined in: [topology/replay.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L30) + +##### tokens? + +> `optional` **tokens?**: `number` + +Defined in: [topology/replay.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L31) + +##### usd? + +> `optional` **usd?**: `number` + +Defined in: [topology/replay.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L32) + +*** + +### ReplayTimeline + +Defined in: [topology/replay.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L35) + +**`Experimental`** + +`@tangle-network/agent-runtime/topology` — the live recursive-agent-tree projection over the +lifecycle hook stream. Attach `createTopologyView().hooks` to a `Supervisor`/`runLoop` and read +`.render()` for the agent tree; or fold a journal replay with `renderTopologyTree`. + +#### Properties + +##### runId + +> **runId**: `string` + +Defined in: [topology/replay.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L36) + +**`Experimental`** + +##### events + +> **events**: [`ReplayEvent`](#replayevent)[] + +Defined in: [topology/replay.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L37) + +**`Experimental`** + +##### t0 + +> **t0**: `number` + +Defined in: [topology/replay.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L39) + +**`Experimental`** + +Wall-clock window [t0, t1] the player scrubs over. + +##### t1 + +> **t1**: `number` + +Defined in: [topology/replay.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L40) + +**`Experimental`** + +*** + +### TopologyNode + +Defined in: [topology/tree.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L24) + +One agent in the tree. A leaf never spawns; a driver's `childIds` is non-empty. + +#### Properties + +##### id + +> `readonly` **id**: `string` + +Defined in: [topology/tree.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L25) + +##### label + +> **label**: `string` + +Defined in: [topology/tree.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L27) + +Display label (spawn `label`, or the driver name on the root). + +##### runtime? + +> `optional` **runtime?**: `string` + +Defined in: [topology/tree.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L29) + +Leaf runtime (`router`/`sandbox`/`cli`) when known. + +##### parentId? + +> `optional` **parentId?**: `string` + +Defined in: [topology/tree.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L31) + +Parent agent id; undefined ⇒ a root. + +##### depth + +> **depth**: `number` + +Defined in: [topology/tree.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L33) + +Recursion depth (root = 0). + +##### status + +> **status**: [`TopologyStatus`](#topologystatus) + +Defined in: [topology/tree.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L34) + +##### steps + +> **steps**: `number` + +Defined in: [topology/tree.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L36) + +Count of in-agent steps (turns + tool calls + plan/decision rounds) folded so far. + +##### score? + +> `optional` **score?**: `number` + +Defined in: [topology/tree.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L38) + +Deployable score in [0,1] once settled `done`. + +##### reason? + +> `optional` **reason?**: `string` + +Defined in: [topology/tree.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L40) + +Failure reason once settled `down`. + +##### childIds + +> `readonly` **childIds**: `string`[] + +Defined in: [topology/tree.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L42) + +Children in spawn order. + +*** + +### RenderOptions + +Defined in: [topology/tree.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L45) + +#### Properties + +##### maxDepth? + +> `readonly` `optional` **maxDepth?**: `number` + +Defined in: [topology/tree.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L47) + +Cap the rendered depth (deeper nodes collapse to a `… N more` line). Default: no cap. + +##### compact? + +> `readonly` `optional` **compact?**: `boolean` + +Defined in: [topology/tree.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L49) + +Drop the per-node detail suffix (steps/children/score) — labels only. Default: false. + +*** + +### TopologyView + +Defined in: [topology/tree.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L52) + +#### Properties + +##### hooks + +> `readonly` **hooks**: [`RuntimeHooks`](index.md#runtimehooks) + +Defined in: [topology/tree.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L54) + +The `RuntimeHooks` sink — attach to `SupervisorOpts.hooks` / `runLoop` options. + +#### Methods + +##### ingest() + +> **ingest**(`event`): `void` + +Defined in: [topology/tree.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L56) + +Fold one event into the tree (the same call `hooks.onEvent` makes — exposed for replay). + +###### Parameters + +###### event + +[`RuntimeHookEvent`](index.md#runtimehookevent) + +###### Returns + +`void` + +##### nodes() + +> **nodes**(): [`TopologyNode`](#topologynode)[] + +Defined in: [topology/tree.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L58) + +Every node, insertion order. + +###### Returns + +[`TopologyNode`](#topologynode)[] + +##### roots() + +> **roots**(): [`TopologyNode`](#topologynode)[] + +Defined in: [topology/tree.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L60) + +Nodes with no in-tree parent (the run roots). + +###### Returns + +[`TopologyNode`](#topologynode)[] + +##### node() + +> **node**(`id`): [`TopologyNode`](#topologynode) \| `undefined` + +Defined in: [topology/tree.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L62) + +One node by id. + +###### Parameters + +###### id + +`string` + +###### Returns + +[`TopologyNode`](#topologynode) \| `undefined` + +##### render() + +> **render**(`opts?`): `string` + +Defined in: [topology/tree.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L64) + +Render the tree as an aligned ASCII forest. + +###### Parameters + +###### opts? + +[`RenderOptions`](#renderoptions) + +###### Returns + +`string` + +## Type Aliases + +### TopologyStatus + +> **TopologyStatus** = `"running"` \| `"done"` \| `"down"` + +Defined in: [topology/tree.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L21) + +## Functions + +### createReplayRecorder() + +> **createReplayRecorder**(): `object` + +Defined in: [topology/replay.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L58) + +**`Experimental`** + +A `RuntimeHooks` sink that records every lifecycle event in arrival order as `ReplayEvent`s. +Attach it to `SupervisorOpts.hooks` (or merge with another hooks object) and read `timeline()` +after the run. Pure capture — no I/O, no throwing; an unrecognized event is ignored. + +#### Returns + +`object` + +##### hooks + +> **hooks**: [`RuntimeHooks`](index.md#runtimehooks) + +##### events + +> **events**: [`ReplayEvent`](#replayevent)[] + +##### timeline() + +> **timeline**(`runId?`): [`ReplayTimeline`](#replaytimeline) + +###### Parameters + +###### runId? + +`string` + +###### Returns + +[`ReplayTimeline`](#replaytimeline) + +*** + +### renderReplayHtml() + +> **renderReplayHtml**(`timeline`, `opts?`): `string` + +Defined in: [topology/replay.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L159) + +**`Experimental`** + +Render a self-contained animated HTML replay player for a timeline. Open the file in a browser. + +#### Parameters + +##### timeline + +[`ReplayTimeline`](#replaytimeline) + +##### opts? + +###### title? + +`string` + +#### Returns + +`string` + +*** + +### createTopologyView() + +> **createTopologyView**(): [`TopologyView`](#topologyview) + +Defined in: [topology/tree.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L70) + +Build a live topology view. Stateful — one per run (or per replay). + +#### Returns + +[`TopologyView`](#topologyview) + +*** + +### renderTopologyTree() + +> **renderTopologyTree**(`tree`, `opts?`): `string` + +Defined in: [topology/tree.ts:161](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L161) + +Render a forest of `TopologyNode`s to an aligned ASCII tree. Pure — given the same roots + + node lookup it returns the same string. Exposed so a caller can render a tree it folded + itself (e.g. from a journal replay) without the live view. + +#### Parameters + +##### tree + +###### roots + +[`TopologyNode`](#topologynode)[] + +###### node + +(`id`) => [`TopologyNode`](#topologynode) \| `undefined` + +##### opts? + +[`RenderOptions`](#renderoptions) = `{}` + +#### Returns + +`string` diff --git a/docs/api/topology/README.md b/docs/api/topology/README.md deleted file mode 100644 index 1f9ea36..0000000 --- a/docs/api/topology/README.md +++ /dev/null @@ -1,26 +0,0 @@ -[**@tangle-network/agent-runtime**](../README.md) - -*** - -[@tangle-network/agent-runtime](../README.md) / topology - -# topology - -## Interfaces - -- [ReplayEvent](interfaces/ReplayEvent.md) -- [ReplayTimeline](interfaces/ReplayTimeline.md) -- [TopologyNode](interfaces/TopologyNode.md) -- [RenderOptions](interfaces/RenderOptions.md) -- [TopologyView](interfaces/TopologyView.md) - -## Type Aliases - -- [TopologyStatus](type-aliases/TopologyStatus.md) - -## Functions - -- [createReplayRecorder](functions/createReplayRecorder.md) -- [renderReplayHtml](functions/renderReplayHtml.md) -- [createTopologyView](functions/createTopologyView.md) -- [renderTopologyTree](functions/renderTopologyTree.md) diff --git a/docs/api/topology/functions/createReplayRecorder.md b/docs/api/topology/functions/createReplayRecorder.md deleted file mode 100644 index 9b9a6e7..0000000 --- a/docs/api/topology/functions/createReplayRecorder.md +++ /dev/null @@ -1,43 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [topology](../README.md) / createReplayRecorder - -# Function: createReplayRecorder() - -> **createReplayRecorder**(): `object` - -Defined in: [topology/replay.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L58) - -**`Experimental`** - -A `RuntimeHooks` sink that records every lifecycle event in arrival order as `ReplayEvent`s. -Attach it to `SupervisorOpts.hooks` (or merge with another hooks object) and read `timeline()` -after the run. Pure capture — no I/O, no throwing; an unrecognized event is ignored. - -## Returns - -`object` - -### hooks - -> **hooks**: [`RuntimeHooks`](../../index/interfaces/RuntimeHooks.md) - -### events - -> **events**: [`ReplayEvent`](../interfaces/ReplayEvent.md)[] - -### timeline() - -> **timeline**(`runId?`): [`ReplayTimeline`](../interfaces/ReplayTimeline.md) - -#### Parameters - -##### runId? - -`string` - -#### Returns - -[`ReplayTimeline`](../interfaces/ReplayTimeline.md) diff --git a/docs/api/topology/functions/createTopologyView.md b/docs/api/topology/functions/createTopologyView.md deleted file mode 100644 index 45bdbad..0000000 --- a/docs/api/topology/functions/createTopologyView.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [topology](../README.md) / createTopologyView - -# Function: createTopologyView() - -> **createTopologyView**(): [`TopologyView`](../interfaces/TopologyView.md) - -Defined in: [topology/tree.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L70) - -Build a live topology view. Stateful — one per run (or per replay). - -## Returns - -[`TopologyView`](../interfaces/TopologyView.md) diff --git a/docs/api/topology/functions/renderReplayHtml.md b/docs/api/topology/functions/renderReplayHtml.md deleted file mode 100644 index 33c1fe3..0000000 --- a/docs/api/topology/functions/renderReplayHtml.md +++ /dev/null @@ -1,31 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [topology](../README.md) / renderReplayHtml - -# Function: renderReplayHtml() - -> **renderReplayHtml**(`timeline`, `opts?`): `string` - -Defined in: [topology/replay.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L159) - -**`Experimental`** - -Render a self-contained animated HTML replay player for a timeline. Open the file in a browser. - -## Parameters - -### timeline - -[`ReplayTimeline`](../interfaces/ReplayTimeline.md) - -### opts? - -#### title? - -`string` - -## Returns - -`string` diff --git a/docs/api/topology/functions/renderTopologyTree.md b/docs/api/topology/functions/renderTopologyTree.md deleted file mode 100644 index 4ed0d87..0000000 --- a/docs/api/topology/functions/renderTopologyTree.md +++ /dev/null @@ -1,35 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [topology](../README.md) / renderTopologyTree - -# Function: renderTopologyTree() - -> **renderTopologyTree**(`tree`, `opts?`): `string` - -Defined in: [topology/tree.ts:161](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L161) - -Render a forest of `TopologyNode`s to an aligned ASCII tree. Pure — given the same roots + - node lookup it returns the same string. Exposed so a caller can render a tree it folded - itself (e.g. from a journal replay) without the live view. - -## Parameters - -### tree - -#### roots - -[`TopologyNode`](../interfaces/TopologyNode.md)[] - -#### node - -(`id`) => [`TopologyNode`](../interfaces/TopologyNode.md) \| `undefined` - -### opts? - -[`RenderOptions`](../interfaces/RenderOptions.md) = `{}` - -## Returns - -`string` diff --git a/docs/api/topology/interfaces/RenderOptions.md b/docs/api/topology/interfaces/RenderOptions.md deleted file mode 100644 index 45c7923..0000000 --- a/docs/api/topology/interfaces/RenderOptions.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [topology](../README.md) / RenderOptions - -# Interface: RenderOptions - -Defined in: [topology/tree.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L45) - -## Properties - -### maxDepth? - -> `readonly` `optional` **maxDepth?**: `number` - -Defined in: [topology/tree.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L47) - -Cap the rendered depth (deeper nodes collapse to a `… N more` line). Default: no cap. - -*** - -### compact? - -> `readonly` `optional` **compact?**: `boolean` - -Defined in: [topology/tree.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L49) - -Drop the per-node detail suffix (steps/children/score) — labels only. Default: false. diff --git a/docs/api/topology/interfaces/ReplayEvent.md b/docs/api/topology/interfaces/ReplayEvent.md deleted file mode 100644 index 7b50b36..0000000 --- a/docs/api/topology/interfaces/ReplayEvent.md +++ /dev/null @@ -1,117 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [topology](../README.md) / ReplayEvent - -# Interface: ReplayEvent - -Defined in: [topology/replay.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L18) - -One normalized animation frame — a node appearing, settling, or stepping, at a wall-clock ms. - -## Properties - -### t - -> **t**: `number` - -Defined in: [topology/replay.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L19) - -*** - -### kind - -> **kind**: `"root"` \| `"spawn"` \| `"settle"` \| `"step"` - -Defined in: [topology/replay.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L20) - -*** - -### id - -> **id**: `string` - -Defined in: [topology/replay.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L21) - -*** - -### parentId? - -> `optional` **parentId?**: `string` - -Defined in: [topology/replay.ts:22](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L22) - -*** - -### label? - -> `optional` **label?**: `string` - -Defined in: [topology/replay.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L23) - -*** - -### runtime? - -> `optional` **runtime?**: `string` - -Defined in: [topology/replay.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L24) - -*** - -### depth? - -> `optional` **depth?**: `number` - -Defined in: [topology/replay.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L25) - -*** - -### status? - -> `optional` **status?**: `"running"` \| `"done"` \| `"down"` - -Defined in: [topology/replay.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L26) - -*** - -### valid? - -> `optional` **valid?**: `boolean` - -Defined in: [topology/replay.ts:28](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L28) - -The completion-oracle signal: delivered ⟺ a deployable check passed (not self-report). - -*** - -### score? - -> `optional` **score?**: `number` - -Defined in: [topology/replay.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L29) - -*** - -### reason? - -> `optional` **reason?**: `string` - -Defined in: [topology/replay.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L30) - -*** - -### tokens? - -> `optional` **tokens?**: `number` - -Defined in: [topology/replay.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L31) - -*** - -### usd? - -> `optional` **usd?**: `number` - -Defined in: [topology/replay.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L32) diff --git a/docs/api/topology/interfaces/ReplayTimeline.md b/docs/api/topology/interfaces/ReplayTimeline.md deleted file mode 100644 index 70b881d..0000000 --- a/docs/api/topology/interfaces/ReplayTimeline.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [topology](../README.md) / ReplayTimeline - -# Interface: ReplayTimeline - -Defined in: [topology/replay.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L35) - -**`Experimental`** - -`@tangle-network/agent-runtime/topology` — the live recursive-agent-tree projection over the -lifecycle hook stream. Attach `createTopologyView().hooks` to a `Supervisor`/`runLoop` and read -`.render()` for the agent tree; or fold a journal replay with `renderTopologyTree`. - -## Properties - -### runId - -> **runId**: `string` - -Defined in: [topology/replay.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L36) - -**`Experimental`** - -*** - -### events - -> **events**: [`ReplayEvent`](ReplayEvent.md)[] - -Defined in: [topology/replay.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L37) - -**`Experimental`** - -*** - -### t0 - -> **t0**: `number` - -Defined in: [topology/replay.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L39) - -**`Experimental`** - -Wall-clock window [t0, t1] the player scrubs over. - -*** - -### t1 - -> **t1**: `number` - -Defined in: [topology/replay.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/replay.ts#L40) - -**`Experimental`** diff --git a/docs/api/topology/interfaces/TopologyNode.md b/docs/api/topology/interfaces/TopologyNode.md deleted file mode 100644 index 11bdaf1..0000000 --- a/docs/api/topology/interfaces/TopologyNode.md +++ /dev/null @@ -1,107 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [topology](../README.md) / TopologyNode - -# Interface: TopologyNode - -Defined in: [topology/tree.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L24) - -One agent in the tree. A leaf never spawns; a driver's `childIds` is non-empty. - -## Properties - -### id - -> `readonly` **id**: `string` - -Defined in: [topology/tree.ts:25](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L25) - -*** - -### label - -> **label**: `string` - -Defined in: [topology/tree.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L27) - -Display label (spawn `label`, or the driver name on the root). - -*** - -### runtime? - -> `optional` **runtime?**: `string` - -Defined in: [topology/tree.ts:29](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L29) - -Leaf runtime (`router`/`sandbox`/`cli`) when known. - -*** - -### parentId? - -> `optional` **parentId?**: `string` - -Defined in: [topology/tree.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L31) - -Parent agent id; undefined ⇒ a root. - -*** - -### depth - -> **depth**: `number` - -Defined in: [topology/tree.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L33) - -Recursion depth (root = 0). - -*** - -### status - -> **status**: [`TopologyStatus`](../type-aliases/TopologyStatus.md) - -Defined in: [topology/tree.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L34) - -*** - -### steps - -> **steps**: `number` - -Defined in: [topology/tree.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L36) - -Count of in-agent steps (turns + tool calls + plan/decision rounds) folded so far. - -*** - -### score? - -> `optional` **score?**: `number` - -Defined in: [topology/tree.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L38) - -Deployable score in [0,1] once settled `done`. - -*** - -### reason? - -> `optional` **reason?**: `string` - -Defined in: [topology/tree.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L40) - -Failure reason once settled `down`. - -*** - -### childIds - -> `readonly` **childIds**: `string`[] - -Defined in: [topology/tree.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L42) - -Children in spawn order. diff --git a/docs/api/topology/interfaces/TopologyView.md b/docs/api/topology/interfaces/TopologyView.md deleted file mode 100644 index dcb7c91..0000000 --- a/docs/api/topology/interfaces/TopologyView.md +++ /dev/null @@ -1,107 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [topology](../README.md) / TopologyView - -# Interface: TopologyView - -Defined in: [topology/tree.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L52) - -## Properties - -### hooks - -> `readonly` **hooks**: [`RuntimeHooks`](../../index/interfaces/RuntimeHooks.md) - -Defined in: [topology/tree.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L54) - -The `RuntimeHooks` sink — attach to `SupervisorOpts.hooks` / `runLoop` options. - -## Methods - -### ingest() - -> **ingest**(`event`): `void` - -Defined in: [topology/tree.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L56) - -Fold one event into the tree (the same call `hooks.onEvent` makes — exposed for replay). - -#### Parameters - -##### event - -[`RuntimeHookEvent`](../../index/interfaces/RuntimeHookEvent.md) - -#### Returns - -`void` - -*** - -### nodes() - -> **nodes**(): [`TopologyNode`](TopologyNode.md)[] - -Defined in: [topology/tree.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L58) - -Every node, insertion order. - -#### Returns - -[`TopologyNode`](TopologyNode.md)[] - -*** - -### roots() - -> **roots**(): [`TopologyNode`](TopologyNode.md)[] - -Defined in: [topology/tree.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L60) - -Nodes with no in-tree parent (the run roots). - -#### Returns - -[`TopologyNode`](TopologyNode.md)[] - -*** - -### node() - -> **node**(`id`): [`TopologyNode`](TopologyNode.md) \| `undefined` - -Defined in: [topology/tree.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L62) - -One node by id. - -#### Parameters - -##### id - -`string` - -#### Returns - -[`TopologyNode`](TopologyNode.md) \| `undefined` - -*** - -### render() - -> **render**(`opts?`): `string` - -Defined in: [topology/tree.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L64) - -Render the tree as an aligned ASCII forest. - -#### Parameters - -##### opts? - -[`RenderOptions`](RenderOptions.md) - -#### Returns - -`string` diff --git a/docs/api/topology/type-aliases/TopologyStatus.md b/docs/api/topology/type-aliases/TopologyStatus.md deleted file mode 100644 index b558ff6..0000000 --- a/docs/api/topology/type-aliases/TopologyStatus.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [topology](../README.md) / TopologyStatus - -# Type Alias: TopologyStatus - -> **TopologyStatus** = `"running"` \| `"done"` \| `"down"` - -Defined in: [topology/tree.ts:21](https://github.com/tangle-network/agent-runtime/blob/main/src/topology/tree.ts#L21) diff --git a/docs/api/workflow.md b/docs/api/workflow.md new file mode 100644 index 0000000..fcc5067 --- /dev/null +++ b/docs/api/workflow.md @@ -0,0 +1,2379 @@ +[**@tangle-network/agent-runtime**](README.md) + +*** + +[@tangle-network/agent-runtime](README.md) / workflow + +# workflow + +## Classes + +### WorkflowBudget + +Defined in: [workflow/budget.ts:11](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L11) + +#### Implements + +- [`WorkflowBudgetView`](#workflowbudgetview) + +#### Constructors + +##### Constructor + +> **new WorkflowBudget**(`total`, `now`): [`WorkflowBudget`](#workflowbudget) + +Defined in: [workflow/budget.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L20) + +###### Parameters + +###### total + +[`WorkflowBudgetCaps`](#workflowbudgetcaps) + +###### now + +() => `number` + +###### Returns + +[`WorkflowBudget`](#workflowbudget) + +#### Properties + +##### total + +> `readonly` **total**: [`WorkflowBudgetCaps`](#workflowbudgetcaps) + +Defined in: [workflow/budget.ts:12](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L12) + +###### Implementation of + +[`WorkflowBudgetView`](#workflowbudgetview).[`total`](#total-1) + +#### Methods + +##### spent() + +> **spent**(): [`WorkflowBudgetSnapshot`](#workflowbudgetsnapshot) + +Defined in: [workflow/budget.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L26) + +###### Returns + +[`WorkflowBudgetSnapshot`](#workflowbudgetsnapshot) + +###### Implementation of + +[`WorkflowBudgetView`](#workflowbudgetview).[`spent`](#spent-1) + +##### remaining() + +> **remaining**(): [`WorkflowBudgetRemaining`](#workflowbudgetremaining-1) + +Defined in: [workflow/budget.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L36) + +###### Returns + +[`WorkflowBudgetRemaining`](#workflowbudgetremaining-1) + +###### Implementation of + +[`WorkflowBudgetView`](#workflowbudgetview).[`remaining`](#remaining-1) + +##### nextAgentIndex() + +> **nextAgentIndex**(): `number` + +Defined in: [workflow/budget.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L52) + +###### Returns + +`number` + +##### nextLoopIndex() + +> **nextLoopIndex**(): `number` + +Defined in: [workflow/budget.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L64) + +###### Returns + +`number` + +##### assertFanout() + +> **assertFanout**(`count`): `void` + +Defined in: [workflow/budget.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L76) + +###### Parameters + +###### count + +`number` + +###### Returns + +`void` + +##### observe() + +> **observe**(`result`): `object` + +Defined in: [workflow/budget.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L89) + +###### Parameters + +###### result + +[`WorkflowDelegateResult`](#workflowdelegateresult) + +###### Returns + +`object` + +###### costUsd + +> **costUsd**: `number` + +###### tokenUsage + +> **tokenUsage**: [`WorkflowTokenUsage`](#workflowtokenusage) + +##### assertWall() + +> **assertWall**(): `void` + +Defined in: [workflow/budget.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L106) + +###### Returns + +`void` + +##### remainingWallMs() + +> **remainingWallMs**(): `number` \| `undefined` + +Defined in: [workflow/budget.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L112) + +###### Returns + +`number` \| `undefined` + +## Interfaces + +### WorkflowSandboxAgentTrace + +Defined in: [workflow/agent-delegate.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L34) + +#### Type Parameters + +##### TOutput + +`TOutput` = `unknown` + +#### Properties + +##### prompt + +> **prompt**: `string` + +Defined in: [workflow/agent-delegate.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L35) + +##### options + +> **options**: [`WorkflowAgentOptions`](#workflowagentoptions) + +Defined in: [workflow/agent-delegate.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L36) + +##### ctx + +> **ctx**: [`WorkflowDelegateContext`](#workflowdelegatecontext) + +Defined in: [workflow/agent-delegate.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L37) + +##### profile + +> **profile**: `AgentProfile` + +Defined in: [workflow/agent-delegate.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L38) + +##### output + +> **output**: `TOutput` + +Defined in: [workflow/agent-delegate.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L39) + +##### events + +> **events**: `SandboxEvent`[] + +Defined in: [workflow/agent-delegate.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L40) + +##### stream + +> **stream**: [`WorkflowSandboxAgentStream`](#workflowsandboxagentstream) + +Defined in: [workflow/agent-delegate.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L41) + +##### placement + +> **placement**: [`LoopSandboxPlacement`](runtime.md#loopsandboxplacement) + +Defined in: [workflow/agent-delegate.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L42) + +##### costUsd + +> **costUsd**: `number` + +Defined in: [workflow/agent-delegate.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L43) + +##### tokenUsage + +> **tokenUsage**: [`WorkflowTokenUsage`](#workflowtokenusage) + +Defined in: [workflow/agent-delegate.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L44) + +*** + +### CreateSandboxWorkflowAgentDelegateOptions + +Defined in: [workflow/agent-delegate.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L47) + +#### Type Parameters + +##### TOutput + +`TOutput` = `unknown` + +#### Properties + +##### client + +> **client**: [`SandboxClient`](runtime.md#sandboxclient-2) + +Defined in: [workflow/agent-delegate.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L48) + +##### profile + +> **profile**: [`WorkflowSandboxAgentProfileResolver`](#workflowsandboxagentprofileresolver) + +Defined in: [workflow/agent-delegate.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L49) + +##### output? + +> `optional` **output?**: [`OutputAdapter`](runtime.md#outputadapter)\<`TOutput`\> + +Defined in: [workflow/agent-delegate.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L50) + +##### stream? + +> `optional` **stream?**: [`WorkflowSandboxAgentStream`](#workflowsandboxagentstream) + +Defined in: [workflow/agent-delegate.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L51) + +##### sandboxOverrides? + +> `optional` **sandboxOverrides?**: `Partial`\<`Omit`\<`CreateSandboxOptions`, `"backend"`\>\> & `object` + +Defined in: [workflow/agent-delegate.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L52) + +###### Type Declaration + +###### backend? + +> `optional` **backend?**: `Omit`\<`BackendConfig`, `"profile"`\> + +##### promptOptions? + +> `optional` **promptOptions?**: [`WorkflowSandboxPromptOptionsResolver`](#workflowsandboxpromptoptionsresolver)\<`PromptOptions`\> + +Defined in: [workflow/agent-delegate.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L55) + +##### taskOptions? + +> `optional` **taskOptions?**: [`WorkflowSandboxPromptOptionsResolver`](#workflowsandboxpromptoptionsresolver)\<`TaskOptions`\> + +Defined in: [workflow/agent-delegate.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L56) + +##### deleteAfter? + +> `optional` **deleteAfter?**: `boolean` + +Defined in: [workflow/agent-delegate.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L57) + +##### includeEventsInTrace? + +> `optional` **includeEventsInTrace?**: `boolean` + +Defined in: [workflow/agent-delegate.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L58) + +##### toTrace? + +> `optional` **toTrace?**: (`trace`) => `unknown` + +Defined in: [workflow/agent-delegate.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L59) + +###### Parameters + +###### trace + +[`WorkflowSandboxAgentTrace`](#workflowsandboxagenttrace)\<`TOutput`\> + +###### Returns + +`unknown` + +*** + +### WorkflowSandboxAgentDefaultTrace + +Defined in: [workflow/agent-delegate.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L62) + +#### Properties + +##### stream + +> **stream**: [`WorkflowSandboxAgentStream`](#workflowsandboxagentstream) + +Defined in: [workflow/agent-delegate.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L63) + +##### placement + +> **placement**: `"sibling"` \| `"fleet"` + +Defined in: [workflow/agent-delegate.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L64) + +##### sandboxId? + +> `optional` **sandboxId?**: `string` + +Defined in: [workflow/agent-delegate.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L65) + +##### fleetId? + +> `optional` **fleetId?**: `string` + +Defined in: [workflow/agent-delegate.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L66) + +##### machineId? + +> `optional` **machineId?**: `string` + +Defined in: [workflow/agent-delegate.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L67) + +##### profileName? + +> `optional` **profileName?**: `string` + +Defined in: [workflow/agent-delegate.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L68) + +##### eventCount + +> **eventCount**: `number` + +Defined in: [workflow/agent-delegate.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L69) + +##### eventTypes + +> **eventTypes**: `string`[] + +Defined in: [workflow/agent-delegate.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L70) + +##### events? + +> `optional` **events?**: `SandboxEvent`[] + +Defined in: [workflow/agent-delegate.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L71) + +*** + +### CreateRunLoopWorkflowDelegateOptions + +Defined in: [workflow/loop-delegate.ts:9](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/loop-delegate.ts#L9) + +#### Type Parameters + +##### Input + +`Input` + +##### Task + +`Task` + +##### Output + +`Output` + +##### Decision + +`Decision` + +#### Properties + +##### toOutput? + +> `optional` **toOutput?**: (`result`) => `unknown` + +Defined in: [workflow/loop-delegate.ts:15](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/loop-delegate.ts#L15) + +###### Parameters + +###### result + +[`LoopResult`](runtime.md#loopresult)\<`Task`, `Output`, `Decision`\> + +###### Returns + +`unknown` + +##### toTrace? + +> `optional` **toTrace?**: (`result`) => `unknown` + +Defined in: [workflow/loop-delegate.ts:16](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/loop-delegate.ts#L16) + +###### Parameters + +###### result + +[`LoopResult`](runtime.md#loopresult)\<`Task`, `Output`, `Decision`\> + +###### Returns + +`unknown` + +#### Methods + +##### toRunLoopOptions() + +> **toRunLoopOptions**(`input`, `options`, `ctx`): [`RunLoopOptions`](runtime.md#runloopoptions)\<`Task`, `Output`, `Decision`\> + +Defined in: [workflow/loop-delegate.ts:10](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/loop-delegate.ts#L10) + +###### Parameters + +###### input + +`Input` + +###### options + +[`WorkflowLoopOptions`](#workflowloopoptions) + +###### ctx + +[`WorkflowDelegateContext`](#workflowdelegatecontext) + +###### Returns + +[`RunLoopOptions`](runtime.md#runloopoptions)\<`Task`, `Output`, `Decision`\> + +*** + +### NestedWorkflowDelegateInput + +Defined in: [workflow/nested-workflow-delegate.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L17) + +#### Properties + +##### source + +> **source**: `string` + +Defined in: [workflow/nested-workflow-delegate.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L18) + +##### options + +> **options**: [`WorkflowAgentOptions`](#workflowagentoptions) + +Defined in: [workflow/nested-workflow-delegate.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L19) + +##### parent + +> **parent**: [`WorkflowDelegateContext`](#workflowdelegatecontext) + +Defined in: [workflow/nested-workflow-delegate.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L20) + +*** + +### NestedWorkflowTrace + +Defined in: [workflow/nested-workflow-delegate.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L31) + +#### Properties + +##### nested + +> **nested**: `true` + +Defined in: [workflow/nested-workflow-delegate.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L32) + +##### runId + +> **runId**: `string` + +Defined in: [workflow/nested-workflow-delegate.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L33) + +##### parentRunId + +> **parentRunId**: `string` + +Defined in: [workflow/nested-workflow-delegate.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L34) + +##### depth + +> **depth**: `number` + +Defined in: [workflow/nested-workflow-delegate.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L35) + +##### metaName + +> **metaName**: `string` + +Defined in: [workflow/nested-workflow-delegate.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L36) + +##### eventCount + +> **eventCount**: `number` + +Defined in: [workflow/nested-workflow-delegate.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L37) + +##### eventKinds + +> **eventKinds**: `string`[] + +Defined in: [workflow/nested-workflow-delegate.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L38) + +##### durationMs + +> **durationMs**: `number` + +Defined in: [workflow/nested-workflow-delegate.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L39) + +##### costUsd + +> **costUsd**: `number` + +Defined in: [workflow/nested-workflow-delegate.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L40) + +##### tokenUsage + +> **tokenUsage**: [`WorkflowTokenUsage`](#workflowtokenusage) + +Defined in: [workflow/nested-workflow-delegate.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L41) + +##### agentCalls + +> **agentCalls**: `number` + +Defined in: [workflow/nested-workflow-delegate.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L42) + +##### loopCalls + +> **loopCalls**: `number` + +Defined in: [workflow/nested-workflow-delegate.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L43) + +##### events? + +> `optional` **events?**: [`WorkflowTraceEvent`](#workflowtraceevent)[] + +Defined in: [workflow/nested-workflow-delegate.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L44) + +*** + +### CreateNestedWorkflowAgentDelegateOptions + +Defined in: [workflow/nested-workflow-delegate.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L47) + +#### Properties + +##### agent + +> **agent**: [`WorkflowAgentDelegate`](#workflowagentdelegate) + +Defined in: [workflow/nested-workflow-delegate.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L52) + +Real worker delegate used for normal agent() calls and for child workflow +agent() calls that do not opt into allowWorkflow. + +##### caps + +> **caps**: [`NestedWorkflowCapsResolver`](#nestedworkflowcapsresolver) + +Defined in: [workflow/nested-workflow-delegate.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L53) + +##### loop? + +> `optional` **loop?**: [`WorkflowLoopDelegate`](#workflowloopdelegate) + +Defined in: [workflow/nested-workflow-delegate.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L54) + +##### verifier? + +> `optional` **verifier?**: [`WorkflowVerifierDelegate`](#workflowverifierdelegate) + +Defined in: [workflow/nested-workflow-delegate.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L55) + +##### analyst? + +> `optional` **analyst?**: [`WorkflowAnalystDelegate`](#workflowanalystdelegate) + +Defined in: [workflow/nested-workflow-delegate.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L56) + +##### reviewer? + +> `optional` **reviewer?**: [`WorkflowReviewerDelegate`](#workflowreviewerdelegate) + +Defined in: [workflow/nested-workflow-delegate.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L57) + +##### metadata? + +> `optional` **metadata?**: [`NestedWorkflowMetadataResolver`](#nestedworkflowmetadataresolver) + +Defined in: [workflow/nested-workflow-delegate.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L58) + +##### traceEmitter? + +> `optional` **traceEmitter?**: [`WorkflowTraceEmitter`](#workflowtraceemitter) + +Defined in: [workflow/nested-workflow-delegate.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L59) + +##### includeEventsInTrace? + +> `optional` **includeEventsInTrace?**: `boolean` + +Defined in: [workflow/nested-workflow-delegate.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L60) + +##### runId? + +> `optional` **runId?**: (`input`) => `string` + +Defined in: [workflow/nested-workflow-delegate.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L61) + +###### Parameters + +###### input + +[`NestedWorkflowDelegateInput`](#nestedworkflowdelegateinput) + +###### Returns + +`string` + +##### toOutput? + +> `optional` **toOutput?**: (`result`, `input`) => `unknown` + +Defined in: [workflow/nested-workflow-delegate.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L62) + +###### Parameters + +###### result + +[`WorkflowResult`](#workflowresult) + +###### input + +[`NestedWorkflowDelegateInput`](#nestedworkflowdelegateinput) + +###### Returns + +`unknown` + +##### toTrace? + +> `optional` **toTrace?**: (`result`, `input`) => `unknown` + +Defined in: [workflow/nested-workflow-delegate.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L63) + +###### Parameters + +###### result + +[`WorkflowResult`](#workflowresult) + +###### input + +[`NestedWorkflowDelegateInput`](#nestedworkflowdelegateinput) + +###### Returns + +`unknown` + +*** + +### WorkflowPhaseMeta + +Defined in: [workflow/types.ts:13](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L13) + +**`Experimental`** + +Dynamic workflow substrate. + +A workflow is driver-authored code executed by a restricted runtime. The +runtime owns orchestration mechanics (phase/progress, fanout, budget, +cancellation, trace emission); product code supplies delegates that actually +run agents and loops. That boundary keeps this package generic while still +letting consumers wire real sandboxes underneath `agent()` and `loop()`. + +#### Properties + +##### title + +> **title**: `string` + +Defined in: [workflow/types.ts:14](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L14) + +**`Experimental`** + +*** + +### WorkflowMeta + +Defined in: [workflow/types.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L17) + +#### Properties + +##### name + +> **name**: `string` + +Defined in: [workflow/types.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L18) + +##### description + +> **description**: `string` + +Defined in: [workflow/types.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L19) + +##### phases? + +> `optional` **phases?**: [`WorkflowPhaseMeta`](#workflowphasemeta)[] + +Defined in: [workflow/types.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L20) + +*** + +### WorkflowTokenUsage + +Defined in: [workflow/types.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L37) + +#### Properties + +##### input + +> **input**: `number` + +Defined in: [workflow/types.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L38) + +##### output + +> **output**: `number` + +Defined in: [workflow/types.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L39) + +*** + +### WorkflowBudgetSnapshot + +Defined in: [workflow/types.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L42) + +#### Properties + +##### costUsd + +> **costUsd**: `number` + +Defined in: [workflow/types.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L43) + +##### tokens + +> **tokens**: [`WorkflowTokenUsage`](#workflowtokenusage) + +Defined in: [workflow/types.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L44) + +##### agentCalls + +> **agentCalls**: `number` + +Defined in: [workflow/types.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L45) + +##### loopCalls + +> **loopCalls**: `number` + +Defined in: [workflow/types.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L46) + +##### elapsedMs + +> **elapsedMs**: `number` + +Defined in: [workflow/types.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L47) + +*** + +### WorkflowBudgetRemaining + +Defined in: [workflow/types.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L50) + +#### Properties + +##### costUsd? + +> `optional` **costUsd?**: `number` + +Defined in: [workflow/types.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L51) + +##### tokens? + +> `optional` **tokens?**: `number` + +Defined in: [workflow/types.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L52) + +##### agentCalls? + +> `optional` **agentCalls?**: `number` + +Defined in: [workflow/types.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L53) + +##### loopCalls? + +> `optional` **loopCalls?**: `number` + +Defined in: [workflow/types.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L54) + +##### wallMs? + +> `optional` **wallMs?**: `number` + +Defined in: [workflow/types.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L55) + +*** + +### WorkflowBudgetCaps + +Defined in: [workflow/types.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L58) + +#### Properties + +##### maxCostUsd? + +> `optional` **maxCostUsd?**: `number` + +Defined in: [workflow/types.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L59) + +##### maxTokens? + +> `optional` **maxTokens?**: `number` + +Defined in: [workflow/types.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L60) + +##### maxWallMs? + +> `optional` **maxWallMs?**: `number` + +Defined in: [workflow/types.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L61) + +##### maxAgentCalls? + +> `optional` **maxAgentCalls?**: `number` + +Defined in: [workflow/types.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L62) + +##### maxLoopCalls? + +> `optional` **maxLoopCalls?**: `number` + +Defined in: [workflow/types.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L63) + +##### maxFanout? + +> `optional` **maxFanout?**: `number` + +Defined in: [workflow/types.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L64) + +##### maxDepth? + +> `optional` **maxDepth?**: `number` + +Defined in: [workflow/types.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L65) + +*** + +### WorkflowBudgetView + +Defined in: [workflow/types.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L68) + +#### Properties + +##### total + +> `readonly` **total**: [`WorkflowBudgetCaps`](#workflowbudgetcaps) + +Defined in: [workflow/types.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L69) + +#### Methods + +##### spent() + +> **spent**(): [`WorkflowBudgetSnapshot`](#workflowbudgetsnapshot) + +Defined in: [workflow/types.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L70) + +###### Returns + +[`WorkflowBudgetSnapshot`](#workflowbudgetsnapshot) + +##### remaining() + +> **remaining**(): [`WorkflowBudgetRemaining`](#workflowbudgetremaining-1) + +Defined in: [workflow/types.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L71) + +###### Returns + +[`WorkflowBudgetRemaining`](#workflowbudgetremaining-1) + +*** + +### WorkflowAgentOptions + +Defined in: [workflow/types.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L74) + +#### Type Parameters + +##### TOutput + +`TOutput` = `unknown` + +#### Properties + +##### label? + +> `optional` **label?**: `string` + +Defined in: [workflow/types.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L75) + +##### schema? + +> `optional` **schema?**: [`JsonSchema`](#jsonschema) + +Defined in: [workflow/types.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L76) + +##### metadata? + +> `optional` **metadata?**: `Record`\<`string`, `unknown`\> + +Defined in: [workflow/types.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L77) + +##### allowWorkflow? + +> `optional` **allowWorkflow?**: `boolean` + +Defined in: [workflow/types.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L82) + +Nested workflows are denied by default. Consumers that expose them through +a delegate must also honor `ctx.depth` and `ctx.caps.maxDepth`. + +##### decode? + +> `optional` **decode?**: (`value`) => `TOutput` + +Defined in: [workflow/types.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L83) + +###### Parameters + +###### value + +`unknown` + +###### Returns + +`TOutput` + +*** + +### WorkflowLoopOptions + +Defined in: [workflow/types.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L86) + +#### Type Parameters + +##### TOutput + +`TOutput` = `unknown` + +#### Properties + +##### label? + +> `optional` **label?**: `string` + +Defined in: [workflow/types.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L87) + +##### schema? + +> `optional` **schema?**: [`JsonSchema`](#jsonschema) + +Defined in: [workflow/types.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L88) + +##### metadata? + +> `optional` **metadata?**: `Record`\<`string`, `unknown`\> + +Defined in: [workflow/types.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L89) + +##### decode? + +> `optional` **decode?**: (`value`) => `TOutput` + +Defined in: [workflow/types.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L90) + +###### Parameters + +###### value + +`unknown` + +###### Returns + +`TOutput` + +*** + +### WorkflowCheckpointOptions + +Defined in: [workflow/types.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L93) + +#### Type Parameters + +##### TOutput + +`TOutput` = `unknown` + +#### Properties + +##### label? + +> `optional` **label?**: `string` + +Defined in: [workflow/types.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L94) + +##### schema? + +> `optional` **schema?**: [`JsonSchema`](#jsonschema) + +Defined in: [workflow/types.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L95) + +##### metadata? + +> `optional` **metadata?**: `Record`\<`string`, `unknown`\> + +Defined in: [workflow/types.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L96) + +##### decode? + +> `optional` **decode?**: (`value`) => `TOutput` + +Defined in: [workflow/types.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L97) + +###### Parameters + +###### value + +`unknown` + +###### Returns + +`TOutput` + +*** + +### WorkflowDelegateResult + +Defined in: [workflow/types.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L100) + +#### Properties + +##### output + +> **output**: `unknown` + +Defined in: [workflow/types.ts:101](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L101) + +##### costUsd? + +> `optional` **costUsd?**: `number` + +Defined in: [workflow/types.ts:102](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L102) + +##### tokenUsage? + +> `optional` **tokenUsage?**: `Partial`\<[`WorkflowTokenUsage`](#workflowtokenusage)\> + +Defined in: [workflow/types.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L103) + +##### agentCalls? + +> `optional` **agentCalls?**: `number` + +Defined in: [workflow/types.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L105) + +Additional downstream workflow agent calls consumed inside this delegate. + +##### loopCalls? + +> `optional` **loopCalls?**: `number` + +Defined in: [workflow/types.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L107) + +Additional downstream workflow loop calls consumed inside this delegate. + +##### trace? + +> `optional` **trace?**: `unknown` + +Defined in: [workflow/types.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L108) + +*** + +### WorkflowDelegateContext + +Defined in: [workflow/types.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L111) + +#### Properties + +##### workflowRunId + +> **workflowRunId**: `string` + +Defined in: [workflow/types.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L112) + +##### depth + +> **depth**: `number` + +Defined in: [workflow/types.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L113) + +##### phase? + +> `optional` **phase?**: `string` + +Defined in: [workflow/types.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L114) + +##### signal + +> **signal**: `AbortSignal` + +Defined in: [workflow/types.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L115) + +##### caps + +> **caps**: [`WorkflowBudgetCaps`](#workflowbudgetcaps) + +Defined in: [workflow/types.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L116) + +##### budget + +> **budget**: [`WorkflowBudgetView`](#workflowbudgetview) + +Defined in: [workflow/types.ts:117](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L117) + +##### metadata? + +> `optional` **metadata?**: `Record`\<`string`, `unknown`\> + +Defined in: [workflow/types.ts:118](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L118) + +*** + +### WorkflowStartedPayload + +Defined in: [workflow/types.ts:290](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L290) + +#### Properties + +##### meta + +> **meta**: [`WorkflowMeta`](#workflowmeta) + +Defined in: [workflow/types.ts:291](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L291) + +##### depth + +> **depth**: `number` + +Defined in: [workflow/types.ts:292](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L292) + +##### caps + +> **caps**: [`WorkflowBudgetCaps`](#workflowbudgetcaps) + +Defined in: [workflow/types.ts:293](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L293) + +*** + +### WorkflowPhasePayload + +Defined in: [workflow/types.ts:296](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L296) + +#### Properties + +##### title + +> **title**: `string` + +Defined in: [workflow/types.ts:297](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L297) + +*** + +### WorkflowLogPayload + +Defined in: [workflow/types.ts:300](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L300) + +#### Properties + +##### message + +> **message**: `string` + +Defined in: [workflow/types.ts:301](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L301) + +##### phase? + +> `optional` **phase?**: `string` + +Defined in: [workflow/types.ts:302](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L302) + +*** + +### WorkflowParallelStartedPayload + +Defined in: [workflow/types.ts:305](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L305) + +#### Properties + +##### branchCount + +> **branchCount**: `number` + +Defined in: [workflow/types.ts:306](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L306) + +##### phase? + +> `optional` **phase?**: `string` + +Defined in: [workflow/types.ts:307](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L307) + +*** + +### WorkflowParallelEndedPayload + +Defined in: [workflow/types.ts:310](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L310) + +#### Properties + +##### branchCount + +> **branchCount**: `number` + +Defined in: [workflow/types.ts:311](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L311) + +##### durationMs + +> **durationMs**: `number` + +Defined in: [workflow/types.ts:312](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L312) + +##### phase? + +> `optional` **phase?**: `string` + +Defined in: [workflow/types.ts:313](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L313) + +*** + +### WorkflowPipelineStartedPayload + +Defined in: [workflow/types.ts:316](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L316) + +#### Properties + +##### itemCount + +> **itemCount**: `number` + +Defined in: [workflow/types.ts:317](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L317) + +##### stageCount + +> **stageCount**: `number` + +Defined in: [workflow/types.ts:318](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L318) + +##### phase? + +> `optional` **phase?**: `string` + +Defined in: [workflow/types.ts:319](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L319) + +*** + +### WorkflowPipelineEndedPayload + +Defined in: [workflow/types.ts:322](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L322) + +#### Properties + +##### itemCount + +> **itemCount**: `number` + +Defined in: [workflow/types.ts:323](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L323) + +##### stageCount + +> **stageCount**: `number` + +Defined in: [workflow/types.ts:324](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L324) + +##### durationMs + +> **durationMs**: `number` + +Defined in: [workflow/types.ts:325](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L325) + +##### phase? + +> `optional` **phase?**: `string` + +Defined in: [workflow/types.ts:326](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L326) + +*** + +### WorkflowBranchStartedPayload + +Defined in: [workflow/types.ts:331](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L331) + +#### Properties + +##### operation + +> **operation**: [`WorkflowBranchOperation`](#workflowbranchoperation) + +Defined in: [workflow/types.ts:332](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L332) + +##### branchIndex + +> **branchIndex**: `number` + +Defined in: [workflow/types.ts:333](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L333) + +##### phase? + +> `optional` **phase?**: `string` + +Defined in: [workflow/types.ts:334](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L334) + +##### stageCount? + +> `optional` **stageCount?**: `number` + +Defined in: [workflow/types.ts:335](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L335) + +*** + +### WorkflowBranchEndedPayload + +Defined in: [workflow/types.ts:338](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L338) + +#### Properties + +##### operation + +> **operation**: [`WorkflowBranchOperation`](#workflowbranchoperation) + +Defined in: [workflow/types.ts:339](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L339) + +##### branchIndex + +> **branchIndex**: `number` + +Defined in: [workflow/types.ts:340](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L340) + +##### durationMs + +> **durationMs**: `number` + +Defined in: [workflow/types.ts:341](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L341) + +##### phase? + +> `optional` **phase?**: `string` + +Defined in: [workflow/types.ts:342](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L342) + +##### stageCount? + +> `optional` **stageCount?**: `number` + +Defined in: [workflow/types.ts:343](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L343) + +*** + +### WorkflowBranchFailedPayload + +Defined in: [workflow/types.ts:346](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L346) + +#### Properties + +##### operation + +> **operation**: [`WorkflowBranchOperation`](#workflowbranchoperation) + +Defined in: [workflow/types.ts:347](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L347) + +##### branchIndex + +> **branchIndex**: `number` + +Defined in: [workflow/types.ts:348](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L348) + +##### durationMs + +> **durationMs**: `number` + +Defined in: [workflow/types.ts:349](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L349) + +##### message + +> **message**: `string` + +Defined in: [workflow/types.ts:350](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L350) + +##### code? + +> `optional` **code?**: `string` + +Defined in: [workflow/types.ts:351](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L351) + +##### phase? + +> `optional` **phase?**: `string` + +Defined in: [workflow/types.ts:352](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L352) + +##### stageIndex? + +> `optional` **stageIndex?**: `number` + +Defined in: [workflow/types.ts:353](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L353) + +*** + +### WorkflowAgentStartedPayload + +Defined in: [workflow/types.ts:356](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L356) + +#### Properties + +##### index + +> **index**: `number` + +Defined in: [workflow/types.ts:357](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L357) + +##### label? + +> `optional` **label?**: `string` + +Defined in: [workflow/types.ts:358](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L358) + +##### promptChars + +> **promptChars**: `number` + +Defined in: [workflow/types.ts:359](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L359) + +##### phase? + +> `optional` **phase?**: `string` + +Defined in: [workflow/types.ts:360](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L360) + +##### metadata? + +> `optional` **metadata?**: `Record`\<`string`, `unknown`\> + +Defined in: [workflow/types.ts:361](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L361) + +*** + +### WorkflowAgentEndedPayload + +Defined in: [workflow/types.ts:364](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L364) + +#### Properties + +##### index + +> **index**: `number` + +Defined in: [workflow/types.ts:365](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L365) + +##### label? + +> `optional` **label?**: `string` + +Defined in: [workflow/types.ts:366](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L366) + +##### durationMs + +> **durationMs**: `number` + +Defined in: [workflow/types.ts:367](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L367) + +##### costUsd + +> **costUsd**: `number` + +Defined in: [workflow/types.ts:368](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L368) + +##### tokenUsage + +> **tokenUsage**: [`WorkflowTokenUsage`](#workflowtokenusage) + +Defined in: [workflow/types.ts:369](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L369) + +##### phase? + +> `optional` **phase?**: `string` + +Defined in: [workflow/types.ts:370](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L370) + +##### trace? + +> `optional` **trace?**: `unknown` + +Defined in: [workflow/types.ts:371](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L371) + +*** + +### WorkflowLoopStartedPayload + +Defined in: [workflow/types.ts:374](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L374) + +#### Properties + +##### index + +> **index**: `number` + +Defined in: [workflow/types.ts:375](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L375) + +##### label? + +> `optional` **label?**: `string` + +Defined in: [workflow/types.ts:376](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L376) + +##### phase? + +> `optional` **phase?**: `string` + +Defined in: [workflow/types.ts:377](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L377) + +##### metadata? + +> `optional` **metadata?**: `Record`\<`string`, `unknown`\> + +Defined in: [workflow/types.ts:378](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L378) + +*** + +### WorkflowLoopEndedPayload + +Defined in: [workflow/types.ts:381](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L381) + +#### Properties + +##### index + +> **index**: `number` + +Defined in: [workflow/types.ts:382](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L382) + +##### label? + +> `optional` **label?**: `string` + +Defined in: [workflow/types.ts:383](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L383) + +##### durationMs + +> **durationMs**: `number` + +Defined in: [workflow/types.ts:384](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L384) + +##### costUsd + +> **costUsd**: `number` + +Defined in: [workflow/types.ts:385](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L385) + +##### tokenUsage + +> **tokenUsage**: [`WorkflowTokenUsage`](#workflowtokenusage) + +Defined in: [workflow/types.ts:386](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L386) + +##### phase? + +> `optional` **phase?**: `string` + +Defined in: [workflow/types.ts:387](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L387) + +##### trace? + +> `optional` **trace?**: `unknown` + +Defined in: [workflow/types.ts:388](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L388) + +*** + +### WorkflowCheckpointStartedPayload + +Defined in: [workflow/types.ts:391](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L391) + +#### Properties + +##### index + +> **index**: `number` + +Defined in: [workflow/types.ts:392](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L392) + +##### label? + +> `optional` **label?**: `string` + +Defined in: [workflow/types.ts:393](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L393) + +##### phase? + +> `optional` **phase?**: `string` + +Defined in: [workflow/types.ts:394](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L394) + +##### metadata? + +> `optional` **metadata?**: `Record`\<`string`, `unknown`\> + +Defined in: [workflow/types.ts:395](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L395) + +*** + +### WorkflowCheckpointEndedPayload + +Defined in: [workflow/types.ts:398](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L398) + +#### Properties + +##### index + +> **index**: `number` + +Defined in: [workflow/types.ts:399](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L399) + +##### label? + +> `optional` **label?**: `string` + +Defined in: [workflow/types.ts:400](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L400) + +##### durationMs + +> **durationMs**: `number` + +Defined in: [workflow/types.ts:401](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L401) + +##### costUsd + +> **costUsd**: `number` + +Defined in: [workflow/types.ts:402](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L402) + +##### tokenUsage + +> **tokenUsage**: [`WorkflowTokenUsage`](#workflowtokenusage) + +Defined in: [workflow/types.ts:403](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L403) + +##### phase? + +> `optional` **phase?**: `string` + +Defined in: [workflow/types.ts:404](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L404) + +##### trace? + +> `optional` **trace?**: `unknown` + +Defined in: [workflow/types.ts:405](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L405) + +*** + +### WorkflowFailedPayload + +Defined in: [workflow/types.ts:417](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L417) + +#### Properties + +##### message + +> **message**: `string` + +Defined in: [workflow/types.ts:418](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L418) + +##### code? + +> `optional` **code?**: `string` + +Defined in: [workflow/types.ts:419](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L419) + +##### phase? + +> `optional` **phase?**: `string` + +Defined in: [workflow/types.ts:420](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L420) + +*** + +### WorkflowEndedPayload + +Defined in: [workflow/types.ts:423](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L423) + +#### Properties + +##### durationMs + +> **durationMs**: `number` + +Defined in: [workflow/types.ts:424](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L424) + +##### costUsd + +> **costUsd**: `number` + +Defined in: [workflow/types.ts:425](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L425) + +##### tokenUsage + +> **tokenUsage**: [`WorkflowTokenUsage`](#workflowtokenusage) + +Defined in: [workflow/types.ts:426](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L426) + +##### agentCalls + +> **agentCalls**: `number` + +Defined in: [workflow/types.ts:427](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L427) + +##### loopCalls + +> **loopCalls**: `number` + +Defined in: [workflow/types.ts:428](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L428) + +*** + +### WorkflowTraceEmitter + +Defined in: [workflow/types.ts:431](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L431) + +#### Methods + +##### emit() + +> **emit**(`event`): `void` \| `Promise`\<`void`\> + +Defined in: [workflow/types.ts:432](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L432) + +###### Parameters + +###### event + +[`WorkflowTraceEvent`](#workflowtraceevent) + +###### Returns + +`void` \| `Promise`\<`void`\> + +*** + +### WorkflowRuntimeOptions + +Defined in: [workflow/types.ts:435](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L435) + +#### Properties + +##### source + +> **source**: `string` + +Defined in: [workflow/types.ts:436](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L436) + +##### agent + +> **agent**: [`WorkflowAgentDelegate`](#workflowagentdelegate) + +Defined in: [workflow/types.ts:437](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L437) + +##### loop? + +> `optional` **loop?**: [`WorkflowLoopDelegate`](#workflowloopdelegate) + +Defined in: [workflow/types.ts:438](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L438) + +##### verifier? + +> `optional` **verifier?**: [`WorkflowVerifierDelegate`](#workflowverifierdelegate) + +Defined in: [workflow/types.ts:439](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L439) + +##### analyst? + +> `optional` **analyst?**: [`WorkflowAnalystDelegate`](#workflowanalystdelegate) + +Defined in: [workflow/types.ts:440](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L440) + +##### reviewer? + +> `optional` **reviewer?**: [`WorkflowReviewerDelegate`](#workflowreviewerdelegate) + +Defined in: [workflow/types.ts:441](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L441) + +##### runId? + +> `optional` **runId?**: `string` + +Defined in: [workflow/types.ts:442](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L442) + +##### depth? + +> `optional` **depth?**: `number` + +Defined in: [workflow/types.ts:443](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L443) + +##### caps? + +> `optional` **caps?**: [`WorkflowBudgetCaps`](#workflowbudgetcaps) + +Defined in: [workflow/types.ts:444](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L444) + +##### metadata? + +> `optional` **metadata?**: `Record`\<`string`, `unknown`\> + +Defined in: [workflow/types.ts:445](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L445) + +##### signal? + +> `optional` **signal?**: `AbortSignal` + +Defined in: [workflow/types.ts:446](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L446) + +##### traceEmitter? + +> `optional` **traceEmitter?**: [`WorkflowTraceEmitter`](#workflowtraceemitter) + +Defined in: [workflow/types.ts:447](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L447) + +##### now? + +> `optional` **now?**: () => `number` + +Defined in: [workflow/types.ts:448](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L448) + +###### Returns + +`number` + +##### syncTimeoutMs? + +> `optional` **syncTimeoutMs?**: `number` + +Defined in: [workflow/types.ts:449](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L449) + +*** + +### WorkflowResult + +Defined in: [workflow/types.ts:452](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L452) + +#### Type Parameters + +##### TOutput + +`TOutput` = `unknown` + +#### Properties + +##### runId + +> **runId**: `string` + +Defined in: [workflow/types.ts:453](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L453) + +##### meta + +> **meta**: [`WorkflowMeta`](#workflowmeta) + +Defined in: [workflow/types.ts:454](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L454) + +##### output + +> **output**: `TOutput` + +Defined in: [workflow/types.ts:455](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L455) + +##### events + +> **events**: [`WorkflowTraceEvent`](#workflowtraceevent)[] + +Defined in: [workflow/types.ts:456](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L456) + +##### durationMs + +> **durationMs**: `number` + +Defined in: [workflow/types.ts:457](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L457) + +##### costUsd + +> **costUsd**: `number` + +Defined in: [workflow/types.ts:458](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L458) + +##### tokenUsage + +> **tokenUsage**: [`WorkflowTokenUsage`](#workflowtokenusage) + +Defined in: [workflow/types.ts:459](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L459) + +##### agentCalls + +> **agentCalls**: `number` + +Defined in: [workflow/types.ts:460](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L460) + +##### loopCalls + +> **loopCalls**: `number` + +Defined in: [workflow/types.ts:461](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L461) + +*** + +### ParsedWorkflowScript + +Defined in: [workflow/validate.ts:5](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/validate.ts#L5) + +#### Properties + +##### meta + +> **meta**: [`WorkflowMeta`](#workflowmeta) + +Defined in: [workflow/validate.ts:6](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/validate.ts#L6) + +##### body + +> **body**: `string` + +Defined in: [workflow/validate.ts:7](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/validate.ts#L7) + +## Type Aliases + +### WorkflowSandboxAgentStream + +> **WorkflowSandboxAgentStream** = `"prompt"` \| `"task"` + +Defined in: [workflow/agent-delegate.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L24) + +*** + +### WorkflowSandboxAgentProfileResolver + +> **WorkflowSandboxAgentProfileResolver** = `AgentProfile` \| ((`prompt`, `options`, `ctx`) => `AgentProfile`) + +Defined in: [workflow/agent-delegate.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L26) + +*** + +### WorkflowSandboxPromptOptionsResolver + +> **WorkflowSandboxPromptOptionsResolver**\<`TOptions`\> = `TOptions` \| ((`prompt`, `options`, `ctx`) => `TOptions`) + +Defined in: [workflow/agent-delegate.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L30) + +#### Type Parameters + +##### TOptions + +`TOptions` *extends* `PromptOptions` + +*** + +### NestedWorkflowCapsResolver + +> **NestedWorkflowCapsResolver** = [`WorkflowBudgetCaps`](#workflowbudgetcaps) \| ((`input`) => [`WorkflowBudgetCaps`](#workflowbudgetcaps)) + +Defined in: [workflow/nested-workflow-delegate.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L23) + +*** + +### NestedWorkflowMetadataResolver + +> **NestedWorkflowMetadataResolver** = `Record`\<`string`, `unknown`\> \| ((`input`) => `Record`\<`string`, `unknown`\> \| `undefined`) + +Defined in: [workflow/nested-workflow-delegate.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L27) + +*** + +### JsonSchema + +> **JsonSchema** = \{ `type`: `"string"`; `minLength?`: `number`; `maxLength?`: `number`; `enum?`: `string`[]; \} \| \{ `type`: `"number"`; `minimum?`: `number`; `maximum?`: `number`; `enum?`: `number`[]; \} \| \{ `type`: `"integer"`; `minimum?`: `number`; `maximum?`: `number`; `enum?`: `number`[]; \} \| \{ `type`: `"boolean"`; `enum?`: `boolean`[]; \} \| \{ `type`: `"null"`; \} \| \{ `type`: `"array"`; `items?`: [`JsonSchema`](#jsonschema); `minItems?`: `number`; `maxItems?`: `number`; \} \| \{ `type`: `"object"`; `properties?`: `Record`\<`string`, [`JsonSchema`](#jsonschema)\>; `required?`: `string`[]; `additionalProperties?`: `boolean`; \} + +Defined in: [workflow/types.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L23) + +*** + +### WorkflowAgentDelegate + +> **WorkflowAgentDelegate** = (`prompt`, `options`, `ctx`) => `Promise`\<[`WorkflowDelegateResult`](#workflowdelegateresult)\> + +Defined in: [workflow/types.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L121) + +#### Parameters + +##### prompt + +`string` + +##### options + +[`WorkflowAgentOptions`](#workflowagentoptions) + +##### ctx + +[`WorkflowDelegateContext`](#workflowdelegatecontext) + +#### Returns + +`Promise`\<[`WorkflowDelegateResult`](#workflowdelegateresult)\> + +*** + +### WorkflowLoopDelegate + +> **WorkflowLoopDelegate** = (`input`, `options`, `ctx`) => `Promise`\<[`WorkflowDelegateResult`](#workflowdelegateresult)\> + +Defined in: [workflow/types.ts:127](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L127) + +#### Parameters + +##### input + +`unknown` + +##### options + +[`WorkflowLoopOptions`](#workflowloopoptions) + +##### ctx + +[`WorkflowDelegateContext`](#workflowdelegatecontext) + +#### Returns + +`Promise`\<[`WorkflowDelegateResult`](#workflowdelegateresult)\> + +*** + +### WorkflowVerifierDelegate + +> **WorkflowVerifierDelegate** = (`input`, `options`, `ctx`) => `Promise`\<[`WorkflowDelegateResult`](#workflowdelegateresult)\> + +Defined in: [workflow/types.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L133) + +#### Parameters + +##### input + +`unknown` + +##### options + +[`WorkflowCheckpointOptions`](#workflowcheckpointoptions) + +##### ctx + +[`WorkflowDelegateContext`](#workflowdelegatecontext) + +#### Returns + +`Promise`\<[`WorkflowDelegateResult`](#workflowdelegateresult)\> + +*** + +### WorkflowAnalystDelegate + +> **WorkflowAnalystDelegate** = (`input`, `options`, `ctx`) => `Promise`\<[`WorkflowDelegateResult`](#workflowdelegateresult)\> + +Defined in: [workflow/types.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L139) + +#### Parameters + +##### input + +`unknown` + +##### options + +[`WorkflowCheckpointOptions`](#workflowcheckpointoptions) + +##### ctx + +[`WorkflowDelegateContext`](#workflowdelegatecontext) + +#### Returns + +`Promise`\<[`WorkflowDelegateResult`](#workflowdelegateresult)\> + +*** + +### WorkflowReviewerDelegate + +> **WorkflowReviewerDelegate** = (`input`, `options`, `ctx`) => `Promise`\<[`WorkflowDelegateResult`](#workflowdelegateresult)\> + +Defined in: [workflow/types.ts:145](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L145) + +#### Parameters + +##### input + +`unknown` + +##### options + +[`WorkflowCheckpointOptions`](#workflowcheckpointoptions) + +##### ctx + +[`WorkflowDelegateContext`](#workflowdelegatecontext) + +#### Returns + +`Promise`\<[`WorkflowDelegateResult`](#workflowdelegateresult)\> + +*** + +### WorkflowTraceEvent + +> **WorkflowTraceEvent** = \{ `kind`: `"workflow.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowStartedPayload`](#workflowstartedpayload); \} \| \{ `kind`: `"workflow.phase"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowPhasePayload`](#workflowphasepayload); \} \| \{ `kind`: `"workflow.log"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowLogPayload`](#workflowlogpayload); \} \| \{ `kind`: `"workflow.parallel.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowParallelStartedPayload`](#workflowparallelstartedpayload); \} \| \{ `kind`: `"workflow.parallel.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowParallelEndedPayload`](#workflowparallelendedpayload); \} \| \{ `kind`: `"workflow.pipeline.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowPipelineStartedPayload`](#workflowpipelinestartedpayload); \} \| \{ `kind`: `"workflow.pipeline.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowPipelineEndedPayload`](#workflowpipelineendedpayload); \} \| \{ `kind`: `"workflow.branch.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowBranchStartedPayload`](#workflowbranchstartedpayload); \} \| \{ `kind`: `"workflow.branch.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowBranchEndedPayload`](#workflowbranchendedpayload); \} \| \{ `kind`: `"workflow.branch.failed"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowBranchFailedPayload`](#workflowbranchfailedpayload); \} \| \{ `kind`: `"workflow.agent.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowAgentStartedPayload`](#workflowagentstartedpayload); \} \| \{ `kind`: `"workflow.agent.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowAgentEndedPayload`](#workflowagentendedpayload); \} \| \{ `kind`: `"workflow.agent.failed"`; `runId`: `string`; `timestamp`: `number`; `payload`: `WorkflowDelegateFailedPayload`; \} \| \{ `kind`: `"workflow.loop.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowLoopStartedPayload`](#workflowloopstartedpayload); \} \| \{ `kind`: `"workflow.loop.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowLoopEndedPayload`](#workflowloopendedpayload); \} \| \{ `kind`: `"workflow.loop.failed"`; `runId`: `string`; `timestamp`: `number`; `payload`: `WorkflowDelegateFailedPayload`; \} \| \{ `kind`: `"workflow.verifier.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowCheckpointStartedPayload`](#workflowcheckpointstartedpayload); \} \| \{ `kind`: `"workflow.verifier.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowCheckpointEndedPayload`](#workflowcheckpointendedpayload); \} \| \{ `kind`: `"workflow.verifier.failed"`; `runId`: `string`; `timestamp`: `number`; `payload`: `WorkflowDelegateFailedPayload`; \} \| \{ `kind`: `"workflow.analyst.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowCheckpointStartedPayload`](#workflowcheckpointstartedpayload); \} \| \{ `kind`: `"workflow.analyst.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowCheckpointEndedPayload`](#workflowcheckpointendedpayload); \} \| \{ `kind`: `"workflow.analyst.failed"`; `runId`: `string`; `timestamp`: `number`; `payload`: `WorkflowDelegateFailedPayload`; \} \| \{ `kind`: `"workflow.reviewer.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowCheckpointStartedPayload`](#workflowcheckpointstartedpayload); \} \| \{ `kind`: `"workflow.reviewer.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowCheckpointEndedPayload`](#workflowcheckpointendedpayload); \} \| \{ `kind`: `"workflow.reviewer.failed"`; `runId`: `string`; `timestamp`: `number`; `payload`: `WorkflowDelegateFailedPayload`; \} \| \{ `kind`: `"workflow.failed"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowFailedPayload`](#workflowfailedpayload); \} \| \{ `kind`: `"workflow.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowEndedPayload`](#workflowendedpayload); \} + +Defined in: [workflow/types.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L151) + +*** + +### WorkflowBranchOperation + +> **WorkflowBranchOperation** = `"parallel"` \| `"pipeline"` + +Defined in: [workflow/types.ts:329](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L329) + +## Functions + +### createSandboxWorkflowAgentDelegate() + +> **createSandboxWorkflowAgentDelegate**\<`TOutput`\>(`options`): [`WorkflowAgentDelegate`](#workflowagentdelegate) + +Defined in: [workflow/agent-delegate.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L74) + +#### Type Parameters + +##### TOutput + +`TOutput` = `unknown` + +#### Parameters + +##### options + +[`CreateSandboxWorkflowAgentDelegateOptions`](#createsandboxworkflowagentdelegateoptions)\<`TOutput`\> + +#### Returns + +[`WorkflowAgentDelegate`](#workflowagentdelegate) + +*** + +### parseSandboxAgentDefaultOutput() + +> **parseSandboxAgentDefaultOutput**(`events`): `unknown` + +Defined in: [workflow/agent-delegate.ts:147](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L147) + +#### Parameters + +##### events + +`SandboxEvent`[] + +#### Returns + +`unknown` + +*** + +### createRunLoopWorkflowDelegate() + +> **createRunLoopWorkflowDelegate**\<`Input`, `Task`, `Output`, `Decision`\>(`options`): [`WorkflowLoopDelegate`](#workflowloopdelegate) + +Defined in: [workflow/loop-delegate.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/loop-delegate.ts#L19) + +#### Type Parameters + +##### Input + +`Input` + +##### Task + +`Task` + +##### Output + +`Output` + +##### Decision + +`Decision` + +#### Parameters + +##### options + +[`CreateRunLoopWorkflowDelegateOptions`](#createrunloopworkflowdelegateoptions)\<`Input`, `Task`, `Output`, `Decision`\> + +#### Returns + +[`WorkflowLoopDelegate`](#workflowloopdelegate) + +*** + +### createNestedWorkflowAgentDelegate() + +> **createNestedWorkflowAgentDelegate**(`options`): [`WorkflowAgentDelegate`](#workflowagentdelegate) + +Defined in: [workflow/nested-workflow-delegate.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L66) + +#### Parameters + +##### options + +[`CreateNestedWorkflowAgentDelegateOptions`](#createnestedworkflowagentdelegateoptions) + +#### Returns + +[`WorkflowAgentDelegate`](#workflowagentdelegate) + +*** + +### runWorkflow() + +> **runWorkflow**\<`TOutput`\>(`options`): `Promise`\<[`WorkflowResult`](#workflowresult)\<`TOutput`\>\> + +Defined in: [workflow/runtime.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/runtime.ts#L36) + +#### Type Parameters + +##### TOutput + +`TOutput` = `unknown` + +#### Parameters + +##### options + +[`WorkflowRuntimeOptions`](#workflowruntimeoptions) + +#### Returns + +`Promise`\<[`WorkflowResult`](#workflowresult)\<`TOutput`\>\> + +*** + +### validateJsonSchema() + +> **validateJsonSchema**(`value`, `schema`, `path?`): `void` + +Defined in: [workflow/schema.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/schema.ts#L68) + +#### Parameters + +##### value + +`unknown` + +##### schema + +[`JsonSchema`](#jsonschema) + +##### path? + +`string` = `'$'` + +#### Returns + +`void` + +*** + +### parseWorkflowScript() + +> **parseWorkflowScript**(`source`): [`ParsedWorkflowScript`](#parsedworkflowscript) + +Defined in: [workflow/validate.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/validate.ts#L53) + +#### Parameters + +##### source + +`string` + +#### Returns + +[`ParsedWorkflowScript`](#parsedworkflowscript) + +*** + +### validateWorkflowBody() + +> **validateWorkflowBody**(`body`): `void` + +Defined in: [workflow/validate.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/validate.ts#L71) + +#### Parameters + +##### body + +`string` + +#### Returns + +`void` diff --git a/docs/api/workflow/README.md b/docs/api/workflow/README.md deleted file mode 100644 index ca0890e..0000000 --- a/docs/api/workflow/README.md +++ /dev/null @@ -1,82 +0,0 @@ -[**@tangle-network/agent-runtime**](../README.md) - -*** - -[@tangle-network/agent-runtime](../README.md) / workflow - -# workflow - -## Classes - -- [WorkflowBudget](classes/WorkflowBudget.md) - -## Interfaces - -- [WorkflowSandboxAgentTrace](interfaces/WorkflowSandboxAgentTrace.md) -- [CreateSandboxWorkflowAgentDelegateOptions](interfaces/CreateSandboxWorkflowAgentDelegateOptions.md) -- [WorkflowSandboxAgentDefaultTrace](interfaces/WorkflowSandboxAgentDefaultTrace.md) -- [CreateRunLoopWorkflowDelegateOptions](interfaces/CreateRunLoopWorkflowDelegateOptions.md) -- [NestedWorkflowDelegateInput](interfaces/NestedWorkflowDelegateInput.md) -- [NestedWorkflowTrace](interfaces/NestedWorkflowTrace.md) -- [CreateNestedWorkflowAgentDelegateOptions](interfaces/CreateNestedWorkflowAgentDelegateOptions.md) -- [WorkflowPhaseMeta](interfaces/WorkflowPhaseMeta.md) -- [WorkflowMeta](interfaces/WorkflowMeta.md) -- [WorkflowTokenUsage](interfaces/WorkflowTokenUsage.md) -- [WorkflowBudgetSnapshot](interfaces/WorkflowBudgetSnapshot.md) -- [WorkflowBudgetRemaining](interfaces/WorkflowBudgetRemaining.md) -- [WorkflowBudgetCaps](interfaces/WorkflowBudgetCaps.md) -- [WorkflowBudgetView](interfaces/WorkflowBudgetView.md) -- [WorkflowAgentOptions](interfaces/WorkflowAgentOptions.md) -- [WorkflowLoopOptions](interfaces/WorkflowLoopOptions.md) -- [WorkflowCheckpointOptions](interfaces/WorkflowCheckpointOptions.md) -- [WorkflowDelegateResult](interfaces/WorkflowDelegateResult.md) -- [WorkflowDelegateContext](interfaces/WorkflowDelegateContext.md) -- [WorkflowStartedPayload](interfaces/WorkflowStartedPayload.md) -- [WorkflowPhasePayload](interfaces/WorkflowPhasePayload.md) -- [WorkflowLogPayload](interfaces/WorkflowLogPayload.md) -- [WorkflowParallelStartedPayload](interfaces/WorkflowParallelStartedPayload.md) -- [WorkflowParallelEndedPayload](interfaces/WorkflowParallelEndedPayload.md) -- [WorkflowPipelineStartedPayload](interfaces/WorkflowPipelineStartedPayload.md) -- [WorkflowPipelineEndedPayload](interfaces/WorkflowPipelineEndedPayload.md) -- [WorkflowBranchStartedPayload](interfaces/WorkflowBranchStartedPayload.md) -- [WorkflowBranchEndedPayload](interfaces/WorkflowBranchEndedPayload.md) -- [WorkflowBranchFailedPayload](interfaces/WorkflowBranchFailedPayload.md) -- [WorkflowAgentStartedPayload](interfaces/WorkflowAgentStartedPayload.md) -- [WorkflowAgentEndedPayload](interfaces/WorkflowAgentEndedPayload.md) -- [WorkflowLoopStartedPayload](interfaces/WorkflowLoopStartedPayload.md) -- [WorkflowLoopEndedPayload](interfaces/WorkflowLoopEndedPayload.md) -- [WorkflowCheckpointStartedPayload](interfaces/WorkflowCheckpointStartedPayload.md) -- [WorkflowCheckpointEndedPayload](interfaces/WorkflowCheckpointEndedPayload.md) -- [WorkflowFailedPayload](interfaces/WorkflowFailedPayload.md) -- [WorkflowEndedPayload](interfaces/WorkflowEndedPayload.md) -- [WorkflowTraceEmitter](interfaces/WorkflowTraceEmitter.md) -- [WorkflowRuntimeOptions](interfaces/WorkflowRuntimeOptions.md) -- [WorkflowResult](interfaces/WorkflowResult.md) -- [ParsedWorkflowScript](interfaces/ParsedWorkflowScript.md) - -## Type Aliases - -- [WorkflowSandboxAgentStream](type-aliases/WorkflowSandboxAgentStream.md) -- [WorkflowSandboxAgentProfileResolver](type-aliases/WorkflowSandboxAgentProfileResolver.md) -- [WorkflowSandboxPromptOptionsResolver](type-aliases/WorkflowSandboxPromptOptionsResolver.md) -- [NestedWorkflowCapsResolver](type-aliases/NestedWorkflowCapsResolver.md) -- [NestedWorkflowMetadataResolver](type-aliases/NestedWorkflowMetadataResolver.md) -- [JsonSchema](type-aliases/JsonSchema.md) -- [WorkflowAgentDelegate](type-aliases/WorkflowAgentDelegate.md) -- [WorkflowLoopDelegate](type-aliases/WorkflowLoopDelegate.md) -- [WorkflowVerifierDelegate](type-aliases/WorkflowVerifierDelegate.md) -- [WorkflowAnalystDelegate](type-aliases/WorkflowAnalystDelegate.md) -- [WorkflowReviewerDelegate](type-aliases/WorkflowReviewerDelegate.md) -- [WorkflowTraceEvent](type-aliases/WorkflowTraceEvent.md) -- [WorkflowBranchOperation](type-aliases/WorkflowBranchOperation.md) - -## Functions - -- [createSandboxWorkflowAgentDelegate](functions/createSandboxWorkflowAgentDelegate.md) -- [parseSandboxAgentDefaultOutput](functions/parseSandboxAgentDefaultOutput.md) -- [createRunLoopWorkflowDelegate](functions/createRunLoopWorkflowDelegate.md) -- [createNestedWorkflowAgentDelegate](functions/createNestedWorkflowAgentDelegate.md) -- [runWorkflow](functions/runWorkflow.md) -- [validateJsonSchema](functions/validateJsonSchema.md) -- [parseWorkflowScript](functions/parseWorkflowScript.md) -- [validateWorkflowBody](functions/validateWorkflowBody.md) diff --git a/docs/api/workflow/classes/WorkflowBudget.md b/docs/api/workflow/classes/WorkflowBudget.md deleted file mode 100644 index d3814ba..0000000 --- a/docs/api/workflow/classes/WorkflowBudget.md +++ /dev/null @@ -1,171 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowBudget - -# Class: WorkflowBudget - -Defined in: [workflow/budget.ts:11](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L11) - -## Implements - -- [`WorkflowBudgetView`](../interfaces/WorkflowBudgetView.md) - -## Constructors - -### Constructor - -> **new WorkflowBudget**(`total`, `now`): `WorkflowBudget` - -Defined in: [workflow/budget.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L20) - -#### Parameters - -##### total - -[`WorkflowBudgetCaps`](../interfaces/WorkflowBudgetCaps.md) - -##### now - -() => `number` - -#### Returns - -`WorkflowBudget` - -## Properties - -### total - -> `readonly` **total**: [`WorkflowBudgetCaps`](../interfaces/WorkflowBudgetCaps.md) - -Defined in: [workflow/budget.ts:12](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L12) - -#### Implementation of - -[`WorkflowBudgetView`](../interfaces/WorkflowBudgetView.md).[`total`](../interfaces/WorkflowBudgetView.md#total) - -## Methods - -### spent() - -> **spent**(): [`WorkflowBudgetSnapshot`](../interfaces/WorkflowBudgetSnapshot.md) - -Defined in: [workflow/budget.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L26) - -#### Returns - -[`WorkflowBudgetSnapshot`](../interfaces/WorkflowBudgetSnapshot.md) - -#### Implementation of - -[`WorkflowBudgetView`](../interfaces/WorkflowBudgetView.md).[`spent`](../interfaces/WorkflowBudgetView.md#spent) - -*** - -### remaining() - -> **remaining**(): [`WorkflowBudgetRemaining`](../interfaces/WorkflowBudgetRemaining.md) - -Defined in: [workflow/budget.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L36) - -#### Returns - -[`WorkflowBudgetRemaining`](../interfaces/WorkflowBudgetRemaining.md) - -#### Implementation of - -[`WorkflowBudgetView`](../interfaces/WorkflowBudgetView.md).[`remaining`](../interfaces/WorkflowBudgetView.md#remaining) - -*** - -### nextAgentIndex() - -> **nextAgentIndex**(): `number` - -Defined in: [workflow/budget.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L52) - -#### Returns - -`number` - -*** - -### nextLoopIndex() - -> **nextLoopIndex**(): `number` - -Defined in: [workflow/budget.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L64) - -#### Returns - -`number` - -*** - -### assertFanout() - -> **assertFanout**(`count`): `void` - -Defined in: [workflow/budget.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L76) - -#### Parameters - -##### count - -`number` - -#### Returns - -`void` - -*** - -### observe() - -> **observe**(`result`): `object` - -Defined in: [workflow/budget.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L89) - -#### Parameters - -##### result - -[`WorkflowDelegateResult`](../interfaces/WorkflowDelegateResult.md) - -#### Returns - -`object` - -##### costUsd - -> **costUsd**: `number` - -##### tokenUsage - -> **tokenUsage**: [`WorkflowTokenUsage`](../interfaces/WorkflowTokenUsage.md) - -*** - -### assertWall() - -> **assertWall**(): `void` - -Defined in: [workflow/budget.ts:106](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L106) - -#### Returns - -`void` - -*** - -### remainingWallMs() - -> **remainingWallMs**(): `number` \| `undefined` - -Defined in: [workflow/budget.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/budget.ts#L112) - -#### Returns - -`number` \| `undefined` diff --git a/docs/api/workflow/functions/createNestedWorkflowAgentDelegate.md b/docs/api/workflow/functions/createNestedWorkflowAgentDelegate.md deleted file mode 100644 index 5aeb07e..0000000 --- a/docs/api/workflow/functions/createNestedWorkflowAgentDelegate.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / createNestedWorkflowAgentDelegate - -# Function: createNestedWorkflowAgentDelegate() - -> **createNestedWorkflowAgentDelegate**(`options`): [`WorkflowAgentDelegate`](../type-aliases/WorkflowAgentDelegate.md) - -Defined in: [workflow/nested-workflow-delegate.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L66) - -## Parameters - -### options - -[`CreateNestedWorkflowAgentDelegateOptions`](../interfaces/CreateNestedWorkflowAgentDelegateOptions.md) - -## Returns - -[`WorkflowAgentDelegate`](../type-aliases/WorkflowAgentDelegate.md) diff --git a/docs/api/workflow/functions/createRunLoopWorkflowDelegate.md b/docs/api/workflow/functions/createRunLoopWorkflowDelegate.md deleted file mode 100644 index a2a5917..0000000 --- a/docs/api/workflow/functions/createRunLoopWorkflowDelegate.md +++ /dev/null @@ -1,39 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / createRunLoopWorkflowDelegate - -# Function: createRunLoopWorkflowDelegate() - -> **createRunLoopWorkflowDelegate**\<`Input`, `Task`, `Output`, `Decision`\>(`options`): [`WorkflowLoopDelegate`](../type-aliases/WorkflowLoopDelegate.md) - -Defined in: [workflow/loop-delegate.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/loop-delegate.ts#L19) - -## Type Parameters - -### Input - -`Input` - -### Task - -`Task` - -### Output - -`Output` - -### Decision - -`Decision` - -## Parameters - -### options - -[`CreateRunLoopWorkflowDelegateOptions`](../interfaces/CreateRunLoopWorkflowDelegateOptions.md)\<`Input`, `Task`, `Output`, `Decision`\> - -## Returns - -[`WorkflowLoopDelegate`](../type-aliases/WorkflowLoopDelegate.md) diff --git a/docs/api/workflow/functions/createSandboxWorkflowAgentDelegate.md b/docs/api/workflow/functions/createSandboxWorkflowAgentDelegate.md deleted file mode 100644 index 1e5ec0c..0000000 --- a/docs/api/workflow/functions/createSandboxWorkflowAgentDelegate.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / createSandboxWorkflowAgentDelegate - -# Function: createSandboxWorkflowAgentDelegate() - -> **createSandboxWorkflowAgentDelegate**\<`TOutput`\>(`options`): [`WorkflowAgentDelegate`](../type-aliases/WorkflowAgentDelegate.md) - -Defined in: [workflow/agent-delegate.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L74) - -## Type Parameters - -### TOutput - -`TOutput` = `unknown` - -## Parameters - -### options - -[`CreateSandboxWorkflowAgentDelegateOptions`](../interfaces/CreateSandboxWorkflowAgentDelegateOptions.md)\<`TOutput`\> - -## Returns - -[`WorkflowAgentDelegate`](../type-aliases/WorkflowAgentDelegate.md) diff --git a/docs/api/workflow/functions/parseSandboxAgentDefaultOutput.md b/docs/api/workflow/functions/parseSandboxAgentDefaultOutput.md deleted file mode 100644 index 13705d9..0000000 --- a/docs/api/workflow/functions/parseSandboxAgentDefaultOutput.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / parseSandboxAgentDefaultOutput - -# Function: parseSandboxAgentDefaultOutput() - -> **parseSandboxAgentDefaultOutput**(`events`): `unknown` - -Defined in: [workflow/agent-delegate.ts:147](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L147) - -## Parameters - -### events - -`SandboxEvent`[] - -## Returns - -`unknown` diff --git a/docs/api/workflow/functions/parseWorkflowScript.md b/docs/api/workflow/functions/parseWorkflowScript.md deleted file mode 100644 index 982311b..0000000 --- a/docs/api/workflow/functions/parseWorkflowScript.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / parseWorkflowScript - -# Function: parseWorkflowScript() - -> **parseWorkflowScript**(`source`): [`ParsedWorkflowScript`](../interfaces/ParsedWorkflowScript.md) - -Defined in: [workflow/validate.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/validate.ts#L53) - -## Parameters - -### source - -`string` - -## Returns - -[`ParsedWorkflowScript`](../interfaces/ParsedWorkflowScript.md) diff --git a/docs/api/workflow/functions/runWorkflow.md b/docs/api/workflow/functions/runWorkflow.md deleted file mode 100644 index cf50bd4..0000000 --- a/docs/api/workflow/functions/runWorkflow.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / runWorkflow - -# Function: runWorkflow() - -> **runWorkflow**\<`TOutput`\>(`options`): `Promise`\<[`WorkflowResult`](../interfaces/WorkflowResult.md)\<`TOutput`\>\> - -Defined in: [workflow/runtime.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/runtime.ts#L36) - -## Type Parameters - -### TOutput - -`TOutput` = `unknown` - -## Parameters - -### options - -[`WorkflowRuntimeOptions`](../interfaces/WorkflowRuntimeOptions.md) - -## Returns - -`Promise`\<[`WorkflowResult`](../interfaces/WorkflowResult.md)\<`TOutput`\>\> diff --git a/docs/api/workflow/functions/validateJsonSchema.md b/docs/api/workflow/functions/validateJsonSchema.md deleted file mode 100644 index 32872c1..0000000 --- a/docs/api/workflow/functions/validateJsonSchema.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / validateJsonSchema - -# Function: validateJsonSchema() - -> **validateJsonSchema**(`value`, `schema`, `path?`): `void` - -Defined in: [workflow/schema.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/schema.ts#L68) - -## Parameters - -### value - -`unknown` - -### schema - -[`JsonSchema`](../type-aliases/JsonSchema.md) - -### path? - -`string` = `'$'` - -## Returns - -`void` diff --git a/docs/api/workflow/functions/validateWorkflowBody.md b/docs/api/workflow/functions/validateWorkflowBody.md deleted file mode 100644 index 46d2a9f..0000000 --- a/docs/api/workflow/functions/validateWorkflowBody.md +++ /dev/null @@ -1,21 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / validateWorkflowBody - -# Function: validateWorkflowBody() - -> **validateWorkflowBody**(`body`): `void` - -Defined in: [workflow/validate.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/validate.ts#L71) - -## Parameters - -### body - -`string` - -## Returns - -`void` diff --git a/docs/api/workflow/interfaces/CreateNestedWorkflowAgentDelegateOptions.md b/docs/api/workflow/interfaces/CreateNestedWorkflowAgentDelegateOptions.md deleted file mode 100644 index 84fc6cf..0000000 --- a/docs/api/workflow/interfaces/CreateNestedWorkflowAgentDelegateOptions.md +++ /dev/null @@ -1,146 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / CreateNestedWorkflowAgentDelegateOptions - -# Interface: CreateNestedWorkflowAgentDelegateOptions - -Defined in: [workflow/nested-workflow-delegate.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L47) - -## Properties - -### agent - -> **agent**: [`WorkflowAgentDelegate`](../type-aliases/WorkflowAgentDelegate.md) - -Defined in: [workflow/nested-workflow-delegate.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L52) - -Real worker delegate used for normal agent() calls and for child workflow -agent() calls that do not opt into allowWorkflow. - -*** - -### caps - -> **caps**: [`NestedWorkflowCapsResolver`](../type-aliases/NestedWorkflowCapsResolver.md) - -Defined in: [workflow/nested-workflow-delegate.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L53) - -*** - -### loop? - -> `optional` **loop?**: [`WorkflowLoopDelegate`](../type-aliases/WorkflowLoopDelegate.md) - -Defined in: [workflow/nested-workflow-delegate.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L54) - -*** - -### verifier? - -> `optional` **verifier?**: [`WorkflowVerifierDelegate`](../type-aliases/WorkflowVerifierDelegate.md) - -Defined in: [workflow/nested-workflow-delegate.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L55) - -*** - -### analyst? - -> `optional` **analyst?**: [`WorkflowAnalystDelegate`](../type-aliases/WorkflowAnalystDelegate.md) - -Defined in: [workflow/nested-workflow-delegate.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L56) - -*** - -### reviewer? - -> `optional` **reviewer?**: [`WorkflowReviewerDelegate`](../type-aliases/WorkflowReviewerDelegate.md) - -Defined in: [workflow/nested-workflow-delegate.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L57) - -*** - -### metadata? - -> `optional` **metadata?**: [`NestedWorkflowMetadataResolver`](../type-aliases/NestedWorkflowMetadataResolver.md) - -Defined in: [workflow/nested-workflow-delegate.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L58) - -*** - -### traceEmitter? - -> `optional` **traceEmitter?**: [`WorkflowTraceEmitter`](WorkflowTraceEmitter.md) - -Defined in: [workflow/nested-workflow-delegate.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L59) - -*** - -### includeEventsInTrace? - -> `optional` **includeEventsInTrace?**: `boolean` - -Defined in: [workflow/nested-workflow-delegate.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L60) - -*** - -### runId? - -> `optional` **runId?**: (`input`) => `string` - -Defined in: [workflow/nested-workflow-delegate.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L61) - -#### Parameters - -##### input - -[`NestedWorkflowDelegateInput`](NestedWorkflowDelegateInput.md) - -#### Returns - -`string` - -*** - -### toOutput? - -> `optional` **toOutput?**: (`result`, `input`) => `unknown` - -Defined in: [workflow/nested-workflow-delegate.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L62) - -#### Parameters - -##### result - -[`WorkflowResult`](WorkflowResult.md) - -##### input - -[`NestedWorkflowDelegateInput`](NestedWorkflowDelegateInput.md) - -#### Returns - -`unknown` - -*** - -### toTrace? - -> `optional` **toTrace?**: (`result`, `input`) => `unknown` - -Defined in: [workflow/nested-workflow-delegate.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L63) - -#### Parameters - -##### result - -[`WorkflowResult`](WorkflowResult.md) - -##### input - -[`NestedWorkflowDelegateInput`](NestedWorkflowDelegateInput.md) - -#### Returns - -`unknown` diff --git a/docs/api/workflow/interfaces/CreateRunLoopWorkflowDelegateOptions.md b/docs/api/workflow/interfaces/CreateRunLoopWorkflowDelegateOptions.md deleted file mode 100644 index 7396315..0000000 --- a/docs/api/workflow/interfaces/CreateRunLoopWorkflowDelegateOptions.md +++ /dev/null @@ -1,89 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / CreateRunLoopWorkflowDelegateOptions - -# Interface: CreateRunLoopWorkflowDelegateOptions\ - -Defined in: [workflow/loop-delegate.ts:9](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/loop-delegate.ts#L9) - -## Type Parameters - -### Input - -`Input` - -### Task - -`Task` - -### Output - -`Output` - -### Decision - -`Decision` - -## Properties - -### toOutput? - -> `optional` **toOutput?**: (`result`) => `unknown` - -Defined in: [workflow/loop-delegate.ts:15](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/loop-delegate.ts#L15) - -#### Parameters - -##### result - -[`LoopResult`](../../runtime/interfaces/LoopResult.md)\<`Task`, `Output`, `Decision`\> - -#### Returns - -`unknown` - -*** - -### toTrace? - -> `optional` **toTrace?**: (`result`) => `unknown` - -Defined in: [workflow/loop-delegate.ts:16](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/loop-delegate.ts#L16) - -#### Parameters - -##### result - -[`LoopResult`](../../runtime/interfaces/LoopResult.md)\<`Task`, `Output`, `Decision`\> - -#### Returns - -`unknown` - -## Methods - -### toRunLoopOptions() - -> **toRunLoopOptions**(`input`, `options`, `ctx`): [`RunLoopOptions`](../../runtime/interfaces/RunLoopOptions.md)\<`Task`, `Output`, `Decision`\> - -Defined in: [workflow/loop-delegate.ts:10](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/loop-delegate.ts#L10) - -#### Parameters - -##### input - -`Input` - -##### options - -[`WorkflowLoopOptions`](WorkflowLoopOptions.md) - -##### ctx - -[`WorkflowDelegateContext`](WorkflowDelegateContext.md) - -#### Returns - -[`RunLoopOptions`](../../runtime/interfaces/RunLoopOptions.md)\<`Task`, `Output`, `Decision`\> diff --git a/docs/api/workflow/interfaces/CreateSandboxWorkflowAgentDelegateOptions.md b/docs/api/workflow/interfaces/CreateSandboxWorkflowAgentDelegateOptions.md deleted file mode 100644 index 1a85d0c..0000000 --- a/docs/api/workflow/interfaces/CreateSandboxWorkflowAgentDelegateOptions.md +++ /dev/null @@ -1,111 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / CreateSandboxWorkflowAgentDelegateOptions - -# Interface: CreateSandboxWorkflowAgentDelegateOptions\ - -Defined in: [workflow/agent-delegate.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L47) - -## Type Parameters - -### TOutput - -`TOutput` = `unknown` - -## Properties - -### client - -> **client**: [`SandboxClient`](../../runtime/interfaces/SandboxClient.md) - -Defined in: [workflow/agent-delegate.ts:48](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L48) - -*** - -### profile - -> **profile**: [`WorkflowSandboxAgentProfileResolver`](../type-aliases/WorkflowSandboxAgentProfileResolver.md) - -Defined in: [workflow/agent-delegate.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L49) - -*** - -### output? - -> `optional` **output?**: [`OutputAdapter`](../../runtime/interfaces/OutputAdapter.md)\<`TOutput`\> - -Defined in: [workflow/agent-delegate.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L50) - -*** - -### stream? - -> `optional` **stream?**: [`WorkflowSandboxAgentStream`](../type-aliases/WorkflowSandboxAgentStream.md) - -Defined in: [workflow/agent-delegate.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L51) - -*** - -### sandboxOverrides? - -> `optional` **sandboxOverrides?**: `Partial`\<`Omit`\<`CreateSandboxOptions`, `"backend"`\>\> & `object` - -Defined in: [workflow/agent-delegate.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L52) - -#### Type Declaration - -##### backend? - -> `optional` **backend?**: `Omit`\<`BackendConfig`, `"profile"`\> - -*** - -### promptOptions? - -> `optional` **promptOptions?**: [`WorkflowSandboxPromptOptionsResolver`](../type-aliases/WorkflowSandboxPromptOptionsResolver.md)\<`PromptOptions`\> - -Defined in: [workflow/agent-delegate.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L55) - -*** - -### taskOptions? - -> `optional` **taskOptions?**: [`WorkflowSandboxPromptOptionsResolver`](../type-aliases/WorkflowSandboxPromptOptionsResolver.md)\<`TaskOptions`\> - -Defined in: [workflow/agent-delegate.ts:56](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L56) - -*** - -### deleteAfter? - -> `optional` **deleteAfter?**: `boolean` - -Defined in: [workflow/agent-delegate.ts:57](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L57) - -*** - -### includeEventsInTrace? - -> `optional` **includeEventsInTrace?**: `boolean` - -Defined in: [workflow/agent-delegate.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L58) - -*** - -### toTrace? - -> `optional` **toTrace?**: (`trace`) => `unknown` - -Defined in: [workflow/agent-delegate.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L59) - -#### Parameters - -##### trace - -[`WorkflowSandboxAgentTrace`](WorkflowSandboxAgentTrace.md)\<`TOutput`\> - -#### Returns - -`unknown` diff --git a/docs/api/workflow/interfaces/NestedWorkflowDelegateInput.md b/docs/api/workflow/interfaces/NestedWorkflowDelegateInput.md deleted file mode 100644 index c4eef96..0000000 --- a/docs/api/workflow/interfaces/NestedWorkflowDelegateInput.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / NestedWorkflowDelegateInput - -# Interface: NestedWorkflowDelegateInput - -Defined in: [workflow/nested-workflow-delegate.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L17) - -## Properties - -### source - -> **source**: `string` - -Defined in: [workflow/nested-workflow-delegate.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L18) - -*** - -### options - -> **options**: [`WorkflowAgentOptions`](WorkflowAgentOptions.md) - -Defined in: [workflow/nested-workflow-delegate.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L19) - -*** - -### parent - -> **parent**: [`WorkflowDelegateContext`](WorkflowDelegateContext.md) - -Defined in: [workflow/nested-workflow-delegate.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L20) diff --git a/docs/api/workflow/interfaces/NestedWorkflowTrace.md b/docs/api/workflow/interfaces/NestedWorkflowTrace.md deleted file mode 100644 index 77c5cdd..0000000 --- a/docs/api/workflow/interfaces/NestedWorkflowTrace.md +++ /dev/null @@ -1,113 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / NestedWorkflowTrace - -# Interface: NestedWorkflowTrace - -Defined in: [workflow/nested-workflow-delegate.ts:31](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L31) - -## Properties - -### nested - -> **nested**: `true` - -Defined in: [workflow/nested-workflow-delegate.ts:32](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L32) - -*** - -### runId - -> **runId**: `string` - -Defined in: [workflow/nested-workflow-delegate.ts:33](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L33) - -*** - -### parentRunId - -> **parentRunId**: `string` - -Defined in: [workflow/nested-workflow-delegate.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L34) - -*** - -### depth - -> **depth**: `number` - -Defined in: [workflow/nested-workflow-delegate.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L35) - -*** - -### metaName - -> **metaName**: `string` - -Defined in: [workflow/nested-workflow-delegate.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L36) - -*** - -### eventCount - -> **eventCount**: `number` - -Defined in: [workflow/nested-workflow-delegate.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L37) - -*** - -### eventKinds - -> **eventKinds**: `string`[] - -Defined in: [workflow/nested-workflow-delegate.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L38) - -*** - -### durationMs - -> **durationMs**: `number` - -Defined in: [workflow/nested-workflow-delegate.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L39) - -*** - -### costUsd - -> **costUsd**: `number` - -Defined in: [workflow/nested-workflow-delegate.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L40) - -*** - -### tokenUsage - -> **tokenUsage**: [`WorkflowTokenUsage`](WorkflowTokenUsage.md) - -Defined in: [workflow/nested-workflow-delegate.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L41) - -*** - -### agentCalls - -> **agentCalls**: `number` - -Defined in: [workflow/nested-workflow-delegate.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L42) - -*** - -### loopCalls - -> **loopCalls**: `number` - -Defined in: [workflow/nested-workflow-delegate.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L43) - -*** - -### events? - -> `optional` **events?**: [`WorkflowTraceEvent`](../type-aliases/WorkflowTraceEvent.md)[] - -Defined in: [workflow/nested-workflow-delegate.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L44) diff --git a/docs/api/workflow/interfaces/ParsedWorkflowScript.md b/docs/api/workflow/interfaces/ParsedWorkflowScript.md deleted file mode 100644 index 9bb3dd2..0000000 --- a/docs/api/workflow/interfaces/ParsedWorkflowScript.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / ParsedWorkflowScript - -# Interface: ParsedWorkflowScript - -Defined in: [workflow/validate.ts:5](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/validate.ts#L5) - -## Properties - -### meta - -> **meta**: [`WorkflowMeta`](WorkflowMeta.md) - -Defined in: [workflow/validate.ts:6](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/validate.ts#L6) - -*** - -### body - -> **body**: `string` - -Defined in: [workflow/validate.ts:7](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/validate.ts#L7) diff --git a/docs/api/workflow/interfaces/WorkflowAgentEndedPayload.md b/docs/api/workflow/interfaces/WorkflowAgentEndedPayload.md deleted file mode 100644 index 0c36bdd..0000000 --- a/docs/api/workflow/interfaces/WorkflowAgentEndedPayload.md +++ /dev/null @@ -1,65 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowAgentEndedPayload - -# Interface: WorkflowAgentEndedPayload - -Defined in: [workflow/types.ts:364](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L364) - -## Properties - -### index - -> **index**: `number` - -Defined in: [workflow/types.ts:365](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L365) - -*** - -### label? - -> `optional` **label?**: `string` - -Defined in: [workflow/types.ts:366](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L366) - -*** - -### durationMs - -> **durationMs**: `number` - -Defined in: [workflow/types.ts:367](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L367) - -*** - -### costUsd - -> **costUsd**: `number` - -Defined in: [workflow/types.ts:368](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L368) - -*** - -### tokenUsage - -> **tokenUsage**: [`WorkflowTokenUsage`](WorkflowTokenUsage.md) - -Defined in: [workflow/types.ts:369](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L369) - -*** - -### phase? - -> `optional` **phase?**: `string` - -Defined in: [workflow/types.ts:370](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L370) - -*** - -### trace? - -> `optional` **trace?**: `unknown` - -Defined in: [workflow/types.ts:371](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L371) diff --git a/docs/api/workflow/interfaces/WorkflowAgentOptions.md b/docs/api/workflow/interfaces/WorkflowAgentOptions.md deleted file mode 100644 index fadcce9..0000000 --- a/docs/api/workflow/interfaces/WorkflowAgentOptions.md +++ /dev/null @@ -1,68 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowAgentOptions - -# Interface: WorkflowAgentOptions\ - -Defined in: [workflow/types.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L74) - -## Type Parameters - -### TOutput - -`TOutput` = `unknown` - -## Properties - -### label? - -> `optional` **label?**: `string` - -Defined in: [workflow/types.ts:75](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L75) - -*** - -### schema? - -> `optional` **schema?**: [`JsonSchema`](../type-aliases/JsonSchema.md) - -Defined in: [workflow/types.ts:76](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L76) - -*** - -### metadata? - -> `optional` **metadata?**: `Record`\<`string`, `unknown`\> - -Defined in: [workflow/types.ts:77](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L77) - -*** - -### allowWorkflow? - -> `optional` **allowWorkflow?**: `boolean` - -Defined in: [workflow/types.ts:82](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L82) - -Nested workflows are denied by default. Consumers that expose them through -a delegate must also honor `ctx.depth` and `ctx.caps.maxDepth`. - -*** - -### decode? - -> `optional` **decode?**: (`value`) => `TOutput` - -Defined in: [workflow/types.ts:83](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L83) - -#### Parameters - -##### value - -`unknown` - -#### Returns - -`TOutput` diff --git a/docs/api/workflow/interfaces/WorkflowAgentStartedPayload.md b/docs/api/workflow/interfaces/WorkflowAgentStartedPayload.md deleted file mode 100644 index ae7814a..0000000 --- a/docs/api/workflow/interfaces/WorkflowAgentStartedPayload.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowAgentStartedPayload - -# Interface: WorkflowAgentStartedPayload - -Defined in: [workflow/types.ts:356](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L356) - -## Properties - -### index - -> **index**: `number` - -Defined in: [workflow/types.ts:357](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L357) - -*** - -### label? - -> `optional` **label?**: `string` - -Defined in: [workflow/types.ts:358](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L358) - -*** - -### promptChars - -> **promptChars**: `number` - -Defined in: [workflow/types.ts:359](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L359) - -*** - -### phase? - -> `optional` **phase?**: `string` - -Defined in: [workflow/types.ts:360](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L360) - -*** - -### metadata? - -> `optional` **metadata?**: `Record`\<`string`, `unknown`\> - -Defined in: [workflow/types.ts:361](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L361) diff --git a/docs/api/workflow/interfaces/WorkflowBranchEndedPayload.md b/docs/api/workflow/interfaces/WorkflowBranchEndedPayload.md deleted file mode 100644 index 78cc855..0000000 --- a/docs/api/workflow/interfaces/WorkflowBranchEndedPayload.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowBranchEndedPayload - -# Interface: WorkflowBranchEndedPayload - -Defined in: [workflow/types.ts:338](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L338) - -## Properties - -### operation - -> **operation**: [`WorkflowBranchOperation`](../type-aliases/WorkflowBranchOperation.md) - -Defined in: [workflow/types.ts:339](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L339) - -*** - -### branchIndex - -> **branchIndex**: `number` - -Defined in: [workflow/types.ts:340](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L340) - -*** - -### durationMs - -> **durationMs**: `number` - -Defined in: [workflow/types.ts:341](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L341) - -*** - -### phase? - -> `optional` **phase?**: `string` - -Defined in: [workflow/types.ts:342](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L342) - -*** - -### stageCount? - -> `optional` **stageCount?**: `number` - -Defined in: [workflow/types.ts:343](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L343) diff --git a/docs/api/workflow/interfaces/WorkflowBranchFailedPayload.md b/docs/api/workflow/interfaces/WorkflowBranchFailedPayload.md deleted file mode 100644 index 64c5779..0000000 --- a/docs/api/workflow/interfaces/WorkflowBranchFailedPayload.md +++ /dev/null @@ -1,65 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowBranchFailedPayload - -# Interface: WorkflowBranchFailedPayload - -Defined in: [workflow/types.ts:346](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L346) - -## Properties - -### operation - -> **operation**: [`WorkflowBranchOperation`](../type-aliases/WorkflowBranchOperation.md) - -Defined in: [workflow/types.ts:347](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L347) - -*** - -### branchIndex - -> **branchIndex**: `number` - -Defined in: [workflow/types.ts:348](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L348) - -*** - -### durationMs - -> **durationMs**: `number` - -Defined in: [workflow/types.ts:349](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L349) - -*** - -### message - -> **message**: `string` - -Defined in: [workflow/types.ts:350](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L350) - -*** - -### code? - -> `optional` **code?**: `string` - -Defined in: [workflow/types.ts:351](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L351) - -*** - -### phase? - -> `optional` **phase?**: `string` - -Defined in: [workflow/types.ts:352](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L352) - -*** - -### stageIndex? - -> `optional` **stageIndex?**: `number` - -Defined in: [workflow/types.ts:353](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L353) diff --git a/docs/api/workflow/interfaces/WorkflowBranchStartedPayload.md b/docs/api/workflow/interfaces/WorkflowBranchStartedPayload.md deleted file mode 100644 index 3f10c2c..0000000 --- a/docs/api/workflow/interfaces/WorkflowBranchStartedPayload.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowBranchStartedPayload - -# Interface: WorkflowBranchStartedPayload - -Defined in: [workflow/types.ts:331](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L331) - -## Properties - -### operation - -> **operation**: [`WorkflowBranchOperation`](../type-aliases/WorkflowBranchOperation.md) - -Defined in: [workflow/types.ts:332](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L332) - -*** - -### branchIndex - -> **branchIndex**: `number` - -Defined in: [workflow/types.ts:333](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L333) - -*** - -### phase? - -> `optional` **phase?**: `string` - -Defined in: [workflow/types.ts:334](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L334) - -*** - -### stageCount? - -> `optional` **stageCount?**: `number` - -Defined in: [workflow/types.ts:335](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L335) diff --git a/docs/api/workflow/interfaces/WorkflowBudgetCaps.md b/docs/api/workflow/interfaces/WorkflowBudgetCaps.md deleted file mode 100644 index f277a7e..0000000 --- a/docs/api/workflow/interfaces/WorkflowBudgetCaps.md +++ /dev/null @@ -1,65 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowBudgetCaps - -# Interface: WorkflowBudgetCaps - -Defined in: [workflow/types.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L58) - -## Properties - -### maxCostUsd? - -> `optional` **maxCostUsd?**: `number` - -Defined in: [workflow/types.ts:59](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L59) - -*** - -### maxTokens? - -> `optional` **maxTokens?**: `number` - -Defined in: [workflow/types.ts:60](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L60) - -*** - -### maxWallMs? - -> `optional` **maxWallMs?**: `number` - -Defined in: [workflow/types.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L61) - -*** - -### maxAgentCalls? - -> `optional` **maxAgentCalls?**: `number` - -Defined in: [workflow/types.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L62) - -*** - -### maxLoopCalls? - -> `optional` **maxLoopCalls?**: `number` - -Defined in: [workflow/types.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L63) - -*** - -### maxFanout? - -> `optional` **maxFanout?**: `number` - -Defined in: [workflow/types.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L64) - -*** - -### maxDepth? - -> `optional` **maxDepth?**: `number` - -Defined in: [workflow/types.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L65) diff --git a/docs/api/workflow/interfaces/WorkflowBudgetRemaining.md b/docs/api/workflow/interfaces/WorkflowBudgetRemaining.md deleted file mode 100644 index 83965db..0000000 --- a/docs/api/workflow/interfaces/WorkflowBudgetRemaining.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowBudgetRemaining - -# Interface: WorkflowBudgetRemaining - -Defined in: [workflow/types.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L50) - -## Properties - -### costUsd? - -> `optional` **costUsd?**: `number` - -Defined in: [workflow/types.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L51) - -*** - -### tokens? - -> `optional` **tokens?**: `number` - -Defined in: [workflow/types.ts:52](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L52) - -*** - -### agentCalls? - -> `optional` **agentCalls?**: `number` - -Defined in: [workflow/types.ts:53](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L53) - -*** - -### loopCalls? - -> `optional` **loopCalls?**: `number` - -Defined in: [workflow/types.ts:54](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L54) - -*** - -### wallMs? - -> `optional` **wallMs?**: `number` - -Defined in: [workflow/types.ts:55](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L55) diff --git a/docs/api/workflow/interfaces/WorkflowBudgetSnapshot.md b/docs/api/workflow/interfaces/WorkflowBudgetSnapshot.md deleted file mode 100644 index c586793..0000000 --- a/docs/api/workflow/interfaces/WorkflowBudgetSnapshot.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowBudgetSnapshot - -# Interface: WorkflowBudgetSnapshot - -Defined in: [workflow/types.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L42) - -## Properties - -### costUsd - -> **costUsd**: `number` - -Defined in: [workflow/types.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L43) - -*** - -### tokens - -> **tokens**: [`WorkflowTokenUsage`](WorkflowTokenUsage.md) - -Defined in: [workflow/types.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L44) - -*** - -### agentCalls - -> **agentCalls**: `number` - -Defined in: [workflow/types.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L45) - -*** - -### loopCalls - -> **loopCalls**: `number` - -Defined in: [workflow/types.ts:46](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L46) - -*** - -### elapsedMs - -> **elapsedMs**: `number` - -Defined in: [workflow/types.ts:47](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L47) diff --git a/docs/api/workflow/interfaces/WorkflowBudgetView.md b/docs/api/workflow/interfaces/WorkflowBudgetView.md deleted file mode 100644 index bfe7c37..0000000 --- a/docs/api/workflow/interfaces/WorkflowBudgetView.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowBudgetView - -# Interface: WorkflowBudgetView - -Defined in: [workflow/types.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L68) - -## Properties - -### total - -> `readonly` **total**: [`WorkflowBudgetCaps`](WorkflowBudgetCaps.md) - -Defined in: [workflow/types.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L69) - -## Methods - -### spent() - -> **spent**(): [`WorkflowBudgetSnapshot`](WorkflowBudgetSnapshot.md) - -Defined in: [workflow/types.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L70) - -#### Returns - -[`WorkflowBudgetSnapshot`](WorkflowBudgetSnapshot.md) - -*** - -### remaining() - -> **remaining**(): [`WorkflowBudgetRemaining`](WorkflowBudgetRemaining.md) - -Defined in: [workflow/types.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L71) - -#### Returns - -[`WorkflowBudgetRemaining`](WorkflowBudgetRemaining.md) diff --git a/docs/api/workflow/interfaces/WorkflowCheckpointEndedPayload.md b/docs/api/workflow/interfaces/WorkflowCheckpointEndedPayload.md deleted file mode 100644 index 3090ccb..0000000 --- a/docs/api/workflow/interfaces/WorkflowCheckpointEndedPayload.md +++ /dev/null @@ -1,65 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowCheckpointEndedPayload - -# Interface: WorkflowCheckpointEndedPayload - -Defined in: [workflow/types.ts:398](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L398) - -## Properties - -### index - -> **index**: `number` - -Defined in: [workflow/types.ts:399](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L399) - -*** - -### label? - -> `optional` **label?**: `string` - -Defined in: [workflow/types.ts:400](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L400) - -*** - -### durationMs - -> **durationMs**: `number` - -Defined in: [workflow/types.ts:401](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L401) - -*** - -### costUsd - -> **costUsd**: `number` - -Defined in: [workflow/types.ts:402](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L402) - -*** - -### tokenUsage - -> **tokenUsage**: [`WorkflowTokenUsage`](WorkflowTokenUsage.md) - -Defined in: [workflow/types.ts:403](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L403) - -*** - -### phase? - -> `optional` **phase?**: `string` - -Defined in: [workflow/types.ts:404](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L404) - -*** - -### trace? - -> `optional` **trace?**: `unknown` - -Defined in: [workflow/types.ts:405](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L405) diff --git a/docs/api/workflow/interfaces/WorkflowCheckpointOptions.md b/docs/api/workflow/interfaces/WorkflowCheckpointOptions.md deleted file mode 100644 index e695e9b..0000000 --- a/docs/api/workflow/interfaces/WorkflowCheckpointOptions.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowCheckpointOptions - -# Interface: WorkflowCheckpointOptions\ - -Defined in: [workflow/types.ts:93](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L93) - -## Type Parameters - -### TOutput - -`TOutput` = `unknown` - -## Properties - -### label? - -> `optional` **label?**: `string` - -Defined in: [workflow/types.ts:94](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L94) - -*** - -### schema? - -> `optional` **schema?**: [`JsonSchema`](../type-aliases/JsonSchema.md) - -Defined in: [workflow/types.ts:95](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L95) - -*** - -### metadata? - -> `optional` **metadata?**: `Record`\<`string`, `unknown`\> - -Defined in: [workflow/types.ts:96](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L96) - -*** - -### decode? - -> `optional` **decode?**: (`value`) => `TOutput` - -Defined in: [workflow/types.ts:97](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L97) - -#### Parameters - -##### value - -`unknown` - -#### Returns - -`TOutput` diff --git a/docs/api/workflow/interfaces/WorkflowCheckpointStartedPayload.md b/docs/api/workflow/interfaces/WorkflowCheckpointStartedPayload.md deleted file mode 100644 index 35ef52c..0000000 --- a/docs/api/workflow/interfaces/WorkflowCheckpointStartedPayload.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowCheckpointStartedPayload - -# Interface: WorkflowCheckpointStartedPayload - -Defined in: [workflow/types.ts:391](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L391) - -## Properties - -### index - -> **index**: `number` - -Defined in: [workflow/types.ts:392](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L392) - -*** - -### label? - -> `optional` **label?**: `string` - -Defined in: [workflow/types.ts:393](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L393) - -*** - -### phase? - -> `optional` **phase?**: `string` - -Defined in: [workflow/types.ts:394](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L394) - -*** - -### metadata? - -> `optional` **metadata?**: `Record`\<`string`, `unknown`\> - -Defined in: [workflow/types.ts:395](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L395) diff --git a/docs/api/workflow/interfaces/WorkflowDelegateContext.md b/docs/api/workflow/interfaces/WorkflowDelegateContext.md deleted file mode 100644 index 10a740e..0000000 --- a/docs/api/workflow/interfaces/WorkflowDelegateContext.md +++ /dev/null @@ -1,65 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowDelegateContext - -# Interface: WorkflowDelegateContext - -Defined in: [workflow/types.ts:111](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L111) - -## Properties - -### workflowRunId - -> **workflowRunId**: `string` - -Defined in: [workflow/types.ts:112](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L112) - -*** - -### depth - -> **depth**: `number` - -Defined in: [workflow/types.ts:113](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L113) - -*** - -### phase? - -> `optional` **phase?**: `string` - -Defined in: [workflow/types.ts:114](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L114) - -*** - -### signal - -> **signal**: `AbortSignal` - -Defined in: [workflow/types.ts:115](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L115) - -*** - -### caps - -> **caps**: [`WorkflowBudgetCaps`](WorkflowBudgetCaps.md) - -Defined in: [workflow/types.ts:116](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L116) - -*** - -### budget - -> **budget**: [`WorkflowBudgetView`](WorkflowBudgetView.md) - -Defined in: [workflow/types.ts:117](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L117) - -*** - -### metadata? - -> `optional` **metadata?**: `Record`\<`string`, `unknown`\> - -Defined in: [workflow/types.ts:118](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L118) diff --git a/docs/api/workflow/interfaces/WorkflowDelegateResult.md b/docs/api/workflow/interfaces/WorkflowDelegateResult.md deleted file mode 100644 index c417c36..0000000 --- a/docs/api/workflow/interfaces/WorkflowDelegateResult.md +++ /dev/null @@ -1,61 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowDelegateResult - -# Interface: WorkflowDelegateResult - -Defined in: [workflow/types.ts:100](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L100) - -## Properties - -### output - -> **output**: `unknown` - -Defined in: [workflow/types.ts:101](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L101) - -*** - -### costUsd? - -> `optional` **costUsd?**: `number` - -Defined in: [workflow/types.ts:102](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L102) - -*** - -### tokenUsage? - -> `optional` **tokenUsage?**: `Partial`\<[`WorkflowTokenUsage`](WorkflowTokenUsage.md)\> - -Defined in: [workflow/types.ts:103](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L103) - -*** - -### agentCalls? - -> `optional` **agentCalls?**: `number` - -Defined in: [workflow/types.ts:105](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L105) - -Additional downstream workflow agent calls consumed inside this delegate. - -*** - -### loopCalls? - -> `optional` **loopCalls?**: `number` - -Defined in: [workflow/types.ts:107](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L107) - -Additional downstream workflow loop calls consumed inside this delegate. - -*** - -### trace? - -> `optional` **trace?**: `unknown` - -Defined in: [workflow/types.ts:108](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L108) diff --git a/docs/api/workflow/interfaces/WorkflowEndedPayload.md b/docs/api/workflow/interfaces/WorkflowEndedPayload.md deleted file mode 100644 index 8927998..0000000 --- a/docs/api/workflow/interfaces/WorkflowEndedPayload.md +++ /dev/null @@ -1,49 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowEndedPayload - -# Interface: WorkflowEndedPayload - -Defined in: [workflow/types.ts:423](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L423) - -## Properties - -### durationMs - -> **durationMs**: `number` - -Defined in: [workflow/types.ts:424](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L424) - -*** - -### costUsd - -> **costUsd**: `number` - -Defined in: [workflow/types.ts:425](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L425) - -*** - -### tokenUsage - -> **tokenUsage**: [`WorkflowTokenUsage`](WorkflowTokenUsage.md) - -Defined in: [workflow/types.ts:426](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L426) - -*** - -### agentCalls - -> **agentCalls**: `number` - -Defined in: [workflow/types.ts:427](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L427) - -*** - -### loopCalls - -> **loopCalls**: `number` - -Defined in: [workflow/types.ts:428](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L428) diff --git a/docs/api/workflow/interfaces/WorkflowFailedPayload.md b/docs/api/workflow/interfaces/WorkflowFailedPayload.md deleted file mode 100644 index 31073d4..0000000 --- a/docs/api/workflow/interfaces/WorkflowFailedPayload.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowFailedPayload - -# Interface: WorkflowFailedPayload - -Defined in: [workflow/types.ts:417](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L417) - -## Properties - -### message - -> **message**: `string` - -Defined in: [workflow/types.ts:418](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L418) - -*** - -### code? - -> `optional` **code?**: `string` - -Defined in: [workflow/types.ts:419](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L419) - -*** - -### phase? - -> `optional` **phase?**: `string` - -Defined in: [workflow/types.ts:420](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L420) diff --git a/docs/api/workflow/interfaces/WorkflowLogPayload.md b/docs/api/workflow/interfaces/WorkflowLogPayload.md deleted file mode 100644 index 2be8b75..0000000 --- a/docs/api/workflow/interfaces/WorkflowLogPayload.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowLogPayload - -# Interface: WorkflowLogPayload - -Defined in: [workflow/types.ts:300](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L300) - -## Properties - -### message - -> **message**: `string` - -Defined in: [workflow/types.ts:301](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L301) - -*** - -### phase? - -> `optional` **phase?**: `string` - -Defined in: [workflow/types.ts:302](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L302) diff --git a/docs/api/workflow/interfaces/WorkflowLoopEndedPayload.md b/docs/api/workflow/interfaces/WorkflowLoopEndedPayload.md deleted file mode 100644 index b95cde7..0000000 --- a/docs/api/workflow/interfaces/WorkflowLoopEndedPayload.md +++ /dev/null @@ -1,65 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowLoopEndedPayload - -# Interface: WorkflowLoopEndedPayload - -Defined in: [workflow/types.ts:381](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L381) - -## Properties - -### index - -> **index**: `number` - -Defined in: [workflow/types.ts:382](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L382) - -*** - -### label? - -> `optional` **label?**: `string` - -Defined in: [workflow/types.ts:383](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L383) - -*** - -### durationMs - -> **durationMs**: `number` - -Defined in: [workflow/types.ts:384](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L384) - -*** - -### costUsd - -> **costUsd**: `number` - -Defined in: [workflow/types.ts:385](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L385) - -*** - -### tokenUsage - -> **tokenUsage**: [`WorkflowTokenUsage`](WorkflowTokenUsage.md) - -Defined in: [workflow/types.ts:386](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L386) - -*** - -### phase? - -> `optional` **phase?**: `string` - -Defined in: [workflow/types.ts:387](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L387) - -*** - -### trace? - -> `optional` **trace?**: `unknown` - -Defined in: [workflow/types.ts:388](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L388) diff --git a/docs/api/workflow/interfaces/WorkflowLoopOptions.md b/docs/api/workflow/interfaces/WorkflowLoopOptions.md deleted file mode 100644 index dc4efc8..0000000 --- a/docs/api/workflow/interfaces/WorkflowLoopOptions.md +++ /dev/null @@ -1,57 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowLoopOptions - -# Interface: WorkflowLoopOptions\ - -Defined in: [workflow/types.ts:86](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L86) - -## Type Parameters - -### TOutput - -`TOutput` = `unknown` - -## Properties - -### label? - -> `optional` **label?**: `string` - -Defined in: [workflow/types.ts:87](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L87) - -*** - -### schema? - -> `optional` **schema?**: [`JsonSchema`](../type-aliases/JsonSchema.md) - -Defined in: [workflow/types.ts:88](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L88) - -*** - -### metadata? - -> `optional` **metadata?**: `Record`\<`string`, `unknown`\> - -Defined in: [workflow/types.ts:89](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L89) - -*** - -### decode? - -> `optional` **decode?**: (`value`) => `TOutput` - -Defined in: [workflow/types.ts:90](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L90) - -#### Parameters - -##### value - -`unknown` - -#### Returns - -`TOutput` diff --git a/docs/api/workflow/interfaces/WorkflowLoopStartedPayload.md b/docs/api/workflow/interfaces/WorkflowLoopStartedPayload.md deleted file mode 100644 index d83e69f..0000000 --- a/docs/api/workflow/interfaces/WorkflowLoopStartedPayload.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowLoopStartedPayload - -# Interface: WorkflowLoopStartedPayload - -Defined in: [workflow/types.ts:374](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L374) - -## Properties - -### index - -> **index**: `number` - -Defined in: [workflow/types.ts:375](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L375) - -*** - -### label? - -> `optional` **label?**: `string` - -Defined in: [workflow/types.ts:376](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L376) - -*** - -### phase? - -> `optional` **phase?**: `string` - -Defined in: [workflow/types.ts:377](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L377) - -*** - -### metadata? - -> `optional` **metadata?**: `Record`\<`string`, `unknown`\> - -Defined in: [workflow/types.ts:378](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L378) diff --git a/docs/api/workflow/interfaces/WorkflowMeta.md b/docs/api/workflow/interfaces/WorkflowMeta.md deleted file mode 100644 index dd4743a..0000000 --- a/docs/api/workflow/interfaces/WorkflowMeta.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowMeta - -# Interface: WorkflowMeta - -Defined in: [workflow/types.ts:17](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L17) - -## Properties - -### name - -> **name**: `string` - -Defined in: [workflow/types.ts:18](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L18) - -*** - -### description - -> **description**: `string` - -Defined in: [workflow/types.ts:19](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L19) - -*** - -### phases? - -> `optional` **phases?**: [`WorkflowPhaseMeta`](WorkflowPhaseMeta.md)[] - -Defined in: [workflow/types.ts:20](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L20) diff --git a/docs/api/workflow/interfaces/WorkflowParallelEndedPayload.md b/docs/api/workflow/interfaces/WorkflowParallelEndedPayload.md deleted file mode 100644 index fa5c994..0000000 --- a/docs/api/workflow/interfaces/WorkflowParallelEndedPayload.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowParallelEndedPayload - -# Interface: WorkflowParallelEndedPayload - -Defined in: [workflow/types.ts:310](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L310) - -## Properties - -### branchCount - -> **branchCount**: `number` - -Defined in: [workflow/types.ts:311](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L311) - -*** - -### durationMs - -> **durationMs**: `number` - -Defined in: [workflow/types.ts:312](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L312) - -*** - -### phase? - -> `optional` **phase?**: `string` - -Defined in: [workflow/types.ts:313](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L313) diff --git a/docs/api/workflow/interfaces/WorkflowParallelStartedPayload.md b/docs/api/workflow/interfaces/WorkflowParallelStartedPayload.md deleted file mode 100644 index e04b456..0000000 --- a/docs/api/workflow/interfaces/WorkflowParallelStartedPayload.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowParallelStartedPayload - -# Interface: WorkflowParallelStartedPayload - -Defined in: [workflow/types.ts:305](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L305) - -## Properties - -### branchCount - -> **branchCount**: `number` - -Defined in: [workflow/types.ts:306](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L306) - -*** - -### phase? - -> `optional` **phase?**: `string` - -Defined in: [workflow/types.ts:307](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L307) diff --git a/docs/api/workflow/interfaces/WorkflowPhaseMeta.md b/docs/api/workflow/interfaces/WorkflowPhaseMeta.md deleted file mode 100644 index c34b96a..0000000 --- a/docs/api/workflow/interfaces/WorkflowPhaseMeta.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowPhaseMeta - -# Interface: WorkflowPhaseMeta - -Defined in: [workflow/types.ts:13](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L13) - -**`Experimental`** - -Dynamic workflow substrate. - -A workflow is driver-authored code executed by a restricted runtime. The -runtime owns orchestration mechanics (phase/progress, fanout, budget, -cancellation, trace emission); product code supplies delegates that actually -run agents and loops. That boundary keeps this package generic while still -letting consumers wire real sandboxes underneath `agent()` and `loop()`. - -## Properties - -### title - -> **title**: `string` - -Defined in: [workflow/types.ts:14](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L14) - -**`Experimental`** diff --git a/docs/api/workflow/interfaces/WorkflowPhasePayload.md b/docs/api/workflow/interfaces/WorkflowPhasePayload.md deleted file mode 100644 index cf580f3..0000000 --- a/docs/api/workflow/interfaces/WorkflowPhasePayload.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowPhasePayload - -# Interface: WorkflowPhasePayload - -Defined in: [workflow/types.ts:296](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L296) - -## Properties - -### title - -> **title**: `string` - -Defined in: [workflow/types.ts:297](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L297) diff --git a/docs/api/workflow/interfaces/WorkflowPipelineEndedPayload.md b/docs/api/workflow/interfaces/WorkflowPipelineEndedPayload.md deleted file mode 100644 index 094dc4c..0000000 --- a/docs/api/workflow/interfaces/WorkflowPipelineEndedPayload.md +++ /dev/null @@ -1,41 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowPipelineEndedPayload - -# Interface: WorkflowPipelineEndedPayload - -Defined in: [workflow/types.ts:322](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L322) - -## Properties - -### itemCount - -> **itemCount**: `number` - -Defined in: [workflow/types.ts:323](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L323) - -*** - -### stageCount - -> **stageCount**: `number` - -Defined in: [workflow/types.ts:324](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L324) - -*** - -### durationMs - -> **durationMs**: `number` - -Defined in: [workflow/types.ts:325](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L325) - -*** - -### phase? - -> `optional` **phase?**: `string` - -Defined in: [workflow/types.ts:326](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L326) diff --git a/docs/api/workflow/interfaces/WorkflowPipelineStartedPayload.md b/docs/api/workflow/interfaces/WorkflowPipelineStartedPayload.md deleted file mode 100644 index a0003c5..0000000 --- a/docs/api/workflow/interfaces/WorkflowPipelineStartedPayload.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowPipelineStartedPayload - -# Interface: WorkflowPipelineStartedPayload - -Defined in: [workflow/types.ts:316](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L316) - -## Properties - -### itemCount - -> **itemCount**: `number` - -Defined in: [workflow/types.ts:317](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L317) - -*** - -### stageCount - -> **stageCount**: `number` - -Defined in: [workflow/types.ts:318](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L318) - -*** - -### phase? - -> `optional` **phase?**: `string` - -Defined in: [workflow/types.ts:319](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L319) diff --git a/docs/api/workflow/interfaces/WorkflowResult.md b/docs/api/workflow/interfaces/WorkflowResult.md deleted file mode 100644 index 917d7c8..0000000 --- a/docs/api/workflow/interfaces/WorkflowResult.md +++ /dev/null @@ -1,87 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowResult - -# Interface: WorkflowResult\ - -Defined in: [workflow/types.ts:452](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L452) - -## Type Parameters - -### TOutput - -`TOutput` = `unknown` - -## Properties - -### runId - -> **runId**: `string` - -Defined in: [workflow/types.ts:453](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L453) - -*** - -### meta - -> **meta**: [`WorkflowMeta`](WorkflowMeta.md) - -Defined in: [workflow/types.ts:454](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L454) - -*** - -### output - -> **output**: `TOutput` - -Defined in: [workflow/types.ts:455](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L455) - -*** - -### events - -> **events**: [`WorkflowTraceEvent`](../type-aliases/WorkflowTraceEvent.md)[] - -Defined in: [workflow/types.ts:456](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L456) - -*** - -### durationMs - -> **durationMs**: `number` - -Defined in: [workflow/types.ts:457](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L457) - -*** - -### costUsd - -> **costUsd**: `number` - -Defined in: [workflow/types.ts:458](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L458) - -*** - -### tokenUsage - -> **tokenUsage**: [`WorkflowTokenUsage`](WorkflowTokenUsage.md) - -Defined in: [workflow/types.ts:459](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L459) - -*** - -### agentCalls - -> **agentCalls**: `number` - -Defined in: [workflow/types.ts:460](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L460) - -*** - -### loopCalls - -> **loopCalls**: `number` - -Defined in: [workflow/types.ts:461](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L461) diff --git a/docs/api/workflow/interfaces/WorkflowRuntimeOptions.md b/docs/api/workflow/interfaces/WorkflowRuntimeOptions.md deleted file mode 100644 index 2863491..0000000 --- a/docs/api/workflow/interfaces/WorkflowRuntimeOptions.md +++ /dev/null @@ -1,125 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowRuntimeOptions - -# Interface: WorkflowRuntimeOptions - -Defined in: [workflow/types.ts:435](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L435) - -## Properties - -### source - -> **source**: `string` - -Defined in: [workflow/types.ts:436](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L436) - -*** - -### agent - -> **agent**: [`WorkflowAgentDelegate`](../type-aliases/WorkflowAgentDelegate.md) - -Defined in: [workflow/types.ts:437](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L437) - -*** - -### loop? - -> `optional` **loop?**: [`WorkflowLoopDelegate`](../type-aliases/WorkflowLoopDelegate.md) - -Defined in: [workflow/types.ts:438](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L438) - -*** - -### verifier? - -> `optional` **verifier?**: [`WorkflowVerifierDelegate`](../type-aliases/WorkflowVerifierDelegate.md) - -Defined in: [workflow/types.ts:439](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L439) - -*** - -### analyst? - -> `optional` **analyst?**: [`WorkflowAnalystDelegate`](../type-aliases/WorkflowAnalystDelegate.md) - -Defined in: [workflow/types.ts:440](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L440) - -*** - -### reviewer? - -> `optional` **reviewer?**: [`WorkflowReviewerDelegate`](../type-aliases/WorkflowReviewerDelegate.md) - -Defined in: [workflow/types.ts:441](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L441) - -*** - -### runId? - -> `optional` **runId?**: `string` - -Defined in: [workflow/types.ts:442](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L442) - -*** - -### depth? - -> `optional` **depth?**: `number` - -Defined in: [workflow/types.ts:443](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L443) - -*** - -### caps? - -> `optional` **caps?**: [`WorkflowBudgetCaps`](WorkflowBudgetCaps.md) - -Defined in: [workflow/types.ts:444](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L444) - -*** - -### metadata? - -> `optional` **metadata?**: `Record`\<`string`, `unknown`\> - -Defined in: [workflow/types.ts:445](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L445) - -*** - -### signal? - -> `optional` **signal?**: `AbortSignal` - -Defined in: [workflow/types.ts:446](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L446) - -*** - -### traceEmitter? - -> `optional` **traceEmitter?**: [`WorkflowTraceEmitter`](WorkflowTraceEmitter.md) - -Defined in: [workflow/types.ts:447](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L447) - -*** - -### now? - -> `optional` **now?**: () => `number` - -Defined in: [workflow/types.ts:448](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L448) - -#### Returns - -`number` - -*** - -### syncTimeoutMs? - -> `optional` **syncTimeoutMs?**: `number` - -Defined in: [workflow/types.ts:449](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L449) diff --git a/docs/api/workflow/interfaces/WorkflowSandboxAgentDefaultTrace.md b/docs/api/workflow/interfaces/WorkflowSandboxAgentDefaultTrace.md deleted file mode 100644 index 68ec8f3..0000000 --- a/docs/api/workflow/interfaces/WorkflowSandboxAgentDefaultTrace.md +++ /dev/null @@ -1,81 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowSandboxAgentDefaultTrace - -# Interface: WorkflowSandboxAgentDefaultTrace - -Defined in: [workflow/agent-delegate.ts:62](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L62) - -## Properties - -### stream - -> **stream**: [`WorkflowSandboxAgentStream`](../type-aliases/WorkflowSandboxAgentStream.md) - -Defined in: [workflow/agent-delegate.ts:63](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L63) - -*** - -### placement - -> **placement**: `"sibling"` \| `"fleet"` - -Defined in: [workflow/agent-delegate.ts:64](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L64) - -*** - -### sandboxId? - -> `optional` **sandboxId?**: `string` - -Defined in: [workflow/agent-delegate.ts:65](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L65) - -*** - -### fleetId? - -> `optional` **fleetId?**: `string` - -Defined in: [workflow/agent-delegate.ts:66](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L66) - -*** - -### machineId? - -> `optional` **machineId?**: `string` - -Defined in: [workflow/agent-delegate.ts:67](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L67) - -*** - -### profileName? - -> `optional` **profileName?**: `string` - -Defined in: [workflow/agent-delegate.ts:68](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L68) - -*** - -### eventCount - -> **eventCount**: `number` - -Defined in: [workflow/agent-delegate.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L69) - -*** - -### eventTypes - -> **eventTypes**: `string`[] - -Defined in: [workflow/agent-delegate.ts:70](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L70) - -*** - -### events? - -> `optional` **events?**: `SandboxEvent`[] - -Defined in: [workflow/agent-delegate.ts:71](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L71) diff --git a/docs/api/workflow/interfaces/WorkflowSandboxAgentTrace.md b/docs/api/workflow/interfaces/WorkflowSandboxAgentTrace.md deleted file mode 100644 index 5662ce0..0000000 --- a/docs/api/workflow/interfaces/WorkflowSandboxAgentTrace.md +++ /dev/null @@ -1,95 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowSandboxAgentTrace - -# Interface: WorkflowSandboxAgentTrace\ - -Defined in: [workflow/agent-delegate.ts:34](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L34) - -## Type Parameters - -### TOutput - -`TOutput` = `unknown` - -## Properties - -### prompt - -> **prompt**: `string` - -Defined in: [workflow/agent-delegate.ts:35](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L35) - -*** - -### options - -> **options**: [`WorkflowAgentOptions`](WorkflowAgentOptions.md) - -Defined in: [workflow/agent-delegate.ts:36](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L36) - -*** - -### ctx - -> **ctx**: [`WorkflowDelegateContext`](WorkflowDelegateContext.md) - -Defined in: [workflow/agent-delegate.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L37) - -*** - -### profile - -> **profile**: `AgentProfile` - -Defined in: [workflow/agent-delegate.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L38) - -*** - -### output - -> **output**: `TOutput` - -Defined in: [workflow/agent-delegate.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L39) - -*** - -### events - -> **events**: `SandboxEvent`[] - -Defined in: [workflow/agent-delegate.ts:40](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L40) - -*** - -### stream - -> **stream**: [`WorkflowSandboxAgentStream`](../type-aliases/WorkflowSandboxAgentStream.md) - -Defined in: [workflow/agent-delegate.ts:41](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L41) - -*** - -### placement - -> **placement**: [`LoopSandboxPlacement`](../../runtime/interfaces/LoopSandboxPlacement.md) - -Defined in: [workflow/agent-delegate.ts:42](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L42) - -*** - -### costUsd - -> **costUsd**: `number` - -Defined in: [workflow/agent-delegate.ts:43](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L43) - -*** - -### tokenUsage - -> **tokenUsage**: [`WorkflowTokenUsage`](WorkflowTokenUsage.md) - -Defined in: [workflow/agent-delegate.ts:44](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L44) diff --git a/docs/api/workflow/interfaces/WorkflowStartedPayload.md b/docs/api/workflow/interfaces/WorkflowStartedPayload.md deleted file mode 100644 index 4fc2f98..0000000 --- a/docs/api/workflow/interfaces/WorkflowStartedPayload.md +++ /dev/null @@ -1,33 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowStartedPayload - -# Interface: WorkflowStartedPayload - -Defined in: [workflow/types.ts:290](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L290) - -## Properties - -### meta - -> **meta**: [`WorkflowMeta`](WorkflowMeta.md) - -Defined in: [workflow/types.ts:291](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L291) - -*** - -### depth - -> **depth**: `number` - -Defined in: [workflow/types.ts:292](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L292) - -*** - -### caps - -> **caps**: [`WorkflowBudgetCaps`](WorkflowBudgetCaps.md) - -Defined in: [workflow/types.ts:293](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L293) diff --git a/docs/api/workflow/interfaces/WorkflowTokenUsage.md b/docs/api/workflow/interfaces/WorkflowTokenUsage.md deleted file mode 100644 index 6461eb5..0000000 --- a/docs/api/workflow/interfaces/WorkflowTokenUsage.md +++ /dev/null @@ -1,25 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowTokenUsage - -# Interface: WorkflowTokenUsage - -Defined in: [workflow/types.ts:37](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L37) - -## Properties - -### input - -> **input**: `number` - -Defined in: [workflow/types.ts:38](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L38) - -*** - -### output - -> **output**: `number` - -Defined in: [workflow/types.ts:39](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L39) diff --git a/docs/api/workflow/interfaces/WorkflowTraceEmitter.md b/docs/api/workflow/interfaces/WorkflowTraceEmitter.md deleted file mode 100644 index 0173ed3..0000000 --- a/docs/api/workflow/interfaces/WorkflowTraceEmitter.md +++ /dev/null @@ -1,27 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowTraceEmitter - -# Interface: WorkflowTraceEmitter - -Defined in: [workflow/types.ts:431](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L431) - -## Methods - -### emit() - -> **emit**(`event`): `void` \| `Promise`\<`void`\> - -Defined in: [workflow/types.ts:432](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L432) - -#### Parameters - -##### event - -[`WorkflowTraceEvent`](../type-aliases/WorkflowTraceEvent.md) - -#### Returns - -`void` \| `Promise`\<`void`\> diff --git a/docs/api/workflow/type-aliases/JsonSchema.md b/docs/api/workflow/type-aliases/JsonSchema.md deleted file mode 100644 index 594017c..0000000 --- a/docs/api/workflow/type-aliases/JsonSchema.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / JsonSchema - -# Type Alias: JsonSchema - -> **JsonSchema** = \{ `type`: `"string"`; `minLength?`: `number`; `maxLength?`: `number`; `enum?`: `string`[]; \} \| \{ `type`: `"number"`; `minimum?`: `number`; `maximum?`: `number`; `enum?`: `number`[]; \} \| \{ `type`: `"integer"`; `minimum?`: `number`; `maximum?`: `number`; `enum?`: `number`[]; \} \| \{ `type`: `"boolean"`; `enum?`: `boolean`[]; \} \| \{ `type`: `"null"`; \} \| \{ `type`: `"array"`; `items?`: `JsonSchema`; `minItems?`: `number`; `maxItems?`: `number`; \} \| \{ `type`: `"object"`; `properties?`: `Record`\<`string`, `JsonSchema`\>; `required?`: `string`[]; `additionalProperties?`: `boolean`; \} - -Defined in: [workflow/types.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L23) diff --git a/docs/api/workflow/type-aliases/NestedWorkflowCapsResolver.md b/docs/api/workflow/type-aliases/NestedWorkflowCapsResolver.md deleted file mode 100644 index fd983a8..0000000 --- a/docs/api/workflow/type-aliases/NestedWorkflowCapsResolver.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / NestedWorkflowCapsResolver - -# Type Alias: NestedWorkflowCapsResolver - -> **NestedWorkflowCapsResolver** = [`WorkflowBudgetCaps`](../interfaces/WorkflowBudgetCaps.md) \| ((`input`) => [`WorkflowBudgetCaps`](../interfaces/WorkflowBudgetCaps.md)) - -Defined in: [workflow/nested-workflow-delegate.ts:23](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L23) diff --git a/docs/api/workflow/type-aliases/NestedWorkflowMetadataResolver.md b/docs/api/workflow/type-aliases/NestedWorkflowMetadataResolver.md deleted file mode 100644 index c749bb2..0000000 --- a/docs/api/workflow/type-aliases/NestedWorkflowMetadataResolver.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / NestedWorkflowMetadataResolver - -# Type Alias: NestedWorkflowMetadataResolver - -> **NestedWorkflowMetadataResolver** = `Record`\<`string`, `unknown`\> \| ((`input`) => `Record`\<`string`, `unknown`\> \| `undefined`) - -Defined in: [workflow/nested-workflow-delegate.ts:27](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/nested-workflow-delegate.ts#L27) diff --git a/docs/api/workflow/type-aliases/WorkflowAgentDelegate.md b/docs/api/workflow/type-aliases/WorkflowAgentDelegate.md deleted file mode 100644 index 2f9b27b..0000000 --- a/docs/api/workflow/type-aliases/WorkflowAgentDelegate.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowAgentDelegate - -# Type Alias: WorkflowAgentDelegate - -> **WorkflowAgentDelegate** = (`prompt`, `options`, `ctx`) => `Promise`\<[`WorkflowDelegateResult`](../interfaces/WorkflowDelegateResult.md)\> - -Defined in: [workflow/types.ts:121](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L121) - -## Parameters - -### prompt - -`string` - -### options - -[`WorkflowAgentOptions`](../interfaces/WorkflowAgentOptions.md) - -### ctx - -[`WorkflowDelegateContext`](../interfaces/WorkflowDelegateContext.md) - -## Returns - -`Promise`\<[`WorkflowDelegateResult`](../interfaces/WorkflowDelegateResult.md)\> diff --git a/docs/api/workflow/type-aliases/WorkflowAnalystDelegate.md b/docs/api/workflow/type-aliases/WorkflowAnalystDelegate.md deleted file mode 100644 index 46a216a..0000000 --- a/docs/api/workflow/type-aliases/WorkflowAnalystDelegate.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowAnalystDelegate - -# Type Alias: WorkflowAnalystDelegate - -> **WorkflowAnalystDelegate** = (`input`, `options`, `ctx`) => `Promise`\<[`WorkflowDelegateResult`](../interfaces/WorkflowDelegateResult.md)\> - -Defined in: [workflow/types.ts:139](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L139) - -## Parameters - -### input - -`unknown` - -### options - -[`WorkflowCheckpointOptions`](../interfaces/WorkflowCheckpointOptions.md) - -### ctx - -[`WorkflowDelegateContext`](../interfaces/WorkflowDelegateContext.md) - -## Returns - -`Promise`\<[`WorkflowDelegateResult`](../interfaces/WorkflowDelegateResult.md)\> diff --git a/docs/api/workflow/type-aliases/WorkflowBranchOperation.md b/docs/api/workflow/type-aliases/WorkflowBranchOperation.md deleted file mode 100644 index 5e98b90..0000000 --- a/docs/api/workflow/type-aliases/WorkflowBranchOperation.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowBranchOperation - -# Type Alias: WorkflowBranchOperation - -> **WorkflowBranchOperation** = `"parallel"` \| `"pipeline"` - -Defined in: [workflow/types.ts:329](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L329) diff --git a/docs/api/workflow/type-aliases/WorkflowLoopDelegate.md b/docs/api/workflow/type-aliases/WorkflowLoopDelegate.md deleted file mode 100644 index aaebc31..0000000 --- a/docs/api/workflow/type-aliases/WorkflowLoopDelegate.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowLoopDelegate - -# Type Alias: WorkflowLoopDelegate - -> **WorkflowLoopDelegate** = (`input`, `options`, `ctx`) => `Promise`\<[`WorkflowDelegateResult`](../interfaces/WorkflowDelegateResult.md)\> - -Defined in: [workflow/types.ts:127](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L127) - -## Parameters - -### input - -`unknown` - -### options - -[`WorkflowLoopOptions`](../interfaces/WorkflowLoopOptions.md) - -### ctx - -[`WorkflowDelegateContext`](../interfaces/WorkflowDelegateContext.md) - -## Returns - -`Promise`\<[`WorkflowDelegateResult`](../interfaces/WorkflowDelegateResult.md)\> diff --git a/docs/api/workflow/type-aliases/WorkflowReviewerDelegate.md b/docs/api/workflow/type-aliases/WorkflowReviewerDelegate.md deleted file mode 100644 index 6b1da92..0000000 --- a/docs/api/workflow/type-aliases/WorkflowReviewerDelegate.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowReviewerDelegate - -# Type Alias: WorkflowReviewerDelegate - -> **WorkflowReviewerDelegate** = (`input`, `options`, `ctx`) => `Promise`\<[`WorkflowDelegateResult`](../interfaces/WorkflowDelegateResult.md)\> - -Defined in: [workflow/types.ts:145](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L145) - -## Parameters - -### input - -`unknown` - -### options - -[`WorkflowCheckpointOptions`](../interfaces/WorkflowCheckpointOptions.md) - -### ctx - -[`WorkflowDelegateContext`](../interfaces/WorkflowDelegateContext.md) - -## Returns - -`Promise`\<[`WorkflowDelegateResult`](../interfaces/WorkflowDelegateResult.md)\> diff --git a/docs/api/workflow/type-aliases/WorkflowSandboxAgentProfileResolver.md b/docs/api/workflow/type-aliases/WorkflowSandboxAgentProfileResolver.md deleted file mode 100644 index d97fcfd..0000000 --- a/docs/api/workflow/type-aliases/WorkflowSandboxAgentProfileResolver.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowSandboxAgentProfileResolver - -# Type Alias: WorkflowSandboxAgentProfileResolver - -> **WorkflowSandboxAgentProfileResolver** = `AgentProfile` \| ((`prompt`, `options`, `ctx`) => `AgentProfile`) - -Defined in: [workflow/agent-delegate.ts:26](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L26) diff --git a/docs/api/workflow/type-aliases/WorkflowSandboxAgentStream.md b/docs/api/workflow/type-aliases/WorkflowSandboxAgentStream.md deleted file mode 100644 index 2f4c4ef..0000000 --- a/docs/api/workflow/type-aliases/WorkflowSandboxAgentStream.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowSandboxAgentStream - -# Type Alias: WorkflowSandboxAgentStream - -> **WorkflowSandboxAgentStream** = `"prompt"` \| `"task"` - -Defined in: [workflow/agent-delegate.ts:24](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L24) diff --git a/docs/api/workflow/type-aliases/WorkflowSandboxPromptOptionsResolver.md b/docs/api/workflow/type-aliases/WorkflowSandboxPromptOptionsResolver.md deleted file mode 100644 index 71ad096..0000000 --- a/docs/api/workflow/type-aliases/WorkflowSandboxPromptOptionsResolver.md +++ /dev/null @@ -1,17 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowSandboxPromptOptionsResolver - -# Type Alias: WorkflowSandboxPromptOptionsResolver\ - -> **WorkflowSandboxPromptOptionsResolver**\<`TOptions`\> = `TOptions` \| ((`prompt`, `options`, `ctx`) => `TOptions`) - -Defined in: [workflow/agent-delegate.ts:30](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/agent-delegate.ts#L30) - -## Type Parameters - -### TOptions - -`TOptions` *extends* `PromptOptions` diff --git a/docs/api/workflow/type-aliases/WorkflowTraceEvent.md b/docs/api/workflow/type-aliases/WorkflowTraceEvent.md deleted file mode 100644 index 32858e0..0000000 --- a/docs/api/workflow/type-aliases/WorkflowTraceEvent.md +++ /dev/null @@ -1,11 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowTraceEvent - -# Type Alias: WorkflowTraceEvent - -> **WorkflowTraceEvent** = \{ `kind`: `"workflow.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowStartedPayload`](../interfaces/WorkflowStartedPayload.md); \} \| \{ `kind`: `"workflow.phase"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowPhasePayload`](../interfaces/WorkflowPhasePayload.md); \} \| \{ `kind`: `"workflow.log"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowLogPayload`](../interfaces/WorkflowLogPayload.md); \} \| \{ `kind`: `"workflow.parallel.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowParallelStartedPayload`](../interfaces/WorkflowParallelStartedPayload.md); \} \| \{ `kind`: `"workflow.parallel.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowParallelEndedPayload`](../interfaces/WorkflowParallelEndedPayload.md); \} \| \{ `kind`: `"workflow.pipeline.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowPipelineStartedPayload`](../interfaces/WorkflowPipelineStartedPayload.md); \} \| \{ `kind`: `"workflow.pipeline.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowPipelineEndedPayload`](../interfaces/WorkflowPipelineEndedPayload.md); \} \| \{ `kind`: `"workflow.branch.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowBranchStartedPayload`](../interfaces/WorkflowBranchStartedPayload.md); \} \| \{ `kind`: `"workflow.branch.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowBranchEndedPayload`](../interfaces/WorkflowBranchEndedPayload.md); \} \| \{ `kind`: `"workflow.branch.failed"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowBranchFailedPayload`](../interfaces/WorkflowBranchFailedPayload.md); \} \| \{ `kind`: `"workflow.agent.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowAgentStartedPayload`](../interfaces/WorkflowAgentStartedPayload.md); \} \| \{ `kind`: `"workflow.agent.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowAgentEndedPayload`](../interfaces/WorkflowAgentEndedPayload.md); \} \| \{ `kind`: `"workflow.agent.failed"`; `runId`: `string`; `timestamp`: `number`; `payload`: `WorkflowDelegateFailedPayload`; \} \| \{ `kind`: `"workflow.loop.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowLoopStartedPayload`](../interfaces/WorkflowLoopStartedPayload.md); \} \| \{ `kind`: `"workflow.loop.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowLoopEndedPayload`](../interfaces/WorkflowLoopEndedPayload.md); \} \| \{ `kind`: `"workflow.loop.failed"`; `runId`: `string`; `timestamp`: `number`; `payload`: `WorkflowDelegateFailedPayload`; \} \| \{ `kind`: `"workflow.verifier.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowCheckpointStartedPayload`](../interfaces/WorkflowCheckpointStartedPayload.md); \} \| \{ `kind`: `"workflow.verifier.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowCheckpointEndedPayload`](../interfaces/WorkflowCheckpointEndedPayload.md); \} \| \{ `kind`: `"workflow.verifier.failed"`; `runId`: `string`; `timestamp`: `number`; `payload`: `WorkflowDelegateFailedPayload`; \} \| \{ `kind`: `"workflow.analyst.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowCheckpointStartedPayload`](../interfaces/WorkflowCheckpointStartedPayload.md); \} \| \{ `kind`: `"workflow.analyst.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowCheckpointEndedPayload`](../interfaces/WorkflowCheckpointEndedPayload.md); \} \| \{ `kind`: `"workflow.analyst.failed"`; `runId`: `string`; `timestamp`: `number`; `payload`: `WorkflowDelegateFailedPayload`; \} \| \{ `kind`: `"workflow.reviewer.started"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowCheckpointStartedPayload`](../interfaces/WorkflowCheckpointStartedPayload.md); \} \| \{ `kind`: `"workflow.reviewer.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowCheckpointEndedPayload`](../interfaces/WorkflowCheckpointEndedPayload.md); \} \| \{ `kind`: `"workflow.reviewer.failed"`; `runId`: `string`; `timestamp`: `number`; `payload`: `WorkflowDelegateFailedPayload`; \} \| \{ `kind`: `"workflow.failed"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowFailedPayload`](../interfaces/WorkflowFailedPayload.md); \} \| \{ `kind`: `"workflow.ended"`; `runId`: `string`; `timestamp`: `number`; `payload`: [`WorkflowEndedPayload`](../interfaces/WorkflowEndedPayload.md); \} - -Defined in: [workflow/types.ts:151](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L151) diff --git a/docs/api/workflow/type-aliases/WorkflowVerifierDelegate.md b/docs/api/workflow/type-aliases/WorkflowVerifierDelegate.md deleted file mode 100644 index 51722cc..0000000 --- a/docs/api/workflow/type-aliases/WorkflowVerifierDelegate.md +++ /dev/null @@ -1,29 +0,0 @@ -[**@tangle-network/agent-runtime**](../../README.md) - -*** - -[@tangle-network/agent-runtime](../../README.md) / [workflow](../README.md) / WorkflowVerifierDelegate - -# Type Alias: WorkflowVerifierDelegate - -> **WorkflowVerifierDelegate** = (`input`, `options`, `ctx`) => `Promise`\<[`WorkflowDelegateResult`](../interfaces/WorkflowDelegateResult.md)\> - -Defined in: [workflow/types.ts:133](https://github.com/tangle-network/agent-runtime/blob/main/src/workflow/types.ts#L133) - -## Parameters - -### input - -`unknown` - -### options - -[`WorkflowCheckpointOptions`](../interfaces/WorkflowCheckpointOptions.md) - -### ctx - -[`WorkflowDelegateContext`](../interfaces/WorkflowDelegateContext.md) - -## Returns - -`Promise`\<[`WorkflowDelegateResult`](../interfaces/WorkflowDelegateResult.md)\> diff --git a/scripts/check-docs-freshness.mjs b/scripts/check-docs-freshness.mjs index 6e41de0..4533928 100644 --- a/scripts/check-docs-freshness.mjs +++ b/scripts/check-docs-freshness.mjs @@ -102,23 +102,26 @@ function sourceFilesUnder(dir, acc = []) { return acc } -// Every symbol that has a generated page under docs/api///.md. -// This is the authoritative set of what TypeDoc actually resolved as a public export. +// Every symbol TypeDoc resolved as a public export, read from the generated API pages. +// Output is one markdown file per MODULE (typedoc.json outputFileStrategy: modules); each +// export/member is a heading (### Name / #### method). Walking headings (not filenames) makes +// this robust to either output strategy (per-module flat files OR per-symbol nested files). function exportsFromApiIndex(root) { const names = new Set() if (!existsSync(root)) return names - const kinds = ['functions', 'classes', 'interfaces', 'type-aliases', 'variables', 'enumerations'] - for (const moduleDir of readdirSync(root)) { - const modPath = join(root, moduleDir) - if (!statSync(modPath).isDirectory()) continue - for (const kind of kinds) { - const kindPath = join(modPath, kind) - if (!existsSync(kindPath)) continue - for (const f of readdirSync(kindPath)) { - if (f.endsWith('.md')) names.add(f.slice(0, -3)) + const walk = (dir) => { + for (const e of readdirSync(dir, { withFileTypes: true })) { + const p = join(dir, e.name) + if (e.isDirectory()) { + walk(p) + } else if (e.name.endsWith('.md')) { + const md = readFileSync(p, 'utf8') + // h3..h6 headings are symbols/members; h2 are category sections (Functions/Classes/…). + for (const m of md.matchAll(/^#{3,6}\s+`?([A-Za-z_$][\w$]*)/gm)) names.add(m[1]) } } } + walk(root) return names } diff --git a/typedoc.json b/typedoc.json index e612f84..2f0a177 100644 --- a/typedoc.json +++ b/typedoc.json @@ -16,7 +16,9 @@ ], "entryPointStrategy": "resolve", "tsconfig": "./tsconfig.json", - "plugin": ["typedoc-plugin-markdown"], + "plugin": [ + "typedoc-plugin-markdown" + ], "out": "docs/api", "readme": "none", "excludePrivate": true, @@ -35,6 +37,9 @@ "disableSources": false, "hideGenerator": true, "skipErrorChecking": true, - "sort": ["source-order"], - "githubPages": false + "sort": [ + "source-order" + ], + "githubPages": false, + "outputFileStrategy": "modules" }