@tangle-network/agent-runtime 0.105.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 +2 -2
- 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 -1058
- package/dist/index.js +2106 -2082
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +768 -889
- package/dist/intelligence.js +1466 -1367
- 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 -15
- 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 -436
- 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 +149 -145
- package/dist/primeintellect/index.js +626 -1003
- 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 -56
- package/skills/build-with-agent-runtime/SKILL.md +1 -0
- 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-2VZYRB55.js +0 -834
- package/dist/chunk-2VZYRB55.js.map +0 -1
- package/dist/chunk-3MDZX7YU.js +0 -125
- package/dist/chunk-3MDZX7YU.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-C5RTIBNZ.js +0 -48
- package/dist/chunk-C5RTIBNZ.js.map +0 -1
- package/dist/chunk-CTRA64LY.js +0 -680
- package/dist/chunk-CTRA64LY.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-H5QPIZNX.js +0 -907
- package/dist/chunk-H5QPIZNX.js.map +0 -1
- package/dist/chunk-HLKC4UYB.js +0 -3514
- package/dist/chunk-HLKC4UYB.js.map +0 -1
- package/dist/chunk-HNP72PNU.js +0 -192
- package/dist/chunk-HNP72PNU.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-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-OPVWXJ2H.js +0 -75
- package/dist/chunk-OPVWXJ2H.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-RDOAVVHY.js +0 -699
- package/dist/chunk-RDOAVVHY.js.map +0 -1
- package/dist/chunk-SGKPNBXE.js +0 -60
- package/dist/chunk-SGKPNBXE.js.map +0 -1
- package/dist/chunk-SMQXZGLZ.js +0 -351
- package/dist/chunk-SMQXZGLZ.js.map +0 -1
- package/dist/chunk-UHEZW5BU.js +0 -2918
- package/dist/chunk-UHEZW5BU.js.map +0 -1
- package/dist/chunk-UPWGXKXB.js +0 -254
- package/dist/chunk-UPWGXKXB.js.map +0 -1
- package/dist/chunk-VISA6CI3.js +0 -200
- package/dist/chunk-VISA6CI3.js.map +0 -1
- package/dist/chunk-WMTCUOQL.js +0 -474
- package/dist/chunk-WMTCUOQL.js.map +0 -1
- package/dist/chunk-WRTOVNN4.js +0 -4728
- package/dist/chunk-WRTOVNN4.js.map +0 -1
- package/dist/chunk-WSTRQZYQ.js +0 -5576
- package/dist/chunk-WSTRQZYQ.js.map +0 -1
- package/dist/chunk-XBG2W2VW.js +0 -6434
- package/dist/chunk-XBG2W2VW.js.map +0 -1
- package/dist/chunk-YEJR7IXO.js +0 -68
- package/dist/chunk-YEJR7IXO.js.map +0 -1
- package/dist/chunk-YJZA2BIK.js +0 -1338
- package/dist/chunk-YJZA2BIK.js.map +0 -1
- package/dist/completion-gate-BMy5LGoP.d.ts +0 -256
- package/dist/conversation.js.map +0 -1
- package/dist/coordination-BZZSVYpZ.d.ts +0 -2570
- package/dist/environment-provider.js.map +0 -1
- package/dist/improvement-adapter-HAZz-7vK.d.ts +0 -203
- package/dist/knowledge.js.map +0 -1
- package/dist/local-harness-BDNcl6jI.d.ts +0 -175
- package/dist/loop-runner-bin-68aoM9-7.d.ts +0 -199
- 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-B4t-OQjL.d.ts +0 -271
- package/dist/redact-BuFjxBUJ.d.ts +0 -481
- package/dist/sanitize-DEbPNtyI.d.ts +0 -328
- package/dist/structural-rollout-DEh6CEsa.d.ts +0 -446
- package/dist/supervise-4_48wwvy.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-DxhAWr5Z.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,108 +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. Every
|
|
203
|
-
* `memory_search` can append one JSONL row to a retrieval log (`logPath`) —
|
|
204
|
-
* the per-query record an off-policy retrieval estimator (agent-knowledge's
|
|
205
|
-
* `RetrievalHoldout`) consumes. agent-knowledge is NOT a dependency of this
|
|
206
|
-
* repo, so the log file is the flagged cross-package seam, not an import.
|
|
207
|
-
*
|
|
208
|
-
* Fail-loud discipline (mirrors `materializeLocalMcp`): an EMPTY memory is
|
|
209
|
-
* never served — a profile without memory simply omits the artifact, and
|
|
210
|
-
* silently serving zero rows would fake the with/without ablation.
|
|
211
|
-
*
|
|
212
|
-
* @experimental
|
|
213
|
-
*/
|
|
214
|
-
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/mcp/memory-server.d.ts
|
|
215
130
|
/** One row of agent memory: a crisp lesson/fact with provenance. */
|
|
216
131
|
interface MemoryItem {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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;
|
|
225
140
|
}
|
|
226
141
|
/**
|
|
227
142
|
* The `memory` artifact payload — HOW a profile's memory is stored and served:
|
|
@@ -238,15 +153,15 @@ interface MemoryItem {
|
|
|
238
153
|
* — the retrieval log a holdout estimator reads (see module doc).
|
|
239
154
|
*/
|
|
240
155
|
interface AgentMemorySpec {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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;
|
|
250
165
|
}
|
|
251
166
|
/** Env var naming the durable row store file the memory bin loads (the
|
|
252
167
|
* `memoryMcpServer` ↔ memory-bin contract). */
|
|
@@ -258,16 +173,16 @@ declare const MEMORY_LOG_ENV = "AGENT_MEMORY_LOG";
|
|
|
258
173
|
/** Env var overriding the served display name (default 'agent-memory'). */
|
|
259
174
|
declare const MEMORY_NAME_ENV = "AGENT_MEMORY_NAME";
|
|
260
175
|
interface CreateMemoryToolServerOptions {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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;
|
|
271
186
|
}
|
|
272
187
|
/**
|
|
273
188
|
* Build the memory MCP server: `memory_search` (lexical top-k over the rows)
|
|
@@ -280,9 +195,9 @@ declare function parseMemoryItems(value: unknown, source: string): MemoryItem[];
|
|
|
280
195
|
declare function readMemoryItemsFile(path: string): MemoryItem[];
|
|
281
196
|
/** What the memory bin resolved from its environment. */
|
|
282
197
|
interface ResolvedMemoryEnv {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
198
|
+
items: MemoryItem[];
|
|
199
|
+
serverName?: string;
|
|
200
|
+
logPath?: string;
|
|
286
201
|
}
|
|
287
202
|
/**
|
|
288
203
|
* Resolve the bin's memory from `AGENT_MEMORY_FILE` (durable store) and/or
|
|
@@ -290,35 +205,18 @@ interface ResolvedMemoryEnv {
|
|
|
290
205
|
* a boot FAILURE, matching the fail-closed materialization discipline.
|
|
291
206
|
*/
|
|
292
207
|
declare function resolveMemoryFromEnv(env: Record<string, string | undefined>): ResolvedMemoryEnv;
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
*
|
|
296
|
-
* The trace-analyst KIND directory — the operator's lenses, as composable DATA.
|
|
297
|
-
*
|
|
298
|
-
* An analyst is not one question. A kind is ONE lens (completeness, correctness, policy, efficiency,
|
|
299
|
-
* tool-use, …); each emits `AnalystFinding`s tagged by its `area`. The driver `list_analysts` to see
|
|
300
|
-
* the menu, `run_analyst(kind, worker)` to apply a lens, and `define_analyst` to author a new one —
|
|
301
|
-
* so at test time you compose the exact lenses a domain needs (maximum specificity), not one generic
|
|
302
|
-
* reviewer. The kinds are data, the runner is generic, and the finding shape + firewall are reused
|
|
303
|
-
* from agent-eval / the keystone — never re-derived.
|
|
304
|
-
*
|
|
305
|
-
* A kind here is a lightweight lens (`Check`); it is a deliberate SUBSET of agent-eval's full
|
|
306
|
-
* `TraceAnalystKindSpec`, so a kind that needs the heavy agentic actor (sub-agent recursion, tools,
|
|
307
|
-
* goldens) upgrades to `createTraceAnalystKind` without changing this directory's surface.
|
|
308
|
-
*
|
|
309
|
-
* @experimental
|
|
310
|
-
*/
|
|
311
|
-
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/mcp/tools/checks.d.ts
|
|
312
210
|
/** One lens — a composable analyst kind. Identity fields mirror `TraceAnalystKindSpec` so a kind is
|
|
313
211
|
* upgradeable to the full agentic factory; `lookFor` is the lens question the actor applies. */
|
|
314
212
|
interface Check {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
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;
|
|
322
220
|
}
|
|
323
221
|
/** The built-in lens directory. Domain-blind (about any agent trace); compose at test time. */
|
|
324
222
|
declare const defaultChecks: Record<string, Check>;
|
|
@@ -329,11 +227,11 @@ declare function liftFindings(kind: Check, rows: unknown[], producedAt: string):
|
|
|
329
227
|
* the trace shape: a `{ messages }` conversation, a bare message array, else stringified. */
|
|
330
228
|
declare function renderTrace(trace: unknown): string;
|
|
331
229
|
interface CheckRunnerOptions {
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
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>;
|
|
337
235
|
}
|
|
338
236
|
/** Run ONE lens over a trace → findings. Generic over any kind: prompt = the lens + the agent-eval
|
|
339
237
|
* finding schema; the model's JSON array is parsed (`parseRawFinding`), lifted, and firewalled. */
|
|
@@ -344,288 +242,249 @@ declare function runCheck(kind: Check, trace: unknown, opts: CheckRunnerOptions,
|
|
|
344
242
|
* passed in because replay-safe paths must not read `Date.now`.
|
|
345
243
|
*/
|
|
346
244
|
declare function makeCheckRunner(kinds: Record<string, Check>, opts: CheckRunnerOptions): (kindId: string, trace: unknown, producedAt: string) => Promise<AnalystFinding[] | {
|
|
347
|
-
|
|
245
|
+
error: string;
|
|
348
246
|
}>;
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
*
|
|
352
|
-
* `delegate_feedback` MCP tool — synchronous record of agent / user /
|
|
353
|
-
* downstream-judge feedback on a delegation, artifact, or outcome.
|
|
354
|
-
*
|
|
355
|
-
* The store is append-only. Every rating is its own event; no dedupe.
|
|
356
|
-
* When `refersTo.kind === 'delegation'`, the snapshot is also attached
|
|
357
|
-
* to the matching queue record so `delegation_history` surfaces it
|
|
358
|
-
* inline without a join.
|
|
359
|
-
*
|
|
360
|
-
* @experimental
|
|
361
|
-
*/
|
|
362
|
-
|
|
247
|
+
//#endregion
|
|
248
|
+
//#region src/mcp/tools/delegate-feedback.d.ts
|
|
363
249
|
/** MCP tool name for the `delegate_feedback` feedback-recording tool. @experimental */
|
|
364
250
|
declare const DELEGATE_FEEDBACK_TOOL_NAME = "delegate_feedback";
|
|
365
251
|
/** Human-readable description of the `delegate_feedback` MCP tool, injected into the tool manifest. @experimental */
|
|
366
252
|
declare const DELEGATE_FEEDBACK_DESCRIPTION: string;
|
|
367
253
|
/** JSON Schema for `delegate_feedback` tool arguments (`refersTo`, `rating`, `by`, optional fields). @experimental */
|
|
368
254
|
declare const DELEGATE_FEEDBACK_INPUT_SCHEMA: {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
};
|
|
378
|
-
readonly ref: {
|
|
379
|
-
readonly type: "string";
|
|
380
|
-
};
|
|
381
|
-
};
|
|
382
|
-
readonly required: readonly ["kind", "ref"];
|
|
383
|
-
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"];
|
|
384
263
|
};
|
|
385
|
-
readonly
|
|
386
|
-
|
|
387
|
-
readonly properties: {
|
|
388
|
-
readonly score: {
|
|
389
|
-
readonly type: "number";
|
|
390
|
-
readonly minimum: 0;
|
|
391
|
-
readonly maximum: 1;
|
|
392
|
-
};
|
|
393
|
-
readonly label: {
|
|
394
|
-
readonly type: "string";
|
|
395
|
-
readonly enum: readonly ["good", "bad", "neutral", "mixed"];
|
|
396
|
-
};
|
|
397
|
-
readonly notes: {
|
|
398
|
-
readonly type: "string";
|
|
399
|
-
};
|
|
400
|
-
};
|
|
401
|
-
readonly required: readonly ["score", "notes"];
|
|
402
|
-
readonly additionalProperties: false;
|
|
264
|
+
readonly ref: {
|
|
265
|
+
readonly type: "string";
|
|
403
266
|
};
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
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;
|
|
407
278
|
};
|
|
408
|
-
readonly
|
|
409
|
-
|
|
279
|
+
readonly label: {
|
|
280
|
+
readonly type: "string";
|
|
281
|
+
readonly enum: readonly ["good", "bad", "neutral", "mixed"];
|
|
410
282
|
};
|
|
411
|
-
readonly
|
|
412
|
-
|
|
283
|
+
readonly notes: {
|
|
284
|
+
readonly type: "string";
|
|
413
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";
|
|
414
296
|
};
|
|
415
|
-
readonly
|
|
416
|
-
|
|
297
|
+
readonly namespace: {
|
|
298
|
+
readonly type: "string";
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
readonly required: readonly ["refersTo", "rating", "by"];
|
|
302
|
+
readonly additionalProperties: false;
|
|
417
303
|
};
|
|
418
304
|
/** Parse and validate raw MCP tool input into typed `DelegateFeedbackArgs`; throws `TypeError` on bad input. @experimental */
|
|
419
305
|
declare function validateDelegateFeedbackArgs(raw: unknown): DelegateFeedbackArgs;
|
|
420
306
|
/** @experimental */
|
|
421
307
|
interface DelegateFeedbackHandlerOptions {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
308
|
+
queue: DelegationTaskQueue;
|
|
309
|
+
store: FeedbackStore;
|
|
310
|
+
generateId?: () => string;
|
|
311
|
+
now?: () => string;
|
|
426
312
|
}
|
|
427
313
|
/** Build the MCP tool handler that persists feedback events and attaches them to delegation records. @experimental */
|
|
428
314
|
declare function createDelegateFeedbackHandler(options: DelegateFeedbackHandlerOptions): (raw: unknown) => Promise<DelegateFeedbackResult>;
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
*
|
|
432
|
-
* `delegate_ui_audit` MCP tool — async kickoff for UI audit runs. Validates
|
|
433
|
-
* the input, computes an idempotency key over the canonical fields, hands
|
|
434
|
-
* the task to the queue, and returns a taskId. Identical inputs return
|
|
435
|
-
* the same taskId.
|
|
436
|
-
*
|
|
437
|
-
* The handler does not import the auditor profile directly — consumers
|
|
438
|
-
* inject a `UiAuditorDelegate` via `createMcpServer({ uiAuditorDelegate })`.
|
|
439
|
-
* The delegate is the seam where the consumer chooses the judge (vision
|
|
440
|
-
* model) and the `SandboxClient` (in-process Playwright vs fleet vs
|
|
441
|
-
* remote browser). agent-runtime ships the in-process client under
|
|
442
|
-
* `./profiles` so consumers who want the canonical setup can wire it
|
|
443
|
-
* with a few lines.
|
|
444
|
-
*
|
|
445
|
-
* @experimental
|
|
446
|
-
*/
|
|
447
|
-
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/mcp/tools/delegate-ui-audit.d.ts
|
|
448
317
|
/** MCP tool name for the `delegate_ui_audit` async kickoff tool. @experimental */
|
|
449
318
|
declare const DELEGATE_UI_AUDIT_TOOL_NAME = "delegate_ui_audit";
|
|
450
319
|
/** Human-readable description of the `delegate_ui_audit` MCP tool, injected into the tool manifest. @experimental */
|
|
451
320
|
declare const DELEGATE_UI_AUDIT_DESCRIPTION: string;
|
|
452
321
|
/** JSON Schema for `delegate_ui_audit` tool arguments (`workspaceDir`, `routes`, optional config). @experimental */
|
|
453
322
|
declare const DELEGATE_UI_AUDIT_INPUT_SCHEMA: {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
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: {
|
|
457
335
|
readonly type: "string";
|
|
458
|
-
readonly description: "
|
|
459
|
-
|
|
460
|
-
|
|
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: {
|
|
461
343
|
readonly type: "array";
|
|
462
344
|
readonly items: {
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
};
|
|
473
|
-
readonly viewports: {
|
|
474
|
-
readonly type: "array";
|
|
475
|
-
readonly items: {
|
|
476
|
-
readonly type: "object";
|
|
477
|
-
readonly properties: {
|
|
478
|
-
readonly width: {
|
|
479
|
-
readonly type: "integer";
|
|
480
|
-
readonly minimum: 1;
|
|
481
|
-
};
|
|
482
|
-
readonly height: {
|
|
483
|
-
readonly type: "integer";
|
|
484
|
-
readonly minimum: 1;
|
|
485
|
-
};
|
|
486
|
-
};
|
|
487
|
-
readonly required: readonly ["width", "height"];
|
|
488
|
-
readonly additionalProperties: false;
|
|
489
|
-
};
|
|
490
|
-
readonly description: "Viewports to capture at. Default [{1280, 800}].";
|
|
491
|
-
};
|
|
492
|
-
readonly fullPage: {
|
|
493
|
-
readonly type: "boolean";
|
|
494
|
-
};
|
|
495
|
-
readonly waitFor: {
|
|
496
|
-
readonly type: "string";
|
|
497
|
-
readonly description: "CSS selector to wait for before capturing.";
|
|
498
|
-
};
|
|
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;
|
|
499
354
|
};
|
|
500
|
-
|
|
501
|
-
|
|
355
|
+
};
|
|
356
|
+
readonly required: readonly ["width", "height"];
|
|
357
|
+
readonly additionalProperties: false;
|
|
502
358
|
};
|
|
503
|
-
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
|
+
};
|
|
504
368
|
};
|
|
505
|
-
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: {
|
|
506
384
|
readonly type: "string";
|
|
507
|
-
readonly
|
|
385
|
+
readonly enum: readonly UiLens[];
|
|
386
|
+
};
|
|
387
|
+
readonly description: "Lenses to iterate. Default: every lens except \"other\".";
|
|
508
388
|
};
|
|
509
|
-
readonly
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
};
|
|
520
|
-
readonly maxIterations: {
|
|
521
|
-
readonly type: "integer";
|
|
522
|
-
readonly minimum: 1;
|
|
523
|
-
};
|
|
524
|
-
readonly maxConcurrency: {
|
|
525
|
-
readonly type: "integer";
|
|
526
|
-
readonly minimum: 1;
|
|
527
|
-
};
|
|
528
|
-
readonly productContext: {
|
|
529
|
-
readonly type: "string";
|
|
530
|
-
};
|
|
531
|
-
};
|
|
532
|
-
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";
|
|
533
399
|
};
|
|
400
|
+
};
|
|
401
|
+
readonly additionalProperties: false;
|
|
534
402
|
};
|
|
535
|
-
|
|
536
|
-
|
|
403
|
+
};
|
|
404
|
+
readonly required: readonly ["workspaceDir", "routes"];
|
|
405
|
+
readonly additionalProperties: false;
|
|
537
406
|
};
|
|
538
407
|
/** Parse and validate raw MCP tool input into typed `DelegateUiAuditArgs`; throws `TypeError` on bad input. @experimental */
|
|
539
408
|
declare function validateDelegateUiAuditArgs(raw: unknown): DelegateUiAuditArgs;
|
|
540
409
|
/** @experimental */
|
|
541
410
|
interface DelegateUiAuditHandlerOptions {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
411
|
+
queue: DelegationTaskQueue;
|
|
412
|
+
delegate: UiAuditorDelegate;
|
|
413
|
+
estimateDurationMs?: (args: DelegateUiAuditArgs) => number;
|
|
545
414
|
}
|
|
546
415
|
/** Build the MCP tool handler that validates input, deduplicates via idempotency key, and enqueues a UI audit. @experimental */
|
|
547
416
|
declare function createDelegateUiAuditHandler(options: DelegateUiAuditHandlerOptions): (raw: unknown) => Promise<DelegateUiAuditResult>;
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
*
|
|
551
|
-
* `delegation_history` MCP tool — synchronous read of past delegations.
|
|
552
|
-
* The agent uses this for self-introspection — "have I delegated this
|
|
553
|
-
* kind of task before? did it work?" — and calibration.
|
|
554
|
-
*
|
|
555
|
-
* @experimental
|
|
556
|
-
*/
|
|
557
|
-
|
|
417
|
+
//#endregion
|
|
418
|
+
//#region src/mcp/tools/delegation-history.d.ts
|
|
558
419
|
/** MCP tool name for the `delegation_history` read-past-delegations tool. @experimental */
|
|
559
420
|
declare const DELEGATION_HISTORY_TOOL_NAME = "delegation_history";
|
|
560
421
|
/** Human-readable description of the `delegation_history` MCP tool, injected into the tool manifest. @experimental */
|
|
561
422
|
declare const DELEGATION_HISTORY_DESCRIPTION: string;
|
|
562
423
|
/** JSON Schema for `delegation_history` tool arguments (optional `namespace`, `profile`, `since`, `limit`). @experimental */
|
|
563
424
|
declare const DELEGATION_HISTORY_INPUT_SCHEMA: {
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
};
|
|
573
|
-
readonly since: {
|
|
574
|
-
readonly type: "string";
|
|
575
|
-
readonly description: "ISO datetime — earliest startedAt to include.";
|
|
576
|
-
};
|
|
577
|
-
readonly limit: {
|
|
578
|
-
readonly type: "integer";
|
|
579
|
-
readonly minimum: 1;
|
|
580
|
-
readonly maximum: 500;
|
|
581
|
-
};
|
|
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"];
|
|
582
433
|
};
|
|
583
|
-
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;
|
|
584
445
|
};
|
|
585
446
|
/** Parse and validate raw MCP tool input into typed `DelegationHistoryArgs`; throws `TypeError` on bad input. @experimental */
|
|
586
447
|
declare function validateDelegationHistoryArgs(raw: unknown): DelegationHistoryArgs;
|
|
587
448
|
/** @experimental */
|
|
588
449
|
interface DelegationHistoryHandlerOptions {
|
|
589
|
-
|
|
450
|
+
queue: DelegationTaskQueue;
|
|
590
451
|
}
|
|
591
452
|
/** Build the MCP tool handler that reads filtered past delegations from a `DelegationTaskQueue`. @experimental */
|
|
592
453
|
declare function createDelegationHistoryHandler(options: DelegationHistoryHandlerOptions): (raw: unknown) => Promise<DelegationHistoryResult>;
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
*
|
|
596
|
-
* `delegation_status` MCP tool — synchronous poll. Returns the current
|
|
597
|
-
* state machine + optional progress + final result (when terminal).
|
|
598
|
-
*
|
|
599
|
-
* @experimental
|
|
600
|
-
*/
|
|
601
|
-
|
|
454
|
+
//#endregion
|
|
455
|
+
//#region src/mcp/tools/delegation-status.d.ts
|
|
602
456
|
/** MCP tool name for the `delegation_status` synchronous-poll tool. @experimental */
|
|
603
457
|
declare const DELEGATION_STATUS_TOOL_NAME = "delegation_status";
|
|
604
458
|
/** Human-readable description of the `delegation_status` MCP tool, injected into the tool manifest. @experimental */
|
|
605
459
|
declare const DELEGATION_STATUS_DESCRIPTION: string;
|
|
606
460
|
/** JSON Schema for `delegation_status` tool arguments (`taskId` + optional `includeTrace`). @experimental */
|
|
607
461
|
declare const DELEGATION_STATUS_INPUT_SCHEMA: {
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
};
|
|
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.";
|
|
618
471
|
};
|
|
619
|
-
|
|
620
|
-
|
|
472
|
+
};
|
|
473
|
+
readonly required: readonly ["taskId"];
|
|
474
|
+
readonly additionalProperties: false;
|
|
621
475
|
};
|
|
622
476
|
/** Parse and validate raw MCP tool input into typed `DelegationStatusArgs`; throws `TypeError` on bad input. @experimental */
|
|
623
477
|
declare function validateDelegationStatusArgs(raw: unknown): DelegationStatusArgs;
|
|
624
478
|
/** @experimental */
|
|
625
479
|
interface DelegationStatusHandlerOptions {
|
|
626
|
-
|
|
480
|
+
queue: DelegationTaskQueue;
|
|
627
481
|
}
|
|
628
482
|
/** Build the MCP tool handler that polls a `DelegationTaskQueue` for task status. @experimental */
|
|
629
483
|
declare function createDelegationStatusHandler(options: DelegationStatusHandlerOptions): (raw: unknown) => Promise<DelegationStatusResult>;
|
|
630
|
-
|
|
631
|
-
|
|
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
|