@tangle-network/agent-runtime 0.240.0 → 0.247.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/dist/{activation-q224yRQK.js → activation-DYqnl8zq.js} +3 -3
- package/dist/{activation-q224yRQK.js.map → activation-DYqnl8zq.js.map} +1 -1
- package/dist/{activation-CtkpoWet.d.ts → activation-DizpINK3.d.ts} +115 -5
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +2 -2
- package/dist/candidate-execution/index.js +7 -7
- package/dist/candidate-execution/index.js.map +1 -1
- package/dist/{coordination-driver-CMprWr0k.js → coordination-driver-BV4AAUns.js} +35 -14
- package/dist/coordination-driver-BV4AAUns.js.map +1 -0
- package/dist/{delegate-kwBecu_w.js → delegate-DQAzB5Xv.js} +2 -2
- package/dist/{delegate-kwBecu_w.js.map → delegate-DQAzB5Xv.js.map} +1 -1
- package/dist/{durable-file-D24y9zg7.js → durable-file-DWQA4ooo.js} +2 -2
- package/dist/{durable-file-D24y9zg7.js.map → durable-file-DWQA4ooo.js.map} +1 -1
- package/dist/durable.d.ts +2 -2
- package/dist/durable.js +3 -3
- package/dist/{graph-Bke7I2gs.js → graph-DcBmMLIp.js} +3 -3
- package/dist/{graph-Bke7I2gs.js.map → graph-DcBmMLIp.js.map} +1 -1
- package/dist/{improvement-cycle-BpSVwIJw.js → improvement-cycle-B049YmQ8.js} +458 -60
- package/dist/improvement-cycle-B049YmQ8.js.map +1 -0
- package/dist/{index-CbZaoYbD.d.ts → index-DLzlXwr6.d.ts} +14 -9
- package/dist/index.d.ts +11 -8
- package/dist/index.js +27 -17
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +7 -5
- package/dist/intelligence.js +15 -11
- package/dist/intelligence.js.map +1 -1
- package/dist/kernel.d.ts +3 -3
- package/dist/kernel.js +9 -9
- package/dist/{loop-runner-bin-BUkkPt10.d.ts → loop-runner-bin-HbMECmxT.d.ts} +3 -3
- package/dist/{loop-runner-bin-DU8XqsGN.js → loop-runner-bin-iqq1azfy.js} +3 -3
- package/dist/{loop-runner-bin-DU8XqsGN.js.map → loop-runner-bin-iqq1azfy.js.map} +1 -1
- 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 +5 -5
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-BI1ofIfL.d.ts → openai-tools-DvLk_Ddg.d.ts} +2 -2
- package/dist/{prepare-Dc30WRB0.js → prepare-CibQrhfi.js} +28 -28
- package/dist/prepare-CibQrhfi.js.map +1 -0
- package/dist/profiles.d.ts +2 -2
- package/dist/{protected-model-port-D5gDcnrH.js → protected-model-port-Dhdi5mDl.js} +3 -3
- package/dist/{protected-model-port-D5gDcnrH.js.map → protected-model-port-Dhdi5mDl.js.map} +1 -1
- package/dist/{protected-redaction-wGo44k2K.js → protected-redaction-Fn1ETfJ-.js} +6 -6
- package/dist/protected-redaction-Fn1ETfJ-.js.map +1 -0
- package/dist/{provision-supervisor-DoSrqsM7.js → provision-supervisor-BgQx2Avp.js} +5 -5
- package/dist/{provision-supervisor-DoSrqsM7.js.map → provision-supervisor-BgQx2Avp.js.map} +1 -1
- package/dist/{run-layout-hZREkcfu.js → run-layout-hKAJGF4g.js} +7 -2
- package/dist/run-layout-hKAJGF4g.js.map +1 -0
- package/dist/{runtime-CmuAQsWI.js → runtime-HpTXhB3g.js} +16 -13
- package/dist/{runtime-CmuAQsWI.js.map → runtime-HpTXhB3g.js.map} +1 -1
- package/dist/{server-shkdLqls.js → server-OOE7mXrN.js} +3 -3
- package/dist/{server-shkdLqls.js.map → server-OOE7mXrN.js.map} +1 -1
- package/dist/{stream-agent-turn-DayHmtvw.d.ts → stream-agent-turn-CcumM0Bu.d.ts} +2 -2
- package/dist/{structural-rollout-CW67upUV.js → structural-rollout-z1A0okaB.js} +2 -2
- package/dist/{structural-rollout-CW67upUV.js.map → structural-rollout-z1A0okaB.js.map} +1 -1
- package/dist/{substrate-iQOskmQ_.d.ts → substrate-CQ0hfewn.d.ts} +2 -2
- package/dist/{supervise-DzoCYAe-.js → supervise-DZEOpzRw.js} +148 -35
- package/dist/supervise-DZEOpzRw.js.map +1 -0
- package/dist/{supervisor-CFSPj8rx.js → supervisor-BIBWUFUr.js} +325 -150
- package/dist/supervisor-BIBWUFUr.js.map +1 -0
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +398 -398
- package/dist/{top-app-CMMd8DgR.js → top-app-d-bmwO7O.js} +2 -2
- package/dist/{top-app-CMMd8DgR.js.map → top-app-d-bmwO7O.js.map} +1 -1
- package/dist/tui/bin.js +1 -1
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +2 -2
- package/dist/{types-CEma9LKR.d.ts → types-BUhz284C.d.ts} +25 -11
- package/dist/{workspace-archive-CBX0hwL_.js → workspace-archive-DSRT4Tro.js} +8 -8
- package/dist/workspace-archive-DSRT4Tro.js.map +1 -0
- package/package.json +6 -6
- package/dist/coordination-driver-CMprWr0k.js.map +0 -1
- package/dist/improvement-cycle-BpSVwIJw.js.map +0 -1
- package/dist/prepare-Dc30WRB0.js.map +0 -1
- package/dist/protected-redaction-wGo44k2K.js.map +0 -1
- package/dist/run-layout-hZREkcfu.js.map +0 -1
- package/dist/supervise-DzoCYAe-.js.map +0 -1
- package/dist/supervisor-CFSPj8rx.js.map +0 -1
- package/dist/workspace-archive-CBX0hwL_.js.map +0 -1
|
@@ -2614,7 +2614,8 @@ interface EvalRunsExportResult {
|
|
|
2614
2614
|
* Ship self-improvement eval-run events to Tangle Intelligence. Unlike the
|
|
2615
2615
|
* best-effort span exporter, this RESOLVES with the ingest verdict (accepted /
|
|
2616
2616
|
* rejected per event) so a consumer's loop can assert its provenance landed.
|
|
2617
|
-
*
|
|
2617
|
+
* Success requires a complete, valid acknowledgement accepting every event.
|
|
2618
|
+
* Throws on a missing key, network failure, or unreadable/inconsistent acknowledgement.
|
|
2618
2619
|
*/
|
|
2619
2620
|
declare function exportEvalRuns(events: EvalRunEvent[], config?: EvalRunsExportConfig): Promise<EvalRunsExportResult>;
|
|
2620
2621
|
//#endregion
|
|
@@ -3569,8 +3570,12 @@ type Settled<Out> = {
|
|
|
3569
3570
|
/** Retained output evidence, when execution returned an artifact before this failure.
|
|
3570
3571
|
* Its presence does not make the result successful or eligible for selection. */
|
|
3571
3572
|
outRef?: string;
|
|
3572
|
-
/**
|
|
3573
|
-
|
|
3573
|
+
/** `true` = the platform, not the work, ended this child (excluded from merge `n` /
|
|
3574
|
+
* equal-k); `false` = the runtime knows the work itself failed (an ordinary thrown result);
|
|
3575
|
+
* absent = the executor's envelope reported a failure the runtime cannot attribute either
|
|
3576
|
+
* way. Absent is a stated unknown, never a euphemism for `false`: until 2026-09-20 the
|
|
3577
|
+
* envelope path stamped `false` unconditionally and caught 1 of 78 platform losses. */
|
|
3578
|
+
infra?: boolean;
|
|
3574
3579
|
/** Partial structured tool evidence captured before this failure was journaled. */
|
|
3575
3580
|
trace: WorkerTraceEvidence;
|
|
3576
3581
|
/** The child's own harness transcript, read out of its environment at the last moment it
|
|
@@ -4549,9 +4554,10 @@ type SupervisedResult<Out> = {
|
|
|
4549
4554
|
/**
|
|
4550
4555
|
* The LIFECYCLE no-winner arms: the supervisor itself proved why nothing was delivered, so
|
|
4551
4556
|
* the reason is complete on its own and there is no driver rejection to hand back. A tripped
|
|
4552
|
-
* breaker or
|
|
4557
|
+
* breaker or every child down is `all-children-down`, a cascaded abort is `aborted`, an
|
|
4553
4558
|
* empty pool is `budget-exhausted`. These outrank `driver-failed`: when the driver threw
|
|
4554
4559
|
* BECAUSE the pool emptied or the run was aborted, the lifecycle cause is the explanation.
|
|
4560
|
+
* One down child among delivered siblings is not a lifecycle cause; it rides `downCount`.
|
|
4555
4561
|
*/
|
|
4556
4562
|
kind: 'no-winner';
|
|
4557
4563
|
tree: TreeView;
|
|
@@ -4592,10 +4598,17 @@ type SupervisedResult<Out> = {
|
|
|
4592
4598
|
* never spawned a child. Until this arm existed that run settled `all-children-down`
|
|
4593
4599
|
* with `downCount: 0`, which reads as a fleet failure to anyone who did not open the
|
|
4594
4600
|
* journal; fifteen sandbox-placed directors settled that way in one week while the
|
|
4595
|
-
* actual fault was that the root never recursed.
|
|
4596
|
-
*
|
|
4601
|
+
* actual fault was that the root never recursed.
|
|
4602
|
+
*
|
|
4603
|
+
* `no-result-selected`: the root ran to completion under budget, spawned children, and
|
|
4604
|
+
* selected nothing while no child was down when it settled. Until this arm existed that
|
|
4605
|
+
* run also settled `all-children-down`: on the 2026-09-20 fleet corpus, 46 of the 57
|
|
4606
|
+
* runs carrying that reason had zero down children in their own `fleetYield`, and a
|
|
4607
|
+
* reader of the label learned that banking pages was losing. `all-children-down` now
|
|
4608
|
+
* asserts what its name says: the supervisor observed a down child, a tripped breaker,
|
|
4609
|
+
* or every child down, before the root settled.
|
|
4597
4610
|
*/
|
|
4598
|
-
reason: 'all-children-down' | 'no-children-spawned' | 'budget-exhausted' | 'aborted';
|
|
4611
|
+
reason: 'all-children-down' | 'no-children-spawned' | 'no-result-selected' | 'budget-exhausted' | 'aborted';
|
|
4599
4612
|
} | {
|
|
4600
4613
|
reason: 'cancelled';
|
|
4601
4614
|
readonly source: string;
|
|
@@ -4603,9 +4616,10 @@ type SupervisedResult<Out> = {
|
|
|
4603
4616
|
readonly operationId?: string;
|
|
4604
4617
|
})) | {
|
|
4605
4618
|
/**
|
|
4606
|
-
* The DRIVER-FAULT arm: `act()` rejected
|
|
4607
|
-
*
|
|
4608
|
-
*
|
|
4619
|
+
* The DRIVER-FAULT arm: `act()` rejected and no lifecycle cause (breaker/abort/budget/every
|
|
4620
|
+
* child down) outranks it — so nothing about the tree explains the failure and the driver's
|
|
4621
|
+
* own rejection is the only thing that does. It is therefore REQUIRED here. One down child
|
|
4622
|
+
* among delivered siblings does not outrank it: that count rides `downCount`.
|
|
4609
4623
|
* `all-children-down` with `downCount: 0` used to be indistinguishable from an honest empty
|
|
4610
4624
|
* result; this arm is that configuration/authoring fault, named.
|
|
4611
4625
|
*/
|
|
@@ -4690,4 +4704,4 @@ interface WidenGate<Out> {
|
|
|
4690
4704
|
}
|
|
4691
4705
|
//#endregion
|
|
4692
4706
|
export { SpawnPrior as $, captureHarnessTranscript as $n, LoopPlanPayload as $r, RuntimeStreamEventCollector as $t, NodeId as A, AgentRuntimeEventSink as Ai, RetainedPendingCause as An, BudgetPoolRestore as Ar, EvalRunEvent as At, ResumedWork as B, RunAgentTaskOptions as Bi, RecoverRetainedInteractiveRunOptions as Bn, spendFromUsageEvents as Br, RuntimeEventOtelOptions as Bt, ExecutorToolCall as C, startRuntimeRun as Ci, SessionTraceBox as Cn, RetainedRunReplayPoint as Cr, workerTraceHeaders as Ct, MaterializedModelIdentity as D, AgentExecutionBackend as Di, decodeToolPart as Dn, StartRetainedRunInEnvironmentOptions as Dr, mergeTraceEnv as Dt, MaterializedExecutionIdentity as E, AgentBackendInput as Ei, createPushTraceSource as En, RetainedRunTurnInput as Er, createPropagatingTraceEmitter as Et, ProviderModelExecutionEvidence as F, BackendErrorDetail as Fi, ScopeProgressInput as Fn, ReservationRejection as Fr, LoopSpanNode as Ft, RootSignal as G, RuntimeStreamEvent as Gi, StartRetainedInteractiveRunOptions as Gn, Iteration as Gr, createOtelExporter as Gt, RootHandle as H, RuntimeCanonicalStreamEvent as Hi, RetainedInteractiveEnvironmentInput as Hn, DefaultVerdict$1 as Hr, buildLoopSpanNodes as Ht, ResourceLimit as I, KnowledgeReadinessDecision as Ii, WorkerProgress as In, ReservationShortfall as Ir, OtelAttribute as It, Scope as J, HarnessTranscriptEvidence as Jn, LoopIterationDispatchPayload as Jr, loopEventToOtelSpan as Jt, RootStreamReceipt as K, HarnessTranscriptArtifact as Kn, LoopDecisionPayload as Kr, exportEvalRuns as Kt, ResourceSpend as L, OpenAIChatResponseFormat as Li, createActivityLog as Ln, ReservationStage as Lr, OtelExportConfig as Lt, NodeStatus as M, AgentTaskRunResult as Mi, ActivityNote as Mn, BudgetReconcileFault as Mr, EvalRunsExportConfig as Mt, ProfileMaterializationReceipt as N, AgentTaskSpec as Ni, DEFAULT_STALL_AFTER_MS as Nn, LeakedReservation as Nr, EvalRunsExportResult as Nt, NoWinnerError as O, AgentKnowledgeProvider as Oi, sandboxSessionTraceSource as On, StartRetainedRunOptions as Or, readTraceContextFromEnv as Ot, ProviderModelAttemptEvidence as P, AgentTaskStatus as Pi, ExecutorProgress as Pn, ReservationHolder as Pr, INTELLIGENCE_WIRE_VERSION as Pt, SpawnOpts as Q, ReadableEnvironment as Qn, LoopPlanDescription as Qr, RuntimeEventCollector as Qt, ResultBlobStore as R, OpenAIChatTool as Ri, readWorkerProgress as Rn, ReservationTicket as Rr, OtelExporter as Rt, ExecutorTeardownWarning as S, RuntimeRunStatus as Si, SessionMessageLike as Sn, RetainedRunIntentAdmission as Sr, workerTraceEnv as St, Handle as T, AgentBackendContext as Ti, TraceSource as Tn, RetainedRunStartMaterial as Tr, TraceContext as Tt, RootMaterialization as U, RuntimeSession as Ui, RetainedInteractiveRunHandle as Un, Driver as Ur, buildRuntimeEventOtelSpans as Ut, RetainedExecutionState as V, RunAgentTaskStreamOptions as Vi, RetainedInteractiveAdmissionHook as Vn, AgentRunSpec as Vr, buildLoopOtelSpans as Vt, RootProviderModelEvidence as W, RuntimeSessionStore as Wi, RetainedInteractiveStartMaterial as Wn, ExecCtx as Wr, createOpenInferenceFileExporter as Wt, SpawnEvent as X, HarnessTranscriptUnavailable as Xn, LoopIterationStartedPayload as Xr, padTraceId as Xt, Settled as Y, HarnessTranscriptFile as Yn, LoopIterationEndedPayload as Yr, padSpanId as Yt, SpawnJournal as Z, HarnessTranscriptUnavailableReason as Zn, LoopLineageOptions as Zr, toOtelAttributes as Zt, ExecutorMaterialization as _, RuntimeRunCost as _i, isWaitOutcome as _n, RetainedRunDispatchedAdmission as _r, WorkerTraceEvidence as _t, BudgetOverspend as a, LoopTraceEmitter as ai, createRuntimeEventCollector as an, ReconnectRetainedRunOptions as ar, SupervisedResult as at, ExecutorRegistry as b, RuntimeRunPersistenceAdapter as bi, validateWaitSpec as bn, RetainedRunEventOptions as br, WorkerTraceSeamCarrier as bt, EnvironmentTeardownReceipt as c, MountManifestEntry as ci, sanitizeKnowledgeReadinessReport as cn, RecoverRetainedRunResult as cr, TokenUsageProvenance as ct, ExecutorAccounting as d, RunProvenance as di, WaitOutcome as dn, RetainedInteractiveIntentAdmission as dr, UnknownMaterializationReason as dt, LoopResult as ei, RuntimeStreamEventSink as en, harnessTranscriptArtifact as er, SpawnRejection as et, ExecutorCancellation as f, SandboxClient as fi, WaitProbe as fn, RetainedInteractiveStartedAdmission as fr, UsageEvent as ft, ExecutorFactory as g, RuntimeRunCompleteInput as gi, createWaitProbes as gn, RetainedRunCancellation as gr, WorkerInteractiveUnavailableReason as gt, ExecutorExecutionBinding as h, Validator as hi, WaitSpec as hn, RetainedRunCancelOptions as hr, WorkerInteractiveSession as ht, Budget as i, LoopTokenUsage as ii, SanitizedKnowledgeRequirement as in, NativeContextContinuationInput as ir, SteerableRootHandle as it, NodeSnapshot as j, AgentTaskContext as ji, ActivityLog as jn, BudgetReadout as jr, EvalRunGeneration as jt, NodeExecutionIdentity as k, AgentRuntimeEvent as ki, RetainedChildRecovery as kn, BudgetPool as kr, traceContextToEnv as kt, ExecutionBindingReceipt as l, MountRecorder as li, sanitizeRuntimeStreamEvent as ln, RetainedInteractiveAdmission as lr, TreeView as lt, ExecutorContext as m, ValidationCtx as mi, WaitRejection as mn, RetainedRunAdmissionHook as mr, WidenGate as mt, AgentExecutionRef as n, LoopStartedPayload as ni, RuntimeTelemetryOptions as nn, NativeContextContinuationExecution as nr, SpendChannel as nt, BudgetViolation as o, LoopTraceEvent as oi, createRuntimeStreamEventCollector as on, RecoverRetainedRunIntentOptions as or, Supervisor as ot, ExecutorCancellationRequest as p, SelectionReceipt as pi, WaitProbeRegistry as pn, RetainedRunAdmission as pr, WaitOpts as pt, Runtime as q, HarnessTranscriptCapture as qn, LoopEndedPayload as qr, generateSpanId as qt, AgentSpec as r, LoopTeardownFailedPayload as ri, SanitizedKnowledgeReadinessReport as rn, NativeContextContinuationHandle as rr, SpendGap as rt, DefaultVerdict as s, LoopWinner as si, sanitizeAgentRuntimeEvent as sn, RecoverRetainedRunOptions as sr, SupervisorOpts as st, Agent as t, LoopSandboxPlacement as ti, RuntimeStreamEventSummary as tn, persistHarnessTranscript as tr, Spend as tt, Executor as u, OutputAdapter as ui, PendingWait as un, RetainedInteractiveEnvironmentAdmission as ur, UnconfirmedTeardown as ut, ExecutorNodeContext as v, RuntimeRunHandle as vi, pollFor as vn, RetainedRunEffect as vr, WorkerTraceUnavailableReason as vt, FleetYield as w, AgentAdapter as wi, ToolStepInput as wn, RetainedRunSnapshot as wr, workerTraceSeamKey as wt, ExecutorResult as x, RuntimeRunRow as xi, waitUntil as xn, RetainedRunHandle as xr, readWorkerTraceContext as xt, ExecutorProgressEvent as y, RuntimeRunOptions as yi, timerAt as yn, RetainedRunEnvironmentAdmission as yr, WorkerTraceResolver as yt, ResumedKeyState as z, OpenAIChatToolChoice as zi, ReconnectRetainedInteractiveRunOptions as zn, createBudgetPool as zr, OtelSpan as zt };
|
|
4693
|
-
//# sourceMappingURL=types-
|
|
4707
|
+
//# sourceMappingURL=types-BUhz284C.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as canonicalCandidateBytes, c as deepFreezeCandidate, d as omitTopLevelDigest, f as sha256Bytes, l as embeddedCandidateArtifact, o as canonicalCandidateDigest$1, u as immutableCandidateValue } from "./protected-redaction-
|
|
2
|
-
import { B as captureMaterializedWorkspace, F as assertNoGitIndirection, I as readCandidateGitTreeFiles, L as runCandidateGit, U as verifyBytes, W as verifyMaterializedWorkspace, d as persistCandidateOutputArtifact, st as isWellFormedUnicode, z as candidateWorkspaceManifest } from "./prepare-
|
|
1
|
+
import { a as canonicalCandidateBytes$1, c as deepFreezeCandidate, d as omitTopLevelDigest, f as sha256Bytes, l as embeddedCandidateArtifact, o as canonicalCandidateDigest$1, u as immutableCandidateValue } from "./protected-redaction-Fn1ETfJ-.js";
|
|
2
|
+
import { B as captureMaterializedWorkspace, F as assertNoGitIndirection, I as readCandidateGitTreeFiles, L as runCandidateGit, U as verifyBytes, W as verifyMaterializedWorkspace, d as persistCandidateOutputArtifact, st as isWellFormedUnicode, z as candidateWorkspaceManifest } from "./prepare-CibQrhfi.js";
|
|
3
3
|
import { agentCandidateBundleSchema } from "@tangle-network/agent-interface";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { constants } from "node:fs";
|
|
@@ -55,7 +55,7 @@ async function captureAgentCandidateWorkspaceFiles(input, options = {}) {
|
|
|
55
55
|
}
|
|
56
56
|
async function captureWorkspaceFiles(files, repository, limits, artifactPersistence) {
|
|
57
57
|
const material = candidateWorkspaceManifest(files);
|
|
58
|
-
const manifest = canonicalCandidateBytes(material);
|
|
58
|
+
const manifest = canonicalCandidateBytes$1(material);
|
|
59
59
|
const archive = await encodeWorkspaceArchive(files, repository, limits.maxArchiveBytes);
|
|
60
60
|
if (!artifactPersistence && (manifest.byteLength > limits.maxEmbeddedArtifactBytes || archive.byteLength > limits.maxEmbeddedArtifactBytes)) throw new Error("candidate workspace artifacts exceed maxEmbeddedArtifactBytes; artifactPersistence is required");
|
|
61
61
|
const manifestArtifact = await captureWorkspaceArtifact("manifest", manifest, artifactPersistence);
|
|
@@ -205,7 +205,7 @@ async function verifyCanonicalWorkspaceArchive(files, repository, expected, maxA
|
|
|
205
205
|
async function writeWorkspaceArchiveEntries(archive, files, repository) {
|
|
206
206
|
for (const file of files) await writeTarEntry(archive, `${workspaceEntryPrefix}${file.path}`, file.mode, file.bytes);
|
|
207
207
|
if (!repository) return;
|
|
208
|
-
const metadata = canonicalCandidateBytes({
|
|
208
|
+
const metadata = canonicalCandidateBytes$1({
|
|
209
209
|
kind: archiveKind,
|
|
210
210
|
headCommit: repository.headCommit,
|
|
211
211
|
headTree: repository.headTree,
|
|
@@ -285,7 +285,7 @@ function parseRepositoryMetadata(bytes, maxBundleBytes) {
|
|
|
285
285
|
throw new Error("candidate workspace archive repository metadata is invalid", { cause: error });
|
|
286
286
|
}
|
|
287
287
|
if (!isRecord(value) || Object.keys(value).sort().join(",") !== "bundle,headCommit,headTree,kind" || value.kind !== archiveKind || typeof value.headCommit !== "string" || typeof value.headTree !== "string" || !isRecord(value.bundle) || Object.keys(value.bundle).sort().join(",") !== "byteLength,sha256" || typeof value.bundle.sha256 !== "string" || !/^sha256:[a-f0-9]{64}$/.test(value.bundle.sha256) || !Number.isSafeInteger(value.bundle.byteLength) || value.bundle.byteLength <= 0 || value.bundle.byteLength > maxBundleBytes) throw new Error("candidate workspace archive repository is invalid");
|
|
288
|
-
if (!Buffer.from(canonicalCandidateBytes(value)).equals(Buffer.from(bytes))) throw new Error("candidate workspace archive repository metadata is not canonical");
|
|
288
|
+
if (!Buffer.from(canonicalCandidateBytes$1(value)).equals(Buffer.from(bytes))) throw new Error("candidate workspace archive repository metadata is not canonical");
|
|
289
289
|
assertGitObjectId(value.headCommit, "repository HEAD");
|
|
290
290
|
assertGitObjectId(value.headTree, "repository HEAD tree");
|
|
291
291
|
if (value.headCommit.length !== value.headTree.length) throw new Error("candidate repository HEAD and tree use different object formats");
|
|
@@ -445,9 +445,9 @@ async function materializeRepository(repository, destination) {
|
|
|
445
445
|
}
|
|
446
446
|
function assertArchiveMatchesSnapshot(files, snapshot) {
|
|
447
447
|
const material = candidateWorkspaceManifest(files);
|
|
448
|
-
const materialBytes = canonicalCandidateBytes(material);
|
|
448
|
+
const materialBytes = canonicalCandidateBytes$1(material);
|
|
449
449
|
verifyBytes(materialBytes, snapshot.manifest.sha256, snapshot.manifest.byteLength, "candidate workspace manifest");
|
|
450
|
-
if (canonicalCandidateDigest$1(material) !== snapshot.digest || !Buffer.from(materialBytes).equals(Buffer.from(canonicalCandidateBytes(snapshot.material)))) throw new Error("candidate workspace archive does not match its snapshot manifest");
|
|
450
|
+
if (canonicalCandidateDigest$1(material) !== snapshot.digest || !Buffer.from(materialBytes).equals(Buffer.from(canonicalCandidateBytes$1(snapshot.material)))) throw new Error("candidate workspace archive does not match its snapshot manifest");
|
|
451
451
|
}
|
|
452
452
|
function assertWorkspaceFilesWithinLimits(files, limits) {
|
|
453
453
|
if (files.length > limits.maxFiles) throw new Error("candidate workspace exceeds maxFiles");
|
|
@@ -569,4 +569,4 @@ const typedArrayByteLengthGetter = requireTypedArrayGetter("byteLength");
|
|
|
569
569
|
//#endregion
|
|
570
570
|
export { sealAgentCandidateBundle as i, captureAgentCandidateWorkspaceFiles as n, createAgentCandidateWorkspacePort as r, captureAgentCandidateWorkspace as t };
|
|
571
571
|
|
|
572
|
-
//# sourceMappingURL=workspace-archive-
|
|
572
|
+
//# sourceMappingURL=workspace-archive-DSRT4Tro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-archive-DSRT4Tro.js","names":["canonicalCandidateDigest","canonicalCandidateBytes","canonicalCandidateDigest","fsConstants"],"sources":["../src/candidate-execution/bundle.ts","../src/candidate-execution/workspace-archive.ts"],"sourcesContent":["import type { AgentCandidateBundle } from '@tangle-network/agent-interface'\nimport { agentCandidateBundleSchema } from '@tangle-network/agent-interface'\n\nimport { canonicalCandidateDigest, immutableCandidateValue, omitTopLevelDigest } from './digest'\n\n/** Exact candidate wire shape before the runtime computes its canonical digest. */\nexport type AgentCandidateBundleInput = Omit<AgentCandidateBundle, 'digest'>\n\n/** Validate and content-address a candidate bundle before it crosses an approval boundary. */\nexport function sealAgentCandidateBundle(input: AgentCandidateBundleInput): AgentCandidateBundle {\n const digest = canonicalCandidateDigest(input)\n const parsed = agentCandidateBundleSchema.parse({ ...input, digest })\n const parsedDigest = canonicalCandidateDigest(omitTopLevelDigest(parsed))\n if (parsedDigest !== digest) {\n throw new Error('candidate bundle changed while validating its canonical wire shape')\n }\n return immutableCandidateValue(parsed)\n}\n","import { randomUUID } from 'node:crypto'\nimport { constants as fsConstants } from 'node:fs'\nimport {\n lstat,\n mkdir,\n mkdtemp,\n open,\n readdir,\n readFile,\n realpath,\n rename,\n rm,\n writeFile,\n} from 'node:fs/promises'\nimport { tmpdir } from 'node:os'\nimport { dirname, isAbsolute, join, resolve, sep, win32 } from 'node:path'\nimport { isAnyArrayBuffer, isSharedArrayBuffer } from 'node:util/types'\nimport type {\n AgentCandidateCapturedArtifact,\n AgentCandidateWorkspaceSnapshotEvidence,\n} from '@tangle-network/agent-interface'\nimport { extract, type Pack, pack, type Extract as TarExtract } from 'tar-stream'\nimport {\n candidateWorkspaceManifest,\n captureMaterializedWorkspace,\n verifyBytes,\n verifyMaterializedWorkspace,\n} from './artifacts'\nimport {\n canonicalCandidateBytes,\n canonicalCandidateDigest,\n deepFreezeCandidate,\n embeddedCandidateArtifact,\n sha256Bytes,\n} from './digest'\nimport { isWellFormedUnicode } from './exact-object'\nimport {\n assertNoGitIndirection,\n readCandidateGitTreeFiles,\n runCandidateGit,\n} from './git-materialize'\nimport { persistCandidateOutputArtifact } from './output-artifacts'\nimport type {\n AgentCandidateExecutorWorkspaceFile,\n AgentCandidateOutputArtifactPort,\n AgentCandidateWorkspacePort,\n} from './types'\n\nconst archiveKind = 'agent-candidate-workspace-archive' as const\nconst workspaceEntryPrefix = 'workspace/'\nconst repositoryMetadataEntry = 'metadata/repository.json'\nconst repositoryBundleEntry = 'metadata/repository.bundle'\nconst fixedTarTime = new Date(0)\n\nexport interface AgentCandidateWorkspaceArchiveLimits {\n maxArchiveBytes: number\n maxEmbeddedArtifactBytes: number\n maxFiles: number\n maxFileBytes: number\n maxTotalFileBytes: number\n maxPathBytes: number\n maxRepositoryBundleBytes: number\n}\n\nconst defaultLimits: AgentCandidateWorkspaceArchiveLimits = Object.freeze({\n maxArchiveBytes: 512 * 1024 * 1024,\n maxEmbeddedArtifactBytes: 1024 * 1024,\n maxFiles: 50_000,\n maxFileBytes: 128 * 1024 * 1024,\n maxTotalFileBytes: 256 * 1024 * 1024,\n maxPathBytes: 4_096,\n maxRepositoryBundleBytes: 128 * 1024 * 1024,\n})\n\ninterface WorkspaceArchiveRepository {\n headCommit: string\n headTree: string\n bundle: {\n sha256: `sha256:${string}`\n byteLength: number\n bytes: Uint8Array\n }\n}\n\ninterface WorkspaceArchiveRepositoryMetadata {\n kind: typeof archiveKind\n headCommit: string\n headTree: string\n bundle: {\n sha256: `sha256:${string}`\n byteLength: number\n }\n}\n\ninterface DecodedWorkspaceArchive {\n files: Array<{ path: string; mode: number; bytes: Uint8Array }>\n repository?: WorkspaceArchiveRepository\n}\n\nexport interface CaptureAgentCandidateWorkspaceOptions {\n /** Include Git HEAD so task preparation can prove its exact commit and tree. */\n includeRepository?: boolean\n limits?: Partial<AgentCandidateWorkspaceArchiveLimits>\n /** Use the evaluator-owned artifact store when manifest or archive bytes should not be embedded. */\n artifactPersistence?: {\n executionId: string\n outputArtifacts: AgentCandidateOutputArtifactPort\n signal?: AbortSignal\n }\n}\n\nexport interface CreateAgentCandidateWorkspacePortOptions {\n limits?: Partial<AgentCandidateWorkspaceArchiveLimits>\n}\n\nexport interface CapturedAgentCandidateWorkspace {\n readonly snapshot: AgentCandidateWorkspaceSnapshotEvidence\n /** Caller-owned bytes accepted by createAgentCandidateWorkspacePort. */\n readonly archive: Uint8Array\n}\n\n/** Capture one exact regular-file workspace for immutable candidate execution. */\nexport async function captureAgentCandidateWorkspace(\n rootInput: string,\n options: CaptureAgentCandidateWorkspaceOptions = {},\n): Promise<CapturedAgentCandidateWorkspace> {\n const root = resolve(rootInput)\n const limits = workspaceLimits(options.limits)\n const captured = options.includeRepository\n ? await captureRepository(root, limits)\n : await captureMaterializedWorkspace(root, {\n limits: {\n maxFiles: limits.maxFiles,\n maxFileBytes: limits.maxFileBytes,\n maxTotalFileBytes: limits.maxTotalFileBytes,\n },\n })\n assertWorkspaceFilesWithinLimits(captured.files, limits)\n const repository = 'repository' in captured ? captured.repository : undefined\n return captureWorkspaceFiles(captured.files, repository, limits, options.artifactPersistence)\n}\n\n/** Capture detached files returned by a remote executor into the standard archive. */\nexport async function captureAgentCandidateWorkspaceFiles(\n input: readonly AgentCandidateExecutorWorkspaceFile[],\n options: Omit<CaptureAgentCandidateWorkspaceOptions, 'includeRepository'> = {},\n): Promise<CapturedAgentCandidateWorkspace> {\n const limits = workspaceLimits(options.limits)\n return captureWorkspaceFiles(\n normalizeWorkspaceFiles(input, limits),\n undefined,\n limits,\n options.artifactPersistence,\n )\n}\n\nasync function captureWorkspaceFiles(\n files: readonly AgentCandidateExecutorWorkspaceFile[],\n repository: WorkspaceArchiveRepository | undefined,\n limits: AgentCandidateWorkspaceArchiveLimits,\n artifactPersistence: CaptureAgentCandidateWorkspaceOptions['artifactPersistence'],\n): Promise<CapturedAgentCandidateWorkspace> {\n const material = candidateWorkspaceManifest(files)\n const manifest = canonicalCandidateBytes(material)\n const archive = await encodeWorkspaceArchive(files, repository, limits.maxArchiveBytes)\n if (\n !artifactPersistence &&\n (manifest.byteLength > limits.maxEmbeddedArtifactBytes ||\n archive.byteLength > limits.maxEmbeddedArtifactBytes)\n ) {\n throw new Error(\n 'candidate workspace artifacts exceed maxEmbeddedArtifactBytes; artifactPersistence is required',\n )\n }\n const manifestArtifact = await captureWorkspaceArtifact('manifest', manifest, artifactPersistence)\n const archiveArtifact = await captureWorkspaceArtifact('archive', archive, artifactPersistence)\n const snapshot = deepFreezeCandidate({\n kind: 'agent-candidate-workspace-snapshot',\n digest: canonicalCandidateDigest(material),\n material,\n manifest: manifestArtifact,\n archive: archiveArtifact,\n } satisfies AgentCandidateWorkspaceSnapshotEvidence)\n return Object.freeze({ snapshot, archive })\n}\n\nasync function captureWorkspaceArtifact(\n kind: 'manifest' | 'archive',\n bytes: Uint8Array,\n persistence: CaptureAgentCandidateWorkspaceOptions['artifactPersistence'],\n): Promise<AgentCandidateCapturedArtifact> {\n if (!persistence) return embeddedCandidateArtifact(bytes)\n if (!persistence.executionId.trim()) {\n throw new Error('candidate workspace artifact persistence requires an executionId')\n }\n return persistCandidateOutputArtifact(persistence.outputArtifacts, {\n executionId: persistence.executionId,\n purpose: kind === 'manifest' ? 'candidate-workspace-manifest' : 'candidate-workspace-archive',\n bytes,\n ...(persistence.signal ? { signal: persistence.signal } : {}),\n })\n}\n\n/** Create the standard bounded materializer for candidate execution ports. */\nexport function createAgentCandidateWorkspacePort(\n options: CreateAgentCandidateWorkspacePortOptions = {},\n): AgentCandidateWorkspacePort {\n const limits = workspaceLimits(options.limits)\n const port: AgentCandidateWorkspacePort = {\n materialize: async ({ role, snapshot, archive, destination }) => {\n await materializeAgentCandidateWorkspace({\n role,\n snapshot,\n archive,\n destination,\n limits,\n })\n },\n }\n return Object.freeze(port)\n}\n\nasync function materializeAgentCandidateWorkspace(input: {\n role: 'task' | 'candidate' | 'knowledge' | 'memory'\n snapshot: AgentCandidateWorkspaceSnapshotEvidence\n archive: Uint8Array\n destination: string\n limits: AgentCandidateWorkspaceArchiveLimits\n}): Promise<void> {\n verifyBytes(\n input.archive,\n input.snapshot.archive.sha256,\n input.snapshot.archive.byteLength,\n 'candidate workspace archive',\n )\n const decoded = await parseWorkspaceArchive(input.archive, input.limits)\n if (decoded.repository && input.role !== 'task') {\n throw new Error('only task workspaces may carry a Git repository')\n }\n assertArchiveMatchesSnapshot(decoded.files, input.snapshot)\n const destination = resolve(input.destination)\n await prepareEmptyDestination(destination)\n const staging = await mkdtemp(`${destination}.materializing-`)\n try {\n await writeWorkspaceFiles(staging, decoded.files)\n if (decoded.repository) {\n await materializeRepository(decoded.repository, staging)\n }\n await verifyMaterializedWorkspace(staging, input.snapshot.material, {\n ignoredProtectedRootEntries: decoded.repository ? ['.git'] : [],\n })\n await rename(staging, destination)\n } catch (error) {\n await rm(staging, { recursive: true, force: true })\n await rm(destination, { recursive: true, force: true })\n throw error\n }\n}\n\nasync function captureRepository(\n requestedRoot: string,\n limits: AgentCandidateWorkspaceArchiveLimits,\n): Promise<{\n files: Array<{ path: string; mode: number; bytes: Uint8Array }>\n repository: WorkspaceArchiveRepository\n}> {\n const requestedStats = await lstat(requestedRoot)\n if (!requestedStats.isDirectory() || requestedStats.isSymbolicLink()) {\n throw new Error('candidate repository root must be a real directory')\n }\n // Capture the RESOLVED root. The property this guards is that capture starts at one real\n // worktree root with no aliasing, which resolving satisfies directly — rejecting a symlinked\n // prefix outright does not, and makes capture impossible on macOS, where the OS itself hands\n // out temp paths under /var, a symlink to /private/var. Git reports a resolved path, so the\n // worktree-root comparison below needs the resolved form on both sides.\n const root = await realpath(requestedRoot)\n const resolvedStats = await lstat(root)\n if (!resolvedStats.isDirectory() || resolvedStats.isSymbolicLink()) {\n throw new Error('candidate repository root must resolve to a real directory')\n }\n const topLevel = (await runCandidateGit(root, ['rev-parse', '--show-toplevel'])).stdout\n .toString('utf8')\n .trim()\n if ((await realpath(resolve(topLevel))) !== root) {\n throw new Error('candidate repository capture must start at the Git worktree root')\n }\n const gitDir = resolve(\n (await runCandidateGit(root, ['rev-parse', '--absolute-git-dir'])).stdout\n .toString('utf8')\n .trim(),\n )\n if ((await realpath(gitDir)) !== gitDir || gitDir.includes(':')) {\n throw new Error('candidate repository Git object store has an unsupported path')\n }\n await assertNoGitIndirection(root, gitDir, 'candidate repository')\n const headCommit = (await runCandidateGit(root, ['rev-parse', 'HEAD'])).stdout\n .toString('utf8')\n .trim()\n const headTree = (await runCandidateGit(root, ['rev-parse', 'HEAD^{tree}'])).stdout\n .toString('utf8')\n .trim()\n assertGitObjectId(headCommit, 'HEAD')\n assertGitObjectId(headTree, 'HEAD tree')\n if (headCommit.length !== headTree.length) {\n throw new Error('candidate repository HEAD and tree use different object formats')\n }\n const files = await readCandidateGitTreeFiles(root, headTree, {}, limits)\n assertWorkspaceFilesWithinLimits(files, limits)\n const reachableBytesText = (\n await runCandidateGit(root, ['rev-list', '--disk-usage', '--objects', 'HEAD'])\n ).stdout\n .toString('utf8')\n .trim()\n const reachableBytes = Number(reachableBytesText)\n if (!Number.isSafeInteger(reachableBytes) || reachableBytes < 0) {\n throw new Error('candidate repository reachable size is invalid')\n }\n if (reachableBytes > limits.maxRepositoryBundleBytes) {\n throw new Error('candidate repository exceeds maxRepositoryBundleBytes')\n }\n const temporary = await mkdtemp(join(tmpdir(), 'agent-candidate-workspace-bundle-'))\n const bundlePath = join(temporary, `${randomUUID()}.bundle`)\n try {\n await runCandidateGit(root, ['bundle', 'create', bundlePath, 'HEAD'])\n const bundle = Uint8Array.from(await readFile(bundlePath))\n if (bundle.byteLength > limits.maxRepositoryBundleBytes) {\n throw new Error('candidate repository bundle exceeds maxRepositoryBundleBytes')\n }\n return {\n files,\n repository: {\n headCommit,\n headTree,\n bundle: {\n sha256: sha256Bytes(bundle),\n byteLength: bundle.byteLength,\n bytes: bundle,\n },\n },\n }\n } finally {\n await rm(temporary, { recursive: true, force: true })\n }\n}\n\nasync function encodeWorkspaceArchive(\n files: ReadonlyArray<{ path: string; mode: number; bytes: Uint8Array }>,\n repository: WorkspaceArchiveRepository | undefined,\n maxArchiveBytes: number,\n): Promise<Uint8Array> {\n const archive = pack()\n const output = collectStream(archive, maxArchiveBytes, 'candidate workspace archive')\n try {\n await writeWorkspaceArchiveEntries(archive, files, repository)\n archive.finalize()\n return await output\n } catch (error) {\n archive.destroy(error instanceof Error ? error : new Error(String(error)))\n await output.catch(() => undefined)\n throw error\n }\n}\n\nasync function verifyCanonicalWorkspaceArchive(\n files: ReadonlyArray<{ path: string; mode: number; bytes: Uint8Array }>,\n repository: WorkspaceArchiveRepository | undefined,\n expected: Uint8Array,\n maxArchiveBytes: number,\n): Promise<void> {\n const archive = pack()\n const comparison = streamEqualsBytes(\n archive,\n expected,\n maxArchiveBytes,\n 'candidate workspace archive',\n )\n try {\n await writeWorkspaceArchiveEntries(archive, files, repository)\n archive.finalize()\n if (!(await comparison)) throw new Error('candidate workspace tar is not canonical')\n } catch (error) {\n archive.destroy(error instanceof Error ? error : new Error(String(error)))\n await comparison.catch(() => undefined)\n throw error\n }\n}\n\nasync function writeWorkspaceArchiveEntries(\n archive: Pack,\n files: ReadonlyArray<{ path: string; mode: number; bytes: Uint8Array }>,\n repository: WorkspaceArchiveRepository | undefined,\n): Promise<void> {\n for (const file of files) {\n await writeTarEntry(archive, `${workspaceEntryPrefix}${file.path}`, file.mode, file.bytes)\n }\n if (!repository) return\n const metadata = canonicalCandidateBytes({\n kind: archiveKind,\n headCommit: repository.headCommit,\n headTree: repository.headTree,\n bundle: {\n sha256: repository.bundle.sha256,\n byteLength: repository.bundle.byteLength,\n },\n } satisfies WorkspaceArchiveRepositoryMetadata)\n await writeTarEntry(archive, repositoryMetadataEntry, 0o600, metadata)\n await writeTarEntry(archive, repositoryBundleEntry, 0o600, repository.bundle.bytes)\n}\n\nasync function parseWorkspaceArchive(\n bytes: Uint8Array,\n limits: AgentCandidateWorkspaceArchiveLimits,\n): Promise<DecodedWorkspaceArchive> {\n if (bytes.byteLength > limits.maxArchiveBytes) {\n throw new Error('candidate workspace archive exceeds maxArchiveBytes')\n }\n const parser = extract()\n const files: DecodedWorkspaceArchive['files'] = []\n const observedEntryNames = new Set<string>()\n const observedPaths = new Set<string>()\n let totalBytes = 0\n let retainedEntryBytes = 0\n let previousPath: string | undefined\n let repositoryMetadata: WorkspaceArchiveRepositoryMetadata | undefined\n let repositoryBundle: Uint8Array | undefined\n const decoded = (async () => {\n for await (const entry of parser) {\n const name = entry.header.name\n if (\n entry.header.type !== 'file' ||\n typeof name !== 'string' ||\n observedEntryNames.has(name)\n ) {\n throw new Error('candidate workspace tar contains an invalid entry')\n }\n observedEntryNames.add(name)\n if (name.startsWith(workspaceEntryPrefix)) {\n if (files.length >= limits.maxFiles) {\n throw new Error('candidate workspace archive has an invalid file count')\n }\n const path = safeArchivePath(name.slice(workspaceEntryPrefix.length), limits.maxPathBytes)\n if (!isWorkspaceFileMode(entry.header.mode)) {\n throw new Error(`candidate workspace archive has an unsupported mode: ${path}`)\n }\n assertRetainedArchiveSize(bytes.byteLength, retainedEntryBytes, entry.header.size, limits)\n const fileBytes = await readTarEntry(entry, limits.maxFileBytes, `workspace file ${path}`)\n retainedEntryBytes += fileBytes.byteLength\n assertWorkspacePathOrder(\n path,\n previousPath,\n observedPaths,\n 'candidate workspace archive paths must be unique and sorted',\n )\n previousPath = path\n if (fileBytes.byteLength > limits.maxTotalFileBytes - totalBytes) {\n throw new Error('candidate workspace archive exceeds maxTotalFileBytes')\n }\n totalBytes += fileBytes.byteLength\n files.push({ path, mode: entry.header.mode, bytes: fileBytes })\n } else if (name === repositoryMetadataEntry) {\n if (entry.header.mode !== 0o600 || repositoryMetadata) {\n throw new Error('candidate workspace archive repository metadata is invalid')\n }\n assertRetainedArchiveSize(bytes.byteLength, retainedEntryBytes, entry.header.size, limits)\n const metadataBytes = await readTarEntry(\n entry,\n limits.maxPathBytes,\n 'candidate repository metadata',\n )\n retainedEntryBytes += metadataBytes.byteLength\n repositoryMetadata = parseRepositoryMetadata(metadataBytes, limits.maxRepositoryBundleBytes)\n } else if (name === repositoryBundleEntry) {\n if (entry.header.mode !== 0o600 || repositoryBundle) {\n throw new Error('candidate workspace archive repository bundle is invalid')\n }\n assertRetainedArchiveSize(bytes.byteLength, retainedEntryBytes, entry.header.size, limits)\n repositoryBundle = await readTarEntry(\n entry,\n limits.maxRepositoryBundleBytes,\n 'candidate Git bundle',\n )\n retainedEntryBytes += repositoryBundle.byteLength\n } else {\n throw new Error(`candidate workspace tar contains an unsupported entry: ${name}`)\n }\n }\n if (Boolean(repositoryMetadata) !== Boolean(repositoryBundle)) {\n throw new Error('candidate workspace archive repository evidence is incomplete')\n }\n const repository =\n repositoryMetadata && repositoryBundle\n ? repositoryFromTar(repositoryMetadata, repositoryBundle)\n : undefined\n return { files, ...(repository ? { repository } : {}) }\n })()\n parser.end(Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength))\n const result = await decoded\n await verifyCanonicalWorkspaceArchive(\n result.files,\n result.repository,\n bytes,\n limits.maxArchiveBytes,\n )\n return result\n}\n\nfunction assertRetainedArchiveSize(\n archiveBytes: number,\n retainedEntryBytes: number,\n entryBytes: number | undefined,\n limits: AgentCandidateWorkspaceArchiveLimits,\n): void {\n if (\n !Number.isSafeInteger(entryBytes) ||\n entryBytes === undefined ||\n entryBytes < 0 ||\n entryBytes > limits.maxArchiveBytes - archiveBytes - retainedEntryBytes\n ) {\n throw new Error('candidate workspace archive exceeds maxArchiveBytes while decoding')\n }\n}\n\nfunction parseRepositoryMetadata(\n bytes: Uint8Array,\n maxBundleBytes: number,\n): WorkspaceArchiveRepositoryMetadata {\n let value: unknown\n try {\n value = JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes))\n } catch (error) {\n throw new Error('candidate workspace archive repository metadata is invalid', { cause: error })\n }\n if (\n !isRecord(value) ||\n Object.keys(value).sort().join(',') !== 'bundle,headCommit,headTree,kind' ||\n value.kind !== archiveKind ||\n typeof value.headCommit !== 'string' ||\n typeof value.headTree !== 'string' ||\n !isRecord(value.bundle) ||\n Object.keys(value.bundle).sort().join(',') !== 'byteLength,sha256' ||\n typeof value.bundle.sha256 !== 'string' ||\n !/^sha256:[a-f0-9]{64}$/.test(value.bundle.sha256) ||\n !Number.isSafeInteger(value.bundle.byteLength) ||\n (value.bundle.byteLength as number) <= 0 ||\n (value.bundle.byteLength as number) > maxBundleBytes\n ) {\n throw new Error('candidate workspace archive repository is invalid')\n }\n if (!Buffer.from(canonicalCandidateBytes(value)).equals(Buffer.from(bytes))) {\n throw new Error('candidate workspace archive repository metadata is not canonical')\n }\n assertGitObjectId(value.headCommit, 'repository HEAD')\n assertGitObjectId(value.headTree, 'repository HEAD tree')\n if (value.headCommit.length !== value.headTree.length) {\n throw new Error('candidate repository HEAD and tree use different object formats')\n }\n return {\n kind: archiveKind,\n headCommit: value.headCommit,\n headTree: value.headTree,\n bundle: {\n sha256: value.bundle.sha256 as `sha256:${string}`,\n byteLength: value.bundle.byteLength as number,\n },\n }\n}\n\nfunction repositoryFromTar(\n metadata: WorkspaceArchiveRepositoryMetadata,\n bundle: Uint8Array,\n): WorkspaceArchiveRepository {\n verifyBytes(bundle, metadata.bundle.sha256, metadata.bundle.byteLength, 'candidate Git bundle')\n return {\n headCommit: metadata.headCommit,\n headTree: metadata.headTree,\n bundle: { ...metadata.bundle, bytes: bundle },\n }\n}\n\nasync function writeTarEntry(\n archive: Pack,\n name: string,\n mode: number,\n bytes: Uint8Array,\n): Promise<void> {\n await new Promise<void>((resolveEntry, rejectEntry) => {\n archive.entry(\n {\n name,\n mode,\n uid: 0,\n gid: 0,\n size: bytes.byteLength,\n mtime: fixedTarTime,\n type: 'file',\n uname: '',\n gname: '',\n },\n Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength),\n (error) => (error ? rejectEntry(error) : resolveEntry()),\n )\n })\n}\n\ntype TarEntry = TarExtract extends AsyncIterable<infer Entry> ? Entry : never\n\nasync function readTarEntry(entry: TarEntry, maxBytes: number, label: string): Promise<Uint8Array> {\n const size = entry.header.size\n if (!Number.isSafeInteger(size) || size === undefined || size < 0 || size > maxBytes) {\n throw new Error(`${label} has an invalid tar size`)\n }\n const bytes = await collectStream(entry, maxBytes, label)\n if (bytes.byteLength !== size) throw new Error(`${label} differs from its tar size`)\n return bytes\n}\n\nasync function collectStream(\n stream: AsyncIterable<unknown>,\n maxBytes: number,\n label: string,\n): Promise<Uint8Array> {\n const chunks: Buffer[] = []\n let totalBytes = 0\n for await (const chunk of stream) {\n if (!(chunk instanceof Uint8Array)) {\n throw new Error(`${label} emitted a non-byte chunk`)\n }\n if (chunk.byteLength > maxBytes - totalBytes) {\n const error = new Error(`${label} exceeds its size limit`)\n if ('destroy' in stream && typeof stream.destroy === 'function') stream.destroy(error)\n throw error\n }\n const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)\n chunks.push(bytes)\n totalBytes += bytes.byteLength\n }\n return Buffer.concat(chunks, totalBytes)\n}\n\nasync function streamEqualsBytes(\n stream: AsyncIterable<unknown>,\n expected: Uint8Array,\n maxBytes: number,\n label: string,\n): Promise<boolean> {\n const expectedBuffer = Buffer.from(expected.buffer, expected.byteOffset, expected.byteLength)\n let equal = true\n let offset = 0\n for await (const chunk of stream) {\n if (!(chunk instanceof Uint8Array)) {\n throw new Error(`${label} emitted a non-byte chunk`)\n }\n if (chunk.byteLength > maxBytes - offset) {\n const error = new Error(`${label} exceeds its size limit`)\n if ('destroy' in stream && typeof stream.destroy === 'function') stream.destroy(error)\n throw error\n }\n const observed = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength)\n if (\n offset + observed.byteLength > expectedBuffer.byteLength ||\n !observed.equals(expectedBuffer.subarray(offset, offset + observed.byteLength))\n ) {\n equal = false\n }\n offset += observed.byteLength\n }\n return equal && offset === expectedBuffer.byteLength\n}\n\nasync function prepareEmptyDestination(destination: string): Promise<void> {\n await mkdir(destination, { recursive: true, mode: 0o700 })\n const stats = await lstat(destination)\n if (!stats.isDirectory() || stats.isSymbolicLink()) {\n throw new Error('candidate workspace destination must be a real directory')\n }\n // A symlinked PREFIX is the OS's own doing on macOS, where temp paths live under /var, a\n // symlink to /private/var. What must hold is that the destination itself is a real\n // directory, which both this check and the lstat above require.\n const resolvedDestination = await realpath(destination)\n const resolvedStats = await lstat(resolvedDestination)\n if (!resolvedStats.isDirectory() || resolvedStats.isSymbolicLink()) {\n throw new Error('candidate workspace destination must resolve to a real directory')\n }\n if ((await readdir(destination)).length > 0) {\n throw new Error('candidate workspace destination must be empty')\n }\n}\n\nasync function writeWorkspaceFiles(\n destination: string,\n files: ReadonlyArray<{ path: string; mode: number; bytes: Uint8Array }>,\n): Promise<void> {\n for (const file of files) {\n const path = workspacePath(destination, file.path)\n await mkdir(dirname(path), { recursive: true, mode: 0o700 })\n const descriptor = await open(\n path,\n fsConstants.O_WRONLY |\n fsConstants.O_CREAT |\n fsConstants.O_EXCL |\n (typeof fsConstants.O_NOFOLLOW === 'number' ? fsConstants.O_NOFOLLOW : 0),\n 0o600,\n )\n try {\n await descriptor.writeFile(file.bytes)\n const stats = await descriptor.stat()\n if (!stats.isFile() || stats.nlink !== 1) {\n throw new Error(`candidate workspace file identity changed while writing: ${file.path}`)\n }\n await descriptor.chmod(file.mode)\n } finally {\n await descriptor.close()\n }\n }\n}\n\nasync function materializeRepository(\n repository: WorkspaceArchiveRepository,\n destination: string,\n): Promise<void> {\n const temporary = await mkdtemp(join(tmpdir(), 'agent-candidate-workspace-bundle-'))\n const bundlePath = join(temporary, `${randomUUID()}.bundle`)\n try {\n await writeFile(bundlePath, repository.bundle.bytes, { flag: 'wx', mode: 0o600 })\n await runCandidateGit(destination, [\n 'init',\n '--quiet',\n '--initial-branch=candidate',\n `--object-format=${repository.headCommit.length === 64 ? 'sha256' : 'sha1'}`,\n ])\n await runCandidateGit(destination, ['bundle', 'verify', bundlePath])\n await runCandidateGit(destination, ['bundle', 'unbundle', bundlePath])\n const objectType = (\n await runCandidateGit(destination, ['cat-file', '-t', repository.headCommit])\n ).stdout\n .toString('utf8')\n .trim()\n if (objectType !== 'commit') throw new Error('candidate repository HEAD is not a commit')\n const observedTree = (\n await runCandidateGit(destination, ['rev-parse', `${repository.headCommit}^{tree}`])\n ).stdout\n .toString('utf8')\n .trim()\n if (observedTree !== repository.headTree) {\n throw new Error('candidate repository bundle HEAD tree changed')\n }\n await runCandidateGit(destination, ['update-ref', '--no-deref', 'HEAD', repository.headCommit])\n await runCandidateGit(destination, ['read-tree', repository.headTree])\n const status = (\n await runCandidateGit(destination, ['status', '--porcelain=v1', '--untracked-files=all'])\n ).stdout\n .toString('utf8')\n .trim()\n if (status) throw new Error('candidate repository files do not exactly match HEAD')\n } finally {\n await rm(temporary, { recursive: true, force: true })\n }\n}\n\nfunction assertArchiveMatchesSnapshot(\n files: ReadonlyArray<{ path: string; mode: number; bytes: Uint8Array }>,\n snapshot: AgentCandidateWorkspaceSnapshotEvidence,\n): void {\n const material = candidateWorkspaceManifest(files)\n const materialBytes = canonicalCandidateBytes(material)\n verifyBytes(\n materialBytes,\n snapshot.manifest.sha256,\n snapshot.manifest.byteLength,\n 'candidate workspace manifest',\n )\n if (\n canonicalCandidateDigest(material) !== snapshot.digest ||\n !Buffer.from(materialBytes).equals(Buffer.from(canonicalCandidateBytes(snapshot.material)))\n ) {\n throw new Error('candidate workspace archive does not match its snapshot manifest')\n }\n}\n\nfunction assertWorkspaceFilesWithinLimits(\n files: ReadonlyArray<{ path: string; mode: number; bytes: Uint8Array }>,\n limits: AgentCandidateWorkspaceArchiveLimits,\n): void {\n if (files.length > limits.maxFiles) {\n throw new Error('candidate workspace exceeds maxFiles')\n }\n let totalBytes = 0\n let previousPath: string | undefined\n const observedPaths = new Set<string>()\n for (const file of files) {\n const path = safeArchivePath(file.path, limits.maxPathBytes)\n assertWorkspacePathOrder(\n path,\n previousPath,\n observedPaths,\n 'candidate workspace paths must be unique and sorted',\n )\n previousPath = path\n if (!isWorkspaceFileMode(file.mode)) {\n throw new Error(`candidate workspace file has unsupported mode: ${path}`)\n }\n if (file.bytes.byteLength > limits.maxFileBytes) {\n throw new Error(`candidate workspace file exceeds maxFileBytes: ${path}`)\n }\n totalBytes += file.bytes.byteLength\n if (totalBytes > limits.maxTotalFileBytes) {\n throw new Error('candidate workspace exceeds maxTotalFileBytes')\n }\n }\n}\n\nfunction normalizeWorkspaceFiles(\n input: readonly AgentCandidateExecutorWorkspaceFile[],\n limits: AgentCandidateWorkspaceArchiveLimits,\n): AgentCandidateExecutorWorkspaceFile[] {\n if (!Array.isArray(input)) {\n throw new Error('candidate workspace files must be an array')\n }\n const fileCount = input.length\n if (fileCount > limits.maxFiles) {\n throw new Error('candidate workspace exceeds maxFiles')\n }\n let totalBytes = 0\n const files: AgentCandidateExecutorWorkspaceFile[] = []\n for (let index = 0; index < fileCount; index++) {\n const inputFile = input[index]\n if (!isRecord(inputFile) || Object.keys(inputFile).sort().join(',') !== 'bytes,mode,path') {\n throw new Error(`candidate workspace file ${index} is invalid`)\n }\n const descriptors = Object.getOwnPropertyDescriptors(inputFile)\n if (\n !('value' in (descriptors.path ?? {})) ||\n !('value' in (descriptors.mode ?? {})) ||\n !('value' in (descriptors.bytes ?? {}))\n ) {\n throw new Error(`candidate workspace file ${index} must use fixed values`)\n }\n const path = safeArchivePath(descriptors.path?.value, limits.maxPathBytes)\n const mode = descriptors.mode?.value\n const inputBytes = descriptors.bytes?.value\n if (!isWorkspaceFileMode(mode)) {\n throw new Error(`candidate workspace file has unsupported mode: ${path}`)\n }\n const view = inspectWorkspaceBytes(inputBytes, path)\n if (view.byteLength > limits.maxFileBytes) {\n throw new Error(`candidate workspace file exceeds maxFileBytes: ${path}`)\n }\n if (view.byteLength > limits.maxTotalFileBytes - totalBytes) {\n throw new Error('candidate workspace exceeds maxTotalFileBytes')\n }\n if (view.byteLength > Math.max(0, limits.maxArchiveBytes - 1024)) {\n throw new Error('candidate workspace archive exceeds maxArchiveBytes')\n }\n totalBytes += view.byteLength\n files.push({ path, mode, bytes: detachWorkspaceBytes(view) })\n }\n files.sort((left, right) => (left.path < right.path ? -1 : left.path > right.path ? 1 : 0))\n assertWorkspaceFilesWithinLimits(files, limits)\n return files\n}\n\nfunction isWorkspaceFileMode(value: unknown): value is number {\n return Number.isSafeInteger(value) && (value as number) >= 0 && (value as number) <= 0o777\n}\n\nfunction workspaceLimits(\n overrides: Partial<AgentCandidateWorkspaceArchiveLimits> | undefined,\n): AgentCandidateWorkspaceArchiveLimits {\n const limits = { ...defaultLimits, ...overrides }\n for (const [name, value] of Object.entries(limits)) {\n if (!Number.isSafeInteger(value) || value <= 0) {\n throw new Error(`candidate workspace ${name} must be a positive safe integer`)\n }\n }\n return Object.freeze(limits)\n}\n\nfunction safeArchivePath(value: unknown, maxPathBytes: number): string {\n if (\n typeof value !== 'string' ||\n !value ||\n !isWellFormedUnicode(value) ||\n Buffer.byteLength(value, 'utf8') > maxPathBytes ||\n isAbsolute(value) ||\n win32.isAbsolute(value) ||\n value.includes('\\\\') ||\n value.includes('\\0') ||\n hasControlCharacter(value) ||\n value.split('/').some((part) => !part || part === '.' || part === '..') ||\n ['.git', '.sidecar'].includes(value.split('/')[0]?.toLowerCase() ?? '')\n ) {\n throw new Error(`candidate workspace archive contains an unsafe path: ${String(value)}`)\n }\n return value\n}\n\nfunction assertWorkspacePathOrder(\n path: string,\n previousPath: string | undefined,\n observedPaths: Set<string>,\n errorMessage: string,\n): void {\n if (previousPath !== undefined && previousPath >= path) throw new Error(errorMessage)\n for (let slash = path.indexOf('/'); slash !== -1; slash = path.indexOf('/', slash + 1)) {\n if (observedPaths.has(path.slice(0, slash))) throw new Error(errorMessage)\n }\n observedPaths.add(path)\n}\n\nfunction inspectWorkspaceBytes(\n input: unknown,\n path: string,\n): { buffer: ArrayBuffer; byteOffset: number; byteLength: number } {\n let buffer: ArrayBufferLike\n let byteOffset: number\n let byteLength: number\n try {\n buffer = typedArrayBufferGetter.call(input as Uint8Array) as ArrayBufferLike\n byteOffset = typedArrayByteOffsetGetter.call(input as Uint8Array) as number\n byteLength = typedArrayByteLengthGetter.call(input as Uint8Array) as number\n } catch {\n throw new Error(`candidate workspace file bytes are invalid: ${path}`)\n }\n if (isSharedArrayBuffer(buffer)) {\n throw new Error(`candidate workspace file uses shared bytes: ${path}`)\n }\n if (!isAnyArrayBuffer(buffer)) {\n throw new Error(`candidate workspace file bytes are invalid: ${path}`)\n }\n return { buffer, byteOffset, byteLength }\n}\n\nfunction detachWorkspaceBytes(input: {\n buffer: ArrayBuffer\n byteOffset: number\n byteLength: number\n}): Uint8Array {\n const { buffer, byteOffset, byteLength } = input\n const copy = new Uint8Array(byteLength)\n Uint8Array.prototype.set.call(copy, new Uint8Array(buffer, byteOffset, byteLength))\n return copy\n}\n\nfunction workspacePath(root: string, relativePath: string): string {\n const path = resolve(root, relativePath)\n if (!path.startsWith(`${root}${sep}`)) {\n throw new Error(`candidate workspace archive path escapes its destination: ${relativePath}`)\n }\n return path\n}\n\nfunction assertGitObjectId(value: string, label: string): void {\n if (!/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/.test(value)) {\n throw new Error(`candidate repository ${label} is not a Git object id`)\n }\n}\n\nfunction hasControlCharacter(value: string): boolean {\n for (let index = 0; index < value.length; index++) {\n const code = value.charCodeAt(index)\n if (code < 0x20 || code === 0x7f) return true\n }\n return false\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\ntype TypedArrayGetter = (this: Uint8Array) => unknown\n\nfunction requireTypedArrayGetter(name: 'buffer' | 'byteOffset' | 'byteLength'): TypedArrayGetter {\n const typedArrayPrototype = Object.getPrototypeOf(Uint8Array.prototype) as object\n const getter = Object.getOwnPropertyDescriptor(typedArrayPrototype, name)?.get\n if (!getter) throw new Error(`typed array intrinsic ${name} accessor is unavailable`)\n return getter\n}\n\nconst typedArrayBufferGetter = requireTypedArrayGetter('buffer')\nconst typedArrayByteOffsetGetter = requireTypedArrayGetter('byteOffset')\nconst typedArrayByteLengthGetter = requireTypedArrayGetter('byteLength')\n"],"mappings":";;;;;;;;;;;;AASA,SAAgB,yBAAyB,OAAwD;CAC/F,MAAM,SAASA,2BAAyB,KAAK;CAC7C,MAAM,SAAS,2BAA2B,MAAM;EAAE,GAAG;EAAO;CAAO,CAAC;CAEpE,IADqBA,2BAAyB,mBAAmB,MAAM,CACxD,MAAM,QACnB,MAAM,IAAI,MAAM,oEAAoE;CAEtF,OAAO,wBAAwB,MAAM;AACvC;;;AC+BA,MAAM,cAAc;AACpB,MAAM,uBAAuB;AAC7B,MAAM,0BAA0B;AAChC,MAAM,wBAAwB;AAC9B,MAAM,+BAAe,IAAI,KAAK,CAAC;AAY/B,MAAM,gBAAsD,OAAO,OAAO;CACxE,iBAAiB,MAAM,OAAO;CAC9B,0BAA0B,OAAO;CACjC,UAAU;CACV,cAAc,MAAM,OAAO;CAC3B,mBAAmB,MAAM,OAAO;CAChC,cAAc;CACd,0BAA0B,MAAM,OAAO;AACzC,CAAC;;AAkDD,eAAsB,+BACpB,WACA,UAAiD,CAAC,GACR;CAC1C,MAAM,OAAO,QAAQ,SAAS;CAC9B,MAAM,SA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AACT;AAEA,SAAS,kBAAkB,OAAe,OAAqB;CAC7D,IAAI,CAAC,kCAAkC,KAAK,KAAK,GAC/C,MAAM,IAAI,MAAM,wBAAwB,MAAM,wBAAwB;AAE1E;AAEA,SAAS,oBAAoB,OAAwB;CACnD,KAAK,IAAI,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS;EACjD,MAAM,OAAO,MAAM,WAAW,KAAK;EACnC,IAAI,OAAO,MAAQ,SAAS,KAAM,OAAO;CAC3C;CACA,OAAO;AACT;AAEA,SAAS,SAAS,OAAkD;CAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAIA,SAAS,wBAAwB,MAAgE;CAC/F,MAAM,sBAAsB,OAAO,eAAe,WAAW,SAAS;CACtE,MAAM,SAAS,OAAO,yBAAyB,qBAAqB,IAAI,CAAC,EAAE;CAC3E,IAAI,CAAC,QAAQ,MAAM,IAAI,MAAM,yBAAyB,KAAK,yBAAyB;CACpF,OAAO;AACT;AAEA,MAAM,yBAAyB,wBAAwB,QAAQ;AAC/D,MAAM,6BAA6B,wBAAwB,YAAY;AACvE,MAAM,6BAA6B,wBAAwB,YAAY"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.247.0",
|
|
4
4
|
"description": "Shared task-lifecycle skeleton for agents: a recursive loop kernel for chat turns, one-shot tasks, and multi-attempt loops, with trace capture and eval-gated self-improvement. Domain behavior lives in adapters; scoring and ship-gates in @tangle-network/agent-eval.",
|
|
5
5
|
"homepage": "https://github.com/tangle-network/agent-runtime#readme",
|
|
6
6
|
"repository": {
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
"@biomejs/biome": "^2.5.11",
|
|
100
100
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
101
101
|
"@tangle-network/agent-eval": "0.182.0",
|
|
102
|
-
"@tangle-network/agent-interface": "^2.
|
|
103
|
-
"@tangle-network/sandbox": ">=0.36.4 <0.
|
|
102
|
+
"@tangle-network/agent-interface": "^2.10.0",
|
|
103
|
+
"@tangle-network/sandbox": ">=0.36.4 <0.46.0",
|
|
104
104
|
"@types/node": "26.4.0",
|
|
105
105
|
"@types/tar-stream": "3.1.4",
|
|
106
106
|
"miniflare": "4.20260722.0",
|
|
@@ -122,13 +122,13 @@
|
|
|
122
122
|
"license": "MIT",
|
|
123
123
|
"peerDependencies": {
|
|
124
124
|
"@tangle-network/agent-eval": ">=0.182.0 <0.183.0",
|
|
125
|
-
"@tangle-network/agent-interface": "^2.
|
|
126
|
-
"@tangle-network/sandbox": ">=0.36.4 <0.
|
|
125
|
+
"@tangle-network/agent-interface": "^2.10.0",
|
|
126
|
+
"@tangle-network/sandbox": ">=0.36.4 <0.46.0"
|
|
127
127
|
},
|
|
128
128
|
"dependencies": {
|
|
129
129
|
"@tangle-network/agent-core": ">=0.9.6 <0.10.0",
|
|
130
130
|
"@tangle-network/agent-knowledge": "^17.0.2",
|
|
131
|
-
"@tangle-network/agent-profile-materialize": ">=0.
|
|
131
|
+
"@tangle-network/agent-profile-materialize": ">=0.20.1 <0.21.0",
|
|
132
132
|
"@tangle-network/agent-trace-contract": "^1.0.2",
|
|
133
133
|
"tar-stream": "3.2.1"
|
|
134
134
|
},
|