@tangle-network/agent-runtime 0.89.0 → 0.90.1

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 (69) hide show
  1. package/README.md +51 -18
  2. package/dist/agent.d.ts +53 -2
  3. package/dist/agent.js +168 -6
  4. package/dist/agent.js.map +1 -1
  5. package/dist/analyst-loop.d.ts +1 -1
  6. package/dist/chunk-5QOB7H74.js +387 -0
  7. package/dist/chunk-5QOB7H74.js.map +1 -0
  8. package/dist/{chunk-4WXGK6GV.js → chunk-7ON74BQO.js} +2 -2
  9. package/dist/{chunk-7LO5GMAO.js → chunk-CMYMTRGA.js} +14 -5
  10. package/dist/chunk-CMYMTRGA.js.map +1 -0
  11. package/dist/{chunk-UD4BHQMI.js → chunk-IVGYLCFH.js} +2 -2
  12. package/dist/{chunk-UD4BHQMI.js.map → chunk-IVGYLCFH.js.map} +1 -1
  13. package/dist/{chunk-VNOOH22O.js → chunk-OOL3675H.js} +85 -4
  14. package/dist/chunk-OOL3675H.js.map +1 -0
  15. package/dist/{chunk-5AVV7KAH.js → chunk-QK4DV5PR.js} +2 -2
  16. package/dist/chunk-R2VAJGR3.js +214 -0
  17. package/dist/chunk-R2VAJGR3.js.map +1 -0
  18. package/dist/{chunk-N7EJV7N3.js → chunk-RYBVU4M3.js} +3592 -3562
  19. package/dist/chunk-RYBVU4M3.js.map +1 -0
  20. package/dist/{chunk-BQPFZE2C.js → chunk-WRUSWK4F.js} +5 -5
  21. package/dist/{chunk-PIPPLSOF.js → chunk-ZV4LXYCJ.js} +451 -24
  22. package/dist/chunk-ZV4LXYCJ.js.map +1 -0
  23. package/dist/{worktree-harness-CX_McRLp.d.ts → completion-gate-DkAnUmpb.d.ts} +45 -45
  24. package/dist/{coordination-CuDLO8wj.d.ts → coordination-rRj5hjJK.d.ts} +415 -227
  25. package/dist/environment-provider.d.ts +3 -3
  26. package/dist/index.d.ts +255 -16
  27. package/dist/index.js +463 -72
  28. package/dist/index.js.map +1 -1
  29. package/dist/intelligence.d.ts +228 -84
  30. package/dist/intelligence.js +259 -166
  31. package/dist/intelligence.js.map +1 -1
  32. package/dist/knowledge.d.ts +120 -0
  33. package/dist/knowledge.js +28 -0
  34. package/dist/knowledge.js.map +1 -0
  35. package/dist/lifecycle.d.ts +2 -2
  36. package/dist/lifecycle.js +2 -2
  37. package/dist/{local-harness-sI0S_XNA.d.ts → local-harness-dcD5WTTr.d.ts} +3 -0
  38. package/dist/{loop-runner-bin-hQDUL8Ld.d.ts → loop-runner-bin-DTbZVGfM.d.ts} +2 -2
  39. package/dist/loop-runner-bin.d.ts +6 -6
  40. package/dist/loop-runner-bin.js +7 -7
  41. package/dist/loops.d.ts +34 -369
  42. package/dist/loops.js +31 -5
  43. package/dist/mcp/bin.js +5 -5
  44. package/dist/mcp/index.d.ts +10 -11
  45. package/dist/mcp/index.js +10 -10
  46. package/dist/{mcp-serve-verifier-FL7-ZEb_.d.ts → mcp-serve-verifier-XsX8rkB9.d.ts} +12 -1
  47. package/dist/{openai-tools-BnrOmGjN.d.ts → openai-tools-C4ZfUD4L.d.ts} +1 -1
  48. package/dist/profiles.d.ts +196 -5
  49. package/dist/profiles.js +8 -0
  50. package/dist/profiles.js.map +1 -1
  51. package/dist/{router-client-r8y_VFVM.d.ts → router-client-DJImUDlm.d.ts} +1 -1
  52. package/dist/structural-rollout-MwlpgQ-6.d.ts +446 -0
  53. package/dist/supervise-DPmYPk0j.d.ts +131 -0
  54. package/dist/{types-ESeMOj94.d.ts → types-SyuwunY_.d.ts} +1 -1
  55. package/dist/{types-Driepl87.d.ts → types-eMNgWgFi.d.ts} +2 -2
  56. package/dist/{worktree-fanout-D6xR2CIA.d.ts → worktree-fanout-BDFQIO-Y.d.ts} +234 -234
  57. package/package.json +12 -4
  58. package/skills/agent-runtime-adoption/SKILL.md +74 -24
  59. package/skills/build-with-agent-runtime/SKILL.md +23 -20
  60. package/skills/loop-writer/SKILL.md +6 -5
  61. package/skills/supervise/SKILL.md +2 -2
  62. package/dist/chunk-7LO5GMAO.js.map +0 -1
  63. package/dist/chunk-N7EJV7N3.js.map +0 -1
  64. package/dist/chunk-PIPPLSOF.js.map +0 -1
  65. package/dist/chunk-VNOOH22O.js.map +0 -1
  66. package/dist/otel-export-BKmNwiCb.d.ts +0 -180
  67. /package/dist/{chunk-4WXGK6GV.js.map → chunk-7ON74BQO.js.map} +0 -0
  68. /package/dist/{chunk-5AVV7KAH.js.map → chunk-QK4DV5PR.js.map} +0 -0
  69. /package/dist/{chunk-BQPFZE2C.js.map → chunk-WRUSWK4F.js.map} +0 -0
package/dist/loops.js CHANGED
@@ -12,8 +12,11 @@ import {
12
12
  breadthStrategy,
13
13
  buildSteerContext,
14
14
  builtinShapes,
15
+ canDisplace,
15
16
  collectAgentTurn,
17
+ compareCheckOutcomes,
16
18
  completionAuthorizes,
19
+ composeCheckSources,
17
20
  computeFindingId,
18
21
  createMcpEnvironment,
19
22
  createPushTraceSource,
@@ -24,6 +27,8 @@ import {
24
27
  decodeToolPart,
25
28
  defaultAnalystInstruction,
26
29
  defaultAuditorInstruction,
30
+ defaultExtractCandidate,
31
+ defaultStructuralRolloutPolicy,
27
32
  defaultToolDetectors,
28
33
  defineLeaderboard,
29
34
  definePersona,
@@ -35,6 +40,7 @@ import {
35
40
  equalKOnCost,
36
41
  failuresAnalyst,
37
42
  fanout,
43
+ filterAuthoredAsserts,
38
44
  flatWidenGate,
39
45
  gitWorkspace,
40
46
  harvestCorpus,
@@ -47,8 +53,10 @@ import {
47
53
  loopDispatch,
48
54
  loopUntil,
49
55
  makeFinding,
56
+ modelAuthoredChecks,
50
57
  naiveDriver,
51
58
  observe,
59
+ officialChecksFromMeta,
52
60
  openSandboxRun,
53
61
  pairwiseSignificance,
54
62
  panel,
@@ -68,6 +76,7 @@ import {
68
76
  renderPairwiseMarkdown,
69
77
  renderReport,
70
78
  reportLoopUsage,
79
+ resolveEntrySymbol,
71
80
  resolveSandboxClient,
72
81
  runAgentic,
73
82
  runBenchmark,
@@ -76,20 +85,24 @@ import {
76
85
  runStrategyEvolution,
77
86
  sample,
78
87
  sampleThenRefine,
88
+ sandboxCheckRunner,
79
89
  sandboxSessionTraceSource,
90
+ selectBestIndex,
80
91
  selectChampion,
81
92
  selectValidWinner,
82
93
  sentinelCompletion,
83
94
  stopSentinel,
84
95
  strategyAuthorContract,
85
96
  streamAgentTurn,
97
+ structuralRollout,
86
98
  superviseSurface,
87
99
  trajectoryReport,
88
100
  verify,
101
+ visibleCheckScore,
89
102
  watchTrace,
90
103
  widen,
91
104
  worktreeFanout
92
- } from "./chunk-PIPPLSOF.js";
105
+ } from "./chunk-ZV4LXYCJ.js";
93
106
  import {
94
107
  InMemoryResultBlobStore,
95
108
  InMemorySpawnJournal,
@@ -131,8 +144,9 @@ import {
131
144
  supervisorAgent,
132
145
  supervisorInstructions,
133
146
  workerFromBackend
134
- } from "./chunk-N7EJV7N3.js";
135
- import "./chunk-UD4BHQMI.js";
147
+ } from "./chunk-RYBVU4M3.js";
148
+ import "./chunk-DPEUKJRO.js";
149
+ import "./chunk-IVGYLCFH.js";
136
150
  import {
137
151
  createAgentEnvironmentProviderRegistry,
138
152
  providerAsExecutor,
@@ -147,9 +161,8 @@ import {
147
161
  mapSandboxToolEvent,
148
162
  sumSandboxUsage
149
163
  } from "./chunk-FVJ7M3DA.js";
150
- import "./chunk-7LO5GMAO.js";
164
+ import "./chunk-CMYMTRGA.js";
151
165
  import "./chunk-YEJR7IXO.js";
152
- import "./chunk-DPEUKJRO.js";
153
166
  import "./chunk-DGUM43GV.js";
154
167
  export {
155
168
  FileCorpus,
@@ -172,9 +185,12 @@ export {
172
185
  breadthStrategy,
173
186
  buildSteerContext,
174
187
  builtinShapes,
188
+ canDisplace,
175
189
  cliWorktreeExecutor,
176
190
  collectAgentTurn,
191
+ compareCheckOutcomes,
177
192
  completionAuthorizes,
193
+ composeCheckSources,
178
194
  computeFindingId,
179
195
  contentAddress,
180
196
  createAgentEnvironmentProviderRegistry,
@@ -199,8 +215,10 @@ export {
199
215
  defaultAnalystInstruction,
200
216
  defaultAuditorInstruction,
201
217
  defaultDelegateBudget,
218
+ defaultExtractCandidate,
202
219
  defaultProfileRichnessThresholds,
203
220
  defaultSelectWinner,
221
+ defaultStructuralRolloutPolicy,
204
222
  defaultToolDetectors,
205
223
  defineLeaderboard,
206
224
  definePersona,
@@ -215,6 +233,7 @@ export {
215
233
  extractLlmCallEvent,
216
234
  failuresAnalyst,
217
235
  fanout,
236
+ filterAuthoredAsserts,
218
237
  finalizeBestDelivered,
219
238
  flatWidenGate,
220
239
  gateOnDeliverable,
@@ -231,8 +250,10 @@ export {
231
250
  makeFinding,
232
251
  mapSandboxEvent,
233
252
  mapSandboxToolEvent,
253
+ modelAuthoredChecks,
234
254
  naiveDriver,
235
255
  observe,
256
+ officialChecksFromMeta,
236
257
  openSandboxRun,
237
258
  pairwiseSignificance,
238
259
  panel,
@@ -257,6 +278,7 @@ export {
257
278
  renderReport,
258
279
  reportLoopUsage,
259
280
  resolveAgentEnvironmentProvider,
281
+ resolveEntrySymbol,
260
282
  resolveSandboxClient,
261
283
  routerBrain,
262
284
  routerChatWithTools,
@@ -270,8 +292,10 @@ export {
270
292
  runStrategyEvolution,
271
293
  sample,
272
294
  sampleThenRefine,
295
+ sandboxCheckRunner,
273
296
  sandboxClientAsProvider,
274
297
  sandboxSessionTraceSource,
298
+ selectBestIndex,
275
299
  selectChampion,
276
300
  selectValidWinner,
277
301
  sentinelCompletion,
@@ -281,6 +305,7 @@ export {
281
305
  stopSentinel,
282
306
  strategyAuthorContract,
283
307
  streamAgentTurn,
308
+ structuralRollout,
284
309
  sumSandboxUsage,
285
310
  supervise,
286
311
  superviseSurface,
@@ -288,6 +313,7 @@ export {
288
313
  supervisorInstructions,
289
314
  trajectoryReport,
290
315
  verify,
316
+ visibleCheckScore,
291
317
  watchTrace,
292
318
  widen,
293
319
  workerFromBackend,
package/dist/mcp/bin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readTraceContextFromEnv
4
- } from "../chunk-4WXGK6GV.js";
4
+ } from "../chunk-7ON74BQO.js";
5
5
  import {
6
6
  resolveRouterBaseUrl
7
7
  } from "../chunk-NURIQBJQ.js";
@@ -9,13 +9,13 @@ import {
9
9
  DelegationTaskQueue,
10
10
  FileDelegationStore,
11
11
  createMcpServer
12
- } from "../chunk-N7EJV7N3.js";
13
- import "../chunk-UD4BHQMI.js";
12
+ } from "../chunk-RYBVU4M3.js";
13
+ import "../chunk-DPEUKJRO.js";
14
+ import "../chunk-IVGYLCFH.js";
14
15
  import "../chunk-BZF3KQ6G.js";
15
16
  import "../chunk-FVJ7M3DA.js";
16
- import "../chunk-7LO5GMAO.js";
17
+ import "../chunk-CMYMTRGA.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
@@ -1,19 +1,18 @@
1
- import { S as SandboxClient, d as LoopSandboxPlacement } from '../types-ESeMOj94.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-CuDLO8wj.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, E as DelegateResearchConfig, G as DelegateResearchResult, H as DelegateResult, I as DelegateRunCtx, J as DelegateUiAuditConfig, K as DelegateUiAuditRoute, L as DelegationError, M as DelegationFeedbackSnapshot, N as DelegationHistoryEntry, O as DelegationPersistenceError, P as DelegationProfile, Q as DelegationProgress, R as DelegationRecord, S as DelegationResultPayload, T as DelegationResumeContext, V as DelegationResumeDriver, W as DelegationResumeTick, X as DelegationRunContext, Y as DelegationStateCorruptError, Z as DelegationStatus, _ as DelegationStore, $ as DelegationTaskQueueOptions, a0 as DelegationTraceCaps, a1 as DelegationTraceCollector, a2 as DelegationTraceSpan, a3 as DetachedSessionDelegateOptions, a4 as DetachedSessionRefParts, a5 as DetachedTurn, a6 as DetachedTurnResumeDriverOptions, a7 as DetachedWinnerSelection, a8 as DriveTurnCapableBox, a9 as DriveTurnTick, aa as FeedbackEvent, ab as FeedbackRating, ac as FeedbackRefersTo, ad as FileDelegationStore, ae as FileDelegationStoreOptions, af as FleetWorkspaceExecutorOptions, ag as InMemoryDelegationStore, ah as InMemoryFeedbackStore, ai as JsonRpcMessage, aj as JsonRpcResponse, ak as MakeWorkerAgent, al as McpServer, am as McpServerOptions, an as McpToolDescriptor, ao as McpTransport, ap as Question, aq as QuestionDecision, ar as QuestionPolicy, as as QuestionRecord, at as ResearchOutputShape, au as ResearchSource, av as RunDetachedTurnOptions, aw as SettleDetachedCoderTurnOptions, ax as SettledWorker, ay as SiblingSandboxExecutorOptions, az as SubmitInput, aA as SubmitOutput, aB as TraceContext, aC as UiAuditorDelegationOutput, aD as buildDelegationTraceSpans, aE as capDelegationTrace, aF as coderTaskFromArgs, aG as composeLoopTraceEmitters, aH as createCoordinationTools, aI as createDelegateHandler, aJ as createDelegationTraceCollector, aK as createDetachedTurnResumeDriver, aL as createFleetWorkspaceExecutor, aM as createInProcessTransport, aN as createMcpServer, aO as createPropagatingTraceEmitter, aP as createSiblingSandboxExecutor, aQ as detachedSessionDelegate, aR as detachedTurnEvents, aS as eventToSnapshot, aT as formatDetachedSessionRef, aU as hashIdempotencyInput, aV as parseDetachedSessionRef, aW as readTraceContextFromEnv, aX as runDetachedTurn, aY as settleDetachedCoderTurn, aZ as traceContextToEnv, a_ as validateDelegateArgs } from '../coordination-CuDLO8wj.js';
4
- import { L as LocalHarness, r as runLocalHarness } from '../local-harness-sI0S_XNA.js';
5
- export { a as LocalHarnessResult, R as RunLocalHarnessOptions } from '../local-harness-sI0S_XNA.js';
6
- import { G as GitRunner } from '../worktree-harness-CX_McRLp.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 '../worktree-harness-CX_McRLp.js';
1
+ import { S as SandboxClient, e as LoopSandboxPlacement } from '../types-SyuwunY_.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-rRj5hjJK.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-rRj5hjJK.js';
4
+ import { L as LocalHarness, r as runLocalHarness } from '../local-harness-dcD5WTTr.js';
5
+ export { a as LocalHarnessResult, R as RunLocalHarnessOptions } from '../local-harness-dcD5WTTr.js';
6
+ import { G as GitRunner } from '../completion-gate-DkAnUmpb.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-DkAnUmpb.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-BnrOmGjN.js';
9
+ export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from '../openai-tools-C4ZfUD4L.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-Driepl87.js';
13
+ import '../types-eMNgWgFi.js';
14
14
  import '@tangle-network/agent-interface';
15
- import '../otel-export-BKmNwiCb.js';
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';
package/dist/mcp/index.js CHANGED
@@ -1,12 +1,15 @@
1
+ import {
2
+ coderTaskToPrompt
3
+ } from "../chunk-5IBQAPVB.js";
1
4
  import {
2
5
  createPropagatingTraceEmitter,
3
6
  readTraceContextFromEnv,
4
7
  traceContextToEnv
5
- } from "../chunk-4WXGK6GV.js";
8
+ } from "../chunk-7ON74BQO.js";
6
9
  import {
7
10
  mcpToolsForRuntimeMcp,
8
11
  mcpToolsForRuntimeMcpSubset
9
- } from "../chunk-5AVV7KAH.js";
12
+ } from "../chunk-QK4DV5PR.js";
10
13
  import {
11
14
  createKbGate
12
15
  } from "../chunk-SGKPNBXE.js";
@@ -14,7 +17,7 @@ import {
14
17
  assertTraceDerivedFindings,
15
18
  runCoderChecks,
16
19
  selectValidWinner
17
- } from "../chunk-PIPPLSOF.js";
20
+ } from "../chunk-ZV4LXYCJ.js";
18
21
  import {
19
22
  DELEGATE_DESCRIPTION,
20
23
  DELEGATE_FEEDBACK_DESCRIPTION,
@@ -64,8 +67,9 @@ import {
64
67
  validateDelegateUiAuditArgs,
65
68
  validateDelegationHistoryArgs,
66
69
  validateDelegationStatusArgs
67
- } from "../chunk-N7EJV7N3.js";
68
- import "../chunk-UD4BHQMI.js";
70
+ } from "../chunk-RYBVU4M3.js";
71
+ import "../chunk-DPEUKJRO.js";
72
+ import "../chunk-IVGYLCFH.js";
69
73
  import {
70
74
  deleteBoxSafe,
71
75
  sleep,
@@ -75,14 +79,10 @@ import {
75
79
  import "../chunk-FVJ7M3DA.js";
76
80
  import {
77
81
  runLocalHarness
78
- } from "../chunk-7LO5GMAO.js";
82
+ } from "../chunk-CMYMTRGA.js";
79
83
  import {
80
84
  ValidationError
81
85
  } from "../chunk-YEJR7IXO.js";
82
- import {
83
- coderTaskToPrompt
84
- } from "../chunk-5IBQAPVB.js";
85
- import "../chunk-DPEUKJRO.js";
86
86
  import "../chunk-DGUM43GV.js";
87
87
 
88
88
  // src/mcp/executor.ts
@@ -1,5 +1,5 @@
1
1
  import { AnalystFinding } from '@tangle-network/agent-eval';
2
- import { L as LocalHarness, r as runLocalHarness } from './local-harness-sI0S_XNA.js';
2
+ import { L as LocalHarness, r as runLocalHarness } from './local-harness-dcD5WTTr.js';
3
3
  import { LabeledScenarioStore, WorktreeAdapter, SurfaceProposer } from '@tangle-network/agent-eval/campaign';
4
4
 
5
5
  /**
@@ -30,6 +30,17 @@ import { LabeledScenarioStore, WorktreeAdapter, SurfaceProposer } from '@tangle-
30
30
  * adapter's `finalize`. */
31
31
  interface CandidateGenerator {
32
32
  kind: string;
33
+ /** Whether this generator can produce a candidate from an EMPTY findings set
34
+ * and no phase-2 report — i.e. it draws its change signal from the repo and
35
+ * the raw-trace filesystem context on disk, not only from pre-summarized
36
+ * findings. An agentic coder (`agenticGenerator`) sets this: the seed repo +
37
+ * raw traces ARE the signal, so it must still run the full `populationSize`
38
+ * when the distiller yielded nothing (this is the meta-harness contract — the
39
+ * agent diagnoses from the raw traces itself). A patch-applier
40
+ * (`reflectiveGenerator`) leaves it unset — with no findings there is no
41
+ * patch to draft, so the driver short-circuits rather than spin up worktrees
42
+ * for a guaranteed no-op. Default `false`. */
43
+ proposesWithoutFindings?: boolean;
33
44
  generate(args: {
34
45
  /** The candidate worktree — a fresh checkout of baseRef. Write changes here. */
35
46
  worktreePath: string;
@@ -1,4 +1,4 @@
1
- import { O as OpenAIChatTool } from './types-ESeMOj94.js';
1
+ import { O as OpenAIChatTool } from './types-SyuwunY_.js';
2
2
 
3
3
  /**
4
4
  *
@@ -1,8 +1,8 @@
1
1
  import { a as UiFinding, U as UiLens } from './substrate-DO2GHNg2.js';
2
2
  export { C as CoderTask, b as UI_FINDING_SEVERITIES, c as UI_LENSES, d as UiFindingScreenshot, e as UiFindingSeverity, f as coderTaskToPrompt } from './substrate-DO2GHNg2.js';
3
- import { S as SandboxClient, b as OutputAdapter, V as Validator, A as AgentRunSpec } from './types-ESeMOj94.js';
4
- import { SandboxEvent } from '@tangle-network/sandbox';
5
- import { AgentProfile } from '@tangle-network/agent-interface';
3
+ import { AgentProfile, SandboxEvent } from '@tangle-network/sandbox';
4
+ import { V as Validator, A as AgentRunSpec, c as OutputAdapter, D as Driver, S as SandboxClient } from './types-SyuwunY_.js';
5
+ import { AgentProfile as AgentProfile$1 } from '@tangle-network/agent-interface';
6
6
  import '@tangle-network/agent-eval';
7
7
 
8
8
  /**
@@ -96,6 +96,197 @@ declare function summarizeRegistry(reg: AuditRegistry): AuditIndex;
96
96
  */
97
97
  declare function writeAuditIndex(workspaceDir: string): Promise<string>;
98
98
 
99
+ /**
100
+ * Opinionated preset for source-grounded research
101
+ * tasks. The agent is told to:
102
+ * - bound its work to a single `knowledgeNamespace`
103
+ * - emit `items[]` carrying provenance + confidence
104
+ * - emit `citations[]` linking quotes back to source urls
105
+ * - emit `proposedWrites[]` — never call materialize itself
106
+ * - describe `gaps` it could not answer
107
+ *
108
+ * The profile is stateless and agent-agnostic. `harness` selects the
109
+ * sandbox-SDK backend. For heterogeneous fanout, use
110
+ * `multiHarnessResearcherFanout`.
111
+ *
112
+ * Propose-don't-apply: the profile NEVER writes to the knowledge base.
113
+ * It produces `proposedWrites: KnowledgeUpdate[]` in the output. The
114
+ * caller (gtm-agent, journey-eval, user) decides whether to feed those
115
+ * updates through `applyKnowledgeWriteBlocks` / a KbStore put.
116
+ *
117
+ * Namespace isolation: every `KnowledgeItem` + `KnowledgeUpdate` in the
118
+ * output carries `namespace`. The validator hard-fails when any item
119
+ * touches a namespace other than `task.knowledgeNamespace`.
120
+ *
121
+ * @experimental
122
+ */
123
+
124
+ /** Source families a researcher profile may prefer for a task. @experimental */
125
+ type ResearchSource = 'web' | 'corpus' | 'twitter' | 'github' | 'docs';
126
+ /** Task contract for a source-grounded research agent. @experimental */
127
+ interface ResearchTask {
128
+ /** The research question to answer. */
129
+ question: string;
130
+ /** Bound: e.g. "audience for cpg-founder ICP". */
131
+ scope?: string;
132
+ /** Multi-tenant scope (customer-id, workspace-id). Validator enforces. */
133
+ knowledgeNamespace: string;
134
+ sources?: ResearchSource[];
135
+ recencyWindow?: {
136
+ since?: Date;
137
+ until?: Date;
138
+ };
139
+ maxItems?: number;
140
+ /** Per-item minimum confidence in [0, 1]. Validator scores recall vs this. */
141
+ minConfidence?: number;
142
+ }
143
+ /**
144
+ * Knowledge item emitted by the researcher.
145
+ *
146
+ * Profile-local type. When agent-knowledge promotes `KnowledgeClaim` →
147
+ * top-level `KnowledgeItem` substrate-wide, these fields collapse 1:1.
148
+ *
149
+ * @experimental
150
+ */
151
+ interface KnowledgeItem {
152
+ id: string;
153
+ /** Multi-tenant scope. MUST equal `task.knowledgeNamespace`. */
154
+ namespace: string;
155
+ /** The factual claim, in the researcher's words. */
156
+ claim: string;
157
+ /** Provenance — at least one entry required. */
158
+ evidence: Array<{
159
+ source: string;
160
+ quote?: string;
161
+ url?: string;
162
+ capturedAt: number;
163
+ }>;
164
+ /** Researcher's self-reported confidence in [0, 1]. */
165
+ confidence: number;
166
+ /** Prior item ids this supersedes (chain). */
167
+ supersedes?: string[];
168
+ /** Set if the agent is retracting an earlier item. Unix ms. */
169
+ retractedAt?: number;
170
+ authoredBy: {
171
+ kind: 'human' | 'agent';
172
+ id: string;
173
+ };
174
+ }
175
+ /**
176
+ * A proposed write to the knowledge base. The profile does NOT apply
177
+ * these — the caller decides.
178
+ *
179
+ * @experimental
180
+ */
181
+ type KnowledgeUpdate = {
182
+ kind: 'insert';
183
+ namespace: string;
184
+ item: KnowledgeItem;
185
+ } | {
186
+ kind: 'supersede';
187
+ namespace: string;
188
+ previousId: string;
189
+ item: KnowledgeItem;
190
+ } | {
191
+ kind: 'retract';
192
+ namespace: string;
193
+ itemId: string;
194
+ reason: string;
195
+ };
196
+ /**
197
+ * Researcher output. Required fields are typed; optional fields preserve
198
+ * the agent's free-form intelligence (`notes`, `raw`). The validator
199
+ * enforces the typed minimum.
200
+ *
201
+ * @experimental
202
+ */
203
+ interface ResearchOutput {
204
+ items: KnowledgeItem[];
205
+ citations: Array<{
206
+ url: string;
207
+ quote: string;
208
+ confidence: number;
209
+ }>;
210
+ proposedWrites: KnowledgeUpdate[];
211
+ gaps?: string[];
212
+ notes?: string;
213
+ /** Anything the agent emitted beyond the typed fields. */
214
+ raw?: unknown;
215
+ }
216
+ /** Options for the source-grounded researcher profile preset. @experimental */
217
+ interface ResearcherProfileOptions {
218
+ /** Sandbox-SDK backend.type. Default `'opencode/zai-coding-plan/glm-5.1'`. */
219
+ harness?: string;
220
+ /** Default model id passed in `AgentProfile.model.default`. */
221
+ model?: string;
222
+ /** Custom system prompt replacement. Default = built-in researcher preset. */
223
+ systemPrompt?: string;
224
+ /** Stable name for `AgentRunSpec.name`. Default = `researcher-${harness}`. */
225
+ name?: string;
226
+ /**
227
+ * Default 0.7. Minimum (citations with quote) / items ratio for `valid=true`.
228
+ * Below this floor, citation_density scores < 1 and the item set is gated.
229
+ */
230
+ citationDensityMin?: number;
231
+ }
232
+ /** Build a source-grounded researcher profile with output parsing and validation. @experimental */
233
+ declare function researcherProfile(options?: ResearcherProfileOptions & {
234
+ task?: ResearchTask;
235
+ }): {
236
+ profile: AgentProfile;
237
+ taskToPrompt: (task: ResearchTask) => string;
238
+ output: OutputAdapter<ResearchOutput>;
239
+ validator: Validator<ResearchOutput>;
240
+ agentRunSpec: AgentRunSpec<ResearchTask>;
241
+ };
242
+ /** @experimental */
243
+ interface MultiHarnessResearcherFanoutOptions {
244
+ /** Backend.type identifiers, one per parallel agent. */
245
+ harnesses?: string[];
246
+ /** Optional per-harness model override. Indexed parallel to `harnesses`. */
247
+ models?: (string | undefined)[];
248
+ /** Default citation density floor for the shared validator. */
249
+ citationDensityMin?: number;
250
+ /** Optional task — narrows the validator's namespace check. */
251
+ task?: ResearchTask;
252
+ }
253
+ /**
254
+ * Build a fanout topology over multiple harnesses. The kernel round-robins
255
+ * `agentRuns` across the N parallel iterations and the `FanoutVote` driver
256
+ * picks the highest-scoring valid output.
257
+ *
258
+ * @experimental
259
+ */
260
+ declare function multiHarnessResearcherFanout(options?: MultiHarnessResearcherFanoutOptions): {
261
+ agentRuns: AgentRunSpec<ResearchTask>[];
262
+ output: OutputAdapter<ResearchOutput>;
263
+ validator: Validator<ResearchOutput>;
264
+ driver: Driver<ResearchTask, ResearchOutput, 'done'>;
265
+ };
266
+ /**
267
+ * Build a validator that closes over a specific `ResearchTask`'s constraints.
268
+ *
269
+ * Checks in order:
270
+ * 1. Items must be non-empty.
271
+ * 2. Every item carries `evidence.length >= 1`.
272
+ * 3. Every item + proposedWrite is scoped to `task.knowledgeNamespace`
273
+ * (hard-fail on any namespace mismatch — defence in depth for the
274
+ * multi-tenant invariant).
275
+ * 4. Citation density (citations with quote / items) >= floor.
276
+ *
277
+ * Aggregate score:
278
+ * 0.4 · citation_density
279
+ * + 0.2 · source_diversity (distinct sources / max(items, 1))
280
+ * + 0.2 · recency_match (mean fraction within `recencyWindow`)
281
+ * + 0.2 · (1 − gaps/maxGaps), maxGaps = max(items, 1)
282
+ *
283
+ * @experimental
284
+ */
285
+ declare function createResearcherValidator(task: ResearchTask, config?: {
286
+ citationDensityMin?: number;
287
+ namespaceCheck?: boolean;
288
+ }): Validator<ResearchOutput>;
289
+
99
290
  /**
100
291
  *
101
292
  * UI auditor task + output shapes — what one iteration of the audit loop
@@ -440,7 +631,7 @@ interface UiAuditorProfileOptions {
440
631
  * @experimental
441
632
  */
442
633
  declare function uiAuditorProfile(options?: UiAuditorProfileOptions): {
443
- profile: AgentProfile;
634
+ profile: AgentProfile$1;
444
635
  taskToPrompt: (task: UiAuditTask) => string;
445
636
  output: OutputAdapter<UiAuditOutput>;
446
637
  validator: Validator<UiAuditOutput>;
@@ -511,4 +702,4 @@ declare function formatAuditorPrompt(task: UiAuditTask): string;
511
702
  /** Build a `Validator` that rejects off-lens findings and findings missing screenshot evidence. @experimental */
512
703
  declare function createUiAuditorValidator(task: UiAuditTask): Validator<UiAuditOutput>;
513
704
 
514
- export { type AppendFindingsResult, type AuditIndex, type AuditRegistry, type AuditRegistryCapture, type BrowserContextHandle, type BrowserHandle, type InProcessUiAuditClientOptions, LENS_BRIEFS, type PageHandle, type RegisterCapturesOptions, SHARED_AUDITOR_RULES, type UiAuditCapture, type UiAuditCaptureRequest, type UiAuditOutput, type UiAuditTask, type UiAuditViewport, type UiAuditorProfileOptions, UiFinding, type UiJudge, type UiJudgeInput, type UiJudgeOutput, type UiJudgeTokenUsage, UiLens, appendFindings, buildAuditorSystemPrompt, createInProcessUiAuditClient, createUiAuditorValidator, decodeAuditTaskEnvelope, encodeAuditTaskEnvelope, formatAuditorPrompt, initAuditWorkspace, parseAuditorEvents, readAuditRegistry, registerCaptures, summarizeRegistry, uiAuditorProfile, writeAuditIndex };
705
+ export { type AppendFindingsResult, type AuditIndex, type AuditRegistry, type AuditRegistryCapture, type BrowserContextHandle, type BrowserHandle, type InProcessUiAuditClientOptions, type KnowledgeItem, type KnowledgeUpdate, LENS_BRIEFS, type MultiHarnessResearcherFanoutOptions, type PageHandle, type RegisterCapturesOptions, type ResearchOutput, type ResearchSource, type ResearchTask, type ResearcherProfileOptions, SHARED_AUDITOR_RULES, type UiAuditCapture, type UiAuditCaptureRequest, type UiAuditOutput, type UiAuditTask, type UiAuditViewport, type UiAuditorProfileOptions, UiFinding, type UiJudge, type UiJudgeInput, type UiJudgeOutput, type UiJudgeTokenUsage, UiLens, appendFindings, buildAuditorSystemPrompt, createInProcessUiAuditClient, createResearcherValidator, createUiAuditorValidator, decodeAuditTaskEnvelope, encodeAuditTaskEnvelope, formatAuditorPrompt, initAuditWorkspace, multiHarnessResearcherFanout, parseAuditorEvents, readAuditRegistry, registerCaptures, researcherProfile, summarizeRegistry, uiAuditorProfile, writeAuditIndex };
package/dist/profiles.js CHANGED
@@ -1,6 +1,11 @@
1
1
  import {
2
2
  coderTaskToPrompt
3
3
  } from "./chunk-5IBQAPVB.js";
4
+ import {
5
+ createResearcherValidator,
6
+ multiHarnessResearcherFanout,
7
+ researcherProfile
8
+ } from "./chunk-5QOB7H74.js";
4
9
  import {
5
10
  UI_FINDING_SEVERITIES,
6
11
  UI_LENSES
@@ -851,14 +856,17 @@ export {
851
856
  buildAuditorSystemPrompt,
852
857
  coderTaskToPrompt,
853
858
  createInProcessUiAuditClient,
859
+ createResearcherValidator,
854
860
  createUiAuditorValidator,
855
861
  decodeAuditTaskEnvelope,
856
862
  encodeAuditTaskEnvelope,
857
863
  formatAuditorPrompt,
858
864
  initAuditWorkspace,
865
+ multiHarnessResearcherFanout,
859
866
  parseAuditorEvents,
860
867
  readAuditRegistry,
861
868
  registerCaptures,
869
+ researcherProfile,
862
870
  summarizeRegistry,
863
871
  uiAuditorProfile,
864
872
  writeAuditIndex