@tangle-network/agent-runtime 0.333.1 → 0.334.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 (53) hide show
  1. package/dist/{activation-BiJHZQ7_.js → activation-CVW7l4F3.js} +2 -2
  2. package/dist/{activation-BiJHZQ7_.js.map → activation-CVW7l4F3.js.map} +1 -1
  3. package/dist/{activation-BGZ0rVuv.d.ts → activation-D64x9f07.d.ts} +2 -2
  4. package/dist/agent.d.ts +1 -1
  5. package/dist/agent.js +2 -2
  6. package/dist/{coordination-driver-NpDEfkvT.js → coordination-driver-D36spfRN.js} +22 -11
  7. package/dist/coordination-driver-D36spfRN.js.map +1 -0
  8. package/dist/{delegate-D8fWCoxb.js → delegate-DGPYLJLx.js} +2 -2
  9. package/dist/{delegate-D8fWCoxb.js.map → delegate-DGPYLJLx.js.map} +1 -1
  10. package/dist/durable.d.ts +1 -1
  11. package/dist/durable.js +3 -3
  12. package/dist/{graph-BWg5yNC7.js → graph-CnjWiqlB.js} +4 -4
  13. package/dist/{graph-BWg5yNC7.js.map → graph-CnjWiqlB.js.map} +1 -1
  14. package/dist/{improvement-cycle-CL2GGCQq.js → improvement-cycle-BC6GXcYl.js} +3 -3
  15. package/dist/{improvement-cycle-CL2GGCQq.js.map → improvement-cycle-BC6GXcYl.js.map} +1 -1
  16. package/dist/index.d.ts +4 -4
  17. package/dist/index.js +7 -7
  18. package/dist/intelligence.d.ts +2 -2
  19. package/dist/intelligence.js +3 -3
  20. package/dist/kernel.d.ts +1 -1
  21. package/dist/kernel.js +8 -8
  22. package/dist/{loop-runner-bin-Cx6nXmMP.js → loop-runner-bin-D3nU-Wp0.js} +3 -3
  23. package/dist/{loop-runner-bin-Cx6nXmMP.js.map → loop-runner-bin-D3nU-Wp0.js.map} +1 -1
  24. package/dist/{loop-runner-bin-CaH_49Ts.d.ts → loop-runner-bin-DpH55EFc.d.ts} +2 -2
  25. package/dist/loop-runner-bin.d.ts +1 -1
  26. package/dist/loop-runner-bin.js +1 -1
  27. package/dist/mcp/bin.js +3 -3
  28. package/dist/mcp/index.d.ts +2 -2
  29. package/dist/mcp/index.js +4 -4
  30. package/dist/{openai-tools-BhO6-5ff.d.ts → openai-tools-D8eHMvNr.d.ts} +2 -2
  31. package/dist/profiles.d.ts +1 -1
  32. package/dist/{provision-supervisor-Csm4ZzSd.js → provision-supervisor-C1FQ2uIe.js} +3 -3
  33. package/dist/{provision-supervisor-Csm4ZzSd.js.map → provision-supervisor-C1FQ2uIe.js.map} +1 -1
  34. package/dist/{runtime-BeuNt-n3.js → runtime-Cff0UnPw.js} +66 -16
  35. package/dist/runtime-Cff0UnPw.js.map +1 -0
  36. package/dist/{search-executor-wqvqoJZS.js → search-executor-CFqHN4Dt.js} +2 -2
  37. package/dist/{search-executor-wqvqoJZS.js.map → search-executor-CFqHN4Dt.js.map} +1 -1
  38. package/dist/{server-DheSbIyd.js → server-CFIzBMYb.js} +3 -3
  39. package/dist/{server-DheSbIyd.js.map → server-CFIzBMYb.js.map} +1 -1
  40. package/dist/{supervise-C8oeQwrk.js → supervise-Dl2rTArD.js} +53 -8
  41. package/dist/supervise-Dl2rTArD.js.map +1 -0
  42. package/dist/{supervisor-B4sM2Xu2.js → supervisor-BObk9STz.js} +135 -14
  43. package/dist/supervisor-BObk9STz.js.map +1 -0
  44. package/dist/testing.d.ts +1 -1
  45. package/dist/testing.js +12 -12
  46. package/dist/tui/index.d.ts +1 -1
  47. package/dist/tui/index.js +1 -1
  48. package/dist/{types-CsDKtdE3.d.ts → types-Dkx4dbaX.d.ts} +15 -3
  49. package/package.json +3 -3
  50. package/dist/coordination-driver-NpDEfkvT.js.map +0 -1
  51. package/dist/runtime-BeuNt-n3.js.map +0 -1
  52. package/dist/supervise-C8oeQwrk.js.map +0 -1
  53. package/dist/supervisor-B4sM2Xu2.js.map +0 -1
@@ -1,19 +1,19 @@
1
1
  import { o as writeAtomicDurableFile } from "./durable-file-B_eJr6Mb.js";
2
- import { Dn as runBrainLoop, E as settledToIteration, Ei as executableAgentSpecSnapshot, En as routerBrain, J as coordinationProfileToolPrefix, Qt as CheckUnavailableError, Ti as executableAgentProfileSnapshot, Tn as readPromptOptions, Xn as runAbortable, _n as defaultSelectWinner, at as rollingDispatch, bn as createSandboxLineage, ca as isTraceAnalysisStore, cn as verdictFromJudgeScore, da as contentAddress, ea as InMemoryResultBlobStore, f as withDriverExecutor, fa as detachedFrozen, ft as createExecutor, ht as createWorktreeCliExecutor, na as insideCursorNamespace, ot as gateOnDeliverable, pa as detachedSnapshot, pt as createExecutorRegistry, qi as notifySandboxEventObserver, r as createSupervisor, st as mapExecutorResult, ta as InMemorySpawnJournal, wn as assertBoxlessPromptOptions, yn as runAgentRounds } from "./supervisor-B4sM2Xu2.js";
2
+ import { Dn as runBrainLoop, E as settledToIteration, Ei as executableAgentSpecSnapshot, En as routerBrain, J as coordinationProfileToolPrefix, Qt as CheckUnavailableError, Ti as executableAgentProfileSnapshot, Tn as readPromptOptions, Xn as runAbortable, _n as defaultSelectWinner, at as rollingDispatch, bn as createSandboxLineage, ca as isTraceAnalysisStore, cn as verdictFromJudgeScore, da as contentAddress, ea as InMemoryResultBlobStore, f as withDriverExecutor, fa as detachedFrozen, ft as createExecutor, ht as createWorktreeCliExecutor, na as insideCursorNamespace, ot as gateOnDeliverable, pa as detachedSnapshot, pt as createExecutorRegistry, qi as notifySandboxEventObserver, r as createSupervisor, st as mapExecutorResult, ta as InMemorySpawnJournal, wn as assertBoxlessPromptOptions, yn as runAgentRounds } from "./supervisor-BObk9STz.js";
3
3
  import { i as ConfigError, m as ValidationError, n as AnalystError, s as PlannerError } from "./errors-DodWX-cb.js";
4
- import { B as runAgentic, G as observe, K as renderReport, U as ObservationError, V as sample, X as strategyAuthorMethod, a as reconcileInterruptedSearchCalls, c as searchExecutor, q as profileChatClient, r as dedicatedLane, x as runtimeShipDecision, z as refine } from "./search-executor-wqvqoJZS.js";
4
+ import { B as runAgentic, G as observe, K as renderReport, U as ObservationError, V as sample, X as strategyAuthorMethod, a as reconcileInterruptedSearchCalls, c as searchExecutor, q as profileChatClient, r as dedicatedLane, x as runtimeShipDecision, z as refine } from "./search-executor-CFqHN4Dt.js";
5
5
  import { $ as isAsyncIterable, Ct as armDeadlineTimer, F as canonicalCandidateDigest$1, G as chargedTokens, K as cloneSpend, M as markPutStreamVerified, Q as isAbortError, U as addSpend, V as sha256Bytes$1, X as fnv1a32Hex, Y as errorMessage, Z as hasCompleteCacheBreakdown, at as sleep, dt as zeroSpend, et as mapWithConcurrency, nt as randomSuffix, ot as stringifySafe, w as captureMaterializedWorkspace, x as WorkspaceScanLimitError, z as immutableCandidateValue } from "./sandbox-profile-compat-CVgQWb7T.js";
6
6
  import { a as readCommittedJsonLines, i as readCommittedJsonFile, n as isNoEntError, o as upsertCommittedJsonLine, s as withJsonlFileLock, t as appendCommittedJsonLine } from "./jsonl-file-DBv31uPi.js";
7
7
  import { c as profileModelExecutionSettings, i as concreteModelId, l as profileProviderModel, o as enforceTokenLimits, p as canonicalObservedModelParts, t as assertExecutableAgentProfile, v as harnessRunsAgent } from "./model-policy-CyCUwHed.js";
8
8
  import { i as notifyRuntimeHookEvent } from "./runtime-hooks-tXpAarhW.js";
9
9
  import { i as redactProtectedValue, r as redactProtectedReason } from "./protected-redaction-DFCeo4vg.js";
10
- import { D as foldCoordinationRecords, w as createInMemoryRunContext } from "./coordination-driver-NpDEfkvT.js";
11
- import { r as supervise } from "./supervise-C8oeQwrk.js";
10
+ import { D as foldCoordinationRecords, w as createInMemoryRunContext } from "./coordination-driver-D36spfRN.js";
11
+ import { r as supervise } from "./supervise-Dl2rTArD.js";
12
12
  import { a as graphRunsFor, d as recordGraphRun, i as graphRegistry, l as lookupGraph, p as taskShapeDigest, r as graphFromStored, t as digestOfGraph } from "./graph-registry-DAI6KNXB.js";
13
13
  import "./run-layout-Cu8H7aeh.js";
14
- import "./provision-supervisor-Csm4ZzSd.js";
15
- import "./delegate-D8fWCoxb.js";
16
- import "./graph-BWg5yNC7.js";
14
+ import "./provision-supervisor-C1FQ2uIe.js";
15
+ import "./delegate-DGPYLJLx.js";
16
+ import "./graph-CnjWiqlB.js";
17
17
  import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, sha256Bytes, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
18
18
  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";
19
19
  import { createAgentRunOutcomeTracker } from "@tangle-network/sandbox/runtime";
@@ -5127,9 +5127,14 @@ function createPrivateCasArtifactPort(root, namespace, options = {}) {
5127
5127
  throw failure;
5128
5128
  };
5129
5129
  let lastPass;
5130
+ const localIndex = /* @__PURE__ */ new Map();
5131
+ const undurable = /* @__PURE__ */ new Set();
5130
5132
  const settlePut = async (sha, byteLength, linked, upload, signal) => {
5131
5133
  if (upload !== void 0 && !await hasReceipt(sha)) await copyOnce(sha, upload, signal).catch(() => void 0);
5132
5134
  const durableNow = await hasReceipt(sha);
5135
+ if (linked) localIndex.set(sha, byteLength);
5136
+ if (durableNow) undurable.delete(sha);
5137
+ else undurable.add(sha);
5133
5138
  const added = linked ? byteLength : 0;
5134
5139
  const known = lastPass;
5135
5140
  if (durableNow && known !== void 0 && known.pending === 0 && (localBudgetBytes === void 0 || known.localBytes + added <= localBudgetBytes)) {
@@ -5157,8 +5162,38 @@ function createPrivateCasArtifactPort(root, namespace, options = {}) {
5157
5162
  if (uploading.get(sha) === current) uploading.delete(sha);
5158
5163
  }
5159
5164
  };
5165
+ const undurableObjects = async () => {
5166
+ const objects = [];
5167
+ for (const hex of [...undurable]) {
5168
+ const path = join(store, hex.slice(0, 2), hex);
5169
+ try {
5170
+ const entry = await lstat(path);
5171
+ if (entry.isFile()) objects.push({
5172
+ hex,
5173
+ path,
5174
+ size: entry.size,
5175
+ modifiedMs: entry.mtimeMs
5176
+ });
5177
+ } catch (error) {
5178
+ if (!missing(error)) throw error;
5179
+ undurable.delete(hex);
5180
+ }
5181
+ }
5182
+ return objects;
5183
+ };
5184
+ const receiptCount = async () => {
5185
+ try {
5186
+ return (await readdir(receipts)).filter((name) => HEX.test(name)).length;
5187
+ } catch (error) {
5188
+ if (!missing(error)) throw error;
5189
+ return 0;
5190
+ }
5191
+ };
5160
5192
  const sweep = async (signal) => {
5161
- const objects = await localObjects();
5193
+ let indexedBytes = 0;
5194
+ for (const size of localIndex.values()) indexedBytes += size;
5195
+ const full = lastPass === void 0 || durable === void 0 || localBudgetBytes !== void 0 && indexedBytes > localBudgetBytes;
5196
+ const objects = full ? await localObjects() : await undurableObjects();
5162
5197
  let refusal;
5163
5198
  const outcomes = await mapWithConcurrency(objects, durable === void 0 || durable.putStream && durable.getStream ? OFFLOAD_COPIES_AT_ONCE : 1, async ({ hex, path, size }) => {
5164
5199
  const inflight = uploading.get(hex);
@@ -5219,6 +5254,26 @@ function createPrivateCasArtifactPort(root, namespace, options = {}) {
5219
5254
  digest: `sha256:${outcome.hex}`,
5220
5255
  error: outcome.error
5221
5256
  });
5257
+ for (const outcome of outcomes) if (outcome.durable) undurable.delete(outcome.hex);
5258
+ else if (durable !== void 0) undurable.add(outcome.hex);
5259
+ if (!full) {
5260
+ let localBytes = 0;
5261
+ for (const size of localIndex.values()) localBytes += size;
5262
+ lastPass = {
5263
+ localBytes,
5264
+ pending: pending.length
5265
+ };
5266
+ return {
5267
+ durable: await receiptCount(),
5268
+ uploaded,
5269
+ pending,
5270
+ evicted: 0,
5271
+ localObjects: localIndex.size,
5272
+ localBytes
5273
+ };
5274
+ }
5275
+ localIndex.clear();
5276
+ for (const object of objects) localIndex.set(object.hex, object.size);
5222
5277
  let localBytes = objects.reduce((total, object) => total + object.size, 0);
5223
5278
  let evicted = 0;
5224
5279
  if (localBudgetBytes !== void 0) for (const object of [...objects].sort((a, b) => a.modifiedMs - b.modifiedMs)) {
@@ -5230,20 +5285,15 @@ function createPrivateCasArtifactPort(root, namespace, options = {}) {
5230
5285
  if (!missing(error)) throw error;
5231
5286
  }
5232
5287
  localBytes -= object.size;
5288
+ localIndex.delete(object.hex);
5233
5289
  evicted++;
5234
5290
  }
5235
5291
  lastPass = {
5236
5292
  localBytes,
5237
5293
  pending: pending.length
5238
5294
  };
5239
- let receiptCount = 0;
5240
- try {
5241
- receiptCount = (await readdir(receipts)).filter((name) => HEX.test(name)).length;
5242
- } catch (error) {
5243
- if (!missing(error)) throw error;
5244
- }
5245
5295
  return {
5246
- durable: receiptCount,
5296
+ durable: await receiptCount(),
5247
5297
  uploaded,
5248
5298
  pending,
5249
5299
  evicted,
@@ -9359,4 +9409,4 @@ function tail(s) {
9359
9409
  //#endregion
9360
9410
  export { runBenchmark as $, McpSpawnFault as $t, connectRemoteSupervisor as A, inlineSandboxClient as At, chatTransportExecutor as B, runIsolatedCheck as Bt, analyzeTrace as C, observationFromRegistry as Ct, compileSearchSpec as D, defineLeaderboard as Dt, assertSearchSpec as E, harvestCorpus as Et, profileRunsForName as F, checkProgramDigest as Ft, assertStrategyContract as G, leaderboard as Gt, createChatSessionStore as H, deterministicCompletion as Ht, recordProfileRun as I, declaredCheckDeliverable as It, strategyAuthorSystemPrompt as J, renderLeaderboardMarkdown as Jt, authorStrategy as K, pairwiseSignificance as Kt, patchDelivered as L, declaredCheckDigest as Lt, loadProfile as M, loopDispatch as Mt, pickBestProfile as N, superviseDispatch as Nt, searchPresets as O, resolveSandboxClient as Ot, profileRegistry as P, assertDeclaredCheck as Pt, printBenchmarkReport as Q, openSqlRunStore as Qt, runCoderChecks as R, declaredCheckJudge as Rt, withUntrackedArtifacts as S, registryScopeAnalyst as St, SEARCH_SPEC_CORRELATION_KEY as T, HarvestError as Tt, runStrategyEvolution as U, sentinelCompletion as Ut, chatWorkerSeam as V, completionAuthorizes as Vt, strategyTournament as W, stopSentinel as Wt, openSandboxRun as X, renderPairwiseMarkdown as Xt, SandboxRunAbortError as Y, renderLeaderboardSvg as Yt, createS3PrivateCasStore as Z, SqlRunOwnershipError as Zt, VERIFY_TAIL_CHARS as _, verify as _t, localShell as a, mcpSecretEnvMetadataKey as an, builtinShapes as at, settledWorkerOut as b, buildSteerContext as bt, createVerifierEnvironment as c, secretEnvOfMcpServer as cn, FileCorpus as ct, harvestSurfaceDiffs as d, fanout as dt, connectStdioMcp as en, createPrivateCasArtifactPort as et, analystsFromRegistry as f, flatWidenGate as ft, NOTE_MAX_CHARS as g, selectValidWinner as gt, EVIDENCE_MAX_CHARS as h, pipeline as ht, jjWorkspace as i, envKeyProvider as in, runPersonified as it, bestProfileFor as j, loopCampaignDispatch as jt, searchSpecDigest as k, localSandboxClient as kt, boxSurfaceReader as l, createTangleSandboxExactProcessProvider as ln, InMemoryCorpus as lt, worktreeFanout as m, panel as mt, makeFinding$1 as n, createMcpEnvironment as nn, trajectoryReport as nt, runInWorkspace as o, resolveMcpServerLaunch as on, createShapeRegistry as ot, failuresAnalyst as p, loopUntil as pt, strategyAuthorContract as q, renderLeaderboardHtml as qt, gitWorkspace as r, sanitizeMcpToolSchema as rn, definePersona as rt, createWaterfallCollector as s, resolveSecretEnv as sn, registerShape as st, computeFindingId$1 as t, materializeLocalMcp as tn, equalKOnCost as tt, fsSurfaceReader as u, renderCorpusToInstructions as ut, closingWorkerNote as v, widen as vt, createFencedSqlRunContext as w, inProcessSandboxClient as wt, copyUntrackedIntoClone as x, createScopeAnalyst as xt, composeWorkerEvidence as y, assertTraceDerivedFindings as yt, graphDesignerExtraTools as z, readDeclaredCheck as zt };
9361
9411
 
9362
- //# sourceMappingURL=runtime-BeuNt-n3.js.map
9412
+ //# sourceMappingURL=runtime-Cff0UnPw.js.map