@tangle-network/agent-runtime 0.162.0 → 0.164.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/{activation-DxGP0h_p.js → activation-CneAm4jL.js} +3 -3
  2. package/dist/{activation-DxGP0h_p.js.map → activation-CneAm4jL.js.map} +1 -1
  3. package/dist/agent.d.ts +1 -1
  4. package/dist/agent.js +2 -2
  5. package/dist/{authoring-kO7vE_c9.js → authoring-CZM22nUG.js} +2 -2
  6. package/dist/{authoring-kO7vE_c9.js.map → authoring-CZM22nUG.js.map} +1 -1
  7. package/dist/candidate-execution/index.js +4 -4
  8. package/dist/{candidate-execution-izJj02pU.js → candidate-execution-DNLk6h0A.js} +4 -4
  9. package/dist/{candidate-execution-izJj02pU.js.map → candidate-execution-DNLk6h0A.js.map} +1 -1
  10. package/dist/conversation.d.ts +1 -1
  11. package/dist/durable.d.ts +2 -2
  12. package/dist/durable.js +1 -1
  13. package/dist/{environment-provider-Bk8rg4gs.d.ts → environment-provider-BXFFK_rZ.d.ts} +2 -2
  14. package/dist/environment-provider.d.ts +1 -1
  15. package/dist/{graph-COikUkrj.js → graph-DzE4SwfP.js} +2 -2
  16. package/dist/{graph-COikUkrj.js.map → graph-DzE4SwfP.js.map} +1 -1
  17. package/dist/graph.d.ts +230 -4
  18. package/dist/graph.js +873 -50
  19. package/dist/graph.js.map +1 -1
  20. package/dist/{improvement-cycle-dGtgX1vr.js → improvement-cycle-a_L8FFql.js} +4 -4
  21. package/dist/{improvement-cycle-dGtgX1vr.js.map → improvement-cycle-a_L8FFql.js.map} +1 -1
  22. package/dist/{index-8b0o4dMF.d.ts → index-BP11HXYi.d.ts} +5 -5
  23. package/dist/{index-4mRXbu_V.d.ts → index-C2X-OVPZ.d.ts} +4 -4
  24. package/dist/{index-CTQ97IMO.d.ts → index-OFOvnNc2.d.ts} +2 -2
  25. package/dist/index.d.ts +7 -7
  26. package/dist/index.js +11 -11
  27. package/dist/intelligence.d.ts +4 -4
  28. package/dist/intelligence.js +5 -5
  29. package/dist/kernel.d.ts +5 -5
  30. package/dist/kernel.js +6 -6
  31. package/dist/{knowledge-CZT8ahp6.js → knowledge-Ccdghy81.js} +5 -5
  32. package/dist/{knowledge-CZT8ahp6.js.map → knowledge-Ccdghy81.js.map} +1 -1
  33. package/dist/knowledge.d.ts +1 -1
  34. package/dist/knowledge.js +1 -1
  35. package/dist/{loop-runner-bin-DHU5kmJW.d.ts → loop-runner-bin-2NITRIFc.d.ts} +3 -3
  36. package/dist/{loop-runner-bin-CIjmKf7v.js → loop-runner-bin-DM-AnPC-.js} +3 -3
  37. package/dist/{loop-runner-bin-CIjmKf7v.js.map → loop-runner-bin-DM-AnPC-.js.map} +1 -1
  38. package/dist/loop-runner-bin.d.ts +1 -1
  39. package/dist/loop-runner-bin.js +1 -1
  40. package/dist/mcp/bin.js +3 -3
  41. package/dist/mcp/index.d.ts +3 -3
  42. package/dist/mcp/index.js +4 -4
  43. package/dist/{openai-tools-DG779Z6S.js → openai-tools-CIo9tB75.js} +2 -2
  44. package/dist/{openai-tools-DG779Z6S.js.map → openai-tools-CIo9tB75.js.map} +1 -1
  45. package/dist/{prepare-VLGnSyav.js → prepare-D7Fb75XR.js} +6 -4
  46. package/dist/prepare-D7Fb75XR.js.map +1 -0
  47. package/dist/primeintellect/index.d.ts +1 -1
  48. package/dist/{protected-model-port-CcCH0Uji.js → protected-model-port-RZkxRZhp.js} +2 -2
  49. package/dist/{protected-model-port-CcCH0Uji.js.map → protected-model-port-RZkxRZhp.js.map} +1 -1
  50. package/dist/{redact-BUIB5IWj.d.ts → redact-D4vlt6p4.d.ts} +3 -3
  51. package/dist/{runtime-BT00zfIS.js → runtime-BDHsMgCK.js} +6 -6
  52. package/dist/{runtime-BT00zfIS.js.map → runtime-BDHsMgCK.js.map} +1 -1
  53. package/dist/{runtime-B0FIFwpH.d.ts → runtime-D44YrQ4t.d.ts} +4 -4
  54. package/dist/{stream-agent-turn-BEhmmYmL.d.ts → stream-agent-turn-Dx2YrEWW.d.ts} +2 -2
  55. package/dist/{structural-rollout-DAenyNls.js → structural-rollout-CBK2LHni.js} +2 -2
  56. package/dist/{structural-rollout-DAenyNls.js.map → structural-rollout-CBK2LHni.js.map} +1 -1
  57. package/dist/{supervise-Di6xvnOL.js → supervise-CzllE0vn.js} +2 -2
  58. package/dist/{supervise-Di6xvnOL.js.map → supervise-CzllE0vn.js.map} +1 -1
  59. package/dist/{supervisor-DmWq4vkU.js → supervisor-D5K8ihKQ.js} +106 -36
  60. package/dist/supervisor-D5K8ihKQ.js.map +1 -0
  61. package/dist/testing.d.ts +2 -2
  62. package/dist/testing.js +12 -12
  63. package/dist/{types-DXKDG6DQ.d.ts → types-C2l1jaos.d.ts} +7 -4
  64. package/dist/{workspace-archive-BptlGCEU.js → workspace-archive-DK0mDjSB.js} +2 -2
  65. package/dist/{workspace-archive-BptlGCEU.js.map → workspace-archive-DK0mDjSB.js.map} +1 -1
  66. package/package.json +1 -1
  67. package/dist/prepare-VLGnSyav.js.map +0 -1
  68. package/dist/supervisor-DmWq4vkU.js.map +0 -1
@@ -513,7 +513,25 @@ const HARNESS_INVOCATIONS = {
513
513
  ultracode: "max"
514
514
  },
515
515
  args: (level) => ["--variant", level]
516
- }
516
+ },
517
+ permissionBypassArgs: () => ["--auto"]
518
+ },
519
+ pi: {
520
+ command: "pi",
521
+ buildArgs: (taskPrompt) => ["--print", taskPrompt],
522
+ modelArgs: (model) => ["--model", model],
523
+ reasoning: {
524
+ levels: {
525
+ minimal: "minimal",
526
+ low: "low",
527
+ medium: "medium",
528
+ high: "high",
529
+ xhigh: "xhigh",
530
+ ultracode: "max"
531
+ },
532
+ args: (level) => ["--thinking", level]
533
+ },
534
+ permissionBypassArgs: () => ["--approve"]
517
535
  }
518
536
  };
519
537
  /** Every local harness, in table order — the one list `AGENT_RUNTIME_LOCAL_HARNESSES` and any
@@ -691,7 +709,7 @@ var RollingByteCapture = class {
691
709
  async function runLocalHarness(options) {
692
710
  const { harness, cwd, taskPrompt } = options;
693
711
  if (options.codexReproducible && harness !== "codex") throw new Error("runLocalHarness: codexReproducible requires the Codex harness");
694
- if (options.codexReproducible && process.platform !== "linux") throw new Error("runLocalHarness: codexReproducible currently requires Linux");
712
+ if (options.codexReproducible && !isSupportedCodexPlatform()) throw new Error(`runLocalHarness: codexReproducible does not support ${process.platform}/${process.arch}; supported: linux and darwin on x64 or arm64`);
695
713
  if (options.codexReadDeniedPaths !== void 0 && !options.codexReproducible) throw new Error("runLocalHarness: codexReadDeniedPaths requires codexReproducible");
696
714
  const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
697
715
  const maxOutputBytes = options.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES;
@@ -1194,7 +1212,7 @@ async function isolateCodexHome(opts) {
1194
1212
  const stagedPath = join(candidateRoot, ".agent-runtime-bin");
1195
1213
  if (readDeniedPaths.some((path) => isSameOrDescendant(candidateRoot, path) || isSameOrDescendant(stagedPath, path) || isSameOrDescendant(path, stagedPath))) throw new Error("runLocalHarness: codexReadDeniedPaths cannot contain the candidate root or staged executable");
1196
1214
  const nativeExecutable = await opts.resolveExecutable(opts.command, opts.baseEnv);
1197
- if (!await isStaticElfExecutable(nativeExecutable)) throw new Error("runLocalHarness: reproducible Codex mode requires a statically linked Linux Codex ELF");
1215
+ if (!await isVendoredCodexExecutable(nativeExecutable)) throw new Error("runLocalHarness: reproducible Codex mode requires the vendored native Codex build (a static musl ELF on linux, a Mach-O executable on darwin), not a PATH wrapper");
1198
1216
  const sourceExecutableSha256 = await sha256File(nativeExecutable);
1199
1217
  stagedExecutableDir = stagedPath;
1200
1218
  try {
@@ -1207,7 +1225,7 @@ async function isolateCodexHome(opts) {
1207
1225
  await copyFile(nativeExecutable, stagedExecutable, constants.COPYFILE_FICLONE);
1208
1226
  await chmod(stagedExecutable, 320);
1209
1227
  const executableSha256 = await sha256File(stagedExecutable);
1210
- if (executableSha256 !== sourceExecutableSha256 || !await isStaticElfExecutable(stagedExecutable)) throw new Error("runLocalHarness: staged Codex executable digest mismatch");
1228
+ if (executableSha256 !== sourceExecutableSha256 || !await isVendoredCodexExecutable(stagedExecutable)) throw new Error("runLocalHarness: staged Codex executable digest mismatch");
1211
1229
  await chmod(stagedExecutableDir, 320);
1212
1230
  workspaceTemp = await mkdtemp(join(candidateRoot, ".agent-runtime-tmp-"));
1213
1231
  await chmod(workspaceTemp, 448);
@@ -1357,7 +1375,7 @@ async function resolveCodexNativeExecutable(command, env) {
1357
1375
  }
1358
1376
  if (seen.has(resolved)) continue;
1359
1377
  seen.add(resolved);
1360
- if (await isStaticElfExecutable(resolved)) return resolved;
1378
+ if (await isVendoredCodexExecutable(resolved)) return resolved;
1361
1379
  const packageRoot = await findCodexPackageRoot(resolved);
1362
1380
  if (!packageRoot) continue;
1363
1381
  const bundled = await findBundledCodexExecutable(packageRoot);
@@ -1377,51 +1395,103 @@ async function findCodexPackageRoot(file) {
1377
1395
  }
1378
1396
  }
1379
1397
  async function findBundledCodexExecutable(packageRoot) {
1380
- const target = linuxCodexTarget();
1398
+ const target = codexTarget();
1381
1399
  const candidates = [join(packageRoot, "node_modules", "@openai", target.packageName, "vendor", target.triple, "bin", "codex"), join(packageRoot, "vendor", target.triple, "bin", "codex")];
1382
- for (const executable of candidates) if (await isStaticElfExecutable(executable)) return executable;
1400
+ for (const executable of candidates) if (await isVendoredCodexExecutable(executable)) return executable;
1383
1401
  }
1384
- function linuxCodexTarget() {
1385
- if (process.platform !== "linux") throw new Error("runLocalHarness: reproducible Codex mode requires Linux");
1386
- if (process.arch === "x64") return {
1387
- packageName: "codex-linux-x64",
1388
- triple: "x86_64-unknown-linux-musl"
1389
- };
1390
- if (process.arch === "arm64") return {
1391
- packageName: "codex-linux-arm64",
1392
- triple: "aarch64-unknown-linux-musl"
1393
- };
1394
- throw new Error(`runLocalHarness: unsupported Linux architecture ${process.arch}`);
1402
+ /**
1403
+ * The vendored Codex build for this host.
1404
+ *
1405
+ * `@openai/codex` ships a per-platform binary for linux, darwin and win32 on x64 and arm64.
1406
+ * Reproducible mode needs the vendored native executable rather than a PATH wrapper, so the
1407
+ * table maps host to package name plus Rust target triple. Linux vendors static musl builds;
1408
+ * darwin vendors Mach-O against the system libc, which is why the executable check below is
1409
+ * per-format rather than ELF-only.
1410
+ */
1411
+ function codexTarget() {
1412
+ const target = {
1413
+ "linux-x64": {
1414
+ packageName: "codex-linux-x64",
1415
+ triple: "x86_64-unknown-linux-musl"
1416
+ },
1417
+ "linux-arm64": {
1418
+ packageName: "codex-linux-arm64",
1419
+ triple: "aarch64-unknown-linux-musl"
1420
+ },
1421
+ "darwin-x64": {
1422
+ packageName: "codex-darwin-x64",
1423
+ triple: "x86_64-apple-darwin"
1424
+ },
1425
+ "darwin-arm64": {
1426
+ packageName: "codex-darwin-arm64",
1427
+ triple: "aarch64-apple-darwin"
1428
+ }
1429
+ }[`${process.platform}-${process.arch}`];
1430
+ if (!target) throw new Error(`runLocalHarness: reproducible Codex mode does not support ${process.platform}/${process.arch}`);
1431
+ return target;
1432
+ }
1433
+ /** Hosts with a vendored Codex build reproducible mode can verify and run. */
1434
+ function isSupportedCodexPlatform() {
1435
+ return (process.platform === "linux" || process.platform === "darwin") && (process.arch === "x64" || process.arch === "arm64");
1395
1436
  }
1396
- async function isStaticElfExecutable(path) {
1437
+ /**
1438
+ * Is this the vendored native Codex build for this host?
1439
+ *
1440
+ * Reproducible mode must run the vendored binary, never a shell wrapper that could re-enter
1441
+ * a different toolchain, so the check reads the file's own header rather than trusting its
1442
+ * path. The two vendor formats differ: linux ships a STATIC musl ELF (an interpreter segment
1443
+ * would mean a dynamic build, which is rejected), darwin ships Mach-O linked against the
1444
+ * system libc, where dynamic linkage is normal and not a signal of the wrong artifact.
1445
+ */
1446
+ async function isVendoredCodexExecutable(path) {
1397
1447
  let handle;
1398
1448
  try {
1399
1449
  await access(path, constants.X_OK);
1400
1450
  handle = await open(path, "r");
1401
1451
  const header = Buffer.alloc(64);
1402
1452
  const { bytesRead } = await handle.read(header, 0, header.length, 0);
1403
- if (bytesRead !== header.length || !header.subarray(0, 4).equals(Buffer.from([
1404
- 127,
1405
- 69,
1406
- 76,
1407
- 70
1408
- ])) || header[4] !== 2 || header[5] !== 1) return false;
1409
- const programHeaderOffset = Number(header.readBigUInt64LE(32));
1410
- const programHeaderSize = header.readUInt16LE(54);
1411
- const programHeaderCount = header.readUInt16LE(56);
1412
- const expectedMachine = process.arch === "x64" ? 62 : process.arch === "arm64" ? 183 : -1;
1413
- if (![2, 3].includes(header.readUInt16LE(16)) || header.readUInt16LE(18) !== expectedMachine || !Number.isSafeInteger(programHeaderOffset) || programHeaderOffset < 64 || programHeaderSize < 56 || programHeaderSize > 1024 || programHeaderCount === 0 || programHeaderCount > 1024) return false;
1414
- const tableSize = programHeaderSize * programHeaderCount;
1415
- const table = Buffer.alloc(tableSize);
1416
- if ((await handle.read(table, 0, tableSize, programHeaderOffset)).bytesRead !== tableSize) return false;
1417
- for (let index = 0; index < programHeaderCount; index += 1) if (table.readUInt32LE(index * programHeaderSize) === 3) return false;
1418
- return true;
1453
+ if (bytesRead !== header.length) return false;
1454
+ if (process.platform === "darwin") return isMachOExecutable(header);
1455
+ return await isStaticElf(header, handle);
1419
1456
  } catch {
1420
1457
  return false;
1421
1458
  } finally {
1422
1459
  await handle?.close();
1423
1460
  }
1424
1461
  }
1462
+ /**
1463
+ * A 64-bit Mach-O executable for this architecture, or a universal binary containing one.
1464
+ *
1465
+ * Magics: 0xfeedfacf is a little-endian 64-bit Mach-O; 0xcafebabe/0xbebafeca is a fat header,
1466
+ * whose slices are checked by the loader at exec time rather than here.
1467
+ */
1468
+ function isMachOExecutable(header) {
1469
+ const magic = header.readUInt32LE(0);
1470
+ const MH_MAGIC_64 = 4277009103;
1471
+ const MH_CIGAM_64 = 3489328638;
1472
+ if (magic === 3199925962 || magic === 3405691582) return true;
1473
+ if (magic !== MH_MAGIC_64 && magic !== MH_CIGAM_64) return false;
1474
+ return (magic === MH_MAGIC_64 ? header.readUInt32LE(4) : header.readUInt32BE(4)) === (process.arch === "x64" ? 16777223 : 16777228);
1475
+ }
1476
+ /** A statically linked ELF for this architecture: no PT_INTERP segment (type 3). */
1477
+ async function isStaticElf(header, handle) {
1478
+ if (!header.subarray(0, 4).equals(Buffer.from([
1479
+ 127,
1480
+ 69,
1481
+ 76,
1482
+ 70
1483
+ ])) || header[4] !== 2 || header[5] !== 1) return false;
1484
+ const programHeaderOffset = Number(header.readBigUInt64LE(32));
1485
+ const programHeaderSize = header.readUInt16LE(54);
1486
+ const programHeaderCount = header.readUInt16LE(56);
1487
+ const expectedMachine = process.arch === "x64" ? 62 : process.arch === "arm64" ? 183 : -1;
1488
+ if (![2, 3].includes(header.readUInt16LE(16)) || header.readUInt16LE(18) !== expectedMachine || !Number.isSafeInteger(programHeaderOffset) || programHeaderOffset < 64 || programHeaderSize < 56 || programHeaderSize > 1024 || programHeaderCount === 0 || programHeaderCount > 1024) return false;
1489
+ const tableSize = programHeaderSize * programHeaderCount;
1490
+ const table = Buffer.alloc(tableSize);
1491
+ if ((await handle.read(table, 0, tableSize, programHeaderOffset)).bytesRead !== tableSize) return false;
1492
+ for (let index = 0; index < programHeaderCount; index += 1) if (table.readUInt32LE(index * programHeaderSize) === 3) return false;
1493
+ return true;
1494
+ }
1425
1495
  function sha256File(path) {
1426
1496
  return new Promise((resolveDigest, reject) => {
1427
1497
  const hash = createHash("sha256");
@@ -13319,4 +13389,4 @@ function isNonEmptySpend(s) {
13319
13389
  //#endregion
13320
13390
  export { DEFAULT_STALL_AFTER_MS as $, LOCAL_HARNESSES as $t, createBudgetPool as A, buildLoopOtelSpans as At, createExecutorRegistry as B, padTraceId as Bt, effectiveConcurrency as C, canonicalObservedModel as Ct, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as D, readTraceContextFromEnv as Dt, rollingDispatch as E, mergeTraceEnv as Et, bridgeRuntimeAttachmentsKey as F, exportEvalRuns as Ft, workerTraceEnv as G, sanitizeKnowledgeReadinessReport as Gt, createWorktreeCliExecutor as H, createRuntimeEventCollector as Ht, bridgeStopSignalKey as I, flatOtelSpan as It, DEFAULT_SANDBOX_STEERING_MAX_TURNS as J, runWorktreeHarness as Jt, workerTraceHeaders as K, sanitizeRuntimeStreamEvent as Kt, captureReusableExecutorConfig as L, generateSpanId as Lt, bindReusableExecutorExecutionId as M, buildRuntimeEventOtelSpans as Mt, bridgeAdmissionRead as N, createOpenInferenceFileExporter as Nt, teardownExecutor as O, traceContextToEnv as Ot, bridgeModelRouteRefusal as P, createOtelExporter as Pt, sandboxSessionTraceSource as Q, DEFAULT_LOCAL_HARNESS as Qt, cliWorktreeExecutor as R, loopEventToOtelSpan as Rt, waitUntil as S, runBrainLoop as St, queueOf as T, createPropagatingTraceEmitter as Tt, WORKER_TRACE_PROPAGATION as U, createRuntimeStreamEventCollector as Ut, snapshotExecutorConfig as V, toOtelAttributes as Vt, readWorkerTraceContext as W, sanitizeAgentRuntimeEvent as Wt, createPushTraceSource as X, createWorktree as Xt, createSteerableSandboxSession as Y, captureWorktreeDiff as Yt, decodeToolPart as Z, removeWorktree as Zt, createWaitProbes as _, unsupportedProfileDimensions as _n, runAgentRounds as _t, pickBestDelivered as a, assertProfileMaterialization as an, PEER_MAIL_WIRE_KEY as at, timerAt as b, acquireSandbox as bt, driverChild as c, fullProfileMaterialization as cn, isPeerMailEnvelope as ct, deriveNodeExecutionIdentity as d, promptModelProfileMaterialization as dn, isLiveNodeStatus as dt, harnessSupportsReasoningEffort as en, createActivityLog as et, meterRuntimeOwnedAccounting as f, promptOnlyProfileMaterialization as fn, isTerminalNodeStatus as ft, settledToIteration as g, sandboxActProfileMaterialization as gn, isTerminalDecision as gt, scopeOwnerExecutorNodeContext as h, renderUnsupported as hn, defaultSelectWinner as ht, collectDelivered as i, AGENT_PROFILE_MATERIALIZATION_AXES as in, DEFAULT_PEER_MAIL_LIMITS as it, spendFromUsageEvents as j, buildLoopSpanNodes as jt, assertValidBudget as k, INTELLIGENCE_WIRE_VERSION as kt, withDriverExecutor as l, profileMaterializationAxes$1 as ln, peerMailTools as lt, recordScopeOwnerMaterialization as m, renderProfileMaterializationIssues as mn, createSandboxForSpec as mt, createSupervisor as n, parseCodexTokenUsage as nn, createInbox as nt, runFinalizer as o, controlProfileMaterialization as on, claimsAuthority as ot, meterRuntimeOwnedProviderAttempt as p, promptResourceProfileMaterialization as pn, TERMINAL_DECISIONS as pt, workerTraceSeamKey as q, runSettledCommand as qt, bestDelivered as r, CodexExecutionDiagnosticError as rn, AUTHORITY_MARKERS as rt, runTree as s, defineProfileMaterializationContract as sn, createPeerMailbox as st, createRootHandle as t, localHarnessExecutable as tn, readWorkerProgress as tt, createScope as u, promptControlProfileMaterialization as un, peerMailVerbNames as ut, isWaitOutcome as v, validateProfileMaterialization as vn, createSandboxLineage as vt, freeSlots as w, observedModelMatchesDeclared as wt, validateWaitSpec as x, routerBrain as xt, pollFor as y, worktreeCliProfileMaterialization as yn, probeSandboxCapabilities as yt, createExecutor as z, padSpanId as zt };
13321
13391
 
13322
- //# sourceMappingURL=supervisor-DmWq4vkU.js.map
13392
+ //# sourceMappingURL=supervisor-D5K8ihKQ.js.map