@tangle-network/agent-runtime 0.190.0 → 0.192.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 (75) hide show
  1. package/dist/{activation-BgRWFKZi.js → activation-D9WGuwcK.js} +2 -2
  2. package/dist/{activation-BgRWFKZi.js.map → activation-D9WGuwcK.js.map} +1 -1
  3. package/dist/agent.d.ts +1 -1
  4. package/dist/agent.js +2 -2
  5. package/dist/{authoring-dQQ2z1fT.js → authoring-BzMyFv9z.js} +7 -3
  6. package/dist/{authoring-dQQ2z1fT.js.map → authoring-BzMyFv9z.js.map} +1 -1
  7. package/dist/conversation.d.ts +1 -1
  8. package/dist/{coordination-driver-Da1IGdTP.js → coordination-driver-_wzRdIK_.js} +668 -35
  9. package/dist/coordination-driver-_wzRdIK_.js.map +1 -0
  10. package/dist/durable.d.ts +2 -2
  11. package/dist/durable.js +1 -1
  12. package/dist/{environment-provider-Bf-hgR6p.d.ts → environment-provider-CJ43FJfJ.d.ts} +2 -2
  13. package/dist/{environment-provider-DcelIawX.js → environment-provider-DEwsolvi.js} +43 -6
  14. package/dist/environment-provider-DEwsolvi.js.map +1 -0
  15. package/dist/environment-provider.d.ts +1 -1
  16. package/dist/environment-provider.js +1 -1
  17. package/dist/{graph-Bd1elhdL.js → graph-y0AW_Txn.js} +3 -2
  18. package/dist/graph-y0AW_Txn.js.map +1 -0
  19. package/dist/graph.d.ts +3 -3
  20. package/dist/graph.js +3 -3
  21. package/dist/{redact-Cv1GfOFO.d.ts → improve-Cbbt3jE6.d.ts} +4 -36
  22. package/dist/{improvement-cycle-BanlFMyL.js → improvement-cycle-BPyj98Id.js} +3 -3
  23. package/dist/{improvement-cycle-BanlFMyL.js.map → improvement-cycle-BPyj98Id.js.map} +1 -1
  24. package/dist/{index-DpNil9jh.d.ts → index-B_fEqr5V.d.ts} +328 -13
  25. package/dist/{index-C-gBk5M9.d.ts → index-COznK4kB.d.ts} +4 -4
  26. package/dist/{index-Clb7_qML.d.ts → index-OSRVFARy.d.ts} +2 -2
  27. package/dist/index.d.ts +9 -8
  28. package/dist/index.js +7 -8
  29. package/dist/index.js.map +1 -1
  30. package/dist/intelligence.d.ts +5 -4
  31. package/dist/intelligence.js +4 -5
  32. package/dist/intelligence.js.map +1 -1
  33. package/dist/kernel.d.ts +6 -6
  34. package/dist/kernel.js +9 -9
  35. package/dist/{knowledge-BXdXlv48.js → knowledge-BIo_3VwO.js} +3 -3
  36. package/dist/{knowledge-BXdXlv48.js.map → knowledge-BIo_3VwO.js.map} +1 -1
  37. package/dist/knowledge.d.ts +1 -1
  38. package/dist/knowledge.js +1 -1
  39. package/dist/{loop-runner-bin-CGQzzWAc.js → loop-runner-bin-C-FnTrM8.js} +3 -3
  40. package/dist/{loop-runner-bin-CGQzzWAc.js.map → loop-runner-bin-C-FnTrM8.js.map} +1 -1
  41. package/dist/{loop-runner-bin-Cy4f9M6p.d.ts → loop-runner-bin-DiiZMHw7.d.ts} +3 -3
  42. package/dist/loop-runner-bin.d.ts +1 -1
  43. package/dist/loop-runner-bin.js +1 -1
  44. package/dist/mcp/bin.js +3 -3
  45. package/dist/mcp/index.d.ts +4 -4
  46. package/dist/mcp/index.js +6 -6
  47. package/dist/{openai-tools-BSDk_umV.js → openai-tools-PzShuaP4.js} +2 -2
  48. package/dist/{openai-tools-BSDk_umV.js.map → openai-tools-PzShuaP4.js.map} +1 -1
  49. package/dist/primeintellect/index.d.ts +1 -1
  50. package/dist/{provision-supervisor-bwpzajiz.js → provision-supervisor-DkVH1f9I.js} +4 -4
  51. package/dist/{provision-supervisor-bwpzajiz.js.map → provision-supervisor-DkVH1f9I.js.map} +1 -1
  52. package/dist/{supervisor-CqJW4qap.js → redact-h5zAxyNV.js} +179 -12
  53. package/dist/redact-h5zAxyNV.js.map +1 -0
  54. package/dist/{runtime-Ddh7PyCy.js → runtime-1JqxyKDI.js} +84 -30
  55. package/dist/runtime-1JqxyKDI.js.map +1 -0
  56. package/dist/{runtime-BMWmSu4A.d.ts → runtime-DI4mJNXI.d.ts} +3 -3
  57. package/dist/{stream-agent-turn-uqzf9ZEh.d.ts → stream-agent-turn-_GgUW49y.d.ts} +35 -3
  58. package/dist/{structural-rollout-0NKvKuFm.js → structural-rollout-CunhVUWJ.js} +2 -2
  59. package/dist/{structural-rollout-0NKvKuFm.js.map → structural-rollout-CunhVUWJ.js.map} +1 -1
  60. package/dist/{supervise-yDiZAqlN.js → supervise-Bx1Ps8xQ.js} +21 -6
  61. package/dist/supervise-Bx1Ps8xQ.js.map +1 -0
  62. package/dist/testing.d.ts +2 -2
  63. package/dist/testing.js +12 -12
  64. package/dist/tui/index.d.ts +1 -1
  65. package/dist/tui/index.js +1 -1
  66. package/dist/{types-02hXqnSP.d.ts → types-DKA_PDv0.d.ts} +27 -2
  67. package/package.json +1 -1
  68. package/dist/coordination-driver-Da1IGdTP.js.map +0 -1
  69. package/dist/environment-provider-DcelIawX.js.map +0 -1
  70. package/dist/graph-Bd1elhdL.js.map +0 -1
  71. package/dist/redact-D-u-rrcn.js +0 -82
  72. package/dist/redact-D-u-rrcn.js.map +0 -1
  73. package/dist/runtime-Ddh7PyCy.js.map +0 -1
  74. package/dist/supervise-yDiZAqlN.js.map +0 -1
  75. package/dist/supervisor-CqJW4qap.js.map +0 -1
@@ -7,19 +7,19 @@ import { i as redactProtectedValue, r as redactProtectedReason } from "./protect
7
7
  import { l as notifySandboxEventObserver } from "./sandbox-events-DWeQRWxg.js";
8
8
  import { n as executableAgentSpecSnapshot, t as executableAgentProfileSnapshot } from "./executable-spec-DxuiDFAU.js";
9
9
  import { c as profileModelExecutionSettings, i as concreteModelId, l as profileProviderModel, o as enforceTokenLimits, t as assertExecutableAgentProfile } from "./model-policy-Wf2MxXJ9.js";
10
- import { Bt as createSandboxLineage, G as rollingDispatch, Gt as routerBrain, Kt as runBrainLoop, Lt as defaultSelectWinner, Ut as assertBoxlessPromptOptions, Vt as probeSandboxCapabilities, Wt as readPromptOptions, at as createExecutor, ct as createWorktreeCliExecutor, f as withDriverExecutor, gt as createPushTraceSource, n as createSupervisor, ot as createExecutorRegistry, qt as canonicalObservedModel, y as settledToIteration, zt as runAgentRounds } from "./supervisor-CqJW4qap.js";
11
- import "./environment-provider-DcelIawX.js";
10
+ import { Bt as defaultSelectWinner, Ht as runAgentRounds, J as rollingDispatch, Jt as routerBrain, Kt as assertBoxlessPromptOptions, S as settledToIteration, Ut as createSandboxLineage, Wt as probeSandboxCapabilities, Xt as canonicalObservedModelParts, Yt as runBrainLoop, a as createSupervisor, ct as createExecutor, dt as createWorktreeCliExecutor, h as withDriverExecutor, lt as createExecutorRegistry, qt as readPromptOptions, yt as createPushTraceSource } from "./redact-h5zAxyNV.js";
11
+ import "./environment-provider-DEwsolvi.js";
12
12
  import { i as notifyRuntimeHookEvent } from "./runtime-hooks-tXpAarhW.js";
13
- import { C as observe, O as strategyAuthorMethod, T as profileChatClient, b as sample, v as refine, x as sampleThenRefine, y as runAgentic } from "./structural-rollout-0NKvKuFm.js";
14
- import "./coordination-driver-Da1IGdTP.js";
15
- import { n as supervise, vt as gateOnDeliverable, yt as mapExecutorResult } from "./supervise-yDiZAqlN.js";
13
+ import { C as observe, O as strategyAuthorMethod, T as profileChatClient, b as sample, v as refine, x as sampleThenRefine, y as runAgentic } from "./structural-rollout-CunhVUWJ.js";
14
+ import "./coordination-driver-_wzRdIK_.js";
15
+ import { n as supervise, vt as gateOnDeliverable, yt as mapExecutorResult } from "./supervise-Bx1Ps8xQ.js";
16
16
  import "./run-layout-B8I_LXN-.js";
17
- import "./provision-supervisor-bwpzajiz.js";
17
+ import "./provision-supervisor-DkVH1f9I.js";
18
18
  import { t as assertAuthoredCode } from "./authored-code-DzYtiflw.js";
19
- import "./authoring-dQQ2z1fT.js";
20
- import "./graph-Bd1elhdL.js";
21
- import { agentProfileSchema, canonicalAgentProfileDigest, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
22
- import { CODING_HARNESSES, DEFAULT_TRACE_ANALYST_KINDS, InMemoryTraceStore, OUTPUT_VALUE, benjaminiHochberg, buildTrajectory, computeFindingId as computeFindingId$1, confidenceInterval, expandProfileAxes, makeFinding as makeFinding$1, pairedBootstrap, paretoFrontier, wilcoxonSignedRank, wilson } from "@tangle-network/agent-eval";
19
+ import "./authoring-BzMyFv9z.js";
20
+ import "./graph-y0AW_Txn.js";
21
+ import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
22
+ 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";
23
23
  import { createHash, randomUUID } from "node:crypto";
24
24
  import { appendFileSync, chmodSync, constants, copyFileSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readlinkSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
25
25
  import { mkdir, readFile, realpath, writeFile } from "node:fs/promises";
@@ -1112,29 +1112,33 @@ function collectProviderModels(evidence, validate) {
1112
1112
  if (attempt === null || typeof attempt !== "object" || !Array.isArray(attempt.observations) || attempt.observations.length === 0 || attempt.identityConflict === true) return { kind: "unknown" };
1113
1113
  let attemptBase;
1114
1114
  let attemptSnapshot;
1115
+ let attemptSnapshotKind;
1115
1116
  let representative;
1116
1117
  for (const model of attempt.observations) {
1117
1118
  if (typeof model !== "string" || !validate(model)) return { kind: "unknown" };
1118
- const identity = canonicalObservedModel(model);
1119
+ const identity = canonicalObservedModelParts(model);
1119
1120
  if (identity === void 0) return { kind: "unknown" };
1120
- const at = identity.lastIndexOf("@");
1121
- const base = at < 0 ? identity : identity.slice(0, at);
1122
- const snapshot = at < 0 ? void 0 : identity.slice(at + 1);
1121
+ const base = identity.base;
1122
+ const snapshot = identity.snapshot;
1123
1123
  if (attemptBase !== void 0 && attemptBase !== base) return {
1124
1124
  kind: "mixed",
1125
- models: [.../* @__PURE__ */ new Set([...attemptBase ? [attemptBase] : [], identity])]
1126
- };
1127
- if (attemptSnapshot !== void 0 && snapshot !== void 0 && attemptSnapshot !== snapshot) return {
1128
- kind: "mixed",
1129
- models: [`${attemptBase}@${attemptSnapshot}`, `${base}@${snapshot}`]
1125
+ models: [.../* @__PURE__ */ new Set([...attemptBase ? [attemptBase] : [], identity.canonical])]
1130
1126
  };
1127
+ if (attemptSnapshot !== void 0 && snapshot !== void 0 && (attemptSnapshot !== snapshot || attemptSnapshotKind !== identity.snapshotKind)) {
1128
+ if (attemptBase === void 0 || attemptSnapshotKind === void 0) return { kind: "unknown" };
1129
+ return {
1130
+ kind: "mixed",
1131
+ models: [attemptIdentityText(attemptBase, attemptSnapshot, attemptSnapshotKind), identity.canonical]
1132
+ };
1133
+ }
1131
1134
  attemptBase = base;
1132
1135
  attemptSnapshot ??= snapshot;
1136
+ attemptSnapshotKind ??= identity.snapshotKind;
1133
1137
  if (snapshot !== void 0) representative = model;
1134
1138
  observedRaw.add(model);
1135
1139
  }
1136
- if (attemptBase === void 0 || attemptSnapshot === void 0 || representative === void 0) return { kind: "unknown" };
1137
- const attemptIdentity = `${attemptBase}@${attemptSnapshot}`;
1140
+ if (attemptBase === void 0 || attemptSnapshot === void 0 || attemptSnapshotKind === void 0 || representative === void 0) return { kind: "unknown" };
1141
+ const attemptIdentity = attemptIdentityText(attemptBase, attemptSnapshot, attemptSnapshotKind);
1138
1142
  observed.push({
1139
1143
  raw: representative,
1140
1144
  canonical: attemptIdentity
@@ -1156,6 +1160,9 @@ function collectProviderModels(evidence, validate) {
1156
1160
  observed
1157
1161
  };
1158
1162
  }
1163
+ function attemptIdentityText(base, snapshot, kind) {
1164
+ return kind === "date" ? `${base}-${snapshot}` : `${base}@${snapshot}`;
1165
+ }
1159
1166
  /** The Eval receipt surface has no pre-admitted per-model recursive-tree receipt bundle yet. */
1160
1167
  var SupervisedTreeModelIdentityError = class extends Error {
1161
1168
  constructor(identity) {
@@ -2990,9 +2997,12 @@ async function runPersonified(options) {
2990
2997
  journal: options.journal ?? new InMemorySpawnJournal(),
2991
2998
  blobs: options.blobs ?? new InMemoryResultBlobStore(),
2992
2999
  executors,
3000
+ ...options.rootIdentity !== void 0 ? { rootIdentity: options.rootIdentity } : {},
2993
3001
  ...options.maxDepth !== void 0 ? { maxDepth: options.maxDepth } : {},
3002
+ ...options.maxLiveWorkers !== void 0 ? { maxLiveWorkers: options.maxLiveWorkers } : {},
2994
3003
  ...options.maxRestarts !== void 0 ? { maxRestarts: options.maxRestarts } : {},
2995
3004
  ...options.withinMs !== void 0 ? { withinMs: options.withinMs } : {},
3005
+ ...options.resume !== void 0 ? { resume: options.resume } : {},
2996
3006
  ...options.now ? { now: options.now } : {},
2997
3007
  ...options.signal ? { signal: options.signal } : {},
2998
3008
  ...options.hooks ? { hooks: options.hooks } : {}
@@ -4723,7 +4733,7 @@ function chatWorkerSeam(opts) {
4723
4733
  * THE GRANT CANNOT DRIFT FROM THE DOCS: `search` renders from `context.coordinationTools()`, the
4724
4734
  * same descriptor objects the verbs are served from — never prose written beside them.
4725
4735
  */
4726
- /** The seven coordination verbs callable in code, and the `context.verbs` member each maps to. */
4736
+ /** The coordination verbs callable in code, and the `context.verbs` member each maps to. */
4727
4737
  const CODE_CALLABLE_VERBS = {
4728
4738
  spawn_worker: "spawnAgent",
4729
4739
  await_event: "awaitEvent",
@@ -4731,7 +4741,9 @@ const CODE_CALLABLE_VERBS = {
4731
4741
  observe_agent: "observeAgent",
4732
4742
  list_questions: "listQuestions",
4733
4743
  answer_question: "answerQuestion",
4734
- run_analyst: "runAnalyst"
4744
+ run_analyst: "runAnalyst",
4745
+ read_journal: "readJournal",
4746
+ define_analyst: "defineAnalyst"
4735
4747
  };
4736
4748
  /** The manager's own lifecycle verbs — never callable from code; `search` names them and why. */
4737
4749
  const LIFECYCLE_VERBS = [
@@ -5482,18 +5494,60 @@ function analystsFromRegistry(registry, kinds = DEFAULT_TRACE_ANALYST_KINDS, opt
5482
5494
  const registered = new Set(registry.list().map((analyst) => analyst.id));
5483
5495
  const missing = kinds.map((kind) => kind.id).filter((id) => !registered.has(id));
5484
5496
  if (missing.length > 0) throw new ValidationError(`analystsFromRegistry: ${missing.map((id) => JSON.stringify(id)).join(", ")} ${missing.length === 1 ? "is" : "are"} not registered; the registry has ${[...registered].map((id) => JSON.stringify(id)).join(", ") || "<none>"}`);
5497
+ const adapted = kinds.map((kind) => ({
5498
+ id: kind.id,
5499
+ description: kind.description,
5500
+ area: kind.area
5501
+ }));
5502
+ const authoring = opts?.authoring;
5503
+ if (authoring !== void 0 && typeof registry.register !== "function") throw new ValidationError("analystsFromRegistry: `authoring` needs a registry with `register`; pass the agent-eval AnalystRegistry itself, not a read-only shim");
5504
+ const authoringRegistry = registry;
5485
5505
  return {
5486
- kinds: kinds.map((kind) => ({
5487
- id: kind.id,
5488
- description: kind.description,
5489
- area: kind.area
5490
- })),
5506
+ kinds: adapted,
5491
5507
  run: async (kindId, trace) => {
5492
5508
  return (await registry.run(`supervise-analyst-${kindId}-${randomUUID()}`, { traceStore: trace }, {
5493
5509
  ...opts?.runOpts,
5494
5510
  only: [kindId]
5495
5511
  })).findings;
5496
- }
5512
+ },
5513
+ ...authoring === void 0 ? {} : { register: (definition) => {
5514
+ const engine = authoring.resolveEngine(definition.model);
5515
+ const analyst = createTraceAnalyst(traceAnalystFromAuthored(definition), {
5516
+ engine,
5517
+ ...authoring.settlementTimeoutMs === void 0 ? {} : { settlementTimeoutMs: authoring.settlementTimeoutMs }
5518
+ });
5519
+ try {
5520
+ authoringRegistry.register(analyst);
5521
+ } catch (error) {
5522
+ throw new ValidationError(`the lens id ${JSON.stringify(definition.id)} is already registered for this run — analyst ids are shared by every manager in the tree, so pick a more specific id: ${error instanceof Error ? error.message : String(error)}`);
5523
+ }
5524
+ return {
5525
+ id: definition.id,
5526
+ description: definition.description,
5527
+ area: definition.area
5528
+ };
5529
+ } }
5530
+ };
5531
+ }
5532
+ /**
5533
+ * Map an authored definition onto the eval definition `createTraceAnalyst` compiles.
5534
+ *
5535
+ * The version is DERIVED from the definition's own canonical digest, never supplied by the manager.
5536
+ * That is what makes an invented lens reproducible: the same authored words always compile to the
5537
+ * same analyst version, two different wordings can never share one, and a finding's `analyst_id`
5538
+ * plus version names the exact text that produced it.
5539
+ */
5540
+ function traceAnalystFromAuthored(definition) {
5541
+ return {
5542
+ id: definition.id,
5543
+ description: definition.description,
5544
+ area: definition.area,
5545
+ version: `1.0.0+authored.${canonicalCandidateDigest(definition).slice(-12)}`,
5546
+ question: definition.question,
5547
+ instructions: definition.instructions,
5548
+ toolGroup: definition.toolGroup,
5549
+ ...definition.limits === void 0 ? {} : { limits: definition.limits },
5550
+ ...definition.minimumEvidenceCitations === void 0 ? {} : { minimumEvidenceCitations: definition.minimumEvidenceCitations }
5497
5551
  };
5498
5552
  }
5499
5553
  /** The default self-improvement LENS — authored content, not a code path. On each settled worker it hands
@@ -6296,4 +6350,4 @@ function tail(s) {
6296
6350
  //#endregion
6297
6351
  export { InMemoryCorpus as $, chatWorkerSeam as A, renderLeaderboardSvg as At, SandboxRunAbortError as B, mcpSecretEnvMetadataKey as Bt, withUntrackedArtifacts as C, deterministicCompletion as Ct, codeModeSupervisorTools as D, pairwiseSignificance as Dt, runCoderChecks as E, leaderboard as Et, selectChampion as F, connectStdioMcp as Ft, equalKOnCost as G, printBenchmarkReport as H, resolveSecretEnv as Ht, assertStrategyContract as I, materializeLocalMcp as It, runPersonified as J, trajectoryReport as K, authorStrategy as L, createMcpEnvironment as Lt, discriminatingMeans as M, auditIntent as Mt, pickChampion as N, defaultAuditorInstruction as Nt, unsafeInProcessRunner as O, renderLeaderboardHtml as Ot, runStrategyEvolution as P, McpSpawnFault as Pt, FileCorpus as Q, strategyAuthorContract as R, sanitizeMcpToolSchema as Rt, copyUntrackedIntoClone as S, completionAuthorizes as St, patchDelivered as T, stopSentinel as Tt, runBenchmark as U, secretEnvOfMcpServer as Ut, openSandboxRun as V, resolveMcpServerLaunch as Vt, promotionGate as W, createShapeRegistry as X, builtinShapes as Y, registerShape as Z, NOTE_MAX_CHARS as _, localSandboxClient as _t, localShell as a, pipeline as at, composeWorkerEvidence as b, loopDispatch as bt, createVerifierEnvironment as c, widen as ct, harvestSurfaceDiffs as d, createScopeAnalyst as dt, renderCorpusToInstructions as et, analystsFromRegistry as f, registryScopeAnalyst as ft, EVIDENCE_MAX_CHARS as g, resolveSandboxClient as gt, worktreeFanout as h, defineLeaderboard as ht, jjWorkspace as i, panel as it, createChatSessionStore as j, renderPairwiseMarkdown as jt, chatTransportExecutor as k, renderLeaderboardMarkdown as kt, boxSurfaceReader as l, assertTraceDerivedFindings as lt, superviseSurface as m, harvestCorpus as mt, makeFinding$1 as n, flatWidenGate as nt, runInWorkspace as o, selectValidWinner as ot, failuresAnalyst as p, inProcessSandboxClient as pt, definePersona as q, gitWorkspace as r, loopUntil as rt, createWaterfallCollector as s, verify as st, computeFindingId$1 as t, fanout as tt, fsSurfaceReader as u, buildSteerContext as ut, VERIFY_TAIL_CHARS as v, inlineSandboxClient as vt, analyzeTrace as w, sentinelCompletion as wt, settledWorkerOut as x, superviseDispatch as xt, closingWorkerNote as y, loopCampaignDispatch as yt, strategyAuthorSystemPrompt as z, envKeyProvider as zt };
6298
6352
 
6299
- //# sourceMappingURL=runtime-Ddh7PyCy.js.map
6353
+ //# sourceMappingURL=runtime-1JqxyKDI.js.map