@tangle-network/agent-runtime 0.56.1 → 0.58.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.
Files changed (41) hide show
  1. package/dist/agent.d.ts +1 -1
  2. package/dist/agent.js +1 -1
  3. package/dist/analyst-loop.d.ts +1 -1
  4. package/dist/{chunk-EXIV2C72.js → chunk-E2L6PG5F.js} +59 -79
  5. package/dist/chunk-E2L6PG5F.js.map +1 -0
  6. package/dist/{chunk-G4NIVG34.js → chunk-ISVIQDIX.js} +4 -3
  7. package/dist/chunk-ISVIQDIX.js.map +1 -0
  8. package/dist/{chunk-4H2FML7G.js → chunk-MDFZSPHA.js} +950 -230
  9. package/dist/chunk-MDFZSPHA.js.map +1 -0
  10. package/dist/{chunk-F5XQA43K.js → chunk-VAGARXI5.js} +2 -2
  11. package/dist/{chunk-6XKXWA7H.js → chunk-ZGPQY6Z3.js} +2 -2
  12. package/dist/{coder-COuOK8h8.d.ts → coder-CybltHEm.d.ts} +1 -1
  13. package/dist/{coordination-DWNGqygr.d.ts → coordination-BydGBQCZ.d.ts} +164 -4
  14. package/dist/{delegates-D9o5_VFj.d.ts → delegates-C94qchkz.d.ts} +8 -2
  15. package/dist/index.d.ts +6 -6
  16. package/dist/index.js +4 -4
  17. package/dist/intelligence.d.ts +1 -1
  18. package/dist/{loop-runner-bin-CN2Se3jB.d.ts → loop-runner-bin-Noz7P-mS.d.ts} +3 -3
  19. package/dist/loop-runner-bin.d.ts +4 -4
  20. package/dist/loop-runner-bin.js +3 -3
  21. package/dist/loops.d.ts +7 -6
  22. package/dist/loops.js +31 -1
  23. package/dist/mcp/bin.js +3 -3
  24. package/dist/mcp/index.d.ts +20 -82
  25. package/dist/mcp/index.js +4 -4
  26. package/dist/{openai-tools-CoeLQ7Uo.d.ts → openai-tools-d4GKwgya.d.ts} +1 -1
  27. package/dist/profiles.d.ts +2 -2
  28. package/dist/{run-loop-DluzfJ2h.d.ts → run-loop-CcqfR_gy.d.ts} +1 -1
  29. package/dist/runtime.d.ts +336 -67
  30. package/dist/runtime.js +31 -1
  31. package/dist/{types-C8rNlxfV.d.ts → types-CUzjRFZ3.d.ts} +1 -1
  32. package/dist/workflow.d.ts +2 -2
  33. package/dist/workflow.js +1 -1
  34. package/package.json +2 -2
  35. package/skills/loop-writer/SKILL.md +1 -1
  36. package/skills/supervise/SKILL.md +1 -1
  37. package/dist/chunk-4H2FML7G.js.map +0 -1
  38. package/dist/chunk-EXIV2C72.js.map +0 -1
  39. package/dist/chunk-G4NIVG34.js.map +0 -1
  40. /package/dist/{chunk-F5XQA43K.js.map → chunk-VAGARXI5.js.map} +0 -0
  41. /package/dist/{chunk-6XKXWA7H.js.map → chunk-ZGPQY6Z3.js.map} +0 -0
@@ -1,18 +1,18 @@
1
- import { S as SandboxClient, f as LoopSandboxPlacement } from '../types-C8rNlxfV.js';
2
- import { F as FleetHandle, f as DelegationExecutor, d as DelegationTaskQueue, e as CoderDelegate, D as DelegateCodeArgs, g as DelegateCodeResult, h as DelegateFeedbackResult, b as DelegateFeedbackArgs, i as ResearchSource, R as ResearcherDelegate, j as DelegateResearchArgs, k as DelegateResearchResult, U as UiAuditorDelegate, l as DelegateUiAuditArgs, m as DelegateUiAuditResult, n as DelegationHistoryResult, o as DelegationHistoryArgs, p as DelegationStatusResult, q as DelegationStatusArgs } from '../delegates-D9o5_VFj.js';
3
- export { r as CappedDelegationTrace, s as CoderReview, C as CoderReviewer, a as CoderWinnerSelection, t as CreateDefaultCoderDelegateOptions, u as DELEGATION_TRACE_MAX_BYTES, v as DELEGATION_TRACE_MAX_SPANS, w as DelegateCodeConfig, x as DelegateResearchConfig, y as DelegateRunCtx, z as DelegateUiAuditConfig, A as DelegateUiAuditRoute, B as DelegationError, c as DelegationFeedbackSnapshot, E as DelegationHistoryEntry, G as DelegationPersistenceError, H as DelegationProfile, I as DelegationProgress, J as DelegationRecord, K as DelegationResultPayload, L as DelegationResumeContext, M as DelegationResumeDriver, N as DelegationResumeTick, O as DelegationRunContext, P as DelegationStateCorruptError, Q as DelegationStatus, S as DelegationStore, V as DelegationTaskQueueOptions, W as DelegationTraceCaps, X as DelegationTraceCollector, Y as DelegationTraceSpan, Z as DetachedSessionRefParts, _ as DetachedTurn, $ as DriveTurnCapableBox, a0 as DriveTurnResumeDriverOptions, a1 as DriveTurnTick, a2 as FeedbackRating, a3 as FeedbackRefersTo, a4 as FileDelegationStore, a5 as FileDelegationStoreOptions, a6 as FleetWorkspaceExecutorOptions, a7 as InMemoryDelegationStore, a8 as ResearchOutputShape, a9 as RunDetachedTurnOptions, aa as SettleDetachedCoderTurnOptions, ab as SiblingSandboxExecutorOptions, ac as SubmitInput, ad as SubmitOutput, T as TraceContext, ae as UiAuditorDelegationOutput, af as buildDelegationTraceSpans, ag as capDelegationTrace, ah as coderTaskFromArgs, ai as composeLoopTraceEmitters, aj as createDefaultCoderDelegate, ak as createDelegationTraceCollector, al as createDriveTurnResumeDriver, am as createFleetWorkspaceExecutor, an as createPropagatingTraceEmitter, ao as createSiblingSandboxExecutor, ap as detachedTurnEvents, aq as formatDetachedSessionRef, ar as hashIdempotencyInput, as as parseDetachedSessionRef, at as readTraceContextFromEnv, au as runDetachedTurn, av as settleDetachedCoderTurn, aw as traceContextToEnv } from '../delegates-D9o5_VFj.js';
1
+ import { S as SandboxClient, f as LoopSandboxPlacement } from '../types-CUzjRFZ3.js';
2
+ import { F as FleetHandle, f as DelegationExecutor, d as DelegationTaskQueue, e as CoderDelegate, D as DelegateCodeArgs, g as DelegateCodeResult, h as DelegateFeedbackResult, b as DelegateFeedbackArgs, i as ResearchSource, R as ResearcherDelegate, j as DelegateResearchArgs, k as DelegateResearchResult, U as UiAuditorDelegate, l as DelegateUiAuditArgs, m as DelegateUiAuditResult, n as DelegationHistoryResult, o as DelegationHistoryArgs, p as DelegationStatusResult, q as DelegationStatusArgs } from '../delegates-C94qchkz.js';
3
+ export { r as CappedDelegationTrace, s as CoderReview, C as CoderReviewer, a as CoderWinnerSelection, t as CreateDefaultCoderDelegateOptions, u as DELEGATION_TRACE_MAX_BYTES, v as DELEGATION_TRACE_MAX_SPANS, w as DelegateCodeConfig, x as DelegateResearchConfig, y as DelegateRunCtx, z as DelegateUiAuditConfig, A as DelegateUiAuditRoute, B as DelegationError, c as DelegationFeedbackSnapshot, E as DelegationHistoryEntry, G as DelegationPersistenceError, H as DelegationProfile, I as DelegationProgress, J as DelegationRecord, K as DelegationResultPayload, L as DelegationResumeContext, M as DelegationResumeDriver, N as DelegationResumeTick, O as DelegationRunContext, P as DelegationStateCorruptError, Q as DelegationStatus, S as DelegationStore, V as DelegationTaskQueueOptions, W as DelegationTraceCaps, X as DelegationTraceCollector, Y as DelegationTraceSpan, Z as DetachedSessionRefParts, _ as DetachedTurn, $ as DriveTurnCapableBox, a0 as DriveTurnResumeDriverOptions, a1 as DriveTurnTick, a2 as FeedbackRating, a3 as FeedbackRefersTo, a4 as FileDelegationStore, a5 as FileDelegationStoreOptions, a6 as FleetWorkspaceExecutorOptions, a7 as InMemoryDelegationStore, a8 as ResearchOutputShape, a9 as RunDetachedTurnOptions, aa as SettleDetachedCoderTurnOptions, ab as SiblingSandboxExecutorOptions, ac as SubmitInput, ad as SubmitOutput, T as TraceContext, ae as UiAuditorDelegationOutput, af as buildDelegationTraceSpans, ag as capDelegationTrace, ah as coderTaskFromArgs, ai as composeLoopTraceEmitters, aj as createDefaultCoderDelegate, ak as createDelegationTraceCollector, al as createDriveTurnResumeDriver, am as createFleetWorkspaceExecutor, an as createPropagatingTraceEmitter, ao as createSiblingSandboxExecutor, ap as detachedTurnEvents, aq as formatDetachedSessionRef, ar as hashIdempotencyInput, as as parseDetachedSessionRef, at as readTraceContextFromEnv, au as runDetachedTurn, av as settleDetachedCoderTurn, aw as traceContextToEnv } from '../delegates-C94qchkz.js';
4
4
  export { B as BuildDelegationMcpServerOptions, C as ComposeProductionAgentProfileOptions, D as DELEGATION_MCP_SERVER_KEY, b as buildDelegationMcpServer, c as composeProductionAgentProfile } from '../delegation-profile-Bvfro2m1.js';
5
- import { G as GitRunner, F as FeedbackStore } from '../coordination-DWNGqygr.js';
6
- export { A as AnalystRegistry, C as CoordinationEvent, a as CoordinationTools, b as CoordinationToolsOptions, c as CreateWorktreeOptions, D as DiffOptions, d as DiffResult, e as FeedbackEvent, I as InMemoryFeedbackStore, J as JsonRpcMessage, f as JsonRpcResponse, M as MakeWorkerAgent, g as McpServer, h as McpServerOptions, i as McpToolDescriptor, j as McpTransport, Q as Question, k as QuestionDecision, l as QuestionPolicy, m as QuestionRecord, R as RemoveWorktreeOptions, S as SettledWorker, W as WorktreeHandle, n as captureWorktreeDiff, o as createCoordinationTools, p as createInProcessTransport, q as createMcpServer, r as createWorktree, s as eventToSnapshot, t as removeWorktree } from '../coordination-DWNGqygr.js';
5
+ import { G as GitRunner, F as FeedbackStore } from '../coordination-BydGBQCZ.js';
6
+ export { A as AnalystRegistry, C as CoordinationEvent, a as CoordinationTools, b as CoordinationToolsOptions, c as CreateWorktreeOptions, D as DiffOptions, d as DiffResult, e as FeedbackEvent, I as InMemoryFeedbackStore, J as JsonRpcMessage, f as JsonRpcResponse, M as MakeWorkerAgent, g as McpServer, h as McpServerOptions, i as McpToolDescriptor, j as McpTransport, Q as Question, k as QuestionDecision, l as QuestionPolicy, m as QuestionRecord, R as RemoveWorktreeOptions, S as SettledWorker, W as WorktreeHandle, n as captureWorktreeDiff, o as createCoordinationTools, p as createInProcessTransport, q as createMcpServer, r as createWorktree, s as eventToSnapshot, t as removeWorktree } from '../coordination-BydGBQCZ.js';
7
7
  import { L as LocalHarness, r as runLocalHarness } from '../local-harness-BE_h8szs.js';
8
8
  export { a as LocalHarnessResult, R as RunLocalHarnessOptions } from '../local-harness-BE_h8szs.js';
9
9
  export { C as CreateKbGateOptions, F as FactCandidate, a as FactJudge, b as FactJudgeVerdict, K as KbGateResult, c as createKbGate } from '../kb-gate-CuzMYGYM.js';
10
- export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from '../openai-tools-CoeLQ7Uo.js';
10
+ export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from '../openai-tools-d4GKwgya.js';
11
11
  import { AnalystFinding } from '@tangle-network/agent-eval';
12
12
  import { a as UiLens } from '../substrate-CUgk7F7s.js';
13
13
  import '@tangle-network/sandbox';
14
14
  import '../runtime-hooks-C7JwKb9E.js';
15
- import '../coder-COuOK8h8.js';
15
+ import '../coder-CybltHEm.js';
16
16
  import 'node:child_process';
17
17
 
18
18
  /**
@@ -51,63 +51,15 @@ interface DetectExecutorArgs {
51
51
  */
52
52
  declare function detectExecutor(args: DetectExecutorArgs): Promise<DelegationExecutor>;
53
53
 
54
- /**
55
- * @experimental
56
- *
57
- * In-process delegation executor — when `agent-runtime-mcp` is running
58
- * inside a sandbox whose image carries the local coding-harness CLIs
59
- * (claude / codex / opencode), delegations spawn the harness AS A
60
- * SUBPROCESS against a git worktree on the SAME filesystem instead of
61
- * provisioning a sibling sandbox.
62
- *
63
- * Why: zero provisioning latency, worker diffs land in-place, multi-harness
64
- * fanout = N parallel subprocesses in N parallel worktrees.
65
- *
66
- * Selection:
67
- * - env `AGENT_RUNTIME_IN_SANDBOX=1` (set by the parent harness at MCP
68
- * server launch) → in-process executor
69
- * - env `TANGLE_FLEET_ID=...` → fleet executor (Phase 2.5)
70
- * - neither → sibling sandbox executor (default)
71
- *
72
- * Multi-harness rotation: pass `harnesses: ['claude', 'codex', 'opencode']`
73
- * to round-robin across calls. A `runLoop` + `FanoutVote(n: 3)` against this
74
- * executor produces three parallel iterations, each running a different
75
- * harness on its own worktree.
76
- *
77
- * Architecture:
78
- *
79
- * client.create() → returns a fake SandboxInstance whose streamPrompt:
80
- * 1. createWorktree() — git worktree add /workspace/.coder-variants/<id>
81
- * 2. runLocalHarness() — spawn claude/codex/opencode subprocess
82
- * 3. captureWorktreeDiff() — git diff HEAD → patch + stats
83
- * 4. run testCmd + typecheckCmd if specified (the executor doesn't
84
- * own these — caller wires via task-extractor callback)
85
- * 5. emit ONE SandboxEvent { type: 'result', data: { result: CoderOutput } }
86
- * 6. removeWorktree() in finally
87
- */
88
-
89
54
  /** @experimental */
90
55
  interface InProcessExecutorOptions {
91
- /**
92
- * Absolute path to the git repo (the workspace inside the sandbox). The
93
- * executor creates worktrees under `<repoRoot>/.coder-variants/`.
94
- */
56
+ /** Absolute path to the git repo (the workspace). Worktrees go under `<repoRoot>/.coder-variants/`. */
95
57
  repoRoot: string;
96
- /**
97
- * Harnesses to round-robin across calls. With one entry every delegation
98
- * uses that harness; with three you get fanout diversity for free.
99
- * Default `['claude']`.
100
- */
58
+ /** Harnesses to round-robin across `create()` calls. One entry = no fanout. Default `['claude']`. */
101
59
  harnesses?: ReadonlyArray<LocalHarness>;
102
- /**
103
- * Optional per-delegation test command. Run with `cwd = worktree.path`
104
- * after the harness exits. The exit code populates
105
- * `CoderOutput.testResult.passed`.
106
- */
60
+ /** Optional per-delegation test command run in the worktree after the harness exits. */
107
61
  testCmd?: string;
108
- /**
109
- * Optional per-delegation typecheck command. Same shape as `testCmd`.
110
- */
62
+ /** Optional per-delegation typecheck command. Same shape as `testCmd`. */
111
63
  typecheckCmd?: string;
112
64
  /** Wall-clock cap per harness subprocess (ms). Default 5min. */
113
65
  harnessTimeoutMs?: number;
@@ -115,16 +67,10 @@ interface InProcessExecutorOptions {
115
67
  postCheckTimeoutMs?: number;
116
68
  /** Test seam — override the git runner used by the worktree helpers. */
117
69
  runGit?: GitRunner;
118
- /**
119
- * Test seam — override the harness runner. Defaults to spawning the real
120
- * CLI via `runLocalHarness`. Tests inject a stub that returns a scripted
121
- * `LocalHarnessResult`.
122
- */
70
+ /** Test seam — override the harness runner (defaults to the real CLI via `runLocalHarness`). */
123
71
  runHarness?: typeof runLocalHarness;
124
- /**
125
- * Test seam override the post-check runner. Defaults to spawning the
126
- * configured `testCmd` / `typecheckCmd` via `child_process.spawn`.
127
- */
72
+ /** Test seam — override the post-check runner (defaults to a `sh -c` spawn). A throw is folded
73
+ * into a non-fatal `{exitCode:-1}` so a broken check command fails the signal, not the run. */
128
74
  runPostCheck?: (cmd: string, cwd: string, signal?: AbortSignal) => Promise<{
129
75
  exitCode: number;
130
76
  stdout: string;
@@ -133,25 +79,17 @@ interface InProcessExecutorOptions {
133
79
  }
134
80
  /** @experimental */
135
81
  interface InProcessExecutorDescribePlacement extends LoopSandboxPlacement {
136
- /**
137
- * Worktree path in the parent sandbox's filesystem. Set so trace
138
- * consumers can correlate dispatch events with on-disk artifacts after
139
- * the worker exits.
140
- */
82
+ /** Worktree path in the parent sandbox's filesystem (set so traces correlate to on-disk artifacts). */
141
83
  worktreePath?: string;
142
84
  /** Which harness handled this delegation. */
143
85
  harness?: LocalHarness;
144
86
  }
145
87
  /**
146
- * Build an in-process executor.
147
- *
148
- * Returns a {@link DelegationExecutor} whose `client.create()` returns a
149
- * minimal "virtual" SandboxInstance the kernel calls `streamPrompt(msg)`
150
- * on it, which runs the local harness on a worktree and emits one
151
- * `result` event whose `data.result` is a `CoderOutput`-shaped record.
152
- *
153
- * Pairs with `coderProfile`'s event parser (it walks the event list
154
- * back-to-front for the first `type === 'result'`).
88
+ * Build an in-process executor. Returns a {@link DelegationExecutor} whose `client.create()`
89
+ * returns a minimal virtual `SandboxInstance`; the kernel calls `streamPrompt(msg)` on it, which
90
+ * runs the shared worktree-harness core and emits one `result` event whose `data.result` is a
91
+ * `CoderOutput`. The authored profile (`backend.profile`) threads its systemPrompt + model into
92
+ * the harness via the core.
155
93
  *
156
94
  * @experimental
157
95
  */
package/dist/mcp/index.js CHANGED
@@ -4,11 +4,11 @@ import {
4
4
  detectExecutor,
5
5
  readTraceContextFromEnv,
6
6
  traceContextToEnv
7
- } from "../chunk-EXIV2C72.js";
7
+ } from "../chunk-E2L6PG5F.js";
8
8
  import {
9
9
  mcpToolsForRuntimeMcp,
10
10
  mcpToolsForRuntimeMcpSubset
11
- } from "../chunk-F5XQA43K.js";
11
+ } from "../chunk-VAGARXI5.js";
12
12
  import {
13
13
  createKbGate
14
14
  } from "../chunk-FNMGYYSS.js";
@@ -18,7 +18,7 @@ import {
18
18
  createFleetWorkspaceExecutor,
19
19
  createSiblingSandboxExecutor,
20
20
  settleDetachedCoderTurn
21
- } from "../chunk-G4NIVG34.js";
21
+ } from "../chunk-ISVIQDIX.js";
22
22
  import {
23
23
  DELEGATION_MCP_SERVER_KEY,
24
24
  buildDelegationMcpServer,
@@ -81,7 +81,7 @@ import {
81
81
  validateDelegateUiAuditArgs,
82
82
  validateDelegationHistoryArgs,
83
83
  validateDelegationStatusArgs
84
- } from "../chunk-4H2FML7G.js";
84
+ } from "../chunk-MDFZSPHA.js";
85
85
  import "../chunk-7QYOXFCD.js";
86
86
  import "../chunk-WIR4HOOJ.js";
87
87
  import "../chunk-VLF5RHEQ.js";
@@ -1,4 +1,4 @@
1
- import { c as OpenAIChatTool } from './types-C8rNlxfV.js';
1
+ import { c as OpenAIChatTool } from './types-CUzjRFZ3.js';
2
2
 
3
3
  /**
4
4
  * @experimental
@@ -1,5 +1,5 @@
1
- export { a as CoderCheckConstraints, b as CoderCheckInput, C as CoderOutput, c as CoderProfileOptions, d as CoderTask, M as MultiHarnessCoderFanoutOptions, e as coderProfile, f as createCoderValidator, m as multiHarnessCoderFanout, r as runCoderChecks } from './coder-COuOK8h8.js';
2
- import { S as SandboxClient, O as OutputAdapter, V as Validator, A as AgentRunSpec } from './types-C8rNlxfV.js';
1
+ export { a as CoderCheckConstraints, b as CoderCheckInput, C as CoderOutput, c as CoderProfileOptions, d as CoderTask, M as MultiHarnessCoderFanoutOptions, e as coderProfile, f as createCoderValidator, m as multiHarnessCoderFanout, r as runCoderChecks } from './coder-CybltHEm.js';
2
+ import { S as SandboxClient, O as OutputAdapter, V as Validator, A as AgentRunSpec } from './types-CUzjRFZ3.js';
3
3
  import { a as UiLens, U as UiFinding } from './substrate-CUgk7F7s.js';
4
4
  export { b as UI_FINDING_SEVERITIES, c as UI_LENSES, d as UiFindingScreenshot, e as UiFindingSeverity } from './substrate-CUgk7F7s.js';
5
5
  import { SandboxEvent, AgentProfile } from '@tangle-network/sandbox';
@@ -1,5 +1,5 @@
1
1
  import { SandboxInstance } from '@tangle-network/sandbox';
2
- import { D as Driver, A as AgentRunSpec, O as OutputAdapter, V as Validator, E as ExecCtx, I as Iteration, L as LoopWinner, a as LoopLineageOptions, S as SandboxClient, b as LoopResult } from './types-C8rNlxfV.js';
2
+ import { D as Driver, A as AgentRunSpec, O as OutputAdapter, V as Validator, E as ExecCtx, I as Iteration, L as LoopWinner, a as LoopLineageOptions, S as SandboxClient, b as LoopResult } from './types-CUzjRFZ3.js';
3
3
 
4
4
  /**
5
5
  * @experimental