@tangle-network/agent-runtime 0.105.0 → 0.106.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-CiOCyRHb.js +743 -0
- package/dist/backends-CiOCyRHb.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-BpLQZGPH.js +1265 -0
- package/dist/conversation-BpLQZGPH.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-CRagyuNb.js +268 -0
- package/dist/loop-runner-bin-CRagyuNb.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-5zM5XxLr.js +5408 -0
- package/dist/runtime-5zM5XxLr.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 +44 -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/types-Cbp72qyu.d.ts
DELETED
|
@@ -1,491 +0,0 @@
|
|
|
1
|
-
import { BenchmarkEvaluation, TraceStore } from '@tangle-network/agent-eval';
|
|
2
|
-
import { AgentCandidateArtifactRef, AgentCandidateTermination, AgentCandidateTaskOutcomeMaterial, AgentCandidateTaskOutcomeEvidence, AgentCandidateTaskOutputSpec, Sha256Digest, AgentCandidateContainer, AgentCandidateOciPlatform, AgentCandidateGitHubRepository, AgentCandidateWorkspaceSnapshotEvidence, AgentCandidateBundle, AgentCandidateResolvedModel, AgentCandidateAttemptPolicy, AgentCandidateExecutionLimits, AgentCandidateModelAccessNetwork, AgentCandidateModelSettlementCall, AgentCandidateCapturedArtifact, AgentCandidateWorkspaceManifestMaterial, AgentCandidateBenchmarkSuite, AgentCandidateBenchmarkTask, AgentCandidateProfilePlanEvidence, AgentCandidateProfileActivation, AgentCandidateExecutionPlanEvidence, AgentCandidateMaterializationReceipt, AgentCandidateInstructionDelivery, AgentCandidateKnowledgeRef, AgentCandidateEffectiveMemory, AgentCandidateRunReceipt, AgentCandidateFixedSpend, AgentCandidateRunCell } from '@tangle-network/agent-interface';
|
|
3
|
-
|
|
4
|
-
declare const verifiedCandidateBrand: unique symbol;
|
|
5
|
-
declare const preparedCandidateBrand: unique symbol;
|
|
6
|
-
declare const verifiedTaskOutcomeBrand: unique symbol;
|
|
7
|
-
/** Reads one content-addressed object from the closed S3/IPFS locator set. */
|
|
8
|
-
interface AgentCandidateArtifactPort {
|
|
9
|
-
read(ref: AgentCandidateArtifactRef): Promise<Uint8Array>;
|
|
10
|
-
}
|
|
11
|
-
type AgentCandidateOutputPurpose = 'execution-plan' | 'materialization-receipt' | 'candidate-workspace-manifest' | 'candidate-workspace-archive' | 'task-manifest' | 'task-archive' | 'task-patch' | 'task-output' | 'task-outcome' | 'memory-after-manifest' | 'memory-after-archive' | 'grader-evidence' | 'benchmark-result' | 'model-settlement' | 'trace' | 'executor-native-evidence' | 'executor-capture' | 'run-receipt' | 'knowledge-retrieval-config' | 'knowledge-evaluation' | 'failure-evidence';
|
|
12
|
-
/** Durable content-addressed evidence store controlled only by the evaluator. */
|
|
13
|
-
interface AgentCandidateOutputArtifactPort extends AgentCandidateArtifactPort {
|
|
14
|
-
/** Must be idempotent for identical bytes and return only a durable S3/IPFS locator. */
|
|
15
|
-
put(input: {
|
|
16
|
-
executionId: string;
|
|
17
|
-
purpose: AgentCandidateOutputPurpose;
|
|
18
|
-
bytes: Uint8Array;
|
|
19
|
-
/** Abort must prevent durable publication when it happens before resolution. */
|
|
20
|
-
signal?: AbortSignal;
|
|
21
|
-
}): Promise<AgentCandidateArtifactRef>;
|
|
22
|
-
}
|
|
23
|
-
/** Resolves a declared GitHub repository to an already-present local Git object store. */
|
|
24
|
-
interface AgentCandidateRepositoryPort {
|
|
25
|
-
resolve(repository: AgentCandidateGitHubRepository): Promise<string>;
|
|
26
|
-
}
|
|
27
|
-
interface AgentCandidateVerificationPorts {
|
|
28
|
-
artifacts: AgentCandidateArtifactPort;
|
|
29
|
-
repositories: AgentCandidateRepositoryPort;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Materializes an already-verified workspace archive.
|
|
33
|
-
*
|
|
34
|
-
* The runtime independently scans every resulting byte, mode, and path against
|
|
35
|
-
* the signed manifest after this returns. Implementations may therefore unpack
|
|
36
|
-
* any archive encoding, or no-op when the exact workspace is already present.
|
|
37
|
-
*/
|
|
38
|
-
interface AgentCandidateWorkspacePort {
|
|
39
|
-
materialize(input: {
|
|
40
|
-
role: 'task' | 'candidate' | 'knowledge' | 'memory';
|
|
41
|
-
snapshot: AgentCandidateWorkspaceSnapshotEvidence;
|
|
42
|
-
archive: Uint8Array;
|
|
43
|
-
destination: string;
|
|
44
|
-
}): Promise<void>;
|
|
45
|
-
}
|
|
46
|
-
interface ResolvedAgentCandidateContainer {
|
|
47
|
-
source: 'pinned-container' | 'evaluator-task-container';
|
|
48
|
-
image: string;
|
|
49
|
-
indexDigest: Sha256Digest;
|
|
50
|
-
manifestDigest: Sha256Digest;
|
|
51
|
-
platform: AgentCandidateOciPlatform;
|
|
52
|
-
}
|
|
53
|
-
interface AgentCandidateContainerPort {
|
|
54
|
-
resolve(input: {
|
|
55
|
-
candidate: AgentCandidateContainer | undefined;
|
|
56
|
-
evaluatorTaskContainer: ResolvedAgentCandidateContainer | undefined;
|
|
57
|
-
}): Promise<ResolvedAgentCandidateContainer>;
|
|
58
|
-
}
|
|
59
|
-
interface AgentCandidateModelPort {
|
|
60
|
-
resolve(input: {
|
|
61
|
-
requested: string;
|
|
62
|
-
harness: AgentCandidateBundle['execution']['harness'];
|
|
63
|
-
reasoningEffort: NonNullable<AgentCandidateBundle['profile']['model']>['reasoningEffort'];
|
|
64
|
-
}): Promise<AgentCandidateResolvedModel>;
|
|
65
|
-
/**
|
|
66
|
-
* Reserve a stable access identity without creating a live credential.
|
|
67
|
-
* The reservation is scoped to `preparationId` and must automatically expire
|
|
68
|
-
* at `expiresAtMs`, even if this call returns ambiguously to the runtime.
|
|
69
|
-
*/
|
|
70
|
-
reserveGrant(input: {
|
|
71
|
-
executionId: string;
|
|
72
|
-
preparationId: string;
|
|
73
|
-
expiresAtMs: number;
|
|
74
|
-
attempt: AgentCandidateAttemptPolicy;
|
|
75
|
-
bundleDigest: Sha256Digest;
|
|
76
|
-
resolved: AgentCandidateResolvedModel;
|
|
77
|
-
limits: AgentCandidateModelLimits;
|
|
78
|
-
}): Promise<AgentCandidateProtectedModelReservation>;
|
|
79
|
-
/** Create the live scoped credential only after the execution attempt is durably claimed. */
|
|
80
|
-
activateGrant(input: {
|
|
81
|
-
executionId: string;
|
|
82
|
-
preparationId: string;
|
|
83
|
-
grantDigest: Sha256Digest;
|
|
84
|
-
resolved: AgentCandidateResolvedModel;
|
|
85
|
-
deadlineAtMs: number;
|
|
86
|
-
}): Promise<AgentCandidateProtectedModelActivation>;
|
|
87
|
-
/**
|
|
88
|
-
* Atomically revoke the grant, drain in-flight calls, and return its immutable final ledger.
|
|
89
|
-
* This operation must be idempotent for the exact preparation and must also
|
|
90
|
-
* settle a reservation that was never activated. It must never affect a
|
|
91
|
-
* different preparation, even when both reservations report the same digest.
|
|
92
|
-
*/
|
|
93
|
-
settleGrant(input: {
|
|
94
|
-
executionId: string;
|
|
95
|
-
preparationId: string;
|
|
96
|
-
grantDigest: Sha256Digest;
|
|
97
|
-
resolved: AgentCandidateResolvedModel;
|
|
98
|
-
reason: 'completed' | 'failed' | 'timeout' | 'replayed' | 'preparation-failed' | 'abandoned';
|
|
99
|
-
}): Promise<AgentCandidateProtectedModelSettlement>;
|
|
100
|
-
}
|
|
101
|
-
/** Limits mechanically enforced by the evaluator-owned model gateway. */
|
|
102
|
-
type AgentCandidateModelLimits = Pick<AgentCandidateExecutionLimits, 'maxModelCalls' | 'maxInputTokens' | 'maxOutputTokens' | 'maxCostUsd'>;
|
|
103
|
-
interface AgentCandidateProtectedModelReservation {
|
|
104
|
-
preparationId: string;
|
|
105
|
-
digest: Sha256Digest;
|
|
106
|
-
/** Evaluator service must expire and revoke this reservation at this epoch millisecond. */
|
|
107
|
-
expiresAtMs: number;
|
|
108
|
-
/** The gateway must stop calls before any one of these limits is exceeded. */
|
|
109
|
-
enforcedLimits: AgentCandidateModelLimits;
|
|
110
|
-
/** Exact public endpoint exception; every other candidate destination stays blocked. */
|
|
111
|
-
network: AgentCandidateModelAccessNetwork;
|
|
112
|
-
}
|
|
113
|
-
interface AgentCandidateProtectedModelActivation {
|
|
114
|
-
/** Injected only into the trusted executor after all pre-launch checks pass. */
|
|
115
|
-
env: Readonly<Record<string, string>>;
|
|
116
|
-
}
|
|
117
|
-
interface AgentCandidateProtectedModelSettlement {
|
|
118
|
-
preparationId: string;
|
|
119
|
-
grantDigest: Sha256Digest;
|
|
120
|
-
closed: true;
|
|
121
|
-
calls: readonly AgentCandidateModelSettlementCall[];
|
|
122
|
-
}
|
|
123
|
-
interface AgentCandidateMemoryResetResult {
|
|
124
|
-
preparationId: string;
|
|
125
|
-
accessDigest: Sha256Digest;
|
|
126
|
-
expiresAtMs: number;
|
|
127
|
-
evidence: AgentCandidateCapturedArtifact;
|
|
128
|
-
emptyStateDigest: Sha256Digest;
|
|
129
|
-
beforeState: AgentCandidateWorkspaceSnapshotEvidence;
|
|
130
|
-
}
|
|
131
|
-
interface AgentCandidateMemoryPort {
|
|
132
|
-
/**
|
|
133
|
-
* Reset and reserve exact task memory without returning live access.
|
|
134
|
-
* The service must scope the reservation to `preparationId`, automatically
|
|
135
|
-
* revoke it at `expiresAtMs`, and never reuse it for another preparation.
|
|
136
|
-
*/
|
|
137
|
-
reset(input: {
|
|
138
|
-
executionId: string;
|
|
139
|
-
preparationId: string;
|
|
140
|
-
expiresAtMs: number;
|
|
141
|
-
effectiveNamespace: string;
|
|
142
|
-
seed?: Uint8Array;
|
|
143
|
-
seedDigest?: Sha256Digest;
|
|
144
|
-
}): Promise<AgentCandidateMemoryResetResult>;
|
|
145
|
-
/**
|
|
146
|
-
* Create live scoped access only after the execution attempt is durably claimed.
|
|
147
|
-
* Activation must match the exact preparation/access pair and may not extend expiry.
|
|
148
|
-
*/
|
|
149
|
-
activate(input: {
|
|
150
|
-
executionId: string;
|
|
151
|
-
preparationId: string;
|
|
152
|
-
accessDigest: Sha256Digest;
|
|
153
|
-
effectiveNamespace: string;
|
|
154
|
-
deadlineAtMs: number;
|
|
155
|
-
}): Promise<{
|
|
156
|
-
env: Readonly<Record<string, string>>;
|
|
157
|
-
}>;
|
|
158
|
-
/**
|
|
159
|
-
* Revoke evaluator-owned access after process death or a failed preparation.
|
|
160
|
-
* Must be idempotent and concurrency-safe for the exact preparation/access
|
|
161
|
-
* pair and must never close a different preparation.
|
|
162
|
-
*/
|
|
163
|
-
close(input: {
|
|
164
|
-
executionId: string;
|
|
165
|
-
preparationId: string;
|
|
166
|
-
accessDigest: Sha256Digest;
|
|
167
|
-
effectiveNamespace: string;
|
|
168
|
-
reason: 'completed' | 'failed' | 'timeout' | 'replayed' | 'preparation-failed' | 'abandoned';
|
|
169
|
-
}): Promise<{
|
|
170
|
-
closed: true;
|
|
171
|
-
}>;
|
|
172
|
-
}
|
|
173
|
-
interface AgentCandidateExecutionPorts extends AgentCandidateVerificationPorts {
|
|
174
|
-
workspaces: AgentCandidateWorkspacePort;
|
|
175
|
-
containers: AgentCandidateContainerPort;
|
|
176
|
-
models: AgentCandidateModelPort;
|
|
177
|
-
memory: AgentCandidateMemoryPort;
|
|
178
|
-
}
|
|
179
|
-
/** Runtime placement for one exact cell from a signed candidate experiment. */
|
|
180
|
-
interface AgentCandidateTaskExecution {
|
|
181
|
-
executionId: string;
|
|
182
|
-
runCell: AgentCandidateRunCell;
|
|
183
|
-
benchmarkSuite: AgentCandidateBenchmarkSuite;
|
|
184
|
-
task: AgentCandidateBenchmarkTask;
|
|
185
|
-
/** Absolute paths inside the evaluator-owned execution environment. */
|
|
186
|
-
executionRoots: {
|
|
187
|
-
taskRoot: string;
|
|
188
|
-
candidateRoot?: string;
|
|
189
|
-
};
|
|
190
|
-
/** Host-side staging roots. These are verified but never signed as container paths. */
|
|
191
|
-
stagingRoots: {
|
|
192
|
-
taskRoot: string;
|
|
193
|
-
candidateRoot?: string;
|
|
194
|
-
profileRoot: string;
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
interface VerifiedAgentCandidate {
|
|
198
|
-
readonly bundle: AgentCandidateBundle;
|
|
199
|
-
readonly materializedTree?: string;
|
|
200
|
-
readonly [verifiedCandidateBrand]: true;
|
|
201
|
-
}
|
|
202
|
-
interface CanonicalCandidateDocument<T> {
|
|
203
|
-
readonly value: T;
|
|
204
|
-
/** Canonical UTF-8 bytes of `value` with its top-level digest omitted. */
|
|
205
|
-
readonly bytes: Uint8Array;
|
|
206
|
-
readonly digest: Sha256Digest;
|
|
207
|
-
}
|
|
208
|
-
interface PreparedAgentCandidateLaunch {
|
|
209
|
-
executable: string;
|
|
210
|
-
/** Complete fixed argv, including profile materializer flags but excluding task delivery. */
|
|
211
|
-
args: readonly string[];
|
|
212
|
-
env: Readonly<Record<string, string>>;
|
|
213
|
-
/** Informational subset already present at the tail of `args`; executors must not append twice. */
|
|
214
|
-
flags: readonly string[];
|
|
215
|
-
cwd: string;
|
|
216
|
-
}
|
|
217
|
-
interface PreparedAgentCandidateInstruction {
|
|
218
|
-
bytes: Uint8Array;
|
|
219
|
-
delivery: AgentCandidateInstructionDelivery;
|
|
220
|
-
}
|
|
221
|
-
/** Exact file-backed knowledge admitted by the candidate bundle. */
|
|
222
|
-
interface PreparedAgentCandidateKnowledge {
|
|
223
|
-
readonly candidate: AgentCandidateKnowledgeRef;
|
|
224
|
-
readonly snapshot: AgentCandidateWorkspaceSnapshotEvidence;
|
|
225
|
-
readonly files: readonly AgentCandidateExecutorWorkspaceFile[];
|
|
226
|
-
readonly retrievalConfig?: Uint8Array;
|
|
227
|
-
}
|
|
228
|
-
interface PreparedAgentCandidateTrace {
|
|
229
|
-
runId: string;
|
|
230
|
-
tags: Readonly<Record<string, string>>;
|
|
231
|
-
env: Readonly<Record<string, string>>;
|
|
232
|
-
}
|
|
233
|
-
interface PreparedAgentCandidateExecution {
|
|
234
|
-
readonly bundle: AgentCandidateBundle;
|
|
235
|
-
readonly benchmark: {
|
|
236
|
-
readonly suite: AgentCandidateBenchmarkSuite;
|
|
237
|
-
readonly task: AgentCandidateBenchmarkTask;
|
|
238
|
-
};
|
|
239
|
-
readonly executionId: string;
|
|
240
|
-
readonly roots: {
|
|
241
|
-
execution: {
|
|
242
|
-
taskRoot: string;
|
|
243
|
-
candidateRoot?: string;
|
|
244
|
-
};
|
|
245
|
-
staging: {
|
|
246
|
-
taskRoot: string;
|
|
247
|
-
candidateRoot?: string;
|
|
248
|
-
profileRoot: string;
|
|
249
|
-
};
|
|
250
|
-
};
|
|
251
|
-
readonly profilePlan: {
|
|
252
|
-
value: AgentCandidateProfilePlanEvidence;
|
|
253
|
-
bytes: Uint8Array;
|
|
254
|
-
written: readonly string[];
|
|
255
|
-
};
|
|
256
|
-
readonly profileActivation: AgentCandidateProfileActivation;
|
|
257
|
-
readonly executionPlan: {
|
|
258
|
-
value: AgentCandidateExecutionPlanEvidence;
|
|
259
|
-
bytes: Uint8Array;
|
|
260
|
-
};
|
|
261
|
-
readonly materializationReceipt: CanonicalCandidateDocument<AgentCandidateMaterializationReceipt>;
|
|
262
|
-
readonly launch: PreparedAgentCandidateLaunch;
|
|
263
|
-
readonly instruction: PreparedAgentCandidateInstruction;
|
|
264
|
-
readonly resolvedModel: AgentCandidateResolvedModel;
|
|
265
|
-
readonly knowledge?: PreparedAgentCandidateKnowledge;
|
|
266
|
-
readonly trace: PreparedAgentCandidateTrace;
|
|
267
|
-
readonly memory: AgentCandidateEffectiveMemory;
|
|
268
|
-
readonly [preparedCandidateBrand]: true;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
interface AgentCandidateProtectedRunCapture {
|
|
272
|
-
executionId: string;
|
|
273
|
-
termination: AgentCandidateTermination;
|
|
274
|
-
}
|
|
275
|
-
/** Raw evaluator capture made only after the candidate process is dead. */
|
|
276
|
-
type AgentCandidateExecutorTaskOutcomeCapture = {
|
|
277
|
-
readonly kind: 'workspace';
|
|
278
|
-
/** Claimed final tree. The runtime recomputes it independently from `gitDiff`. */
|
|
279
|
-
readonly resultTree: string;
|
|
280
|
-
/** Complete evaluator-captured workspace description after candidate execution. */
|
|
281
|
-
readonly afterState: AgentCandidateWorkspaceManifestMaterial;
|
|
282
|
-
/** Reproducible workspace archive corresponding to `afterState`. */
|
|
283
|
-
readonly archive: Uint8Array;
|
|
284
|
-
/** Exact binary patch from the signed task base to `afterState`. */
|
|
285
|
-
readonly gitDiff: Uint8Array;
|
|
286
|
-
} | {
|
|
287
|
-
readonly kind: 'output';
|
|
288
|
-
/** Exact evaluator-captured final output bytes. */
|
|
289
|
-
readonly bytes: Uint8Array;
|
|
290
|
-
};
|
|
291
|
-
/** Raw isolated-memory capture made only after access has been revoked. */
|
|
292
|
-
interface AgentCandidateExecutorMemoryCapture {
|
|
293
|
-
readonly afterState: AgentCandidateWorkspaceManifestMaterial;
|
|
294
|
-
readonly archive: Uint8Array;
|
|
295
|
-
}
|
|
296
|
-
/** Replayable evaluator result captured only after process death and trace drain. */
|
|
297
|
-
interface AgentCandidateExecutorFinalCapture {
|
|
298
|
-
readonly taskOutcome?: AgentCandidateExecutorTaskOutcomeCapture;
|
|
299
|
-
/** Required only when the prepared candidate uses isolated task memory. */
|
|
300
|
-
readonly memoryAfter?: AgentCandidateExecutorMemoryCapture;
|
|
301
|
-
/** Executor-native bytes preserved when a fresh worker cannot reconstruct a verified outcome. */
|
|
302
|
-
readonly evidence?: Uint8Array;
|
|
303
|
-
}
|
|
304
|
-
type PersistedTaskOutcomeEvidence<Kind extends AgentCandidateTaskOutcomeMaterial['outcome']['kind']> = Omit<AgentCandidateTaskOutcomeEvidence, 'material'> & {
|
|
305
|
-
readonly artifact: AgentCandidateArtifactRef;
|
|
306
|
-
readonly material: Omit<AgentCandidateTaskOutcomeMaterial, 'outcome'> & {
|
|
307
|
-
readonly outcome: Extract<AgentCandidateTaskOutcomeMaterial['outcome'], {
|
|
308
|
-
kind: Kind;
|
|
309
|
-
}>;
|
|
310
|
-
};
|
|
311
|
-
};
|
|
312
|
-
/** Branded task outcome that has survived independent evaluator verification. */
|
|
313
|
-
type VerifiedAgentCandidateTaskOutcome = {
|
|
314
|
-
readonly kind: 'workspace';
|
|
315
|
-
readonly evidence: PersistedTaskOutcomeEvidence<'workspace'>;
|
|
316
|
-
readonly patch: Uint8Array;
|
|
317
|
-
readonly [verifiedTaskOutcomeBrand]: true;
|
|
318
|
-
} | {
|
|
319
|
-
readonly kind: 'output';
|
|
320
|
-
readonly evidence: PersistedTaskOutcomeEvidence<'output'>;
|
|
321
|
-
readonly spec: AgentCandidateTaskOutputSpec;
|
|
322
|
-
readonly bytes: Uint8Array;
|
|
323
|
-
readonly [verifiedTaskOutcomeBrand]: true;
|
|
324
|
-
};
|
|
325
|
-
/**
|
|
326
|
-
* Evaluator-owned executable grader, pinned by immutable implementation bytes.
|
|
327
|
-
*
|
|
328
|
-
* `run` is an isolation boundary, not an arbitrary scoring callback. The
|
|
329
|
-
* implementation admitted to that boundary is supplied by the runtime after
|
|
330
|
-
* artifact verification. Implementations must derive every returned binding
|
|
331
|
-
* digest from the bytes and task outcome they actually admitted, rather than
|
|
332
|
-
* copying an expected digest from ambient configuration.
|
|
333
|
-
*/
|
|
334
|
-
interface AgentCandidateBenchmarkGraderPort {
|
|
335
|
-
readonly name: string;
|
|
336
|
-
readonly version: string;
|
|
337
|
-
readonly artifact: AgentCandidateArtifactRef;
|
|
338
|
-
run(input: {
|
|
339
|
-
readonly executionId: string;
|
|
340
|
-
readonly termination: AgentCandidateTermination;
|
|
341
|
-
readonly outcome: VerifiedAgentCandidateTaskOutcome;
|
|
342
|
-
/** Exact verified artifact bytes. Each read returns a detached copy. */
|
|
343
|
-
readonly implementation: {
|
|
344
|
-
readonly byteLength: number;
|
|
345
|
-
readonly bytes: Uint8Array;
|
|
346
|
-
};
|
|
347
|
-
/** Frozen result deadline; runners must stop work and side effects when aborted. */
|
|
348
|
-
readonly signal: AbortSignal;
|
|
349
|
-
}): Promise<{
|
|
350
|
-
readonly evaluation: BenchmarkEvaluation;
|
|
351
|
-
/** Raw grader output needed to audit or reproduce the normalized result. */
|
|
352
|
-
readonly evidence: Uint8Array;
|
|
353
|
-
/** Runtime-checked binding between admitted code, task input, and raw output. */
|
|
354
|
-
readonly binding: {
|
|
355
|
-
/** Digest computed from the implementation bytes admitted to execution. */
|
|
356
|
-
readonly implementationDigest: Sha256Digest;
|
|
357
|
-
/** Digest of the exact runtime-verified task outcome graded by this run. */
|
|
358
|
-
readonly taskOutcomeDigest: Sha256Digest;
|
|
359
|
-
/** Digest computed from `evidence` before it leaves the execution boundary. */
|
|
360
|
-
readonly outputDigest: Sha256Digest;
|
|
361
|
-
};
|
|
362
|
-
}>;
|
|
363
|
-
}
|
|
364
|
-
/** One detached request passed to the trusted environment-specific executor. */
|
|
365
|
-
interface AgentCandidateExecutorRequest {
|
|
366
|
-
readonly executionId: string;
|
|
367
|
-
readonly benchmark: PreparedAgentCandidateExecution['benchmark'];
|
|
368
|
-
/** Immutable bytes from which the executor creates fresh isolated workspaces. */
|
|
369
|
-
readonly inputs: {
|
|
370
|
-
readonly task: AgentCandidateExecutorWorkspaceInput;
|
|
371
|
-
readonly candidate?: AgentCandidateExecutorWorkspaceInput;
|
|
372
|
-
readonly profile: {
|
|
373
|
-
readonly files: readonly AgentCandidateExecutorProfileFile[];
|
|
374
|
-
};
|
|
375
|
-
};
|
|
376
|
-
readonly roots: PreparedAgentCandidateExecution['roots']['execution'];
|
|
377
|
-
readonly profilePlan: PreparedAgentCandidateExecution['profilePlan'];
|
|
378
|
-
readonly profileActivation: AgentCandidateProfileActivation;
|
|
379
|
-
readonly executionPlan: PreparedAgentCandidateExecution['executionPlan'];
|
|
380
|
-
readonly materializationReceipt: CanonicalCandidateDocument<AgentCandidateMaterializationReceipt>;
|
|
381
|
-
readonly launch: PreparedAgentCandidateLaunch;
|
|
382
|
-
readonly instruction: PreparedAgentCandidateInstruction;
|
|
383
|
-
readonly resolvedModel: AgentCandidateResolvedModel;
|
|
384
|
-
/** Mechanically enforced by the runtime plus executor process-death acknowledgement. */
|
|
385
|
-
readonly hardLimits: Pick<AgentCandidateExecutionLimits, 'timeoutMs'>;
|
|
386
|
-
/** Validity bound checked against protected traces; generic black-box executors cannot preempt it. */
|
|
387
|
-
readonly observedLimits: Pick<AgentCandidateExecutionLimits, 'maxSteps'>;
|
|
388
|
-
readonly knowledge?: PreparedAgentCandidateKnowledge;
|
|
389
|
-
readonly trace: PreparedAgentCandidateTrace;
|
|
390
|
-
readonly memory: AgentCandidateEffectiveMemory;
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* Executes one prepared request inside an evaluator-owned isolation boundary.
|
|
394
|
-
*
|
|
395
|
-
* `request.launch.env` is the complete allowlisted environment, including
|
|
396
|
-
* protected model, memory, and trace bindings. Implementations must not merge
|
|
397
|
-
* ambient host variables into it. The returned capture deliberately contains
|
|
398
|
-
* no candidate-authored usage or score fields.
|
|
399
|
-
*/
|
|
400
|
-
interface AgentCandidateExecutorPort {
|
|
401
|
-
execute(request: AgentCandidateExecutorRequest, context: {
|
|
402
|
-
traceStore: TraceStore;
|
|
403
|
-
/** Aborted by the runtime at the exact frozen wall-time deadline. */
|
|
404
|
-
signal: AbortSignal;
|
|
405
|
-
/** Absolute epoch-millisecond deadline owned by the runtime. */
|
|
406
|
-
deadlineAtMs: number;
|
|
407
|
-
}): Promise<AgentCandidateProtectedRunCapture>;
|
|
408
|
-
/** Kill the exact process/container and drain trace writes. Must be idempotent. */
|
|
409
|
-
stop(request: AgentCandidateExecutorStopRequest, context: {
|
|
410
|
-
traceStore: TraceStore;
|
|
411
|
-
reason: 'completed' | 'failed' | 'timeout';
|
|
412
|
-
/** Aborted at the frozen execution deadline or evaluator cleanup deadline. */
|
|
413
|
-
signal: AbortSignal;
|
|
414
|
-
/** Absolute execution deadline; a later stop acknowledgement cannot produce success. */
|
|
415
|
-
deadlineAtMs: number;
|
|
416
|
-
}): Promise<{
|
|
417
|
-
readonly stopped: true;
|
|
418
|
-
}>;
|
|
419
|
-
/** Capture immutable final evidence after stop. Must be replayable by a fresh worker. */
|
|
420
|
-
capture(request: AgentCandidateExecutorStopRequest, context: {
|
|
421
|
-
traceStore: TraceStore;
|
|
422
|
-
/** Aborted at the frozen execution deadline or evaluator cleanup deadline. */
|
|
423
|
-
signal: AbortSignal;
|
|
424
|
-
}): Promise<AgentCandidateExecutorFinalCapture>;
|
|
425
|
-
/** Remove evaluator-owned execution resources after final capture. Must be idempotent. */
|
|
426
|
-
dispose?(request: AgentCandidateExecutorStopRequest, context: {
|
|
427
|
-
signal: AbortSignal;
|
|
428
|
-
}): Promise<{
|
|
429
|
-
readonly disposed: true;
|
|
430
|
-
}>;
|
|
431
|
-
}
|
|
432
|
-
/** Opaque process identity used for termination without re-exposing launch credentials. */
|
|
433
|
-
interface AgentCandidateExecutorStopRequest {
|
|
434
|
-
readonly executionId: string;
|
|
435
|
-
readonly executionPlanDigest: Sha256Digest;
|
|
436
|
-
}
|
|
437
|
-
interface AgentCandidateExecutorWorkspaceInput {
|
|
438
|
-
readonly snapshot: AgentCandidateWorkspaceSnapshotEvidence;
|
|
439
|
-
readonly files: readonly AgentCandidateExecutorWorkspaceFile[];
|
|
440
|
-
}
|
|
441
|
-
interface AgentCandidateExecutorWorkspaceFile {
|
|
442
|
-
readonly path: string;
|
|
443
|
-
readonly mode: number;
|
|
444
|
-
readonly bytes: Uint8Array;
|
|
445
|
-
}
|
|
446
|
-
/** One exact profile file supplied to an evaluator-owned executor. */
|
|
447
|
-
interface AgentCandidateExecutorProfileFile {
|
|
448
|
-
readonly path: string;
|
|
449
|
-
readonly mode: number;
|
|
450
|
-
readonly bytes: Uint8Array;
|
|
451
|
-
}
|
|
452
|
-
type AgentCandidateRunFinalization = {
|
|
453
|
-
succeeded: true;
|
|
454
|
-
receipt: CanonicalCandidateDocument<AgentCandidateRunReceipt>;
|
|
455
|
-
artifacts: {
|
|
456
|
-
executorCapture: AgentCandidateArtifactRef;
|
|
457
|
-
modelSettlement: AgentCandidateArtifactRef;
|
|
458
|
-
taskOutcome: AgentCandidateArtifactRef;
|
|
459
|
-
benchmarkResult: AgentCandidateArtifactRef;
|
|
460
|
-
runReceipt: AgentCandidateArtifactRef;
|
|
461
|
-
};
|
|
462
|
-
} | {
|
|
463
|
-
succeeded: false;
|
|
464
|
-
reason: string;
|
|
465
|
-
partial: {
|
|
466
|
-
executionId: string;
|
|
467
|
-
bundleDigest: Sha256Digest;
|
|
468
|
-
executionPlanDigest: Sha256Digest;
|
|
469
|
-
materializationReceiptDigest: Sha256Digest;
|
|
470
|
-
termination?: AgentCandidateTermination;
|
|
471
|
-
};
|
|
472
|
-
/** Independent evaluator-gateway usage, even when execution or trace capture failed. */
|
|
473
|
-
usage: AgentCandidateFixedSpend | null;
|
|
474
|
-
};
|
|
475
|
-
/** Protected trace tags that bind a run to one prepared candidate execution. */
|
|
476
|
-
declare const CANDIDATE_TRACE_TAGS: {
|
|
477
|
-
readonly executionId: "tangle.candidate.execution_id";
|
|
478
|
-
readonly bundleDigest: "tangle.candidate.bundle_digest";
|
|
479
|
-
readonly executionPlanDigest: "tangle.candidate.execution_plan_digest";
|
|
480
|
-
readonly materializationReceiptDigest: "tangle.candidate.materialization_receipt_digest";
|
|
481
|
-
};
|
|
482
|
-
/** Environment keys used to propagate immutable candidate trace identity. */
|
|
483
|
-
declare const CANDIDATE_TRACE_ENV: {
|
|
484
|
-
readonly executionId: "TANGLE_CANDIDATE_EXECUTION_ID";
|
|
485
|
-
readonly bundleDigest: "TANGLE_CANDIDATE_BUNDLE_DIGEST";
|
|
486
|
-
readonly executionPlanDigest: "TANGLE_CANDIDATE_EXECUTION_PLAN_DIGEST";
|
|
487
|
-
readonly materializationReceiptDigest: "TANGLE_CANDIDATE_MATERIALIZATION_RECEIPT_DIGEST";
|
|
488
|
-
readonly traceRunId: "TANGLE_TRACE_RUN_ID";
|
|
489
|
-
};
|
|
490
|
-
|
|
491
|
-
export { type AgentCandidateExecutorPort as A, type AgentCandidateWorkspacePort as B, CANDIDATE_TRACE_ENV as C, CANDIDATE_TRACE_TAGS as D, type CanonicalCandidateDocument as E, type PreparedAgentCandidateInstruction as F, type PreparedAgentCandidateKnowledge as G, type PreparedAgentCandidateLaunch as H, type PreparedAgentCandidateTrace as I, type VerifiedAgentCandidateTaskOutcome as J, type PreparedAgentCandidateExecution as P, type ResolvedAgentCandidateContainer as R, type VerifiedAgentCandidate as V, type AgentCandidateBenchmarkGraderPort as a, type AgentCandidateOutputArtifactPort as b, type AgentCandidateRunFinalization as c, type AgentCandidateTaskExecution as d, type AgentCandidateExecutionPorts as e, type AgentCandidateModelPort as f, type AgentCandidateProtectedModelReservation as g, type AgentCandidateProtectedModelActivation as h, type AgentCandidateProtectedModelSettlement as i, type AgentCandidateArtifactPort as j, type AgentCandidateContainerPort as k, type AgentCandidateExecutorFinalCapture as l, type AgentCandidateExecutorMemoryCapture as m, type AgentCandidateExecutorProfileFile as n, type AgentCandidateExecutorRequest as o, type AgentCandidateExecutorStopRequest as p, type AgentCandidateExecutorTaskOutcomeCapture as q, type AgentCandidateExecutorWorkspaceFile as r, type AgentCandidateExecutorWorkspaceInput as s, type AgentCandidateMemoryPort as t, type AgentCandidateMemoryResetResult as u, type AgentCandidateModelLimits as v, type AgentCandidateOutputPurpose as w, type AgentCandidateProtectedRunCapture as x, type AgentCandidateRepositoryPort as y, type AgentCandidateVerificationPorts as z };
|