@tangle-network/agent-runtime 0.104.0 → 0.106.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +176 -42
- package/dist/activation-CRjVfOiy.js +203 -0
- package/dist/activation-CRjVfOiy.js.map +1 -0
- package/dist/activation-DyWB0K6E.d.ts +98 -0
- package/dist/agent.d.ts +216 -234
- package/dist/agent.js +615 -547
- package/dist/agent.js.map +1 -1
- package/dist/analyst-loop-DGdtVENg.js +517 -0
- package/dist/analyst-loop-DGdtVENg.js.map +1 -0
- package/dist/analyst-loop.d.ts +10 -43
- package/dist/analyst-loop.js +2 -11
- package/dist/backends-Dy8NujB4.js +713 -0
- package/dist/backends-Dy8NujB4.js.map +1 -0
- package/dist/candidate-execution/index.d.ts +4 -192
- package/dist/candidate-execution/index.js +5 -66
- package/dist/candidate-execution-DqMbv1rU.js +488 -0
- package/dist/candidate-execution-DqMbv1rU.js.map +1 -0
- package/dist/coder-yhVWbdWc.js +40 -0
- package/dist/coder-yhVWbdWc.js.map +1 -0
- package/dist/conversation-XucG_K3l.js +1265 -0
- package/dist/conversation-XucG_K3l.js.map +1 -0
- package/dist/conversation.d.ts +2 -804
- package/dist/conversation.js +2 -55
- package/dist/environment-provider-CfLUmKmf.js +1168 -0
- package/dist/environment-provider-CfLUmKmf.js.map +1 -0
- package/dist/environment-provider-IUGU3epE.d.ts +964 -0
- package/dist/environment-provider.d.ts +2 -78
- package/dist/environment-provider.js +2 -18
- package/dist/errors-DEAvWQPy.js +111 -0
- package/dist/errors-DEAvWQPy.js.map +1 -0
- package/dist/improvement-adapter-Cr5TBSji.d.ts +166 -0
- package/dist/improvement-cycle-C095kS_g.js +2624 -0
- package/dist/improvement-cycle-C095kS_g.js.map +1 -0
- package/dist/index-BGdxAwfO.d.ts +838 -0
- package/dist/index-C-FYUuFG.d.ts +193 -0
- package/dist/index-CbNM40xG.d.ts +140 -0
- package/dist/index-DruSKs3Z.d.ts +7224 -0
- package/dist/index-Efjb3nrQ.d.ts +671 -0
- package/dist/index.d.ts +14 -1134
- package/dist/index.js +2134 -1972
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +776 -888
- package/dist/intelligence.js +1466 -1410
- package/dist/intelligence.js.map +1 -1
- package/dist/{kb-gate-CwHO0vz6.d.ts → kb-gate-C8z2juK8.d.ts} +33 -31
- package/dist/kb-gate-DpaSwXVx.js +80 -0
- package/dist/kb-gate-DpaSwXVx.js.map +1 -0
- package/dist/knowledge-Ku-mPP4f.js +433 -0
- package/dist/knowledge-Ku-mPP4f.js.map +1 -0
- package/dist/knowledge.d.ts +2 -150
- package/dist/knowledge.js +2 -40
- package/dist/local-harness-Dh8PJ0ot.d.ts +455 -0
- package/dist/loop-runner-bin-BXsFEUcf.d.ts +162 -0
- package/dist/loop-runner-bin-BwjQ1NfH.js +268 -0
- package/dist/loop-runner-bin-BwjQ1NfH.js.map +1 -0
- package/dist/loop-runner-bin.d.ts +2 -17
- package/dist/loop-runner-bin.js +2 -24
- package/dist/loops.d.ts +5 -4164
- package/dist/loops.js +8 -419
- package/dist/mcp/bin.d.ts +1 -1
- package/dist/mcp/bin.js +116 -146
- package/dist/mcp/bin.js.map +1 -1
- package/dist/mcp/index.d.ts +295 -437
- package/dist/mcp/index.js +1242 -1177
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/memory-bin.d.ts +1 -1
- package/dist/mcp/memory-bin.js +37 -16
- package/dist/mcp/memory-bin.js.map +1 -1
- package/dist/memory-server-DL6cE2Ag.js +234 -0
- package/dist/memory-server-DL6cE2Ag.js.map +1 -0
- package/dist/model-resolution-Btd9iIKV.js +98 -0
- package/dist/model-resolution-Btd9iIKV.js.map +1 -0
- package/dist/openai-tools-B68JaOCx.d.ts +24 -0
- package/dist/openai-tools-CKLy1C7M.js +44 -0
- package/dist/openai-tools-CKLy1C7M.js.map +1 -0
- package/dist/otel-export-D34IQW1C.js +843 -0
- package/dist/otel-export-D34IQW1C.js.map +1 -0
- package/dist/platform.d.ts +188 -185
- package/dist/platform.js +185 -218
- package/dist/platform.js.map +1 -1
- package/dist/prepare-B53sPV7M.js +4292 -0
- package/dist/prepare-B53sPV7M.js.map +1 -0
- package/dist/primeintellect/index.d.ts +150 -147
- package/dist/primeintellect/index.js +626 -1004
- package/dist/primeintellect/index.js.map +1 -1
- package/dist/profiles.d.ts +296 -490
- package/dist/profiles.js +722 -749
- package/dist/profiles.js.map +1 -1
- package/dist/protected-model-port-BLPH5VVv.js +722 -0
- package/dist/protected-model-port-BLPH5VVv.js.map +1 -0
- package/dist/protected-model-port-BP6Z4eau.d.ts +283 -0
- package/dist/protected-redaction--F3v1oo8.js +200 -0
- package/dist/protected-redaction--F3v1oo8.js.map +1 -0
- package/dist/redact-D-u-rrcn.js +82 -0
- package/dist/redact-D-u-rrcn.js.map +1 -0
- package/dist/redact-kbIOjfjM.d.ts +452 -0
- package/dist/researcher-CoVqNhfI.js +433 -0
- package/dist/researcher-CoVqNhfI.js.map +1 -0
- package/dist/runtime-BG0BziaP.js +5408 -0
- package/dist/runtime-BG0BziaP.js.map +1 -0
- package/dist/sandbox-events-DeI5xX8P.js +316 -0
- package/dist/sandbox-events-DeI5xX8P.js.map +1 -0
- package/dist/spawn-journal-CwPvKUTa.js +456 -0
- package/dist/spawn-journal-CwPvKUTa.js.map +1 -0
- package/dist/structural-rollout-IXUEplky.js +1445 -0
- package/dist/structural-rollout-IXUEplky.js.map +1 -0
- package/dist/substrate-B0TYNrXn.js +27 -0
- package/dist/substrate-B0TYNrXn.js.map +1 -0
- package/dist/{substrate-Dyiqmd3o.d.ts → substrate-BcnuSHXm.d.ts} +57 -54
- package/dist/supervise-BiRutHS9.js +7321 -0
- package/dist/supervise-BiRutHS9.js.map +1 -0
- package/dist/supervisor-DTKhF-RV.js +3826 -0
- package/dist/supervisor-DTKhF-RV.js.map +1 -0
- package/dist/testing.d.ts +4 -3
- package/dist/testing.js +2478 -2637
- package/dist/testing.js.map +1 -1
- package/dist/tool-server-RcWgLIsL.js +141 -0
- package/dist/tool-server-RcWgLIsL.js.map +1 -0
- package/dist/trace-propagation-CJJC7SVB.js +57 -0
- package/dist/trace-propagation-CJJC7SVB.js.map +1 -0
- package/dist/types-BaIpb0XT.d.ts +492 -0
- package/dist/types-BevOjfTY.d.ts +765 -0
- package/dist/types-C9j4qg6l.d.ts +500 -0
- package/dist/types-Cja5OTGh.d.ts +190 -0
- package/dist/util-MVgdwuIS.js +145 -0
- package/dist/util-MVgdwuIS.js.map +1 -0
- package/dist/workspace-archive-BosQiotA.js +575 -0
- package/dist/workspace-archive-BosQiotA.js.map +1 -0
- package/package.json +43 -55
- package/skills/build-with-agent-runtime/SKILL.md +16 -9
- package/skills/loop-writer/SKILL.md +1 -1
- package/dist/activation-Cm-9MMX1.d.ts +0 -69
- package/dist/analyst-loop.js.map +0 -1
- package/dist/backends-BO4Jqoe2.d.ts +0 -134
- package/dist/candidate-execution/index.js.map +0 -1
- package/dist/chunk-2KGAN2HM.js +0 -1256
- package/dist/chunk-2KGAN2HM.js.map +0 -1
- package/dist/chunk-2QJSNOGK.js +0 -48
- package/dist/chunk-2QJSNOGK.js.map +0 -1
- package/dist/chunk-2UABGGUB.js +0 -474
- package/dist/chunk-2UABGGUB.js.map +0 -1
- package/dist/chunk-2VZYRB55.js +0 -834
- package/dist/chunk-2VZYRB55.js.map +0 -1
- package/dist/chunk-2X65HYMI.js +0 -3526
- package/dist/chunk-2X65HYMI.js.map +0 -1
- package/dist/chunk-3MDZX7YU.js +0 -125
- package/dist/chunk-3MDZX7YU.js.map +0 -1
- package/dist/chunk-3PPVCS75.js +0 -199
- package/dist/chunk-3PPVCS75.js.map +0 -1
- package/dist/chunk-5HNDYWUT.js +0 -6424
- package/dist/chunk-5HNDYWUT.js.map +0 -1
- package/dist/chunk-5IBQAPVB.js +0 -29
- package/dist/chunk-5IBQAPVB.js.map +0 -1
- package/dist/chunk-5QOB7H74.js +0 -387
- package/dist/chunk-5QOB7H74.js.map +0 -1
- package/dist/chunk-ATDFUJYI.js +0 -4728
- package/dist/chunk-ATDFUJYI.js.map +0 -1
- package/dist/chunk-B7K7V22Y.js +0 -699
- package/dist/chunk-B7K7V22Y.js.map +0 -1
- package/dist/chunk-DPEUKJRO.js +0 -27
- package/dist/chunk-DPEUKJRO.js.map +0 -1
- package/dist/chunk-FD2MBMOH.js +0 -494
- package/dist/chunk-FD2MBMOH.js.map +0 -1
- package/dist/chunk-FJI3EXU3.js +0 -2402
- package/dist/chunk-FJI3EXU3.js.map +0 -1
- package/dist/chunk-HAO4CXHP.js +0 -200
- package/dist/chunk-HAO4CXHP.js.map +0 -1
- package/dist/chunk-ISPWRSEC.js +0 -408
- package/dist/chunk-ISPWRSEC.js.map +0 -1
- package/dist/chunk-KRBFHMV6.js +0 -1228
- package/dist/chunk-KRBFHMV6.js.map +0 -1
- package/dist/chunk-L5DST3QC.js +0 -351
- package/dist/chunk-L5DST3QC.js.map +0 -1
- package/dist/chunk-M22PL4GH.js +0 -171
- package/dist/chunk-M22PL4GH.js.map +0 -1
- package/dist/chunk-NURIQBJQ.js +0 -72
- package/dist/chunk-NURIQBJQ.js.map +0 -1
- package/dist/chunk-PZZKQVQV.js +0 -52
- package/dist/chunk-PZZKQVQV.js.map +0 -1
- package/dist/chunk-Q2JSAVQ3.js +0 -671
- package/dist/chunk-Q2JSAVQ3.js.map +0 -1
- package/dist/chunk-SBTWKPVR.js +0 -5576
- package/dist/chunk-SBTWKPVR.js.map +0 -1
- package/dist/chunk-SGKPNBXE.js +0 -60
- package/dist/chunk-SGKPNBXE.js.map +0 -1
- package/dist/chunk-SNSMRT6H.js +0 -680
- package/dist/chunk-SNSMRT6H.js.map +0 -1
- package/dist/chunk-STJEHM5F.js +0 -1338
- package/dist/chunk-STJEHM5F.js.map +0 -1
- package/dist/chunk-UPWGXKXB.js +0 -254
- package/dist/chunk-UPWGXKXB.js.map +0 -1
- package/dist/chunk-YEJR7IXO.js +0 -68
- package/dist/chunk-YEJR7IXO.js.map +0 -1
- package/dist/chunk-ZXICDSAK.js +0 -907
- package/dist/chunk-ZXICDSAK.js.map +0 -1
- package/dist/completion-gate-Bv47cOnn.d.ts +0 -256
- package/dist/conversation.js.map +0 -1
- package/dist/coordination-CxtzMxSM.d.ts +0 -2570
- package/dist/environment-provider.js.map +0 -1
- package/dist/improve--2A0gK1-.d.ts +0 -440
- package/dist/improvement-adapter-HAZz-7vK.d.ts +0 -203
- package/dist/knowledge.js.map +0 -1
- package/dist/local-harness-CtK9dSny.d.ts +0 -175
- package/dist/loop-runner-bin-DUOGtvOl.d.ts +0 -207
- package/dist/loop-runner-bin.js.map +0 -1
- package/dist/loops.js.map +0 -1
- package/dist/openai-tools-fnj6SRVg.d.ts +0 -46
- package/dist/protected-model-port-DzkUY3HQ.d.ts +0 -271
- package/dist/sanitize-DEbPNtyI.d.ts +0 -328
- package/dist/structural-rollout-C4mabf87.d.ts +0 -446
- package/dist/supervise-7q9F5brx.d.ts +0 -379
- package/dist/types-BCoemcXU.d.ts +0 -802
- package/dist/types-BwoZWq-i.d.ts +0 -510
- package/dist/types-Cbp72qyu.d.ts +0 -491
- package/dist/types-CmYCMbFT.d.ts +0 -203
- package/dist/types-CvNwMzQt.d.ts +0 -957
- package/dist/worktree-fanout-WsOzt8qu.d.ts +0 -999
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,65 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from '../openai-tools-fnj6SRVg.js';
|
|
11
|
-
import { AnalystFinding } from '@tangle-network/agent-eval';
|
|
12
|
-
import { a as UiLens } from '../substrate-Dyiqmd3o.js';
|
|
13
|
-
import '@tangle-network/sandbox';
|
|
14
|
-
import '../types-BwoZWq-i.js';
|
|
15
|
-
import '../types-CvNwMzQt.js';
|
|
16
|
-
import '../sanitize-DEbPNtyI.js';
|
|
17
|
-
import '../environment-provider.js';
|
|
18
|
-
import '@tangle-network/agent-interface/environment-provider';
|
|
19
|
-
import 'node:child_process';
|
|
20
|
-
import '@tangle-network/agent-profile-materialize';
|
|
21
|
-
|
|
1
|
+
import { E as SandboxClient, h as LoopSandboxPlacement } from "../types-BevOjfTY.js";
|
|
2
|
+
import { $c as DetachedSessionRefParts, $l as traceContextToEnv, Ac as McpToolDescriptor, Al as DelegateUiAuditConfig, As as createCoordinationTools, Au as FileDelegationStore, Bc as DetachedSessionDelegateOptions, Bl as DelegationResultPayload, Bs as DelegateResult, Cc as captureWorktreeDiff, Cl as DelegateCodeResult, Cs as QuestionLevel, Cu as buildDelegationTraceSpans, Dl as DelegateResearchConfig, Ds as QuestionUrgency, Du as DelegationPersistenceError, El as DelegateResearchArgs, Es as QuestionRecord, Eu as createDelegationTraceCollector, Fc as eventToSnapshot, Fl as DelegationHistoryArgs, Fs as DELEGATE_DESCRIPTION, Gc as detachedSessionDelegate, Gl as FeedbackRefersTo, Hc as SettleDetachedCoderTurnOptions, Hl as DelegationStatusArgs, Hs as validateDelegateArgs, Hu as CoderOutput, Ic as CoderDelegate, Il as DelegationHistoryEntry, Is as DELEGATE_INPUT_SCHEMA, Jc as FleetHandle, Jl as UiAuditLensFilter, Kc as settleDetachedCoderTurn, Kl as ResearchOutputShape, Lc as CoderReview, Ll as DelegationHistoryResult, Ls as DELEGATE_TOOL_NAME, Mc as FeedbackEvent, Ml as DelegateUiAuditRoute, Ms as McpServerOptions, Mu as InMemoryDelegationStore, Nc as FeedbackStore, Nl as DelegationError, Ns as createInProcessTransport, Oc as JsonRpcMessage, Ol as DelegateResearchResult, Os as SettledWorker, Ou as DelegationStateCorruptError, Pc as InMemoryFeedbackStore, Pl as DelegationFeedbackSnapshot, Ps as createMcpServer, Qc as createSiblingSandboxExecutor, Ql as readTraceContextFromEnv, Rc as CoderReviewer, Rl as DelegationProfile, Rs as DelegateArgs, Sc as WorktreeHandle, Sl as DelegateCodeConfig, Ss as QuestionDecision, Su as DelegationTraceSpan, Tc as removeWorktree, Tl as DelegateFeedbackResult, Ts as QuestionPolicy, Tu as composeLoopTraceEmitters, Uc as UiAuditorDelegate, Ul as DelegationStatusResult, Vc as DetachedWinnerSelection, Vl as DelegationStatus, Vs as createDelegateHandler, Wc as coderTaskFromArgs, Wl as FeedbackRating, Xc as SiblingSandboxExecutorOptions, Xl as TraceContext, Yc as FleetWorkspaceExecutorOptions, Yl as UiAuditorDelegationOutput, Zc as createFleetWorkspaceExecutor, Zl as createPropagatingTraceEmitter, _c as CreateWorktreeOptions, _l as DelegationTaskQueueOptions, _s as CoordinationToolsOptions, _u as CappedDelegationTrace, al as createDetachedTurnResumeDriver, bc as GitRunner, bl as hashIdempotencyInput, bs as MakeWorkerAgent, bu as DelegationTraceCaps, cl as parseDetachedSessionRef, dl as DelegationRecord, el as DetachedTurn, fl as DelegationResumeContext, gl as DelegationTaskQueue, gs as CoordinationTools, hl as DelegationRunContext, hs as CoordinationEvent, il as RunDetachedTurnOptions, jc as McpTransport, jl as DelegateUiAuditResult, js as McpServer, ju as FileDelegationStoreOptions, kc as JsonRpcResponse, kl as DelegateUiAuditArgs, ks as WorkerWatchOptions, ku as DelegationStore, ll as runDetachedTurn, ml as DelegationResumeTick, ms as AnalystRegistry, nl as DriveTurnCapableBox, ol as detachedTurnEvents, pl as DelegationResumeDriver, ps as AnalystFindingEvent, qc as DelegationExecutor, ql as ResearchSource, rl as DriveTurnTick, sl as formatDetachedSessionRef, tl as DetachedTurnResumeDriverOptions, ul as DelegationArgs, vc as DiffOptions, vl as SubmitInput, vs as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, vu as DELEGATION_TRACE_MAX_BYTES, wc as createWorktree, wl as DelegateFeedbackArgs, ws as QuestionOption, wu as capDelegationTrace, xc as RemoveWorktreeOptions, xl as DelegateCodeArgs, xs as Question, xu as DelegationTraceCollector, yc as DiffResult, yl as SubmitOutput, ys as DownMessageEvent, yu as DELEGATION_TRACE_MAX_SPANS, zc as DelegateRunCtx, zl as DelegationProgress, zs as DelegateHandlerOptions } from "../index-DruSKs3Z.js";
|
|
3
|
+
import { o as UiLens } from "../substrate-BcnuSHXm.js";
|
|
4
|
+
import { a as LocalHarnessResult, c as runLocalHarness, i as LocalHarness, n as CodexExecutionPolicy, o as RunLocalHarnessOptions, r as CodexTokenUsage, s as parseCodexTokenUsage, t as CodexExecutionEvidence } from "../local-harness-Dh8PJ0ot.js";
|
|
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-B68JaOCx.js";
|
|
7
|
+
import { AnalystFinding } from "@tangle-network/agent-eval";
|
|
8
|
+
import { AgentProfileMcpServer } from "@tangle-network/agent-interface";
|
|
9
|
+
//#region src/mcp/codex-diagnostics.d.ts
|
|
22
10
|
/** Bounded, credential-redacted process context attached when reproducible Codex output fails
|
|
23
11
|
* validation. The process still fails closed; this only preserves enough evidence to diagnose it. */
|
|
24
12
|
interface CodexExecutionFailureDiagnostic {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
13
|
+
exitCode: number | null;
|
|
14
|
+
killedBySignal: NodeJS.Signals | null;
|
|
15
|
+
timedOut: boolean;
|
|
16
|
+
aborted?: boolean;
|
|
17
|
+
durationMs: number;
|
|
18
|
+
stdout: string;
|
|
19
|
+
stderr: string;
|
|
20
|
+
stdoutTruncated: boolean;
|
|
21
|
+
stderrTruncated: boolean;
|
|
34
22
|
}
|
|
35
23
|
/** Thrown when reproducible Codex exits without one valid terminal usage event. */
|
|
36
24
|
declare class CodexExecutionDiagnosticError extends Error {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
readonly reason: string;
|
|
26
|
+
readonly diagnostic: CodexExecutionFailureDiagnostic;
|
|
27
|
+
readonly code = "CODEX_EXECUTION_DIAGNOSTIC";
|
|
28
|
+
constructor(reason: string, diagnostic: CodexExecutionFailureDiagnostic, cause?: unknown);
|
|
41
29
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
* Helpers extracted from `bin.ts` so the env-detection + executor-selection
|
|
46
|
-
* logic is unit-testable without spawning a subprocess. The bin imports from
|
|
47
|
-
* here; tests import from here directly.
|
|
48
|
-
*
|
|
49
|
-
* @experimental
|
|
50
|
-
*/
|
|
51
|
-
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/mcp/bin-helpers.d.ts
|
|
52
32
|
/** @experimental */
|
|
53
33
|
interface DetectExecutorArgs {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
34
|
+
sandboxClient: SandboxClient;
|
|
35
|
+
/** Raw env (defaults to `process.env`). Pass an explicit map for tests. */
|
|
36
|
+
env?: Record<string, string | undefined>;
|
|
37
|
+
/**
|
|
38
|
+
* Override how a fleet handle is resolved from the client + fleet id. The
|
|
39
|
+
* default reads `client.fleets.get(fleetId)` and validates the returned
|
|
40
|
+
* shape against the structural `FleetHandle` contract.
|
|
41
|
+
*/
|
|
42
|
+
resolveFleet?: (client: SandboxClient, fleetId: string) => Promise<FleetHandle>;
|
|
63
43
|
}
|
|
64
44
|
/**
|
|
65
45
|
* Pick the right executor for an MCP server invocation based on env vars.
|
|
@@ -76,39 +56,40 @@ interface DetectExecutorArgs {
|
|
|
76
56
|
* @experimental
|
|
77
57
|
*/
|
|
78
58
|
declare function detectExecutor(args: DetectExecutorArgs): Promise<DelegationExecutor>;
|
|
79
|
-
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/mcp/in-process-executor.d.ts
|
|
80
61
|
/** @experimental */
|
|
81
62
|
interface InProcessExecutorOptions {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
63
|
+
/** Absolute path to the git repo (the workspace). Worktrees go under `<repoRoot>/.agent-worktrees/`. */
|
|
64
|
+
repoRoot: string;
|
|
65
|
+
/** Harnesses to round-robin across `create()` calls. One entry = no fanout. Default `['claude']`. */
|
|
66
|
+
harnesses?: ReadonlyArray<LocalHarness>;
|
|
67
|
+
/** Optional per-delegation test command run in the worktree after the harness exits. */
|
|
68
|
+
testCmd?: string;
|
|
69
|
+
/** Optional per-delegation typecheck command. Same shape as `testCmd`. */
|
|
70
|
+
typecheckCmd?: string;
|
|
71
|
+
/** Wall-clock cap per harness subprocess (ms). Default 5min. */
|
|
72
|
+
harnessTimeoutMs?: number;
|
|
73
|
+
/** Wall-clock cap per test/typecheck subprocess (ms). Default 2min. */
|
|
74
|
+
postCheckTimeoutMs?: number;
|
|
75
|
+
/** Test seam — override the git runner used by the worktree helpers. */
|
|
76
|
+
runGit?: GitRunner;
|
|
77
|
+
/** Test seam — override the harness runner (defaults to the real CLI via `runLocalHarness`). */
|
|
78
|
+
runHarness?: typeof runLocalHarness;
|
|
79
|
+
/** Test seam — override the post-check runner (defaults to a `sh -c` spawn). A throw is folded
|
|
80
|
+
* into a non-fatal `{exitCode:-1}` so a broken check command fails the signal, not the run. */
|
|
81
|
+
runPostCheck?: (cmd: string, cwd: string, signal?: AbortSignal) => Promise<{
|
|
82
|
+
exitCode: number;
|
|
83
|
+
stdout: string;
|
|
84
|
+
stderr: string;
|
|
85
|
+
}>;
|
|
105
86
|
}
|
|
106
87
|
/** @experimental */
|
|
107
88
|
interface InProcessExecutorDescribePlacement extends LoopSandboxPlacement {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
89
|
+
/** Worktree path in the parent sandbox's filesystem (set so traces correlate to on-disk artifacts). */
|
|
90
|
+
worktreePath?: string;
|
|
91
|
+
/** Which harness handled this delegation. */
|
|
92
|
+
harness?: LocalHarness;
|
|
112
93
|
}
|
|
113
94
|
/**
|
|
114
95
|
* Build an in-process executor. Returns a {@link DelegationExecutor} whose `client.create()`
|
|
@@ -120,109 +101,42 @@ interface InProcessExecutorDescribePlacement extends LoopSandboxPlacement {
|
|
|
120
101
|
* @experimental
|
|
121
102
|
*/
|
|
122
103
|
declare function createInProcessExecutor(options: InProcessExecutorOptions): DelegationExecutor;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
* `createStdioToolServer` — the generic newline-delimited JSON-RPC 2.0 MCP
|
|
126
|
-
* server core: `initialize` / `notifications/initialized` / `tools/list` /
|
|
127
|
-
* `tools/call` over a stdio-shaped transport, protocol 2024-11-05.
|
|
128
|
-
*
|
|
129
|
-
* Extracted from `createMcpServer` (server.ts) so every in-repo MCP server —
|
|
130
|
-
* the delegation server, the memory server — serves the ONE wire protocol the
|
|
131
|
-
* same-host client (`connectStdioMcp`, runtime/stdio-mcp-client.ts) speaks.
|
|
132
|
-
* A second hand-rolled serve loop could drift from what the client expects;
|
|
133
|
-
* this core makes that impossible by construction.
|
|
134
|
-
*
|
|
135
|
-
* @experimental
|
|
136
|
-
*/
|
|
137
|
-
/** @experimental */
|
|
138
|
-
interface McpToolDescriptor {
|
|
139
|
-
name: string;
|
|
140
|
-
description: string;
|
|
141
|
-
inputSchema: Record<string, unknown>;
|
|
142
|
-
handler: (raw: unknown) => Promise<unknown>;
|
|
143
|
-
}
|
|
144
|
-
/** @experimental */
|
|
145
|
-
interface McpTransport {
|
|
146
|
-
input: NodeJS.ReadableStream;
|
|
147
|
-
output: NodeJS.WritableStream;
|
|
148
|
-
}
|
|
149
|
-
/** @experimental */
|
|
150
|
-
interface JsonRpcMessage {
|
|
151
|
-
jsonrpc: '2.0';
|
|
152
|
-
id?: number | string | null;
|
|
153
|
-
method: string;
|
|
154
|
-
params?: unknown;
|
|
155
|
-
}
|
|
156
|
-
/** @experimental */
|
|
157
|
-
interface JsonRpcResponse {
|
|
158
|
-
jsonrpc: '2.0';
|
|
159
|
-
id: number | string | null;
|
|
160
|
-
result?: unknown;
|
|
161
|
-
error?: {
|
|
162
|
-
code: number;
|
|
163
|
-
message: string;
|
|
164
|
-
data?: unknown;
|
|
165
|
-
};
|
|
166
|
-
}
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/mcp/tool-server.d.ts
|
|
167
106
|
/** @experimental */
|
|
168
107
|
interface StdioToolServerOptions {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
108
|
+
/** Server display name surfaced via `initialize`. */
|
|
109
|
+
serverName: string;
|
|
110
|
+
/** Server version surfaced via `initialize`. */
|
|
111
|
+
serverVersion: string;
|
|
112
|
+
/** The tools to serve. Duplicate names throw — a silent shadow would hide a tool. */
|
|
113
|
+
tools: readonly McpToolDescriptor[];
|
|
175
114
|
}
|
|
176
115
|
/** @experimental */
|
|
177
116
|
interface StdioToolServer {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
117
|
+
/** Tools currently registered, keyed by name. */
|
|
118
|
+
readonly tools: ReadonlyMap<string, McpToolDescriptor>;
|
|
119
|
+
/** Handle a single parsed JSON-RPC message. Returns the response object (or `null` for notifications). */
|
|
120
|
+
handle(message: JsonRpcMessage): Promise<JsonRpcResponse | null>;
|
|
121
|
+
/** Drive the server on a stdio-shaped transport until `stop()` is called. */
|
|
122
|
+
serve(transport?: McpTransport): Promise<void>;
|
|
123
|
+
/** Stop a `serve` call. Subsequent requests are rejected. */
|
|
124
|
+
stop(): void;
|
|
186
125
|
}
|
|
187
126
|
/** Build the generic stdio JSON-RPC tool server. */
|
|
188
127
|
declare function createStdioToolServer(options: StdioToolServerOptions): StdioToolServer;
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
* Memory MCP server — the LIVE serving half of the `memory` profile surface
|
|
192
|
-
* (Phase 5). A curated memory (lessons distilled from prior runs) is only
|
|
193
|
-
* real if the DRIVEN agent can query it mid-task; this module serves a flat
|
|
194
|
-
* store of `MemoryItem` rows as `memory_search` / `memory_get` tools over the
|
|
195
|
-
* ONE in-repo stdio JSON-RPC core (`createStdioToolServer`), so the exact
|
|
196
|
-
* wire protocol the same-host client (`connectStdioMcp` /
|
|
197
|
-
* `materializeLocalMcp`, runtime/stdio-mcp-client.ts) speaks is guaranteed by
|
|
198
|
-
* construction — serve and consume cannot drift.
|
|
199
|
-
*
|
|
200
|
-
* Retrieval is DETERMINISTIC lexical overlap (no vectors, no LLM): a lift
|
|
201
|
-
* measured with this memory mounted is attributable to the lessons
|
|
202
|
-
* themselves, never to retrieval-model noise — the same discipline as
|
|
203
|
-
* agent-eval's `memoryCurationProposer` (deterministic curation). Every
|
|
204
|
-
* `memory_search` can append one JSONL row to a retrieval log (`logPath`) —
|
|
205
|
-
* the per-query record an off-policy retrieval estimator (agent-knowledge's
|
|
206
|
-
* `RetrievalHoldout`) consumes. agent-knowledge is NOT a dependency of this
|
|
207
|
-
* repo, so the log file is the flagged cross-package seam, not an import.
|
|
208
|
-
*
|
|
209
|
-
* Fail-loud discipline (mirrors `materializeLocalMcp`): an EMPTY memory is
|
|
210
|
-
* never served — a profile without memory simply omits the artifact, and
|
|
211
|
-
* silently serving zero rows would fake the with/without ablation.
|
|
212
|
-
*
|
|
213
|
-
* @experimental
|
|
214
|
-
*/
|
|
215
|
-
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/mcp/memory-server.d.ts
|
|
216
130
|
/** One row of agent memory: a crisp lesson/fact with provenance. */
|
|
217
131
|
interface MemoryItem {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
132
|
+
/** Stable id (content-hash by convention; see `memoryArtifactFromLessons`). */
|
|
133
|
+
id: string;
|
|
134
|
+
/** The lesson itself — one imperative or observation the agent should recall. */
|
|
135
|
+
text: string;
|
|
136
|
+
/** Optional retrieval tags, matched by `memory_search` alongside the text. */
|
|
137
|
+
tags?: string[];
|
|
138
|
+
/** Provenance: the finding / trace / curation pass this row came from. */
|
|
139
|
+
source?: string;
|
|
226
140
|
}
|
|
227
141
|
/**
|
|
228
142
|
* The `memory` artifact payload — HOW a profile's memory is stored and served:
|
|
@@ -239,15 +153,15 @@ interface MemoryItem {
|
|
|
239
153
|
* — the retrieval log a holdout estimator reads (see module doc).
|
|
240
154
|
*/
|
|
241
155
|
interface AgentMemorySpec {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
156
|
+
store: 'file' | 'mcp';
|
|
157
|
+
/** `store:'file'` — host path to the durable row store (JSON array or JSONL). */
|
|
158
|
+
path?: string;
|
|
159
|
+
/** Inline seed rows, served alongside (and winning over) `path` rows. */
|
|
160
|
+
items?: MemoryItem[];
|
|
161
|
+
/** `store:'mcp'` — the external server that already serves memory tools. */
|
|
162
|
+
server?: AgentProfileMcpServer;
|
|
163
|
+
/** JSONL retrieval log: one row per `memory_search` (ts, query, k, returned). */
|
|
164
|
+
logPath?: string;
|
|
251
165
|
}
|
|
252
166
|
/** Env var naming the durable row store file the memory bin loads (the
|
|
253
167
|
* `memoryMcpServer` ↔ memory-bin contract). */
|
|
@@ -259,16 +173,16 @@ declare const MEMORY_LOG_ENV = "AGENT_MEMORY_LOG";
|
|
|
259
173
|
/** Env var overriding the served display name (default 'agent-memory'). */
|
|
260
174
|
declare const MEMORY_NAME_ENV = "AGENT_MEMORY_NAME";
|
|
261
175
|
interface CreateMemoryToolServerOptions {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
176
|
+
/** The rows to serve. MUST be non-empty (an empty memory is never served). */
|
|
177
|
+
items: readonly MemoryItem[];
|
|
178
|
+
/** Server display name surfaced via `initialize`. Default 'agent-memory'. */
|
|
179
|
+
serverName?: string;
|
|
180
|
+
/** Server version surfaced via `initialize`. Default '0'. */
|
|
181
|
+
serverVersion?: string;
|
|
182
|
+
/** Default result count for `memory_search`. Default 5. */
|
|
183
|
+
defaultK?: number;
|
|
184
|
+
/** Append one JSONL row per `memory_search` (the retrieval-holdout seam). */
|
|
185
|
+
logPath?: string;
|
|
272
186
|
}
|
|
273
187
|
/**
|
|
274
188
|
* Build the memory MCP server: `memory_search` (lexical top-k over the rows)
|
|
@@ -281,9 +195,9 @@ declare function parseMemoryItems(value: unknown, source: string): MemoryItem[];
|
|
|
281
195
|
declare function readMemoryItemsFile(path: string): MemoryItem[];
|
|
282
196
|
/** What the memory bin resolved from its environment. */
|
|
283
197
|
interface ResolvedMemoryEnv {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
198
|
+
items: MemoryItem[];
|
|
199
|
+
serverName?: string;
|
|
200
|
+
logPath?: string;
|
|
287
201
|
}
|
|
288
202
|
/**
|
|
289
203
|
* Resolve the bin's memory from `AGENT_MEMORY_FILE` (durable store) and/or
|
|
@@ -291,35 +205,18 @@ interface ResolvedMemoryEnv {
|
|
|
291
205
|
* a boot FAILURE, matching the fail-closed materialization discipline.
|
|
292
206
|
*/
|
|
293
207
|
declare function resolveMemoryFromEnv(env: Record<string, string | undefined>): ResolvedMemoryEnv;
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
*
|
|
297
|
-
* The trace-analyst KIND directory — the operator's lenses, as composable DATA.
|
|
298
|
-
*
|
|
299
|
-
* An analyst is not one question. A kind is ONE lens (completeness, correctness, policy, efficiency,
|
|
300
|
-
* tool-use, …); each emits `AnalystFinding`s tagged by its `area`. The driver `list_analysts` to see
|
|
301
|
-
* the menu, `run_analyst(kind, worker)` to apply a lens, and `define_analyst` to author a new one —
|
|
302
|
-
* so at test time you compose the exact lenses a domain needs (maximum specificity), not one generic
|
|
303
|
-
* reviewer. The kinds are data, the runner is generic, and the finding shape + firewall are reused
|
|
304
|
-
* from agent-eval / the keystone — never re-derived.
|
|
305
|
-
*
|
|
306
|
-
* A kind here is a lightweight lens (`Check`); it is a deliberate SUBSET of agent-eval's full
|
|
307
|
-
* `TraceAnalystKindSpec`, so a kind that needs the heavy agentic actor (sub-agent recursion, tools,
|
|
308
|
-
* goldens) upgrades to `createTraceAnalystKind` without changing this directory's surface.
|
|
309
|
-
*
|
|
310
|
-
* @experimental
|
|
311
|
-
*/
|
|
312
|
-
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/mcp/tools/checks.d.ts
|
|
313
210
|
/** One lens — a composable analyst kind. Identity fields mirror `TraceAnalystKindSpec` so a kind is
|
|
314
211
|
* upgradeable to the full agentic factory; `lookFor` is the lens question the actor applies. */
|
|
315
212
|
interface Check {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
213
|
+
readonly id: string;
|
|
214
|
+
readonly description: string;
|
|
215
|
+
/** Coarse classification stamped on every finding this kind emits (the renderer groups by it). */
|
|
216
|
+
readonly area: string;
|
|
217
|
+
readonly version: string;
|
|
218
|
+
/** The lens — what this analyst looks for in the trace. */
|
|
219
|
+
readonly lookFor: string;
|
|
323
220
|
}
|
|
324
221
|
/** The built-in lens directory. Domain-blind (about any agent trace); compose at test time. */
|
|
325
222
|
declare const defaultChecks: Record<string, Check>;
|
|
@@ -330,11 +227,11 @@ declare function liftFindings(kind: Check, rows: unknown[], producedAt: string):
|
|
|
330
227
|
* the trace shape: a `{ messages }` conversation, a bare message array, else stringified. */
|
|
331
228
|
declare function renderTrace(trace: unknown): string;
|
|
332
229
|
interface CheckRunnerOptions {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
230
|
+
routerBaseUrl: string;
|
|
231
|
+
routerKey: string;
|
|
232
|
+
model: string;
|
|
233
|
+
/** Test/override seam — replace the LLM call. Default: a router chat completion. */
|
|
234
|
+
chat?: (system: string, user: string) => Promise<string>;
|
|
338
235
|
}
|
|
339
236
|
/** Run ONE lens over a trace → findings. Generic over any kind: prompt = the lens + the agent-eval
|
|
340
237
|
* finding schema; the model's JSON array is parsed (`parseRawFinding`), lifted, and firewalled. */
|
|
@@ -345,288 +242,249 @@ declare function runCheck(kind: Check, trace: unknown, opts: CheckRunnerOptions,
|
|
|
345
242
|
* passed in because replay-safe paths must not read `Date.now`.
|
|
346
243
|
*/
|
|
347
244
|
declare function makeCheckRunner(kinds: Record<string, Check>, opts: CheckRunnerOptions): (kindId: string, trace: unknown, producedAt: string) => Promise<AnalystFinding[] | {
|
|
348
|
-
|
|
245
|
+
error: string;
|
|
349
246
|
}>;
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
*
|
|
353
|
-
* `delegate_feedback` MCP tool — synchronous record of agent / user /
|
|
354
|
-
* downstream-judge feedback on a delegation, artifact, or outcome.
|
|
355
|
-
*
|
|
356
|
-
* The store is append-only. Every rating is its own event; no dedupe.
|
|
357
|
-
* When `refersTo.kind === 'delegation'`, the snapshot is also attached
|
|
358
|
-
* to the matching queue record so `delegation_history` surfaces it
|
|
359
|
-
* inline without a join.
|
|
360
|
-
*
|
|
361
|
-
* @experimental
|
|
362
|
-
*/
|
|
363
|
-
|
|
247
|
+
//#endregion
|
|
248
|
+
//#region src/mcp/tools/delegate-feedback.d.ts
|
|
364
249
|
/** MCP tool name for the `delegate_feedback` feedback-recording tool. @experimental */
|
|
365
250
|
declare const DELEGATE_FEEDBACK_TOOL_NAME = "delegate_feedback";
|
|
366
251
|
/** Human-readable description of the `delegate_feedback` MCP tool, injected into the tool manifest. @experimental */
|
|
367
252
|
declare const DELEGATE_FEEDBACK_DESCRIPTION: string;
|
|
368
253
|
/** JSON Schema for `delegate_feedback` tool arguments (`refersTo`, `rating`, `by`, optional fields). @experimental */
|
|
369
254
|
declare const DELEGATE_FEEDBACK_INPUT_SCHEMA: {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
};
|
|
379
|
-
readonly ref: {
|
|
380
|
-
readonly type: "string";
|
|
381
|
-
};
|
|
382
|
-
};
|
|
383
|
-
readonly required: readonly ["kind", "ref"];
|
|
384
|
-
readonly additionalProperties: false;
|
|
255
|
+
readonly type: "object";
|
|
256
|
+
readonly properties: {
|
|
257
|
+
readonly refersTo: {
|
|
258
|
+
readonly type: "object";
|
|
259
|
+
readonly properties: {
|
|
260
|
+
readonly kind: {
|
|
261
|
+
readonly type: "string";
|
|
262
|
+
readonly enum: readonly ["delegation", "artifact", "outcome"];
|
|
385
263
|
};
|
|
386
|
-
readonly
|
|
387
|
-
|
|
388
|
-
readonly properties: {
|
|
389
|
-
readonly score: {
|
|
390
|
-
readonly type: "number";
|
|
391
|
-
readonly minimum: 0;
|
|
392
|
-
readonly maximum: 1;
|
|
393
|
-
};
|
|
394
|
-
readonly label: {
|
|
395
|
-
readonly type: "string";
|
|
396
|
-
readonly enum: readonly ["good", "bad", "neutral", "mixed"];
|
|
397
|
-
};
|
|
398
|
-
readonly notes: {
|
|
399
|
-
readonly type: "string";
|
|
400
|
-
};
|
|
401
|
-
};
|
|
402
|
-
readonly required: readonly ["score", "notes"];
|
|
403
|
-
readonly additionalProperties: false;
|
|
264
|
+
readonly ref: {
|
|
265
|
+
readonly type: "string";
|
|
404
266
|
};
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
267
|
+
};
|
|
268
|
+
readonly required: readonly ["kind", "ref"];
|
|
269
|
+
readonly additionalProperties: false;
|
|
270
|
+
};
|
|
271
|
+
readonly rating: {
|
|
272
|
+
readonly type: "object";
|
|
273
|
+
readonly properties: {
|
|
274
|
+
readonly score: {
|
|
275
|
+
readonly type: "number";
|
|
276
|
+
readonly minimum: 0;
|
|
277
|
+
readonly maximum: 1;
|
|
408
278
|
};
|
|
409
|
-
readonly
|
|
410
|
-
|
|
279
|
+
readonly label: {
|
|
280
|
+
readonly type: "string";
|
|
281
|
+
readonly enum: readonly ["good", "bad", "neutral", "mixed"];
|
|
411
282
|
};
|
|
412
|
-
readonly
|
|
413
|
-
|
|
283
|
+
readonly notes: {
|
|
284
|
+
readonly type: "string";
|
|
414
285
|
};
|
|
286
|
+
};
|
|
287
|
+
readonly required: readonly ["score", "notes"];
|
|
288
|
+
readonly additionalProperties: false;
|
|
289
|
+
};
|
|
290
|
+
readonly by: {
|
|
291
|
+
readonly type: "string";
|
|
292
|
+
readonly enum: readonly ["agent", "user", "downstream-judge"];
|
|
293
|
+
};
|
|
294
|
+
readonly capturedAt: {
|
|
295
|
+
readonly type: "string";
|
|
415
296
|
};
|
|
416
|
-
readonly
|
|
417
|
-
|
|
297
|
+
readonly namespace: {
|
|
298
|
+
readonly type: "string";
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
readonly required: readonly ["refersTo", "rating", "by"];
|
|
302
|
+
readonly additionalProperties: false;
|
|
418
303
|
};
|
|
419
304
|
/** Parse and validate raw MCP tool input into typed `DelegateFeedbackArgs`; throws `TypeError` on bad input. @experimental */
|
|
420
305
|
declare function validateDelegateFeedbackArgs(raw: unknown): DelegateFeedbackArgs;
|
|
421
306
|
/** @experimental */
|
|
422
307
|
interface DelegateFeedbackHandlerOptions {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
308
|
+
queue: DelegationTaskQueue;
|
|
309
|
+
store: FeedbackStore;
|
|
310
|
+
generateId?: () => string;
|
|
311
|
+
now?: () => string;
|
|
427
312
|
}
|
|
428
313
|
/** Build the MCP tool handler that persists feedback events and attaches them to delegation records. @experimental */
|
|
429
314
|
declare function createDelegateFeedbackHandler(options: DelegateFeedbackHandlerOptions): (raw: unknown) => Promise<DelegateFeedbackResult>;
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
*
|
|
433
|
-
* `delegate_ui_audit` MCP tool — async kickoff for UI audit runs. Validates
|
|
434
|
-
* the input, computes an idempotency key over the canonical fields, hands
|
|
435
|
-
* the task to the queue, and returns a taskId. Identical inputs return
|
|
436
|
-
* the same taskId.
|
|
437
|
-
*
|
|
438
|
-
* The handler does not import the auditor profile directly — consumers
|
|
439
|
-
* inject a `UiAuditorDelegate` via `createMcpServer({ uiAuditorDelegate })`.
|
|
440
|
-
* The delegate is the seam where the consumer chooses the judge (vision
|
|
441
|
-
* model) and the `SandboxClient` (in-process Playwright vs fleet vs
|
|
442
|
-
* remote browser). agent-runtime ships the in-process client under
|
|
443
|
-
* `./profiles` so consumers who want the canonical setup can wire it
|
|
444
|
-
* with a few lines.
|
|
445
|
-
*
|
|
446
|
-
* @experimental
|
|
447
|
-
*/
|
|
448
|
-
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/mcp/tools/delegate-ui-audit.d.ts
|
|
449
317
|
/** MCP tool name for the `delegate_ui_audit` async kickoff tool. @experimental */
|
|
450
318
|
declare const DELEGATE_UI_AUDIT_TOOL_NAME = "delegate_ui_audit";
|
|
451
319
|
/** Human-readable description of the `delegate_ui_audit` MCP tool, injected into the tool manifest. @experimental */
|
|
452
320
|
declare const DELEGATE_UI_AUDIT_DESCRIPTION: string;
|
|
453
321
|
/** JSON Schema for `delegate_ui_audit` tool arguments (`workspaceDir`, `routes`, optional config). @experimental */
|
|
454
322
|
declare const DELEGATE_UI_AUDIT_INPUT_SCHEMA: {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
323
|
+
readonly type: "object";
|
|
324
|
+
readonly properties: {
|
|
325
|
+
readonly workspaceDir: {
|
|
326
|
+
readonly type: "string";
|
|
327
|
+
readonly description: "Absolute path for the audit workspace.";
|
|
328
|
+
};
|
|
329
|
+
readonly routes: {
|
|
330
|
+
readonly type: "array";
|
|
331
|
+
readonly items: {
|
|
332
|
+
readonly type: "object";
|
|
333
|
+
readonly properties: {
|
|
334
|
+
readonly name: {
|
|
458
335
|
readonly type: "string";
|
|
459
|
-
readonly description: "
|
|
460
|
-
|
|
461
|
-
|
|
336
|
+
readonly description: "Stable route name (used in screenshot filenames).";
|
|
337
|
+
};
|
|
338
|
+
readonly url: {
|
|
339
|
+
readonly type: "string";
|
|
340
|
+
readonly description: "Fully-qualified URL.";
|
|
341
|
+
};
|
|
342
|
+
readonly viewports: {
|
|
462
343
|
readonly type: "array";
|
|
463
344
|
readonly items: {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
};
|
|
474
|
-
readonly viewports: {
|
|
475
|
-
readonly type: "array";
|
|
476
|
-
readonly items: {
|
|
477
|
-
readonly type: "object";
|
|
478
|
-
readonly properties: {
|
|
479
|
-
readonly width: {
|
|
480
|
-
readonly type: "integer";
|
|
481
|
-
readonly minimum: 1;
|
|
482
|
-
};
|
|
483
|
-
readonly height: {
|
|
484
|
-
readonly type: "integer";
|
|
485
|
-
readonly minimum: 1;
|
|
486
|
-
};
|
|
487
|
-
};
|
|
488
|
-
readonly required: readonly ["width", "height"];
|
|
489
|
-
readonly additionalProperties: false;
|
|
490
|
-
};
|
|
491
|
-
readonly description: "Viewports to capture at. Default [{1280, 800}].";
|
|
492
|
-
};
|
|
493
|
-
readonly fullPage: {
|
|
494
|
-
readonly type: "boolean";
|
|
495
|
-
};
|
|
496
|
-
readonly waitFor: {
|
|
497
|
-
readonly type: "string";
|
|
498
|
-
readonly description: "CSS selector to wait for before capturing.";
|
|
499
|
-
};
|
|
345
|
+
readonly type: "object";
|
|
346
|
+
readonly properties: {
|
|
347
|
+
readonly width: {
|
|
348
|
+
readonly type: "integer";
|
|
349
|
+
readonly minimum: 1;
|
|
350
|
+
};
|
|
351
|
+
readonly height: {
|
|
352
|
+
readonly type: "integer";
|
|
353
|
+
readonly minimum: 1;
|
|
500
354
|
};
|
|
501
|
-
|
|
502
|
-
|
|
355
|
+
};
|
|
356
|
+
readonly required: readonly ["width", "height"];
|
|
357
|
+
readonly additionalProperties: false;
|
|
503
358
|
};
|
|
504
|
-
readonly
|
|
359
|
+
readonly description: "Viewports to capture at. Default [{1280, 800}].";
|
|
360
|
+
};
|
|
361
|
+
readonly fullPage: {
|
|
362
|
+
readonly type: "boolean";
|
|
363
|
+
};
|
|
364
|
+
readonly waitFor: {
|
|
365
|
+
readonly type: "string";
|
|
366
|
+
readonly description: "CSS selector to wait for before capturing.";
|
|
367
|
+
};
|
|
505
368
|
};
|
|
506
|
-
readonly
|
|
369
|
+
readonly required: readonly ["name", "url"];
|
|
370
|
+
readonly additionalProperties: false;
|
|
371
|
+
};
|
|
372
|
+
readonly minItems: 1;
|
|
373
|
+
};
|
|
374
|
+
readonly namespace: {
|
|
375
|
+
readonly type: "string";
|
|
376
|
+
readonly description: "Multi-tenant scope.";
|
|
377
|
+
};
|
|
378
|
+
readonly config: {
|
|
379
|
+
readonly type: "object";
|
|
380
|
+
readonly properties: {
|
|
381
|
+
readonly lenses: {
|
|
382
|
+
readonly type: "array";
|
|
383
|
+
readonly items: {
|
|
507
384
|
readonly type: "string";
|
|
508
|
-
readonly
|
|
385
|
+
readonly enum: readonly UiLens[];
|
|
386
|
+
};
|
|
387
|
+
readonly description: "Lenses to iterate. Default: every lens except \"other\".";
|
|
509
388
|
};
|
|
510
|
-
readonly
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
};
|
|
521
|
-
readonly maxIterations: {
|
|
522
|
-
readonly type: "integer";
|
|
523
|
-
readonly minimum: 1;
|
|
524
|
-
};
|
|
525
|
-
readonly maxConcurrency: {
|
|
526
|
-
readonly type: "integer";
|
|
527
|
-
readonly minimum: 1;
|
|
528
|
-
};
|
|
529
|
-
readonly productContext: {
|
|
530
|
-
readonly type: "string";
|
|
531
|
-
};
|
|
532
|
-
};
|
|
533
|
-
readonly additionalProperties: false;
|
|
389
|
+
readonly maxIterations: {
|
|
390
|
+
readonly type: "integer";
|
|
391
|
+
readonly minimum: 1;
|
|
392
|
+
};
|
|
393
|
+
readonly maxConcurrency: {
|
|
394
|
+
readonly type: "integer";
|
|
395
|
+
readonly minimum: 1;
|
|
396
|
+
};
|
|
397
|
+
readonly productContext: {
|
|
398
|
+
readonly type: "string";
|
|
534
399
|
};
|
|
400
|
+
};
|
|
401
|
+
readonly additionalProperties: false;
|
|
535
402
|
};
|
|
536
|
-
|
|
537
|
-
|
|
403
|
+
};
|
|
404
|
+
readonly required: readonly ["workspaceDir", "routes"];
|
|
405
|
+
readonly additionalProperties: false;
|
|
538
406
|
};
|
|
539
407
|
/** Parse and validate raw MCP tool input into typed `DelegateUiAuditArgs`; throws `TypeError` on bad input. @experimental */
|
|
540
408
|
declare function validateDelegateUiAuditArgs(raw: unknown): DelegateUiAuditArgs;
|
|
541
409
|
/** @experimental */
|
|
542
410
|
interface DelegateUiAuditHandlerOptions {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
411
|
+
queue: DelegationTaskQueue;
|
|
412
|
+
delegate: UiAuditorDelegate;
|
|
413
|
+
estimateDurationMs?: (args: DelegateUiAuditArgs) => number;
|
|
546
414
|
}
|
|
547
415
|
/** Build the MCP tool handler that validates input, deduplicates via idempotency key, and enqueues a UI audit. @experimental */
|
|
548
416
|
declare function createDelegateUiAuditHandler(options: DelegateUiAuditHandlerOptions): (raw: unknown) => Promise<DelegateUiAuditResult>;
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
*
|
|
552
|
-
* `delegation_history` MCP tool — synchronous read of past delegations.
|
|
553
|
-
* The agent uses this for self-introspection — "have I delegated this
|
|
554
|
-
* kind of task before? did it work?" — and calibration.
|
|
555
|
-
*
|
|
556
|
-
* @experimental
|
|
557
|
-
*/
|
|
558
|
-
|
|
417
|
+
//#endregion
|
|
418
|
+
//#region src/mcp/tools/delegation-history.d.ts
|
|
559
419
|
/** MCP tool name for the `delegation_history` read-past-delegations tool. @experimental */
|
|
560
420
|
declare const DELEGATION_HISTORY_TOOL_NAME = "delegation_history";
|
|
561
421
|
/** Human-readable description of the `delegation_history` MCP tool, injected into the tool manifest. @experimental */
|
|
562
422
|
declare const DELEGATION_HISTORY_DESCRIPTION: string;
|
|
563
423
|
/** JSON Schema for `delegation_history` tool arguments (optional `namespace`, `profile`, `since`, `limit`). @experimental */
|
|
564
424
|
declare const DELEGATION_HISTORY_INPUT_SCHEMA: {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
};
|
|
574
|
-
readonly since: {
|
|
575
|
-
readonly type: "string";
|
|
576
|
-
readonly description: "ISO datetime — earliest startedAt to include.";
|
|
577
|
-
};
|
|
578
|
-
readonly limit: {
|
|
579
|
-
readonly type: "integer";
|
|
580
|
-
readonly minimum: 1;
|
|
581
|
-
readonly maximum: 500;
|
|
582
|
-
};
|
|
425
|
+
readonly type: "object";
|
|
426
|
+
readonly properties: {
|
|
427
|
+
readonly namespace: {
|
|
428
|
+
readonly type: "string";
|
|
429
|
+
};
|
|
430
|
+
readonly profile: {
|
|
431
|
+
readonly type: "string";
|
|
432
|
+
readonly enum: readonly ["coder", "researcher"];
|
|
583
433
|
};
|
|
584
|
-
readonly
|
|
434
|
+
readonly since: {
|
|
435
|
+
readonly type: "string";
|
|
436
|
+
readonly description: "ISO datetime — earliest startedAt to include.";
|
|
437
|
+
};
|
|
438
|
+
readonly limit: {
|
|
439
|
+
readonly type: "integer";
|
|
440
|
+
readonly minimum: 1;
|
|
441
|
+
readonly maximum: 500;
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
readonly additionalProperties: false;
|
|
585
445
|
};
|
|
586
446
|
/** Parse and validate raw MCP tool input into typed `DelegationHistoryArgs`; throws `TypeError` on bad input. @experimental */
|
|
587
447
|
declare function validateDelegationHistoryArgs(raw: unknown): DelegationHistoryArgs;
|
|
588
448
|
/** @experimental */
|
|
589
449
|
interface DelegationHistoryHandlerOptions {
|
|
590
|
-
|
|
450
|
+
queue: DelegationTaskQueue;
|
|
591
451
|
}
|
|
592
452
|
/** Build the MCP tool handler that reads filtered past delegations from a `DelegationTaskQueue`. @experimental */
|
|
593
453
|
declare function createDelegationHistoryHandler(options: DelegationHistoryHandlerOptions): (raw: unknown) => Promise<DelegationHistoryResult>;
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
*
|
|
597
|
-
* `delegation_status` MCP tool — synchronous poll. Returns the current
|
|
598
|
-
* state machine + optional progress + final result (when terminal).
|
|
599
|
-
*
|
|
600
|
-
* @experimental
|
|
601
|
-
*/
|
|
602
|
-
|
|
454
|
+
//#endregion
|
|
455
|
+
//#region src/mcp/tools/delegation-status.d.ts
|
|
603
456
|
/** MCP tool name for the `delegation_status` synchronous-poll tool. @experimental */
|
|
604
457
|
declare const DELEGATION_STATUS_TOOL_NAME = "delegation_status";
|
|
605
458
|
/** Human-readable description of the `delegation_status` MCP tool, injected into the tool manifest. @experimental */
|
|
606
459
|
declare const DELEGATION_STATUS_DESCRIPTION: string;
|
|
607
460
|
/** JSON Schema for `delegation_status` tool arguments (`taskId` + optional `includeTrace`). @experimental */
|
|
608
461
|
declare const DELEGATION_STATUS_INPUT_SCHEMA: {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
};
|
|
462
|
+
readonly type: "object";
|
|
463
|
+
readonly properties: {
|
|
464
|
+
readonly taskId: {
|
|
465
|
+
readonly type: "string";
|
|
466
|
+
readonly description: "Returned by delegate_ui_audit.";
|
|
467
|
+
};
|
|
468
|
+
readonly includeTrace: {
|
|
469
|
+
readonly type: "boolean";
|
|
470
|
+
readonly description: "Also return the journaled loop-trace span tree for this delegation. Default false.";
|
|
619
471
|
};
|
|
620
|
-
|
|
621
|
-
|
|
472
|
+
};
|
|
473
|
+
readonly required: readonly ["taskId"];
|
|
474
|
+
readonly additionalProperties: false;
|
|
622
475
|
};
|
|
623
476
|
/** Parse and validate raw MCP tool input into typed `DelegationStatusArgs`; throws `TypeError` on bad input. @experimental */
|
|
624
477
|
declare function validateDelegationStatusArgs(raw: unknown): DelegationStatusArgs;
|
|
625
478
|
/** @experimental */
|
|
626
479
|
interface DelegationStatusHandlerOptions {
|
|
627
|
-
|
|
480
|
+
queue: DelegationTaskQueue;
|
|
628
481
|
}
|
|
629
482
|
/** Build the MCP tool handler that polls a `DelegationTaskQueue` for task status. @experimental */
|
|
630
483
|
declare function createDelegationStatusHandler(options: DelegationStatusHandlerOptions): (raw: unknown) => Promise<DelegationStatusResult>;
|
|
631
|
-
|
|
632
|
-
|
|
484
|
+
//#endregion
|
|
485
|
+
//#region src/mcp/index.d.ts
|
|
486
|
+
/** @deprecated Use `McpToolDescriptor`; both names are the same protocol contract. */
|
|
487
|
+
type StdioToolDescriptor = McpToolDescriptor;
|
|
488
|
+
//#endregion
|
|
489
|
+
export { type AgentMemorySpec, type AnalystFindingEvent, type AnalystRegistry, type CappedDelegationTrace, type Check, type CheckRunnerOptions, type CoderDelegate, type CoderOutput, type CoderReview, type CoderReviewer, CodexExecutionDiagnosticError, type CodexExecutionEvidence, type CodexExecutionFailureDiagnostic, type CodexExecutionPolicy, type CodexTokenUsage, type CoordinationEvent, type CoordinationTools, type CoordinationToolsOptions, type CreateKbGateOptions, type CreateMemoryToolServerOptions, type CreateWorktreeOptions, DEFAULT_AWAIT_EVENT_TIMEOUT_MS, 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 DelegateArgs, type DelegateCodeArgs, type DelegateCodeConfig, type DelegateCodeResult, 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 DownMessageEvent, type DriveTurnCapableBox, type DriveTurnTick, 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, type LocalHarness, type LocalHarnessResult, MEMORY_FILE_ENV, MEMORY_ITEMS_ENV, MEMORY_LOG_ENV, MEMORY_NAME_ENV, type MakeWorkerAgent, type McpServer, type McpServerOptions, type McpToolDescriptor, type McpTransport, type MemoryItem, type Question, type QuestionDecision, type QuestionLevel, type QuestionOption, type QuestionPolicy, type QuestionRecord, type QuestionUrgency, type RemoveWorktreeOptions, type ResearchOutputShape, type ResearchSource, type ResolvedMemoryEnv, type RunDetachedTurnOptions, type RunLocalHarnessOptions, type SettleDetachedCoderTurnOptions, type SettledWorker, type SiblingSandboxExecutorOptions, StdioToolDescriptor, type StdioToolServer, type StdioToolServerOptions, type SubmitInput, type SubmitOutput, type TraceContext, type UiAuditLensFilter, type UiAuditorDelegate, type UiAuditorDelegationOutput, type WorkerWatchOptions, type WorktreeHandle, buildDelegationTraceSpans, capDelegationTrace, captureWorktreeDiff, coderTaskFromArgs, composeLoopTraceEmitters, createCoordinationTools, createDelegateFeedbackHandler, createDelegateHandler, createDelegateUiAuditHandler, createDelegationHistoryHandler, createDelegationStatusHandler, createDelegationTraceCollector, createDetachedTurnResumeDriver, createFleetWorkspaceExecutor, createInProcessExecutor, createInProcessTransport, createKbGate, createMcpServer, createMemoryToolServer, createPropagatingTraceEmitter, createSiblingSandboxExecutor, createStdioToolServer, createWorktree, defaultChecks, detachedSessionDelegate, detachedTurnEvents, detectExecutor, eventToSnapshot, formatDetachedSessionRef, hashIdempotencyInput, liftFindings, makeCheckRunner, mcpToolsForRuntimeMcp, mcpToolsForRuntimeMcpSubset, parseCodexTokenUsage, parseDetachedSessionRef, parseMemoryItems, readMemoryItemsFile, readTraceContextFromEnv, removeWorktree, renderTrace, resolveMemoryFromEnv, runCheck, runDetachedTurn, runLocalHarness, settleDetachedCoderTurn, traceContextToEnv, validateDelegateArgs, validateDelegateFeedbackArgs, validateDelegateUiAuditArgs, validateDelegationHistoryArgs, validateDelegationStatusArgs };
|
|
490
|
+
//# sourceMappingURL=index.d.ts.map
|