@tangle-network/agent-runtime 0.266.0 → 0.273.3

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 (76) hide show
  1. package/dist/{activation-BERiJjx5.js → activation-Cx2dKA_l.js} +2 -2
  2. package/dist/{activation-BERiJjx5.js.map → activation-Cx2dKA_l.js.map} +1 -1
  3. package/dist/{activation-VpxSbDKJ.d.ts → activation-IfDlhR3J.d.ts} +4 -4
  4. package/dist/agent.d.ts +2 -2
  5. package/dist/agent.js +2 -2
  6. package/dist/candidate-execution/index.js +2 -2
  7. package/dist/{coordination-driver-DdZ-nh_4.js → coordination-driver-CkcW4dxU.js} +173 -92
  8. package/dist/coordination-driver-CkcW4dxU.js.map +1 -0
  9. package/dist/{delegate-Ajx_PVyu.js → delegate-Dvb1-mE-.js} +2 -2
  10. package/dist/{delegate-Ajx_PVyu.js.map → delegate-Dvb1-mE-.js.map} +1 -1
  11. package/dist/durable.d.ts +3 -571
  12. package/dist/durable.js +93 -19
  13. package/dist/durable.js.map +1 -1
  14. package/dist/{graph-CK50N9vG.js → graph-C69Uxtzt.js} +17 -8
  15. package/dist/graph-C69Uxtzt.js.map +1 -0
  16. package/dist/{improvement-cycle-GRPoHLm1.js → improvement-cycle-CO2HRCQq.js} +10 -10
  17. package/dist/improvement-cycle-CO2HRCQq.js.map +1 -0
  18. package/dist/{index-CU2mlMfc.d.ts → index-D2ipSqkP.d.ts} +4335 -3055
  19. package/dist/index.d.ts +7 -451
  20. package/dist/index.js +14 -11
  21. package/dist/index.js.map +1 -1
  22. package/dist/intelligence.d.ts +9 -3
  23. package/dist/intelligence.js +13 -7
  24. package/dist/intelligence.js.map +1 -1
  25. package/dist/kernel.d.ts +4 -4
  26. package/dist/kernel.js +9 -9
  27. package/dist/{loop-runner-bin-cC16EPUq.js → loop-runner-bin-B9MIq9O7.js} +3 -3
  28. package/dist/{loop-runner-bin-cC16EPUq.js.map → loop-runner-bin-B9MIq9O7.js.map} +1 -1
  29. package/dist/{loop-runner-bin-XKZXM08Q.d.ts → loop-runner-bin-ThlwVkvo.d.ts} +3 -3
  30. package/dist/loop-runner-bin.d.ts +1 -1
  31. package/dist/loop-runner-bin.js +1 -1
  32. package/dist/mcp/bin.js +3 -3
  33. package/dist/mcp/index.d.ts +12 -6
  34. package/dist/mcp/index.js +7 -7
  35. package/dist/mcp/memory-bin.js +1 -1
  36. package/dist/{memory-server-Cn8LbAxO.js → memory-server-DXQ8IxGR.js} +2 -2
  37. package/dist/{memory-server-Cn8LbAxO.js.map → memory-server-DXQ8IxGR.js.map} +1 -1
  38. package/dist/{openai-tools-D3ajI_D2.d.ts → openai-tools-Bb0mAr5z.d.ts} +2 -2
  39. package/dist/{prepare-oHUQdC5-.js → prepare-DVlvGP7V.js} +2 -2
  40. package/dist/{prepare-oHUQdC5-.js.map → prepare-DVlvGP7V.js.map} +1 -1
  41. package/dist/profiles.d.ts +2 -2
  42. package/dist/{protected-model-port-DqF0qDU6.js → protected-model-port-BrWgsCnl.js} +2 -2
  43. package/dist/{protected-model-port-DqF0qDU6.js.map → protected-model-port-BrWgsCnl.js.map} +1 -1
  44. package/dist/{protected-redaction--F3v1oo8.js → protected-redaction-DylCC_ot.js} +14 -20
  45. package/dist/protected-redaction-DylCC_ot.js.map +1 -0
  46. package/dist/{provision-supervisor-Bf_bPaCv.js → provision-supervisor-BKAvsDtP.js} +3 -3
  47. package/dist/{provision-supervisor-Bf_bPaCv.js.map → provision-supervisor-BKAvsDtP.js.map} +1 -1
  48. package/dist/{runtime-hOLlAc1i.js → runtime-CHxXrUeZ.js} +1714 -854
  49. package/dist/runtime-CHxXrUeZ.js.map +1 -0
  50. package/dist/{server-DOb67ohd.js → server-2OeFrEVG.js} +4 -4
  51. package/dist/{server-DOb67ohd.js.map → server-2OeFrEVG.js.map} +1 -1
  52. package/dist/{stream-agent-turn-Gw9hLpBn.d.ts → stream-agent-turn-ewm3BZAp.d.ts} +34 -17
  53. package/dist/{structural-rollout-DV9YoQF6.js → structural-rollout-DCUprNpH.js} +2 -2
  54. package/dist/{structural-rollout-DV9YoQF6.js.map → structural-rollout-DCUprNpH.js.map} +1 -1
  55. package/dist/{substrate-CLt9S9ym.d.ts → substrate-VKjmrksz.d.ts} +2 -2
  56. package/dist/{supervise--njTtSL3.js → supervise-Dej5aSDa.js} +220 -52
  57. package/dist/supervise-Dej5aSDa.js.map +1 -0
  58. package/dist/{supervisor-B8UMAXya.js → supervisor-DdKPGluv.js} +1233 -303
  59. package/dist/supervisor-DdKPGluv.js.map +1 -0
  60. package/dist/testing.d.ts +2 -2
  61. package/dist/testing.js +62 -62
  62. package/dist/testing.js.map +1 -1
  63. package/dist/{tool-server-x9NEhvHZ.js → tool-server-Dqer2M4_.js} +30 -12
  64. package/dist/tool-server-Dqer2M4_.js.map +1 -0
  65. package/dist/tui/index.d.ts +1 -1
  66. package/dist/tui/index.js +1 -1
  67. package/dist/{types-CrnwLVYQ.d.ts → types-DMRc3jru.d.ts} +463 -105
  68. package/package.json +6 -5
  69. package/dist/coordination-driver-DdZ-nh_4.js.map +0 -1
  70. package/dist/graph-CK50N9vG.js.map +0 -1
  71. package/dist/improvement-cycle-GRPoHLm1.js.map +0 -1
  72. package/dist/protected-redaction--F3v1oo8.js.map +0 -1
  73. package/dist/runtime-hOLlAc1i.js.map +0 -1
  74. package/dist/supervise--njTtSL3.js.map +0 -1
  75. package/dist/supervisor-B8UMAXya.js.map +0 -1
  76. package/dist/tool-server-x9NEhvHZ.js.map +0 -1
@@ -1,9 +1,9 @@
1
- import { At as createPropagatingTraceEmitter, Mt as readTraceContextFromEnv, Nt as traceContextToEnv, ia as SandboxClient, jt as mergeTraceEnv, kt as TraceContext, qi as LoopSandboxPlacement } from "../types-CrnwLVYQ.js";
2
- import { $d as FeedbackStore, $f as DelegationError, $u as DownMessageEvent, Ad as ResolveSpawnResourcePathsResult, Af as DelegationArgs, Ap as FileDelegationStoreOptions, Au as ANALYST_DEFINITION_BOUNDS, Bd as McpServerOptions, Bf as hashIdempotencyInput, Bu as AuthorizeDownMessage, Cd as analystToolGroupNames, Cf as DriveTurnTick, Cp as capDelegationTrace, Df as formatDetachedSessionRef, Dp as DelegationStateCorruptError, Ed as downMessageRefusalReasons, Ef as detachedTurnEvents, Ep as DelegationPersistenceError, Fd as SpawnResourceReader, Ff as DelegationRunContext, Fu as AnalystRegistry, Gd as DELEGATE_TOOL_NAME, Gf as DelegateFeedbackResult, Hd as createMcpServer, Hf as DelegateCodeConfig, Hu as ContinuationInstruction, Id as environmentReader, If as DelegationTaskQueue, Iu as AnalystToolGroupName, Jd as DelegateHandlerOptions, Jf as DelegateResearchResult, Ju as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, Kd as DelegateArgs, Kf as DelegateResearchArgs, Ku as CoordinationTools, Ld as hostDirectoryReader, Lf as DelegationTaskQueueOptions, Md as SPAWN_RESOURCE_PATH_MAX_BYTES, Mf as DelegationResumeContext, Mp as CoderOutput, Mu as AnalystFindingEvent, Nd as SpawnResourceBytes, Nf as DelegationResumeDriver, Nu as AnalystKind, Od as parseAuthoredAnalystDefinition, Of as parseDetachedSessionRef, Op as DelegationStore, Pd as SpawnResourceRead, Pf as DelegationResumeTick, Qd as FeedbackEvent, Qf as DelegateUiAuditRoute, Qu as DownMessageDeliveryOutcome, Rd as resolveSpawnResourcePaths, Rf as SubmitInput, Ru as AuthoredAnalystDefinition, Sd as WorkerWatchOptions, Sf as DriveTurnCapableBox, Sp as buildDelegationTraceSpans, Td as createCoordinationTools, Tf as createDetachedTurnResumeDriver, Tp as createDelegationTraceCollector, Ud as DELEGATE_DESCRIPTION, Uf as DelegateCodeResult, Vd as createInProcessTransport, Vf as DelegateCodeArgs, Vu as AuthorizedDownMessage, Wd as DELEGATE_INPUT_SCHEMA, Wf as DelegateFeedbackArgs, Wu as CoordinationEvent, Xd as createDelegateHandler, Xf as DelegateUiAuditConfig, Xu as DownMessageAuthorizationInput, Yd as DelegateResult, Yf as DelegateUiAuditArgs, Yu as DefinedAnalystRecord, Zd as validateDelegateArgs, Zf as DelegateUiAuditResult, Zu as DownMessageDeliveryAttempt, _f as createFleetWorkspaceExecutor, _p as DELEGATION_TRACE_MAX_BYTES, ad as QuestionDecision, af as DelegateRunCtx, ap as DelegationProgress, bf as DetachedTurn, bp as DelegationTraceCollector, cd as QuestionEscalationTarget, cf as SettleDetachedCoderTurnOptions, cp as DelegationStatusArgs, dd as QuestionPolicy, df as detachedSessionDelegate, dp as FeedbackRefersTo, ed as EscalateQuestion, ef as InMemoryFeedbackStore, ep as DelegationFeedbackSnapshot, fd as QuestionRecord, ff as settleDetachedCoderTurn, fp as ResearchOutputShape, gf as SiblingSandboxExecutorOptions, gp as CappedDelegationTrace, hf as FleetWorkspaceExecutorOptions, hp as delegationProfiles, id as Question, if as CoderReviewer, ip as DelegationProfile, jd as ResolvedSpawnResourcePath, jf as DelegationRecord, jp as InMemoryDelegationStore, ju as AnalystDefinitionIssue, kd as questionEscalationTargets, kf as runDetachedTurn, kp as FileDelegationStore, ld as QuestionLevel, lf as UiAuditorDelegate, lp as DelegationStatusResult, md as SettledWorker, mf as FleetHandle, mp as UiAuditorDelegationOutput, nd as MakeWorkerAgent, nf as CoderDelegate, np as DelegationHistoryEntry, od as QuestionEscalationOutcome, of as DetachedSessionDelegateOptions, op as DelegationResultPayload, pd as QuestionUrgency, pf as DelegationExecutor, pp as UiAuditLensFilter, qd as DelegateError, qf as DelegateResearchConfig, qu as CoordinationToolsOptions, rd as ManagerReentryState, rf as CoderReview, rp as DelegationHistoryResult, sd as QuestionEscalationRecord, sf as DetachedWinnerSelection, sp as DelegationStatus, td as EventAcknowledgement, tf as eventToSnapshot, tp as DelegationHistoryArgs, ud as QuestionOption, uf as coderTaskFromArgs, up as FeedbackRating, vf as createSiblingSandboxExecutor, vp as DELEGATION_TRACE_MAX_SPANS, wf as RunDetachedTurnOptions, wp as composeLoopTraceEmitters, xd as WorkerSpawnContext, xf as DetachedTurnResumeDriverOptions, xp as DelegationTraceSpan, yf as DetachedSessionRefParts, yp as DelegationTraceCaps, zd as McpServer, zf as SubmitOutput, zu as AuthoredAnalystLimits } from "../index-CU2mlMfc.js";
3
- import { An as DEFAULT_LOCAL_HARNESS, Cn as WorktreeHandle, Dn as CodexExecutionEvidence, En as removeWorktree, Fn as harnessSupportsReasoningEffort, In as localHarnessExecutable, Ln as parseCodexTokenUsage, Mn as LocalHarness, Nn as LocalHarnessResult, On as CodexExecutionPolicy, Pn as RunLocalHarnessOptions, Rn as runLocalHarness, Sn as RemoveWorktreeOptions, Tn as createWorktree, bn as DiffResult, dr as JsonRpcMessage, fr as JsonRpcResponse, jn as LOCAL_HARNESSES, kn as CodexTokenUsage, mr as McpTransport, pr as McpToolDescriptor, vn as CreateWorktreeOptions, wn as captureWorktreeDiff, xn as GitRunner, yn as DiffOptions } from "../stream-agent-turn-Gw9hLpBn.js";
4
- import { d as ResearchSource, o as UiLens } from "../substrate-CLt9S9ym.js";
1
+ import { At as createPropagatingTraceEmitter, Mt as readTraceContextFromEnv, Nt as traceContextToEnv, Ta as SandboxClient, jt as mergeTraceEnv, kt as TraceContext, ma as LoopSandboxPlacement } from "../types-DMRc3jru.js";
2
+ import { $d as DefinedAnalystRecord, $f as DelegateResult, $p as DelegateUiAuditArgs, Af as downMessageRefusalReasons, Am as DelegationPersistenceError, Ap as detachedTurnEvents, Bd as AnalystToolGroupName, Bf as environmentReader, Bp as DelegationTaskQueue, Cm as DelegationTraceCaps, Cp as DetachedSessionRefParts, Df as analystToolGroupNames, Dm as capDelegationTrace, Dp as DriveTurnTick, Ef as WorkerWatchOptions, Em as buildDelegationTraceSpans, Ep as DriveTurnCapableBox, Fd as AnalystDefinitionIssue, Ff as ResolvedSpawnResourcePath, Fm as InMemoryDelegationStore, Fp as DelegationRecord, Gd as AuthorizedDownMessage, Gf as createInProcessTransport, Gp as DelegateCodeArgs, Hd as AuthoredAnalystDefinition, Hf as resolveSpawnResourcePaths, Hp as SubmitInput, Id as AnalystFindingEvent, If as SPAWN_RESOURCE_PATH_MAX_BYTES, Im as CoderOutput, Ip as DelegationResumeContext, Jd as CoordinationEvent, Jf as DELEGATE_INPUT_SCHEMA, Jp as DelegateFeedbackArgs, Kd as ContinuationInstruction, Kf as createMcpServer, Kp as DelegateCodeConfig, Ld as AnalystKind, Lf as SpawnResourceBytes, Lp as DelegationResumeDriver, Mf as parseAuthoredAnalystDefinition, Mm as DelegationStore, Mp as parseDetachedSessionRef, Nf as questionEscalationTargets, Nm as FileDelegationStore, Np as runDetachedTurn, Om as composeLoopTraceEmitters, Op as RunDetachedTurnOptions, Pd as ANALYST_DEFINITION_BOUNDS, Pf as ResolveSpawnResourcePathsResult, Pm as FileDelegationStoreOptions, Pp as DelegationArgs, Qd as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, Qf as DelegateHandlerOptions, Qp as DelegateResearchResult, Rf as SpawnResourceRead, Rp as DelegationResumeTick, Sm as DELEGATION_TRACE_MAX_SPANS, Sp as createSiblingSandboxExecutor, Tf as WorkerSpawnContext, Tm as DelegationTraceSpan, Tp as DetachedTurnResumeDriverOptions, Ud as AuthoredAnalystLimits, Uf as McpServer, Up as SubmitOutput, Vf as hostDirectoryReader, Vp as DelegationTaskQueueOptions, Wd as AuthorizeDownMessage, Wf as McpServerOptions, Wp as hashIdempotencyInput, Xd as CoordinationTools, Xf as DelegateArgs, Xp as DelegateResearchArgs, Yf as DELEGATE_TOOL_NAME, Yp as DelegateFeedbackResult, Zd as CoordinationToolsOptions, Zf as DelegateError, Zp as DelegateResearchConfig, _f as QuestionUrgency, _m as UiAuditLensFilter, _p as DelegationExecutor, af as EventAcknowledgement, am as DelegationHistoryArgs, ap as eventToSnapshot, bm as CappedDelegationTrace, bp as SiblingSandboxExecutorOptions, cf as Question, cm as DelegationProfile, cp as CoderReviewer, df as QuestionEscalationRecord, dm as DelegationStatus, dp as DetachedWinnerSelection, ef as DownMessageAuthorizationInput, em as DelegateUiAuditConfig, ep as createDelegateHandler, ff as QuestionEscalationTarget, fm as DelegationStatusArgs, fp as SettleDetachedCoderTurnOptions, gf as QuestionRecord, gm as ResearchOutputShape, gp as settleDetachedCoderTurn, hf as QuestionPolicy, hm as FeedbackRefersTo, hp as detachedSessionDelegate, if as EscalateQuestion, im as DelegationFeedbackSnapshot, ip as InMemoryFeedbackStore, jm as DelegationStateCorruptError, jp as formatDetachedSessionRef, kf as createCoordinationTools, km as createDelegationTraceCollector, kp as createDetachedTurnResumeDriver, lf as QuestionDecision, lm as DelegationProgress, lp as DelegateRunCtx, mf as QuestionOption, mm as FeedbackRating, mp as coderTaskFromArgs, nf as DownMessageDeliveryOutcome, nm as DelegateUiAuditRoute, np as FeedbackEvent, of as MakeWorkerAgent, om as DelegationHistoryEntry, op as CoderDelegate, pf as QuestionLevel, pm as DelegationStatusResult, pp as UiAuditorDelegate, qf as DELEGATE_DESCRIPTION, qp as DelegateCodeResult, rf as DownMessageEvent, rm as DelegationError, rp as FeedbackStore, sf as ManagerReentryState, sm as DelegationHistoryResult, sp as CoderReview, tf as DownMessageDeliveryAttempt, tm as DelegateUiAuditResult, tp as validateDelegateArgs, uf as QuestionEscalationOutcome, um as DelegationResultPayload, up as DetachedSessionDelegateOptions, vf as SettledWorker, vm as UiAuditorDelegationOutput, vp as FleetHandle, wm as DelegationTraceCollector, wp as DetachedTurn, xm as DELEGATION_TRACE_MAX_BYTES, xp as createFleetWorkspaceExecutor, ym as delegationProfiles, yp as FleetWorkspaceExecutorOptions, zd as AnalystRegistry, zf as SpawnResourceReader, zp as DelegationRunContext } from "../index-D2ipSqkP.js";
3
+ import { An as DEFAULT_LOCAL_HARNESS, Cn as WorktreeHandle, Dn as CodexExecutionEvidence, En as removeWorktree, Fn as harnessSupportsReasoningEffort, In as localHarnessExecutable, Ln as parseCodexTokenUsage, Mn as LocalHarness, Nn as LocalHarnessResult, On as CodexExecutionPolicy, Pn as RunLocalHarnessOptions, Rn as runLocalHarness, Sn as RemoveWorktreeOptions, Tn as createWorktree, bn as DiffResult, dr as JsonRpcMessage, fr as JsonRpcResponse, hr as McpTransport, jn as LOCAL_HARNESSES, kn as CodexTokenUsage, mr as McpToolDescriptor, pr as McpToolAnnotations, vn as CreateWorktreeOptions, wn as captureWorktreeDiff, xn as GitRunner, yn as DiffOptions } from "../stream-agent-turn-ewm3BZAp.js";
4
+ import { d as ResearchSource, o as UiLens } from "../substrate-VKjmrksz.js";
5
5
  import { a as KbGateResult, i as FactJudgeVerdict, n as FactCandidate, o as createKbGate, r as FactJudge, t as CreateKbGateOptions } from "../kb-gate-C8z2juK8.js";
6
- import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "../openai-tools-D3ajI_D2.js";
6
+ import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "../openai-tools-Bb0mAr5z.js";
7
7
  import { AgentProfileMcpServer, HarnessType } from "@tangle-network/agent-interface";
8
8
  //#region src/mcp/codex-diagnostics.d.ts
9
9
  /** Bounded, credential-redacted process context attached when reproducible Codex output fails
@@ -130,6 +130,12 @@ interface InProcessExecutorDescribePlacement extends LoopSandboxPlacement {
130
130
  declare function createInProcessExecutor(options: InProcessExecutorOptions): DelegationExecutor;
131
131
  //#endregion
132
132
  //#region src/mcp/tool-server.d.ts
133
+ /**
134
+ * Protocol versions this server speaks, newest first. `initialize` answers with
135
+ * the client's requested version when it is listed here, and otherwise with
136
+ * `PROTOCOL_VERSION` (2024-11-05), which every client that speaks 2024-11-05 accepts.
137
+ */
138
+ declare const SUPPORTED_PROTOCOL_VERSIONS: readonly string[];
133
139
  /** @experimental */
134
140
  interface StdioToolServerOptions {
135
141
  /** Server display name surfaced via `initialize`. */
@@ -470,5 +476,5 @@ interface DelegationStatusHandlerOptions {
470
476
  /** Build the MCP tool handler that polls a `DelegationTaskQueue` for task status. @stable */
471
477
  declare function createDelegationStatusHandler(options: DelegationStatusHandlerOptions): (raw: unknown) => Promise<DelegationStatusResult>;
472
478
  //#endregion
473
- export { ANALYST_DEFINITION_BOUNDS, type AgentMemorySpec, type AnalystDefinitionIssue, type AnalystFindingEvent, type AnalystKind, type AnalystRegistry, type AnalystToolGroupName, type AuthoredAnalystDefinition, type AuthoredAnalystLimits, type AuthorizeDownMessage, type AuthorizedDownMessage, type CappedDelegationTrace, type CoderDelegate, type CoderOutput, type CoderReview, type CoderReviewer, CodexExecutionDiagnosticError, type CodexExecutionEvidence, type CodexExecutionFailureDiagnostic, type CodexExecutionPolicy, type CodexTokenUsage, type ContinuationInstruction, type CoordinationEvent, type CoordinationTools, type CoordinationToolsOptions, type CreateKbGateOptions, type CreateMemoryToolServerOptions, type CreateWorktreeOptions, DEFAULT_AWAIT_EVENT_TIMEOUT_MS, DEFAULT_LOCAL_HARNESS, DELEGATE_DESCRIPTION, DELEGATE_FEEDBACK_DESCRIPTION, DELEGATE_FEEDBACK_INPUT_SCHEMA, DELEGATE_FEEDBACK_TOOL_NAME, DELEGATE_INPUT_SCHEMA, DELEGATE_TOOL_NAME, DELEGATE_UI_AUDIT_DESCRIPTION, DELEGATE_UI_AUDIT_INPUT_SCHEMA, DELEGATE_UI_AUDIT_TOOL_NAME, DELEGATION_HISTORY_DESCRIPTION, DELEGATION_HISTORY_INPUT_SCHEMA, DELEGATION_HISTORY_TOOL_NAME, DELEGATION_STATUS_DESCRIPTION, DELEGATION_STATUS_INPUT_SCHEMA, DELEGATION_STATUS_TOOL_NAME, DELEGATION_TRACE_MAX_BYTES, DELEGATION_TRACE_MAX_SPANS, type DefinedAnalystRecord, type DelegateArgs, type DelegateCodeArgs, type DelegateCodeConfig, type DelegateCodeResult, type DelegateError, type DelegateFeedbackArgs, type DelegateFeedbackHandlerOptions, type DelegateFeedbackResult, type DelegateHandlerOptions, type DelegateResearchArgs, type DelegateResearchConfig, type DelegateResearchResult, type DelegateResult, type DelegateRunCtx, type DelegateUiAuditArgs, type DelegateUiAuditConfig, type DelegateUiAuditHandlerOptions, type DelegateUiAuditResult, type DelegateUiAuditRoute, type DelegationArgs, type DelegationError, type DelegationExecutor, type DelegationFeedbackSnapshot, type DelegationHistoryArgs, type DelegationHistoryEntry, type DelegationHistoryHandlerOptions, type DelegationHistoryResult, DelegationPersistenceError, type DelegationProfile, type DelegationProgress, type DelegationRecord, type DelegationResultPayload, type DelegationResumeContext, type DelegationResumeDriver, type DelegationResumeTick, type DelegationRunContext, DelegationStateCorruptError, type DelegationStatus, type DelegationStatusArgs, type DelegationStatusHandlerOptions, type DelegationStatusResult, type DelegationStore, DelegationTaskQueue, type DelegationTaskQueueOptions, type DelegationTraceCaps, type DelegationTraceCollector, type DelegationTraceSpan, type DetachedSessionDelegateOptions, type DetachedSessionRefParts, type DetachedTurn, type DetachedTurnResumeDriverOptions, type DetachedWinnerSelection, type DetectExecutorArgs, type DiffOptions, type DiffResult, type DownMessageAuthorizationInput, type DownMessageDeliveryAttempt, type DownMessageDeliveryOutcome, type DownMessageEvent, type DriveTurnCapableBox, type DriveTurnTick, type EscalateQuestion, type EventAcknowledgement, type FactCandidate, type FactJudge, type FactJudgeVerdict, type FeedbackEvent, type FeedbackRating, type FeedbackRefersTo, type FeedbackStore, FileDelegationStore, type FileDelegationStoreOptions, type FleetHandle, type FleetWorkspaceExecutorOptions, type GitRunner, InMemoryDelegationStore, InMemoryFeedbackStore, type InProcessExecutorDescribePlacement, type InProcessExecutorOptions, type JsonRpcMessage, type JsonRpcResponse, type KbGateResult, LOCAL_HARNESSES, type LocalHarness, type LocalHarnessResult, MEMORY_FILE_ENV, MEMORY_ITEMS_ENV, MEMORY_LOG_ENV, MEMORY_NAME_ENV, type MakeWorkerAgent, type ManagerReentryState, type McpServer, type McpServerOptions, type McpToolDescriptor, type McpTransport, type MemoryItem, type Question, type QuestionDecision, type QuestionEscalationOutcome, type QuestionEscalationRecord, type QuestionEscalationTarget, type QuestionLevel, type QuestionOption, type QuestionPolicy, type QuestionRecord, type QuestionUrgency, type RemoveWorktreeOptions, type ResearchOutputShape, type ResearchSource, type ResolveSpawnResourcePathsResult, type ResolvedMemoryEnv, type ResolvedSpawnResourcePath, type RunDetachedTurnOptions, type RunLocalHarnessOptions, SPAWN_RESOURCE_PATH_MAX_BYTES, type SettleDetachedCoderTurnOptions, type SettledWorker, type SiblingSandboxExecutorOptions, type SourcedHarness, type SpawnResourceBytes, type SpawnResourceRead, type SpawnResourceReader, type StdioToolServer, type StdioToolServerOptions, type SubmitInput, type SubmitOutput, type TraceContext, type UiAuditLensFilter, type UiAuditorDelegate, type UiAuditorDelegationOutput, type WorkerSpawnContext, type WorkerWatchOptions, type WorktreeHandle, analystToolGroupNames, buildDelegationTraceSpans, capDelegationTrace, captureWorktreeDiff, coderTaskFromArgs, collidesWithHarnessNativeTool, composeLoopTraceEmitters, createCoordinationTools, createDelegateFeedbackHandler, createDelegateHandler, createDelegateUiAuditHandler, createDelegationHistoryHandler, createDelegationStatusHandler, createDelegationTraceCollector, createDetachedTurnResumeDriver, createFleetWorkspaceExecutor, createInProcessExecutor, createInProcessTransport, createKbGate, createMcpServer, createMemoryToolServer, createPropagatingTraceEmitter, createSiblingSandboxExecutor, createStdioToolServer, createWorktree, delegationProfiles, detachedSessionDelegate, detachedTurnEvents, detectExecutor, downMessageRefusalReasons, environmentReader, eventToSnapshot, formatDetachedSessionRef, harnessNativeToolNames, harnessNativeTools, harnessSupportsReasoningEffort, hashIdempotencyInput, hostDirectoryReader, localHarnessExecutable, mcpToolsForRuntimeMcp, mcpToolsForRuntimeMcpSubset, mergeTraceEnv, parseAuthoredAnalystDefinition, parseCodexTokenUsage, parseDetachedSessionRef, parseMemoryItems, questionEscalationTargets, readMemoryItemsFile, readTraceContextFromEnv, removeWorktree, resolveMemoryFromEnv, resolveSpawnResourcePaths, runDetachedTurn, settleDetachedCoderTurn, sourcedHarnesses, traceContextToEnv, validateDelegateArgs, validateDelegateFeedbackArgs, validateDelegateUiAuditArgs, validateDelegationHistoryArgs, validateDelegationStatusArgs };
479
+ export { ANALYST_DEFINITION_BOUNDS, type AgentMemorySpec, type AnalystDefinitionIssue, type AnalystFindingEvent, type AnalystKind, type AnalystRegistry, type AnalystToolGroupName, type AuthoredAnalystDefinition, type AuthoredAnalystLimits, type AuthorizeDownMessage, type AuthorizedDownMessage, type CappedDelegationTrace, type CoderDelegate, type CoderOutput, type CoderReview, type CoderReviewer, CodexExecutionDiagnosticError, type CodexExecutionEvidence, type CodexExecutionFailureDiagnostic, type CodexExecutionPolicy, type CodexTokenUsage, type ContinuationInstruction, type CoordinationEvent, type CoordinationTools, type CoordinationToolsOptions, type CreateKbGateOptions, type CreateMemoryToolServerOptions, type CreateWorktreeOptions, DEFAULT_AWAIT_EVENT_TIMEOUT_MS, DEFAULT_LOCAL_HARNESS, DELEGATE_DESCRIPTION, DELEGATE_FEEDBACK_DESCRIPTION, DELEGATE_FEEDBACK_INPUT_SCHEMA, DELEGATE_FEEDBACK_TOOL_NAME, DELEGATE_INPUT_SCHEMA, DELEGATE_TOOL_NAME, DELEGATE_UI_AUDIT_DESCRIPTION, DELEGATE_UI_AUDIT_INPUT_SCHEMA, DELEGATE_UI_AUDIT_TOOL_NAME, DELEGATION_HISTORY_DESCRIPTION, DELEGATION_HISTORY_INPUT_SCHEMA, DELEGATION_HISTORY_TOOL_NAME, DELEGATION_STATUS_DESCRIPTION, DELEGATION_STATUS_INPUT_SCHEMA, DELEGATION_STATUS_TOOL_NAME, DELEGATION_TRACE_MAX_BYTES, DELEGATION_TRACE_MAX_SPANS, type DefinedAnalystRecord, type DelegateArgs, type DelegateCodeArgs, type DelegateCodeConfig, type DelegateCodeResult, type DelegateError, type DelegateFeedbackArgs, type DelegateFeedbackHandlerOptions, type DelegateFeedbackResult, type DelegateHandlerOptions, type DelegateResearchArgs, type DelegateResearchConfig, type DelegateResearchResult, type DelegateResult, type DelegateRunCtx, type DelegateUiAuditArgs, type DelegateUiAuditConfig, type DelegateUiAuditHandlerOptions, type DelegateUiAuditResult, type DelegateUiAuditRoute, type DelegationArgs, type DelegationError, type DelegationExecutor, type DelegationFeedbackSnapshot, type DelegationHistoryArgs, type DelegationHistoryEntry, type DelegationHistoryHandlerOptions, type DelegationHistoryResult, DelegationPersistenceError, type DelegationProfile, type DelegationProgress, type DelegationRecord, type DelegationResultPayload, type DelegationResumeContext, type DelegationResumeDriver, type DelegationResumeTick, type DelegationRunContext, DelegationStateCorruptError, type DelegationStatus, type DelegationStatusArgs, type DelegationStatusHandlerOptions, type DelegationStatusResult, type DelegationStore, DelegationTaskQueue, type DelegationTaskQueueOptions, type DelegationTraceCaps, type DelegationTraceCollector, type DelegationTraceSpan, type DetachedSessionDelegateOptions, type DetachedSessionRefParts, type DetachedTurn, type DetachedTurnResumeDriverOptions, type DetachedWinnerSelection, type DetectExecutorArgs, type DiffOptions, type DiffResult, type DownMessageAuthorizationInput, type DownMessageDeliveryAttempt, type DownMessageDeliveryOutcome, type DownMessageEvent, type DriveTurnCapableBox, type DriveTurnTick, type EscalateQuestion, type EventAcknowledgement, type FactCandidate, type FactJudge, type FactJudgeVerdict, type FeedbackEvent, type FeedbackRating, type FeedbackRefersTo, type FeedbackStore, FileDelegationStore, type FileDelegationStoreOptions, type FleetHandle, type FleetWorkspaceExecutorOptions, type GitRunner, InMemoryDelegationStore, InMemoryFeedbackStore, type InProcessExecutorDescribePlacement, type InProcessExecutorOptions, type JsonRpcMessage, type JsonRpcResponse, type KbGateResult, LOCAL_HARNESSES, type LocalHarness, type LocalHarnessResult, MEMORY_FILE_ENV, MEMORY_ITEMS_ENV, MEMORY_LOG_ENV, MEMORY_NAME_ENV, type MakeWorkerAgent, type ManagerReentryState, type McpServer, type McpServerOptions, type McpToolAnnotations, type McpToolDescriptor, type McpTransport, type MemoryItem, type Question, type QuestionDecision, type QuestionEscalationOutcome, type QuestionEscalationRecord, type QuestionEscalationTarget, type QuestionLevel, type QuestionOption, type QuestionPolicy, type QuestionRecord, type QuestionUrgency, type RemoveWorktreeOptions, type ResearchOutputShape, type ResearchSource, type ResolveSpawnResourcePathsResult, type ResolvedMemoryEnv, type ResolvedSpawnResourcePath, type RunDetachedTurnOptions, type RunLocalHarnessOptions, SPAWN_RESOURCE_PATH_MAX_BYTES, SUPPORTED_PROTOCOL_VERSIONS, type SettleDetachedCoderTurnOptions, type SettledWorker, type SiblingSandboxExecutorOptions, type SourcedHarness, type SpawnResourceBytes, type SpawnResourceRead, type SpawnResourceReader, type StdioToolServer, type StdioToolServerOptions, type SubmitInput, type SubmitOutput, type TraceContext, type UiAuditLensFilter, type UiAuditorDelegate, type UiAuditorDelegationOutput, type WorkerSpawnContext, type WorkerWatchOptions, type WorktreeHandle, analystToolGroupNames, buildDelegationTraceSpans, capDelegationTrace, captureWorktreeDiff, coderTaskFromArgs, collidesWithHarnessNativeTool, composeLoopTraceEmitters, createCoordinationTools, createDelegateFeedbackHandler, createDelegateHandler, createDelegateUiAuditHandler, createDelegationHistoryHandler, createDelegationStatusHandler, createDelegationTraceCollector, createDetachedTurnResumeDriver, createFleetWorkspaceExecutor, createInProcessExecutor, createInProcessTransport, createKbGate, createMcpServer, createMemoryToolServer, createPropagatingTraceEmitter, createSiblingSandboxExecutor, createStdioToolServer, createWorktree, delegationProfiles, detachedSessionDelegate, detachedTurnEvents, detectExecutor, downMessageRefusalReasons, environmentReader, eventToSnapshot, formatDetachedSessionRef, harnessNativeToolNames, harnessNativeTools, harnessSupportsReasoningEffort, hashIdempotencyInput, hostDirectoryReader, localHarnessExecutable, mcpToolsForRuntimeMcp, mcpToolsForRuntimeMcpSubset, mergeTraceEnv, parseAuthoredAnalystDefinition, parseCodexTokenUsage, parseDetachedSessionRef, parseMemoryItems, questionEscalationTargets, readMemoryItemsFile, readTraceContextFromEnv, removeWorktree, resolveMemoryFromEnv, resolveSpawnResourcePaths, runDetachedTurn, settleDetachedCoderTurn, sourcedHarnesses, traceContextToEnv, validateDelegateArgs, validateDelegateFeedbackArgs, validateDelegateUiAuditArgs, validateDelegationHistoryArgs, validateDelegationStatusArgs };
474
480
  //# sourceMappingURL=index.d.ts.map
package/dist/mcp/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import { Br as DEFAULT_LOCAL_HARNESS, Gr as parseCodexTokenUsage, Ir as runWorktreeHarness, Kr as CodexExecutionDiagnosticError, Lr as captureWorktreeDiff, On as assertBoxlessPromptOptions, Q as resolveSpawnResourcePaths, Rr as createWorktree, Ur as harnessSupportsReasoningEffort, Vr as LOCAL_HARNESSES, Wr as localHarnessExecutable, X as environmentReader, Y as SPAWN_RESOURCE_PATH_MAX_BYTES, Z as hostDirectoryReader, aa as sleep, ca as throwIfAborted, ea as deleteBoxSafe, gr as traceContextToEnv, hr as readTraceContextFromEnv, mr as mergeTraceEnv, pr as createPropagatingTraceEmitter, sa as throwAbort, wn as runAgentRounds, xn as createSandboxForSpec, zr as removeWorktree } from "../supervisor-B8UMAXya.js";
1
+ import { $r as runWorktreeHarness, Ar as createPropagatingTraceEmitter, Bn as runAgentRounds, Ln as createSandboxForSpec, Mr as readTraceContextFromEnv, Nr as traceContextToEnv, Sa as sleep, Ta as throwIfAborted, Wn as assertBoxlessPromptOptions, _a as deleteBoxSafe, ci as parseCodexTokenUsage, ct as environmentReader, ei as captureWorktreeDiff, ii as LOCAL_HARNESSES, jr as mergeTraceEnv, li as CodexExecutionDiagnosticError, lt as hostDirectoryReader, ni as removeWorktree, oi as harnessSupportsReasoningEffort, ri as DEFAULT_LOCAL_HARNESS, si as localHarnessExecutable, st as SPAWN_RESOURCE_PATH_MAX_BYTES, ti as createWorktree, ut as resolveSpawnResourcePaths, wa as throwAbort } from "../supervisor-DdKPGluv.js";
2
2
  import { i as ConfigError, m as ValidationError } from "../errors-DodWX-cb.js";
3
3
  import { t as assertExecutableAgentProfile } from "../model-policy-BbSCSak0.js";
4
- import { E as runCoderChecks, ft as selectValidWinner } from "../runtime-hOLlAc1i.js";
5
- import { A as downMessageRefusalReasons, C as ANALYST_DEFINITION_BOUNDS, M as parseAuthoredAnalystDefinition, N as questionEscalationTargets, O as createCoordinationTools, T as analystToolGroupNames, w as DEFAULT_AWAIT_EVENT_TIMEOUT_MS } from "../coordination-driver-DdZ-nh_4.js";
6
- import { n as createStdioToolServer } from "../tool-server-x9NEhvHZ.js";
4
+ import { O as runCoderChecks, mt as selectValidWinner } from "../runtime-CHxXrUeZ.js";
5
+ import { A as createCoordinationTools, D as analystToolGroupNames, E as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, F as questionEscalationTargets, M as downMessageRefusalReasons, P as parseAuthoredAnalystDefinition, T as ANALYST_DEFINITION_BOUNDS } from "../coordination-driver-CkcW4dxU.js";
6
+ import { n as SUPPORTED_PROTOCOL_VERSIONS, r as createStdioToolServer } from "../tool-server-Dqer2M4_.js";
7
7
  import { t as createKbGate } from "../kb-gate-DpaSwXVx.js";
8
8
  import { _ as InMemoryFeedbackStore, a as validateDelegationStatusArgs, c as DELEGATION_HISTORY_TOOL_NAME, d as delegationProfiles, f as DELEGATE_FEEDBACK_DESCRIPTION, g as validateDelegateFeedbackArgs, h as createDelegateFeedbackHandler, i as createDelegationStatusHandler, l as createDelegationHistoryHandler, m as DELEGATE_FEEDBACK_TOOL_NAME, n as DELEGATION_STATUS_INPUT_SCHEMA, o as DELEGATION_HISTORY_DESCRIPTION, p as DELEGATE_FEEDBACK_INPUT_SCHEMA, r as DELEGATION_STATUS_TOOL_NAME, s as DELEGATION_HISTORY_INPUT_SCHEMA, t as DELEGATION_STATUS_DESCRIPTION, u as validateDelegationHistoryArgs, v as eventToSnapshot } from "../delegation-status-CF4D0NZ_.js";
9
9
  import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "../openai-tools-DoQ32vpe.js";
10
10
  import { t as coderTaskToPrompt } from "../coder-yhVWbdWc.js";
11
- import { C as composeLoopTraceEmitters, S as capDelegationTrace, _ as FileDelegationStore, a as DELEGATE_UI_AUDIT_TOOL_NAME, b as DELEGATION_TRACE_MAX_SPANS, c as DELEGATE_DESCRIPTION, d as createDelegateHandler, f as validateDelegateArgs, g as DelegationStateCorruptError, h as DelegationPersistenceError, i as DELEGATE_UI_AUDIT_INPUT_SCHEMA, l as DELEGATE_INPUT_SCHEMA, m as hashIdempotencyInput, n as createMcpServer, o as createDelegateUiAuditHandler, p as DelegationTaskQueue, r as DELEGATE_UI_AUDIT_DESCRIPTION, s as validateDelegateUiAuditArgs, t as createInProcessTransport, u as DELEGATE_TOOL_NAME, v as InMemoryDelegationStore, w as createDelegationTraceCollector, x as buildDelegationTraceSpans, y as DELEGATION_TRACE_MAX_BYTES } from "../server-DOb67ohd.js";
12
- import { a as createMemoryToolServer, c as resolveMemoryFromEnv, i as MEMORY_NAME_ENV, n as MEMORY_ITEMS_ENV, o as parseMemoryItems, r as MEMORY_LOG_ENV, s as readMemoryItemsFile, t as MEMORY_FILE_ENV } from "../memory-server-Cn8LbAxO.js";
11
+ import { C as composeLoopTraceEmitters, S as capDelegationTrace, _ as FileDelegationStore, a as DELEGATE_UI_AUDIT_TOOL_NAME, b as DELEGATION_TRACE_MAX_SPANS, c as DELEGATE_DESCRIPTION, d as createDelegateHandler, f as validateDelegateArgs, g as DelegationStateCorruptError, h as DelegationPersistenceError, i as DELEGATE_UI_AUDIT_INPUT_SCHEMA, l as DELEGATE_INPUT_SCHEMA, m as hashIdempotencyInput, n as createMcpServer, o as createDelegateUiAuditHandler, p as DelegationTaskQueue, r as DELEGATE_UI_AUDIT_DESCRIPTION, s as validateDelegateUiAuditArgs, t as createInProcessTransport, u as DELEGATE_TOOL_NAME, v as InMemoryDelegationStore, w as createDelegationTraceCollector, x as buildDelegationTraceSpans, y as DELEGATION_TRACE_MAX_BYTES } from "../server-2OeFrEVG.js";
12
+ import { a as createMemoryToolServer, c as resolveMemoryFromEnv, i as MEMORY_NAME_ENV, n as MEMORY_ITEMS_ENV, o as parseMemoryItems, r as MEMORY_LOG_ENV, s as readMemoryItemsFile, t as MEMORY_FILE_ENV } from "../memory-server-DXQ8IxGR.js";
13
13
  import { agentProfileSchema } from "@tangle-network/agent-interface";
14
14
  import { randomUUID } from "node:crypto";
15
15
  //#region src/mcp/executor.ts
@@ -1169,6 +1169,6 @@ function collidesWithHarnessNativeTool(name) {
1169
1169
  return sourcedHarnesses.filter((harness) => harnessNativeTools[harness].some((native) => native.toLowerCase() === wanted));
1170
1170
  }
1171
1171
  //#endregion
1172
- export { ANALYST_DEFINITION_BOUNDS, CodexExecutionDiagnosticError, DEFAULT_AWAIT_EVENT_TIMEOUT_MS, DEFAULT_LOCAL_HARNESS, DELEGATE_DESCRIPTION, DELEGATE_FEEDBACK_DESCRIPTION, DELEGATE_FEEDBACK_INPUT_SCHEMA, DELEGATE_FEEDBACK_TOOL_NAME, DELEGATE_INPUT_SCHEMA, DELEGATE_TOOL_NAME, DELEGATE_UI_AUDIT_DESCRIPTION, DELEGATE_UI_AUDIT_INPUT_SCHEMA, DELEGATE_UI_AUDIT_TOOL_NAME, DELEGATION_HISTORY_DESCRIPTION, DELEGATION_HISTORY_INPUT_SCHEMA, DELEGATION_HISTORY_TOOL_NAME, DELEGATION_STATUS_DESCRIPTION, DELEGATION_STATUS_INPUT_SCHEMA, DELEGATION_STATUS_TOOL_NAME, DELEGATION_TRACE_MAX_BYTES, DELEGATION_TRACE_MAX_SPANS, DelegationPersistenceError, DelegationStateCorruptError, DelegationTaskQueue, FileDelegationStore, InMemoryDelegationStore, InMemoryFeedbackStore, LOCAL_HARNESSES, MEMORY_FILE_ENV, MEMORY_ITEMS_ENV, MEMORY_LOG_ENV, MEMORY_NAME_ENV, SPAWN_RESOURCE_PATH_MAX_BYTES, analystToolGroupNames, buildDelegationTraceSpans, capDelegationTrace, captureWorktreeDiff, coderTaskFromArgs, collidesWithHarnessNativeTool, composeLoopTraceEmitters, createCoordinationTools, createDelegateFeedbackHandler, createDelegateHandler, createDelegateUiAuditHandler, createDelegationHistoryHandler, createDelegationStatusHandler, createDelegationTraceCollector, createDetachedTurnResumeDriver, createFleetWorkspaceExecutor, createInProcessExecutor, createInProcessTransport, createKbGate, createMcpServer, createMemoryToolServer, createPropagatingTraceEmitter, createSiblingSandboxExecutor, createStdioToolServer, createWorktree, delegationProfiles, detachedSessionDelegate, detachedTurnEvents, detectExecutor, downMessageRefusalReasons, environmentReader, eventToSnapshot, formatDetachedSessionRef, harnessNativeToolNames, harnessNativeTools, harnessSupportsReasoningEffort, hashIdempotencyInput, hostDirectoryReader, localHarnessExecutable, mcpToolsForRuntimeMcp, mcpToolsForRuntimeMcpSubset, mergeTraceEnv, parseAuthoredAnalystDefinition, parseCodexTokenUsage, parseDetachedSessionRef, parseMemoryItems, questionEscalationTargets, readMemoryItemsFile, readTraceContextFromEnv, removeWorktree, resolveMemoryFromEnv, resolveSpawnResourcePaths, runDetachedTurn, settleDetachedCoderTurn, sourcedHarnesses, traceContextToEnv, validateDelegateArgs, validateDelegateFeedbackArgs, validateDelegateUiAuditArgs, validateDelegationHistoryArgs, validateDelegationStatusArgs };
1172
+ export { ANALYST_DEFINITION_BOUNDS, CodexExecutionDiagnosticError, DEFAULT_AWAIT_EVENT_TIMEOUT_MS, DEFAULT_LOCAL_HARNESS, DELEGATE_DESCRIPTION, DELEGATE_FEEDBACK_DESCRIPTION, DELEGATE_FEEDBACK_INPUT_SCHEMA, DELEGATE_FEEDBACK_TOOL_NAME, DELEGATE_INPUT_SCHEMA, DELEGATE_TOOL_NAME, DELEGATE_UI_AUDIT_DESCRIPTION, DELEGATE_UI_AUDIT_INPUT_SCHEMA, DELEGATE_UI_AUDIT_TOOL_NAME, DELEGATION_HISTORY_DESCRIPTION, DELEGATION_HISTORY_INPUT_SCHEMA, DELEGATION_HISTORY_TOOL_NAME, DELEGATION_STATUS_DESCRIPTION, DELEGATION_STATUS_INPUT_SCHEMA, DELEGATION_STATUS_TOOL_NAME, DELEGATION_TRACE_MAX_BYTES, DELEGATION_TRACE_MAX_SPANS, DelegationPersistenceError, DelegationStateCorruptError, DelegationTaskQueue, FileDelegationStore, InMemoryDelegationStore, InMemoryFeedbackStore, LOCAL_HARNESSES, MEMORY_FILE_ENV, MEMORY_ITEMS_ENV, MEMORY_LOG_ENV, MEMORY_NAME_ENV, SPAWN_RESOURCE_PATH_MAX_BYTES, SUPPORTED_PROTOCOL_VERSIONS, analystToolGroupNames, buildDelegationTraceSpans, capDelegationTrace, captureWorktreeDiff, coderTaskFromArgs, collidesWithHarnessNativeTool, composeLoopTraceEmitters, createCoordinationTools, createDelegateFeedbackHandler, createDelegateHandler, createDelegateUiAuditHandler, createDelegationHistoryHandler, createDelegationStatusHandler, createDelegationTraceCollector, createDetachedTurnResumeDriver, createFleetWorkspaceExecutor, createInProcessExecutor, createInProcessTransport, createKbGate, createMcpServer, createMemoryToolServer, createPropagatingTraceEmitter, createSiblingSandboxExecutor, createStdioToolServer, createWorktree, delegationProfiles, detachedSessionDelegate, detachedTurnEvents, detectExecutor, downMessageRefusalReasons, environmentReader, eventToSnapshot, formatDetachedSessionRef, harnessNativeToolNames, harnessNativeTools, harnessSupportsReasoningEffort, hashIdempotencyInput, hostDirectoryReader, localHarnessExecutable, mcpToolsForRuntimeMcp, mcpToolsForRuntimeMcpSubset, mergeTraceEnv, parseAuthoredAnalystDefinition, parseCodexTokenUsage, parseDetachedSessionRef, parseMemoryItems, questionEscalationTargets, readMemoryItemsFile, readTraceContextFromEnv, removeWorktree, resolveMemoryFromEnv, resolveSpawnResourcePaths, runDetachedTurn, settleDetachedCoderTurn, sourcedHarnesses, traceContextToEnv, validateDelegateArgs, validateDelegateFeedbackArgs, validateDelegateUiAuditArgs, validateDelegationHistoryArgs, validateDelegationStatusArgs };
1173
1173
 
1174
1174
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as createMemoryToolServer, c as resolveMemoryFromEnv } from "../memory-server-Cn8LbAxO.js";
2
+ import { a as createMemoryToolServer, c as resolveMemoryFromEnv } from "../memory-server-DXQ8IxGR.js";
3
3
  //#region src/mcp/memory-bin.ts
4
4
  /**
5
5
  * `agent-runtime-memory-mcp` — stdio memory MCP server entry point.
@@ -1,5 +1,5 @@
1
1
  import { m as ValidationError } from "./errors-DodWX-cb.js";
2
- import { n as createStdioToolServer } from "./tool-server-x9NEhvHZ.js";
2
+ import { r as createStdioToolServer } from "./tool-server-Dqer2M4_.js";
3
3
  import { appendFileSync, mkdirSync, readFileSync } from "node:fs";
4
4
  import { dirname } from "node:path";
5
5
  //#region src/mcp/memory-server.ts
@@ -231,4 +231,4 @@ function scoreItem(queryTokens, item) {
231
231
  //#endregion
232
232
  export { createMemoryToolServer as a, resolveMemoryFromEnv as c, MEMORY_NAME_ENV as i, MEMORY_ITEMS_ENV as n, parseMemoryItems as o, MEMORY_LOG_ENV as r, readMemoryItemsFile as s, MEMORY_FILE_ENV as t };
233
233
 
234
- //# sourceMappingURL=memory-server-Cn8LbAxO.js.map
234
+ //# sourceMappingURL=memory-server-DXQ8IxGR.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"memory-server-Cn8LbAxO.js","names":[],"sources":["../src/mcp/memory-server.ts"],"sourcesContent":["/**\n * Memory MCP server — the LIVE serving half of the `memory` profile surface\n * (Phase 5). A curated memory (lessons distilled from prior runs) is only\n * real if the DRIVEN agent can query it mid-task; this module serves a flat\n * store of `MemoryItem` rows as `memory_search` / `memory_get` tools over the\n * ONE in-repo stdio JSON-RPC core (`createStdioToolServer`), so the exact\n * wire protocol the same-host client (`connectStdioMcp` /\n * `materializeLocalMcp`, runtime/stdio-mcp-client.ts) speaks is guaranteed by\n * construction — serve and consume cannot drift.\n *\n * Retrieval is DETERMINISTIC lexical overlap (no vectors, no LLM): a lift\n * measured with this memory mounted is attributable to the lessons\n * themselves, never to retrieval-model noise. Every\n * `memory_search` can append one JSONL row to a retrieval log (`logPath`) —\n * the per-query record an off-policy retrieval estimator (agent-knowledge's\n * `RetrievalHoldout`) consumes. agent-knowledge is NOT a dependency of this\n * repo, so the log file is the flagged cross-package seam, not an import.\n *\n * Fail-loud discipline (mirrors `materializeLocalMcp`): an EMPTY memory is\n * never served — a profile without memory simply omits the artifact, and\n * silently serving zero rows would fake the with/without ablation.\n *\n * @experimental\n */\n\nimport { appendFileSync, mkdirSync, readFileSync } from 'node:fs'\nimport { dirname } from 'node:path'\nimport type { AgentProfileMcpServer } from '@tangle-network/agent-interface'\nimport { ValidationError } from '../errors'\nimport { createStdioToolServer, type McpToolDescriptor, type StdioToolServer } from './tool-server'\n\n/** One row of agent memory: a crisp lesson/fact with provenance. */\nexport interface MemoryItem {\n /** Stable id (content-hash by convention; see `memoryArtifactFromLessons`). */\n id: string\n /** The lesson itself — one imperative or observation the agent should recall. */\n text: string\n /** Optional retrieval tags, matched by `memory_search` alongside the text. */\n tags?: string[]\n /** Provenance: the finding / trace / curation pass this row came from. */\n source?: string\n}\n\n/**\n * The `memory` artifact payload — HOW a profile's memory is stored and served:\n *\n * - `store: 'file'` — served by the in-repo memory bin\n * (`agent-runtime-memory-mcp`, src/mcp/memory-bin.ts): rows load from\n * `path` (a JSON array or JSONL file of `MemoryItem`) and/or the inline\n * `items` seed (inline wins on id collision). At least one of\n * `path`/`items` is required.\n * - `store: 'mcp'` — an EXTERNAL, already-runnable MCP server that exposes\n * the memory tools itself; `server` is required and mounts verbatim.\n *\n * `logPath` makes the served memory append one JSONL row per `memory_search`\n * — the retrieval log a holdout estimator reads (see module doc).\n */\nexport interface AgentMemorySpec {\n store: 'file' | 'mcp'\n /** `store:'file'` — host path to the durable row store (JSON array or JSONL). */\n path?: string\n /** Inline seed rows, served alongside (and winning over) `path` rows. */\n items?: MemoryItem[]\n /** `store:'mcp'` — the external server that already serves memory tools. */\n server?: AgentProfileMcpServer\n /** JSONL retrieval log: one row per `memory_search` (ts, query, k, returned). */\n logPath?: string\n}\n\n/** Env var naming the durable row store file the memory bin loads (the\n * `memoryMcpServer` ↔ memory-bin contract). */\nexport const MEMORY_FILE_ENV = 'AGENT_MEMORY_FILE'\n/** Env var carrying inline JSON `MemoryItem` rows (win over file rows on id). */\nexport const MEMORY_ITEMS_ENV = 'AGENT_MEMORY_ITEMS'\n/** Env var naming the JSONL retrieval log (one row per `memory_search`). */\nexport const MEMORY_LOG_ENV = 'AGENT_MEMORY_LOG'\n/** Env var overriding the served display name (default 'agent-memory'). */\nexport const MEMORY_NAME_ENV = 'AGENT_MEMORY_NAME'\n\nexport interface CreateMemoryToolServerOptions {\n /** The rows to serve. MUST be non-empty (an empty memory is never served). */\n items: readonly MemoryItem[]\n /** Server display name surfaced via `initialize`. Default 'agent-memory'. */\n serverName?: string\n /** Server version surfaced via `initialize`. Default '0'. */\n serverVersion?: string\n /** Default result count for `memory_search`. Default 5. */\n defaultK?: number\n /** Append one JSONL row per `memory_search` (the retrieval-holdout seam). */\n logPath?: string\n}\n\n/**\n * Build the memory MCP server: `memory_search` (lexical top-k over the rows)\n * and `memory_get` (one row by id) on the generic stdio JSON-RPC core.\n */\nexport function createMemoryToolServer(opts: CreateMemoryToolServerOptions): StdioToolServer {\n if (opts.items.length === 0) {\n throw new ValidationError(\n 'createMemoryToolServer: refusing to serve an EMPTY memory — a profile without memory omits the artifact; serving zero rows would fake the with/without ablation',\n )\n }\n const byId = new Map<string, MemoryItem>()\n for (const item of opts.items) {\n if (byId.has(item.id)) {\n throw new ValidationError(`createMemoryToolServer: duplicate memory item id '${item.id}'`)\n }\n byId.set(item.id, item)\n }\n const items = [...byId.values()]\n const defaultK = opts.defaultK ?? 5\n const logPath = opts.logPath\n if (logPath) mkdirSync(dirname(logPath), { recursive: true })\n\n const search: McpToolDescriptor = {\n name: 'memory_search',\n description:\n 'Search the agent memory of lessons learned from prior runs. Give what you are about to do or the problem you face; returns the top-k lessons ranked by relevance. Consult it BEFORE repeating work a prior run already learned from.',\n inputSchema: {\n type: 'object',\n properties: {\n query: {\n type: 'string',\n description: 'The task/problem at hand — matched against lesson text and tags.',\n },\n k: { type: 'number', description: `Max results (default ${defaultK}).` },\n tags: {\n type: 'array',\n items: { type: 'string' },\n description: 'Only return items carrying at least one of these tags.',\n },\n },\n required: ['query'],\n },\n handler: async (raw) => {\n const args = (raw ?? {}) as { query?: unknown; k?: unknown; tags?: unknown }\n if (typeof args.query !== 'string' || args.query.trim().length === 0) {\n throw new TypeError('memory_search: query must be a non-empty string')\n }\n const k = args.k === undefined ? defaultK : Math.floor(Number(args.k))\n if (!Number.isFinite(k) || k < 1) {\n throw new TypeError('memory_search: k must be a positive integer')\n }\n let tagFilter: string[] | undefined\n if (args.tags !== undefined) {\n if (!Array.isArray(args.tags) || args.tags.some((t) => typeof t !== 'string')) {\n throw new TypeError('memory_search: tags must be an array of strings')\n }\n tagFilter = args.tags as string[]\n }\n const queryTokens = tokenize(args.query)\n const pool = tagFilter\n ? items.filter((i) => (i.tags ?? []).some((t) => tagFilter.includes(t)))\n : items\n const results = pool\n .map((item) => ({ item, score: scoreItem(queryTokens, item) }))\n .filter((r) => r.score > 0)\n // Highest score first; stable on ties (curation order is the tiebreak).\n .sort((a, b) => b.score - a.score)\n .slice(0, k)\n .map(({ item, score }) => ({\n id: item.id,\n text: item.text,\n score: Number(score.toFixed(4)),\n ...(item.tags ? { tags: item.tags } : {}),\n ...(item.source ? { source: item.source } : {}),\n }))\n if (logPath) {\n // The retrieval log: what was asked, what came back, at what rank —\n // exactly the per-query record an off-policy estimator needs.\n appendFileSync(\n logPath,\n `${JSON.stringify({\n ts: new Date().toISOString(),\n query: args.query,\n k,\n returned: results.map((r) => ({ id: r.id, score: r.score })),\n })}\\n`,\n )\n }\n return { query: args.query, results }\n },\n }\n\n const get: McpToolDescriptor = {\n name: 'memory_get',\n description: 'Fetch one memory item verbatim by its id (ids come from memory_search results).',\n inputSchema: {\n type: 'object',\n properties: { id: { type: 'string', description: 'The memory item id.' } },\n required: ['id'],\n },\n handler: async (raw) => {\n const args = (raw ?? {}) as { id?: unknown }\n if (typeof args.id !== 'string' || args.id.trim().length === 0) {\n throw new TypeError('memory_get: id must be a non-empty string')\n }\n const item = byId.get(args.id)\n if (!item) throw new Error(`memory_get: no memory item with id '${args.id}'`)\n return item\n },\n }\n\n return createStdioToolServer({\n serverName: opts.serverName ?? 'agent-memory',\n serverVersion: opts.serverVersion ?? '0',\n tools: [search, get],\n })\n}\n\n/** Coerce an untrusted JSON array into validated `MemoryItem` rows. */\nexport function parseMemoryItems(value: unknown, source: string): MemoryItem[] {\n if (!Array.isArray(value)) {\n throw new ValidationError(`${source}: expected a JSON array of memory items`)\n }\n return value.map((row, i) => coerceMemoryItem(row, `${source}[${i}]`))\n}\n\n/** Read a memory store file: a JSON array, or JSONL (one `MemoryItem` per line). */\nexport function readMemoryItemsFile(path: string): MemoryItem[] {\n let raw: string\n try {\n raw = readFileSync(path, 'utf8')\n } catch (err) {\n throw new ValidationError(\n `readMemoryItemsFile: cannot read '${path}': ${err instanceof Error ? err.message : String(err)}`,\n )\n }\n const trimmed = raw.trim()\n if (trimmed.length === 0) return []\n if (trimmed.startsWith('[')) {\n let parsed: unknown\n try {\n parsed = JSON.parse(trimmed)\n } catch (err) {\n throw new ValidationError(\n `readMemoryItemsFile: '${path}' is not valid JSON: ${(err as Error).message}`,\n )\n }\n return parseMemoryItems(parsed, path)\n }\n return trimmed\n .split('\\n')\n .map((line) => line.trim())\n .filter((line) => line.length > 0)\n .map((line, i) => {\n let parsed: unknown\n try {\n parsed = JSON.parse(line)\n } catch (err) {\n throw new ValidationError(\n `readMemoryItemsFile: '${path}' line ${i + 1} is not valid JSON: ${(err as Error).message}`,\n )\n }\n return coerceMemoryItem(parsed, `${path}:${i + 1}`)\n })\n}\n\n/** What the memory bin resolved from its environment. */\nexport interface ResolvedMemoryEnv {\n items: MemoryItem[]\n serverName?: string\n logPath?: string\n}\n\n/**\n * Resolve the bin's memory from `AGENT_MEMORY_FILE` (durable store) and/or\n * `AGENT_MEMORY_ITEMS` (inline JSON rows; wins on id collision). Zero rows is\n * a boot FAILURE, matching the fail-closed materialization discipline.\n */\nexport function resolveMemoryFromEnv(env: Record<string, string | undefined>): ResolvedMemoryEnv {\n const filePath = env[MEMORY_FILE_ENV]\n const inlineRaw = env[MEMORY_ITEMS_ENV]\n const fromFile = filePath ? readMemoryItemsFile(filePath) : []\n let inline: MemoryItem[] = []\n if (inlineRaw) {\n let parsed: unknown\n try {\n parsed = JSON.parse(inlineRaw)\n } catch (err) {\n throw new ValidationError(\n `${MEMORY_ITEMS_ENV} is not valid JSON: ${err instanceof Error ? err.message : String(err)}`,\n )\n }\n inline = parseMemoryItems(parsed, MEMORY_ITEMS_ENV)\n }\n const byId = new Map<string, MemoryItem>()\n for (const item of fromFile) byId.set(item.id, item)\n for (const item of inline) byId.set(item.id, item)\n if (byId.size === 0) {\n throw new ValidationError(\n `memory bin: no memory items — set ${MEMORY_FILE_ENV} and/or ${MEMORY_ITEMS_ENV}; an EMPTY memory must never be served (a profile without memory omits the artifact)`,\n )\n }\n const serverName = env[MEMORY_NAME_ENV]\n const logPath = env[MEMORY_LOG_ENV]\n return {\n items: [...byId.values()],\n ...(serverName ? { serverName } : {}),\n ...(logPath ? { logPath } : {}),\n }\n}\n\nfunction coerceMemoryItem(row: unknown, at: string): MemoryItem {\n if (!row || typeof row !== 'object' || Array.isArray(row)) {\n throw new ValidationError(`${at}: memory item must be an object`)\n }\n const r = row as Record<string, unknown>\n if (typeof r.id !== 'string' || r.id.trim().length === 0) {\n throw new ValidationError(`${at}: 'id' must be a non-empty string`)\n }\n if (typeof r.text !== 'string' || r.text.trim().length === 0) {\n throw new ValidationError(`${at}: 'text' must be a non-empty string`)\n }\n let tags: string[] | undefined\n if (r.tags !== undefined) {\n if (!Array.isArray(r.tags) || r.tags.some((t) => typeof t !== 'string')) {\n throw new ValidationError(`${at}: 'tags' must be an array of strings`)\n }\n tags = r.tags as string[]\n }\n if (r.source !== undefined && typeof r.source !== 'string') {\n throw new ValidationError(`${at}: 'source' must be a string`)\n }\n return {\n id: r.id,\n text: r.text,\n ...(tags ? { tags } : {}),\n ...(typeof r.source === 'string' ? { source: r.source } : {}),\n }\n}\n\n/** Unique lowercase alphanumeric tokens of length >= 2. */\nfunction tokenize(text: string): string[] {\n return [\n ...new Set(\n text\n .toLowerCase()\n .split(/[^a-z0-9]+/)\n .filter((t) => t.length >= 2),\n ),\n ]\n}\n\n/** Fraction of query tokens present in the item's text + tags (0..1). */\nfunction scoreItem(queryTokens: readonly string[], item: MemoryItem): number {\n if (queryTokens.length === 0) return 0\n const hay = new Set(tokenize(`${item.text} ${(item.tags ?? []).join(' ')}`))\n let hit = 0\n for (const t of queryTokens) if (hay.has(t)) hit += 1\n return hit / queryTokens.length\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAa,kBAAkB;;AAE/B,MAAa,mBAAmB;;AAEhC,MAAa,iBAAiB;;AAE9B,MAAa,kBAAkB;;;;;AAmB/B,SAAgB,uBAAuB,MAAsD;CAC3F,IAAI,KAAK,MAAM,WAAW,GACxB,MAAM,IAAI,gBACR,iKACF;CAEF,MAAM,uBAAO,IAAI,IAAwB;CACzC,KAAK,MAAM,QAAQ,KAAK,OAAO;EAC7B,IAAI,KAAK,IAAI,KAAK,EAAE,GAClB,MAAM,IAAI,gBAAgB,qDAAqD,KAAK,GAAG,EAAE;EAE3F,KAAK,IAAI,KAAK,IAAI,IAAI;CACxB;CACA,MAAM,QAAQ,CAAC,GAAG,KAAK,OAAO,CAAC;CAC/B,MAAM,WAAW,KAAK,YAAY;CAClC,MAAM,UAAU,KAAK;CACrB,IAAI,SAAS,UAAU,QAAQ,OAAO,GAAG,EAAE,WAAW,KAAK,CAAC;CAE5D,MAAM,SAA4B;EAChC,MAAM;EACN,aACE;EACF,aAAa;GACX,MAAM;GACN,YAAY;IACV,OAAO;KACL,MAAM;KACN,aAAa;IACf;IACA,GAAG;KAAE,MAAM;KAAU,aAAa,wBAAwB,SAAS;IAAI;IACvE,MAAM;KACJ,MAAM;KACN,OAAO,EAAE,MAAM,SAAS;KACxB,aAAa;IACf;GACF;GACA,UAAU,CAAC,OAAO;EACpB;EACA,SAAS,OAAO,QAAQ;GACtB,MAAM,OAAQ,OAAO,CAAC;GACtB,IAAI,OAAO,KAAK,UAAU,YAAY,KAAK,MAAM,KAAK,CAAC,CAAC,WAAW,GACjE,MAAM,IAAI,UAAU,i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AAG,CAAC;CAC3E,IAAI,MAAM;CACV,KAAK,MAAM,KAAK,aAAa,IAAI,IAAI,IAAI,CAAC,GAAG,OAAO;CACpD,OAAO,MAAM,YAAY;AAC3B"}
1
+ {"version":3,"file":"memory-server-DXQ8IxGR.js","names":[],"sources":["../src/mcp/memory-server.ts"],"sourcesContent":["/**\n * Memory MCP server — the LIVE serving half of the `memory` profile surface\n * (Phase 5). A curated memory (lessons distilled from prior runs) is only\n * real if the DRIVEN agent can query it mid-task; this module serves a flat\n * store of `MemoryItem` rows as `memory_search` / `memory_get` tools over the\n * ONE in-repo stdio JSON-RPC core (`createStdioToolServer`), so the exact\n * wire protocol the same-host client (`connectStdioMcp` /\n * `materializeLocalMcp`, runtime/stdio-mcp-client.ts) speaks is guaranteed by\n * construction — serve and consume cannot drift.\n *\n * Retrieval is DETERMINISTIC lexical overlap (no vectors, no LLM): a lift\n * measured with this memory mounted is attributable to the lessons\n * themselves, never to retrieval-model noise. Every\n * `memory_search` can append one JSONL row to a retrieval log (`logPath`) —\n * the per-query record an off-policy retrieval estimator (agent-knowledge's\n * `RetrievalHoldout`) consumes. agent-knowledge is NOT a dependency of this\n * repo, so the log file is the flagged cross-package seam, not an import.\n *\n * Fail-loud discipline (mirrors `materializeLocalMcp`): an EMPTY memory is\n * never served — a profile without memory simply omits the artifact, and\n * silently serving zero rows would fake the with/without ablation.\n *\n * @experimental\n */\n\nimport { appendFileSync, mkdirSync, readFileSync } from 'node:fs'\nimport { dirname } from 'node:path'\nimport type { AgentProfileMcpServer } from '@tangle-network/agent-interface'\nimport { ValidationError } from '../errors'\nimport { createStdioToolServer, type McpToolDescriptor, type StdioToolServer } from './tool-server'\n\n/** One row of agent memory: a crisp lesson/fact with provenance. */\nexport interface MemoryItem {\n /** Stable id (content-hash by convention; see `memoryArtifactFromLessons`). */\n id: string\n /** The lesson itself — one imperative or observation the agent should recall. */\n text: string\n /** Optional retrieval tags, matched by `memory_search` alongside the text. */\n tags?: string[]\n /** Provenance: the finding / trace / curation pass this row came from. */\n source?: string\n}\n\n/**\n * The `memory` artifact payload — HOW a profile's memory is stored and served:\n *\n * - `store: 'file'` — served by the in-repo memory bin\n * (`agent-runtime-memory-mcp`, src/mcp/memory-bin.ts): rows load from\n * `path` (a JSON array or JSONL file of `MemoryItem`) and/or the inline\n * `items` seed (inline wins on id collision). At least one of\n * `path`/`items` is required.\n * - `store: 'mcp'` — an EXTERNAL, already-runnable MCP server that exposes\n * the memory tools itself; `server` is required and mounts verbatim.\n *\n * `logPath` makes the served memory append one JSONL row per `memory_search`\n * — the retrieval log a holdout estimator reads (see module doc).\n */\nexport interface AgentMemorySpec {\n store: 'file' | 'mcp'\n /** `store:'file'` — host path to the durable row store (JSON array or JSONL). */\n path?: string\n /** Inline seed rows, served alongside (and winning over) `path` rows. */\n items?: MemoryItem[]\n /** `store:'mcp'` — the external server that already serves memory tools. */\n server?: AgentProfileMcpServer\n /** JSONL retrieval log: one row per `memory_search` (ts, query, k, returned). */\n logPath?: string\n}\n\n/** Env var naming the durable row store file the memory bin loads (the\n * `memoryMcpServer` ↔ memory-bin contract). */\nexport const MEMORY_FILE_ENV = 'AGENT_MEMORY_FILE'\n/** Env var carrying inline JSON `MemoryItem` rows (win over file rows on id). */\nexport const MEMORY_ITEMS_ENV = 'AGENT_MEMORY_ITEMS'\n/** Env var naming the JSONL retrieval log (one row per `memory_search`). */\nexport const MEMORY_LOG_ENV = 'AGENT_MEMORY_LOG'\n/** Env var overriding the served display name (default 'agent-memory'). */\nexport const MEMORY_NAME_ENV = 'AGENT_MEMORY_NAME'\n\nexport interface CreateMemoryToolServerOptions {\n /** The rows to serve. MUST be non-empty (an empty memory is never served). */\n items: readonly MemoryItem[]\n /** Server display name surfaced via `initialize`. Default 'agent-memory'. */\n serverName?: string\n /** Server version surfaced via `initialize`. Default '0'. */\n serverVersion?: string\n /** Default result count for `memory_search`. Default 5. */\n defaultK?: number\n /** Append one JSONL row per `memory_search` (the retrieval-holdout seam). */\n logPath?: string\n}\n\n/**\n * Build the memory MCP server: `memory_search` (lexical top-k over the rows)\n * and `memory_get` (one row by id) on the generic stdio JSON-RPC core.\n */\nexport function createMemoryToolServer(opts: CreateMemoryToolServerOptions): StdioToolServer {\n if (opts.items.length === 0) {\n throw new ValidationError(\n 'createMemoryToolServer: refusing to serve an EMPTY memory — a profile without memory omits the artifact; serving zero rows would fake the with/without ablation',\n )\n }\n const byId = new Map<string, MemoryItem>()\n for (const item of opts.items) {\n if (byId.has(item.id)) {\n throw new ValidationError(`createMemoryToolServer: duplicate memory item id '${item.id}'`)\n }\n byId.set(item.id, item)\n }\n const items = [...byId.values()]\n const defaultK = opts.defaultK ?? 5\n const logPath = opts.logPath\n if (logPath) mkdirSync(dirname(logPath), { recursive: true })\n\n const search: McpToolDescriptor = {\n name: 'memory_search',\n description:\n 'Search the agent memory of lessons learned from prior runs. Give what you are about to do or the problem you face; returns the top-k lessons ranked by relevance. Consult it BEFORE repeating work a prior run already learned from.',\n inputSchema: {\n type: 'object',\n properties: {\n query: {\n type: 'string',\n description: 'The task/problem at hand — matched against lesson text and tags.',\n },\n k: { type: 'number', description: `Max results (default ${defaultK}).` },\n tags: {\n type: 'array',\n items: { type: 'string' },\n description: 'Only return items carrying at least one of these tags.',\n },\n },\n required: ['query'],\n },\n handler: async (raw) => {\n const args = (raw ?? {}) as { query?: unknown; k?: unknown; tags?: unknown }\n if (typeof args.query !== 'string' || args.query.trim().length === 0) {\n throw new TypeError('memory_search: query must be a non-empty string')\n }\n const k = args.k === undefined ? defaultK : Math.floor(Number(args.k))\n if (!Number.isFinite(k) || k < 1) {\n throw new TypeError('memory_search: k must be a positive integer')\n }\n let tagFilter: string[] | undefined\n if (args.tags !== undefined) {\n if (!Array.isArray(args.tags) || args.tags.some((t) => typeof t !== 'string')) {\n throw new TypeError('memory_search: tags must be an array of strings')\n }\n tagFilter = args.tags as string[]\n }\n const queryTokens = tokenize(args.query)\n const pool = tagFilter\n ? items.filter((i) => (i.tags ?? []).some((t) => tagFilter.includes(t)))\n : items\n const results = pool\n .map((item) => ({ item, score: scoreItem(queryTokens, item) }))\n .filter((r) => r.score > 0)\n // Highest score first; stable on ties (curation order is the tiebreak).\n .sort((a, b) => b.score - a.score)\n .slice(0, k)\n .map(({ item, score }) => ({\n id: item.id,\n text: item.text,\n score: Number(score.toFixed(4)),\n ...(item.tags ? { tags: item.tags } : {}),\n ...(item.source ? { source: item.source } : {}),\n }))\n if (logPath) {\n // The retrieval log: what was asked, what came back, at what rank —\n // exactly the per-query record an off-policy estimator needs.\n appendFileSync(\n logPath,\n `${JSON.stringify({\n ts: new Date().toISOString(),\n query: args.query,\n k,\n returned: results.map((r) => ({ id: r.id, score: r.score })),\n })}\\n`,\n )\n }\n return { query: args.query, results }\n },\n }\n\n const get: McpToolDescriptor = {\n name: 'memory_get',\n description: 'Fetch one memory item verbatim by its id (ids come from memory_search results).',\n inputSchema: {\n type: 'object',\n properties: { id: { type: 'string', description: 'The memory item id.' } },\n required: ['id'],\n },\n handler: async (raw) => {\n const args = (raw ?? {}) as { id?: unknown }\n if (typeof args.id !== 'string' || args.id.trim().length === 0) {\n throw new TypeError('memory_get: id must be a non-empty string')\n }\n const item = byId.get(args.id)\n if (!item) throw new Error(`memory_get: no memory item with id '${args.id}'`)\n return item\n },\n }\n\n return createStdioToolServer({\n serverName: opts.serverName ?? 'agent-memory',\n serverVersion: opts.serverVersion ?? '0',\n tools: [search, get],\n })\n}\n\n/** Coerce an untrusted JSON array into validated `MemoryItem` rows. */\nexport function parseMemoryItems(value: unknown, source: string): MemoryItem[] {\n if (!Array.isArray(value)) {\n throw new ValidationError(`${source}: expected a JSON array of memory items`)\n }\n return value.map((row, i) => coerceMemoryItem(row, `${source}[${i}]`))\n}\n\n/** Read a memory store file: a JSON array, or JSONL (one `MemoryItem` per line). */\nexport function readMemoryItemsFile(path: string): MemoryItem[] {\n let raw: string\n try {\n raw = readFileSync(path, 'utf8')\n } catch (err) {\n throw new ValidationError(\n `readMemoryItemsFile: cannot read '${path}': ${err instanceof Error ? err.message : String(err)}`,\n )\n }\n const trimmed = raw.trim()\n if (trimmed.length === 0) return []\n if (trimmed.startsWith('[')) {\n let parsed: unknown\n try {\n parsed = JSON.parse(trimmed)\n } catch (err) {\n throw new ValidationError(\n `readMemoryItemsFile: '${path}' is not valid JSON: ${(err as Error).message}`,\n )\n }\n return parseMemoryItems(parsed, path)\n }\n return trimmed\n .split('\\n')\n .map((line) => line.trim())\n .filter((line) => line.length > 0)\n .map((line, i) => {\n let parsed: unknown\n try {\n parsed = JSON.parse(line)\n } catch (err) {\n throw new ValidationError(\n `readMemoryItemsFile: '${path}' line ${i + 1} is not valid JSON: ${(err as Error).message}`,\n )\n }\n return coerceMemoryItem(parsed, `${path}:${i + 1}`)\n })\n}\n\n/** What the memory bin resolved from its environment. */\nexport interface ResolvedMemoryEnv {\n items: MemoryItem[]\n serverName?: string\n logPath?: string\n}\n\n/**\n * Resolve the bin's memory from `AGENT_MEMORY_FILE` (durable store) and/or\n * `AGENT_MEMORY_ITEMS` (inline JSON rows; wins on id collision). Zero rows is\n * a boot FAILURE, matching the fail-closed materialization discipline.\n */\nexport function resolveMemoryFromEnv(env: Record<string, string | undefined>): ResolvedMemoryEnv {\n const filePath = env[MEMORY_FILE_ENV]\n const inlineRaw = env[MEMORY_ITEMS_ENV]\n const fromFile = filePath ? readMemoryItemsFile(filePath) : []\n let inline: MemoryItem[] = []\n if (inlineRaw) {\n let parsed: unknown\n try {\n parsed = JSON.parse(inlineRaw)\n } catch (err) {\n throw new ValidationError(\n `${MEMORY_ITEMS_ENV} is not valid JSON: ${err instanceof Error ? err.message : String(err)}`,\n )\n }\n inline = parseMemoryItems(parsed, MEMORY_ITEMS_ENV)\n }\n const byId = new Map<string, MemoryItem>()\n for (const item of fromFile) byId.set(item.id, item)\n for (const item of inline) byId.set(item.id, item)\n if (byId.size === 0) {\n throw new ValidationError(\n `memory bin: no memory items — set ${MEMORY_FILE_ENV} and/or ${MEMORY_ITEMS_ENV}; an EMPTY memory must never be served (a profile without memory omits the artifact)`,\n )\n }\n const serverName = env[MEMORY_NAME_ENV]\n const logPath = env[MEMORY_LOG_ENV]\n return {\n items: [...byId.values()],\n ...(serverName ? { serverName } : {}),\n ...(logPath ? { logPath } : {}),\n }\n}\n\nfunction coerceMemoryItem(row: unknown, at: string): MemoryItem {\n if (!row || typeof row !== 'object' || Array.isArray(row)) {\n throw new ValidationError(`${at}: memory item must be an object`)\n }\n const r = row as Record<string, unknown>\n if (typeof r.id !== 'string' || r.id.trim().length === 0) {\n throw new ValidationError(`${at}: 'id' must be a non-empty string`)\n }\n if (typeof r.text !== 'string' || r.text.trim().length === 0) {\n throw new ValidationError(`${at}: 'text' must be a non-empty string`)\n }\n let tags: string[] | undefined\n if (r.tags !== undefined) {\n if (!Array.isArray(r.tags) || r.tags.some((t) => typeof t !== 'string')) {\n throw new ValidationError(`${at}: 'tags' must be an array of strings`)\n }\n tags = r.tags as string[]\n }\n if (r.source !== undefined && typeof r.source !== 'string') {\n throw new ValidationError(`${at}: 'source' must be a string`)\n }\n return {\n id: r.id,\n text: r.text,\n ...(tags ? { tags } : {}),\n ...(typeof r.source === 'string' ? { source: r.source } : {}),\n }\n}\n\n/** Unique lowercase alphanumeric tokens of length >= 2. */\nfunction tokenize(text: string): string[] {\n return [\n ...new Set(\n text\n .toLowerCase()\n .split(/[^a-z0-9]+/)\n .filter((t) => t.length >= 2),\n ),\n ]\n}\n\n/** Fraction of query tokens present in the item's text + tags (0..1). */\nfunction scoreItem(queryTokens: readonly string[], item: MemoryItem): number {\n if (queryTokens.length === 0) return 0\n const hay = new Set(tokenize(`${item.text} ${(item.tags ?? []).join(' ')}`))\n let hit = 0\n for (const t of queryTokens) if (hay.has(t)) hit += 1\n return hit / queryTokens.length\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAa,kBAAkB;;AAE/B,MAAa,mBAAmB;;AAEhC,MAAa,iBAAiB;;AAE9B,MAAa,kBAAkB;;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E,KAAK,KAAK,CAAC,CAAC,WAAW,GACzD,MAAM,IAAI,gBAAgB,GAAG,GAAG,oCAAoC;CAEtE,IAAI;CACJ,IAAI,EAAE,SAAS,KAAA,GAAW;EACxB,IAAI,CAAC,MAAM,QAAQ,EAAE,IAAI,KAAK,EAAE,KAAK,MAAM,MAAM,OAAO,MAAM,QAAQ,GACpE,MAAM,IAAI,gBAAgB,GAAG,GAAG,qCAAqC;EAEvE,OAAO,EAAE;CACX;CACA,IAAI,EAAE,WAAW,KAAA,KAAa,OAAO,EAAE,WAAW,UAChD,MAAM,IAAI,gBAAgB,GAAG,GAAG,4BAA4B;CAE9D,OAAO;EACL,IAAI,EAAE;EACN,MAAM,EAAE;EACR,GAAI,OAAO,EAAE,KAAK,IAAI,CAAC;EACvB,GAAI,OAAO,EAAE,WAAW,WAAW,EAAE,QAAQ,EAAE,OAAO,IAAI,CAAC;CAC7D;AACF;;AAGA,SAAS,SAAS,MAAwB;CACxC,OAAO,CACL,GAAG,IAAI,IACL,KACG,YAAY,CAAC,CACb,MAAM,YAAY,CAAC,CACnB,QAAQ,MAAM,EAAE,UAAU,CAAC,CAChC,CACF;AACF;;AAGA,SAAS,UAAU,aAAgC,MAA0B;CAC3E,IAAI,YAAY,WAAW,GAAG,OAAO;CACrC,MAAM,MAAM,IAAI,IAAI,SAAS,GAAG,KAAK,KAAK,IAAI,KAAK,QAAQ,CAAC,EAAA,CAAG,KAAK,GAAG,GAAG,CAAC;CAC3E,IAAI,MAAM;CACV,KAAK,MAAM,KAAK,aAAa,IAAI,IAAI,IAAI,CAAC,GAAG,OAAO;CACpD,OAAO,MAAM,YAAY;AAC3B"}
@@ -1,4 +1,4 @@
1
- import { Aa as OpenAIChatTool } from "./types-CrnwLVYQ.js";
1
+ import { Za as OpenAIChatTool } from "./types-DMRc3jru.js";
2
2
  //#region src/mcp/openai-tools.d.ts
3
3
  /**
4
4
  *
@@ -21,4 +21,4 @@ declare function mcpToolsForRuntimeMcp(): OpenAIChatTool[];
21
21
  declare function mcpToolsForRuntimeMcpSubset(names: ReadonlyArray<string>): OpenAIChatTool[];
22
22
  //#endregion
23
23
  export { mcpToolsForRuntimeMcpSubset as n, mcpToolsForRuntimeMcp as t };
24
- //# sourceMappingURL=openai-tools-D3ajI_D2.d.ts.map
24
+ //# sourceMappingURL=openai-tools-Bb0mAr5z.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { C as canonicalCandidateDigest$1, D as immutableCandidateValue, E as embeddedCandidateArtifact, O as omitTopLevelDigest, S as canonicalCandidateBytes$1, T as deepFreezeCandidate, a as persistCandidateOutputArtifact, b as verifyMaterializedWorkspace, c as verifyTaskCheckout, d as isWellFormedUnicode, f as artifactCacheKey, g as readVerifiedArtifact, h as readMaterializedWorkspaceFiles, k as sha256Bytes$1, l as verifyTaskOutcomePatch, o as readCandidateGitHubResource, s as verifyCandidateCode, u as assertExactObjectKeys, v as verifyBytes, w as canonicalCandidateDocument, x as verifyWorkspaceSnapshotArtifacts, y as verifyMaterializedProfileWorkspace } from "./workspace-archive-C9lgf77y.js";
2
- import { i as redactProtectedValue, n as createProtectedRecordRedactor, r as redactProtectedReason, t as assertNoProtectedBytes } from "./protected-redaction--F3v1oo8.js";
2
+ import { i as redactProtectedValue, n as createProtectedRecordRedactor, r as redactProtectedReason, t as assertNoProtectedBytes } from "./protected-redaction-DylCC_ot.js";
3
3
  import { f as parseAgentCandidateProfileActivation, n as PI_CANDIDATE_SESSION_DIR_ENV, o as assertCandidateProfileExecutionSupport, s as candidateProfileAgentPaths, t as PI_CANDIDATE_AGENT_DIR_ENV, u as materializeAgentCandidateProfilePlan } from "./profile-D3eXNBQV.js";
4
4
  import { agentCandidateArtifactRefSchema, agentCandidateBenchmarkResultEvidenceSchema, agentCandidateBenchmarkSuiteSchema, agentCandidateBenchmarkTaskSchema, agentCandidateBundleSchema, agentCandidateContainerSchema, agentCandidateExecutionLimitsSchema, agentCandidateExecutionPlanEvidenceSchema, agentCandidateExecutionPlanMaterialSchema, agentCandidateMaterializationReceiptSchema, agentCandidateModelAccessNetworkSchema, agentCandidateModelSettlementEvidenceSchema, agentCandidateProfilePlanEvidenceSchema, agentCandidateResolvedModelSchema, agentCandidateRunCellSchema, agentCandidateRunReceiptSchema, agentCandidateTaskOutcomeEvidenceSchema, agentCandidateTaskOutcomeSpecSchema, agentCandidateTerminationSchema, agentCandidateWorkspaceManifestMaterialSchema, agentCandidateWorkspaceSnapshotEvidenceSchema, sha256DigestSchema } from "@tangle-network/agent-interface";
5
5
  import { REDACTION_VERSION, isLlmSpan } from "@tangle-network/agent-eval";
@@ -3587,4 +3587,4 @@ function errorMessage(error) {
3587
3587
  //#endregion
3588
3588
  export { recoveredTerminalRecord as A, candidateCleanupDeadline as C, assertTerminalAllowedInPhase as D, assertRecoveryMatchesStaged as E, terminalRecord as F, rejectedStage as M, requireStagedTerminal as N, assertTerminalMatchesClaim as O, sealTerminalDigest as P, candidateClaimFileInternals as S, withinCandidateCleanupDeadline as T, consumePreparedCandidateExecution as _, AGENT_CANDIDATE_EXECUTION_SUPPORT as a, assertAgentCandidateExecutionRoots as b, executePreparedAgentCandidate as c, sealAgentCandidateModelSettlement as d, usdToNanos as f, beginPreparedCandidateDisposal as g, assertPreparedCandidateIntegrity as h, candidateKnowledgeExecutionPaths as i, rejectedFinish as j, assertTerminalMatchesStaged as k, RecoveryAgentCandidateTraceStore as l, candidateExecutionClaim as m, CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV as n, verifiedResourceTextByDigest as o, sealAgentCandidateExecutorStopAcknowledgement as p, CANDIDATE_KNOWLEDGE_ROOT_ENV as r, verifyAgentCandidateBundle as s, prepareAgentCandidateExecution as t, persistCandidateModelSettlementEvidence as u, CANDIDATE_TRACE_ENV as v, candidateCleanupTimeout as w, InMemoryAgentCandidateExecutionClaimStore as x, CANDIDATE_TRACE_TAGS as y };
3589
3589
 
3590
- //# sourceMappingURL=prepare-oHUQdC5-.js.map
3590
+ //# sourceMappingURL=prepare-DVlvGP7V.js.map