@tangle-network/agent-runtime 0.196.0 → 0.198.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 +1 -2
- package/dist/{activation-BxMZybuo.js → activation-CwdO0ml2.js} +2 -2
- package/dist/{activation-BxMZybuo.js.map → activation-CwdO0ml2.js.map} +1 -1
- package/dist/{improve-DZs0KXhK.d.ts → activation-DFRTurvU.d.ts} +99 -5
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -2
- package/dist/candidate-execution/index.d.ts +370 -2
- package/dist/candidate-execution/index.js +828 -4
- package/dist/candidate-execution/index.js.map +1 -0
- package/dist/{coordination-driver-zkCrfEbS.js → coordination-driver-Cf638-6q.js} +2 -5
- package/dist/{coordination-driver-zkCrfEbS.js.map → coordination-driver-Cf638-6q.js.map} +1 -1
- package/dist/{delegate-D7sonS78.js → delegate-Bez07Dlh.js} +2 -2
- package/dist/{delegate-D7sonS78.js.map → delegate-Bez07Dlh.js.map} +1 -1
- package/dist/durable.d.ts +110 -6
- package/dist/durable.js +404 -47
- package/dist/durable.js.map +1 -1
- package/dist/{graph-BuS-NxXD.js → graph-DBk3Unto.js} +3 -3
- package/dist/{graph-BuS-NxXD.js.map → graph-DBk3Unto.js.map} +1 -1
- package/dist/{improvement-cycle-Tw5nYT5R.js → improvement-cycle-Bma8TJs-.js} +8 -10
- package/dist/{improvement-cycle-Tw5nYT5R.js.map → improvement-cycle-Bma8TJs-.js.map} +1 -1
- package/dist/{index-CYOJsxSg.d.ts → index-D8LWK3Ha.d.ts} +6 -7
- package/dist/index.d.ts +694 -16
- package/dist/index.js +1780 -17
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +3 -7
- package/dist/intelligence.js +5 -6
- package/dist/intelligence.js.map +1 -1
- package/dist/kernel.d.ts +2 -5
- package/dist/kernel.js +8 -10
- package/dist/{loop-runner-bin-XKMc3Ld-.js → loop-runner-bin-Bd3dHQuw.js} +3 -3
- package/dist/{loop-runner-bin-XKMc3Ld-.js.map → loop-runner-bin-Bd3dHQuw.js.map} +1 -1
- package/dist/{loop-runner-bin-DwrSB04m.d.ts → loop-runner-bin-Bn-0o_4k.d.ts} +3 -3
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +2 -3
- package/dist/mcp/index.js +4 -5
- package/dist/mcp/index.js.map +1 -1
- package/dist/{prepare-DDGp0-rW.js → prepare-CAO1yXov.js} +2407 -2407
- package/dist/prepare-CAO1yXov.js.map +1 -0
- package/dist/{protected-model-port-DxFN8DLS.js → protected-model-port-B5avcRiQ.js} +2 -2
- package/dist/{protected-model-port-DxFN8DLS.js.map → protected-model-port-B5avcRiQ.js.map} +1 -1
- package/dist/{provision-supervisor-CpMMShE_.js → provision-supervisor-C97q5NN_.js} +3 -6
- package/dist/{provision-supervisor-CpMMShE_.js.map → provision-supervisor-C97q5NN_.js.map} +1 -1
- package/dist/{redact-Cbl2O-4N.js → redact-CVyxp2AU.js} +5232 -2525
- package/dist/redact-CVyxp2AU.js.map +1 -0
- package/dist/{runtime-DqRieJ6e.js → runtime-BrTBBSfC.js} +427 -23
- package/dist/runtime-BrTBBSfC.js.map +1 -0
- package/dist/{server-BjB6ay4N.js → server-CO4bvAwe.js} +4 -4
- package/dist/{server-BjB6ay4N.js.map → server-CO4bvAwe.js.map} +1 -1
- package/dist/{types-DFLZMaeh.d.ts → stream-agent-turn-CLOQr497.d.ts} +1986 -6
- package/dist/{structural-rollout-DPbZWgEm.js → structural-rollout-D__lmWXe.js} +1101 -8
- package/dist/structural-rollout-D__lmWXe.js.map +1 -0
- package/dist/{supervise-D9aNi8_f.js → supervise-KSe4JEcg.js} +30 -7
- package/dist/supervise-KSe4JEcg.js.map +1 -0
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +13 -13
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/dist/{workspace-archive-Ybomp7AN.js → workspace-archive-BMOnloFf.js} +3 -3
- package/dist/{workspace-archive-Ybomp7AN.js.map → workspace-archive-BMOnloFf.js.map} +1 -1
- package/package.json +4 -31
- package/dist/activation-DyWB0K6E.d.ts +0 -98
- package/dist/authored-code-URmkdgjv.js +0 -37
- package/dist/authored-code-URmkdgjv.js.map +0 -1
- package/dist/candidate-execution-nvqVIMyS.js +0 -829
- package/dist/candidate-execution-nvqVIMyS.js.map +0 -1
- package/dist/conversation-BxJ0SIBM.js +0 -1363
- package/dist/conversation-BxJ0SIBM.js.map +0 -1
- package/dist/conversation.d.ts +0 -2
- package/dist/conversation.js +0 -2
- package/dist/environment-provider-1fKZh2zl.js +0 -2281
- package/dist/environment-provider-1fKZh2zl.js.map +0 -1
- package/dist/environment-provider-B-I2jlQy.d.ts +0 -143
- package/dist/environment-provider.d.ts +0 -2
- package/dist/environment-provider.js +0 -2
- package/dist/graph.d.ts +0 -753
- package/dist/graph.js +0 -2111
- package/dist/graph.js.map +0 -1
- package/dist/index-CUosKU4N.d.ts +0 -372
- package/dist/index-D9mb6fn2.d.ts +0 -691
- package/dist/index-ZnxSe6iK.d.ts +0 -138
- package/dist/jsonl-file-BEpaEYjT.js +0 -141
- package/dist/jsonl-file-BEpaEYjT.js.map +0 -1
- package/dist/knowledge-CPzT_Ve7.js +0 -428
- package/dist/knowledge-CPzT_Ve7.js.map +0 -1
- package/dist/knowledge.d.ts +0 -2
- package/dist/knowledge.js +0 -2
- package/dist/materialization-Cy0oM8tb.js +0 -672
- package/dist/materialization-Cy0oM8tb.js.map +0 -1
- package/dist/prepare-DDGp0-rW.js.map +0 -1
- package/dist/primeintellect/index.d.ts +0 -218
- package/dist/primeintellect/index.js +0 -739
- package/dist/primeintellect/index.js.map +0 -1
- package/dist/redact-Cbl2O-4N.js.map +0 -1
- package/dist/runtime-0xNaV6TJ.d.ts +0 -1699
- package/dist/runtime-DqRieJ6e.js.map +0 -1
- package/dist/stream-agent-turn-Dt5mZpc3.js +0 -1103
- package/dist/stream-agent-turn-Dt5mZpc3.js.map +0 -1
- package/dist/stream-agent-turn-urHpmO_Z.d.ts +0 -160
- package/dist/structural-rollout-DPbZWgEm.js.map +0 -1
- package/dist/supervise-D9aNi8_f.js.map +0 -1
|
@@ -1,4 +1,372 @@
|
|
|
1
1
|
import { A as AgentCandidateWorkspacePort, B as ResolvedAgentCandidateContainer, C as AgentCandidateProtectedModelSettlement, D as AgentCandidateRunFinalization, E as AgentCandidateRepositoryPort, F as PreparedAgentCandidateExecution, H as VerifiedAgentCandidateTaskOutcome, I as PreparedAgentCandidateInstruction, L as PreparedAgentCandidateKnowledge, M as CANDIDATE_TRACE_TAGS, N as CanonicalCandidateDocument, O as AgentCandidateTaskExecution, P as PersistedTaskOutcomeEvidence, R as PreparedAgentCandidateLaunch, S as AgentCandidateProtectedModelReservation, T as AgentCandidateProtectedRunCapture, U as AgentCandidateExecutionRoots, V as VerifiedAgentCandidate, _ as AgentCandidateModelLimits, a as AgentCandidateExecutionPorts, b as AgentCandidateOutputPurpose, c as AgentCandidateExecutorPort, d as AgentCandidateExecutorStopRequest, f as AgentCandidateExecutorTaskOutcomeCapture, g as AgentCandidateMemoryResetResult, h as AgentCandidateMemoryPort, i as AgentCandidateContainerPort, j as CANDIDATE_TRACE_ENV, k as AgentCandidateVerificationPorts, l as AgentCandidateExecutorProfileFile, m as AgentCandidateExecutorWorkspaceInput, n as AgentCandidateBenchmarkGraderIdentity, o as AgentCandidateExecutorFinalCapture, p as AgentCandidateExecutorWorkspaceFile, r as AgentCandidateBenchmarkGraderPort, s as AgentCandidateExecutorMemoryCapture, t as AgentCandidateArtifactPort, u as AgentCandidateExecutorRequest, v as AgentCandidateModelPort, w as AgentCandidateProtectedModelSettlementCall, x as AgentCandidateProtectedModelActivation, y as AgentCandidateOutputArtifactPort, z as PreparedAgentCandidateTrace } from "../types-1s_29INY.js";
|
|
2
|
-
import { A as ExactProcessCandidateExecutorOptions, B as buildAgentCandidateBundle, C as RunProtectedAgentCandidateModelGrantOptions, D as CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, E as persistCandidateOutputArtifact, F as FileAgentCandidateExecutionClaimStoreOptions, G as candidateWorkspaceManifest, H as sealAgentCandidateBundle, I as AgentCandidateCodeSource, K as scanMaterializedWorkspaceManifest, L as AgentCandidateCodeSurfaceSource, M as DisposePreparedAgentCandidateOptions, N as disposePreparedAgentCandidateExecution, O as CANDIDATE_KNOWLEDGE_ROOT_ENV, P as FileAgentCandidateExecutionClaimStore, R as AgentCandidateProfileSource, S as ProtectedAgentCandidateModelGrantContext, T as runProtectedAgentCandidateModelGrant, U as WorkspaceScanLimits, V as AgentCandidateBundleInput, W as WorkspaceScanOptions, _ as AGENT_CANDIDATE_EXECUTION_SUPPORT, a as WorkspaceTreeEntryPolicy, b as recoverExpiredAgentCandidateExecution, c as describeWorkspaceTree, d as CaptureAgentCandidateWorkspaceOptions, f as CapturedAgentCandidateWorkspace, g as createAgentCandidateWorkspacePort, h as captureAgentCandidateWorkspaceFiles, i as WorkspaceTreeDescriptor, j as exactProcessProviderAsCandidateExecutor, k as candidateKnowledgeExecutionPaths, l as seedWorkspaceTree, m as captureAgentCandidateWorkspace, n as SeedWorkspaceTreeInput, o as WorkspaceTreeExclusion, p as CreateAgentCandidateWorkspacePortOptions, q as verifyMaterializedWorkspace, r as WorkspaceTreeAlgorithm, s as WorkspaceTreeExclusionReason, t as DescribeWorkspaceTreeOptions, u as AgentCandidateWorkspaceArchiveLimits, v as verifyAgentCandidateBundle, w as RunProtectedAgentCandidateModelGrantResult, x as AgentCandidateModelGrantRunReservationInput, y as RecoverExpiredAgentCandidateOptions, z as BuildAgentCandidateBundleInput } from "../index-CUosKU4N.js";
|
|
3
2
|
import { A as AgentCandidateExecutionPhase, B as AgentCandidatePreparationEvidence, C as AgentCandidateExecutionClaim, D as AgentCandidateExecutionFailureClass, E as AgentCandidateExecutionCleanupHandles, F as AgentCandidateExecutionTerminalResult, I as AgentCandidateRetryRejection, L as InMemoryAgentCandidateExecutionClaimStore, M as AgentCandidateExecutionRecoveryEvidence, N as AgentCandidateExecutionStageResult, O as AgentCandidateExecutionFinishResult, P as AgentCandidateExecutionTerminalRecord, R as InMemoryAgentCandidateExecutionClaimStoreOptions, S as AgentCandidateExecutionAttemptRef, T as AgentCandidateExecutionClaimStore, _ as PrepareAgentCandidateExecutionOptions, a as AgentCandidateModelGrantSettleInput, b as executePreparedAgentCandidate, c as agentCandidateProfileAsAgentProfile, d as freezeGenericAgentCandidateProfile, f as omitUndefinedObjectFields, g as parseExactCandidateProfile, h as parseExactAgentProfileDiff, i as AgentCandidateModelGrantReserveInput, j as AgentCandidateExecutionPhaseResult, k as AgentCandidateExecutionLease, l as applyExactAgentProfileDiff, m as parseExactAgentProfile, n as AgentCandidateModelGrantClient, o as CreateProtectedAgentCandidateModelPortOptions, r as AgentCandidateModelGrantReservation, s as createProtectedAgentCandidateModelPort, t as AgentCandidateModelGrantActivateInput, u as assertCandidateProfileBinding, v as prepareAgentCandidateExecution, w as AgentCandidateExecutionClaimResult, x as AgentCandidateExecutionAttemptRecord, y as ExecutePreparedAgentCandidateOptions, z as candidateExecutionClaim } from "../protected-model-port-BtXp2dUY.js";
|
|
4
|
-
|
|
3
|
+
import { AgentCandidateArtifactRef, AgentCandidateBundle, AgentCandidateCapturedArtifact, AgentCandidateCodeDisabled, AgentCandidateCodeNoOp, AgentCandidateExecution, AgentCandidateGitHubRepository, AgentCandidateKnowledge, AgentCandidateMemoryPolicy, AgentCandidateProfile, AgentCandidateResolvedModel, AgentCandidateRunCell, AgentCandidateWorkspaceManifestMaterial, AgentCandidateWorkspaceSnapshotEvidence, AgentProfile, AgentProfileDiff, Sha256Digest } from "@tangle-network/agent-interface";
|
|
4
|
+
import { TraceStore } from "@tangle-network/agent-eval";
|
|
5
|
+
import { CodeSurface } from "@tangle-network/agent-eval/campaign";
|
|
6
|
+
import { AgentEnvironmentProvider, AgentExactProcessResources } from "@tangle-network/agent-interface/environment-provider";
|
|
7
|
+
//#region src/candidate-execution/artifacts.d.ts
|
|
8
|
+
/** The per-scan caps a bounded capture applies. */
|
|
9
|
+
interface WorkspaceScanLimits {
|
|
10
|
+
readonly maxFiles: number;
|
|
11
|
+
readonly maxFileBytes: number;
|
|
12
|
+
readonly maxTotalFileBytes: number;
|
|
13
|
+
}
|
|
14
|
+
/** What a workspace scan reads and how it records a file's permission bits. */
|
|
15
|
+
interface WorkspaceScanOptions {
|
|
16
|
+
readonly ignoredProtectedRootEntries?: readonly ('.git' | '.sidecar')[];
|
|
17
|
+
readonly limits?: WorkspaceScanLimits;
|
|
18
|
+
/**
|
|
19
|
+
* Record Git's two file modes instead of the filesystem's exact permission bits: `0o755` when
|
|
20
|
+
* any execute bit is set, `0o644` otherwise. A checkout umask then cannot move a manifest
|
|
21
|
+
* digest, while a real permission change still does.
|
|
22
|
+
*
|
|
23
|
+
* This is the normalization `readCandidateGitTreeFiles` already applies to a Git tree
|
|
24
|
+
* (`100644`/`100755`), so one tree scanned from disk and the same tree read out of Git produce
|
|
25
|
+
* the same manifest. Off by default: the flag changes the digest, so a capture and the verify
|
|
26
|
+
* that checks it must agree on it.
|
|
27
|
+
*/
|
|
28
|
+
readonly portableTree?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Refuse a materialized workspace whose files, modes, or bytes are not the signed manifest.
|
|
32
|
+
*
|
|
33
|
+
* The scan streams, so the size of the largest file does not decide whether the check can run, and
|
|
34
|
+
* the refusal names the one mismatch a caller can produce on its own: a capture and a verify that
|
|
35
|
+
* disagree about `portableTree`.
|
|
36
|
+
*/
|
|
37
|
+
declare function verifyMaterializedWorkspace(root: string, expected: AgentCandidateWorkspaceManifestMaterial, options?: Omit<WorkspaceScanOptions, 'limits'>): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* The canonical manifest of one materialized workspace, read without holding any file.
|
|
40
|
+
*
|
|
41
|
+
* Every file is digested by streaming, so the size of the largest file does not decide whether the
|
|
42
|
+
* workspace can be described. `FileHandle.readFile` refuses anything above 2 GiB with
|
|
43
|
+
* `ERR_FS_FILE_TOO_LARGE`, which made a workspace holding one such artifact impossible to verify
|
|
44
|
+
* against a manifest it already matched. The digest is sha-256 over the same bytes either way, so
|
|
45
|
+
* a manifest a buffered read produced is reproduced exactly.
|
|
46
|
+
*/
|
|
47
|
+
declare function scanMaterializedWorkspaceManifest(root: string, options?: WorkspaceScanOptions): Promise<AgentCandidateWorkspaceManifestMaterial>;
|
|
48
|
+
/**
|
|
49
|
+
* Build the canonical manifest for files a caller already holds — the shape a remote executor
|
|
50
|
+
* returns. Pass `portableTree` to record Git's two file modes instead of exact permission bits, and
|
|
51
|
+
* pass the same flag to every verify that reads the result.
|
|
52
|
+
*/
|
|
53
|
+
declare function candidateWorkspaceManifest(files: ReadonlyArray<{
|
|
54
|
+
path: string;
|
|
55
|
+
mode: number;
|
|
56
|
+
bytes: Uint8Array;
|
|
57
|
+
}>, options?: {
|
|
58
|
+
portableTree?: boolean;
|
|
59
|
+
}): AgentCandidateWorkspaceManifestMaterial;
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/candidate-execution/bundle.d.ts
|
|
62
|
+
/** Exact candidate wire shape before the runtime computes its canonical digest. */
|
|
63
|
+
type AgentCandidateBundleInput = Omit<AgentCandidateBundle, 'digest'>;
|
|
64
|
+
/** Validate and content-address a candidate bundle before it crosses an approval boundary. */
|
|
65
|
+
declare function sealAgentCandidateBundle(input: AgentCandidateBundleInput): AgentCandidateBundle;
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/candidate-execution/builder.d.ts
|
|
68
|
+
/** A complete profile that can be frozen without losing behavior. */
|
|
69
|
+
type AgentCandidateProfileSource = {
|
|
70
|
+
kind: 'profile';
|
|
71
|
+
profile: AgentProfile;
|
|
72
|
+
} | {
|
|
73
|
+
kind: 'profile-diffs';
|
|
74
|
+
base: AgentProfile;
|
|
75
|
+
/** Applied in order before the resulting profile is frozen into the bundle. */
|
|
76
|
+
diffs: readonly AgentProfileDiff[];
|
|
77
|
+
} | {
|
|
78
|
+
kind: 'candidate-profile';
|
|
79
|
+
/** Already converted to the closed, secret-free candidate profile contract. */
|
|
80
|
+
profile: AgentCandidateProfile;
|
|
81
|
+
};
|
|
82
|
+
/** The only accepted path from an agent-eval code candidate to executable bytes. */
|
|
83
|
+
interface AgentCandidateCodeSurfaceSource {
|
|
84
|
+
kind: 'code-surface';
|
|
85
|
+
surface: CodeSurface;
|
|
86
|
+
repository: AgentCandidateGitHubRepository;
|
|
87
|
+
/** Optional parent directory used to resolve a relative `surface.worktreeRef`. */
|
|
88
|
+
worktreeDir?: string;
|
|
89
|
+
}
|
|
90
|
+
/** Explicit control/no-op code or one finalized CodeSurface whose bytes must still verify. */
|
|
91
|
+
type AgentCandidateCodeSource = AgentCandidateCodeDisabled | AgentCandidateCodeNoOp | AgentCandidateCodeSurfaceSource;
|
|
92
|
+
/** Complete measured surfaces and execution policy compiled into one candidate bundle. */
|
|
93
|
+
interface BuildAgentCandidateBundleInput {
|
|
94
|
+
profile: AgentCandidateProfileSource;
|
|
95
|
+
code: AgentCandidateCodeSource;
|
|
96
|
+
execution: AgentCandidateExecution;
|
|
97
|
+
knowledge?: AgentCandidateKnowledge;
|
|
98
|
+
memory: AgentCandidateMemoryPolicy;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Compile one measured profile/code candidate into the immutable execution
|
|
102
|
+
* contract. Code bytes are re-read and verified by agent-eval before they are
|
|
103
|
+
* embedded. The returned bundle is schema-validated, canonically digested, and
|
|
104
|
+
* deeply immutable; call `verifyAgentCandidateBundle` at the execution boundary
|
|
105
|
+
* to re-read external memory, repository, and workspace artifacts.
|
|
106
|
+
*/
|
|
107
|
+
declare function buildAgentCandidateBundle(input: BuildAgentCandidateBundleInput): ReturnType<typeof sealAgentCandidateBundle>;
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/candidate-execution/claim-file-store.d.ts
|
|
110
|
+
interface FileAgentCandidateExecutionClaimStoreOptions {
|
|
111
|
+
/** Evaluator-owned directory shared by every process allowed to execute candidates. */
|
|
112
|
+
directory: string;
|
|
113
|
+
/** Testable evaluator clock; defaults to `Date.now`. */
|
|
114
|
+
now?: () => number;
|
|
115
|
+
}
|
|
116
|
+
/** Cross-process lifecycle implemented as fsynced, create-if-absent records. */
|
|
117
|
+
declare class FileAgentCandidateExecutionClaimStore implements AgentCandidateExecutionClaimStore {
|
|
118
|
+
private readonly directory;
|
|
119
|
+
private readonly now;
|
|
120
|
+
constructor(options: FileAgentCandidateExecutionClaimStoreOptions);
|
|
121
|
+
tryClaim(requested: AgentCandidateExecutionClaim): Promise<AgentCandidateExecutionClaimResult>;
|
|
122
|
+
getAttempt(requestedAttempt: AgentCandidateExecutionAttemptRef): Promise<AgentCandidateExecutionAttemptRecord | undefined>;
|
|
123
|
+
markCandidateMayRun(requestedLease: AgentCandidateExecutionLease): Promise<AgentCandidateExecutionPhaseResult>;
|
|
124
|
+
stageTerminal(requestedLease: AgentCandidateExecutionLease, result: AgentCandidateExecutionTerminalResult): Promise<AgentCandidateExecutionStageResult>;
|
|
125
|
+
finish(requestedLease: AgentCandidateExecutionLease, requestedTerminalDigest: Sha256Digest): Promise<AgentCandidateExecutionFinishResult>;
|
|
126
|
+
recoverExpired(requestedAttempt: AgentCandidateExecutionAttemptRef, evidence: AgentCandidateExecutionRecoveryEvidence): Promise<AgentCandidateExecutionFinishResult>;
|
|
127
|
+
private storedAttempt;
|
|
128
|
+
private transitionState;
|
|
129
|
+
private retryFailure;
|
|
130
|
+
private ownerPublication;
|
|
131
|
+
private claimPath;
|
|
132
|
+
private terminalPath;
|
|
133
|
+
private transitionPath;
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/candidate-execution/dispose.d.ts
|
|
137
|
+
interface DisposePreparedAgentCandidateOptions {
|
|
138
|
+
cleanupTimeoutMs?: number;
|
|
139
|
+
}
|
|
140
|
+
/** Revoke reservations held by a prepared candidate that will not be executed. */
|
|
141
|
+
declare function disposePreparedAgentCandidateExecution(prepared: PreparedAgentCandidateExecution, options?: DisposePreparedAgentCandidateOptions): Promise<{
|
|
142
|
+
disposed: true;
|
|
143
|
+
}>;
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/candidate-execution/exact-process-executor.d.ts
|
|
146
|
+
interface ExactProcessCandidateExecutorOptions {
|
|
147
|
+
provider: AgentEnvironmentProvider;
|
|
148
|
+
resources: AgentExactProcessResources;
|
|
149
|
+
provisionTimeoutMs?: number;
|
|
150
|
+
recoveryRetentionMs?: number;
|
|
151
|
+
providerOptions?: Record<string, unknown>;
|
|
152
|
+
}
|
|
153
|
+
/** Adapt one neutral exact-process provider to Runtime's trusted candidate boundary. */
|
|
154
|
+
declare function exactProcessProviderAsCandidateExecutor(options: ExactProcessCandidateExecutorOptions): AgentCandidateExecutorPort;
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/candidate-execution/knowledge.d.ts
|
|
157
|
+
/** Environment variable containing the materialized candidate knowledge root. */
|
|
158
|
+
declare const CANDIDATE_KNOWLEDGE_ROOT_ENV = "TANGLE_CANDIDATE_KNOWLEDGE_ROOT";
|
|
159
|
+
/** Environment variable containing the materialized retrieval configuration path. */
|
|
160
|
+
declare const CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV = "TANGLE_CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG";
|
|
161
|
+
/** Deterministic, signed locations used by every candidate executor. */
|
|
162
|
+
declare function candidateKnowledgeExecutionPaths(taskRoot: string, hasRetrievalConfig: boolean): {
|
|
163
|
+
root: string;
|
|
164
|
+
retrievalConfig?: string;
|
|
165
|
+
};
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/candidate-execution/output-artifacts.d.ts
|
|
168
|
+
/** Persist evaluator evidence, read it back, and bind the returned locator to the exact bytes. */
|
|
169
|
+
declare function persistCandidateOutputArtifact(port: AgentCandidateOutputArtifactPort, input: {
|
|
170
|
+
executionId: string;
|
|
171
|
+
purpose: AgentCandidateOutputPurpose;
|
|
172
|
+
bytes: Uint8Array;
|
|
173
|
+
signal?: AbortSignal;
|
|
174
|
+
}): Promise<AgentCandidateArtifactRef>;
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/candidate-execution/protected-model-grant.d.ts
|
|
177
|
+
/** Reservation fields supplied by a caller before Runtime resolves the model. */
|
|
178
|
+
type AgentCandidateModelGrantRunReservationInput = Omit<AgentCandidateModelGrantReserveInput, 'resolved'>;
|
|
179
|
+
/** Values available only while one protected model grant is active. */
|
|
180
|
+
interface ProtectedAgentCandidateModelGrantContext {
|
|
181
|
+
readonly activation: AgentCandidateProtectedModelActivation;
|
|
182
|
+
readonly reservation: AgentCandidateProtectedModelReservation;
|
|
183
|
+
readonly resolved: AgentCandidateResolvedModel;
|
|
184
|
+
}
|
|
185
|
+
/** Inputs for one protected grant scoped to one bounded caller unit. */
|
|
186
|
+
interface RunProtectedAgentCandidateModelGrantOptions<TResult> {
|
|
187
|
+
/** Runtime port that validates and settles the evaluator-owned grant. */
|
|
188
|
+
readonly port: AgentCandidateModelPort;
|
|
189
|
+
/** Provider-neutral model request resolved before any grant is reserved. */
|
|
190
|
+
readonly resolve: Parameters<AgentCandidateModelPort['resolve']>[0];
|
|
191
|
+
/** One bounded unit's immutable identity, attempt, expiry, and limits. */
|
|
192
|
+
readonly reserve: AgentCandidateModelGrantRunReservationInput;
|
|
193
|
+
/** Must be no later than the reservation expiry. */
|
|
194
|
+
readonly deadlineAtMs: AgentCandidateModelGrantActivateInput['deadlineAtMs'];
|
|
195
|
+
/** Execute exactly one bounded unit while the activated environment is valid. */
|
|
196
|
+
readonly execute: (context: ProtectedAgentCandidateModelGrantContext) => Promise<TResult>;
|
|
197
|
+
}
|
|
198
|
+
/** Result and sealed settlement returned after one protected grant closes. */
|
|
199
|
+
interface RunProtectedAgentCandidateModelGrantResult<TResult> {
|
|
200
|
+
readonly value: TResult;
|
|
201
|
+
readonly resolved: AgentCandidateResolvedModel;
|
|
202
|
+
readonly reservation: AgentCandidateProtectedModelReservation;
|
|
203
|
+
readonly settlement: AgentCandidateProtectedModelSettlement;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Run one bounded unit under a protected model grant.
|
|
207
|
+
*
|
|
208
|
+
* Runtime owns the grant lifecycle; callers own the unit boundary and any
|
|
209
|
+
* durable scheduling or accounting around it. A reserved grant is settled
|
|
210
|
+
* after activation failure or callback failure, and the callback error is
|
|
211
|
+
* preserved when settlement also fails.
|
|
212
|
+
*/
|
|
213
|
+
declare function runProtectedAgentCandidateModelGrant<TResult>(options: RunProtectedAgentCandidateModelGrantOptions<TResult>): Promise<RunProtectedAgentCandidateModelGrantResult<TResult>>;
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/candidate-execution/recover.d.ts
|
|
216
|
+
interface RecoverExpiredAgentCandidateOptions {
|
|
217
|
+
attempt: AgentCandidateExecutionAttemptRef;
|
|
218
|
+
claimStore: AgentCandidateExecutionClaimStore;
|
|
219
|
+
executor: AgentCandidateExecutorPort;
|
|
220
|
+
traceStore: TraceStore;
|
|
221
|
+
ports: Pick<AgentCandidateExecutionPorts, 'models' | 'memory'>;
|
|
222
|
+
outputArtifacts: AgentCandidateOutputArtifactPort;
|
|
223
|
+
cleanupTimeoutMs?: number;
|
|
224
|
+
/** Evaluator clock; must be the same clock used by the claim store. */
|
|
225
|
+
now?: () => number;
|
|
226
|
+
}
|
|
227
|
+
/** Close an expired crashed attempt from persisted non-secret handles, then record failure. */
|
|
228
|
+
declare function recoverExpiredAgentCandidateExecution(options: RecoverExpiredAgentCandidateOptions): Promise<AgentCandidateExecutionFinishResult>;
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/candidate-execution/verify.d.ts
|
|
231
|
+
/** Surfaces admitted by Runtime's verifier before an environment adapter is selected. */
|
|
232
|
+
declare const AGENT_CANDIDATE_EXECUTION_SUPPORT: Readonly<{
|
|
233
|
+
outcomes: readonly ["workspace", "output"];
|
|
234
|
+
code: readonly ["disabled", "no-op", "git-patch"];
|
|
235
|
+
memory: readonly ["disabled", "isolated"];
|
|
236
|
+
knowledge: true;
|
|
237
|
+
profile: Readonly<{
|
|
238
|
+
mcpTransports: readonly ["stdio"];
|
|
239
|
+
remoteMcp: false;
|
|
240
|
+
tools: false;
|
|
241
|
+
permissions: false;
|
|
242
|
+
modes: false;
|
|
243
|
+
confidential: false;
|
|
244
|
+
}>;
|
|
245
|
+
}>;
|
|
246
|
+
/** Verifies every digest, resource, workspace, and Git object in a candidate bundle. */
|
|
247
|
+
declare function verifyAgentCandidateBundle(input: unknown, ports: AgentCandidateVerificationPorts): Promise<VerifiedAgentCandidate>;
|
|
248
|
+
//#endregion
|
|
249
|
+
//#region src/candidate-execution/workspace-archive.d.ts
|
|
250
|
+
interface AgentCandidateWorkspaceArchiveLimits {
|
|
251
|
+
maxArchiveBytes: number;
|
|
252
|
+
maxEmbeddedArtifactBytes: number;
|
|
253
|
+
maxFiles: number;
|
|
254
|
+
maxFileBytes: number;
|
|
255
|
+
maxTotalFileBytes: number;
|
|
256
|
+
maxPathBytes: number;
|
|
257
|
+
maxRepositoryBundleBytes: number;
|
|
258
|
+
}
|
|
259
|
+
interface CaptureAgentCandidateWorkspaceOptions {
|
|
260
|
+
/** Include Git HEAD so task preparation can prove its exact commit and tree. */
|
|
261
|
+
includeRepository?: boolean;
|
|
262
|
+
limits?: Partial<AgentCandidateWorkspaceArchiveLimits>;
|
|
263
|
+
/** Use the evaluator-owned artifact store when manifest or archive bytes should not be embedded. */
|
|
264
|
+
artifactPersistence?: {
|
|
265
|
+
executionId: string;
|
|
266
|
+
outputArtifacts: AgentCandidateOutputArtifactPort;
|
|
267
|
+
signal?: AbortSignal;
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
interface CreateAgentCandidateWorkspacePortOptions {
|
|
271
|
+
limits?: Partial<AgentCandidateWorkspaceArchiveLimits>;
|
|
272
|
+
}
|
|
273
|
+
interface CapturedAgentCandidateWorkspace {
|
|
274
|
+
readonly snapshot: AgentCandidateWorkspaceSnapshotEvidence;
|
|
275
|
+
/** Caller-owned bytes accepted by createAgentCandidateWorkspacePort. */
|
|
276
|
+
readonly archive: Uint8Array;
|
|
277
|
+
}
|
|
278
|
+
/** Capture one exact regular-file workspace for immutable candidate execution. */
|
|
279
|
+
declare function captureAgentCandidateWorkspace(rootInput: string, options?: CaptureAgentCandidateWorkspaceOptions): Promise<CapturedAgentCandidateWorkspace>;
|
|
280
|
+
/** Capture detached files returned by a remote executor into the standard archive. */
|
|
281
|
+
declare function captureAgentCandidateWorkspaceFiles(input: readonly AgentCandidateExecutorWorkspaceFile[], options?: Omit<CaptureAgentCandidateWorkspaceOptions, 'includeRepository'>): Promise<CapturedAgentCandidateWorkspace>;
|
|
282
|
+
/** Create the standard bounded materializer for candidate execution ports. */
|
|
283
|
+
declare function createAgentCandidateWorkspacePort(options?: CreateAgentCandidateWorkspacePortOptions): AgentCandidateWorkspacePort;
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region src/candidate-execution/workspace-tree.d.ts
|
|
286
|
+
/**
|
|
287
|
+
* `'tree-v1'` records a file's exact permission bits. `'portable-tree-v1'` records the two modes
|
|
288
|
+
* Git stores — `755` when any execute bit is set, `644` otherwise, and `755` for a directory — so a
|
|
289
|
+
* digest survives a checkout whose umask differs. Both stamp the algorithm into the digest, so one
|
|
290
|
+
* tree cannot produce the same digest under both.
|
|
291
|
+
*/
|
|
292
|
+
type WorkspaceTreeAlgorithm = 'tree-v1' | 'portable-tree-v1';
|
|
293
|
+
/** What a walk does with an entry it refuses to describe: fail, or record and continue. */
|
|
294
|
+
type WorkspaceTreeEntryPolicy = 'refuse' | 'exclude';
|
|
295
|
+
/** Why one entry contributed its name instead of its content. */
|
|
296
|
+
type WorkspaceTreeExclusionReason = 'absolute-symlink' | 'symlink-escapes-tree' | 'symlink-resolves-outside-tree' | 'unresolved-symlink' | 'entry-disappeared';
|
|
297
|
+
/** One entry the walk recorded but did not describe. Reported rather than dropped: a digest that
|
|
298
|
+
* silently omitted an entry would be a different digest with no way to tell why. */
|
|
299
|
+
interface WorkspaceTreeExclusion {
|
|
300
|
+
/** Tree-relative path, `/`-separated. */
|
|
301
|
+
readonly path: string;
|
|
302
|
+
readonly reason: WorkspaceTreeExclusionReason;
|
|
303
|
+
/** The link target exactly as it was written, for a symbolic-link exclusion. */
|
|
304
|
+
readonly target?: string;
|
|
305
|
+
}
|
|
306
|
+
interface WorkspaceTreeDescriptor {
|
|
307
|
+
readonly algorithm: WorkspaceTreeAlgorithm;
|
|
308
|
+
readonly digest: Sha256Digest;
|
|
309
|
+
readonly files: number;
|
|
310
|
+
readonly directories: number;
|
|
311
|
+
/** Links kept INSIDE the tree. An excluded link is counted in `excluded`, never here. */
|
|
312
|
+
readonly symlinks: number;
|
|
313
|
+
/** Total described regular-file bytes. */
|
|
314
|
+
readonly bytes: number;
|
|
315
|
+
readonly excluded: ReadonlyArray<WorkspaceTreeExclusion>;
|
|
316
|
+
}
|
|
317
|
+
interface DescribeWorkspaceTreeOptions {
|
|
318
|
+
/** Default `'tree-v1'`. */
|
|
319
|
+
readonly algorithm?: WorkspaceTreeAlgorithm;
|
|
320
|
+
/**
|
|
321
|
+
* A symbolic link that is absolute, leaves the tree lexically, resolves outside it, or does not
|
|
322
|
+
* resolve at all. `'refuse'` (default) is correct for an input seed. `'exclude'` is correct for a
|
|
323
|
+
* close-time walk over a tree a run wrote. The link is NEVER followed in either policy: an
|
|
324
|
+
* escaping link must not contribute bytes from outside the tree to a content address.
|
|
325
|
+
*/
|
|
326
|
+
readonly onEscapingLink?: WorkspaceTreeEntryPolicy;
|
|
327
|
+
/**
|
|
328
|
+
* An entry that vanished between the directory read that named it and the walk that reached it.
|
|
329
|
+
* `'refuse'` (default) is correct for a settled tree; `'exclude'` is correct for a workspace a
|
|
330
|
+
* live process still writes to.
|
|
331
|
+
*/
|
|
332
|
+
readonly onMissingEntry?: WorkspaceTreeEntryPolicy;
|
|
333
|
+
}
|
|
334
|
+
interface SeedWorkspaceTreeInput {
|
|
335
|
+
/** The tree to copy FROM. Described, then copied entry by entry. */
|
|
336
|
+
readonly source: string;
|
|
337
|
+
/** The tree to copy INTO. Must exist, and must not lie inside `source`. */
|
|
338
|
+
readonly destination: string;
|
|
339
|
+
/** Default `'tree-v1'`; decides only the digest this returns, never the bytes it writes. */
|
|
340
|
+
readonly algorithm?: WorkspaceTreeAlgorithm;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Describe one directory tree by content, streaming every file.
|
|
344
|
+
*
|
|
345
|
+
* The digest covers, for every entry in sorted order: its kind, its tree-relative path, its mode
|
|
346
|
+
* under the selected algorithm, and then — for a file, its length and its own sha-256; for a kept
|
|
347
|
+
* link, its target; for an excluded entry, the reason and the target. A file's content therefore
|
|
348
|
+
* never enters the tree hash directly, which is what removes any in-memory size ceiling: the tree
|
|
349
|
+
* hash consumes 32 bytes per file however large the file is.
|
|
350
|
+
*
|
|
351
|
+
* A hard-linked regular file is described like any other regular file. Its content is what the
|
|
352
|
+
* digest is about, and a package manager that links a store into `node_modules` is ordinary
|
|
353
|
+
* content, not a reason to refuse a workspace.
|
|
354
|
+
*/
|
|
355
|
+
declare function describeWorkspaceTree(directory: string, options?: DescribeWorkspaceTreeOptions): Promise<WorkspaceTreeDescriptor>;
|
|
356
|
+
/**
|
|
357
|
+
* Seed a workspace from a directory, one entry at a time, and return the digest of what was
|
|
358
|
+
* seeded.
|
|
359
|
+
*
|
|
360
|
+
* Nothing is packed: `cp` walks and copies file by file, so a multi-gigabyte seed costs one file
|
|
361
|
+
* handle rather than one archive in memory. Existing destination entries are never overwritten —
|
|
362
|
+
* a seed that could replace a file the workspace already holds would make the resulting tree
|
|
363
|
+
* depend on the order two seeds ran in.
|
|
364
|
+
*
|
|
365
|
+
* Links are copied verbatim, exactly as they were written. Following them would copy bytes from
|
|
366
|
+
* outside the seed into the workspace, which is the same rule {@link describeWorkspaceTree}
|
|
367
|
+
* applies to the digest.
|
|
368
|
+
*/
|
|
369
|
+
declare function seedWorkspaceTree(input: SeedWorkspaceTreeInput): Promise<WorkspaceTreeDescriptor>;
|
|
370
|
+
//#endregion
|
|
371
|
+
export { AGENT_CANDIDATE_EXECUTION_SUPPORT, type AgentCandidateArtifactPort, type AgentCandidateBenchmarkGraderIdentity, type AgentCandidateBenchmarkGraderPort, type AgentCandidateBundleInput, type AgentCandidateCodeSource, type AgentCandidateCodeSurfaceSource, type AgentCandidateContainerPort, type AgentCandidateExecutionAttemptRecord, type AgentCandidateExecutionAttemptRef, type AgentCandidateExecutionClaim, type AgentCandidateExecutionClaimResult, type AgentCandidateExecutionClaimStore, type AgentCandidateExecutionCleanupHandles, type AgentCandidateExecutionFailureClass, type AgentCandidateExecutionFinishResult, type AgentCandidateExecutionLease, type AgentCandidateExecutionPhase, type AgentCandidateExecutionPhaseResult, type AgentCandidateExecutionPorts, type AgentCandidateExecutionRecoveryEvidence, type AgentCandidateExecutionRoots, type AgentCandidateExecutionStageResult, type AgentCandidateExecutionTerminalRecord, type AgentCandidateExecutionTerminalResult, type AgentCandidateExecutorFinalCapture, type AgentCandidateExecutorMemoryCapture, type AgentCandidateExecutorPort, type AgentCandidateExecutorProfileFile, type AgentCandidateExecutorRequest, type AgentCandidateExecutorStopRequest, type AgentCandidateExecutorTaskOutcomeCapture, type AgentCandidateExecutorWorkspaceFile, type AgentCandidateExecutorWorkspaceInput, type AgentCandidateMemoryPort, type AgentCandidateMemoryResetResult, type AgentCandidateModelGrantActivateInput, type AgentCandidateModelGrantClient, type AgentCandidateModelGrantReservation, type AgentCandidateModelGrantReserveInput, type AgentCandidateModelGrantRunReservationInput, type AgentCandidateModelGrantSettleInput, type AgentCandidateModelLimits, type AgentCandidateModelPort, type AgentCandidateOutputArtifactPort, type AgentCandidateOutputPurpose, type AgentCandidatePreparationEvidence, type AgentCandidateProfileSource, type AgentCandidateProtectedModelActivation, type AgentCandidateProtectedModelReservation, type AgentCandidateProtectedModelSettlement, type AgentCandidateProtectedModelSettlementCall, type AgentCandidateProtectedRunCapture, type AgentCandidateRepositoryPort, type AgentCandidateRetryRejection, type AgentCandidateRunFinalization, type AgentCandidateTaskExecution, type AgentCandidateVerificationPorts, type AgentCandidateWorkspaceArchiveLimits, type AgentCandidateWorkspacePort, type BuildAgentCandidateBundleInput, CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, CANDIDATE_KNOWLEDGE_ROOT_ENV, CANDIDATE_TRACE_ENV, CANDIDATE_TRACE_TAGS, type CanonicalCandidateDocument, type CaptureAgentCandidateWorkspaceOptions, type CapturedAgentCandidateWorkspace, type CreateAgentCandidateWorkspacePortOptions, type CreateProtectedAgentCandidateModelPortOptions, type DescribeWorkspaceTreeOptions, type DisposePreparedAgentCandidateOptions, type ExactProcessCandidateExecutorOptions, type ExecutePreparedAgentCandidateOptions, FileAgentCandidateExecutionClaimStore, type FileAgentCandidateExecutionClaimStoreOptions, InMemoryAgentCandidateExecutionClaimStore, type InMemoryAgentCandidateExecutionClaimStoreOptions, type PersistedTaskOutcomeEvidence, type PrepareAgentCandidateExecutionOptions, type PreparedAgentCandidateExecution, type PreparedAgentCandidateInstruction, type PreparedAgentCandidateKnowledge, type PreparedAgentCandidateLaunch, type PreparedAgentCandidateTrace, type ProtectedAgentCandidateModelGrantContext, type RecoverExpiredAgentCandidateOptions, type ResolvedAgentCandidateContainer, type RunProtectedAgentCandidateModelGrantOptions, type RunProtectedAgentCandidateModelGrantResult, type SeedWorkspaceTreeInput, type VerifiedAgentCandidate, type VerifiedAgentCandidateTaskOutcome, type WorkspaceScanLimits, type WorkspaceScanOptions, type WorkspaceTreeAlgorithm, type WorkspaceTreeDescriptor, type WorkspaceTreeEntryPolicy, type WorkspaceTreeExclusion, type WorkspaceTreeExclusionReason, agentCandidateProfileAsAgentProfile, applyExactAgentProfileDiff, assertCandidateProfileBinding, buildAgentCandidateBundle, candidateExecutionClaim, candidateKnowledgeExecutionPaths, candidateWorkspaceManifest, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, createAgentCandidateWorkspacePort, createProtectedAgentCandidateModelPort, describeWorkspaceTree, disposePreparedAgentCandidateExecution, exactProcessProviderAsCandidateExecutor, executePreparedAgentCandidate, freezeGenericAgentCandidateProfile, omitUndefinedObjectFields, parseExactAgentProfile, parseExactAgentProfileDiff, parseExactCandidateProfile, persistCandidateOutputArtifact, prepareAgentCandidateExecution, recoverExpiredAgentCandidateExecution, runProtectedAgentCandidateModelGrant, scanMaterializedWorkspaceManifest, sealAgentCandidateBundle, seedWorkspaceTree, verifyAgentCandidateBundle, verifyMaterializedWorkspace };
|
|
372
|
+
//# sourceMappingURL=index.d.ts.map
|