@tangle-network/agent-runtime 3.0.39 → 3.0.40

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 (54) hide show
  1. package/dist/{activation-BbQGq4Py.js → activation-n22lMRhH.js} +2 -2
  2. package/dist/{activation-BbQGq4Py.js.map → activation-n22lMRhH.js.map} +1 -1
  3. package/dist/agent.js +4 -4
  4. package/dist/{coordination-manager-B3mF1nMA.js → coordination-manager-C_ohXf63.js} +6 -6
  5. package/dist/{coordination-manager-B3mF1nMA.js.map → coordination-manager-C_ohXf63.js.map} +1 -1
  6. package/dist/{coordination-map-routing-BllzcZov.js → coordination-map-routing-2_hUlTnz.js} +2 -2
  7. package/dist/{coordination-map-routing-BllzcZov.js.map → coordination-map-routing-2_hUlTnz.js.map} +1 -1
  8. package/dist/{delegate-DR2gtTHa.js → delegate-BYLjG7Ev.js} +2 -2
  9. package/dist/{delegate-DR2gtTHa.js.map → delegate-BYLjG7Ev.js.map} +1 -1
  10. package/dist/durable.js +7 -7
  11. package/dist/{graph-BBQ6L1Mc.js → graph-T1-PBhLx.js} +6 -6
  12. package/dist/{graph-BBQ6L1Mc.js.map → graph-T1-PBhLx.js.map} +1 -1
  13. package/dist/{graph-registry-D6y6zffC.js → graph-registry-BoaUV5g8.js} +3 -3
  14. package/dist/{graph-registry-D6y6zffC.js.map → graph-registry-BoaUV5g8.js.map} +1 -1
  15. package/dist/{graph-registry-rV9mwxQO.js → graph-registry-EGeo_moB.js} +1 -1
  16. package/dist/{improve-fCd7c9dZ.js → improve-BqMfcxh1.js} +7 -7
  17. package/dist/{improve-fCd7c9dZ.js.map → improve-BqMfcxh1.js.map} +1 -1
  18. package/dist/index.js +9 -9
  19. package/dist/intelligence.js +5 -5
  20. package/dist/{jsonl-file-BBP9Dz9w.js → jsonl-file-CbxMVnUj.js} +16 -18
  21. package/dist/jsonl-file-CbxMVnUj.js.map +1 -0
  22. package/dist/kernel.js +12 -12
  23. package/dist/{loop-runner-DshmaiYp.js → loop-runner-CGa71-66.js} +2 -2
  24. package/dist/{loop-runner-DshmaiYp.js.map → loop-runner-CGa71-66.js.map} +1 -1
  25. package/dist/loop-runner-bin.js +1 -1
  26. package/dist/mcp/bin.js +3 -3
  27. package/dist/mcp/index.js +5 -5
  28. package/dist/{provision-supervisor-s7XtrK3h.js → provision-supervisor-Dl6oYQDN.js} +5 -5
  29. package/dist/{provision-supervisor-s7XtrK3h.js.map → provision-supervisor-Dl6oYQDN.js.map} +1 -1
  30. package/dist/{run-cancellation-CRPdLJVP.js → run-cancellation-BzmmqlM8.js} +3 -3
  31. package/dist/{run-cancellation-CRPdLJVP.js.map → run-cancellation-BzmmqlM8.js.map} +1 -1
  32. package/dist/{runtime-BufkoSjF.js → runtime-DoUb4SOs.js} +15 -15
  33. package/dist/{runtime-BufkoSjF.js.map → runtime-DoUb4SOs.js.map} +1 -1
  34. package/dist/{scope-CpULJrAr.js → scope-BGWRFiYt.js} +2 -2
  35. package/dist/{scope-CpULJrAr.js.map → scope-BGWRFiYt.js.map} +1 -1
  36. package/dist/{search-executor-qcgra0sA.js → search-executor-DPBewC3S.js} +3 -3
  37. package/dist/{search-executor-qcgra0sA.js.map → search-executor-DPBewC3S.js.map} +1 -1
  38. package/dist/{server-CekOTeag.js → server-M9dG-WG9.js} +3 -3
  39. package/dist/{server-CekOTeag.js.map → server-M9dG-WG9.js.map} +1 -1
  40. package/dist/{structural-rollout-CSLfWHEN.js → structural-rollout-BylGQ_wK.js} +3 -3
  41. package/dist/{structural-rollout-CSLfWHEN.js.map → structural-rollout-BylGQ_wK.js.map} +1 -1
  42. package/dist/{supervise-Dszn1xVB.js → supervise-BfT708zt.js} +8 -8
  43. package/dist/{supervise-Dszn1xVB.js.map → supervise-BfT708zt.js.map} +1 -1
  44. package/dist/{supervision-discovery-1UUbaYC6.js → supervision-discovery-C2Tjw6LX.js} +3 -3
  45. package/dist/{supervision-discovery-1UUbaYC6.js.map → supervision-discovery-C2Tjw6LX.js.map} +1 -1
  46. package/dist/{supervisor-CWTFw-lP.js → supervisor-BDnqTl_R.js} +3 -3
  47. package/dist/{supervisor-CWTFw-lP.js.map → supervisor-BDnqTl_R.js.map} +1 -1
  48. package/dist/testing.js +11 -11
  49. package/dist/{top-web-CuLbTd93.js → top-web-Ms-SgnGN.js} +5 -5
  50. package/dist/{top-web-CuLbTd93.js.map → top-web-Ms-SgnGN.js.map} +1 -1
  51. package/dist/tui/bin.js +3 -3
  52. package/dist/tui/index.js +2 -2
  53. package/package.json +1 -1
  54. package/dist/jsonl-file-BBP9Dz9w.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,17 +1,17 @@
1
- import { Fn as buildLoopOtelSpans, Gn as sanitizeKnowledgeReadinessReport, Hn as loopEventToOtelSpan, Kn as sanitizeRuntimeStreamEvent, Un as createRuntimeEventCollector, Vr as executableAgentProfileSnapshot, Wn as createRuntimeStreamEventCollector, da as providerMessageText, qr as runtimeFailureCause, zn as createOtelExporter } from "./scope-CpULJrAr.js";
1
+ import { Fn as buildLoopOtelSpans, Gn as sanitizeKnowledgeReadinessReport, Hn as loopEventToOtelSpan, Kn as sanitizeRuntimeStreamEvent, Un as createRuntimeEventCollector, Vr as executableAgentProfileSnapshot, Wn as createRuntimeStreamEventCollector, da as providerMessageText, qr as runtimeFailureCause, zn as createOtelExporter } from "./scope-BGWRFiYt.js";
2
2
  import { a as JudgeError, f as RuntimeRunStateError, i as ConfigError, m as ValidationError, o as NotFoundError, r as BackendTransportError, t as AgentEvalError } from "./errors-AzSuGI23.js";
3
- import { B as InMemoryRuntimeSessionStore, C as optimizerMethod, H as nowIso, I as streamAgentTurn, L as createIterableBackend, R as createSandboxPromptBackend, U as startOrResumeRuntimeSession, V as newRuntimeSession, W as touchSession, z as normalizeBackendStreamEvent } from "./structural-rollout-CSLfWHEN.js";
3
+ import { B as InMemoryRuntimeSessionStore, C as optimizerMethod, H as nowIso, I as streamAgentTurn, L as createIterableBackend, R as createSandboxPromptBackend, U as startOrResumeRuntimeSession, V as newRuntimeSession, W as touchSession, z as normalizeBackendStreamEvent } from "./structural-rollout-BylGQ_wK.js";
4
4
  import { I as embeddedCandidateArtifact, L as immutableCandidateValue, M as canonicalCandidateBytes$1, N as canonicalCandidateDigest$1, R as omitTopLevelDigest, _ as persistCandidateOutputArtifact, at as sleep, s as captureAgentCandidateWorkspace } from "./workspace-streams-8ALHaZzx.js";
5
- import { b as resolveRedactor, y as defaultRedactorIdentityMaterial } from "./jsonl-file-BBP9Dz9w.js";
6
- import { Mt as ROUTER_PRICE_SOURCE, jt as priceTokens } from "./supervisor-CWTFw-lP.js";
5
+ import { b as resolveRedactor, y as defaultRedactorIdentityMaterial } from "./jsonl-file-CbxMVnUj.js";
6
+ import { Mt as ROUTER_PRICE_SOURCE, jt as priceTokens } from "./supervisor-BDnqTl_R.js";
7
7
  import { t as assertExecutableAgentProfile } from "./model-policy-JOcg3NRs.js";
8
- import { c as withMethodRuntimeControls, d as commandVerifier, f as addRuntimeUsage, i as assertCandidateValidator, m as isUsageAmount, n as createCommandProfileTrainer, o as parseExecutionRef, p as createRuntimeUsageTotals, r as searchMethod, s as privateValuePaths, t as improve, u as agenticGenerator } from "./improve-fCd7c9dZ.js";
8
+ import { c as withMethodRuntimeControls, d as commandVerifier, f as addRuntimeUsage, i as assertCandidateValidator, m as isUsageAmount, n as createCommandProfileTrainer, o as parseExecutionRef, p as createRuntimeUsageTotals, r as searchMethod, s as privateValuePaths, t as improve, u as agenticGenerator } from "./improve-BqMfcxh1.js";
9
9
  import { n as defineRuntimeHooks, t as composeRuntimeHooks } from "./runtime-hooks-CsW2pfFk.js";
10
- import { n as createAgentImprovementActivationResult } from "./activation-BbQGq4Py.js";
11
- import { l as sharedBoxLane, o as routerLane, r as dedicatedLane, t as SearchEnvironmentFault, u as subscriptionLane, y as decideSearchImprovement } from "./search-executor-qcgra0sA.js";
10
+ import { n as createAgentImprovementActivationResult } from "./activation-n22lMRhH.js";
11
+ import { l as sharedBoxLane, o as routerLane, r as dedicatedLane, t as SearchEnvironmentFault, u as subscriptionLane, y as decideSearchImprovement } from "./search-executor-DPBewC3S.js";
12
12
  import { t as sealAgentCandidateBundle } from "./bundle-CV4Ts0cS.js";
13
- import { t as supervise } from "./supervise-Dszn1xVB.js";
14
- import { n as auditLoopRunner } from "./loop-runner-DshmaiYp.js";
13
+ import { t as supervise } from "./supervise-BfT708zt.js";
14
+ import { n as auditLoopRunner } from "./loop-runner-CGa71-66.js";
15
15
  import { toW3CSpanId as padSpanId, toW3CTraceId as padTraceId } from "@tangle-network/agent-trace-contract";
16
16
  import { agentCandidateKnowledgeSchema, agentCandidateWorkspaceManifestMaterialSchema, agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, sha256DigestSchema } from "@tangle-network/agent-interface";
17
17
  import { FAILURE_CLASSES, acquisitionPlansForKnowledgeGaps, blockingKnowledgeEval, canonicalJson, runAgentControlLoop, scoreKnowledgeReadiness, userQuestionsForKnowledgeGaps } from "@tangle-network/agent-eval";
@@ -1,9 +1,9 @@
1
- import { Bn as flatOtelSpan, Fn as buildLoopOtelSpans, Ln as buildRuntimeEventOtelSpans, br as authoredAgentIdentity, zn as createOtelExporter } from "./scope-CpULJrAr.js";
1
+ import { Bn as flatOtelSpan, Fn as buildLoopOtelSpans, Ln as buildRuntimeEventOtelSpans, br as authoredAgentIdentity, zn as createOtelExporter } from "./scope-BGWRFiYt.js";
2
2
  import { B as verifyCanonicalCandidateDocument, L as immutableCandidateValue, M as canonicalCandidateBytes$1, N as canonicalCandidateDigest$1, P as canonicalCandidateDocument, R as omitTopLevelDigest } from "./workspace-streams-8ALHaZzx.js";
3
- import { b as resolveRedactor, v as defaultRedactor } from "./jsonl-file-BBP9Dz9w.js";
4
- import { U as resolveAgentEnvironmentProvider } from "./supervisor-CWTFw-lP.js";
5
- import { a as assertProfileTrainingIsHeldOut, f as addRuntimeUsage, l as rethrowAfterCleanup, m as isUsageAmount, p as createRuntimeUsageTotals, t as improve } from "./improve-fCd7c9dZ.js";
6
- import { _ as agentImprovementTargetProfileDiffs, a as reviewAgentImprovementProposal, b as isAgentProfileMeasuredSurface, c as verifyAgentImprovementProposal, d as attachOptimizationActivationReceipt, f as createOptimizationActivationReceipt, g as agentImprovementProfileSurfaceInput, h as agentImprovementProfileSurfaceDigest, i as executeAgentImprovementActivation, l as verifyAgentImprovementReview, m as agentImprovementProfileDiffs, n as createAgentImprovementActivationResult, o as verifyAgentImprovementActivation, p as optimizationActivationReceiptFromMetadata, r as createAgentImprovementProposal, s as verifyAgentImprovementActivationResult, t as createAgentImprovementActivation, u as assertNoCallerOptimizationReceipt, v as assertProfileImprovementTargetsShareIdentity, y as isAgentImprovementProfileSurface } from "./activation-BbQGq4Py.js";
3
+ import { b as resolveRedactor, v as defaultRedactor } from "./jsonl-file-CbxMVnUj.js";
4
+ import { U as resolveAgentEnvironmentProvider } from "./supervisor-BDnqTl_R.js";
5
+ import { a as assertProfileTrainingIsHeldOut, f as addRuntimeUsage, l as rethrowAfterCleanup, m as isUsageAmount, p as createRuntimeUsageTotals, t as improve } from "./improve-BqMfcxh1.js";
6
+ import { _ as agentImprovementTargetProfileDiffs, a as reviewAgentImprovementProposal, b as isAgentProfileMeasuredSurface, c as verifyAgentImprovementProposal, d as attachOptimizationActivationReceipt, f as createOptimizationActivationReceipt, g as agentImprovementProfileSurfaceInput, h as agentImprovementProfileSurfaceDigest, i as executeAgentImprovementActivation, l as verifyAgentImprovementReview, m as agentImprovementProfileDiffs, n as createAgentImprovementActivationResult, o as verifyAgentImprovementActivation, p as optimizationActivationReceiptFromMetadata, r as createAgentImprovementProposal, s as verifyAgentImprovementActivationResult, t as createAgentImprovementActivation, u as assertNoCallerOptimizationReceipt, v as assertProfileImprovementTargetsShareIdentity, y as isAgentImprovementProfileSurface } from "./activation-n22lMRhH.js";
7
7
  import { _ as parseAgentCandidateProfileActivation, a as applyExactAgentProfileDiff, d as createAgentCandidateProfileActivation, g as omitUndefinedObjectFields, m as materializeAgentCandidateProfilePlan, o as assertCandidateProfileBinding, v as parseExactAgentProfile } from "./profile-ClvuI8aY.js";
8
8
  import { t as runAnalystLoop } from "./analyst-loop-BZvXCDKy.js";
9
9
  import { C as verifiedResourceTextByDigest, S as AGENT_CANDIDATE_EXECUTION_SUPPORT, n as executePreparedAgentCandidate, t as prepareAgentCandidateExecution, w as verifyAgentCandidateBundle, x as exactProcessProviderAsCandidateExecutor, y as createProtectedAgentCandidateModelPort } from "./prepare-DutbxpWr.js";
@@ -2,7 +2,8 @@ import { m as ValidationError } from "./errors-AzSuGI23.js";
2
2
  import { s as fenceRunWrite } from "./durable-file-DstVeHcj.js";
3
3
  import { REDACTION_VERSION, redact } from "@tangle-network/agent-eval/traces";
4
4
  import { createHash } from "node:crypto";
5
- import { closeSync, fstatSync, fsyncSync, ftruncateSync, openSync, readSync, writeSync } from "node:fs";
5
+ import { closeSync, fstatSync, fsync, fsyncSync, ftruncateSync, openSync, readSync, writeSync } from "node:fs";
6
+ import { promisify } from "node:util";
6
7
  // src/redact.ts
7
8
  /**
8
9
  * Redaction for values that may leave the Runtime process. The built-in
@@ -210,27 +211,27 @@ function sha256(value) {
210
211
  return createHash("sha256").update(value).digest("hex");
211
212
  }
212
213
  // src/durable/jsonl-append.ts
213
- /** Commit JSONL bytes and validate their descriptor under one generation fence. @internal */
214
- function commitJsonLine(path, record, acknowledge) {
214
+ async function appendCommittedJsonLine(path, record, acknowledge) {
215
215
  const encoded = JSON.stringify(record);
216
216
  if (encoded === void 0) throw new TypeError("JSONL records must be JSON serializable");
217
- return fenceRunWrite(() => {
218
- const separator = prepareJsonlTail(path);
219
- const fd = openSync(path, "a");
220
- try {
221
- const bytes = Buffer.from(`${separator ? "\n" : ""}${encoded}\n`);
217
+ let fd;
218
+ try {
219
+ const acknowledged = fenceRunWrite(() => {
220
+ const bytes = Buffer.from(`${prepareJsonlTail(path) ? "\n" : ""}${encoded}\n`);
221
+ fd = openSync(path, "a");
222
222
  let offset = 0;
223
223
  while (offset < bytes.length) {
224
224
  const written = writeSync(fd, bytes, offset, bytes.length - offset);
225
225
  if (written <= 0) throw new Error(`append-only file write made no progress at byte ${offset}`);
226
226
  offset += written;
227
227
  }
228
- fsyncSync(fd);
229
228
  return acknowledge?.(fd);
230
- } finally {
231
- closeSync(fd);
232
- }
233
- });
229
+ });
230
+ await promisify(fsync)(fd);
231
+ return acknowledged;
232
+ } finally {
233
+ if (fd !== void 0) closeSync(fd);
234
+ }
234
235
  }
235
236
  /** Recover only an uncommitted tail. Caller holds the generation fence. @internal */
236
237
  function prepareJsonlTail(path) {
@@ -355,9 +356,6 @@ function parseRecord(line, source, lineNumber, terminated, allowWhitespaceLines
355
356
  throw new Error(`${source}: malformed JSONL record at line ${lineNumber}`, { cause });
356
357
  }
357
358
  }
358
- async function appendCommittedJsonLine(path, record, acknowledge) {
359
- return commitJsonLine(path, record, acknowledge);
360
- }
361
359
  /** Serialize JSONL file updates across processes and aliases using Eval's existing file lock.
362
360
  * The caller owns validation and the record format. The lock path names the canonical file,
363
361
  * including its first write, so two directory aliases cannot acquire different write heads.
@@ -424,6 +422,6 @@ async function prepareJsonlAppend(path) {
424
422
  function isNoEntError(error) {
425
423
  return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
426
424
  }
427
- export { errorText as _, readCommittedJsonFile as a, resolveRedactor as b, withJsonlFileLock as c, detachedSnapshot as d, shareParsedStrings as f, errorProperty as g, errorHttpStatus as h, prepareJsonlAppend as i, sha256 as l, errMessage as m, isNoEntError as n, readCommittedJsonLines as o, causeChain as p, parseCommittedJsonLines as r, upsertCommittedJsonLine as s, appendCommittedJsonLine as t, detachedFrozen as u, defaultRedactor as v, defaultRedactorIdentityMaterial as y };
425
+ export { errorText as _, readCommittedJsonLines as a, resolveRedactor as b, appendCommittedJsonLine as c, detachedSnapshot as d, shareParsedStrings as f, errorProperty as g, errorHttpStatus as h, readCommittedJsonFile as i, sha256 as l, errMessage as m, parseCommittedJsonLines as n, upsertCommittedJsonLine as o, causeChain as p, prepareJsonlAppend as r, withJsonlFileLock as s, isNoEntError as t, detachedFrozen as u, defaultRedactor as v, defaultRedactorIdentityMaterial as y };
428
426
 
429
- //# sourceMappingURL=jsonl-file-BBP9Dz9w.js.map
427
+ //# sourceMappingURL=jsonl-file-CbxMVnUj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonl-file-CbxMVnUj.js","names":[],"sources":["../src/redact.ts","../src/runtime/supervise/error-message.ts","../src/runtime/supervise/snapshot.ts","../src/content-digest.ts","../src/durable/jsonl-append.ts","../src/durable/jsonl-file.ts"],"sourcesContent":["/**\n * Redaction for values that may leave the Runtime process. The built-in\n * redactor is agent-eval's redaction core (`@tangle-network/agent-eval/traces`,\n * default profile): credentials found by field name or value shape are\n * replaced whole, email, card, SSN and phone values in place, and token counts\n * such as `inputTokens` or `max_tokens` are kept. A customer with\n * domain-specific PII supplies their own `redact` hook.\n *\n * This is narrower than `src/sanitize.ts`, which drops fields of the runtime's\n * *event envelope* unless the caller opts in: here the value is opaque customer\n * payload, so the scrub is value-shaped, not schema-shaped.\n *\n * @experimental\n */\n\nimport { REDACTION_VERSION, redact } from '@tangle-network/agent-eval/traces'\n\n/** A redactor maps an arbitrary trace value to a safe-to-export value. Pure;\n * must not throw on cyclic input (the default tolerates cycles). */\nexport type Redactor = (value: unknown) => unknown\n\n/**\n * The built-in redactor. Cycle-safe, depth-bounded and total: it never throws\n * on customer input and never mutates it.\n */\nexport function defaultRedactor(value: unknown): unknown {\n return redact(value).value\n}\n\n/** Stable identity input for saved work that depends on built-in redaction behavior. */\nexport function defaultRedactorIdentityMaterial(): unknown {\n return {\n core: '@tangle-network/agent-eval/traces redact',\n profile: 'default',\n version: REDACTION_VERSION,\n }\n}\n\n/**\n * Resolve the redactor a client uses. A caller-supplied hook handles\n * domain-specific values first, then the built-in scrubber still removes\n * credentials and personal data. Returning `false` is the explicit opt-out for\n * already-reviewed public values.\n */\nexport function resolveRedactor(redact: Redactor | false | undefined): Redactor {\n if (redact === false) return (value) => value\n if (!redact) return defaultRedactor\n return (value) => defaultRedactor(redact(value))\n}\n","import { defaultRedactor } from '../../redact'\n\nconst maxCauseDepth = 4\nconst maxMessageLength = 32_768\nconst maxPartLength = 2_048\n\n/** A persisted failure must explain its wrappers without exporting credentials or unbounded data. */\nexport function errorText(value: unknown): string {\n let text: string\n try {\n text = typeof value === 'string' ? value : (JSON.stringify(value) ?? String(value))\n } catch {\n text = '[unprintable rejection]'\n }\n return String(defaultRedactor(text)).slice(0, maxMessageLength)\n}\n\nexport function errorProperty(\n error: Error,\n field: 'name' | 'message' | 'stack',\n): string | undefined {\n try {\n const value = error[field]\n return value === undefined\n ? undefined\n : errorText(value).slice(0, field === 'name' ? 256 : maxMessageLength)\n } catch {\n return `[unreadable error ${field}]`\n }\n}\n\n/** An HTTP status carried on a thrown error, read without trusting its getter. Provider SDKs put\n * one on their own error classes, so this is how a refusal is recognised outside the transport\n * taxonomy — for the persisted message here, and for the driver's retry verdict. */\nexport function errorHttpStatus(error: Error): number | undefined {\n try {\n const status: unknown = Reflect.get(error, 'status')\n return typeof status === 'number' && Number.isInteger(status) && status >= 100 && status <= 599\n ? status\n : undefined\n } catch {\n return undefined\n }\n}\n\n/** Shared by child settlements, driver attempts, and the final no-winner result. */\nexport function errMessage(error: unknown): string {\n const parts: string[] = []\n const seen = new Set<Error>()\n let current = error\n for (let depth = 0; depth <= maxCauseDepth; depth += 1) {\n try {\n if (!(current instanceof Error)) {\n parts.push(errorText(current).slice(0, maxPartLength))\n break\n }\n if (seen.has(current)) {\n parts.push('[circular]')\n break\n }\n seen.add(current)\n const status = errorHttpStatus(current)\n const message =\n (status === undefined ? '' : `HTTP ${status}: `) + (errorProperty(current, 'message') ?? '')\n parts.push(\n (depth === 0 ? message : `${errorProperty(current, 'name')}: ${message}`).slice(\n 0,\n maxPartLength,\n ),\n )\n current = current.cause\n if (current === undefined || current === null) break\n if (depth === maxCauseDepth) parts.push('[cause chain truncated]')\n } catch {\n parts.push('[unreadable error cause]')\n break\n }\n }\n return parts.join(': caused by ').slice(0, maxMessageLength)\n}\n\n/** The error and its causes (`cause`, and `errors` members), bounded and cycle-safe. */\nexport function causeChain(error: unknown): object[] {\n const chain: object[] = []\n const queue: unknown[] = [error]\n while (queue.length > 0 && chain.length < 12) {\n const value = queue.shift()\n if (typeof value !== 'object' || value === null || chain.includes(value)) continue\n chain.push(value)\n try {\n const errors: unknown = Reflect.get(value, 'errors')\n if (Array.isArray(errors)) queue.push(...errors)\n queue.push(Reflect.get(value, 'cause'))\n } catch {\n // A cause that cannot be read ends this branch of the walk.\n }\n }\n return chain\n}\n","import { ValidationError } from '../../errors'\n\n/** Deeply detach and freeze untrusted data at a runtime decision boundary. The clone prevents the\n * caller from mutating it later; the freeze prevents downstream code from mutating the snapshot.\n * Strings are immutable, so the snapshot shares the caller's strings instead of copying them. */\nexport function detachedSnapshot<T>(value: T, context: string): T {\n let clone: T\n try {\n clone = structuredClone(value)\n } catch (error) {\n throw new ValidationError(`${context}: input must be structured-cloneable`, { cause: error })\n }\n return deepFreeze(shareSourceStrings(value, clone))\n}\n\n/** Detach a value from its caller and freeze it, without the `ValidationError` framing\n * {@link detachedSnapshot} adds. For a boundary that has already validated its input. */\nexport function detachedFrozen<T>(value: T): T {\n return deepFreeze(shareSourceStrings(value, structuredClone(value)))\n}\n\n/**\n * Point each string in a fresh structured clone at the equal string in its source.\n *\n * `structuredClone` copies every string, and a copied string buys no isolation: only objects and\n * arrays can change through a shared reference. A spawned profile passes several boundaries, and\n * each one kept its own copy: in a reproduction of Discovery's hosted coordinator, a child profile\n * that mounts a 5.3 MB file packet was held four times per spawned child. A scope keeps every\n * child it spawned, so the heap grew about 22 MB per spawn, and hosted coordinators died with V8\n * heap OOM after 37 spawns.\n *\n * The walk pairs only own data properties of plain objects and arrays. Accessors, Maps, Sets and\n * other cloned types keep the clone's values. A string is replaced only by a string equal to it,\n * so the snapshot holds exactly the clone's value. The snapshot keeps the source's strings alive.\n */\nfunction shareSourceStrings<T>(source: unknown, clone: T): T {\n const visited = new Set<object>()\n const visit = (from: unknown, to: unknown): void => {\n if (from === null || to === null || typeof from !== 'object' || typeof to !== 'object') return\n const array = Array.isArray(to)\n if (array !== Array.isArray(from)) return\n if (!array && Object.getPrototypeOf(to) !== Object.prototype) return\n if (visited.has(to)) return\n visited.add(to)\n const target = to as Record<string, unknown>\n for (const key of Object.keys(target)) {\n const own = Object.getOwnPropertyDescriptor(from, key)\n if (own === undefined || !('value' in own)) continue\n const cloned = target[key]\n if (typeof cloned === 'string') {\n if (own.value === cloned) target[key] = own.value\n } else visit(own.value, cloned)\n }\n }\n visit(source, clone)\n return clone\n}\n\n/**\n * Replace each string in a freshly parsed JSON value with an equal string already in `pool`, and\n * add the new ones. One recovery pass parses every interrupted child's profile from its own blob,\n * so children that carry the same file packet would otherwise hold one copy each. The value is\n * updated in place, so it must belong to the caller; frozen objects are left as they are.\n */\nexport function shareParsedStrings<T>(value: T, pool: Map<string, string>): T {\n const visit = (node: unknown): void => {\n if (node === null || typeof node !== 'object' || Object.isFrozen(node)) return\n if (!Array.isArray(node) && Object.getPrototypeOf(node) !== Object.prototype) return\n const target = node as Record<string, unknown>\n for (const key of Object.keys(target)) {\n const item = target[key]\n if (typeof item !== 'string') {\n visit(item)\n continue\n }\n const shared = pool.get(item)\n if (shared === undefined) pool.set(item, item)\n else target[key] = shared\n }\n }\n visit(value)\n return value\n}\n\nfunction deepFreeze<T>(value: T, seen = new Set<object>()): T {\n // `Object.freeze` throws `TypeError: Cannot freeze array buffer views with elements` on any\n // non-empty TypedArray or Buffer, so binary inside a payload must be handed back untouched\n // rather than frozen. Its bytes are already detached by the `structuredClone` above.\n if (value === null || typeof value !== 'object' || ArrayBuffer.isView(value) || seen.has(value)) {\n return value\n }\n seen.add(value)\n for (const child of Object.values(value as Record<string, unknown>)) deepFreeze(child, seen)\n return Object.freeze(value)\n}\n","import { createHash } from 'node:crypto'\n\nexport function sha256(value: string): string {\n return createHash('sha256').update(value).digest('hex')\n}\n","import {\n closeSync,\n fstatSync,\n fsync,\n fsyncSync,\n ftruncateSync,\n openSync,\n readSync,\n writeSync,\n} from 'node:fs'\nimport { promisify } from 'node:util'\nimport { fenceRunWrite } from './run-fence'\n\n/** Append one JSONL record under the caller's existing single-writer discipline.\n * The caller creates the parent directory. Recover only an uncommitted tail and handle short\n * writes under one generation fence; fsync after the fence, off the event loop (#2362), and\n * resolve only once the bytes are durable. An optional acknowledgement reads the same open\n * descriptor inside the fence (the spawn journal validates its file stamp here).\n * @internal\n */\nexport function appendCommittedJsonLine(path: string, record: unknown): Promise<void>\nexport function appendCommittedJsonLine<T>(\n path: string,\n record: unknown,\n acknowledge: (fd: number) => T,\n): Promise<T>\nexport async function appendCommittedJsonLine<T>(\n path: string,\n record: unknown,\n acknowledge?: (fd: number) => T,\n): Promise<T | undefined> {\n const encoded = JSON.stringify(record)\n if (encoded === undefined) throw new TypeError('JSONL records must be JSON serializable')\n let fd: number | undefined\n try {\n const acknowledged = fenceRunWrite(() => {\n const bytes = Buffer.from(`${prepareJsonlTail(path) ? '\\n' : ''}${encoded}\\n`)\n fd = openSync(path, 'a')\n let offset = 0\n while (offset < bytes.length) {\n const written = writeSync(fd, bytes, offset, bytes.length - offset)\n if (written <= 0)\n throw new Error(`append-only file write made no progress at byte ${offset}`)\n offset += written\n }\n return acknowledge?.(fd)\n })\n await promisify(fsync)(fd as number)\n return acknowledged\n } finally {\n if (fd !== undefined) closeSync(fd)\n }\n}\n\n/** Recover only an uncommitted tail. Caller holds the generation fence. @internal */\nexport function prepareJsonlTail(path: string): boolean {\n let fd: number\n try {\n fd = openSync(path, 'r+')\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return false\n throw error\n }\n try {\n const size = fstatSync(fd).size\n if (size === 0) return false\n const last = Buffer.allocUnsafe(1)\n readAt(fd, last, size - 1)\n if (last[0] === 0x0a) return false\n const chunks: Buffer[] = []\n let end = size\n let tailStart = 0\n while (end > 0) {\n const start = Math.max(0, end - 65_536)\n const chunk = Buffer.allocUnsafe(end - start)\n readAt(fd, chunk, start)\n const newline = chunk.lastIndexOf(0x0a)\n chunks.push(chunk.subarray(newline + 1))\n if (newline >= 0) {\n tailStart = start + newline + 1\n break\n }\n end = start\n }\n try {\n JSON.parse(Buffer.concat(chunks.reverse()).toString('utf8'))\n return true\n } catch (error) {\n if (!(error instanceof SyntaxError)) throw error\n ftruncateSync(fd, tailStart)\n fsyncSync(fd)\n return false\n }\n } finally {\n closeSync(fd)\n }\n}\n\nfunction readAt(fd: number, buffer: Buffer, position: number): void {\n let offset = 0\n while (offset < buffer.length) {\n const read = readSync(fd, buffer, offset, buffer.length - offset, position + offset)\n if (read === 0) throw new Error('journal changed while preparing its append tail')\n offset += read\n }\n}\n","import type { FileHandle } from 'node:fs/promises'\nimport { prepareJsonlTail } from './jsonl-append'\nimport { fenceRunWrite } from './run-fence'\n\n/** Parse in-memory evidence with the same commit boundary as streamed journal reads. */\nexport function parseCommittedJsonLines<T>(text: string, source: string): T[] {\n const lines = text.split('\\n')\n const records: T[] = []\n for (const [index, line] of lines.entries()) {\n const record = parseRecord<T>(line, source, index + 1, index < lines.length - 1)\n if (record !== undefined) records.push(record.value)\n }\n return records\n}\n\n/** Read a fixed file prefix one record at a time, never allocating the whole journal as a string.\n * A reader cannot chase concurrent appends forever. Missing files are empty only when requested;\n * corruption, short reads, and other I/O errors remain failures. Closing the iterator closes the fd. */\nexport async function* readCommittedJsonLines<T>(\n path: string,\n options: {\n allowMissing?: boolean\n allowWhitespaceLines?: boolean\n onBytes?: (bytes: Uint8Array) => void\n } = {},\n): AsyncGenerator<T> {\n const fs = await import('node:fs/promises')\n let handle: FileHandle\n try {\n handle = await fs.open(path, 'r')\n } catch (error) {\n if (options.allowMissing && isNoEntError(error)) return\n throw error\n }\n try {\n const { size } = await handle.stat()\n if (size === 0) return\n const { StringDecoder } = await import('node:string_decoder')\n const decoder = new StringDecoder('utf8')\n const stream = handle.createReadStream({ autoClose: false, end: size - 1 })\n const fragments: string[] = []\n let lineNumber = 1\n try {\n for await (const chunk of stream) {\n options.onBytes?.(chunk as Buffer)\n const text = decoder.write(chunk as Buffer)\n let start = 0\n let end = text.indexOf('\\n', start)\n while (end !== -1) {\n fragments.push(text.slice(start, end))\n const record = parseRecord<T>(\n fragments.join(''),\n path,\n lineNumber++,\n true,\n options.allowWhitespaceLines,\n )\n fragments.length = 0\n if (record !== undefined) yield record.value\n start = end + 1\n end = text.indexOf('\\n', start)\n }\n if (start < text.length) fragments.push(text.slice(start))\n }\n if (stream.bytesRead !== size) {\n throw new Error(`${path}: journal changed while reading its committed prefix`)\n }\n fragments.push(decoder.end())\n const record = parseRecord<T>(\n fragments.join(''),\n path,\n lineNumber,\n false,\n options.allowWhitespaceLines,\n )\n if (record !== undefined) yield record.value\n } finally {\n stream.destroy()\n }\n } finally {\n await handle.close()\n }\n}\n\n/** An invalid unterminated tail may be a torn write; other parse failures are not evidence of one. */\nfunction parseRecord<T>(\n line: string,\n source: string,\n lineNumber: number,\n terminated: boolean,\n allowWhitespaceLines = false,\n): { value: T } | undefined {\n if (line.length === 0 || (allowWhitespaceLines && line.trim().length === 0)) return undefined\n try {\n return { value: JSON.parse(line) as T }\n } catch (cause) {\n if (!(cause instanceof SyntaxError)) throw cause\n if (!terminated) return undefined\n throw new Error(`${source}: malformed JSONL record at line ${lineNumber}`, { cause })\n }\n}\n\nexport { appendCommittedJsonLine } from './jsonl-append'\n\n/** Serialize JSONL file updates across processes and aliases using Eval's existing file lock.\n * The caller owns validation and the record format. The lock path names the canonical file,\n * including its first write, so two directory aliases cannot acquire different write heads.\n * @internal\n */\nexport async function withJsonlFileLock<T>(\n path: string,\n operation: (canonicalPath: string) => Promise<T>,\n): Promise<T> {\n const fs = await import('node:fs/promises')\n const { dirname } = await import('node:path')\n const { tryAcquireAtomicFileLock } = await import('@tangle-network/agent-eval/ledger-core')\n await fs.mkdir(dirname(path), { recursive: true })\n const file = await fs.open(path, 'a')\n await file.close()\n const canonicalPath = await fs.realpath(path)\n const deadline = Date.now() + 5000\n for (;;) {\n const acquisition = tryAcquireAtomicFileLock({ lockPath: `${canonicalPath}.lock` })\n if (!acquisition.acquired) {\n if (Date.now() >= deadline) {\n throw new Error(`journal file lock unavailable after 5000ms: ${canonicalPath}`)\n }\n await new Promise((resolve) => setTimeout(resolve, 25))\n continue\n }\n try {\n return await operation(canonicalPath)\n } finally {\n acquisition.lock.release()\n }\n }\n}\n\n/** Read one keyed registry snapshot without an extra whole-file text allocation.\n * Historical registry files allow whitespace-only separators; append journals remain strict.\n * @internal\n */\nexport async function readCommittedJsonFile<T>(path: string): Promise<T[]> {\n const records: T[] = []\n for await (const record of readCommittedJsonLines<T>(path, {\n allowMissing: true,\n allowWhitespaceLines: true,\n })) {\n records.push(record)\n }\n return records\n}\n\n/** Replace one keyed row and publish one durable snapshot. The caller holds the file lock.\n * Keep unrelated rows in order and put the replacement last. No revision archive is retained.\n * @internal\n */\nexport async function upsertCommittedJsonLine<T>(\n path: string,\n record: T,\n key: (record: T) => string,\n): Promise<void> {\n const encoded = JSON.stringify(record)\n if (encoded === undefined) throw new Error('JSONL records must be JSON serializable')\n const snapshot: T = JSON.parse(encoded)\n const id = key(snapshot)\n const updated: T[] = []\n for await (const prior of readCommittedJsonLines<T>(path, {\n allowMissing: true,\n allowWhitespaceLines: true,\n })) {\n if (key(prior) !== id) updated.push(prior)\n }\n updated.push(snapshot)\n // Reuse Runtime's file publication owner; this module owns JSONL framing, not another\n // durability implementation. Preserve the existing snapshot's permissions across rename.\n const { writeAtomicDurableFile } = await import('../runtime/supervise/durable-file')\n writeAtomicDurableFile(path, `${updated.map((row) => JSON.stringify(row)).join('\\n')}\\n`, {\n preserveMode: true,\n })\n}\n\n/** Recover a torn tail under the same generation fence as durable publications. @internal */\nexport async function prepareJsonlAppend(path: string): Promise<boolean> {\n return fenceRunWrite(() => prepareJsonlTail(path))\n}\n\n/** True for a filesystem error meaning \"the file is not there yet\" — the one condition an\n * append-only reader treats as an empty log rather than a fault. */\nexport function isNoEntError(error: unknown): boolean {\n return (\n typeof error === 'object' &&\n error !== null &&\n 'code' in error &&\n (error as { code: unknown }).code === 'ENOENT'\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,gBAAgB,OAAyB;CACvD,OAAO,OAAO,KAAK,CAAC,CAAC;AACvB;;AAGA,SAAgB,kCAA2C;CACzD,OAAO;EACL,MAAM;EACN,SAAS;EACT,SAAS;CACX;AACF;;;;;;;AAQA,SAAgB,gBAAgB,QAAgD;CAC9E,IAAI,WAAW,OAAO,QAAQ,UAAU;CACxC,IAAI,CAAC,QAAQ,OAAO;CACpB,QAAQ,UAAU,gBAAgB,OAAO,KAAK,CAAC;AACjD;;AC9CA,MAAM,gBAAgB;AACtB,MAAM,mBAAmB;AACzB,MAAM,gBAAgB;;AAGtB,SAAgB,UAAU,OAAwB;CAChD,IAAI;CACJ,IAAI;EACF,OAAO,OAAO,UAAU,WAAW,QAAS,KAAK,UAAU,KAAK,KAAK,OAAO,KAAK;CACnF,QAAQ;EACN,OAAO;CACT;CACA,OAAO,OAAO,gBAAgB,IAAI,CAAC,CAAC,CAAC,MAAM,GAAG,gBAAgB;AAChE;AAEA,SAAgB,cACd,OACA,OACoB;CACpB,IAAI;EACF,MAAM,QAAQ,MAAM;EACpB,OAAO,UAAU,KAAA,IACb,KAAA,IACA,UAAU,KAAK,CAAC,CAAC,MAAM,GAAG,UAAU,SAAS,MAAM,gBAAgB;CACzE,QAAQ;EACN,OAAO,qBAAqB,MAAM;CACpC;AACF;;;;AAKA,SAAgB,gBAAgB,OAAkC;CAChE,IAAI;EACF,MAAM,SAAkB,QAAQ,IAAI,OAAO,QAAQ;EACnD,OAAO,OAAO,WAAW,YAAY,OAAO,UAAU,MAAM,KAAK,UAAU,OAAO,UAAU,MACxF,SACA,KAAA;CACN,QAAQ;EACN;CACF;AACF;;AAGA,SAAgB,WAAW,OAAwB;CACjD,MAAM,QAAkB,CAAC;CACzB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ist/kernel.js CHANGED
@@ -1,14 +1,14 @@
1
- import { $n as persistHarnessTranscript, Ai as mapSandboxToolEvent, E as replaySpawnTree, En as createWorkerSlots, F as recoverRetainedInteractiveRun, Gt as materializeTreeView, I as startRetainedInteractiveRun, Ji as decodeHarnessUsage, Jn as captureBoundHarnessTranscript, L as FileSpawnJournal, M as attachWorker, N as readWorkerInteractiveBinding, O as parseWorkerToolTraceArtifact, Oi as createSandboxToolPartState, P as reconnectRetainedInteractiveRun, S as writeWorkerSteer, Si as createBudgetPool, Ti as spendFromUsageEvents, Ut as loadSpawnForest, Vi as extractLlmCallEvent, Xn as harnessTranscriptArtifact, Yn as captureHarnessTranscript, Yt as FileResultBlobStore, Z as settledToIteration, _ as supervisorRunDir, an as reconnectRetainedRun, ar as DEFAULT_STALL_AFTER_MS, b as workerInboxFileFromEventDir, c as cancelWorker, cn as startRetainedRunInEnvironment, cr as readWorkerProgress, et as freeSlots, g as safeWorkerFile, gi as contentAddress, h as readWorkerSteerRequests, hi as TRACE_SUMMARY_SCHEMA, hr as subscriptionUsageLimitSignal, ia as RunCancellationReason, ir as retainHarnessTranscript, ki as mapSandboxEvent, m as readWorkerSteerAcknowledgement, mi as TRACE_ROOT_SCHEMA, nr as readBoundHarnessSessions, nt as rollingDispatch, on as recoverRetainedRun, or as createActivityLog, p as readWorkerCancellation, qi as sumSandboxUsage, qn as HARNESS_TRANSCRIPT_SETTLE_TIMEOUT_MS, rr as resolveHarnessTranscriptCapture, sn as startRetainedRun, t as createScope, tr as HARNESS_TRANSCRIPT_READ_LIMITS, tt as queueOf, u as legacySupervisorRunDir, v as supervisorRunsRoot, zn as createOtelExporter } from "./scope-CpULJrAr.js";
2
- import { A as defaultAnalystInstruction, D as runAgentic, E as refine, F as collectAgentTurn, I as streamAgentTurn, M as renderReport, N as profileChatClient, O as sample, P as profileOptimizerModelCall, S as strategyAuthorSystemPrompt, T as depthStrategy, _ as defineStrategy, a as defaultStructuralRolloutPolicy, b as sampleThenRefine, c as officialChecksFromMeta, d as selectBestIndex, f as structuralRollout, g as authorStrategy, h as assertStrategyContract, i as defaultExtractCandidate, j as observe, k as ObservationError, l as resolveEntrySymbol, m as adaptiveRefine, n as compareCheckOutcomes, o as filterAuthoredAsserts, p as visibleCheckScore, r as composeCheckSources, s as modelAuthoredChecks, t as canDisplace, u as sandboxCheckRunner, w as breadthStrategy, x as strategyAuthorContract } from "./structural-rollout-CSLfWHEN.js";
1
+ import { $n as persistHarnessTranscript, Ai as mapSandboxToolEvent, E as replaySpawnTree, En as createWorkerSlots, F as recoverRetainedInteractiveRun, Gt as materializeTreeView, I as startRetainedInteractiveRun, Ji as decodeHarnessUsage, Jn as captureBoundHarnessTranscript, L as FileSpawnJournal, M as attachWorker, N as readWorkerInteractiveBinding, O as parseWorkerToolTraceArtifact, Oi as createSandboxToolPartState, P as reconnectRetainedInteractiveRun, S as writeWorkerSteer, Si as createBudgetPool, Ti as spendFromUsageEvents, Ut as loadSpawnForest, Vi as extractLlmCallEvent, Xn as harnessTranscriptArtifact, Yn as captureHarnessTranscript, Yt as FileResultBlobStore, Z as settledToIteration, _ as supervisorRunDir, an as reconnectRetainedRun, ar as DEFAULT_STALL_AFTER_MS, b as workerInboxFileFromEventDir, c as cancelWorker, cn as startRetainedRunInEnvironment, cr as readWorkerProgress, et as freeSlots, g as safeWorkerFile, gi as contentAddress, h as readWorkerSteerRequests, hi as TRACE_SUMMARY_SCHEMA, hr as subscriptionUsageLimitSignal, ia as RunCancellationReason, ir as retainHarnessTranscript, ki as mapSandboxEvent, m as readWorkerSteerAcknowledgement, mi as TRACE_ROOT_SCHEMA, nr as readBoundHarnessSessions, nt as rollingDispatch, on as recoverRetainedRun, or as createActivityLog, p as readWorkerCancellation, qi as sumSandboxUsage, qn as HARNESS_TRANSCRIPT_SETTLE_TIMEOUT_MS, rr as resolveHarnessTranscriptCapture, sn as startRetainedRun, t as createScope, tr as HARNESS_TRANSCRIPT_READ_LIMITS, tt as queueOf, u as legacySupervisorRunDir, v as supervisorRunsRoot, zn as createOtelExporter } from "./scope-BGWRFiYt.js";
2
+ import { A as defaultAnalystInstruction, D as runAgentic, E as refine, F as collectAgentTurn, I as streamAgentTurn, M as renderReport, N as profileChatClient, O as sample, P as profileOptimizerModelCall, S as strategyAuthorSystemPrompt, T as depthStrategy, _ as defineStrategy, a as defaultStructuralRolloutPolicy, b as sampleThenRefine, c as officialChecksFromMeta, d as selectBestIndex, f as structuralRollout, g as authorStrategy, h as assertStrategyContract, i as defaultExtractCandidate, j as observe, k as ObservationError, l as resolveEntrySymbol, m as adaptiveRefine, n as compareCheckOutcomes, o as filterAuthoredAsserts, p as visibleCheckScore, r as composeCheckSources, s as modelAuthoredChecks, t as canDisplace, u as sandboxCheckRunner, w as breadthStrategy, x as strategyAuthorContract } from "./structural-rollout-BylGQ_wK.js";
3
3
  import { t as runTaskQueue } from "./task-queue-DbpZAp6C.js";
4
- import { $ as DEFAULT_PEER_MAIL_LIMITS, C as createExecutor, Ct as admitContinuationPolicy, D as runAgentRounds, E as createSteerableSandboxSession, Ft as harnessUsageIsEmpty, H as createAgentEnvironmentProviderRegistry, It as readCodexRolloutSession, J as createInPlaceCliExecutor, K as providerAsSandboxClient, L as createCodeModeTools, Lt as createPushTraceSource, M as acquireSandbox, N as TERMINAL_DECISIONS, Nt as addHarnessUsage, P as defaultSelectWinner, Pt as createCodexRolloutStoreReader, Q as AUTHORITY_MARKERS, R as runCodeMode, T as DEFAULT_SANDBOX_STEERING_MAX_TURNS, U as resolveAgentEnvironmentProvider, W as providerAsExecutor, _t as CheckUnavailableError, at as peerMailVerbNames, b as createExecutorRegistry, bt as mapExecutorResult, et as PEER_MAIL_WIRE_KEY, i as RunParkedError, it as peerMailTools, j as createSandboxLineage, n as createSupervisor, nt as createPeerMailbox, p as createRootHandle, q as createWorktreeCliExecutor, qt as assertProfileMaterializes, rt as isPeerMailEnvelope, s as readRunParking, t as DEFAULT_MAX_DEPTH, tt as claimsAuthority, u as bestDelivered, v as InMemoryResultBlobStore, xt as verdictFromJudgeScore, y as InMemorySpawnJournal, yt as gateOnDeliverable } from "./supervisor-CWTFw-lP.js";
5
- import { _ as sharedWorkerClientName, f as DEFAULT_SHARED_BOX_RESOURCES, g as sharedBoxRefusal, h as ROUTER_CLIENT_HEADER, m as sharedBoxPlacement, p as DEFAULT_SHARED_BOX_WORKERS } from "./search-executor-qcgra0sA.js";
6
- import { i as readRunCancellation, n as cancelRun, r as readRunCancelRequest, v as FileCoordinationLog } from "./run-cancellation-CRPdLJVP.js";
7
- import { f as createFileRunContext, i as watchTrace, m as withRunContext, o as createEventBus, p as createInMemoryRunContext, r as defaultToolDetectors } from "./coordination-manager-B3mF1nMA.js";
8
- import { A as analyzesFindingsReportPrompt, B as anyOf, D as defaultEdgeTraversalCap, F as formatPromptHandle, G as bestSoFar, H as plateau, I as kernelPromptRegistry, J as createSupervisorSpanRecorder, K as plateauLength, L as naiveContinuationPrompt, M as delegatesWorkerBriefPrompt, N as dumbContinuationFailPrompt, P as dumbContinuationPassPrompt, R as promptHandle, U as anytimeReport, V as noProgressFor, W as areaUnderCurve, c as retryPreSpawnRefusals, d as supervisorAgent, g as serveCoordinationMcp, h as composeReentryTask, j as createPromptRegistry, l as withWorkerSpawnRetry, m as UNPROVEN_CONTINUITY, n as superviseFleetCapabilities, o as isPreSpawnExecutorFailure, p as runToolSpans, q as renderAnytimeTable, s as resolveWorkerSpawnRetry, t as supervise, u as workerFromBackend, x as GraphRouteError, z as allWorkersStalled } from "./supervise-Dszn1xVB.js";
9
- import { a as graphRegistry, b as graphRouteWhenSchema, c as loadGraph, d as recordGraphRun, f as recordStoredGraphRun, i as graphFromStored, l as lookupGraph, m as taskShapeDigest, n as graphCorpusSummary, o as graphRunsFor, p as storedGraphDigests, r as graphDigest, s as listGraphRuns, t as digestOfGraph, u as pickBestGraph, y as graphFileSchema } from "./graph-registry-D6y6zffC.js";
10
- import { $ as runBenchmark, $t as renderLeaderboardHtml, A as searchPresets, At as sanitizeMcpToolSchema, B as graphFromSessionFacts, Bt as assertDeclaredCheck, C as withUntrackedArtifacts, Ct as harvestCorpus, D as SEARCH_SPEC_CORRELATION_KEY, Dt as connectStdioMcp, E as createFencedSqlRunContext, Et as McpSpawnFault, F as loadProfile, Ft as secretEnvOfMcpServer, G as chatWorkerSeam, Gt as readDeclaredCheck, H as loadGraphFile, Ht as declaredCheckDeliverable, I as pickBestProfile, It as inlineSandboxClient, J as strategyTournament, Jt as deterministicCompletion, K as createChatSessionStore, Kt as runIsolatedCheck, L as profileRegistry, Lt as loopCampaignDispatch, M as connectRemoteSupervisor, Mt as mcpSecretEnvMetadataKey, N as connectRemoteSupervisorControl, Nt as resolveMcpServerLaunch, O as assertSearchSpec, Ot as materializeLocalMcp, P as bestProfileFor, Pt as resolveSecretEnv, Q as printBenchmarkReport, Qt as pairwiseSignificance, R as profileRunsForName, Rt as loopDispatch, S as copyUntrackedIntoClone, St as HarvestError, T as validateStoredGraph, Tt as resolveSandboxClient, U as graphDesignerExtraTools, Ut as declaredCheckDigest, V as GraphFileResolutionError, Vt as checkProgramDigest, W as chatTransportExecutor, Wt as declaredCheckJudge, X as openSandboxRun, Xt as stopSentinel, Y as SandboxRunAbortError, Yt as sentinelCompletion, Z as createS3PrivateCasStore, Zt as leaderboard, _ as NOTE_MAX_CHARS, _t as buildSteerContext, a as localShell, at as FileCorpus, b as composeWorkerEvidence, bt as observationFromRegistry, c as createVerifierEnvironment, ct as fanout, d as harvestSurfaceDiffs, dt as panel, en as renderLeaderboardMarkdown, et as createPrivateCasArtifactPort, f as analystsFromRegistry, ft as pipeline, g as EVIDENCE_MAX_CHARS, gt as assertTraceDerivedFindings, ht as widen, i as jjWorkspace, in as openSqlRunStore, it as runPersonified, j as searchSpecDigest, jt as envKeyProvider, k as compileSearchSpec, kt as createMcpEnvironment, l as boxSurfaceReader, lt as flatWidenGate, m as worktreeFanout, mt as verify, n as makeFinding, nn as renderPairwiseMarkdown, nt as trajectoryReport, o as runInWorkspace, ot as InMemoryCorpus, p as failuresAnalyst, pt as selectValidWinner, q as runStrategyEvolution, qt as completionAuthorizes, r as gitWorkspace, rn as SqlRunOwnershipError, rt as definePersona, s as createWaterfallCollector, st as renderCorpusToInstructions, t as computeFindingId, tn as renderLeaderboardSvg, tt as equalKOnCost, u as fsSurfaceReader, ut as loopUntil, v as VERIFY_TAIL_CHARS, vt as createScopeAnalyst, w as analyzeTrace, wt as defineLeaderboard, x as settledWorkerOut, xt as inProcessSandboxClient, y as closingWorkerNote, yt as registryScopeAnalyst, z as recordProfileRun, zt as superviseDispatch } from "./runtime-BufkoSjF.js";
11
- import { n as workerFromInteractiveProvider, r as claimRetainedInteractiveControl, t as provisionSupervisor } from "./provision-supervisor-s7XtrK3h.js";
12
- import { a as defaultProfileRichnessThresholds, i as assessAuthoredProfile, n as delegate, o as profileRichnessFinding, r as asAuthoredProfile, s as supervisorInstructions, t as defaultDelegateBudget } from "./delegate-DR2gtTHa.js";
13
- import { n as runGraph, t as GraphEdgeCapError } from "./graph-BBQ6L1Mc.js";
4
+ import { $ as DEFAULT_PEER_MAIL_LIMITS, C as createExecutor, Ct as admitContinuationPolicy, D as runAgentRounds, E as createSteerableSandboxSession, Ft as harnessUsageIsEmpty, H as createAgentEnvironmentProviderRegistry, It as readCodexRolloutSession, J as createInPlaceCliExecutor, K as providerAsSandboxClient, L as createCodeModeTools, Lt as createPushTraceSource, M as acquireSandbox, N as TERMINAL_DECISIONS, Nt as addHarnessUsage, P as defaultSelectWinner, Pt as createCodexRolloutStoreReader, Q as AUTHORITY_MARKERS, R as runCodeMode, T as DEFAULT_SANDBOX_STEERING_MAX_TURNS, U as resolveAgentEnvironmentProvider, W as providerAsExecutor, _t as CheckUnavailableError, at as peerMailVerbNames, b as createExecutorRegistry, bt as mapExecutorResult, et as PEER_MAIL_WIRE_KEY, i as RunParkedError, it as peerMailTools, j as createSandboxLineage, n as createSupervisor, nt as createPeerMailbox, p as createRootHandle, q as createWorktreeCliExecutor, qt as assertProfileMaterializes, rt as isPeerMailEnvelope, s as readRunParking, t as DEFAULT_MAX_DEPTH, tt as claimsAuthority, u as bestDelivered, v as InMemoryResultBlobStore, xt as verdictFromJudgeScore, y as InMemorySpawnJournal, yt as gateOnDeliverable } from "./supervisor-BDnqTl_R.js";
5
+ import { _ as sharedWorkerClientName, f as DEFAULT_SHARED_BOX_RESOURCES, g as sharedBoxRefusal, h as ROUTER_CLIENT_HEADER, m as sharedBoxPlacement, p as DEFAULT_SHARED_BOX_WORKERS } from "./search-executor-DPBewC3S.js";
6
+ import { i as readRunCancellation, n as cancelRun, r as readRunCancelRequest, v as FileCoordinationLog } from "./run-cancellation-BzmmqlM8.js";
7
+ import { f as createFileRunContext, i as watchTrace, m as withRunContext, o as createEventBus, p as createInMemoryRunContext, r as defaultToolDetectors } from "./coordination-manager-C_ohXf63.js";
8
+ import { A as analyzesFindingsReportPrompt, B as anyOf, D as defaultEdgeTraversalCap, F as formatPromptHandle, G as bestSoFar, H as plateau, I as kernelPromptRegistry, J as createSupervisorSpanRecorder, K as plateauLength, L as naiveContinuationPrompt, M as delegatesWorkerBriefPrompt, N as dumbContinuationFailPrompt, P as dumbContinuationPassPrompt, R as promptHandle, U as anytimeReport, V as noProgressFor, W as areaUnderCurve, c as retryPreSpawnRefusals, d as supervisorAgent, g as serveCoordinationMcp, h as composeReentryTask, j as createPromptRegistry, l as withWorkerSpawnRetry, m as UNPROVEN_CONTINUITY, n as superviseFleetCapabilities, o as isPreSpawnExecutorFailure, p as runToolSpans, q as renderAnytimeTable, s as resolveWorkerSpawnRetry, t as supervise, u as workerFromBackend, x as GraphRouteError, z as allWorkersStalled } from "./supervise-BfT708zt.js";
9
+ import { a as graphRegistry, b as graphRouteWhenSchema, c as loadGraph, d as recordGraphRun, f as recordStoredGraphRun, i as graphFromStored, l as lookupGraph, m as taskShapeDigest, n as graphCorpusSummary, o as graphRunsFor, p as storedGraphDigests, r as graphDigest, s as listGraphRuns, t as digestOfGraph, u as pickBestGraph, y as graphFileSchema } from "./graph-registry-BoaUV5g8.js";
10
+ import { $ as runBenchmark, $t as renderLeaderboardHtml, A as searchPresets, At as sanitizeMcpToolSchema, B as graphFromSessionFacts, Bt as assertDeclaredCheck, C as withUntrackedArtifacts, Ct as harvestCorpus, D as SEARCH_SPEC_CORRELATION_KEY, Dt as connectStdioMcp, E as createFencedSqlRunContext, Et as McpSpawnFault, F as loadProfile, Ft as secretEnvOfMcpServer, G as chatWorkerSeam, Gt as readDeclaredCheck, H as loadGraphFile, Ht as declaredCheckDeliverable, I as pickBestProfile, It as inlineSandboxClient, J as strategyTournament, Jt as deterministicCompletion, K as createChatSessionStore, Kt as runIsolatedCheck, L as profileRegistry, Lt as loopCampaignDispatch, M as connectRemoteSupervisor, Mt as mcpSecretEnvMetadataKey, N as connectRemoteSupervisorControl, Nt as resolveMcpServerLaunch, O as assertSearchSpec, Ot as materializeLocalMcp, P as bestProfileFor, Pt as resolveSecretEnv, Q as printBenchmarkReport, Qt as pairwiseSignificance, R as profileRunsForName, Rt as loopDispatch, S as copyUntrackedIntoClone, St as HarvestError, T as validateStoredGraph, Tt as resolveSandboxClient, U as graphDesignerExtraTools, Ut as declaredCheckDigest, V as GraphFileResolutionError, Vt as checkProgramDigest, W as chatTransportExecutor, Wt as declaredCheckJudge, X as openSandboxRun, Xt as stopSentinel, Y as SandboxRunAbortError, Yt as sentinelCompletion, Z as createS3PrivateCasStore, Zt as leaderboard, _ as NOTE_MAX_CHARS, _t as buildSteerContext, a as localShell, at as FileCorpus, b as composeWorkerEvidence, bt as observationFromRegistry, c as createVerifierEnvironment, ct as fanout, d as harvestSurfaceDiffs, dt as panel, en as renderLeaderboardMarkdown, et as createPrivateCasArtifactPort, f as analystsFromRegistry, ft as pipeline, g as EVIDENCE_MAX_CHARS, gt as assertTraceDerivedFindings, ht as widen, i as jjWorkspace, in as openSqlRunStore, it as runPersonified, j as searchSpecDigest, jt as envKeyProvider, k as compileSearchSpec, kt as createMcpEnvironment, l as boxSurfaceReader, lt as flatWidenGate, m as worktreeFanout, mt as verify, n as makeFinding, nn as renderPairwiseMarkdown, nt as trajectoryReport, o as runInWorkspace, ot as InMemoryCorpus, p as failuresAnalyst, pt as selectValidWinner, q as runStrategyEvolution, qt as completionAuthorizes, r as gitWorkspace, rn as SqlRunOwnershipError, rt as definePersona, s as createWaterfallCollector, st as renderCorpusToInstructions, t as computeFindingId, tn as renderLeaderboardSvg, tt as equalKOnCost, u as fsSurfaceReader, ut as loopUntil, v as VERIFY_TAIL_CHARS, vt as createScopeAnalyst, w as analyzeTrace, wt as defineLeaderboard, x as settledWorkerOut, xt as inProcessSandboxClient, y as closingWorkerNote, yt as registryScopeAnalyst, z as recordProfileRun, zt as superviseDispatch } from "./runtime-DoUb4SOs.js";
11
+ import { n as workerFromInteractiveProvider, r as claimRetainedInteractiveControl, t as provisionSupervisor } from "./provision-supervisor-Dl6oYQDN.js";
12
+ import { a as defaultProfileRichnessThresholds, i as assessAuthoredProfile, n as delegate, o as profileRichnessFinding, r as asAuthoredProfile, s as supervisorInstructions, t as defaultDelegateBudget } from "./delegate-BYLjG7Ev.js";
13
+ import { n as runGraph, t as GraphEdgeCapError } from "./graph-T1-PBhLx.js";
14
14
  export { AUTHORITY_MARKERS, CheckUnavailableError, DEFAULT_MAX_DEPTH, DEFAULT_PEER_MAIL_LIMITS, DEFAULT_SANDBOX_STEERING_MAX_TURNS, DEFAULT_SHARED_BOX_RESOURCES, DEFAULT_SHARED_BOX_WORKERS, DEFAULT_STALL_AFTER_MS, EVIDENCE_MAX_CHARS, FileCoordinationLog, FileCorpus, FileResultBlobStore, FileSpawnJournal, GraphEdgeCapError, GraphFileResolutionError, GraphRouteError, HARNESS_TRANSCRIPT_READ_LIMITS, HARNESS_TRANSCRIPT_SETTLE_TIMEOUT_MS, HarvestError, InMemoryCorpus, InMemoryResultBlobStore, InMemorySpawnJournal, McpSpawnFault, NOTE_MAX_CHARS, ObservationError, PEER_MAIL_WIRE_KEY, ROUTER_CLIENT_HEADER, RunCancellationReason, RunParkedError, SEARCH_SPEC_CORRELATION_KEY, SandboxRunAbortError, SqlRunOwnershipError, TERMINAL_DECISIONS, TRACE_ROOT_SCHEMA, TRACE_SUMMARY_SCHEMA, UNPROVEN_CONTINUITY, VERIFY_TAIL_CHARS, acquireSandbox, adaptiveRefine, addHarnessUsage, admitContinuationPolicy, allWorkersStalled, analystsFromRegistry, analyzeTrace, analyzesFindingsReportPrompt, anyOf, anytimeReport, areaUnderCurve, asAuthoredProfile, assertDeclaredCheck, assertProfileMaterializes, assertSearchSpec, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, attachWorker, authorStrategy, bestDelivered, bestProfileFor, bestSoFar, boxSurfaceReader, breadthStrategy, buildSteerContext, canDisplace, cancelRun, cancelWorker, captureBoundHarnessTranscript, captureHarnessTranscript, chatTransportExecutor, chatWorkerSeam, checkProgramDigest, claimRetainedInteractiveControl, claimsAuthority, closingWorkerNote, collectAgentTurn, compareCheckOutcomes, compileSearchSpec, completionAuthorizes, composeCheckSources, composeReentryTask, composeWorkerEvidence, computeFindingId, connectRemoteSupervisor, connectRemoteSupervisorControl, connectStdioMcp, contentAddress, copyUntrackedIntoClone, createActivityLog, createAgentEnvironmentProviderRegistry, createBudgetPool, createChatSessionStore, createCodeModeTools, createCodexRolloutStoreReader, createEventBus, createExecutor, createExecutorRegistry, createFencedSqlRunContext, createFileRunContext, createInMemoryRunContext, createInPlaceCliExecutor, createMcpEnvironment, createOtelExporter, createPeerMailbox, createPrivateCasArtifactPort, createPromptRegistry, createPushTraceSource, createRootHandle, createS3PrivateCasStore, createSandboxLineage, createSandboxToolPartState, createScope, createScopeAnalyst, createSteerableSandboxSession, createSupervisor, createSupervisorSpanRecorder, createVerifierEnvironment, createWaterfallCollector, createWorkerSlots, createWorktreeCliExecutor, declaredCheckDeliverable, declaredCheckDigest, declaredCheckJudge, decodeHarnessUsage, defaultAnalystInstruction, defaultDelegateBudget, defaultEdgeTraversalCap, defaultExtractCandidate, defaultProfileRichnessThresholds, defaultSelectWinner, defaultStructuralRolloutPolicy, defaultToolDetectors, defineLeaderboard, definePersona, defineStrategy, delegate, delegatesWorkerBriefPrompt, depthStrategy, deterministicCompletion, digestOfGraph, dumbContinuationFailPrompt, dumbContinuationPassPrompt, envKeyProvider, equalKOnCost, extractLlmCallEvent, failuresAnalyst, fanout, filterAuthoredAsserts, flatWidenGate, formatPromptHandle, freeSlots, fsSurfaceReader, gateOnDeliverable, gitWorkspace, graphCorpusSummary, graphDesignerExtraTools, graphDigest, graphFileSchema, graphFromSessionFacts, graphFromStored, graphRegistry, graphRouteWhenSchema, graphRunsFor, harnessTranscriptArtifact, harnessUsageIsEmpty, harvestCorpus, harvestSurfaceDiffs, inProcessSandboxClient, inlineSandboxClient, isPeerMailEnvelope, isPreSpawnExecutorFailure, jjWorkspace, kernelPromptRegistry, leaderboard, legacySupervisorRunDir, listGraphRuns, loadGraph, loadGraphFile, loadProfile, loadSpawnForest, localShell, lookupGraph, loopCampaignDispatch, loopDispatch, loopUntil, makeFinding, mapExecutorResult, mapSandboxEvent, mapSandboxToolEvent, materializeLocalMcp, materializeTreeView, mcpSecretEnvMetadataKey, modelAuthoredChecks, naiveContinuationPrompt, noProgressFor, observationFromRegistry, observe, officialChecksFromMeta, openSandboxRun, openSqlRunStore, pairwiseSignificance, panel, parseWorkerToolTraceArtifact, peerMailTools, peerMailVerbNames, persistHarnessTranscript, pickBestGraph, pickBestProfile, pipeline, plateau, plateauLength, printBenchmarkReport, profileChatClient, profileOptimizerModelCall, profileRegistry, profileRichnessFinding, profileRunsForName, promptHandle, providerAsExecutor, providerAsSandboxClient, provisionSupervisor, queueOf, readBoundHarnessSessions, readCodexRolloutSession, readDeclaredCheck, readRunCancelRequest, readRunCancellation, readRunParking, readWorkerCancellation, readWorkerInteractiveBinding, readWorkerProgress, readWorkerSteerAcknowledgement, readWorkerSteerRequests, reconnectRetainedInteractiveRun, reconnectRetainedRun, recordGraphRun, recordProfileRun, recordStoredGraphRun, recoverRetainedInteractiveRun, recoverRetainedRun, refine, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderLeaderboardHtml, renderLeaderboardMarkdown, renderLeaderboardSvg, renderPairwiseMarkdown, renderReport, replaySpawnTree, resolveAgentEnvironmentProvider, resolveEntrySymbol, resolveHarnessTranscriptCapture, resolveMcpServerLaunch, resolveSandboxClient, resolveSecretEnv, resolveWorkerSpawnRetry, retainHarnessTranscript, retryPreSpawnRefusals, rollingDispatch, runAgentRounds, runAgentic, runBenchmark, runCodeMode, runGraph, runInWorkspace, runIsolatedCheck, runPersonified, runStrategyEvolution, runTaskQueue, runToolSpans, safeWorkerFile, sample, sampleThenRefine, sandboxCheckRunner, sanitizeMcpToolSchema, searchPresets, searchSpecDigest, secretEnvOfMcpServer, selectBestIndex, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, settledWorkerOut, sharedBoxPlacement, sharedBoxRefusal, sharedWorkerClientName, spendFromUsageEvents, startRetainedInteractiveRun, startRetainedRun, startRetainedRunInEnvironment, stopSentinel, storedGraphDigests, strategyAuthorContract, strategyAuthorSystemPrompt, strategyTournament, streamAgentTurn, structuralRollout, subscriptionUsageLimitSignal, sumSandboxUsage, supervise, superviseDispatch, superviseFleetCapabilities, supervisorAgent, supervisorInstructions, supervisorRunDir, supervisorRunsRoot, taskShapeDigest, trajectoryReport, validateStoredGraph, verdictFromJudgeScore, verify, visibleCheckScore, watchTrace, widen, withRunContext, withUntrackedArtifacts, withWorkerSpawnRetry, workerFromBackend, workerFromInteractiveProvider, workerInboxFileFromEventDir, worktreeFanout, writeWorkerSteer };
@@ -1,6 +1,6 @@
1
1
  import { i as ConfigError } from "./errors-AzSuGI23.js";
2
2
  import { t as runAnalystLoop } from "./analyst-loop-BZvXCDKy.js";
3
- import "./runtime-BufkoSjF.js";
3
+ import "./runtime-DoUb4SOs.js";
4
4
  // src/loop-runner.ts
5
5
  /** All valid delegated-loop mode names — used for validation and CLI surfaces. @experimental */
6
6
  const DELEGATED_LOOP_MODES = [
@@ -55,4 +55,4 @@ function auditLoopRunner(options) {
55
55
  }
56
56
  export { runDelegatedLoop as i, auditLoopRunner as n, isDelegatedLoopMode as r, DELEGATED_LOOP_MODES as t };
57
57
 
58
- //# sourceMappingURL=loop-runner-DshmaiYp.js.map
58
+ //# sourceMappingURL=loop-runner-CGa71-66.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"loop-runner-DshmaiYp.js","names":[],"sources":["../src/loop-runner.ts"],"sourcesContent":["/**\n *\n * `runDelegatedLoop` — the configured delegated loop-runner.\n *\n * One typed entrypoint a worker agent (or a scheduled routine) calls to run a\n * disciplined loop in a chosen MODE, over agent-runtime's hardened engines:\n *\n * code → build-in-a-loop on the GENERIC recursive path (worktreeLoopRunner: author one\n * `AgentProfile` per harness → worktree-CLI leaves → `patchDelivered` gate)\n * review → caller-registered runner — a `code` runner with an approval gate over candidates\n * research → research-in-a-loop with valid-only KB growth (createKbGate)\n * audit → analyze trace/run data → findings (runAnalystLoop, caller-wired)\n * self-improve → caller-registered `improve(profile, options)` run\n *\n * It is intentionally a thin façade: the value is that EVERY product reuses the\n * one hardened engine instead of forking delegation logic. The dispatcher owns\n * mode routing, timing, fail-loud on an unregistered mode, and a uniform result\n * shape; each mode's engine is a pre-configured runner in the registry (build it\n * with the factories below, or inject your own / a stub).\n *\n * @experimental\n */\n\nimport type { AgentProfile } from '@tangle-network/agent-interface'\nimport { runAnalystLoop } from './analyst-loop'\nimport type { RunAnalystLoopOpts, RunAnalystLoopResult } from './analyst-loop/types'\nimport { ConfigError } from './errors'\nimport { type CreateKbGateOptions, createKbGate, type FactCandidate } from './mcp/kb-gate'\nimport {\n type AuthoredHarness,\n type Budget,\n createExecutorRegistry,\n definePersona,\n runPersonified,\n type WinnerStrategy,\n type WorktreeFanoutOptions,\n type WorktreePatchArtifact,\n worktreeFanout,\n} from './runtime'\n\n/** All valid delegated-loop mode names — used for validation and CLI surfaces. @experimental */\nexport const DELEGATED_LOOP_MODES = ['code', 'review', 'research', 'audit', 'self-improve'] as const\n\n/** @experimental */\nexport type DelegatedLoopMode = (typeof DELEGATED_LOOP_MODES)[number]\n\n/** Type guard — returns true when `value` is a valid `DelegatedLoopMode` string. @experimental */\nexport function isDelegatedLoopMode(value: unknown): value is DelegatedLoopMode {\n return typeof value === 'string' && (DELEGATED_LOOP_MODES as readonly string[]).includes(value)\n}\n\n/** @experimental A pre-configured loop for one mode. Returns the mode's raw\n * output; the dispatcher wraps it in a `DelegatedLoopResult`. */\nexport type DelegatedLoopRunner<T = unknown> = (signal: AbortSignal) => Promise<T>\n\n/** @experimental Mode → configured runner. Partial: only register the modes a\n * given product/routine actually uses. */\nexport type DelegatedLoopRegistry = Partial<Record<DelegatedLoopMode, DelegatedLoopRunner>>\n\n/** @experimental Uniform result — never throws from a registered runner; a\n * thrown engine becomes `{ ok: false, error }` so a routine can record + move on. */\nexport interface DelegatedLoopResult<T = unknown> {\n mode: DelegatedLoopMode\n ok: boolean\n output?: T\n error?: string\n durationMs: number\n}\n\n/** @experimental */\ninterface RunDelegatedLoopOptions {\n signal?: AbortSignal\n /** Clock override for deterministic tests. */\n now?: () => number\n}\n\n/**\n *\n * Dispatch a configured loop by mode. Fails loud (throws `ConfigError`) when no\n * runner is registered for the mode — a routine pointed at an unwired mode is a\n * config bug, not a silent no-op. A runner that throws is captured as\n * `{ ok: false }` so unattended runs record the failure rather than crash.\n *\n * @experimental\n */\nexport async function runDelegatedLoop<T = unknown>(\n mode: DelegatedLoopMode,\n registry: DelegatedLoopRegistry,\n options: RunDelegatedLoopOptions = {},\n): Promise<DelegatedLoopResult<T>> {\n const runner = registry[mode] as DelegatedLoopRunner<T> | undefined\n if (!runner) {\n throw new ConfigError(\n `runDelegatedLoop: no runner registered for mode '${mode}' (registered: ${\n Object.keys(registry).join(', ') || 'none'\n })`,\n )\n }\n const now = options.now ?? Date.now\n const signal = options.signal ?? new AbortController().signal\n const start = now()\n try {\n const output = await runner(signal)\n return { mode, ok: true, output, durationMs: now() - start }\n } catch (err) {\n return {\n mode,\n ok: false,\n error: err instanceof Error ? err.message : String(err),\n durationMs: now() - start,\n }\n }\n}\n\n/** @experimental Options for the local-repo `code` runner over the GENERIC recursive path. */\ninterface WorktreeLoopRunnerOptions {\n /** Exact profile carried by the personified root that owns this fanout. */\n rootProfile: AgentProfile\n /** Absolute path to the local git checkout each worktree is cut from. */\n repoRoot: string\n /** The instruction handed to every authored harness (composed under each profile's systemPrompt). */\n taskPrompt: string\n /** The supervisor-authored harness profiles — one fanout item (one worktree-CLI leaf) each. */\n harnesses: ReadonlyArray<AuthoredHarness>\n /** Conserved budget pool bounding the fanout (equal-k holds by construction). */\n budget: Budget\n /** Shell command run in each worktree to derive the tests-PASS signal. */\n testCmd?: string\n /** Shell command run in each worktree to derive the typecheck-PASS signal. */\n typecheckCmd?: string\n /** Which verification signals the deliverable REQUIRES present-and-passing (default none). */\n require?: ReadonlyArray<'tests' | 'typecheck'>\n /** Diff-size cap (lines). */\n maxDiffLines?: number\n /** Literal path prefixes the patch must not touch (the secret-floor is always on regardless). */\n forbiddenPaths?: string[]\n /** Winner-selection strategy among gated candidates. Default `highest-score`. */\n winnerStrategy?: WinnerStrategy\n /** Test seams forwarded to the worktree-CLI leaves so the runner drives offline. */\n runGit?: WorktreeFanoutOptions['runGit']\n runHarness?: WorktreeFanoutOptions['runHarness']\n runCommand?: WorktreeFanoutOptions['runCommand']\n}\n\n/**\n *\n * `code` mode on the GENERIC recursive path: author one `AgentProfile` per harness, run them as a\n * `worktreeFanout` (N `createWorktreeCliExecutor` leaves, each `gateOnDeliverable`) through\n * `runPersonified` on the keystone Supervisor. The sandbox-session counterpart that drives the in-box\n * harness over a `SandboxClient` is `detachedSessionDelegate` (`./mcp/delegates`); here there is no\n * `runAgentRounds` driver, no role-coupled delegate — the harness list is the fanout, the gate is\n * `patchDelivered`,\n * the winner is the shared valid-only selector (NOT `defaultSelectWinner`, whose non-valid fallback\n * would surface an ungated patch). Equal-k holds by the conserved budget pool. Returns the winning\n * patch artifact, or throws when no candidate is delivered (fail loud, never a vacuous done).\n *\n * @experimental\n */\nexport function worktreeLoopRunner(\n options: WorktreeLoopRunnerOptions,\n): DelegatedLoopRunner<WorktreePatchArtifact> {\n const shape = worktreeFanout<string>({\n repoRoot: options.repoRoot,\n taskPrompt: options.taskPrompt,\n harnesses: options.harnesses,\n ...(options.testCmd !== undefined ? { testCmd: options.testCmd } : {}),\n ...(options.typecheckCmd !== undefined ? { typecheckCmd: options.typecheckCmd } : {}),\n ...(options.require !== undefined ? { require: options.require } : {}),\n ...(options.maxDiffLines !== undefined ? { maxDiffLines: options.maxDiffLines } : {}),\n ...(options.forbiddenPaths !== undefined ? { forbiddenPaths: options.forbiddenPaths } : {}),\n ...(options.winnerStrategy !== undefined ? { winnerStrategy: options.winnerStrategy } : {}),\n ...(options.runGit ? { runGit: options.runGit } : {}),\n ...(options.runHarness ? { runHarness: options.runHarness } : {}),\n ...(options.runCommand ? { runCommand: options.runCommand } : {}),\n })\n // The persona's only role here is to carry the fanout shape onto the Supervisor; each item's\n // executor is BYO (the gated worktree-CLI leaf), so the registry only needs to pass BYO through.\n const persona = definePersona<WorktreePatchArtifact>({\n name: 'worktree-coder',\n root: { profile: options.rootProfile, harness: null },\n directive: 'deliver a minimal validated patch on a fresh worktree',\n context: { role: 'coder' },\n executors: { registry: createExecutorRegistry() },\n })\n return async (signal) => {\n const result = await runPersonified<string, WorktreePatchArtifact>({\n persona,\n shape,\n task: options.taskPrompt,\n budget: options.budget,\n signal,\n })\n if (result.kind !== 'winner' || result.out.kind !== 'done') {\n const blockers =\n result.kind === 'winner' && result.out.kind === 'blocked'\n ? result.out.blockers.join('; ')\n : `supervisor settled ${result.kind}`\n throw new Error(`worktreeLoopRunner: no delivered patch (${blockers})`)\n }\n return result.out.deliverable\n }\n}\n\n/** @experimental A fact rejected at the KB gate — surfaced, never dropped. */\nexport interface VetoedFact {\n candidate: FactCandidate\n vetoedBy?: string\n reason?: string\n}\n\n/** @experimental */\ninterface ResearchLoopResult {\n /** Facts that passed the fail-closed gate — safe to write to the KB. */\n accepted: FactCandidate[]\n /** Facts the gate vetoed in the final round — escalate, do not silently drop. */\n vetoed: VetoedFact[]\n /** Research rounds actually run. */\n rounds: number\n}\n\n/** @experimental Options for the default `research` runner. */\ninterface ResearchLoopRunnerOptions {\n /**\n * The research engine (the consumer's web/doc searcher + extractor). Called\n * each round with the prior round's vetoes so it can re-research the gaps.\n * Returns fact candidates carrying their grounding (`verbatimPassage` +\n * `sourceText`).\n */\n research: (round: number, vetoed: VetoedFact[]) => Promise<FactCandidate[]>\n /** Gate config (extra judges, self-artifact kinds, …). The floor is always on. */\n gate?: CreateKbGateOptions\n /** Max research rounds (correct-on-veto remediation). Default 1. */\n maxRounds?: number\n}\n\n/**\n * `research` mode — research-in-a-loop with valid-only KB growth.\n *\n * Each round: research → gate every candidate (fail-closed; passage MUST be in\n * the source) → accept the clean ones → re-research the vetoed ones next round,\n * up to `maxRounds`. Vetoed facts in the final round are RETURNED (escalate,\n * never silently dropped) so the caller audits vs retries.\n *\n * @experimental\n */\nexport function researchLoopRunner(\n o: ResearchLoopRunnerOptions,\n): DelegatedLoopRunner<ResearchLoopResult> {\n const gate = createKbGate(o.gate)\n const maxRounds = Math.max(1, Math.trunc(o.maxRounds ?? 1))\n return async (signal) => {\n const accepted: FactCandidate[] = []\n let vetoed: VetoedFact[] = []\n let rounds = 0\n for (let round = 0; round < maxRounds; round += 1) {\n if (signal.aborted) break\n rounds += 1\n const candidates = await o.research(round, vetoed)\n if (candidates.length === 0) break\n vetoed = []\n for (const c of candidates) {\n const v = await gate(c)\n if (v.accepted) accepted.push(c)\n else vetoed.push({ candidate: c, vetoedBy: v.vetoedBy, reason: v.reason })\n }\n if (vetoed.length === 0) break\n }\n return { accepted, vetoed, rounds }\n }\n}\n\n/**\n * `audit` mode — analyst loop over captured trace/run data.\n *\n * @experimental\n */\nexport function auditLoopRunner<TProposal = unknown, TEdit = unknown>(\n options: RunAnalystLoopOpts,\n): DelegatedLoopRunner<RunAnalystLoopResult<TProposal, TEdit>> {\n return async () => runAnalystLoop<TProposal, TEdit>(options)\n}\n"],"mappings":";;;;;AAyCA,MAAa,uBAAuB;CAAC;CAAQ;CAAU;CAAY;CAAS;AAAc;;AAM1F,SAAgB,oBAAoB,OAA4C;CAC9E,OAAO,OAAO,UAAU,YAAa,qBAA2C,SAAS,KAAK;AAChG;;;;;;;;;;AAoCA,eAAsB,iBACpB,MACA,UACA,UAAmC,CAAC,GACH;CACjC,MAAM,SAAS,SAAS;CACxB,IAAI,CAAC,QACH,MAAM,IAAI,YACR,oDAAoD,KAAK,iBACvD,OAAO,KAAK,QAAQ,CAAC,CAAC,KAAK,IAAI,KAAK,OACrC,EACH;CAEF,MAAM,MAAM,QAAQ,OAAO,KAAK;CAChC,MAAM,SAAS,QAAQ,UAAU,IAAI,gBAAgB,CAAC,CAAC;CACvD,MAAM,QAAQ,IAAI;CAClB,IAAI;EAEF,OAAO;GAAE;GAAM,IAAI;GAAM,QAAA,MADJ,OAAO,MAAM;GACD,YAAY,IAAI,IAAI;EAAM;CAC7D,SAAS,KAAK;EACZ,OAAO;GACL;GACA,IAAI;GACJ,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;GACtD,YAAY,IAAI,IAAI;EACtB;CACF;AACF;;;;;;AAoKA,SAAgB,gBACd,SAC6D;CAC7D,OAAO,YAAY,eAAiC,OAAO;AAC7D"}
1
+ {"version":3,"file":"loop-runner-CGa71-66.js","names":[],"sources":["../src/loop-runner.ts"],"sourcesContent":["/**\n *\n * `runDelegatedLoop` — the configured delegated loop-runner.\n *\n * One typed entrypoint a worker agent (or a scheduled routine) calls to run a\n * disciplined loop in a chosen MODE, over agent-runtime's hardened engines:\n *\n * code → build-in-a-loop on the GENERIC recursive path (worktreeLoopRunner: author one\n * `AgentProfile` per harness → worktree-CLI leaves → `patchDelivered` gate)\n * review → caller-registered runner — a `code` runner with an approval gate over candidates\n * research → research-in-a-loop with valid-only KB growth (createKbGate)\n * audit → analyze trace/run data → findings (runAnalystLoop, caller-wired)\n * self-improve → caller-registered `improve(profile, options)` run\n *\n * It is intentionally a thin façade: the value is that EVERY product reuses the\n * one hardened engine instead of forking delegation logic. The dispatcher owns\n * mode routing, timing, fail-loud on an unregistered mode, and a uniform result\n * shape; each mode's engine is a pre-configured runner in the registry (build it\n * with the factories below, or inject your own / a stub).\n *\n * @experimental\n */\n\nimport type { AgentProfile } from '@tangle-network/agent-interface'\nimport { runAnalystLoop } from './analyst-loop'\nimport type { RunAnalystLoopOpts, RunAnalystLoopResult } from './analyst-loop/types'\nimport { ConfigError } from './errors'\nimport { type CreateKbGateOptions, createKbGate, type FactCandidate } from './mcp/kb-gate'\nimport {\n type AuthoredHarness,\n type Budget,\n createExecutorRegistry,\n definePersona,\n runPersonified,\n type WinnerStrategy,\n type WorktreeFanoutOptions,\n type WorktreePatchArtifact,\n worktreeFanout,\n} from './runtime'\n\n/** All valid delegated-loop mode names — used for validation and CLI surfaces. @experimental */\nexport const DELEGATED_LOOP_MODES = ['code', 'review', 'research', 'audit', 'self-improve'] as const\n\n/** @experimental */\nexport type DelegatedLoopMode = (typeof DELEGATED_LOOP_MODES)[number]\n\n/** Type guard — returns true when `value` is a valid `DelegatedLoopMode` string. @experimental */\nexport function isDelegatedLoopMode(value: unknown): value is DelegatedLoopMode {\n return typeof value === 'string' && (DELEGATED_LOOP_MODES as readonly string[]).includes(value)\n}\n\n/** @experimental A pre-configured loop for one mode. Returns the mode's raw\n * output; the dispatcher wraps it in a `DelegatedLoopResult`. */\nexport type DelegatedLoopRunner<T = unknown> = (signal: AbortSignal) => Promise<T>\n\n/** @experimental Mode → configured runner. Partial: only register the modes a\n * given product/routine actually uses. */\nexport type DelegatedLoopRegistry = Partial<Record<DelegatedLoopMode, DelegatedLoopRunner>>\n\n/** @experimental Uniform result — never throws from a registered runner; a\n * thrown engine becomes `{ ok: false, error }` so a routine can record + move on. */\nexport interface DelegatedLoopResult<T = unknown> {\n mode: DelegatedLoopMode\n ok: boolean\n output?: T\n error?: string\n durationMs: number\n}\n\n/** @experimental */\ninterface RunDelegatedLoopOptions {\n signal?: AbortSignal\n /** Clock override for deterministic tests. */\n now?: () => number\n}\n\n/**\n *\n * Dispatch a configured loop by mode. Fails loud (throws `ConfigError`) when no\n * runner is registered for the mode — a routine pointed at an unwired mode is a\n * config bug, not a silent no-op. A runner that throws is captured as\n * `{ ok: false }` so unattended runs record the failure rather than crash.\n *\n * @experimental\n */\nexport async function runDelegatedLoop<T = unknown>(\n mode: DelegatedLoopMode,\n registry: DelegatedLoopRegistry,\n options: RunDelegatedLoopOptions = {},\n): Promise<DelegatedLoopResult<T>> {\n const runner = registry[mode] as DelegatedLoopRunner<T> | undefined\n if (!runner) {\n throw new ConfigError(\n `runDelegatedLoop: no runner registered for mode '${mode}' (registered: ${\n Object.keys(registry).join(', ') || 'none'\n })`,\n )\n }\n const now = options.now ?? Date.now\n const signal = options.signal ?? new AbortController().signal\n const start = now()\n try {\n const output = await runner(signal)\n return { mode, ok: true, output, durationMs: now() - start }\n } catch (err) {\n return {\n mode,\n ok: false,\n error: err instanceof Error ? err.message : String(err),\n durationMs: now() - start,\n }\n }\n}\n\n/** @experimental Options for the local-repo `code` runner over the GENERIC recursive path. */\ninterface WorktreeLoopRunnerOptions {\n /** Exact profile carried by the personified root that owns this fanout. */\n rootProfile: AgentProfile\n /** Absolute path to the local git checkout each worktree is cut from. */\n repoRoot: string\n /** The instruction handed to every authored harness (composed under each profile's systemPrompt). */\n taskPrompt: string\n /** The supervisor-authored harness profiles — one fanout item (one worktree-CLI leaf) each. */\n harnesses: ReadonlyArray<AuthoredHarness>\n /** Conserved budget pool bounding the fanout (equal-k holds by construction). */\n budget: Budget\n /** Shell command run in each worktree to derive the tests-PASS signal. */\n testCmd?: string\n /** Shell command run in each worktree to derive the typecheck-PASS signal. */\n typecheckCmd?: string\n /** Which verification signals the deliverable REQUIRES present-and-passing (default none). */\n require?: ReadonlyArray<'tests' | 'typecheck'>\n /** Diff-size cap (lines). */\n maxDiffLines?: number\n /** Literal path prefixes the patch must not touch (the secret-floor is always on regardless). */\n forbiddenPaths?: string[]\n /** Winner-selection strategy among gated candidates. Default `highest-score`. */\n winnerStrategy?: WinnerStrategy\n /** Test seams forwarded to the worktree-CLI leaves so the runner drives offline. */\n runGit?: WorktreeFanoutOptions['runGit']\n runHarness?: WorktreeFanoutOptions['runHarness']\n runCommand?: WorktreeFanoutOptions['runCommand']\n}\n\n/**\n *\n * `code` mode on the GENERIC recursive path: author one `AgentProfile` per harness, run them as a\n * `worktreeFanout` (N `createWorktreeCliExecutor` leaves, each `gateOnDeliverable`) through\n * `runPersonified` on the keystone Supervisor. The sandbox-session counterpart that drives the in-box\n * harness over a `SandboxClient` is `detachedSessionDelegate` (`./mcp/delegates`); here there is no\n * `runAgentRounds` driver, no role-coupled delegate — the harness list is the fanout, the gate is\n * `patchDelivered`,\n * the winner is the shared valid-only selector (NOT `defaultSelectWinner`, whose non-valid fallback\n * would surface an ungated patch). Equal-k holds by the conserved budget pool. Returns the winning\n * patch artifact, or throws when no candidate is delivered (fail loud, never a vacuous done).\n *\n * @experimental\n */\nexport function worktreeLoopRunner(\n options: WorktreeLoopRunnerOptions,\n): DelegatedLoopRunner<WorktreePatchArtifact> {\n const shape = worktreeFanout<string>({\n repoRoot: options.repoRoot,\n taskPrompt: options.taskPrompt,\n harnesses: options.harnesses,\n ...(options.testCmd !== undefined ? { testCmd: options.testCmd } : {}),\n ...(options.typecheckCmd !== undefined ? { typecheckCmd: options.typecheckCmd } : {}),\n ...(options.require !== undefined ? { require: options.require } : {}),\n ...(options.maxDiffLines !== undefined ? { maxDiffLines: options.maxDiffLines } : {}),\n ...(options.forbiddenPaths !== undefined ? { forbiddenPaths: options.forbiddenPaths } : {}),\n ...(options.winnerStrategy !== undefined ? { winnerStrategy: options.winnerStrategy } : {}),\n ...(options.runGit ? { runGit: options.runGit } : {}),\n ...(options.runHarness ? { runHarness: options.runHarness } : {}),\n ...(options.runCommand ? { runCommand: options.runCommand } : {}),\n })\n // The persona's only role here is to carry the fanout shape onto the Supervisor; each item's\n // executor is BYO (the gated worktree-CLI leaf), so the registry only needs to pass BYO through.\n const persona = definePersona<WorktreePatchArtifact>({\n name: 'worktree-coder',\n root: { profile: options.rootProfile, harness: null },\n directive: 'deliver a minimal validated patch on a fresh worktree',\n context: { role: 'coder' },\n executors: { registry: createExecutorRegistry() },\n })\n return async (signal) => {\n const result = await runPersonified<string, WorktreePatchArtifact>({\n persona,\n shape,\n task: options.taskPrompt,\n budget: options.budget,\n signal,\n })\n if (result.kind !== 'winner' || result.out.kind !== 'done') {\n const blockers =\n result.kind === 'winner' && result.out.kind === 'blocked'\n ? result.out.blockers.join('; ')\n : `supervisor settled ${result.kind}`\n throw new Error(`worktreeLoopRunner: no delivered patch (${blockers})`)\n }\n return result.out.deliverable\n }\n}\n\n/** @experimental A fact rejected at the KB gate — surfaced, never dropped. */\nexport interface VetoedFact {\n candidate: FactCandidate\n vetoedBy?: string\n reason?: string\n}\n\n/** @experimental */\ninterface ResearchLoopResult {\n /** Facts that passed the fail-closed gate — safe to write to the KB. */\n accepted: FactCandidate[]\n /** Facts the gate vetoed in the final round — escalate, do not silently drop. */\n vetoed: VetoedFact[]\n /** Research rounds actually run. */\n rounds: number\n}\n\n/** @experimental Options for the default `research` runner. */\ninterface ResearchLoopRunnerOptions {\n /**\n * The research engine (the consumer's web/doc searcher + extractor). Called\n * each round with the prior round's vetoes so it can re-research the gaps.\n * Returns fact candidates carrying their grounding (`verbatimPassage` +\n * `sourceText`).\n */\n research: (round: number, vetoed: VetoedFact[]) => Promise<FactCandidate[]>\n /** Gate config (extra judges, self-artifact kinds, …). The floor is always on. */\n gate?: CreateKbGateOptions\n /** Max research rounds (correct-on-veto remediation). Default 1. */\n maxRounds?: number\n}\n\n/**\n * `research` mode — research-in-a-loop with valid-only KB growth.\n *\n * Each round: research → gate every candidate (fail-closed; passage MUST be in\n * the source) → accept the clean ones → re-research the vetoed ones next round,\n * up to `maxRounds`. Vetoed facts in the final round are RETURNED (escalate,\n * never silently dropped) so the caller audits vs retries.\n *\n * @experimental\n */\nexport function researchLoopRunner(\n o: ResearchLoopRunnerOptions,\n): DelegatedLoopRunner<ResearchLoopResult> {\n const gate = createKbGate(o.gate)\n const maxRounds = Math.max(1, Math.trunc(o.maxRounds ?? 1))\n return async (signal) => {\n const accepted: FactCandidate[] = []\n let vetoed: VetoedFact[] = []\n let rounds = 0\n for (let round = 0; round < maxRounds; round += 1) {\n if (signal.aborted) break\n rounds += 1\n const candidates = await o.research(round, vetoed)\n if (candidates.length === 0) break\n vetoed = []\n for (const c of candidates) {\n const v = await gate(c)\n if (v.accepted) accepted.push(c)\n else vetoed.push({ candidate: c, vetoedBy: v.vetoedBy, reason: v.reason })\n }\n if (vetoed.length === 0) break\n }\n return { accepted, vetoed, rounds }\n }\n}\n\n/**\n * `audit` mode — analyst loop over captured trace/run data.\n *\n * @experimental\n */\nexport function auditLoopRunner<TProposal = unknown, TEdit = unknown>(\n options: RunAnalystLoopOpts,\n): DelegatedLoopRunner<RunAnalystLoopResult<TProposal, TEdit>> {\n return async () => runAnalystLoop<TProposal, TEdit>(options)\n}\n"],"mappings":";;;;;AAyCA,MAAa,uBAAuB;CAAC;CAAQ;CAAU;CAAY;CAAS;AAAc;;AAM1F,SAAgB,oBAAoB,OAA4C;CAC9E,OAAO,OAAO,UAAU,YAAa,qBAA2C,SAAS,KAAK;AAChG;;;;;;;;;;AAoCA,eAAsB,iBACpB,MACA,UACA,UAAmC,CAAC,GACH;CACjC,MAAM,SAAS,SAAS;CACxB,IAAI,CAAC,QACH,MAAM,IAAI,YACR,oDAAoD,KAAK,iBACvD,OAAO,KAAK,QAAQ,CAAC,CAAC,KAAK,IAAI,KAAK,OACrC,EACH;CAEF,MAAM,MAAM,QAAQ,OAAO,KAAK;CAChC,MAAM,SAAS,QAAQ,UAAU,IAAI,gBAAgB,CAAC,CAAC;CACvD,MAAM,QAAQ,IAAI;CAClB,IAAI;EAEF,OAAO;GAAE;GAAM,IAAI;GAAM,QAAA,MADJ,OAAO,MAAM;GACD,YAAY,IAAI,IAAI;EAAM;CAC7D,SAAS,KAAK;EACZ,OAAO;GACL;GACA,IAAI;GACJ,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;GACtD,YAAY,IAAI,IAAI;EACtB;CACF;AACF;;;;;;AAoKA,SAAgB,gBACd,SAC6D;CAC7D,OAAO,YAAY,eAAiC,OAAO;AAC7D"}
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { i as runDelegatedLoop, r as isDelegatedLoopMode, t as DELEGATED_LOOP_MODES } from "./loop-runner-DshmaiYp.js";
2
+ import { i as runDelegatedLoop, r as isDelegatedLoopMode, t as DELEGATED_LOOP_MODES } from "./loop-runner-CGa71-66.js";
3
3
  // src/loop-runner-bin.ts
4
4
  /**
5
5
  *
package/dist/mcp/bin.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { Pn as readTraceContextFromEnv, pn as FileObserverJournal, q as coordinationProfileToolPrefix } from "../scope-CpULJrAr.js";
2
+ import { Pn as readTraceContextFromEnv, pn as FileObserverJournal, q as coordinationProfileToolPrefix } from "../scope-BGWRFiYt.js";
3
3
  import { i as ConfigError } from "../errors-AzSuGI23.js";
4
- import { s as supervisorInstructions } from "../delegate-DR2gtTHa.js";
5
- import { a as FileDelegationStore, i as DelegationTaskQueue, n as observerJournalEventSource, t as createMcpServer } from "../server-CekOTeag.js";
4
+ import { s as supervisorInstructions } from "../delegate-BYLjG7Ev.js";
5
+ import { a as FileDelegationStore, i as DelegationTaskQueue, n as observerJournalEventSource, t as createMcpServer } from "../server-M9dG-WG9.js";
6
6
  import { isAbsolute } from "node:path";
7
7
  // src/mcp/delegate-supervisor-provisioning.ts
8
8
  function trimmed(value) {
package/dist/mcp/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { Ct as environmentReader, Mn as createPropagatingTraceEmitter, Pn as readTraceContextFromEnv, wt as resolveSpawnResourcePaths } from "../scope-CpULJrAr.js";
1
+ import { Ct as environmentReader, Mn as createPropagatingTraceEmitter, Pn as readTraceContextFromEnv, wt as resolveSpawnResourcePaths } from "../scope-BGWRFiYt.js";
2
2
  import { i as ConfigError, m as ValidationError } from "../errors-AzSuGI23.js";
3
3
  import { J as deleteBoxSafe, at as sleep, ct as throwIfAborted } from "../workspace-streams-8ALHaZzx.js";
4
- import { A as createSandboxForSpec, D as runAgentRounds, Ht as runWorktreeHarness, O as assertBoxlessPromptOptions, Ut as LOCAL_HARNESSES } from "../supervisor-CWTFw-lP.js";
4
+ import { A as createSandboxForSpec, D as runAgentRounds, Ht as runWorktreeHarness, O as assertBoxlessPromptOptions, Ut as LOCAL_HARNESSES } from "../supervisor-BDnqTl_R.js";
5
5
  import { t as assertExecutableAgentProfile } from "../model-policy-JOcg3NRs.js";
6
6
  import { n as createStdioToolServer } from "../tool-server-CZWd_Opp.js";
7
- import { t as createCoordinationTools } from "../coordination-manager-B3mF1nMA.js";
8
- import { h as runCoderChecks, pt as selectValidWinner } from "../runtime-BufkoSjF.js";
9
- import { a as FileDelegationStore, i as DelegationTaskQueue, o as composeLoopTraceEmitters, r as createDelegateHandler, t as createMcpServer } from "../server-CekOTeag.js";
7
+ import { t as createCoordinationTools } from "../coordination-manager-C_ohXf63.js";
8
+ import { h as runCoderChecks, pt as selectValidWinner } from "../runtime-DoUb4SOs.js";
9
+ import { a as FileDelegationStore, i as DelegationTaskQueue, o as composeLoopTraceEmitters, r as createDelegateHandler, t as createMcpServer } from "../server-M9dG-WG9.js";
10
10
  import { agentProfileSchema } from "@tangle-network/agent-interface";
11
11
  import { isRecord } from "@tangle-network/agent-core";
12
12
  import { randomUUID } from "node:crypto";
@@ -1,10 +1,10 @@
1
- import { Er as newExecutionAttemptId, I as startRetainedInteractiveRun, N as readWorkerInteractiveBinding, Sr as finalizeRuntimeOwnedPendingExecutor, Vr as executableAgentProfileSnapshot, _ as supervisorRunDir, _n as destroyInteractiveEnvironment, ca as signalAbortError, dn as offerInteractiveControl, fn as prepareInteractiveDelegation, gi as contentAddress, j as interactiveAdmissionSeamKey, ln as retainedCreateMaterial, oa as linkAbort, un as acceptedInteractiveControl, vn as environmentGone, vr as attestRuntimeOwnedPendingExecutor } from "./scope-CpULJrAr.js";
1
+ import { Er as newExecutionAttemptId, I as startRetainedInteractiveRun, N as readWorkerInteractiveBinding, Sr as finalizeRuntimeOwnedPendingExecutor, Vr as executableAgentProfileSnapshot, _ as supervisorRunDir, _n as destroyInteractiveEnvironment, ca as signalAbortError, dn as offerInteractiveControl, fn as prepareInteractiveDelegation, gi as contentAddress, j as interactiveAdmissionSeamKey, ln as retainedCreateMaterial, oa as linkAbort, un as acceptedInteractiveControl, vn as environmentGone, vr as attestRuntimeOwnedPendingExecutor } from "./scope-BGWRFiYt.js";
2
2
  import { H as abortError, St as armDeadlineTimer, at as sleep } from "./workspace-streams-8ALHaZzx.js";
3
- import { d as detachedSnapshot } from "./jsonl-file-BBP9Dz9w.js";
4
- import { X as createInbox, Z as failPendingAfter, n as createSupervisor, ot as taskToPrompt, p as createRootHandle } from "./supervisor-CWTFw-lP.js";
3
+ import { d as detachedSnapshot } from "./jsonl-file-CbxMVnUj.js";
4
+ import { X as createInbox, Z as failPendingAfter, n as createSupervisor, ot as taskToPrompt, p as createRootHandle } from "./supervisor-BDnqTl_R.js";
5
5
  import { a as concreteProfileModel } from "./model-policy-JOcg3NRs.js";
6
6
  import { a as writeAtomicDurableFile } from "./durable-file-DstVeHcj.js";
7
- import { c as createSteerAcknowledger, f as createFileRunContext, s as createCancelAcknowledger, t as createCoordinationTools } from "./coordination-manager-B3mF1nMA.js";
7
+ import { c as createSteerAcknowledger, f as createFileRunContext, s as createCancelAcknowledger, t as createCoordinationTools } from "./coordination-manager-C_ohXf63.js";
8
8
  import { agentInteractiveSessionControlClaimRequestDigest, agentInteractiveSessionPromptRequestDigest, agentInteractiveSessionStopRequestDigest, agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest } from "@tangle-network/agent-interface";
9
9
  import { randomUUID } from "node:crypto";
10
10
  import { mkdirSync } from "node:fs";
@@ -1032,4 +1032,4 @@ function writeState(path, state) {
1032
1032
  }
1033
1033
  export { workerFromInteractiveProvider as n, claimRetainedInteractiveControl as r, provisionSupervisor as t };
1034
1034
 
1035
- //# sourceMappingURL=provision-supervisor-s7XtrK3h.js.map
1035
+ //# sourceMappingURL=provision-supervisor-Dl6oYQDN.js.map