@tangle-network/agent-runtime 0.88.0 → 0.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -18
- package/dist/agent.d.ts +53 -2
- package/dist/agent.js +166 -4
- package/dist/agent.js.map +1 -1
- package/dist/analyst-loop.d.ts +1 -1
- package/dist/{chunk-22HPUH77.js → chunk-4IBAMGBE.js} +170 -269
- package/dist/chunk-4IBAMGBE.js.map +1 -0
- package/dist/chunk-5QOB7H74.js +387 -0
- package/dist/chunk-5QOB7H74.js.map +1 -0
- package/dist/chunk-74SBMDTO.js +214 -0
- package/dist/chunk-74SBMDTO.js.map +1 -0
- package/dist/{chunk-HBE77SWV.js → chunk-MHK62APK.js} +5 -5
- package/dist/{chunk-LRNRPJAV.js → chunk-QSNSMJSZ.js} +2622 -2842
- package/dist/chunk-QSNSMJSZ.js.map +1 -0
- package/dist/{chunk-VNOOH22O.js → chunk-XMOU4WEY.js} +74 -3
- package/dist/chunk-XMOU4WEY.js.map +1 -0
- package/dist/{chunk-JHULWWQD.js → chunk-XQEISTK2.js} +2 -2
- package/dist/{worktree-harness-CX_McRLp.d.ts → completion-gate-BDaBP8dd.d.ts} +44 -44
- package/dist/{coordination-CuDLO8wj.d.ts → coordination-DxHduZg7.d.ts} +414 -226
- package/dist/environment-provider.d.ts +3 -3
- package/dist/index.d.ts +156 -13
- package/dist/index.js +316 -70
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +2 -2
- package/dist/knowledge.d.ts +120 -0
- package/dist/knowledge.js +28 -0
- package/dist/knowledge.js.map +1 -0
- package/dist/lifecycle.js +1 -1
- package/dist/{loop-runner-bin-hQDUL8Ld.d.ts → loop-runner-bin-D3GmB2Ru.d.ts} +2 -2
- package/dist/loop-runner-bin.d.ts +5 -5
- package/dist/loop-runner-bin.js +5 -5
- package/dist/loops.d.ts +46 -324
- package/dist/loops.js +3 -15
- package/dist/mcp/bin.js +2 -2
- package/dist/mcp/index.d.ts +8 -9
- package/dist/mcp/index.js +7 -7
- package/dist/{openai-tools-BnrOmGjN.d.ts → openai-tools-D0xmzo0y.d.ts} +1 -1
- package/dist/profiles.d.ts +196 -5
- package/dist/profiles.js +8 -0
- package/dist/profiles.js.map +1 -1
- package/dist/{router-client-r8y_VFVM.d.ts → router-client-DJImUDlm.d.ts} +1 -1
- package/dist/supervise-BpCdssu0.d.ts +131 -0
- package/dist/{types-Driepl87.d.ts → types-DAJQRIUD.d.ts} +2 -2
- package/dist/{types-ESeMOj94.d.ts → types-Dnk189QA.d.ts} +1 -1
- package/dist/{worktree-fanout-D6xR2CIA.d.ts → worktree-fanout-CfRXYmgV.d.ts} +3 -3
- package/package.json +12 -4
- package/skills/agent-runtime-adoption/SKILL.md +74 -24
- package/skills/build-with-agent-runtime/SKILL.md +3 -9
- package/skills/loop-writer/SKILL.md +6 -78
- package/skills/supervise/SKILL.md +2 -2
- package/dist/chunk-22HPUH77.js.map +0 -1
- package/dist/chunk-LRNRPJAV.js.map +0 -1
- package/dist/chunk-VNOOH22O.js.map +0 -1
- package/dist/otel-export-BKmNwiCb.d.ts +0 -180
- /package/dist/{chunk-HBE77SWV.js.map → chunk-MHK62APK.js.map} +0 -0
- /package/dist/{chunk-JHULWWQD.js.map → chunk-XQEISTK2.js.map} +0 -0
package/dist/loops.d.ts
CHANGED
|
@@ -2,26 +2,27 @@ import { ChatClient, RunRecord, HarnessType, AgentProfile, AnalystFinding, Analy
|
|
|
2
2
|
export { AnalystFinding, DefaultVerdict, computeFindingId, makeFinding } from '@tangle-network/agent-eval';
|
|
3
3
|
import { SandboxEvent, SandboxInstance, CreateSandboxOptions, PromptOptions, TaskOptions } from '@tangle-network/sandbox';
|
|
4
4
|
export { AgentProfile, CreateSandboxOptions, SandboxEvent, SandboxInstance } from '@tangle-network/sandbox';
|
|
5
|
-
import {
|
|
6
|
-
export {
|
|
7
|
-
import {
|
|
8
|
-
export {
|
|
9
|
-
import { R as RuntimeHooks, I as Iteration, S as SandboxClient,
|
|
10
|
-
export { $ as LoopDecisionPayload, a0 as LoopEndedPayload, a1 as LoopIterationDispatchPayload, a2 as LoopIterationEndedPayload, a3 as LoopIterationStartedPayload, a4 as LoopPlanDescription, a5 as LoopPlanPayload, d as LoopSandboxPlacement, a6 as LoopStartedPayload, a7 as LoopTeardownFailedPayload, e as LoopTraceEmitter, c as LoopTraceEvent, a8 as MountManifestEntry, a9 as RunProvenance, aa as SelectionReceipt, ab as ValidationCtx } from './types-
|
|
5
|
+
import { a as ResultBlobStore, f as SpawnJournal, N as NodeId, j as SpawnEvent, E as ExecutorFactory, A as Agent, B as Budget, S as Scope, h as Settled, b as SupervisedResult, i as Spend, U as UsageEvent, e as ExecutorRegistry, k as Supervisor } from './types-DAJQRIUD.js';
|
|
6
|
+
export { d as AgentSpec, c as Executor, l as ExecutorContext, m as ExecutorResult, R as Runtime, n as SupervisorOpts, T as TreeView, W as WidenGate } from './types-DAJQRIUD.js';
|
|
7
|
+
import { M as MakeWorkerAgent, A as AnalystRegistry, o as CoordinationTools, n as CoordinationEvent, as as QuestionPolicy, E as ExecutorConfig } from './coordination-DxHduZg7.js';
|
|
8
|
+
export { bf as BusEvent, bg as BusRecord, bh as BusStats, bi as EventBus, bj as ProviderSeam, bk as PublishOptions, bl as cliWorktreeExecutor, bm as createEventBus, bn as createExecutor, bo as createExecutorRegistry } from './coordination-DxHduZg7.js';
|
|
9
|
+
import { R as RuntimeHooks, I as Iteration, S as SandboxClient, D as Driver, A as AgentRunSpec, b as OutputAdapter, V as Validator, E as ExecCtx, X as LoopWinner, Y as LoopLineageOptions, Z as LoopResult, L as LoopTokenUsage, a as RuntimeStreamEvent, _ as MountRecorder, i as AgentExecutionBackend, o as AgentTaskStatus, B as BackendErrorDetail } from './types-Dnk189QA.js';
|
|
10
|
+
export { $ as LoopDecisionPayload, a0 as LoopEndedPayload, a1 as LoopIterationDispatchPayload, a2 as LoopIterationEndedPayload, a3 as LoopIterationStartedPayload, a4 as LoopPlanDescription, a5 as LoopPlanPayload, d as LoopSandboxPlacement, a6 as LoopStartedPayload, a7 as LoopTeardownFailedPayload, e as LoopTraceEmitter, c as LoopTraceEvent, a8 as MountManifestEntry, a9 as RunProvenance, aa as SelectionReceipt, ab as ValidationCtx } from './types-Dnk189QA.js';
|
|
11
11
|
import { RunProfileMatrixResult, Scenario, ProfileDispatchFn, JudgeConfig, RunProfileMatrixOptions, DispatchFn } from '@tangle-network/agent-eval/campaign';
|
|
12
12
|
export { AgentEnvironmentProviderRef, AgentEnvironmentProviderRegistry, ProviderAsSandboxClientOptions, ProviderExecutorOptions, SandboxClientProviderOptions, createAgentEnvironmentProviderRegistry, providerAsExecutor, providerAsSandboxClient, resolveAgentEnvironmentProvider, sandboxClientAsProvider } from './environment-provider.js';
|
|
13
|
-
import { C as CorpusRecord, c as Corpus, O as Outcome, S as ScopeAnalyzeInput, d as AssertTraceDerivedFindings, e as SteerContext, f as ScopeAnalyst, F as FanoutOptions, g as CombinatorShape, h as ScopeWidenGate, L as LoopUntilSpec, P as PanelSpec, i as PipelineStage, W as WinnerStrategy, j as FanoutWinnerSelector, V as VerifySpec, k as WidenSpec, l as CorpusFilter, R as RenderCorpusToInstructionsOptions, D as DefinePersonaInput, m as Persona, n as RunPersonifiedOptions, o as ShapeRegistry, p as LoopShape, E as EqualKArm, q as EqualKOnCostOptions, r as EqualKVerdict, T as TrajectoryReportOptions, s as TrajectoryReport } from './worktree-fanout-
|
|
14
|
-
export { A as AuthoredHarness, t as DefinePersona, u as EqualKOnCost, v as Fanout, w as FanoutSynthesis, x as FlatWidenGate, y as LoopUntil, z as LoopUntilState, B as Panel, G as PanelJudge, H as PanelVerdict, I as PatchDeliverableOptions, J as PersonaContext, K as PersonaExecutors, M as Pipeline, N as RenderCorpusToInstructions, Q as RunPersonified, U as ShapeBudget, X as ShapeContext, Y as TrajectoryNode, Z as TrajectoryReportFn, _ as Verify, $ as Widen, a0 as WidenDecision, a1 as WidenLineage, a2 as WorktreeCliExecutorOptions, a as WorktreeFanoutOptions, b as WorktreePatchArtifact, a3 as createWorktreeCliExecutor, a4 as patchDelivered, a5 as worktreeFanout } from './worktree-fanout-
|
|
13
|
+
import { C as CorpusRecord, c as Corpus, O as Outcome, S as ScopeAnalyzeInput, d as AssertTraceDerivedFindings, e as SteerContext, f as ScopeAnalyst, F as FanoutOptions, g as CombinatorShape, h as ScopeWidenGate, L as LoopUntilSpec, P as PanelSpec, i as PipelineStage, W as WinnerStrategy, j as FanoutWinnerSelector, V as VerifySpec, k as WidenSpec, l as CorpusFilter, R as RenderCorpusToInstructionsOptions, D as DefinePersonaInput, m as Persona, n as RunPersonifiedOptions, o as ShapeRegistry, p as LoopShape, E as EqualKArm, q as EqualKOnCostOptions, r as EqualKVerdict, T as TrajectoryReportOptions, s as TrajectoryReport } from './worktree-fanout-CfRXYmgV.js';
|
|
14
|
+
export { A as AuthoredHarness, t as DefinePersona, u as EqualKOnCost, v as Fanout, w as FanoutSynthesis, x as FlatWidenGate, y as LoopUntil, z as LoopUntilState, B as Panel, G as PanelJudge, H as PanelVerdict, I as PatchDeliverableOptions, J as PersonaContext, K as PersonaExecutors, M as Pipeline, N as RenderCorpusToInstructions, Q as RunPersonified, U as ShapeBudget, X as ShapeContext, Y as TrajectoryNode, Z as TrajectoryReportFn, _ as Verify, $ as Widen, a0 as WidenDecision, a1 as WidenLineage, a2 as WorktreeCliExecutorOptions, a as WorktreeFanoutOptions, b as WorktreePatchArtifact, a3 as createWorktreeCliExecutor, a4 as patchDelivered, a5 as worktreeFanout } from './worktree-fanout-CfRXYmgV.js';
|
|
15
15
|
import { b as AnalystRegistryLike } from './types-BC3bZpH0.js';
|
|
16
16
|
import { AgentProfile as AgentProfile$1 } from '@tangle-network/agent-interface';
|
|
17
|
-
import { R as RouterConfig,
|
|
18
|
-
export { c as RouterChatResult, d as RouterChatToolsResult, e as RouterToolCall, f as RouterToolLoopResult, g as ToolLoopCompaction,
|
|
19
|
-
import { D as DeliverableSpec } from './
|
|
20
|
-
export { g as WorktreeCommandResult, h as gateOnDeliverable } from './
|
|
17
|
+
import { R as RouterConfig, T as ToolLoopChat, a as ToolLoopCompactionOptions } from './router-client-DJImUDlm.js';
|
|
18
|
+
export { c as RouterChatResult, d as RouterChatToolsResult, e as RouterToolCall, f as RouterToolLoopResult, g as ToolLoopCompaction, b as ToolSpec, r as routerBrain, h as routerChatWithTools, i as routerChatWithUsage, j as routerToolLoop } from './router-client-DJImUDlm.js';
|
|
19
|
+
import { D as DeliverableSpec } from './completion-gate-BDaBP8dd.js';
|
|
20
|
+
export { g as WorktreeCommandResult, h as gateOnDeliverable } from './completion-gate-BDaBP8dd.js';
|
|
21
|
+
import { S as SupervisorProfile } from './supervise-BpCdssu0.js';
|
|
22
|
+
export { D as DriveHarness, a as SuperviseOptions, b as SupervisorAgentDeps, s as supervise, c as supervisorAgent, w as workerFromBackend } from './supervise-BpCdssu0.js';
|
|
21
23
|
import { stuckLoopView, toolWasteView } from '@tangle-network/agent-eval/pipelines';
|
|
22
24
|
export { AgentEnvironment, AgentEnvironmentCapabilities, AgentEnvironmentEvent, AgentEnvironmentProvider, AgentEnvironmentQuery, AgentEnvironmentStatus, AgentEnvironmentSummary, AgentProfileRef, AgentSession, AgentSessionRef, AgentSessionStatus, AgentTurnInput, AgentTurnResult, CheckpointRef, CheckpointRequest, CreateAgentEnvironmentInput, ExecRequest, ExecResult, ForkRequest, PlacementInfo, ResourceRequest, WorkspaceRequest } from '@tangle-network/agent-interface/environment-provider';
|
|
23
25
|
import './substrate-DO2GHNg2.js';
|
|
24
|
-
import './otel-export-BKmNwiCb.js';
|
|
25
26
|
import './local-harness-sI0S_XNA.js';
|
|
26
27
|
import 'node:child_process';
|
|
27
28
|
|
|
@@ -879,182 +880,6 @@ declare function inProcessSandboxClient(options: InProcessSandboxClientOptions):
|
|
|
879
880
|
*/
|
|
880
881
|
declare function inlineSandboxClient(factory: ExecutorFactory<unknown>): SandboxClient;
|
|
881
882
|
|
|
882
|
-
/**
|
|
883
|
-
*
|
|
884
|
-
* The loop-executor — a spawnable, budget-conserving, gated, STEERABLE multi-round loop
|
|
885
|
-
* as a first-class atom, the sibling of the recursive driver-executor.
|
|
886
|
-
*
|
|
887
|
-
* A leaf worker runs one turn and settles. A driver child (driver-executor.ts) runs an
|
|
888
|
-
* LLM brain that spawns children and reacts. A LOOP child is the third shape: a CODED loop
|
|
889
|
-
* whose control flow is written, not left to a model's judgment. On `execute` it mounts a
|
|
890
|
-
* NESTED `Scope` (via the same `nested-scope` seam the driver-executor uses) one `depth`
|
|
891
|
-
* deeper over the SAME conserved pool + shared journal/blobs + open registry, then runs the
|
|
892
|
-
* authored loop's `round(ctx)` up to `maxRounds` times. Each round may spawn children into
|
|
893
|
-
* that nested scope (conserved budget, depth-bounded), and the runtime — not the authored
|
|
894
|
-
* body — owns the three guarantees a "loop" must make:
|
|
895
|
-
*
|
|
896
|
-
* - BOUNDED: at most `maxRounds` rounds; the run-wide conserved pool still fails a spawn
|
|
897
|
-
* closed at any depth, so a loop can never overspend the root ceiling.
|
|
898
|
-
* - GATED: the loop settles `valid` iff its deployable `check(out)` passes (the completion
|
|
899
|
-
* oracle, same discipline as `gateOnDeliverable`). A loop that exhausts `maxRounds`
|
|
900
|
-
* without the check ever passing settles `valid: false` — ran, did not deliver.
|
|
901
|
-
* - STEERABLE: the executor owns an `Inbox` and exposes `deliver`, so a supervisor's
|
|
902
|
-
* `steer_agent` (→ `Scope.send` → this `deliver`) lands between rounds. Queued messages
|
|
903
|
-
* fold into the next round's `ctx.steer`; a forceful `interrupt` aborts the in-flight
|
|
904
|
-
* round's linked signal so the loop re-plans immediately with the message folded in.
|
|
905
|
-
*
|
|
906
|
-
* Why this preserves every keystone invariant: identical to the driver-executor — the SCOPE
|
|
907
|
-
* owns the sharing (nested scope over `args.pool`, one `SpawnJournal` tree per child), this
|
|
908
|
-
* executor only runs the coded loop over what the scope mounts and rolls the sub-tree's
|
|
909
|
-
* conserved spend up on settle. It builds NO new budget, journal, or selection logic.
|
|
910
|
-
*
|
|
911
|
-
* The authored loop body is `defineLoop(name, { maxRounds, round, check })`. `round` is
|
|
912
|
-
* ordinary code — arbitrary composition inside a round (spawn one child, fan out many,
|
|
913
|
-
* pipeline) — while the runtime owns iteration, the budget, the gate, and steer-folding.
|
|
914
|
-
* So a loop is "codemode" (the author writes control flow) yet structurally bounded.
|
|
915
|
-
*
|
|
916
|
-
* @experimental
|
|
917
|
-
*/
|
|
918
|
-
|
|
919
|
-
/** The runtime tag the registry maps a loop child to. */
|
|
920
|
-
declare const loopRuntime: "loop";
|
|
921
|
-
/** What one round of a loop receives. The scope is the NESTED scope — spawn conserved
|
|
922
|
-
* children here; budget/depth are enforced by the scope, not the body. */
|
|
923
|
-
interface LoopRoundCtx {
|
|
924
|
-
/** The spawn task, verbatim. */
|
|
925
|
-
readonly task: unknown;
|
|
926
|
-
/** The nested, conserved scope. Spawn children with `scope.spawn`, react with `scope.next`. */
|
|
927
|
-
readonly scope: Scope<unknown>;
|
|
928
|
-
/** 1-based round index. */
|
|
929
|
-
readonly round: number;
|
|
930
|
-
/** The declared ceiling on rounds. */
|
|
931
|
-
readonly maxRounds: number;
|
|
932
|
-
/** Supervisor `steer_agent` messages that arrived since the last round, folded to text. */
|
|
933
|
-
readonly steer: readonly string[];
|
|
934
|
-
/** Conserved-pool readouts (post-reservation) for in-body budget-awareness. */
|
|
935
|
-
readonly budget: Scope<unknown>['budget'];
|
|
936
|
-
/** Abort signal: the spawn signal + nested-scope signal + a fresh per-round interrupt.
|
|
937
|
-
* A forceful steer during the round aborts THIS signal so the body can break and re-plan. */
|
|
938
|
-
readonly signal: AbortSignal;
|
|
939
|
-
}
|
|
940
|
-
/** What a round returns. `out` is the running result; `done: true` stops the loop early
|
|
941
|
-
* (the author's own stop condition, distinct from the runtime's gate `check`). */
|
|
942
|
-
interface LoopRoundResult {
|
|
943
|
-
readonly out: unknown;
|
|
944
|
-
readonly done?: boolean;
|
|
945
|
-
}
|
|
946
|
-
/** An authored coded loop: a name, a round ceiling, the round body, and an optional
|
|
947
|
-
* deployable gate `check`. `check` decides DELIVERED — the loop settles `valid` iff it
|
|
948
|
-
* passes — and is polled after each round to stop as soon as the loop has delivered. */
|
|
949
|
-
interface LoopDef {
|
|
950
|
-
readonly name: string;
|
|
951
|
-
readonly maxRounds: number;
|
|
952
|
-
round(ctx: LoopRoundCtx): Promise<LoopRoundResult>;
|
|
953
|
-
/** The deployable completion oracle. `settled.valid ⟺ this resolves true`. A throwing
|
|
954
|
-
* check is fail-closed (not delivered). Omit for a loop whose only stop is `done`. */
|
|
955
|
-
check?(out: unknown): boolean | Promise<boolean>;
|
|
956
|
-
/** What the loop was supposed to produce — surfaced in traces. */
|
|
957
|
-
readonly describe?: string;
|
|
958
|
-
}
|
|
959
|
-
/** One named agent in a MULTI-AGENT loop (the `agents` form of `defineLoop`). `run` does the
|
|
960
|
-
* agent's work for a round; `prior` is the previous agent's output, or `ctx.task` for the first.
|
|
961
|
-
* The last agent's return is the round's `out`. So a proposer→verifier loop is just two agents. */
|
|
962
|
-
interface LoopAgent {
|
|
963
|
-
/** A short, human name for the agent this plays (proposer, verifier, engineer). */
|
|
964
|
-
readonly name: string;
|
|
965
|
-
run(ctx: LoopRoundCtx, prior: unknown): Promise<unknown>;
|
|
966
|
-
}
|
|
967
|
-
/**
|
|
968
|
-
* Author a coded loop atom. The returned `LoopDef` is handed to `loopChild` to become a
|
|
969
|
-
* spawnable `Agent`. The runtime owns `maxRounds`, the conserved budget, the gate, and
|
|
970
|
-
* steer-folding; you supply ONE of two round shapes:
|
|
971
|
-
*
|
|
972
|
-
* - `round` — freeform: write the whole round yourself (arbitrary code, may spawn children).
|
|
973
|
-
* - `agents` — declarative MULTI-AGENT: an ordered list of named agents piped each round
|
|
974
|
-
* (`task → agents[0] → agents[1] → … → out`). "How many agents" is self-evident from the
|
|
975
|
-
* list, so a two-agent research loop is `agents: [proposer, verifier]` — no bespoke function.
|
|
976
|
-
*
|
|
977
|
-
* Provide EXACTLY one of `round` / `agents`.
|
|
978
|
-
*/
|
|
979
|
-
declare function defineLoop(name: string, spec: {
|
|
980
|
-
maxRounds: number;
|
|
981
|
-
round?: (ctx: LoopRoundCtx) => Promise<LoopRoundResult>;
|
|
982
|
-
agents?: readonly LoopAgent[];
|
|
983
|
-
check?: (out: unknown) => boolean | Promise<boolean>;
|
|
984
|
-
describe?: string;
|
|
985
|
-
}): LoopDef;
|
|
986
|
-
/**
|
|
987
|
-
* Mark + carry an authored loop so the recursive registry resolves it to the
|
|
988
|
-
* loop-executor. The returned agent is SPAWNED (never run directly): its `executorSpec` is
|
|
989
|
-
* marked `role: 'loop'` and carries the `LoopDef` + the shared journal. `act` fails loud if
|
|
990
|
-
* called directly — a loop child runs THROUGH its nested-scope executor, never as a root.
|
|
991
|
-
*/
|
|
992
|
-
declare function loopChild<Out>(loop: LoopDef, journal: SpawnJournal): Agent<unknown, Out>;
|
|
993
|
-
/**
|
|
994
|
-
* Register the loop-executor so a child marked `role: 'loop'` resolves to it. Mirrors
|
|
995
|
-
* `withDriverExecutor`: a loop-role spec → the loop-executor; everything else → the base
|
|
996
|
-
* registry's resolution. Compose it WITH `withDriverExecutor` so loops and drivers coexist:
|
|
997
|
-
* `withLoopExecutor(withDriverExecutor(base))`.
|
|
998
|
-
*/
|
|
999
|
-
declare function withLoopExecutor(base: ExecutorRegistry): ExecutorRegistry;
|
|
1000
|
-
|
|
1001
|
-
/**
|
|
1002
|
-
* authorLoop — the codemode layer over the loop atom: an LLM reads a goal + the defineLoop
|
|
1003
|
-
* contract and WRITES a coded loop as a module; the caller spawns it as a first-class atom
|
|
1004
|
-
* (`loopChild` → the loop-executor) and it settles gated on its own `check`, budget-conserved
|
|
1005
|
-
* and depth-bounded like any spawned child.
|
|
1006
|
-
*
|
|
1007
|
-
* This is to `defineLoop` what `authorStrategy` is to `defineStrategy`: the "supervisor writes
|
|
1008
|
-
* the loop" seam. The authored body composes real code (spawns children on the nested scope,
|
|
1009
|
-
* fans out, pipelines) while the runtime owns iteration, the conserved budget, the gate, and
|
|
1010
|
-
* steer-between-rounds — so an authored loop can be WRONG but cannot overspend the pool or
|
|
1011
|
-
* skip the completion check.
|
|
1012
|
-
*
|
|
1013
|
-
* Safety is structural, not a sandbox (mirrors `authorStrategy`): the same `assertStrategyContract`
|
|
1014
|
-
* lint bounds the module to the loops import and bans out-of-band compute (require/eval/fetch/
|
|
1015
|
-
* process/node builtins), and the authored module is written to `outDir` and dynamically imported
|
|
1016
|
-
* under a TS-capable loader (tsx) since models emit type annotations.
|
|
1017
|
-
*/
|
|
1018
|
-
|
|
1019
|
-
/** The compressed consumable a skill carries: everything an author needs to emit a loop atom. */
|
|
1020
|
-
declare const loopAuthorContract = "\nYou author a LOOP ATOM for an agent supervisor. A loop runs a bounded, multi-round journey\ntoward a deployable check; a supervisor spawns / observes / steers it exactly like a worker.\nYou write ONE round; the runtime owns the round ceiling, the conserved budget, the gate, and\nfolding a supervisor's steer into the next round. So write real control flow inside a round,\nbut never write the loop's stop condition as \"hope the model stops\" \u2014 that is the runtime's job.\n\nYou export ONE module of EXACTLY this shape (no other imports, no commentary outside the code):\n\nimport { defineLoop } from '@tangle-network/agent-runtime/loops'\nexport default defineLoop('your-loop-name', {\n maxRounds: 3,\n round: async ({ task, scope, round, maxRounds, steer, budget, signal }) => {\n // arbitrary code for ONE round. Do real work by spawning children on the nested scope:\n // const w = scope.spawn(childAgent, subtask, { budget: perRound, label: `r${round}` })\n // if (!w.ok) throw new Error(w.reason) // fail loud: budget-exhausted | depth-exceeded\n // const settled = await scope.next() // conserved child work; settles gated\n // 'steer' is the supervisor's messages since the last round (fold them into what you do next).\n // 'signal' aborts if a forceful steer arrives mid-round \u2014 pass it to your awaited work.\n return { out: /* the running result */ undefined, done: false } // done:true stops early\n },\n check: (out) => /* the deployable completion oracle */ Boolean(out),\n})\n\nFor a MULTI-AGENT loop (a proposer then a verifier, a researcher then an engineer), do NOT\nhand-write the pipeline in 'round' \u2014 use 'agents' instead: an ordered list of named agents piped\neach round (task -> agents[0] -> agents[1] -> ... -> out). \"How many agents\" is then self-evident.\n\nimport { defineLoop } from '@tangle-network/agent-runtime/loops'\nexport default defineLoop('your-loop-name', {\n maxRounds: 3,\n agents: [\n { name: 'proposer', run: async (ctx, prior) => { /* spawn a worker, produce a draft */ return draft } },\n { name: 'verifier', run: async (ctx, prior) => { /* verify/refine the proposer's draft */ return checked } },\n ],\n check: (out) => Boolean(out),\n})\n\nProvide EXACTLY one of 'round' or 'agents'. The round context (for the 'round' form, and passed to\neach agent's run as its first arg):\n task the spawn task, verbatim.\n scope the NESTED conserved scope. scope.spawn(agent, task, { budget, label }) reserves\n budget and fails closed; scope.next() awaits one child settlement. Budget NESTS \u2014\n the pool reserves each spawn's full ceiling until it settles, so give children a\n per-round budget smaller than the loop's own.\n round 1-based round index. maxRounds is the declared ceiling.\n steer readonly string[] \u2014 supervisor steer_agent messages that arrived since last round.\n budget conserved-pool readouts (tokensLeft, usdLeft, deadlineMs) for in-body awareness.\n signal AbortSignal \u2014 the spawn signal + a fresh per-round interrupt; honor it in awaits.\n\nThe round result: { out: unknown; done?: boolean }. 'out' is the running result the gate reads;\n'done: true' is YOUR early stop (distinct from the runtime's gate 'check').\n\ncheck(out): boolean | Promise<boolean>. The DEPLOYABLE oracle \u2014 an executable test, a state\nverifier, a readiness score threshold \u2014 read off 'out', never the model judging itself. The loop\nsettles valid IFF check passes, and the runtime polls it after each round to stop the instant the\nloop has delivered. A loop that exhausts maxRounds without check passing settles valid:false.\n\nRules:\n- ALWAYS await every scope.spawn drain / async call \u2014 a floating rejection crashes the run.\n- Do real work by SPAWNING children; raw un-metered inference in the body is not budget-conserved.\n- Give 'check' a real oracle. A loop whose check is a self-judged score cannot be trusted.\n- The only import allowed is '@tangle-network/agent-runtime/loops'. No require/eval/fetch/process/\n node builtins \u2014 the runtime meters and gates you; out-of-band compute breaks that.\n";
|
|
1021
|
-
interface AuthorLoopOptions {
|
|
1022
|
-
/** The model-call seam (agent-eval `createChatClient`). */
|
|
1023
|
-
chat: ChatClient;
|
|
1024
|
-
model?: string;
|
|
1025
|
-
/** A NAMED fallback author tried once when the primary call fails or returns no code block
|
|
1026
|
-
* (thinking models can time out at the edge on long authoring prompts, or return empty
|
|
1027
|
-
* content without `maxTokens`). Opt-in — absent means the primary's failure propagates. */
|
|
1028
|
-
fallbackModel?: string;
|
|
1029
|
-
/** The contract text shown to the author. Default `loopAuthorContract`. A skill/GEPA loop can
|
|
1030
|
-
* evolve this text and gate each variant on the same check as any loop. */
|
|
1031
|
-
contract?: string;
|
|
1032
|
-
/** What the loop must accomplish — the objective, in plain language (the author's orientation). */
|
|
1033
|
-
goal: string;
|
|
1034
|
-
/** Optional orienting context: the check's shape, the child agents available, prior findings —
|
|
1035
|
-
* never the check's internals (the author stays blind to the oracle, like `authorStrategy`). */
|
|
1036
|
-
context?: string;
|
|
1037
|
-
/** The round ceiling the loop must respect. */
|
|
1038
|
-
maxRounds: number;
|
|
1039
|
-
/** Where the authored module file is written (created if missing). */
|
|
1040
|
-
outDir: string;
|
|
1041
|
-
temperature?: number;
|
|
1042
|
-
/** Completion cap — required by thinking-model authors that stream reasoning first. */
|
|
1043
|
-
maxTokens?: number;
|
|
1044
|
-
signal?: AbortSignal;
|
|
1045
|
-
}
|
|
1046
|
-
interface AuthoredLoop {
|
|
1047
|
-
loop: LoopDef;
|
|
1048
|
-
file: string;
|
|
1049
|
-
code: string;
|
|
1050
|
-
}
|
|
1051
|
-
/**
|
|
1052
|
-
* Author + load a coded loop from a goal. Throws when the author emits no loadable module; with
|
|
1053
|
-
* `fallbackModel` set, the named fallback gets one attempt first. The returned `loop` is handed
|
|
1054
|
-
* to `loopChild(loop, journal)` and spawned as a first-class atom.
|
|
1055
|
-
*/
|
|
1056
|
-
declare function authorLoop(opts: AuthorLoopOptions): Promise<AuthoredLoop>;
|
|
1057
|
-
|
|
1058
883
|
/**
|
|
1059
884
|
*
|
|
1060
885
|
* `runLoop` — the topology-agnostic kernel built atop the sandbox SDK.
|
|
@@ -1317,11 +1142,24 @@ interface AgenticOptions {
|
|
|
1317
1142
|
* worker. Omitted ⇒ the worker's `model`. */
|
|
1318
1143
|
analystModel?: string;
|
|
1319
1144
|
/** Across-run learning: when set, the analyst's observe() pass appends trace-derived
|
|
1320
|
-
* facts here (the flywheel write side).
|
|
1321
|
-
*
|
|
1145
|
+
* facts here (the flywheel write side). Read-back is opt-in via `corpusReadback`
|
|
1146
|
+
* because unconditional priming can pollute context on some domains. */
|
|
1322
1147
|
corpus?: Corpus;
|
|
1323
1148
|
/** Tags written onto learned facts (and used by the caller's priming query). */
|
|
1324
1149
|
corpusTags?: string[];
|
|
1150
|
+
/** In-context learning: when set, query `corpus` before each depth shot and inject
|
|
1151
|
+
* the top trace-derived facts as guidance for the active run. No corpus means no read-back. */
|
|
1152
|
+
corpusReadback?: CorpusReadbackOptions;
|
|
1153
|
+
}
|
|
1154
|
+
interface CorpusReadbackOptions {
|
|
1155
|
+
/** Minimum confidence for a fact to be injected. Default 0.7. */
|
|
1156
|
+
minConfidence?: number;
|
|
1157
|
+
/** Extra tags a fact must carry, in addition to `corpusTags`. */
|
|
1158
|
+
tags?: ReadonlyArray<string>;
|
|
1159
|
+
/** Max facts injected per shot. Default 3. */
|
|
1160
|
+
maxFacts?: number;
|
|
1161
|
+
/** Default false: only facts tagged `audience:agent` are injected into the worker. */
|
|
1162
|
+
includeOperatorFacts?: boolean;
|
|
1325
1163
|
}
|
|
1326
1164
|
type Msg = Record<string, unknown>;
|
|
1327
1165
|
interface ShotResult {
|
|
@@ -2608,6 +2446,14 @@ interface SandboxRun<Out> {
|
|
|
2608
2446
|
* @experimental
|
|
2609
2447
|
*/
|
|
2610
2448
|
type OpenSandboxRunPromptOptions = Omit<PromptOptions, 'signal' | 'sessionId'>;
|
|
2449
|
+
/** Context available after the box/session exists and before the first prompt is
|
|
2450
|
+
* drained. Intended for benchmark-owned workspace setup such as cloning a repo
|
|
2451
|
+
* into a fixed path. */
|
|
2452
|
+
interface OpenSandboxRunBeforeStartContext {
|
|
2453
|
+
readonly box: SandboxInstance;
|
|
2454
|
+
readonly sessionId: string;
|
|
2455
|
+
readonly signal: AbortSignal;
|
|
2456
|
+
}
|
|
2611
2457
|
/** @experimental */
|
|
2612
2458
|
interface OpenSandboxRunOptions {
|
|
2613
2459
|
/** Profile + sandbox env/overrides. `sandboxOverrides.backend.type` is the harness. */
|
|
@@ -2622,6 +2468,10 @@ interface OpenSandboxRunOptions {
|
|
|
2622
2468
|
/** Per-prompt sandbox SDK options forwarded to both `start()` and `resume()`.
|
|
2623
2469
|
* The runtime still owns the session id and abort signal for each turn. */
|
|
2624
2470
|
promptOptions?: OpenSandboxRunPromptOptions;
|
|
2471
|
+
/** Optional pre-start workspace setup. Runs after `lineage.start()` creates the
|
|
2472
|
+
* box/session and before the first prompt stream is consumed. A thrown error
|
|
2473
|
+
* fails the turn before the agent spends tokens. */
|
|
2474
|
+
beforeStart?: (ctx: OpenSandboxRunBeforeStartContext) => Promise<void> | void;
|
|
2625
2475
|
/** Test seam for deterministic hook timestamps. Defaults to `Date.now`. */
|
|
2626
2476
|
now?: () => number;
|
|
2627
2477
|
/** Bounds box-creation bursts inside lineage fanout. Default from lineage. */
|
|
@@ -3568,6 +3418,10 @@ declare function serveCoordinationMcp(opts: {
|
|
|
3568
3418
|
/** Hard cap on simultaneously-LIVE workers — `spawn_agent` fails closed once this many are in
|
|
3569
3419
|
* flight (a concurrency fence on top of the conserved-pool fence). Omit/`<= 0` = no cap. */
|
|
3570
3420
|
maxLiveWorkers?: number;
|
|
3421
|
+
/** Max wall-clock ms a single `await_event` may block before returning a re-pollable
|
|
3422
|
+
* `{ pending, live }` snapshot instead of erroring on the client's request timeout. Omit =
|
|
3423
|
+
* {@link DEFAULT_AWAIT_EVENT_TIMEOUT_MS}; `<= 0` = prior unbounded block (in-process only). */
|
|
3424
|
+
awaitTimeoutMs?: number;
|
|
3571
3425
|
port?: number;
|
|
3572
3426
|
host?: string;
|
|
3573
3427
|
/** Trace-analyst lenses the driver can run (`run_analyst`) or auto-fire on settle. */
|
|
@@ -3579,66 +3433,6 @@ declare function serveCoordinationMcp(opts: {
|
|
|
3579
3433
|
questionPolicy?: QuestionPolicy;
|
|
3580
3434
|
}): Promise<CoordinationMcpHandle>;
|
|
3581
3435
|
|
|
3582
|
-
/** The supervisor's profile — the subset of an `AgentProfile` that selects + shapes its brain.
|
|
3583
|
-
* `harness` is the backend-as-data discriminant; `systemPrompt` is the standing instruction. */
|
|
3584
|
-
interface SupervisorProfile {
|
|
3585
|
-
readonly name?: string;
|
|
3586
|
-
/** null/undefined → router brain (in-process tool-loop); a coding-CLI harness → sandboxed brain. */
|
|
3587
|
-
readonly harness?: string | null;
|
|
3588
|
-
/** The router model when the brain is router-driven (falls back to the deps router config). */
|
|
3589
|
-
readonly model?: string;
|
|
3590
|
-
/** The standing instructions ("you delegate, you do not solve"). */
|
|
3591
|
-
readonly systemPrompt?: string;
|
|
3592
|
-
}
|
|
3593
|
-
/** How to run a sandboxed harness as the DRIVER, with the coordination verbs mounted — the substrate
|
|
3594
|
-
* seam the caller supplies (mirrors `makeWorkerAgent` for spawned children). It runs `profile` on
|
|
3595
|
-
* `task` in its backend (sandbox / cli-bridge) with `coordinationMcpUrl` mounted as an MCP server,
|
|
3596
|
-
* so the harness calls spawn_agent / await_event / stop as native tools over the live scope. */
|
|
3597
|
-
type DriveHarness = (args: {
|
|
3598
|
-
readonly profile: SupervisorProfile;
|
|
3599
|
-
readonly task: unknown;
|
|
3600
|
-
readonly scope: Scope<unknown>;
|
|
3601
|
-
readonly coordinationMcpUrl: string;
|
|
3602
|
-
}) => Promise<void>;
|
|
3603
|
-
interface SupervisorAgentDeps {
|
|
3604
|
-
readonly blobs: ResultBlobStore;
|
|
3605
|
-
/** Resolve a spawned worker `profile` to a leaf agent — the recursion seam (same for both arms). */
|
|
3606
|
-
readonly makeWorkerAgent: MakeWorkerAgent;
|
|
3607
|
-
/** Per-child budget reserved from the conserved pool on each spawn. */
|
|
3608
|
-
readonly perWorker: Budget;
|
|
3609
|
-
/** Hard cap on simultaneously-LIVE workers across both arms — `spawn_agent` fails closed once
|
|
3610
|
-
* this many are in flight (a concurrency fence on top of the conserved-pool fence; bounds live
|
|
3611
|
-
* boxes/sandboxes, not total work). Omit/`<= 0` = no cap. */
|
|
3612
|
-
readonly maxLiveWorkers?: number;
|
|
3613
|
-
/** Router substrate for a router-brained supervisor (`harness` null). The profile's model wins. */
|
|
3614
|
-
readonly router?: RouterConfig;
|
|
3615
|
-
/** Inject the brain directly (tests / advanced) instead of resolving `routerBrain` from the profile. */
|
|
3616
|
-
readonly brain?: ToolLoopChat;
|
|
3617
|
-
/** Required for a sandboxed-harness supervisor (`harness` set): runs the harness as the driver. */
|
|
3618
|
-
readonly driveHarness?: DriveHarness;
|
|
3619
|
-
/** WORK tools the supervisor may call DIRECTLY (router arm) — so it can do simple work ITSELF and
|
|
3620
|
-
* only delegate when it needs parallelism. Pair with `executeExtraTool`. */
|
|
3621
|
-
readonly extraTools?: ReadonlyArray<{
|
|
3622
|
-
readonly name: string;
|
|
3623
|
-
readonly description?: string;
|
|
3624
|
-
readonly parameters: Record<string, unknown>;
|
|
3625
|
-
}>;
|
|
3626
|
-
/** Runs an `extraTools` call; null/undefined falls through to the coordination dispatch. */
|
|
3627
|
-
readonly executeExtraTool?: (name: string, args: Record<string, unknown>) => Promise<string | null | undefined>;
|
|
3628
|
-
/** Analyst lenses available to the driver (both arms). Required for `analyzeOnSettle`. */
|
|
3629
|
-
readonly analysts?: AnalystRegistry;
|
|
3630
|
-
/** Analyst kinds run on each worker-settle → a `finding` the driver composes its next steer from
|
|
3631
|
-
* (the self-improving UP-leg). Unset/empty = status quo (no analyst feed). Requires `analysts`. */
|
|
3632
|
-
readonly analyzeOnSettle?: ReadonlyArray<string>;
|
|
3633
|
-
readonly maxTurns?: number;
|
|
3634
|
-
/** Give the supervisor brain a chapter-lifecycle on its OWN context window (router arm only) — it
|
|
3635
|
-
* distills its coordination transcript to a compact progress note once it exceeds the threshold,
|
|
3636
|
-
* instead of re-billing the whole thing every turn. See `DriverAgentOptions.compaction`. */
|
|
3637
|
-
readonly compaction?: ToolLoopCompactionOptions;
|
|
3638
|
-
}
|
|
3639
|
-
/** Build a supervisor `Agent` from its profile: the brain resolves from `profile.harness` (backend-as-data), the same resolution rule as every worker. */
|
|
3640
|
-
declare function supervisorAgent(profile: SupervisorProfile, deps: SupervisorAgentDeps): Agent<unknown, unknown>;
|
|
3641
|
-
|
|
3642
3436
|
/**
|
|
3643
3437
|
*
|
|
3644
3438
|
* `delegate` — the one generic delegation verb. You hand it an INTENT (what you want done) and it
|
|
@@ -3890,13 +3684,6 @@ interface InMemoryRunContextOptions {
|
|
|
3890
3684
|
* leaf workers. Default `false`.
|
|
3891
3685
|
*/
|
|
3892
3686
|
readonly withDriver?: boolean;
|
|
3893
|
-
/**
|
|
3894
|
-
* Wrap the executor registry with `withLoopExecutor` so a spawned child marked
|
|
3895
|
-
* `role: 'loop'` resolves to the loop-executor (a coded, budget-conserving, gated,
|
|
3896
|
-
* steerable multi-round loop over a nested `Scope` on the same pool). Composes with
|
|
3897
|
-
* `withDriver` so loops and drivers coexist. Default `false`.
|
|
3898
|
-
*/
|
|
3899
|
-
readonly withLoop?: boolean;
|
|
3900
3687
|
}
|
|
3901
3688
|
/**
|
|
3902
3689
|
* The bundle of stores a supervised run needs, shaped to spread into `SupervisorOpts`.
|
|
@@ -3986,71 +3773,6 @@ declare function createScope<Out>(args: ScopeArgs): Scope<Out>;
|
|
|
3986
3773
|
*/
|
|
3987
3774
|
declare function settledToIteration<Out>(settled: Settled<Out>): Iteration<unknown, Out>;
|
|
3988
3775
|
|
|
3989
|
-
/** Build the worker seam from a backend (WHERE workers run) + an optional completion oracle (the
|
|
3990
|
-
* deliverable check that makes "settled ⟺ delivered" true — the guard against "ran but didn't
|
|
3991
|
-
* deliver"). The ONE place a backend becomes a spawnable worker. */
|
|
3992
|
-
declare function workerFromBackend(backend: ExecutorConfig, deliverable?: DeliverableSpec<unknown>): MakeWorkerAgent;
|
|
3993
|
-
interface SuperviseOptions {
|
|
3994
|
-
/** The conserved compute pool for the whole run. */
|
|
3995
|
-
readonly budget: Budget;
|
|
3996
|
-
/** WHERE workers run — derives the worker seam. Provide this OR an explicit `makeWorkerAgent`. */
|
|
3997
|
-
readonly backend?: ExecutorConfig;
|
|
3998
|
-
/** The completion oracle for backend-derived workers (settled ⟺ delivered). Strongly recommended:
|
|
3999
|
-
* without it the supervisor trusts a worker's self-report — exactly the "ran but didn't deliver"
|
|
4000
|
-
* failure mode of a static orchestrator. */
|
|
4001
|
-
readonly deliverable?: DeliverableSpec<unknown>;
|
|
4002
|
-
/** Override the worker seam directly (tests / advanced) instead of deriving it from `backend`. */
|
|
4003
|
-
readonly makeWorkerAgent?: MakeWorkerAgent;
|
|
4004
|
-
/** The supervisor's router substrate (`harness` null). The profile's model wins. */
|
|
4005
|
-
readonly router?: RouterConfig;
|
|
4006
|
-
/** Inject the supervisor brain directly (tests / advanced). */
|
|
4007
|
-
readonly brain?: ToolLoopChat;
|
|
4008
|
-
/** Run a sandboxed-harness supervisor (`harness` set). */
|
|
4009
|
-
readonly driveHarness?: DriveHarness;
|
|
4010
|
-
/** WORK tools the supervisor may call DIRECTLY — so a recursive atom can ACT (do simple work
|
|
4011
|
-
* itself) OR SPAWN (delegate when it needs parallelism), not be a pure manager. Pair with
|
|
4012
|
-
* `executeExtraTool`. Router arm only (`harness` null). */
|
|
4013
|
-
readonly extraTools?: ReadonlyArray<{
|
|
4014
|
-
readonly name: string;
|
|
4015
|
-
readonly description?: string;
|
|
4016
|
-
readonly parameters: Record<string, unknown>;
|
|
4017
|
-
}>;
|
|
4018
|
-
/** Runs an `extraTools` call; null/undefined falls through to the coordination dispatch. */
|
|
4019
|
-
readonly executeExtraTool?: (name: string, args: Record<string, unknown>) => Promise<string | null | undefined>;
|
|
4020
|
-
/** Per-child budget reserved on each spawn. Defaults to a quarter of the pool's tokens. */
|
|
4021
|
-
readonly perWorker?: Budget;
|
|
4022
|
-
/** Hard cap on simultaneously-LIVE workers — `spawn_agent` fails closed once this many are in
|
|
4023
|
-
* flight. The conserved pool bounds TOTAL work; this bounds SIMULTANEOUS work (live boxes/
|
|
4024
|
-
* sandboxes a real fleet runs at once). Omit/`<= 0` = no cap (the pool stays the only fence). */
|
|
4025
|
-
readonly maxLiveWorkers?: number;
|
|
4026
|
-
/** Analyst lenses available to the driver. Required for `analyzeOnSettle`. Unset → status quo
|
|
4027
|
-
* (the driver receives settled worker outputs, no analyst findings). */
|
|
4028
|
-
readonly analysts?: AnalystRegistry;
|
|
4029
|
-
/** Analyst kind ids run AUTOMATICALLY when a worker settles `done` — each re-enters as a `finding`
|
|
4030
|
-
* the driver pulls (`await_event`) and composes its next steer from. The self-improving UP-leg,
|
|
4031
|
-
* threaded to the driver at this level (propagate to sub-drivers via a recursive `makeWorkerAgent`).
|
|
4032
|
-
* Omit/empty = status quo (no analyst feed). Requires `analysts`. */
|
|
4033
|
-
readonly analyzeOnSettle?: ReadonlyArray<string>;
|
|
4034
|
-
/** Worker output store. Defaults to in-memory. */
|
|
4035
|
-
readonly blobs?: ResultBlobStore;
|
|
4036
|
-
readonly maxDepth?: number;
|
|
4037
|
-
readonly maxTurns?: number;
|
|
4038
|
-
/** Give the supervisor brain a chapter-lifecycle on its OWN context window (router arm only): once
|
|
4039
|
-
* its coordination transcript exceeds `thresholdTokens` it distills to a compact progress note and
|
|
4040
|
-
* continues, instead of re-billing the whole transcript every turn (the cost that makes the LLM-brain
|
|
4041
|
-
* front door lose to a dumb-Ralph respawn). The live `Scope` roster is the durable state across
|
|
4042
|
-
* chapters. Default off. `distill` defaults to a brain self-summary + the settled-worker roster. */
|
|
4043
|
-
readonly compaction?: ToolLoopCompactionOptions;
|
|
4044
|
-
readonly runId?: string;
|
|
4045
|
-
readonly now?: () => number;
|
|
4046
|
-
/** Restrict the run to this subset of models. When set, every configured model — the
|
|
4047
|
-
* supervisor router model, the profile's model, and the backend's model — must be a member,
|
|
4048
|
-
* or `supervise()` throws a `ConfigError` before any compute is spent. Unset = unrestricted. */
|
|
4049
|
-
readonly allowedModels?: readonly string[];
|
|
4050
|
-
}
|
|
4051
|
-
/** One-call supervisor: build + run a supervisor from its profile with sensible defaults; the raw `supervisorAgent` + `createSupervisor().run` seams stay available for power use. */
|
|
4052
|
-
declare function supervise(profile: SupervisorProfile, task: unknown, opts: SuperviseOptions): Promise<SupervisedResult<unknown>>;
|
|
4053
|
-
|
|
4054
3776
|
/**
|
|
4055
3777
|
*
|
|
4056
3778
|
* The `Supervisor` impl (KEYSTONE, build step 5).
|
|
@@ -4272,4 +3994,4 @@ declare function runInWorkspace<T>(ws: Workspace, body: (cwd: string) => Promise
|
|
|
4272
3994
|
commitOnInvalid?: boolean;
|
|
4273
3995
|
}): Promise<WorkspaceRun<T>>;
|
|
4274
3996
|
|
|
4275
|
-
export { Agent, AgentRunSpec, type AgentTurnBackend, type AgentTurnUsage, type AgenticOptions, type AgenticRunResult, type AgenticSurface, type AgenticTask, type AgenticTool, AnalystRegistry, type AnytimeReport, type AnytimeStrategySummary, type AnytimeTaskCurve, type ApplyContinuation, type ArtifactHandle, AssertTraceDerivedFindings, type AuditIntentInput, type AuditIntentOptions, type
|
|
3997
|
+
export { Agent, AgentRunSpec, type AgentTurnBackend, type AgentTurnUsage, type AgenticOptions, type AgenticRunResult, type AgenticSurface, type AgenticTask, type AgenticTool, AnalystRegistry, type AnytimeReport, type AnytimeStrategySummary, type AnytimeTaskCurve, type ApplyContinuation, type ArtifactHandle, AssertTraceDerivedFindings, type AuditIntentInput, type AuditIntentOptions, type AuthorStrategyOptions, type AuthoredProfile, type AuthoredStrategy, type BenchmarkCell, type BenchmarkConfig, type BenchmarkLift, type BenchmarkReport, type BenchmarkStrategySummary, type BenchmarkTaskRow, Budget, type BudgetPool, type BudgetReadout, type ChampionPick, type ChampionPolicy, type CheckpointCapableBox, type CollectedAgentTurn, CombinatorShape, type CompletionAnalyst, type CompletionEvidence, type CompletionPolicy, type CompletionVerdict, CoordinationEvent, type CoordinationMcpHandle, Corpus, CorpusFilter, type CorpusReadbackOptions, CorpusRecord, type CreateScopeAnalystOptions, type CriuCapableClient, DefinePersonaInput, type DefinedLeaderboard, type DelegateOptions, type Deliverable, DeliverableSpec, Driver, type DriverAgentOptions, type DumbDriverOptions, type Environment, EqualKArm, EqualKOnCostOptions, EqualKVerdict, type EvolutionArchiveNode, type EvolutionAuthor, type EvolutionBandInfo, type EvolutionCandidate, type EvolutionGeneration, type EvolutionReport, ExecCtx, ExecutorConfig, ExecutorFactory, ExecutorRegistry, FanoutOptions, FanoutWinnerSelector, FileCorpus, type ForkCapableBox, type GitWorkspaceOptions, type HarvestCorpusOptions, type HarvestFailure, type HarvestReport, InMemoryCorpus, InMemoryResultBlobStore, type InMemoryRunContext, type InMemoryRunContextOptions, InMemorySpawnJournal, type InProcessOnPrompt, type InProcessPromptCtx, type InProcessSandboxClientOptions, type Inbox, type InboxMessage, type IntentAudit, type Interval, Iteration, type Leaderboard, type LeaderboardBenchScore, type LeaderboardBenchTask, type LeaderboardBenchmarkAdapter, type LeaderboardFlagSpec, type LeaderboardIterationInfo, type LeaderboardOptions, type LeaderboardRow, type LeaderboardRunContext, type LeaderboardScenario, type LeaderboardScore, type LeaderboardSpec, type LoopCampaignDispatchOptions, type LoopDispatchOptions, LoopLineageOptions, type LoopOptionsForDispatch, LoopResult, LoopShape, LoopTokenUsage, LoopUntilSpec, LoopWinner, MakeWorkerAgent, type McpEndpoint, type McpEnvironmentOptions, MountRecorder, type NaiveDriverOptions, type Observation, type ObserveInput, type ObserveOptions, type OpenSandboxRunBeforeStartContext, type OpenSandboxRunOptions, type OpenSandboxRunPromptOptions, Outcome, OutputAdapter, type PairwiseOptions, type PairwiseVerdict, PanelSpec, Persona, PipelineStage, type ProfileRichness, type ProfileRichnessThresholds, type PromotionGateOptions, type PromotionVerdict, type RegistryAnalyzeProjection, RenderCorpusToInstructionsOptions, type ReservationTicket, type ResolveSandboxClientOptions, ResultBlobStore, RouterConfig, type RunAgenticOptions, RunPersonifiedOptions, type SandboxCapabilities, SandboxClient, type SandboxLineage, type SandboxLineageHandle, type SandboxRun, SandboxRunAbortError, type SandboxToolPartState, Scope, ScopeAnalyst, ScopeAnalyzeInput, ScopeWidenGate, type SessionCapableBox, type SessionTraceBox, Settled, ShapeRegistry, type Shell, type ShotPersona, type ShotSpec, Spend, SteerContext, type SteeringDecision, type Strategy, type StrategyCtx, type StrategyEvolutionConfig, type StrategyResult, type StreamAgentTurnOptions, type SuperviseSurfaceOptions, type SuperviseSurfaceResult, SupervisedResult, Supervisor, SupervisorProfile, type SurfaceScore, type SurfaceWorkerConfig, type SurfaceWorkerOut, ToolLoopChat, ToolLoopCompactionOptions, type TraceSource, type TrajectoryAnalysis, TrajectoryReport, TrajectoryReportOptions, type TurnResult, UsageEvent, type UsageSink, Validator, type VerifierEnvironmentOptions, VerifySpec, type WatchTraceOptions, type WaterfallCollector, type WaterfallReport, type WaterfallSpan, WidenSpec, WinnerStrategy, type Workspace, type WorkspaceCommit, type WorkspaceRun, acquireSandbox, adaptiveRefine, analyzeTrace, anytimeReport, asAuthoredProfile, assertModelAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, breadthStrategy, buildSteerContext, builtinShapes, collectAgentTurn, completionAuthorizes, contentAddress, createBudgetPool, createInMemoryRunContext, createInbox, createMcpEnvironment, createPushTraceSource, createSandboxLineage, createSandboxToolPartState, createScope, createScopeAnalyst, createShapeRegistry, createSupervisor, createVerifierEnvironment, createWaterfallCollector, decodeToolPart, defaultAnalystInstruction, defaultAuditorInstruction, defaultDelegateBudget, defaultProfileRichnessThresholds, defaultSelectWinner, defaultToolDetectors, defineLeaderboard, definePersona, defineStrategy, delegate, depthStrategy, deterministicCompletion, discriminatingMeans, driverAgent, dumbDriver, equalKOnCost, extractLlmCallEvent, failuresAnalyst, fanout, finalizeBestDelivered, flatWidenGate, gitWorkspace, harvestCorpus, inProcessSandboxClient, inlineSandboxClient, jjWorkspace, leaderboard, localShell, loopCampaignDispatch, loopDispatch, loopUntil, mapSandboxEvent, mapSandboxToolEvent, naiveDriver, observe, openSandboxRun, pairwiseSignificance, panel, pickChampion, pipeline, printBenchmarkReport, probeSandboxCapabilities, profileRichnessFinding, promotionGate, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderLeaderboardHtml, renderLeaderboardMarkdown, renderLeaderboardSvg, renderPairwiseMarkdown, renderReport, reportLoopUsage, resolveSandboxClient, runAgentic, runBenchmark, runInWorkspace, runLoop, runPersonified, runStrategyEvolution, sample, sampleThenRefine, sandboxSessionTraceSource, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, spendFromUsageEvents, stopSentinel, strategyAuthorContract, streamAgentTurn, sumSandboxUsage, superviseSurface, supervisorInstructions, trajectoryReport, verify, watchTrace, widen };
|
package/dist/loops.js
CHANGED
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
assertStrategyContract,
|
|
9
9
|
assertTraceDerivedFindings,
|
|
10
10
|
auditIntent,
|
|
11
|
-
authorLoop,
|
|
12
11
|
authorStrategy,
|
|
13
12
|
breadthStrategy,
|
|
14
13
|
buildSteerContext,
|
|
@@ -44,7 +43,6 @@ import {
|
|
|
44
43
|
jjWorkspace,
|
|
45
44
|
leaderboard,
|
|
46
45
|
localShell,
|
|
47
|
-
loopAuthorContract,
|
|
48
46
|
loopCampaignDispatch,
|
|
49
47
|
loopDispatch,
|
|
50
48
|
loopUntil,
|
|
@@ -91,7 +89,7 @@ import {
|
|
|
91
89
|
watchTrace,
|
|
92
90
|
widen,
|
|
93
91
|
worktreeFanout
|
|
94
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-4IBAMGBE.js";
|
|
95
93
|
import {
|
|
96
94
|
InMemoryResultBlobStore,
|
|
97
95
|
InMemorySpawnJournal,
|
|
@@ -115,13 +113,10 @@ import {
|
|
|
115
113
|
defaultDelegateBudget,
|
|
116
114
|
defaultProfileRichnessThresholds,
|
|
117
115
|
defaultSelectWinner,
|
|
118
|
-
defineLoop,
|
|
119
116
|
delegate,
|
|
120
117
|
driverAgent,
|
|
121
118
|
finalizeBestDelivered,
|
|
122
119
|
gateOnDeliverable,
|
|
123
|
-
loopChild,
|
|
124
|
-
loopRuntime,
|
|
125
120
|
probeSandboxCapabilities,
|
|
126
121
|
profileRichnessFinding,
|
|
127
122
|
routerBrain,
|
|
@@ -135,9 +130,9 @@ import {
|
|
|
135
130
|
supervise,
|
|
136
131
|
supervisorAgent,
|
|
137
132
|
supervisorInstructions,
|
|
138
|
-
withLoopExecutor,
|
|
139
133
|
workerFromBackend
|
|
140
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-QSNSMJSZ.js";
|
|
135
|
+
import "./chunk-DPEUKJRO.js";
|
|
141
136
|
import "./chunk-UD4BHQMI.js";
|
|
142
137
|
import {
|
|
143
138
|
createAgentEnvironmentProviderRegistry,
|
|
@@ -155,7 +150,6 @@ import {
|
|
|
155
150
|
} from "./chunk-FVJ7M3DA.js";
|
|
156
151
|
import "./chunk-7LO5GMAO.js";
|
|
157
152
|
import "./chunk-YEJR7IXO.js";
|
|
158
|
-
import "./chunk-DPEUKJRO.js";
|
|
159
153
|
import "./chunk-DGUM43GV.js";
|
|
160
154
|
export {
|
|
161
155
|
FileCorpus,
|
|
@@ -173,7 +167,6 @@ export {
|
|
|
173
167
|
assertTraceDerivedFindings,
|
|
174
168
|
assessAuthoredProfile,
|
|
175
169
|
auditIntent,
|
|
176
|
-
authorLoop,
|
|
177
170
|
authorStrategy,
|
|
178
171
|
authoredWorker,
|
|
179
172
|
breadthStrategy,
|
|
@@ -210,7 +203,6 @@ export {
|
|
|
210
203
|
defaultSelectWinner,
|
|
211
204
|
defaultToolDetectors,
|
|
212
205
|
defineLeaderboard,
|
|
213
|
-
defineLoop,
|
|
214
206
|
definePersona,
|
|
215
207
|
defineStrategy,
|
|
216
208
|
delegate,
|
|
@@ -233,11 +225,8 @@ export {
|
|
|
233
225
|
jjWorkspace,
|
|
234
226
|
leaderboard,
|
|
235
227
|
localShell,
|
|
236
|
-
loopAuthorContract,
|
|
237
228
|
loopCampaignDispatch,
|
|
238
|
-
loopChild,
|
|
239
229
|
loopDispatch,
|
|
240
|
-
loopRuntime,
|
|
241
230
|
loopUntil,
|
|
242
231
|
makeFinding,
|
|
243
232
|
mapSandboxEvent,
|
|
@@ -301,7 +290,6 @@ export {
|
|
|
301
290
|
verify,
|
|
302
291
|
watchTrace,
|
|
303
292
|
widen,
|
|
304
|
-
withLoopExecutor,
|
|
305
293
|
workerFromBackend,
|
|
306
294
|
worktreeFanout
|
|
307
295
|
};
|
package/dist/mcp/bin.js
CHANGED
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
DelegationTaskQueue,
|
|
10
10
|
FileDelegationStore,
|
|
11
11
|
createMcpServer
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-QSNSMJSZ.js";
|
|
13
|
+
import "../chunk-DPEUKJRO.js";
|
|
13
14
|
import "../chunk-UD4BHQMI.js";
|
|
14
15
|
import "../chunk-BZF3KQ6G.js";
|
|
15
16
|
import "../chunk-FVJ7M3DA.js";
|
|
16
17
|
import "../chunk-7LO5GMAO.js";
|
|
17
18
|
import "../chunk-YEJR7IXO.js";
|
|
18
|
-
import "../chunk-DPEUKJRO.js";
|
|
19
19
|
import "../chunk-DGUM43GV.js";
|
|
20
20
|
|
|
21
21
|
// src/mcp/delegate-supervisor-provisioning.ts
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { S as SandboxClient, d as LoopSandboxPlacement } from '../types-
|
|
2
|
-
import { F as FleetHandle, D as DelegationExecutor, a as DelegationTaskQueue, b as FeedbackStore, c as DelegateFeedbackResult, d as DelegateFeedbackArgs, U as UiAuditorDelegate, e as DelegateUiAuditArgs, f as DelegateUiAuditResult, g as DelegationHistoryResult, h as DelegationHistoryArgs, i as DelegationStatusResult, j as DelegationStatusArgs } from '../coordination-
|
|
3
|
-
export { A as AnalystRegistry, C as CappedDelegationTrace, k as CoderDelegate, l as CoderReview, m as CoderReviewer, n as CoordinationEvent, o as CoordinationTools, p as CoordinationToolsOptions, q as DELEGATE_DESCRIPTION, r as DELEGATE_INPUT_SCHEMA, s as DELEGATE_TOOL_NAME, t as DELEGATION_TRACE_MAX_BYTES, u as DELEGATION_TRACE_MAX_SPANS, v as DelegateArgs, w as DelegateCodeArgs, x as DelegateCodeConfig, y as DelegateCodeResult, z as DelegateHandlerOptions, B as DelegateResearchArgs,
|
|
1
|
+
import { S as SandboxClient, d as LoopSandboxPlacement } from '../types-Dnk189QA.js';
|
|
2
|
+
import { F as FleetHandle, D as DelegationExecutor, a as DelegationTaskQueue, b as FeedbackStore, c as DelegateFeedbackResult, d as DelegateFeedbackArgs, U as UiAuditorDelegate, e as DelegateUiAuditArgs, f as DelegateUiAuditResult, g as DelegationHistoryResult, h as DelegationHistoryArgs, i as DelegationStatusResult, j as DelegationStatusArgs } from '../coordination-DxHduZg7.js';
|
|
3
|
+
export { A as AnalystRegistry, C as CappedDelegationTrace, k as CoderDelegate, l as CoderReview, m as CoderReviewer, n as CoordinationEvent, o as CoordinationTools, p as CoordinationToolsOptions, q as DELEGATE_DESCRIPTION, r as DELEGATE_INPUT_SCHEMA, s as DELEGATE_TOOL_NAME, t as DELEGATION_TRACE_MAX_BYTES, u as DELEGATION_TRACE_MAX_SPANS, v as DelegateArgs, w as DelegateCodeArgs, x as DelegateCodeConfig, y as DelegateCodeResult, z as DelegateHandlerOptions, B as DelegateResearchArgs, G as DelegateResearchConfig, H as DelegateResearchResult, I as DelegateResult, J as DelegateRunCtx, K as DelegateUiAuditConfig, L as DelegateUiAuditRoute, N as DelegationError, O as DelegationFeedbackSnapshot, P as DelegationHistoryEntry, Q as DelegationPersistenceError, R as DelegationProfile, S as DelegationProgress, T as DelegationRecord, V as DelegationResultPayload, W as DelegationResumeContext, X as DelegationResumeDriver, Y as DelegationResumeTick, Z as DelegationRunContext, _ as DelegationStateCorruptError, $ as DelegationStatus, a0 as DelegationStore, a1 as DelegationTaskQueueOptions, a2 as DelegationTraceCaps, a3 as DelegationTraceCollector, a4 as DelegationTraceSpan, a5 as DetachedSessionDelegateOptions, a6 as DetachedSessionRefParts, a7 as DetachedTurn, a8 as DetachedTurnResumeDriverOptions, a9 as DetachedWinnerSelection, aa as DriveTurnCapableBox, ab as DriveTurnTick, ac as FeedbackEvent, ad as FeedbackRating, ae as FeedbackRefersTo, af as FileDelegationStore, ag as FileDelegationStoreOptions, ah as FleetWorkspaceExecutorOptions, ai as InMemoryDelegationStore, aj as InMemoryFeedbackStore, ak as JsonRpcMessage, al as JsonRpcResponse, M as MakeWorkerAgent, am as McpServer, an as McpServerOptions, ao as McpToolDescriptor, ap as McpTransport, aq as Question, ar as QuestionDecision, as as QuestionPolicy, at as QuestionRecord, au as ResearchOutputShape, av as ResearchSource, aw as RunDetachedTurnOptions, ax as SettleDetachedCoderTurnOptions, ay as SettledWorker, az as SiblingSandboxExecutorOptions, aA as SubmitInput, aB as SubmitOutput, aC as TraceContext, aD as UiAuditorDelegationOutput, aE as buildDelegationTraceSpans, aF as capDelegationTrace, aG as coderTaskFromArgs, aH as composeLoopTraceEmitters, aI as createCoordinationTools, aJ as createDelegateHandler, aK as createDelegationTraceCollector, aL as createDetachedTurnResumeDriver, aM as createFleetWorkspaceExecutor, aN as createInProcessTransport, aO as createMcpServer, aP as createPropagatingTraceEmitter, aQ as createSiblingSandboxExecutor, aR as detachedSessionDelegate, aS as detachedTurnEvents, aT as eventToSnapshot, aU as formatDetachedSessionRef, aV as hashIdempotencyInput, aW as parseDetachedSessionRef, aX as readTraceContextFromEnv, aY as runDetachedTurn, aZ as settleDetachedCoderTurn, a_ as traceContextToEnv, a$ as validateDelegateArgs } from '../coordination-DxHduZg7.js';
|
|
4
4
|
import { L as LocalHarness, r as runLocalHarness } from '../local-harness-sI0S_XNA.js';
|
|
5
5
|
export { a as LocalHarnessResult, R as RunLocalHarnessOptions } from '../local-harness-sI0S_XNA.js';
|
|
6
|
-
import { G as GitRunner } from '../
|
|
7
|
-
export { C as CreateWorktreeOptions, b as DiffOptions, c as DiffResult, R as RemoveWorktreeOptions, d as WorktreeHandle, e as captureWorktreeDiff, f as createWorktree, r as removeWorktree } from '../
|
|
6
|
+
import { G as GitRunner } from '../completion-gate-BDaBP8dd.js';
|
|
7
|
+
export { C as CreateWorktreeOptions, b as DiffOptions, c as DiffResult, R as RemoveWorktreeOptions, d as WorktreeHandle, e as captureWorktreeDiff, f as createWorktree, r as removeWorktree } from '../completion-gate-BDaBP8dd.js';
|
|
8
8
|
export { C as CreateKbGateOptions, F as FactCandidate, a as FactJudge, b as FactJudgeVerdict, K as KbGateResult, c as createKbGate } from '../kb-gate-CwHO0vz6.js';
|
|
9
|
-
export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from '../openai-tools-
|
|
9
|
+
export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from '../openai-tools-D0xmzo0y.js';
|
|
10
10
|
import { AnalystFinding } from '@tangle-network/agent-eval';
|
|
11
11
|
import { U as UiLens } from '../substrate-DO2GHNg2.js';
|
|
12
12
|
import '@tangle-network/sandbox';
|
|
13
|
-
import '../types-
|
|
13
|
+
import '../types-DAJQRIUD.js';
|
|
14
14
|
import '@tangle-network/agent-interface';
|
|
15
|
-
import '../
|
|
16
|
-
import '../router-client-r8y_VFVM.js';
|
|
15
|
+
import '../router-client-DJImUDlm.js';
|
|
17
16
|
import '../environment-provider.js';
|
|
18
17
|
import '@tangle-network/agent-interface/environment-provider';
|
|
19
18
|
import 'node:child_process';
|