Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api/agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ Canonical agent profile — the same one the prod chat turn uses.

##### sandboxClient

> **sandboxClient**: [`SandboxClient`](runtime.md#sandboxclient-1)
> **sandboxClient**: [`SandboxClient`](runtime.md#sandboxclient-2)

Defined in: [agent/sandbox-act.ts:51](https://github.com/tangle-network/agent-runtime/blob/main/src/agent/sandbox-act.ts#L51)

Expand Down
12 changes: 6 additions & 6 deletions docs/api/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ Defined in: [mcp/bin-helpers.ts:20](https://github.com/tangle-network/agent-runt

##### sandboxClient

> **sandboxClient**: [`SandboxClient`](runtime.md#sandboxclient-1)
> **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)

Expand Down Expand Up @@ -709,7 +709,7 @@ shape against the structural `FleetHandle` contract.

###### client

[`SandboxClient`](runtime.md#sandboxclient-1)
[`SandboxClient`](runtime.md#sandboxclient-2)

###### fleetId

Expand Down Expand Up @@ -878,7 +878,7 @@ one or the other, not both.

##### sandboxClient?

> `optional` **sandboxClient?**: [`SandboxClient`](runtime.md#sandboxclient-1)
> `optional` **sandboxClient?**: [`SandboxClient`](runtime.md#sandboxclient-2)

Defined in: [mcp/delegates.ts:148](https://github.com/tangle-network/agent-runtime/blob/main/src/mcp/delegates.ts#L148)

Expand Down Expand Up @@ -1526,7 +1526,7 @@ Defined in: [mcp/detached-turn.ts:166](https://github.com/tangle-network/agent-r

##### client

> **client**: [`SandboxClient`](runtime.md#sandboxclient-1)
> **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)

Expand Down Expand Up @@ -1781,7 +1781,7 @@ Defined in: [mcp/executor.ts:25](https://github.com/tangle-network/agent-runtime

##### client

> `readonly` **client**: [`SandboxClient`](runtime.md#sandboxclient-1)
> `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)

Expand Down Expand Up @@ -1831,7 +1831,7 @@ Defined in: [mcp/executor.ts:41](https://github.com/tangle-network/agent-runtime

##### client

> **client**: [`SandboxClient`](runtime.md#sandboxclient-1)
> **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)

Expand Down
4 changes: 3 additions & 1 deletion docs/api/primitive-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ Import from `@tangle-network/agent-runtime/intelligence` — 60 exports.

### Recursive atom + loop kernel (alias of ./runtime)

Import from `@tangle-network/agent-runtime/loops` — 386 exports.
Import from `@tangle-network/agent-runtime/loops` — 388 exports.

| Symbol | Kind | Summary |
|---|---|---|
Expand Down Expand Up @@ -396,6 +396,7 @@ Import from `@tangle-network/agent-runtime/loops` — 386 exports.
| `inProcessSandboxClient` | function | Adapt a single `onPrompt(prompt, ctx)` callback into a `SandboxClient` for |
| `jjWorkspace` | function | A jj-backed `Workspace` (Jujutsu, colocated with git for the durable remote). |
| `localShell` | function | _(no summary — add a TSDoc line at the declaration)_ |
| `loopCampaignDispatch` | function | Adapter for plain `runCampaign` scenarios. This is the runtime-side pair for |
| `loopDispatch` | function | Adapter for `runProfileMatrix` (profile is an axis). Returns a |
| `loopUntil` | function | `loopUntil(seed, spec)` — one `step` child per round; `fold` accumulates each settlement into |
| `makeFinding` | function | Convenience factory: produce a fully-formed AnalystFinding with the |
Expand Down Expand Up @@ -565,6 +566,7 @@ Import from `@tangle-network/agent-runtime/loops` — 386 exports.
| `InProcessSandboxClientOptions` | interface | _(no summary — add a TSDoc line at the declaration)_ |
| `IntentAudit` | interface | _(no summary — add a TSDoc line at the declaration)_ |
| `Iteration` | interface | _(no summary — add a TSDoc line at the declaration)_ |
| `LoopCampaignDispatchOptions` | interface | Options for adapting plain agent-eval campaign scenarios into runtime `runLoop` cells. |
| `LoopDecisionPayload` | interface | _(no summary — add a TSDoc line at the declaration)_ |
| `LoopDispatchOptions` | interface | _(no summary — add a TSDoc line at the declaration)_ |
| `LoopEndedPayload` | interface | _(no summary — add a TSDoc line at the declaration)_ |
Expand Down
2 changes: 1 addition & 1 deletion docs/api/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,7 @@ Render a `CoderTask` into the per-task instruction handed to the coder profile.

### createInProcessUiAuditClient()

> **createInProcessUiAuditClient**(`options`): [`SandboxClient`](runtime.md#sandboxclient-1) & `object`
> **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)

Expand Down
172 changes: 154 additions & 18 deletions docs/api/runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ tags, so set it when a demo's output reads on a meaningful sandbox id.

### LoopDispatchOptions

Defined in: [runtime/loop-dispatch.ts:49](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L49)
Defined in: [runtime/loop-dispatch.ts:50](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L50)

#### Type Parameters

Expand Down Expand Up @@ -1166,17 +1166,17 @@ Defined in: [runtime/loop-dispatch.ts:49](https://github.com/tangle-network/agen

##### sandboxClient

> **sandboxClient**: [`SandboxClient`](#sandboxclient-1)
> **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)
Defined in: [runtime/loop-dispatch.ts:58](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L58)

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)
Defined in: [runtime/loop-dispatch.ts:61](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L61)

Build the per-cell runLoop options from the scenario (+ profile, when
used with `runProfileMatrix`).
Expand All @@ -1199,7 +1199,7 @@ Build the per-cell runLoop options from the scenario (+ profile, when

> `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)
Defined in: [runtime/loop-dispatch.ts:69](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L69)

Map the finished loop to the artifact the judges score. Default:
`result.winner?.output`. A loop with no winner yields `undefined` (judges
Expand All @@ -1220,7 +1220,7 @@ Map the finished loop to the artifact the judges score. Default:

> `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)
Defined in: [runtime/loop-dispatch.ts:72](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L72)

Forward `loop.*` trace events into the campaign's scoped trace so loop
spans correlate with the cell. Default true.
Expand All @@ -1229,7 +1229,99 @@ Forward `loop.*` trace events into the campaign's scoped trace so loop

> `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)
Defined in: [runtime/loop-dispatch.ts:74](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L74)

Cost-meter source label for the loop's spend. Default `'loop'`.

***

### LoopCampaignDispatchOptions

Defined in: [runtime/loop-dispatch.ts:124](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L124)

Options for adapting plain agent-eval campaign scenarios into runtime `runLoop` cells.

#### 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:132](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L132)

Sandbox client used for every campaign cell's `runLoop`.

##### toLoopOptions

> **toLoopOptions**: (`scenario`) => [`LoopOptionsForDispatch`](#loopoptionsfordispatch)\<`Task`, `Output`, `Decision`\>

Defined in: [runtime/loop-dispatch.ts:134](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L134)

Build the per-cell runLoop options from the campaign scenario.

###### Parameters

###### scenario

`TScenario`

###### Returns

[`LoopOptionsForDispatch`](#loopoptionsfordispatch)\<`Task`, `Output`, `Decision`\>

##### toArtifact?

> `optional` **toArtifact?**: (`result`) => `TArtifact`

Defined in: [runtime/loop-dispatch.ts:136](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L136)

Map the finished loop to the artifact the campaign judges score.

###### Parameters

###### result

[`LoopResult`](#loopresult)\<`Task`, `Output`, `Decision`\>

###### Returns

`TArtifact`

##### forwardTrace?

> `optional` **forwardTrace?**: `boolean`

Defined in: [runtime/loop-dispatch.ts:138](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L138)

Forward `loop.*` trace events into the campaign's scoped trace. Default true.

##### costSource?

> `optional` **costSource?**: `string`

Defined in: [runtime/loop-dispatch.ts:140](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L140)

Cost-meter source label for the loop's spend. Default `'loop'`.

Expand Down Expand Up @@ -11758,7 +11850,7 @@ Defined in: [runtime/types.ts:556](https://github.com/tangle-network/agent-runti

##### sandboxClient

> **sandboxClient**: [`SandboxClient`](#sandboxclient-1)
> **sandboxClient**: [`SandboxClient`](#sandboxclient-2)

Defined in: [runtime/types.ts:558](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/types.ts#L558)

Expand Down Expand Up @@ -12326,7 +12418,7 @@ async iterable for streaming. The callback may also write files into

> **LoopOptionsForDispatch**\<`Task`, `Output`, `Decision`\> = `Omit`\<`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)
Defined in: [runtime/loop-dispatch.ts:45](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L45)

runLoop options minus the `ctx` (loopDispatch builds the ctx).

Expand Down Expand Up @@ -13696,7 +13788,7 @@ Defined in: [runtime/harvest-corpus.ts:62](https://github.com/tangle-network/age

### inProcessSandboxClient()

> **inProcessSandboxClient**(`options`): [`SandboxClient`](#sandboxclient-1)
> **inProcessSandboxClient**(`options`): [`SandboxClient`](#sandboxclient-2)

Defined in: [runtime/in-process-sandbox-client.ts:98](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/in-process-sandbox-client.ts#L98)

Expand All @@ -13715,13 +13807,13 @@ this function, so call sites stay cast-free.

#### Returns

[`SandboxClient`](#sandboxclient-1)
[`SandboxClient`](#sandboxclient-2)

***

### inlineSandboxClient()

> **inlineSandboxClient**(`factory`): [`SandboxClient`](#sandboxclient-1)
> **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)

Expand All @@ -13737,15 +13829,59 @@ run once on the prompt, emit the terminal result event, tear down.

#### Returns

[`SandboxClient`](#sandboxclient-1)
[`SandboxClient`](#sandboxclient-2)

***

### loopCampaignDispatch()

> **loopCampaignDispatch**\<`Task`, `Output`, `Decision`, `TScenario`, `TArtifact`\>(`opts`): `DispatchFn`\<`TScenario`, `TArtifact`\>

Defined in: [runtime/loop-dispatch.ts:148](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L148)

Adapter for plain `runCampaign` scenarios. This is the runtime-side pair for
agent-eval fixture scenarios: load fixtures in `agent-eval/campaign`, build
the runtime loop here, and keep cost + token + trace reporting automatic.

#### Type Parameters

##### Task

`Task`

##### Output

`Output`

##### Decision

`Decision`

##### TScenario

`TScenario` *extends* `Scenario`

##### TArtifact

`TArtifact`

#### Parameters

##### opts

[`LoopCampaignDispatchOptions`](#loopcampaigndispatchoptions)\<`Task`, `Output`, `Decision`, `TScenario`, `TArtifact`\>

#### Returns

`DispatchFn`\<`TScenario`, `TArtifact`\>

***

### 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)
Defined in: [runtime/loop-dispatch.ts:159](https://github.com/tangle-network/agent-runtime/blob/main/src/runtime/loop-dispatch.ts#L159)

Adapter for `runProfileMatrix` (profile is an axis). Returns a
`ProfileDispatchFn` that runs `runLoop` per (profile, scenario) cell and
Expand Down Expand Up @@ -14839,7 +14975,7 @@ Defined in: [runtime/sandbox-acquire.ts:68](https://github.com/tangle-network/ag

##### client

[`SandboxClient`](#sandboxclient-1)
[`SandboxClient`](#sandboxclient-2)

##### options

Expand Down Expand Up @@ -14872,7 +15008,7 @@ promise is cached so concurrent fanout branches share one round-trip.

##### client

[`SandboxClient`](#sandboxclient-1)
[`SandboxClient`](#sandboxclient-2)

#### Returns

Expand Down Expand Up @@ -14971,7 +15107,7 @@ and the lineage stays a pure function of "what this platform can do".

##### client

[`SandboxClient`](#sandboxclient-1)
[`SandboxClient`](#sandboxclient-2)

##### capabilities

Expand Down Expand Up @@ -15023,7 +15159,7 @@ kimi-code all flow through this one entrypoint with identical env/auth wiring.

##### client

[`SandboxClient`](#sandboxclient-1)
[`SandboxClient`](#sandboxclient-2)

##### options

Expand Down
Loading
Loading