@tangle-network/agent-runtime 0.40.0 → 0.42.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/dist/agent.d.ts +57 -2
- package/dist/agent.js +54 -0
- package/dist/agent.js.map +1 -1
- package/dist/chunk-7JITYN6T.js +72 -0
- package/dist/chunk-7JITYN6T.js.map +1 -0
- package/dist/{chunk-3WQJRSUJ.js → chunk-BDGYYO7K.js} +3 -3
- package/dist/{chunk-6HI3QUJD.js → chunk-HCL2ZG5L.js} +51 -5
- package/dist/chunk-HCL2ZG5L.js.map +1 -0
- package/dist/{chunk-HSX6PFZR.js → chunk-HVYOHJHK.js} +338 -2
- package/dist/chunk-HVYOHJHK.js.map +1 -0
- package/dist/{chunk-OISRXLWI.js → chunk-IFG6GX6A.js} +64 -40
- package/dist/chunk-IFG6GX6A.js.map +1 -0
- package/dist/chunk-NRZOXCJK.js +64 -0
- package/dist/chunk-NRZOXCJK.js.map +1 -0
- package/dist/{chunk-VFKBIZTY.js → chunk-WMBYQPYM.js} +5 -4
- package/dist/chunk-WMBYQPYM.js.map +1 -0
- package/dist/delegation-profile-1GbW5yA3.d.ts +73 -0
- package/dist/{dynamic-BT9Ji3jE.d.ts → dynamic-B_7GgCwu.d.ts} +1 -1
- package/dist/index.d.ts +7 -8
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/{kb-gate-C4tho31v.d.ts → kb-gate-DTBum3vH.d.ts} +9 -1
- package/dist/{loop-runner-bin-C1MuoT8c.d.ts → loop-runner-bin-CVoCBmYk.d.ts} +3 -3
- package/dist/loop-runner-bin.d.ts +4 -5
- package/dist/loop-runner-bin.js +3 -3
- package/dist/loops.d.ts +65 -7
- package/dist/loops.js +7 -1
- package/dist/mcp/bin.js +28 -17
- package/dist/mcp/bin.js.map +1 -1
- package/dist/mcp/index.d.ts +6 -6
- package/dist/mcp/index.js +17 -49
- package/dist/mcp/index.js.map +1 -1
- package/dist/{otel-export-xgf4J6bo.d.ts → otel-export-BzvF1Ela.d.ts} +1 -1
- package/dist/profiles.d.ts +1 -2
- package/dist/{types-CNs7_1R3.d.ts → types-Bcp071Jg.d.ts} +488 -3
- package/package.json +11 -22
- package/dist/chunk-6HI3QUJD.js.map +0 -1
- package/dist/chunk-7ZECSZ3C.js +0 -400
- package/dist/chunk-7ZECSZ3C.js.map +0 -1
- package/dist/chunk-HSX6PFZR.js.map +0 -1
- package/dist/chunk-OISRXLWI.js.map +0 -1
- package/dist/chunk-VFKBIZTY.js.map +0 -1
- package/dist/types-CsCCryln.d.ts +0 -489
- /package/dist/{chunk-3WQJRSUJ.js.map → chunk-BDGYYO7K.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/mcp/openai-tools.ts"],"sourcesContent":["/**\n * @experimental\n *\n * OpenAI Chat Completions `tools[]` projection of the 5 agent-runtime MCP\n * delegation tools.\n *\n * Use when configuring `createOpenAICompatibleBackend({ tools: ... })` so the\n * model can call `delegate_code`, `delegate_research`, `delegate_feedback`,\n * `delegation_status`, and `delegation_history` through the OpenAI-compat\n * transport (tcloud, OpenRouter, OpenAI direct, cli-bridge). The runtime\n * surfaces tool calls as `tool_call` stream events — execution is the\n * caller's responsibility (typically the parent sandbox runtime's MCP\n * mount).\n *\n * Sandbox-SDK callers do NOT need this helper: the sandbox runtime mounts\n * MCP servers natively and the in-sandbox harness discovers tools via the\n * runtime, not via an OpenAI tools array.\n *\n * Tool name + description + JSON-schema are pulled from the canonical\n * `DELEGATE_*` constants exported by `./tools/*` so the projection cannot\n * drift from the server's own validators.\n */\n\nimport type { OpenAIChatTool } from '../types'\nimport {\n DELEGATE_CODE_DESCRIPTION,\n DELEGATE_CODE_INPUT_SCHEMA,\n DELEGATE_CODE_TOOL_NAME,\n} from './tools/delegate-code'\nimport {\n DELEGATE_FEEDBACK_DESCRIPTION,\n DELEGATE_FEEDBACK_INPUT_SCHEMA,\n DELEGATE_FEEDBACK_TOOL_NAME,\n} from './tools/delegate-feedback'\nimport {\n DELEGATE_RESEARCH_DESCRIPTION,\n DELEGATE_RESEARCH_INPUT_SCHEMA,\n DELEGATE_RESEARCH_TOOL_NAME,\n} from './tools/delegate-research'\nimport {\n DELEGATION_HISTORY_DESCRIPTION,\n DELEGATION_HISTORY_INPUT_SCHEMA,\n DELEGATION_HISTORY_TOOL_NAME,\n} from './tools/delegation-history'\nimport {\n DELEGATION_STATUS_DESCRIPTION,\n DELEGATION_STATUS_INPUT_SCHEMA,\n DELEGATION_STATUS_TOOL_NAME,\n} from './tools/delegation-status'\n\nfunction buildTool(\n name: string,\n description: string,\n parameters: Readonly<Record<string, unknown>>,\n): OpenAIChatTool {\n // `parameters` arrives as a deeply-readonly `as const` literal. The\n // OpenAI-compat backend JSON-serializes the body so a shallow copy\n // into a plain object is sufficient — and shields callers that mutate\n // the returned descriptor from corrupting the source constant.\n return {\n type: 'function',\n function: { name, description, parameters: { ...parameters } },\n }\n}\n\n/**\n * @experimental\n *\n * Returns the 5 delegation tools projected into OpenAI Chat Completions\n * `tools[]` shape. The order is stable: `delegate_code`,\n * `delegate_research`, `delegate_feedback`, `delegation_status`,\n * `delegation_history`.\n */\nexport function mcpToolsForRuntimeMcp(): OpenAIChatTool[] {\n return [\n buildTool(\n DELEGATE_CODE_TOOL_NAME,\n DELEGATE_CODE_DESCRIPTION,\n DELEGATE_CODE_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n buildTool(\n DELEGATE_RESEARCH_TOOL_NAME,\n DELEGATE_RESEARCH_DESCRIPTION,\n DELEGATE_RESEARCH_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n buildTool(\n DELEGATE_FEEDBACK_TOOL_NAME,\n DELEGATE_FEEDBACK_DESCRIPTION,\n DELEGATE_FEEDBACK_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n buildTool(\n DELEGATION_STATUS_TOOL_NAME,\n DELEGATION_STATUS_DESCRIPTION,\n DELEGATION_STATUS_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n buildTool(\n DELEGATION_HISTORY_TOOL_NAME,\n DELEGATION_HISTORY_DESCRIPTION,\n DELEGATION_HISTORY_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n ]\n}\n\n/**\n * @experimental\n *\n * Subset filter — return only the projected tools whose `function.name`\n * appears in `names`. Useful for curated mounts (e.g. only the queue-bound\n * delegation tools, omitting `delegate_feedback`). Unknown names are\n * silently ignored; pass an empty array to get an empty result.\n */\nexport function mcpToolsForRuntimeMcpSubset(names: ReadonlyArray<string>): OpenAIChatTool[] {\n const allowed = new Set(names)\n return mcpToolsForRuntimeMcp().filter((tool) => allowed.has(tool.function.name))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkDA,SAAS,UACP,MACA,aACA,YACgB;AAKhB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,UAAU,EAAE,MAAM,aAAa,YAAY,EAAE,GAAG,WAAW,EAAE;AAAA,EAC/D;AACF;AAUO,SAAS,wBAA0C;AACxD,SAAO;AAAA,IACL;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAUO,SAAS,4BAA4B,OAAgD;AAC1F,QAAM,UAAU,IAAI,IAAI,KAAK;AAC7B,SAAO,sBAAsB,EAAE,OAAO,CAAC,SAAS,QAAQ,IAAI,KAAK,SAAS,IAAI,CAAC;AACjF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runLoop
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IFG6GX6A.js";
|
|
4
4
|
import {
|
|
5
5
|
coderProfile,
|
|
6
6
|
multiHarnessCoderFanout
|
|
@@ -78,6 +78,7 @@ function createDefaultCoderDelegate(options) {
|
|
|
78
78
|
const sandboxClient = executor.client;
|
|
79
79
|
const fanoutHarnesses = options.fanoutHarnesses;
|
|
80
80
|
const maxConcurrency = options.maxConcurrency ?? 4;
|
|
81
|
+
const traceEmitter = options.traceEmitter;
|
|
81
82
|
return async (args, ctx) => {
|
|
82
83
|
const task = {
|
|
83
84
|
goal: buildCoderGoal(args),
|
|
@@ -97,7 +98,7 @@ function createDefaultCoderDelegate(options) {
|
|
|
97
98
|
output,
|
|
98
99
|
validator,
|
|
99
100
|
task,
|
|
100
|
-
ctx: { sandboxClient, signal: ctx.signal },
|
|
101
|
+
ctx: { sandboxClient, signal: ctx.signal, ...traceEmitter ? { traceEmitter } : {} },
|
|
101
102
|
maxIterations: 1,
|
|
102
103
|
maxConcurrency
|
|
103
104
|
});
|
|
@@ -122,7 +123,7 @@ function createDefaultCoderDelegate(options) {
|
|
|
122
123
|
output: fanout.output,
|
|
123
124
|
validator: fanout.validator,
|
|
124
125
|
task,
|
|
125
|
-
ctx: { sandboxClient, signal: ctx.signal },
|
|
126
|
+
ctx: { sandboxClient, signal: ctx.signal, ...traceEmitter ? { traceEmitter } : {} },
|
|
126
127
|
maxIterations: variants,
|
|
127
128
|
maxConcurrency: Math.min(maxConcurrency, variants)
|
|
128
129
|
});
|
|
@@ -209,4 +210,4 @@ export {
|
|
|
209
210
|
createFleetWorkspaceExecutor,
|
|
210
211
|
createDefaultCoderDelegate
|
|
211
212
|
};
|
|
212
|
-
//# sourceMappingURL=chunk-
|
|
213
|
+
//# sourceMappingURL=chunk-WMBYQPYM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/mcp/executor.ts","../src/mcp/delegates.ts"],"sourcesContent":["/**\n * @experimental\n *\n * Delegation executors — the layer between MCP delegates and the sandbox\n * substrate. Each executor exposes a {@link LoopSandboxClient} the kernel\n * consumes plus a placement tag so the trace pipeline can correlate workers\n * with their physical placement.\n *\n * Two implementations ship in-box:\n *\n * - {@link createSiblingSandboxExecutor} — every delegation spawns a fresh\n * sandbox sibling to the caller. Default when the MCP server runs as a\n * standalone CLI mounted outside a fleet.\n *\n * - {@link createFleetWorkspaceExecutor} — delegations dispatch onto machines\n * in the caller's existing fleet so worker diffs land directly on the\n * caller's filesystem (the fleet's shared workspace). Selected when the\n * parent sandbox passes `TANGLE_FLEET_ID` into the MCP server's env.\n */\n\nimport type { CreateSandboxOptions, SandboxInstance } from '@tangle-network/sandbox'\nimport type { LoopSandboxClient, LoopSandboxPlacement } from '../loops'\n\n/** @experimental */\nexport interface DelegationExecutor {\n /** Sandbox client the kernel calls. Returned with `describePlacement` set. */\n readonly client: LoopSandboxClient\n /** Best-effort one-liner used in stderr boot logs and diagnostics. */\n describe(): string\n}\n\n/** @experimental */\nexport interface SiblingSandboxExecutorOptions {\n client: LoopSandboxClient\n}\n\n/**\n * Wrap a raw sandbox SDK client so the kernel emits\n * `loop.iteration.dispatch` events with `{ placement: 'sibling', sandboxId }`.\n *\n * The returned client `.create()` delegates to the underlying client; the\n * only added behavior is a `describePlacement` tag the kernel reads.\n *\n * @experimental\n */\nexport function createSiblingSandboxExecutor(\n options: SiblingSandboxExecutorOptions,\n): DelegationExecutor {\n const underlying = options.client\n const client: LoopSandboxClient = {\n create(opts?: CreateSandboxOptions): Promise<SandboxInstance> {\n return underlying.create(opts)\n },\n describePlacement(box: SandboxInstance): LoopSandboxPlacement {\n return { kind: 'sibling', sandboxId: readId(box) }\n },\n }\n return {\n client,\n describe(): string {\n return 'sibling-sandbox (each delegation = fresh sandbox via client.create)'\n },\n }\n}\n\n/**\n * Minimal `SandboxFleet` surface the fleet executor calls. Declared\n * structurally so tests can pass an in-memory stub without instantiating the\n * sandbox SDK.\n *\n * @experimental\n */\nexport interface FleetHandle {\n readonly fleetId: string\n /** Machine ids in dispatch-eligible order. The executor round-robins. */\n readonly ids: ReadonlyArray<string>\n /** Resolve a machine id to its `SandboxInstance` — that machine is mounted\n * on the fleet's shared workspace, so any diff the worker writes lands on\n * every other fleet machine's filesystem too. */\n sandbox(machineId: string): Promise<SandboxInstance>\n}\n\n/** @experimental */\nexport interface FleetWorkspaceExecutorOptions {\n fleet: FleetHandle\n /**\n * Override the machine-selection policy. Default = round-robin across\n * `fleet.ids`, skipping the optional `excludeMachineIds` set (typically the\n * coordinator machine the MCP server is running on).\n */\n selectMachine?: (call: { callIndex: number; ids: ReadonlyArray<string> }) => string\n /**\n * Machine ids to skip during default round-robin. Set to the caller's own\n * machineId so workers don't compete with the orchestrator on the same VM.\n */\n excludeMachineIds?: ReadonlyArray<string>\n}\n\n/**\n * Build an executor that resolves each delegated iteration to an existing\n * machine in `fleet`. The fleet's shared-workspace policy means the worker\n * machine sees the caller's filesystem — diffs land in-place with no\n * cross-sandbox copy step.\n *\n * @experimental\n */\nexport function createFleetWorkspaceExecutor(\n options: FleetWorkspaceExecutorOptions,\n): DelegationExecutor {\n const fleet = options.fleet\n const exclude = new Set(options.excludeMachineIds ?? [])\n let callIndex = 0\n // machineId-by-sandboxId, populated as we resolve machines so\n // `describePlacement` can recover the assignment from the SandboxInstance\n // the kernel hands back.\n const placementBySandboxId = new Map<string, { machineId: string }>()\n\n const client: LoopSandboxClient = {\n async create(): Promise<SandboxInstance> {\n const ids = fleet.ids.filter((id) => !exclude.has(id))\n if (ids.length === 0) {\n throw new Error(\n `agent-runtime: fleet ${fleet.fleetId} has no eligible worker machines (ids=[${fleet.ids.join(',')}], excluded=[${[...exclude].join(',')}])`,\n )\n }\n const selector = options.selectMachine\n const machineId = selector ? selector({ callIndex, ids }) : ids[callIndex % ids.length]\n callIndex += 1\n if (typeof machineId !== 'string' || machineId.length === 0) {\n throw new Error('agent-runtime: fleet executor selectMachine returned an empty machine id')\n }\n const box = await fleet.sandbox(machineId)\n const sandboxId = readId(box)\n if (sandboxId) placementBySandboxId.set(sandboxId, { machineId })\n return box\n },\n describePlacement(box: SandboxInstance): LoopSandboxPlacement {\n const sandboxId = readId(box)\n const recorded = sandboxId ? placementBySandboxId.get(sandboxId) : undefined\n return {\n kind: 'fleet',\n sandboxId,\n fleetId: fleet.fleetId,\n machineId: recorded?.machineId,\n }\n },\n }\n\n return {\n client,\n describe(): string {\n const excluded = exclude.size > 0 ? ` (excluded=[${[...exclude].join(',')}])` : ''\n return `fleet-workspace (fleetId=${fleet.fleetId}, machines=[${fleet.ids.join(',')}]${excluded})`\n },\n }\n}\n\nfunction readId(box: SandboxInstance): string | undefined {\n const raw = (box as unknown as { id?: unknown }).id\n return typeof raw === 'string' && raw.length > 0 ? raw : undefined\n}\n","/**\n * @experimental\n *\n * Delegate factories — the layer between MCP tool handlers and the\n * underlying `runLoop` runners.\n *\n * The MCP server is profile-agnostic: it owns the task queue + feedback\n * store + transport. Each `*Delegate` is the closure that the queue\n * invokes when a task runs. Consumers can override either delegate to\n * inject custom drivers, mocks, fleet-aware dispatchers, etc.\n *\n * The default coder delegate is wired here because we own\n * `coderProfile` / `multiHarnessCoderFanout`. The default researcher\n * delegate is **not** wired in this file — `agent-knowledge` cannot be\n * imported from `agent-runtime` without inducing a cycle. Consumers\n * pass `researcherDelegate` explicitly when constructing the server.\n */\n\nimport type { Iteration, LoopSandboxClient, LoopTraceEmitter } from '../loops'\nimport { runLoop } from '../loops'\nimport { type CoderOutput, coderProfile, multiHarnessCoderFanout } from '../profiles/coder'\nimport { createSiblingSandboxExecutor, type DelegationExecutor } from './executor'\nimport type {\n CoderTask,\n DelegateCodeArgs,\n DelegateResearchArgs,\n DelegationProgress,\n ResearchOutputShape,\n} from './types'\n\n/** @experimental */\nexport interface DelegateRunCtx {\n signal: AbortSignal\n report(progress: DelegationProgress): void\n}\n\n/** @experimental */\nexport type CoderDelegate = (\n args: DelegateCodeArgs,\n ctx: DelegateRunCtx,\n) => Promise<import('../profiles/coder').CoderOutput>\n\n/** @experimental */\nexport type ResearcherDelegate = (\n args: DelegateResearchArgs,\n ctx: DelegateRunCtx,\n) => Promise<ResearchOutputShape>\n\n/** @experimental Structured review verdict over a coder candidate. */\nexport interface CoderReview {\n /** Gate: only approved candidates are eligible to win. */\n approved: boolean\n /** Reviewer's recommendation — surfaced in traces. */\n recommendation: 'ship' | 'approve-with-nits' | 'changes-requested' | 'reject'\n /** Readiness 0..1, used by the `highest-readiness` winner-selection strategy. */\n readiness: number\n notes?: string\n}\n\n/**\n * @experimental\n *\n * Optional adversarial reviewer over a coder candidate that already passed\n * mechanical validation (tests/typecheck/forbidden/diff/no-op/secrets). Folded\n * from the ai-trading-blueprint delegation MCP: a candidate is only eligible to\n * win if the reviewer approves it. The reviewer is the consumer's seam — an LLM\n * judge, a `pnpm review` command, anything returning a `CoderReview`.\n */\nexport type CoderReviewer = (\n output: import('../profiles/coder').CoderOutput,\n task: CoderTask,\n ctx: { signal: AbortSignal },\n) => Promise<CoderReview> | CoderReview\n\n/**\n * @experimental Winner-selection strategy among validated (+ reviewed)\n * candidates. `highest-readiness` requires a `reviewer`. Default `highest-score`\n * (the kernel's behavior — preserves backward compatibility).\n */\nexport type CoderWinnerSelection =\n | 'highest-score'\n | 'smallest-diff'\n | 'highest-readiness'\n | 'first-approved'\n\n/** @experimental */\nexport interface CreateDefaultCoderDelegateOptions {\n /**\n * Execution placement. Pass a {@link DelegationExecutor} (sibling or fleet)\n * to control where worker iterations land. `sandboxClient` is a\n * convenience shorthand that wraps the client in a sibling executor — pass\n * one or the other, not both.\n */\n executor?: DelegationExecutor\n /**\n * Convenience shorthand for sibling placement. Equivalent to\n * `executor: createSiblingSandboxExecutor({ client: sandboxClient })`.\n */\n sandboxClient?: LoopSandboxClient\n /** Default `['claude-code', 'codex', 'opencode/zai-coding-plan/glm-5.1']` when variants > 1. */\n fanoutHarnesses?: string[]\n /** Hard cap on the kernel's per-batch concurrency. Default 4. */\n maxConcurrency?: number\n /**\n * Optional adversarial reviewer. When set, a candidate must pass mechanical\n * validation AND `reviewer.approved` to be eligible to win — empty/secret/\n * test-failing patches are already gone; this catches the \"compiles + passes\n * but wrong/unsafe\" class the deterministic validator can't see.\n */\n reviewer?: CoderReviewer\n /** Winner-selection strategy among eligible candidates. Default `highest-score`. */\n winnerSelection?: CoderWinnerSelection\n /**\n * Loop trace emitter forwarded into every delegated `runLoop`. Wire\n * `createPropagatingTraceEmitter(readTraceContextFromEnv())` here (the bin\n * does) so delegated build-loops export their topology spans to the OTLP /\n * Tangle Intelligence sink when `OTEL_EXPORTER_OTLP_ENDPOINT` is set — and\n * are a cheap no-op when it isn't. Configurable by construction.\n */\n traceEmitter?: LoopTraceEmitter\n}\n\n/**\n * Build a coder delegate that drives `runLoop` against the project's\n * sandbox client + coder profile. When `args.variants > 1` it switches\n * to the multi-harness fanout topology.\n *\n * @experimental\n */\nexport function createDefaultCoderDelegate(\n options: CreateDefaultCoderDelegateOptions,\n): CoderDelegate {\n const executor = resolveExecutor(options)\n const sandboxClient = executor.client\n const fanoutHarnesses = options.fanoutHarnesses\n const maxConcurrency = options.maxConcurrency ?? 4\n const traceEmitter = options.traceEmitter\n return async (args, ctx) => {\n const task: CoderTask = {\n goal: buildCoderGoal(args),\n repoRoot: args.repoRoot,\n testCmd: args.config?.testCmd,\n typecheckCmd: args.config?.typecheckCmd,\n forbiddenPaths: args.config?.forbiddenPaths,\n maxDiffLines: args.config?.maxDiffLines,\n }\n const variants = Math.max(1, Math.trunc(args.variants ?? 1))\n ctx.report({ iteration: 0, phase: 'starting' })\n if (variants <= 1) {\n const { agentRunSpec, output, validator } = coderProfile({ task })\n const result = await runLoop({\n driver: singleShotDriver,\n agentRun: agentRunSpec,\n output,\n validator,\n task,\n ctx: { sandboxClient, signal: ctx.signal, ...(traceEmitter ? { traceEmitter } : {}) },\n maxIterations: 1,\n maxConcurrency,\n })\n const chosen = await pickCoderWinner({\n iterations: result.iterations,\n reviewer: options.reviewer,\n selection: options.winnerSelection ?? 'highest-score',\n task,\n signal: ctx.signal,\n })\n if (!chosen) throw new Error(noWinnerMessage(options.reviewer))\n ctx.report({ iteration: 1, phase: 'completed' })\n return chosen\n }\n const fanout = multiHarnessCoderFanout(\n fanoutHarnesses && fanoutHarnesses.length > 0\n ? { harnesses: fanoutHarnesses.slice(0, variants) }\n : { harnesses: undefined },\n )\n const agentRuns = fanout.agentRuns.slice(0, variants)\n const result = await runLoop({\n driver: fanout.driver,\n agentRuns,\n output: fanout.output,\n validator: fanout.validator,\n task,\n ctx: { sandboxClient, signal: ctx.signal, ...(traceEmitter ? { traceEmitter } : {}) },\n maxIterations: variants,\n maxConcurrency: Math.min(maxConcurrency, variants),\n })\n const chosen = await pickCoderWinner({\n iterations: result.iterations,\n reviewer: options.reviewer,\n selection: options.winnerSelection ?? 'highest-score',\n task,\n signal: ctx.signal,\n })\n if (!chosen) throw new Error(noWinnerMessage(options.reviewer))\n ctx.report({ iteration: agentRuns.length, phase: 'completed' })\n return chosen\n }\n}\n\ninterface PickCoderWinnerArgs {\n iterations: ReadonlyArray<Iteration<CoderTask, CoderOutput>>\n reviewer: CoderReviewer | undefined\n selection: CoderWinnerSelection\n task: CoderTask\n signal: AbortSignal\n}\n\ninterface CoderCandidate {\n index: number\n output: CoderOutput\n score: number\n readiness: number\n}\n\n/**\n * Pick the winning coder candidate from a finished loop's iterations:\n * 1. keep only mechanically-VALID candidates (the validator already gated\n * tests/typecheck/forbidden/diff/no-op/secrets),\n * 2. if a `reviewer` is wired, keep only those it APPROVES,\n * 3. select among survivors by the chosen strategy.\n * Returns `undefined` when nothing survives — the delegate fails loud.\n */\nasync function pickCoderWinner(args: PickCoderWinnerArgs): Promise<CoderOutput | undefined> {\n const valid: CoderCandidate[] = []\n for (const iter of args.iterations) {\n if (iter.output === undefined || iter.error || iter.verdict?.valid !== true) continue\n valid.push({\n index: iter.index,\n output: iter.output,\n score: iter.verdict.score ?? 0,\n readiness: iter.verdict.score ?? 0,\n })\n }\n if (valid.length === 0) return undefined\n\n let eligible = valid\n if (args.reviewer) {\n eligible = []\n for (const c of valid) {\n const review = await args.reviewer(c.output, args.task, { signal: args.signal })\n if (review.approved) eligible.push({ ...c, readiness: review.readiness })\n }\n if (eligible.length === 0) return undefined\n }\n\n return selectCoderCandidate(eligible, args.selection).output\n}\n\n/** Apply the winner-selection strategy; ties broken by earliest iteration. */\nfunction selectCoderCandidate(\n candidates: CoderCandidate[],\n selection: CoderWinnerSelection,\n): CoderCandidate {\n const diffLines = (c: CoderCandidate) =>\n c.output.diffStats.insertions + c.output.diffStats.deletions\n const sorted = [...candidates].sort((a, b) => {\n switch (selection) {\n case 'smallest-diff':\n return diffLines(a) - diffLines(b) || a.index - b.index\n case 'highest-readiness':\n return b.readiness - a.readiness || a.index - b.index\n case 'first-approved':\n return a.index - b.index\n default:\n return b.score - a.score || a.index - b.index\n }\n })\n return sorted[0]!\n}\n\nfunction noWinnerMessage(reviewer: CoderReviewer | undefined): string {\n return reviewer\n ? 'coder delegate: no candidate passed validation + review'\n : 'coder delegate: no candidate passed validation'\n}\n\nfunction buildCoderGoal(args: DelegateCodeArgs): string {\n if (!args.contextHint) return args.goal\n return [args.goal, '', '## Context', args.contextHint].join('\\n')\n}\n\nfunction resolveExecutor(options: CreateDefaultCoderDelegateOptions): DelegationExecutor {\n if (options.executor && options.sandboxClient) {\n throw new Error('createDefaultCoderDelegate: pass exactly one of `executor` or `sandboxClient`')\n }\n if (options.executor) return options.executor\n if (options.sandboxClient) {\n return createSiblingSandboxExecutor({ client: options.sandboxClient })\n }\n throw new Error('createDefaultCoderDelegate: `executor` or `sandboxClient` is required')\n}\n\n/**\n * Single-shot driver — plan one task on iteration 0, stop after one\n * iteration. Used by the coder delegate when `variants <= 1`. Keeps the\n * runLoop kernel-level accounting (timing, cost, trace emission) while\n * skipping fanout/refine topology overhead.\n */\nconst singleShotDriver = {\n name: 'mcp-single-shot',\n async plan<Task>(task: Task, history: ReadonlyArray<unknown>): Promise<Task[]> {\n return history.length === 0 ? [task] : []\n },\n decide(history: ReadonlyArray<unknown>): 'pick-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AClD,KAAK;AACH,eAAO,EAAE,QAAQ,EAAE;AAAA,MACrB;AACE,eAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE;AAAA,IAC5C;AAAA,EACF,CAAC;AACD,SAAO,OAAO,CAAC;AACjB;AAEA,SAAS,gBAAgB,UAA6C;AACpE,SAAO,WACH,4DACA;AACN;AAEA,SAAS,eAAe,MAAgC;AACtD,MAAI,CAAC,KAAK,YAAa,QAAO,KAAK;AACnC,SAAO,CAAC,KAAK,MAAM,IAAI,cAAc,KAAK,WAAW,EAAE,KAAK,IAAI;AAClE;AAEA,SAAS,gBAAgB,SAAgE;AACvF,MAAI,QAAQ,YAAY,QAAQ,eAAe;AAC7C,UAAM,IAAI,MAAM,+EAA+E;AAAA,EACjG;AACA,MAAI,QAAQ,SAAU,QAAO,QAAQ;AACrC,MAAI,QAAQ,eAAe;AACzB,WAAO,6BAA6B,EAAE,QAAQ,QAAQ,cAAc,CAAC;AAAA,EACvE;AACA,QAAM,IAAI,MAAM,uEAAuE;AACzF;AAQA,IAAM,mBAAmB;AAAA,EACvB,MAAM;AAAA,EACN,MAAM,KAAW,MAAY,SAAkD;AAC7E,WAAO,QAAQ,WAAW,IAAI,CAAC,IAAI,IAAI,CAAC;AAAA,EAC1C;AAAA,EACA,OAAO,SAAyD;AAC9D,WAAO,QAAQ,SAAS,IAAI,gBAAgB;AAAA,EAC9C;AACF;","names":["result","chosen"]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { AgentProfileFileMount, AgentProfileMcpServer, AgentProfile } from '@tangle-network/sandbox';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Production-profile composition for the agent-runtime delegation MCP.
|
|
5
|
+
*
|
|
6
|
+
* A product agent's sandbox loads the delegation tools (`delegate_code`,
|
|
7
|
+
* `delegate_research`, `delegate_feedback`, `delegation_status`,
|
|
8
|
+
* `delegation_history`) by mounting the `agent-runtime-mcp` stdio server as
|
|
9
|
+
* an MCP entry in its `AgentProfile`. This module is the single composer for
|
|
10
|
+
* that wiring, so every consumer — the fleet agents and agent-builder's
|
|
11
|
+
* generated agents — shares one implementation instead of copying it.
|
|
12
|
+
*
|
|
13
|
+
* The load-bearing invariant: the delegation MCP entry is only ever emitted
|
|
14
|
+
* when a sandbox API key is present. Without the key the kernel's
|
|
15
|
+
* coder/researcher delegate cannot construct an authenticated sandbox client,
|
|
16
|
+
* so we omit the entry rather than ship an MCP child that fails to
|
|
17
|
+
* authenticate on startup. No static profile entry, ever.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/** MCP server key under which the agent-runtime delegation tools mount. */
|
|
21
|
+
declare const DELEGATION_MCP_SERVER_KEY = "agent-runtime-delegation";
|
|
22
|
+
interface BuildDelegationMcpServerOptions {
|
|
23
|
+
/** Sandbox API key forwarded as `TANGLE_API_KEY` to the MCP child. The
|
|
24
|
+
* agent-runtime MCP bin reads `TANGLE_API_KEY` and passes it straight to
|
|
25
|
+
* `new Sandbox({ apiKey })`. Defaults to `env.TANGLE_API_KEY`. */
|
|
26
|
+
sandboxApiKey?: string;
|
|
27
|
+
/** Sandbox base URL forwarded as `SANDBOX_BASE_URL`. Defaults to
|
|
28
|
+
* `env.SANDBOX_BASE_URL`, then `env.SANDBOX_API_URL`, then the public
|
|
29
|
+
* sandbox endpoint. */
|
|
30
|
+
sandboxBaseUrl?: string;
|
|
31
|
+
/** Environment source for key + OTEL resolution. Defaults to `process.env`;
|
|
32
|
+
* injectable for tests and non-process callers. */
|
|
33
|
+
env?: Record<string, string | undefined>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Build the delegation MCP entry the sandbox-side agent loads on startup.
|
|
37
|
+
* Returns `undefined` when no sandbox API key is resolvable — callers merge
|
|
38
|
+
* the result into a profile's `mcp` map only when defined.
|
|
39
|
+
*/
|
|
40
|
+
declare function buildDelegationMcpServer(options?: BuildDelegationMcpServerOptions): Record<string, AgentProfileMcpServer> | undefined;
|
|
41
|
+
interface ComposeProductionAgentProfileOptions {
|
|
42
|
+
/** Sandbox API key forwarded to the delegation MCP child. Defaults to
|
|
43
|
+
* `env.TANGLE_API_KEY`. When unset, the delegation MCP entry is omitted. */
|
|
44
|
+
sandboxApiKey?: string;
|
|
45
|
+
/** Sandbox base URL forwarded as `SANDBOX_BASE_URL` to the MCP child. */
|
|
46
|
+
sandboxBaseUrl?: string;
|
|
47
|
+
/** Replace the base profile's system prompt. Used by per-turn calls that
|
|
48
|
+
* swap in workspace-augmented prompts (board summary, learned style). */
|
|
49
|
+
systemPrompt?: string;
|
|
50
|
+
/** Extra file mounts layered after the base profile's `resources.files`. */
|
|
51
|
+
extraFiles?: AgentProfileFileMount[];
|
|
52
|
+
/** Override the profile `name`. Defaults to the base profile's name. */
|
|
53
|
+
name?: string;
|
|
54
|
+
/** Environment source for key + OTEL resolution. Defaults to `process.env`. */
|
|
55
|
+
env?: Record<string, string | undefined>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Compose the production `AgentProfile`: the canonical base profile with the
|
|
59
|
+
* delegation MCP merged into `mcp`. Used by every call site that boots a
|
|
60
|
+
* sandbox or runs a chat turn through the sandbox path, and by eval wiring so
|
|
61
|
+
* the scorecard profile hash reflects the actual production profile.
|
|
62
|
+
*
|
|
63
|
+
* Merge rules:
|
|
64
|
+
* - `mcp`: base map preserved; the delegation entry is appended under
|
|
65
|
+
* {@link DELEGATION_MCP_SERVER_KEY}, and omitted entirely when no sandbox
|
|
66
|
+
* API key resolves.
|
|
67
|
+
* - `prompt.systemPrompt`: replaced when `options.systemPrompt` is set.
|
|
68
|
+
* - `resources.files`: `options.extraFiles` concatenated after base files.
|
|
69
|
+
* - `name`: replaced when `options.name` is set.
|
|
70
|
+
*/
|
|
71
|
+
declare function composeProductionAgentProfile(baseProfile: AgentProfile, options?: ComposeProductionAgentProfileOptions): AgentProfile;
|
|
72
|
+
|
|
73
|
+
export { type BuildDelegationMcpServerOptions as B, type ComposeProductionAgentProfileOptions as C, DELEGATION_MCP_SERVER_KEY as D, buildDelegationMcpServer as b, composeProductionAgentProfile as c };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { AgentEvalError, KnowledgeReadinessReport, RunRecord, ControlEvalResult, KnowledgeRequirement } from '@tangle-network/agent-eval';
|
|
2
2
|
export { AgentEvalError, AgentEvalErrorCode, ConfigError, ControlBudget, ControlDecision, ControlEvalResult, ControlRunResult, ControlStep, DataAcquisitionPlan, JudgeError, KnowledgeReadinessReport, KnowledgeRequirement, NotFoundError, RunRecord, ValidationError } from '@tangle-network/agent-eval';
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
export { C as CoderLoopRunnerOptions, D as DELEGATED_LOOP_MODES, a as DelegatedLoopMode, b as DelegatedLoopRegistry, c as DelegatedLoopResult, d as DelegatedLoopRunner, e as DynamicLoopRunnerOptions, L as LoopRunnerCliArgs, f as LoopRunnerCliResult, R as ResearchLoopResult, g as ResearchLoopRunnerOptions, h as RunDelegatedLoopOptions, V as VetoedFact, i as auditLoopRunner, j as coderLoopRunner, k as dynamicLoopRunner, l as isDelegatedLoopMode, p as parseLoopRunnerArgv, r as researchLoopRunner, m as reviewLoopRunner, n as runDelegatedLoop, o as runLoopRunnerCli, s as selfImproveLoopRunner } from './loop-runner-bin-
|
|
6
|
-
export { E as EvalRunEvent, b as EvalRunGeneration, c as EvalRunsExportConfig, d as EvalRunsExportResult, I as INTELLIGENCE_WIRE_VERSION, e as OtelAttribute, f as OtelExportConfig, O as OtelExporter, g as OtelSpan, h as buildLoopOtelSpans, i as createOtelExporter, j as exportEvalRuns, l as loopEventToOtelSpan, m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from './otel-export-
|
|
7
|
-
|
|
3
|
+
import { q as AgentBackendInput, r as AgentExecutionBackend, O as OpenAIChatTool, s as OpenAIChatToolChoice, t as AgentBackendContext, R as RuntimeStreamEvent, K as KnowledgeReadinessDecision, u as RunAgentTaskOptions, v as AgentTaskRunResult, w as RunAgentTaskStreamOptions, x as AgentRuntimeEvent, y as AgentTaskStatus, z as RuntimeSessionStore, B as RuntimeSession } from './types-Bcp071Jg.js';
|
|
4
|
+
export { C as AgentAdapter, F as AgentKnowledgeProvider, G as AgentRuntimeEventSink, H as AgentTaskContext, J as AgentTaskSpec, M as BackendErrorDetail, N as RuntimeRunHandle, P as RuntimeRunPersistenceAdapter, Q as RuntimeRunRow, S as startRuntimeRun } from './types-Bcp071Jg.js';
|
|
5
|
+
export { C as CoderLoopRunnerOptions, D as DELEGATED_LOOP_MODES, a as DelegatedLoopMode, b as DelegatedLoopRegistry, c as DelegatedLoopResult, d as DelegatedLoopRunner, e as DynamicLoopRunnerOptions, L as LoopRunnerCliArgs, f as LoopRunnerCliResult, R as ResearchLoopResult, g as ResearchLoopRunnerOptions, h as RunDelegatedLoopOptions, V as VetoedFact, i as auditLoopRunner, j as coderLoopRunner, k as dynamicLoopRunner, l as isDelegatedLoopMode, p as parseLoopRunnerArgv, r as researchLoopRunner, m as reviewLoopRunner, n as runDelegatedLoop, o as runLoopRunnerCli, s as selfImproveLoopRunner } from './loop-runner-bin-CVoCBmYk.js';
|
|
6
|
+
export { E as EvalRunEvent, b as EvalRunGeneration, c as EvalRunsExportConfig, d as EvalRunsExportResult, I as INTELLIGENCE_WIRE_VERSION, e as OtelAttribute, f as OtelExportConfig, O as OtelExporter, g as OtelSpan, h as buildLoopOtelSpans, i as createOtelExporter, j as exportEvalRuns, l as loopEventToOtelSpan, m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from './otel-export-BzvF1Ela.js';
|
|
7
|
+
import '@tangle-network/sandbox';
|
|
8
8
|
import '@tangle-network/agent-eval/campaign';
|
|
9
9
|
import './types-p8dWBIXL.js';
|
|
10
10
|
import './optimize-prompt-D-urF2wW.js';
|
|
11
|
-
import './dynamic-
|
|
12
|
-
import './kb-gate-
|
|
11
|
+
import './dynamic-B_7GgCwu.js';
|
|
12
|
+
import './kb-gate-DTBum3vH.js';
|
|
13
13
|
import './profiles.js';
|
|
14
|
-
import '@tangle-network/sandbox';
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* @stable
|
package/dist/index.js
CHANGED
|
@@ -10,22 +10,23 @@ import {
|
|
|
10
10
|
runDelegatedLoop,
|
|
11
11
|
runLoopRunnerCli,
|
|
12
12
|
selfImproveLoopRunner
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BDGYYO7K.js";
|
|
14
14
|
import "./chunk-XBUG326M.js";
|
|
15
15
|
import "./chunk-VOX6Z3II.js";
|
|
16
|
+
import {
|
|
17
|
+
mcpToolsForRuntimeMcp,
|
|
18
|
+
mcpToolsForRuntimeMcpSubset
|
|
19
|
+
} from "./chunk-NRZOXCJK.js";
|
|
16
20
|
import {
|
|
17
21
|
INTELLIGENCE_WIRE_VERSION,
|
|
18
22
|
buildLoopOtelSpans,
|
|
19
23
|
createOtelExporter,
|
|
20
24
|
exportEvalRuns,
|
|
21
|
-
loopEventToOtelSpan
|
|
22
|
-
|
|
23
|
-
mcpToolsForRuntimeMcpSubset
|
|
24
|
-
} from "./chunk-7ZECSZ3C.js";
|
|
25
|
-
import "./chunk-HSX6PFZR.js";
|
|
25
|
+
loopEventToOtelSpan
|
|
26
|
+
} from "./chunk-HVYOHJHK.js";
|
|
26
27
|
import "./chunk-FNMGYYSS.js";
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-WMBYQPYM.js";
|
|
29
|
+
import "./chunk-IFG6GX6A.js";
|
|
29
30
|
import "./chunk-3HMHSN22.js";
|
|
30
31
|
import "./chunk-PY6NMZYX.js";
|
|
31
32
|
import {
|