@tangle-network/agent-runtime 0.283.0 → 0.284.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.
Files changed (55) hide show
  1. package/dist/{activation-DL1VoNrT.d.ts → activation-CxiJixSO.d.ts} +2 -2
  2. package/dist/{activation-B_vuAOSo.js → activation-DXFzDCmr.js} +2 -2
  3. package/dist/{activation-B_vuAOSo.js.map → activation-DXFzDCmr.js.map} +1 -1
  4. package/dist/agent.d.ts +1 -1
  5. package/dist/agent.js +2 -2
  6. package/dist/candidate-execution/index.d.ts +2 -38
  7. package/dist/{coordination-driver-BmkANXc5.js → coordination-driver-BJzVI1oV.js} +2 -2
  8. package/dist/{coordination-driver-BmkANXc5.js.map → coordination-driver-BJzVI1oV.js.map} +1 -1
  9. package/dist/{delegate-BfHKdHzV.js → delegate-CfoEXPam.js} +2 -2
  10. package/dist/{delegate-BfHKdHzV.js.map → delegate-CfoEXPam.js.map} +1 -1
  11. package/dist/durable.d.ts +1 -1
  12. package/dist/durable.js +2 -2
  13. package/dist/{graph-XmlRTlaI.js → graph-RCV6ri8A.js} +4 -4
  14. package/dist/{graph-XmlRTlaI.js.map → graph-RCV6ri8A.js.map} +1 -1
  15. package/dist/{improvement-cycle-BFerq3l4.js → improvement-cycle-DxBnEP8q.js} +3 -3
  16. package/dist/{improvement-cycle-BFerq3l4.js.map → improvement-cycle-DxBnEP8q.js.map} +1 -1
  17. package/dist/{index-CkLB8mJF.d.ts → index-BmGVkjsc.d.ts} +66 -5
  18. package/dist/index.d.ts +13 -6
  19. package/dist/index.js +51 -9
  20. package/dist/index.js.map +1 -1
  21. package/dist/intelligence.d.ts +4 -4
  22. package/dist/intelligence.js +4 -4
  23. package/dist/kernel.d.ts +3 -3
  24. package/dist/kernel.js +9 -9
  25. package/dist/{loop-runner-bin-D8P3T5rT.js → loop-runner-bin-BPy7y5rd.js} +3 -3
  26. package/dist/{loop-runner-bin-D8P3T5rT.js.map → loop-runner-bin-BPy7y5rd.js.map} +1 -1
  27. package/dist/{loop-runner-bin-CINywrHK.d.ts → loop-runner-bin-CqwbQ0et.d.ts} +2 -2
  28. package/dist/loop-runner-bin.d.ts +1 -1
  29. package/dist/loop-runner-bin.js +1 -1
  30. package/dist/mcp/bin.js +3 -3
  31. package/dist/mcp/index.d.ts +2 -2
  32. package/dist/mcp/index.js +4 -4
  33. package/dist/{protected-model-port-BlLP8ja6.d.ts → protected-model-port-DDnU39ul.d.ts} +2 -2
  34. package/dist/{provision-supervisor-BNUmrHwC.js → provision-supervisor-CqRp0Rzo.js} +3 -3
  35. package/dist/{provision-supervisor-BNUmrHwC.js.map → provision-supervisor-CqRp0Rzo.js.map} +1 -1
  36. package/dist/{runtime-CM3KCe9V.js → runtime-lin_kRwN.js} +102 -10
  37. package/dist/runtime-lin_kRwN.js.map +1 -0
  38. package/dist/{search-method-Dlor0kKQ.js → search-method-Hjmqa4B8.js} +2 -2
  39. package/dist/{search-method-Dlor0kKQ.js.map → search-method-Hjmqa4B8.js.map} +1 -1
  40. package/dist/{server-BnMcTE7J.js → server-a2wdjRG1.js} +3 -3
  41. package/dist/{server-BnMcTE7J.js.map → server-a2wdjRG1.js.map} +1 -1
  42. package/dist/{stream-agent-turn-Bk79CnTw.d.ts → stream-agent-turn-IIqBKeLB.d.ts} +149 -5
  43. package/dist/{supervise-DL_Hj1uk.js → supervise-C71s4_OJ.js} +3 -3
  44. package/dist/{supervise-DL_Hj1uk.js.map → supervise-C71s4_OJ.js.map} +1 -1
  45. package/dist/{supervisor-YAc4U8HQ.js → supervisor-D4NnNHZd.js} +470 -70
  46. package/dist/supervisor-D4NnNHZd.js.map +1 -0
  47. package/dist/testing.d.ts +2 -2
  48. package/dist/testing.js +12 -12
  49. package/dist/tui/index.d.ts +1 -1
  50. package/dist/tui/index.js +1 -1
  51. package/dist/{types-CuXu5zuS.d.ts → workspace-archive-DpyZV2Cj.d.ts} +38 -2
  52. package/package.json +5 -4
  53. package/skills/profile-authoring/SKILL.md +1 -1
  54. package/dist/runtime-CM3KCe9V.js.map +0 -1
  55. package/dist/supervisor-YAc4U8HQ.js.map +0 -1
@@ -1,16 +1,16 @@
1
- import { $i as detachedSnapshot, $t as isTraceAnalysisStore, Ai as readCommittedJsonLines, Ca as stringifySafe, Et as rollingDispatch, Gn as probeSandboxCapabilities, Gt as encodeResultBlob, Ht as InMemorySpawnJournal, Ia as armDeadlineTimer, Jn as readPromptOptions, Kt as insideCursorNamespace, M as withDriverExecutor, Mt as createExecutorRegistry, O as verdictFromJudgeScore, Oa as zeroSpend, Pt as createWorktreeCliExecutor, Qi as detachedFrozen, Sa as sleep, Un as runAgentRounds, Ut as SpawnEventIndex, Vn as defaultSelectWinner, Vt as InMemoryResultBlobStore, W as settledToIteration, Wn as createSandboxLineage, Wt as assertContentAddress, Xi as executableAgentProfileSnapshot, Xn as runBrainLoop, Yn as routerBrain, Zi as executableAgentSpecSnapshot, Zn as canonicalObservedModelParts, _ as CheckUnavailableError, cr as createPushTraceSource, ga as cloneSpend, ha as chargedTokens, ji as writeAllBytes, jt as createExecutor, ki as prepareJsonlAppend, kr as contentAddress, ma as addSpend, qn as assertBoxlessPromptOptions, r as createSupervisor, ua as notifySandboxEventObserver, va as hasCompleteCacheBreakdown, xa as randomSuffix, ya as isAbortError } from "./supervisor-YAc4U8HQ.js";
1
+ import { $i as executableAgentSpecSnapshot, $n as canonicalObservedModelParts, $t as isTraceAnalysisStore, Aa as zeroSpend, Ca as randomSuffix, Et as rollingDispatch, Gn as probeSandboxCapabilities, Gt as encodeResultBlob, Ht as InMemorySpawnJournal, Kt as insideCursorNamespace, M as withDriverExecutor, Mi as readCommittedJsonLines, Mt as createExecutorRegistry, Ni as writeAllBytes, O as verdictFromJudgeScore, Pt as createWorktreeCliExecutor, Qi as executableAgentProfileSnapshot, Qn as runBrainLoop, Ra as armDeadlineTimer, Ta as stringifySafe, Un as runAgentRounds, Ut as SpawnEventIndex, Vn as defaultSelectWinner, Vt as InMemoryResultBlobStore, W as settledToIteration, Wn as createSandboxLineage, Wt as assertContentAddress, Xn as readPromptOptions, Yn as assertBoxlessPromptOptions, Zn as routerBrain, _ as CheckUnavailableError, _a as chargedTokens, ba as hasCompleteCacheBreakdown, ea as detachedFrozen, fa as notifySandboxEventObserver, ga as addSpend, ji as prepareJsonlAppend, jr as contentAddress, jt as createExecutor, r as createSupervisor, ta as detachedSnapshot, ur as createPushTraceSource, va as cloneSpend, wa as sleep, xa as isAbortError } from "./supervisor-D4NnNHZd.js";
2
2
  import { i as ConfigError, m as ValidationError, n as AnalystError, s as PlannerError } from "./errors-DodWX-cb.js";
3
- import { Q as sample, X as refine, Z as runAgentic, c as reconcileInterruptedSearchCalls, ct as strategyAuthorMethod, et as ObservationError, it as profileChatClient, nt as observe, o as dedicatedLane, r as runtimeShipDecision, rt as renderReport, u as searchExecutor } from "./search-method-Dlor0kKQ.js";
3
+ import { Q as sample, X as refine, Z as runAgentic, c as reconcileInterruptedSearchCalls, ct as strategyAuthorMethod, et as ObservationError, it as profileChatClient, nt as observe, o as dedicatedLane, r as runtimeShipDecision, rt as renderReport, u as searchExecutor } from "./search-method-Hjmqa4B8.js";
4
4
  import { c as profileModelExecutionSettings, i as concreteModelId, l as profileProviderModel, o as enforceTokenLimits, t as assertExecutableAgentProfile } from "./model-policy-BbSCSak0.js";
5
5
  import { A as sha256Bytes$1, O as immutableCandidateValue, f as WorkspaceScanLimitError, h as captureMaterializedWorkspace, w as canonicalCandidateDigest$1 } from "./workspace-archive-MhowMCmp.js";
6
6
  import { i as notifyRuntimeHookEvent } from "./runtime-hooks-tXpAarhW.js";
7
7
  import { i as redactProtectedValue, r as redactProtectedReason } from "./protected-redaction-DylCC_ot.js";
8
- import { S as foldCoordinationRecords, y as createInMemoryRunContext } from "./coordination-driver-BmkANXc5.js";
9
- import { C as gateOnDeliverable, r as supervise, w as mapExecutorResult } from "./supervise-DL_Hj1uk.js";
8
+ import { S as foldCoordinationRecords, y as createInMemoryRunContext } from "./coordination-driver-BJzVI1oV.js";
9
+ import { C as gateOnDeliverable, r as supervise, w as mapExecutorResult } from "./supervise-C71s4_OJ.js";
10
10
  import "./run-layout-vwd4SwX_.js";
11
- import "./provision-supervisor-BNUmrHwC.js";
12
- import "./delegate-BfHKdHzV.js";
13
- import "./graph-XmlRTlaI.js";
11
+ import "./provision-supervisor-CqRp0Rzo.js";
12
+ import "./delegate-CfoEXPam.js";
13
+ import "./graph-RCV6ri8A.js";
14
14
  import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, sha256Bytes, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
15
15
  import { CODING_HARNESSES, DEFAULT_TRACE_ANALYST_KINDS, InMemoryTraceStore, OUTPUT_VALUE, benjaminiHochberg, buildTrajectory, computeFindingId as computeFindingId$1, confidenceInterval, createTraceAnalyst, expandProfileAxes, makeFinding as makeFinding$1, pairedBootstrap, paretoFrontier, wilcoxonSignedRank, wilson } from "@tangle-network/agent-eval";
16
16
  import { createAgentRunOutcomeTracker } from "@tangle-network/sandbox/runtime";
@@ -18,7 +18,7 @@ import { createHash, randomUUID } from "node:crypto";
18
18
  import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
19
19
  import { appendFileSync, chmodSync, constants, copyFileSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readlinkSync, renameSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
20
20
  import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
21
- import { chmod, lstat, mkdir, mkdtemp, open, opendir, readFile, readdir, readlink, realpath, rm, stat, symlink, writeFile } from "node:fs/promises";
21
+ import { chmod, link, lstat, mkdir, mkdtemp, open, opendir, readFile, readdir, readlink, realpath, rm, stat, symlink, unlink, writeFile } from "node:fs/promises";
22
22
  import { tmpdir } from "node:os";
23
23
  import { isDeepStrictEqual, promisify } from "node:util";
24
24
  import { redact } from "@tangle-network/agent-eval/traces";
@@ -4959,6 +4959,98 @@ function requireSpend(rolled, id, root) {
4959
4959
  return spend;
4960
4960
  }
4961
4961
  //#endregion
4962
+ //#region src/runtime/private-cas.ts
4963
+ const DIGEST = /^sha256:([0-9a-f]{64})$/u;
4964
+ const SAFE_NAMESPACE = /^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$/u;
4965
+ async function realDirectory(path) {
4966
+ const entry = await lstat(path);
4967
+ if (!entry.isDirectory() || entry.isSymbolicLink()) throw new Error(`private CAS directory is not a real directory: ${path}`);
4968
+ }
4969
+ async function checkDirectories(path, create) {
4970
+ const parts = resolve(path).split(sep);
4971
+ let current = sep;
4972
+ for (const part of parts) {
4973
+ if (!part) continue;
4974
+ current = join(current, part);
4975
+ if (create) try {
4976
+ await mkdir(current, { mode: 448 });
4977
+ } catch (error) {
4978
+ if (error.code !== "EEXIST") throw error;
4979
+ }
4980
+ await realDirectory(current);
4981
+ }
4982
+ }
4983
+ /** Private host-local content-addressed storage scoped to one recorded run identity. */
4984
+ function createPrivateCasArtifactPort(root, namespace) {
4985
+ if (!isAbsolute(root)) throw new Error("private CAS root must be absolute");
4986
+ if (!SAFE_NAMESPACE.test(namespace) || namespace === "." || namespace === "..") throw new Error("private CAS namespace must be one safe identifier");
4987
+ const store = join(resolve(root), "sha256");
4988
+ const destination = (digest) => {
4989
+ const match = DIGEST.exec(digest);
4990
+ if (!match) throw new Error("private CAS digest must be sha256:<64 lowercase hex>");
4991
+ return join(store, match[1].slice(0, 2), match[1]);
4992
+ };
4993
+ const port = {
4994
+ async put({ bytes, signal }) {
4995
+ signal?.throwIfAborted();
4996
+ const sha = createHash("sha256").update(bytes).digest("hex");
4997
+ const digest = `sha256:${sha}`;
4998
+ const path = destination(digest);
4999
+ const directory = join(store, sha.slice(0, 2));
5000
+ await checkDirectories(directory, true);
5001
+ const temporary = join(directory, `.${sha}.${randomUUID()}.tmp`);
5002
+ const file = await open(temporary, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | constants.O_NOFOLLOW, 384);
5003
+ try {
5004
+ await file.writeFile(bytes);
5005
+ await file.sync();
5006
+ } finally {
5007
+ await file.close();
5008
+ }
5009
+ try {
5010
+ signal?.throwIfAborted();
5011
+ try {
5012
+ await link(temporary, path);
5013
+ } catch (error) {
5014
+ if (error.code !== "EEXIST") throw error;
5015
+ }
5016
+ const dir = await open(directory, constants.O_RDONLY | constants.O_DIRECTORY | constants.O_NOFOLLOW);
5017
+ try {
5018
+ await dir.sync();
5019
+ } finally {
5020
+ await dir.close();
5021
+ }
5022
+ } finally {
5023
+ await unlink(temporary).catch(() => void 0);
5024
+ }
5025
+ const ref = {
5026
+ locator: {
5027
+ kind: "private-cas",
5028
+ namespace,
5029
+ digest
5030
+ },
5031
+ sha256: digest,
5032
+ byteLength: bytes.byteLength
5033
+ };
5034
+ await port.read(ref);
5035
+ return ref;
5036
+ },
5037
+ async read(ref) {
5038
+ if (ref.locator.kind !== "private-cas" || ref.locator.namespace !== namespace || ref.locator.digest !== ref.sha256) throw new Error("private CAS locator does not match its digest and namespace");
5039
+ const path = destination(ref.sha256);
5040
+ await checkDirectories(join(store, DIGEST.exec(ref.sha256)[1].slice(0, 2)), false);
5041
+ const file = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW);
5042
+ try {
5043
+ const bytes = await file.readFile();
5044
+ if (`sha256:${createHash("sha256").update(bytes).digest("hex")}` !== ref.sha256 || bytes.byteLength !== ref.byteLength) throw new Error("private CAS object failed digest or length verification");
5045
+ return bytes;
5046
+ } finally {
5047
+ await file.close();
5048
+ }
5049
+ }
5050
+ };
5051
+ return port;
5052
+ }
5053
+ //#endregion
4962
5054
  //#region src/runtime/run-benchmark.ts
4963
5055
  /**
4964
5056
  * runBenchmark — the packaged optimization suite. Define a domain by implementing an
@@ -8305,6 +8397,6 @@ function tail(s) {
8305
8397
  return s.slice(-400);
8306
8398
  }
8307
8399
  //#endregion
8308
- export { renderCorpusToInstructions as $, resolveMcpServerLaunch as $t, unsafeInProcessRunner as A, completionAuthorizes as At, SandboxRunAbortError as B, auditIntent as Bt, withUntrackedArtifacts as C, assertDeclaredCheck as Ct, patchDelivered as D, declaredCheckJudge as Dt, createSqlRunContext as E, declaredCheckDigest as Et, strategyTournament as F, pairwiseSignificance as Ft, trajectoryReport as G, SqlSpawnJournal as Gt, printBenchmarkReport as H, SqlRunOwnershipError as Ht, assertStrategyContract as I, renderLeaderboardHtml as It, builtinShapes as J, materializeLocalMcp as Jt, definePersona as K, McpSpawnFault as Kt, authorStrategy as L, renderLeaderboardMarkdown as Lt, chatWorkerSeam as M, sentinelCompletion as Mt, createChatSessionStore as N, stopSentinel as Nt, runCoderChecks as O, readDeclaredCheck as Ot, runStrategyEvolution as P, leaderboard as Pt, InMemoryCorpus as Q, mcpSecretEnvMetadataKey as Qt, strategyAuthorContract as R, renderLeaderboardSvg as Rt, copyUntrackedIntoClone as S, superviseDispatch as St, createFencedSqlRunContext as T, declaredCheckDeliverable as Tt, runBenchmark as U, openSqlRunStore as Ut, openSandboxRun as V, defaultAuditorInstruction as Vt, equalKOnCost as W, SqlResultBlobStore as Wt, registerShape as X, sanitizeMcpToolSchema as Xt, createShapeRegistry as Y, createMcpEnvironment as Yt, FileCorpus as Z, envKeyProvider as Zt, NOTE_MAX_CHARS as _, resolveSandboxClient as _t, localShell as a, selectValidWinner as at, composeWorkerEvidence as b, loopCampaignDispatch as bt, createVerifierEnvironment as c, assertTraceDerivedFindings as ct, harvestSurfaceDiffs as d, registryScopeAnalyst as dt, resolveSecretEnv as en, fanout as et, analystsFromRegistry as f, observationFromRegistry as ft, EVIDENCE_MAX_CHARS as g, defineLeaderboard as gt, worktreeFanout as h, harvestCorpus as ht, jjWorkspace as i, pipeline as it, chatTransportExecutor as j, deterministicCompletion as jt, codeModeSupervisorTools as k, runIsolatedCheck as kt, boxSurfaceReader as l, buildSteerContext as lt, superviseSurface as m, HarvestError as mt, makeFinding$1 as n, createTangleSandboxExactProcessProvider as nn, loopUntil as nt, runInWorkspace as o, verify as ot, failuresAnalyst as p, inProcessSandboxClient as pt, runPersonified as q, connectStdioMcp as qt, gitWorkspace as r, panel as rt, createWaterfallCollector as s, widen as st, computeFindingId$1 as t, secretEnvOfMcpServer as tn, flatWidenGate as tt, fsSurfaceReader as u, createScopeAnalyst as ut, VERIFY_TAIL_CHARS as v, localSandboxClient as vt, analyzeTrace as w, checkProgramDigest as wt, settledWorkerOut as x, loopDispatch as xt, closingWorkerNote as y, inlineSandboxClient as yt, strategyAuthorSystemPrompt as z, renderPairwiseMarkdown as zt };
8400
+ export { InMemoryCorpus as $, mcpSecretEnvMetadataKey as $t, unsafeInProcessRunner as A, runIsolatedCheck as At, SandboxRunAbortError as B, renderPairwiseMarkdown as Bt, withUntrackedArtifacts as C, superviseDispatch as Ct, patchDelivered as D, declaredCheckDigest as Dt, createSqlRunContext as E, declaredCheckDeliverable as Et, strategyTournament as F, leaderboard as Ft, equalKOnCost as G, SqlResultBlobStore as Gt, printBenchmarkReport as H, defaultAuditorInstruction as Ht, assertStrategyContract as I, pairwiseSignificance as It, runPersonified as J, connectStdioMcp as Jt, trajectoryReport as K, SqlSpawnJournal as Kt, authorStrategy as L, renderLeaderboardHtml as Lt, chatWorkerSeam as M, deterministicCompletion as Mt, createChatSessionStore as N, sentinelCompletion as Nt, runCoderChecks as O, declaredCheckJudge as Ot, runStrategyEvolution as P, stopSentinel as Pt, FileCorpus as Q, envKeyProvider as Qt, strategyAuthorContract as R, renderLeaderboardMarkdown as Rt, copyUntrackedIntoClone as S, loopDispatch as St, createFencedSqlRunContext as T, checkProgramDigest as Tt, runBenchmark as U, SqlRunOwnershipError as Ut, openSandboxRun as V, auditIntent as Vt, createPrivateCasArtifactPort as W, openSqlRunStore as Wt, createShapeRegistry as X, createMcpEnvironment as Xt, builtinShapes as Y, materializeLocalMcp as Yt, registerShape as Z, sanitizeMcpToolSchema as Zt, NOTE_MAX_CHARS as _, defineLeaderboard as _t, localShell as a, pipeline as at, composeWorkerEvidence as b, inlineSandboxClient as bt, createVerifierEnvironment as c, widen as ct, harvestSurfaceDiffs as d, createScopeAnalyst as dt, resolveMcpServerLaunch as en, renderCorpusToInstructions as et, analystsFromRegistry as f, registryScopeAnalyst as ft, EVIDENCE_MAX_CHARS as g, harvestCorpus as gt, worktreeFanout as h, HarvestError as ht, jjWorkspace as i, panel as it, chatTransportExecutor as j, completionAuthorizes as jt, codeModeSupervisorTools as k, readDeclaredCheck as kt, boxSurfaceReader as l, assertTraceDerivedFindings as lt, superviseSurface as m, inProcessSandboxClient as mt, makeFinding$1 as n, secretEnvOfMcpServer as nn, flatWidenGate as nt, runInWorkspace as o, selectValidWinner as ot, failuresAnalyst as p, observationFromRegistry as pt, definePersona as q, McpSpawnFault as qt, gitWorkspace as r, createTangleSandboxExactProcessProvider as rn, loopUntil as rt, createWaterfallCollector as s, verify as st, computeFindingId$1 as t, resolveSecretEnv as tn, fanout as tt, fsSurfaceReader as u, buildSteerContext as ut, VERIFY_TAIL_CHARS as v, resolveSandboxClient as vt, analyzeTrace as w, assertDeclaredCheck as wt, settledWorkerOut as x, loopCampaignDispatch as xt, closingWorkerNote as y, localSandboxClient as yt, strategyAuthorSystemPrompt as z, renderLeaderboardSvg as zt };
8309
8401
 
8310
- //# sourceMappingURL=runtime-CM3KCe9V.js.map
8402
+ //# sourceMappingURL=runtime-lin_kRwN.js.map