opencode-swarm 7.167.1 → 7.168.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 (126) hide show
  1. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  2. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  3. package/dist/agents/project-context.d.ts +12 -8
  4. package/dist/cli/{coder-settlement-2ye4s5xr.js → coder-settlement-a35acvj1.js} +16 -16
  5. package/dist/cli/{config-doctor-b0k8eyd6.js → config-doctor-9csx775x.js} +3 -3
  6. package/dist/cli/{core-xgzgjk8s.js → core-agk5s7dm.js} +4 -4
  7. package/dist/cli/{curation-policy-bvxf5pxv.js → curation-policy-mgwv8h2k.js} +7 -7
  8. package/dist/cli/{curator-jpvzrxcv.js → curator-2fcagjyk.js} +45 -45
  9. package/dist/cli/{curator-drift-20m2ab5w.js → curator-drift-k0zrnm09.js} +8 -8
  10. package/dist/cli/curator-llm-factory-qaxmyy46.js +71 -0
  11. package/dist/cli/{dispatch-tmb929w8.js → dispatch-8ks9dyk5.js} +244 -70
  12. package/dist/cli/{evidence-summary-service-74az43cb.js → evidence-summary-service-4s6cje60.js} +22 -22
  13. package/dist/cli/{explorer-zvk5kbcb.js → explorer-2cv64zfj.js} +1 -1
  14. package/dist/cli/{gate-evidence-f26h2gn3.js → gate-evidence-saja4dan.js} +11 -11
  15. package/dist/cli/guardrail-explain-z41q6sf0.js +72 -0
  16. package/dist/cli/{guardrail-log-pnye3xw8.js → guardrail-log-0h24spq0.js} +9 -9
  17. package/dist/cli/{guardrail-reset-0da7q8ap.js → guardrail-reset-cwbe47k5.js} +44 -44
  18. package/dist/cli/hive-promoter-esxtcvr1.js +86 -0
  19. package/dist/cli/{index-bv8ha57q.js → index-00zx94vn.js} +6 -6
  20. package/dist/cli/{index-9e6fdz2h.js → index-0mhftbpp.js} +1 -1
  21. package/dist/cli/{index-7qefgq4j.js → index-1xnse449.js} +11 -1
  22. package/dist/cli/{index-qyr17fbz.js → index-21ree67h.js} +62 -106
  23. package/dist/cli/{index-q265ytw6.js → index-30h1pk05.js} +4 -4
  24. package/dist/cli/{index-f8xk5q5j.js → index-3dywbkyr.js} +4 -4
  25. package/dist/cli/{index-2w0beg3s.js → index-4r5pmtvk.js} +5 -5
  26. package/dist/cli/{index-69y9p6dh.js → index-54w1564x.js} +2 -2
  27. package/dist/cli/{index-251vrmge.js → index-5zqakgp4.js} +4 -4
  28. package/dist/cli/{index-bzdc4b7t.js → index-64phnth4.js} +6 -6
  29. package/dist/cli/{index-fmzz6aw7.js → index-8f0kscpg.js} +4 -4
  30. package/dist/cli/{index-t8tw1bhs.js → index-8ybjqg51.js} +2 -2
  31. package/dist/cli/{index-9ss2m4rs.js → index-9br68j86.js} +1 -1
  32. package/dist/cli/{index-4rhhvd1a.js → index-a1w58b47.js} +1 -1
  33. package/dist/cli/{index-qd619x3r.js → index-a8xbvsse.js} +2 -2
  34. package/dist/cli/{index-mgc3c483.js → index-an8b5gda.js} +10 -10
  35. package/dist/cli/{index-9wv6a3jx.js → index-bvqqwx84.js} +2 -2
  36. package/dist/cli/{index-bf6zx8cq.js → index-cyenn3pf.js} +6 -2
  37. package/dist/cli/{index-8x4zwk0t.js → index-ddr97ram.js} +47 -47
  38. package/dist/cli/{index-3nm1b3t2.js → index-dfyv3xkd.js} +8 -8
  39. package/dist/cli/{index-87agfprq.js → index-exatbqwj.js} +13 -4
  40. package/dist/cli/{index-70ha9e09.js → index-fyfbpz4f.js} +1 -1
  41. package/dist/cli/{index-5bd84nxc.js → index-gp9yzr1v.js} +1 -1
  42. package/dist/cli/{index-es13aqdb.js → index-h0e2e3h1.js} +1 -1
  43. package/dist/cli/{index-6d4dc99f.js → index-h439y187.js} +1 -1
  44. package/dist/cli/{index-9bhzbwa4.js → index-j950hqmq.js} +9 -9
  45. package/dist/cli/{index-sahf5yz3.js → index-kear8gb7.js} +11 -6
  46. package/dist/cli/{index-qww0h314.js → index-m35hybf0.js} +1 -1
  47. package/dist/cli/{index-qtd3hrk8.js → index-mr0wn36f.js} +5 -5
  48. package/dist/cli/{index-zwsbegc1.js → index-nprngf8p.js} +7 -7
  49. package/dist/cli/{index-z5gdgdkp.js → index-nsyxj57e.js} +12 -12
  50. package/dist/cli/{index-1aex5zd9.js → index-nwwk3dej.js} +2 -2
  51. package/dist/cli/{index-75f9jj3h.js → index-pyf517sz.js} +2 -2
  52. package/dist/cli/{index-m3tx1q9v.js → index-qhey6vc3.js} +1 -1
  53. package/dist/cli/{index-qd726agw.js → index-qwsh0h2g.js} +3 -3
  54. package/dist/cli/{index-n4fzmqz8.js → index-rdm3px0g.js} +4 -2
  55. package/dist/cli/index-rxcgrgkc.js +116 -0
  56. package/dist/cli/{index-54vzqy47.js → index-s0d5xter.js} +6 -6
  57. package/dist/cli/{index-emwezg3y.js → index-seetnhpx.js} +3 -3
  58. package/dist/cli/{index-0tc0pcmh.js → index-sxt7fgcw.js} +38 -2
  59. package/dist/cli/{index-m21x1bkx.js → index-v3xc4sde.js} +11 -8
  60. package/dist/cli/{index-79wnzc8q.js → index-wnzxcr0z.js} +3 -3
  61. package/dist/cli/{index-rk10x4zr.js → index-wst6n478.js} +106 -6
  62. package/dist/cli/{index-hdsg7yf6.js → index-x7k3dps5.js} +4 -3
  63. package/dist/cli/{index-32bxwzw0.js → index-yevn4jpe.js} +92908 -90093
  64. package/dist/cli/index-yv76j77m.js +2008 -0
  65. package/dist/cli/{index-f6zgz02s.js → index-z6qreakh.js} +7 -7
  66. package/dist/cli/{index-eretcr6t.js → index-ze520xw1.js} +11 -11
  67. package/dist/cli/index.js +44 -44
  68. package/dist/cli/{knowledge-escalator-p2a8xh8x.js → knowledge-escalator-b2tf3sd1.js} +17 -17
  69. package/dist/cli/{knowledge-events-jmh28m8d.js → knowledge-events-bgs2kxe0.js} +15 -15
  70. package/dist/cli/{knowledge-link-w1fwqts4.js → knowledge-link-dr3xnwyd.js} +6 -6
  71. package/dist/cli/{knowledge-store-8gmabtsn.js → knowledge-store-stbmb1b9.js} +7 -7
  72. package/dist/cli/{knowledge-validator-yk579vs4.js → knowledge-validator-zykgnsag.js} +9 -9
  73. package/dist/cli/{model-preflight-b3b5pgsc.js → model-preflight-1ycat9jz.js} +1 -1
  74. package/dist/cli/{pending-delegations-nw7ph53z.js → pending-delegations-n5qavj20.js} +14 -14
  75. package/dist/cli/{pr-subscriptions-9815fxbc.js → pr-subscriptions-gnvmyrng.js} +14 -14
  76. package/dist/cli/{pr-workflow-gate-98a7b6py.js → pr-workflow-gate-cf3ybrws.js} +44 -44
  77. package/dist/cli/{runner-nmrjv7te.js → runner-k0ycgv8x.js} +7 -7
  78. package/dist/cli/{scan-cursor-6zcs0frg.js → scan-cursor-b3mcrx23.js} +10 -10
  79. package/dist/cli/{schema-warvhy9h.js → schema-08049cjb.js} +4 -2
  80. package/dist/cli/{scope-persistence-c2ck77cv.js → scope-persistence-a493gv51.js} +20 -20
  81. package/dist/cli/{skill-generator-jamm1cna.js → skill-generator-2qqzkdpv.js} +19 -19
  82. package/dist/cli/{snapshot-coordination-init-st0xsn3f.js → snapshot-coordination-init-8yt8p7q0.js} +44 -44
  83. package/dist/cli/{sqlite-loader-xrnf6bq8.js → sqlite-loader-amp9z7ty.js} +1 -1
  84. package/dist/cli/{telemetry-ce0tx41h.js → telemetry-2wzapf11.js} +2 -2
  85. package/dist/cli/{workspace-snapshot-0kxj2grt.js → workspace-snapshot-rkgxhj9b.js} +6 -6
  86. package/dist/cli/{worktree-collision-ownership-qra7r8pw.js → worktree-collision-ownership-xttafc4h.js} +17 -17
  87. package/dist/cli/{worktree-isolation-yr9gnf64.js → worktree-isolation-e5q5rewk.js} +45 -45
  88. package/dist/commands/close/align-stage.d.ts +10 -0
  89. package/dist/commands/close/archive-stage.d.ts +34 -0
  90. package/dist/commands/close/clean-stage.d.ts +2 -0
  91. package/dist/commands/close/constants.d.ts +122 -0
  92. package/dist/commands/close/context.d.ts +129 -0
  93. package/dist/commands/close/db-helpers.d.ts +10 -0
  94. package/dist/commands/close/dry-run.d.ts +12 -0
  95. package/dist/commands/close/finalize-stage.d.ts +44 -0
  96. package/dist/commands/close/fs-helpers.d.ts +17 -0
  97. package/dist/commands/close/internals.d.ts +55 -0
  98. package/dist/commands/close/orchestrator.d.ts +32 -0
  99. package/dist/commands/close/wiring.d.ts +2 -0
  100. package/dist/commands/close.d.ts +10 -402
  101. package/dist/commands/reset.d.ts +10 -0
  102. package/dist/commands/rollback.d.ts +9 -0
  103. package/dist/config/schema.d.ts +29 -0
  104. package/dist/db/project-db.d.ts +8 -0
  105. package/dist/db/sqlite-loader.d.ts +2 -1
  106. package/dist/dispatch/spawn-circuit.d.ts +121 -0
  107. package/dist/dispatch/token-bucket.d.ts +46 -0
  108. package/dist/hooks/delegation-gate/dead-lane-reclaim.d.ts +61 -0
  109. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +22 -0
  110. package/dist/hooks/issue-trace.d.ts +3 -0
  111. package/dist/hooks/utils.d.ts +1 -1
  112. package/dist/index.js +811 -726
  113. package/dist/lang/dispatch.d.ts +6 -6
  114. package/dist/plan/ledger-sqlite.d.ts +226 -0
  115. package/dist/plan/ledger.d.ts +24 -0
  116. package/dist/plan/manager.d.ts +19 -0
  117. package/dist/retention/sweep.d.ts +2 -0
  118. package/dist/services/spec-drift-recovery.d.ts +2 -1
  119. package/dist/utils/canonical-root.d.ts +19 -0
  120. package/dist/utils/ephemeral-session-teardown.d.ts +55 -2
  121. package/opencode-swarm.schema.json +41 -0
  122. package/package.json +1 -1
  123. package/dist/cli/curator-llm-factory-zeb0pe2j.js +0 -71
  124. package/dist/cli/guardrail-explain-5vhveypz.js +0 -72
  125. package/dist/cli/hive-promoter-2vj54xc4.js +0 -86
  126. package/dist/cli/index-fenasyvr.js +0 -967
@@ -14,8 +14,9 @@ import {
14
14
  } from "./index-d5qf7hvh.js";
15
15
  import"./index-p612v1mv.js";
16
16
  import {
17
- canonicalRootKeyFresh
18
- } from "./index-7qefgq4j.js";
17
+ canonicalRootKeyFreshAsync,
18
+ canonicalRootKeyLexical
19
+ } from "./index-1xnse449.js";
19
20
  import"./index-ee6ydtfe.js";
20
21
  import"./index-zpsr8rpc.js";
21
22
  import"./index-zgwm4ryv.js";
@@ -398,52 +399,193 @@ var MANIFEST_SET = new Set(MANIFEST_FILES);
398
399
  // src/lang/dispatch.ts
399
400
  var _internals2 = {
400
401
  detectProjectLanguages,
401
- cacheCapacity: 64
402
+ cacheCapacity: 64,
403
+ get manifestRootCacheSize() {
404
+ return manifestRootCache.size;
405
+ }
402
406
  };
403
407
  var cache = new Map;
404
408
  var insertCounter = 0;
405
- function safeReaddirSet(dir) {
409
+ async function tryReadDirectoryAsync(dir) {
406
410
  try {
407
- return new Set(fs4.readdirSync(dir));
411
+ return new Set(await fs4.promises.readdir(dir));
408
412
  } catch {
409
- return new Set;
413
+ return null;
410
414
  }
411
415
  }
412
- function manifestHash(dir) {
413
- const entries = safeReaddirSet(dir);
414
- if (entries.size === 0)
416
+ async function manifestHash(dir, signal) {
417
+ const entries = await tryReadDirectoryAsync(dir);
418
+ throwIfAborted(signal);
419
+ if (entries === null || entries.size === 0)
415
420
  return "";
416
- const parts = [];
417
- for (const name of MANIFEST_FILES) {
418
- if (!entries.has(name))
419
- continue;
421
+ const names = MANIFEST_FILES.filter((name) => entries.has(name));
422
+ const parts = await Promise.all(names.map(async (name) => {
420
423
  try {
421
- const stat = fs4.statSync(path4.join(dir, name));
422
- parts.push(`${name}:${stat.size}:${stat.mtimeMs}:${stat.ino}`);
423
- } catch {}
424
- }
425
- return parts.join("|");
424
+ const stat = await fs4.promises.stat(path4.join(dir, name));
425
+ return `${name}:${stat.size}:${stat.mtimeMs}:${stat.ino}`;
426
+ } catch {
427
+ return null;
428
+ }
429
+ }));
430
+ throwIfAborted(signal);
431
+ return parts.filter((part) => part !== null).join("|");
426
432
  }
433
+ var MAX_MANIFEST_SEARCH_DEPTH = 32;
427
434
  var manifestRootCache = new Map;
428
- function findManifestRoot(start) {
435
+ var manifestRootInsertCounter = 0;
436
+ var profileCacheKeyByInput = new Map;
437
+ function cacheProfileKey(input, cacheKey) {
438
+ const key = canonicalRootKeyLexical(input);
439
+ profileCacheKeyByInput.delete(key);
440
+ profileCacheKeyByInput.set(key, cacheKey);
441
+ while (profileCacheKeyByInput.size > _internals2.cacheCapacity) {
442
+ const oldest = profileCacheKeyByInput.keys().next().value;
443
+ if (oldest === undefined)
444
+ break;
445
+ profileCacheKeyByInput.delete(oldest);
446
+ }
447
+ }
448
+ async function directoryFingerprint(dir) {
449
+ try {
450
+ const stat = await fs4.promises.stat(dir);
451
+ if (!stat.isDirectory())
452
+ return null;
453
+ return {
454
+ directory: dir,
455
+ dev: stat.dev,
456
+ ino: stat.ino,
457
+ size: stat.size,
458
+ mtimeMs: stat.mtimeMs,
459
+ ctimeMs: stat.ctimeMs
460
+ };
461
+ } catch {
462
+ return null;
463
+ }
464
+ }
465
+ function fingerprintsMatch(expected, actual) {
466
+ return expected.dev === actual.dev && expected.ino === actual.ino && expected.size === actual.size && expected.mtimeMs === actual.mtimeMs && expected.ctimeMs === actual.ctimeMs;
467
+ }
468
+ async function readDirectoryForManifestWalk(dir) {
469
+ const entries = await tryReadDirectoryAsync(dir);
470
+ const fingerprint = await directoryFingerprint(dir);
471
+ const after = await tryReadDirectoryAsync(dir);
472
+ if (entries === null || fingerprint === null || after === null) {
473
+ return { entries: null, complete: false, stopAtCurrent: true };
474
+ }
475
+ if (entries.size !== after.size || [...entries].some((entry) => !after.has(entry))) {
476
+ return { entries: null, complete: false, stopAtCurrent: false };
477
+ }
478
+ return { entries, fingerprint, complete: true };
479
+ }
480
+ async function isManifestRootCacheEntryValid(entry) {
481
+ for (const fingerprint of entry.trace) {
482
+ const current = await directoryFingerprint(fingerprint.directory);
483
+ if (current === null || !fingerprintsMatch(fingerprint, current)) {
484
+ return false;
485
+ }
486
+ }
487
+ return true;
488
+ }
489
+ async function isSelectedRootObservationStillValid(resolution, hash, signal) {
490
+ const currentHash = await manifestHash(resolution.root, signal);
491
+ throwIfAborted(signal);
492
+ if (currentHash !== hash || resolution.rootHadManifest && currentHash === "") {
493
+ return false;
494
+ }
495
+ return true;
496
+ }
497
+ function evictManifestRootCacheIfNeeded() {
498
+ if (manifestRootCache.size <= _internals2.cacheCapacity)
499
+ return;
500
+ let oldestKey;
501
+ let oldestOrder = Infinity;
502
+ for (const [key, value] of manifestRootCache) {
503
+ if (value.insertOrder < oldestOrder) {
504
+ oldestKey = key;
505
+ oldestOrder = value.insertOrder;
506
+ }
507
+ }
508
+ if (oldestKey !== undefined)
509
+ manifestRootCache.delete(oldestKey);
510
+ }
511
+ function cacheManifestRoot(key, root, rootHadManifest, trace, cacheable, signal) {
512
+ if (!cacheable || signal?.aborted)
513
+ return;
514
+ manifestRootCache.set(key, {
515
+ root,
516
+ rootHadManifest,
517
+ trace,
518
+ insertOrder: manifestRootInsertCounter++
519
+ });
520
+ evictManifestRootCacheIfNeeded();
521
+ }
522
+ function throwIfAborted(signal) {
523
+ if (signal?.aborted) {
524
+ throw signal.reason ?? new Error("manifest-root lookup aborted");
525
+ }
526
+ }
527
+ async function findManifestRoot(start, signal) {
528
+ throwIfAborted(signal);
429
529
  const resolved = path4.resolve(start);
430
- const key = canonicalRootKeyFresh(resolved);
530
+ const key = await canonicalRootKeyFreshAsync(resolved);
531
+ throwIfAborted(signal);
431
532
  const cached = manifestRootCache.get(key);
432
- if (cached !== undefined)
433
- return cached;
533
+ if (cached !== undefined) {
534
+ if (await isManifestRootCacheEntryValid(cached)) {
535
+ throwIfAborted(signal);
536
+ return {
537
+ root: cached.root,
538
+ rootHadManifest: cached.rootHadManifest,
539
+ key,
540
+ trace: [],
541
+ cacheable: false
542
+ };
543
+ }
544
+ manifestRootCache.delete(key);
545
+ }
434
546
  let cur = resolved;
435
- for (let i = 0;i < 32; i++) {
436
- const entries = safeReaddirSet(cur);
437
- if (entries.size > 0) {
438
- for (const name of MANIFEST_FILES) {
439
- if (entries.has(name)) {
440
- manifestRootCache.set(key, cur);
441
- return cur;
442
- }
547
+ const trace = [];
548
+ let cacheable = true;
549
+ for (let i = 0;i < MAX_MANIFEST_SEARCH_DEPTH; i++) {
550
+ const snapshot = await readDirectoryForManifestWalk(cur);
551
+ throwIfAborted(signal);
552
+ if (!snapshot.complete) {
553
+ if (snapshot.stopAtCurrent) {
554
+ return {
555
+ root: cur,
556
+ rootHadManifest: false,
557
+ key,
558
+ trace,
559
+ cacheable: false
560
+ };
443
561
  }
444
- if (entries.has(".git")) {
445
- manifestRootCache.set(key, cur);
446
- return cur;
562
+ cacheable = false;
563
+ } else {
564
+ trace.push(snapshot.fingerprint);
565
+ }
566
+ const { entries } = snapshot;
567
+ if (entries !== null) {
568
+ if (entries.size > 0) {
569
+ for (const name of MANIFEST_FILES) {
570
+ if (entries.has(name)) {
571
+ return {
572
+ root: cur,
573
+ rootHadManifest: true,
574
+ key,
575
+ trace,
576
+ cacheable
577
+ };
578
+ }
579
+ }
580
+ if (entries.has(".git")) {
581
+ return {
582
+ root: cur,
583
+ rootHadManifest: false,
584
+ key,
585
+ trace,
586
+ cacheable
587
+ };
588
+ }
447
589
  }
448
590
  }
449
591
  const parent = path4.dirname(cur);
@@ -451,8 +593,7 @@ function findManifestRoot(start) {
451
593
  break;
452
594
  cur = parent;
453
595
  }
454
- manifestRootCache.set(key, start);
455
- return start;
596
+ return { root: start, rootHadManifest: false, key, trace, cacheable };
456
597
  }
457
598
  function evictIfNeeded() {
458
599
  if (cache.size <= _internals2.cacheCapacity)
@@ -468,55 +609,88 @@ function evictIfNeeded() {
468
609
  if (oldestKey !== undefined)
469
610
  cache.delete(oldestKey);
470
611
  }
471
- async function pickBackend(dir) {
472
- const root = findManifestRoot(dir);
473
- const hash = manifestHash(root);
474
- const cacheKey = canonicalRootKeyFresh(root);
475
- const cached = cache.get(cacheKey);
476
- if (cached && cached.hash === hash) {
477
- return cached.backend;
478
- }
479
- if (hash === "") {
480
- cache.set(cacheKey, {
481
- hash,
482
- backend: null,
483
- profiles: [],
484
- insertOrder: insertCounter++
485
- });
486
- evictIfNeeded();
487
- return null;
488
- }
489
- const profiles = await _internals2.detectProjectLanguages(root);
490
- if (profiles.length === 0) {
612
+ async function pickBackend(dir, signal) {
613
+ for (let attempt = 0;attempt < 2; attempt++) {
614
+ const resolution = await findManifestRoot(dir, signal);
615
+ const { root } = resolution;
616
+ throwIfAborted(signal);
617
+ const hash = await manifestHash(root, signal);
618
+ throwIfAborted(signal);
619
+ if (resolution.rootHadManifest && hash === "") {
620
+ manifestRootCache.delete(resolution.key);
621
+ if (attempt === 0)
622
+ continue;
623
+ profileCacheKeyByInput.delete(canonicalRootKeyLexical(dir));
624
+ return null;
625
+ }
626
+ const cacheKey = await canonicalRootKeyFreshAsync(root);
627
+ throwIfAborted(signal);
628
+ const cached = cache.get(cacheKey);
629
+ if (cached && cached.hash === hash) {
630
+ cacheManifestRoot(resolution.key, root, resolution.rootHadManifest, resolution.trace, resolution.cacheable, signal);
631
+ cacheProfileKey(dir, cacheKey);
632
+ return cached.backend;
633
+ }
634
+ if (hash === "") {
635
+ cacheManifestRoot(resolution.key, root, resolution.rootHadManifest, resolution.trace, resolution.cacheable, signal);
636
+ cache.set(cacheKey, {
637
+ hash,
638
+ backend: null,
639
+ profiles: [],
640
+ insertOrder: insertCounter++
641
+ });
642
+ evictIfNeeded();
643
+ cacheProfileKey(dir, cacheKey);
644
+ return null;
645
+ }
646
+ const profiles = await _internals2.detectProjectLanguages(root);
647
+ throwIfAborted(signal);
648
+ if (!await isSelectedRootObservationStillValid(resolution, hash, signal)) {
649
+ manifestRootCache.delete(resolution.key);
650
+ if (attempt === 0)
651
+ continue;
652
+ profileCacheKeyByInput.delete(canonicalRootKeyLexical(dir));
653
+ return null;
654
+ }
655
+ cacheManifestRoot(resolution.key, root, resolution.rootHadManifest, resolution.trace, resolution.cacheable, signal);
656
+ if (profiles.length === 0) {
657
+ cache.set(cacheKey, {
658
+ hash,
659
+ backend: null,
660
+ profiles: [],
661
+ insertOrder: insertCounter++
662
+ });
663
+ evictIfNeeded();
664
+ cacheProfileKey(dir, cacheKey);
665
+ return null;
666
+ }
667
+ const winner = profiles[0];
668
+ const backend = LANGUAGE_BACKEND_REGISTRY.getOrDefault(winner.id) ?? null;
491
669
  cache.set(cacheKey, {
492
670
  hash,
493
- backend: null,
494
- profiles: [],
671
+ backend,
672
+ profiles: profiles.map((p) => ({ id: p.id })),
495
673
  insertOrder: insertCounter++
496
674
  });
497
675
  evictIfNeeded();
498
- return null;
676
+ cacheProfileKey(dir, cacheKey);
677
+ return backend;
499
678
  }
500
- const winner = profiles[0];
501
- const backend = LANGUAGE_BACKEND_REGISTRY.getOrDefault(winner.id) ?? null;
502
- cache.set(cacheKey, {
503
- hash,
504
- backend,
505
- profiles: profiles.map((p) => ({ id: p.id })),
506
- insertOrder: insertCounter++
507
- });
508
- evictIfNeeded();
509
- return backend;
679
+ return null;
510
680
  }
511
681
  function pickedProfiles(dir) {
512
- const root = findManifestRoot(dir);
513
- const cached = cache.get(canonicalRootKeyFresh(root));
682
+ const cacheKey = profileCacheKeyByInput.get(canonicalRootKeyLexical(dir));
683
+ if (cacheKey === undefined)
684
+ return [];
685
+ const cached = cache.get(cacheKey);
514
686
  return cached?.profiles ?? [];
515
687
  }
516
688
  function clearDispatchCache() {
517
689
  cache.clear();
518
690
  manifestRootCache.clear();
691
+ profileCacheKeyByInput.clear();
519
692
  insertCounter = 0;
693
+ manifestRootInsertCounter = 0;
520
694
  }
521
695
  export {
522
696
  pickedProfiles,
@@ -6,36 +6,36 @@ import {
6
6
  loadPlanJsonOnly,
7
7
  mergeDurableGateEntriesFromEvidence,
8
8
  readDurableGateEvidence
9
- } from "./index-qyr17fbz.js";
10
- import"./index-5bd84nxc.js";
9
+ } from "./index-21ree67h.js";
10
+ import"./index-gp9yzr1v.js";
11
11
  import"./index-txdagbh7.js";
12
+ import"./index-9br68j86.js";
12
13
  import"./index-cw912re7.js";
13
- import"./index-9ss2m4rs.js";
14
14
  import"./index-zsrtt42s.js";
15
- import"./index-bv8ha57q.js";
16
- import"./index-fmzz6aw7.js";
17
- import"./index-sahf5yz3.js";
15
+ import"./index-00zx94vn.js";
16
+ import"./index-8f0kscpg.js";
17
+ import"./index-kear8gb7.js";
18
18
  import"./index-p612v1mv.js";
19
19
  import"./index-3qf1vxtb.js";
20
20
  import"./index-n832052r.js";
21
- import"./index-fenasyvr.js";
22
- import"./index-qd619x3r.js";
23
- import"./index-6d4dc99f.js";
24
- import"./index-rk10x4zr.js";
21
+ import"./index-yv76j77m.js";
22
+ import"./index-a8xbvsse.js";
23
+ import"./index-h439y187.js";
24
+ import"./index-wst6n478.js";
25
+ import"./index-rdm3px0g.js";
25
26
  import"./index-ry16d01s.js";
26
- import"./index-n4fzmqz8.js";
27
- import"./index-qd726agw.js";
28
- import"./index-2w0beg3s.js";
29
- import"./index-m21x1bkx.js";
30
- import"./index-f6zgz02s.js";
31
- import"./index-7qefgq4j.js";
32
- import"./index-ee6ydtfe.js";
27
+ import"./index-qwsh0h2g.js";
28
+ import"./index-4r5pmtvk.js";
33
29
  import"./index-7g4c7s5r.js";
34
- import"./index-emwezg3y.js";
35
- import"./index-9e6fdz2h.js";
36
- import"./index-4rhhvd1a.js";
37
- import"./index-87agfprq.js";
38
- import"./index-0tc0pcmh.js";
30
+ import"./index-v3xc4sde.js";
31
+ import"./index-z6qreakh.js";
32
+ import"./index-1xnse449.js";
33
+ import"./index-ee6ydtfe.js";
34
+ import"./index-seetnhpx.js";
35
+ import"./index-0mhftbpp.js";
36
+ import"./index-a1w58b47.js";
37
+ import"./index-exatbqwj.js";
38
+ import"./index-sxt7fgcw.js";
39
39
  import"./index-bk5tah7q.js";
40
40
  import"./index-bpmtbmy9.js";
41
41
  import"./index-zpsr8rpc.js";
@@ -7,7 +7,7 @@ import {
7
7
  EXPLORER_MEMORY_OUTCOME_GUIDANCE,
8
8
  EXPLORER_PROMPT,
9
9
  createExplorerAgent
10
- } from "./index-70ha9e09.js";
10
+ } from "./index-fyfbpz4f.js";
11
11
  import"./index-a76rekgs.js";
12
12
  export {
13
13
  createExplorerAgent,
@@ -21,19 +21,19 @@ import {
21
21
  reduceTaskWorkflowSnapshot,
22
22
  transitionTaskWorkflowEvidence,
23
23
  withTaskEvidenceTransaction
24
- } from "./index-bv8ha57q.js";
25
- import"./index-fmzz6aw7.js";
26
- import"./index-sahf5yz3.js";
24
+ } from "./index-00zx94vn.js";
25
+ import"./index-8f0kscpg.js";
26
+ import"./index-kear8gb7.js";
27
27
  import"./index-p612v1mv.js";
28
- import"./index-2w0beg3s.js";
29
- import"./index-m21x1bkx.js";
30
- import"./index-f6zgz02s.js";
31
- import"./index-7qefgq4j.js";
32
- import"./index-ee6ydtfe.js";
28
+ import"./index-4r5pmtvk.js";
33
29
  import"./index-7g4c7s5r.js";
34
- import"./index-9e6fdz2h.js";
35
- import"./index-4rhhvd1a.js";
36
- import"./index-0tc0pcmh.js";
30
+ import"./index-v3xc4sde.js";
31
+ import"./index-z6qreakh.js";
32
+ import"./index-1xnse449.js";
33
+ import"./index-ee6ydtfe.js";
34
+ import"./index-0mhftbpp.js";
35
+ import"./index-a1w58b47.js";
36
+ import"./index-sxt7fgcw.js";
37
37
  import"./index-bpmtbmy9.js";
38
38
  import"./index-zpsr8rpc.js";
39
39
  import"./index-yzjaj53h.js";
@@ -0,0 +1,72 @@
1
+ // @bun
2
+ import {
3
+ handleGuardrailExplain
4
+ } from "./index-54w1564x.js";
5
+ import"./index-yevn4jpe.js";
6
+ import"./index-d5qf7hvh.js";
7
+ import"./index-qhey6vc3.js";
8
+ import"./index-30h1pk05.js";
9
+ import"./index-nwwk3dej.js";
10
+ import"./index-cyenn3pf.js";
11
+ import"./index-21ree67h.js";
12
+ import"./index-gp9yzr1v.js";
13
+ import"./index-txdagbh7.js";
14
+ import"./index-9br68j86.js";
15
+ import"./index-cw912re7.js";
16
+ import"./index-64phnth4.js";
17
+ import"./index-mr0wn36f.js";
18
+ import"./index-wnzxcr0z.js";
19
+ import"./index-fyfbpz4f.js";
20
+ import"./index-dfyv3xkd.js";
21
+ import"./index-zsrtt42s.js";
22
+ import"./index-ze520xw1.js";
23
+ import"./index-5zqakgp4.js";
24
+ import"./index-bvqqwx84.js";
25
+ import"./index-b43rt5ph.js";
26
+ import"./index-q7sjgr1y.js";
27
+ import"./index-00zx94vn.js";
28
+ import"./index-8f0kscpg.js";
29
+ import"./index-nprngf8p.js";
30
+ import"./index-nsyxj57e.js";
31
+ import"./index-kear8gb7.js";
32
+ import"./index-p612v1mv.js";
33
+ import"./index-3dywbkyr.js";
34
+ import"./index-m35hybf0.js";
35
+ import"./index-rtry5xyf.js";
36
+ import"./index-x7k3dps5.js";
37
+ import"./index-3qf1vxtb.js";
38
+ import"./index-n832052r.js";
39
+ import"./index-an8b5gda.js";
40
+ import"./index-yv76j77m.js";
41
+ import"./index-a8xbvsse.js";
42
+ import"./index-pyf517sz.js";
43
+ import"./index-h439y187.js";
44
+ import"./index-wst6n478.js";
45
+ import"./index-rdm3px0g.js";
46
+ import"./index-ry16d01s.js";
47
+ import"./index-qwsh0h2g.js";
48
+ import"./index-j950hqmq.js";
49
+ import"./index-vzm6zre7.js";
50
+ import"./index-ae75rja9.js";
51
+ import"./index-8ybjqg51.js";
52
+ import"./index-4r5pmtvk.js";
53
+ import"./index-7g4c7s5r.js";
54
+ import"./index-v3xc4sde.js";
55
+ import"./index-z6qreakh.js";
56
+ import"./index-1xnse449.js";
57
+ import"./index-ee6ydtfe.js";
58
+ import"./index-seetnhpx.js";
59
+ import"./index-0mhftbpp.js";
60
+ import"./index-a1w58b47.js";
61
+ import"./index-exatbqwj.js";
62
+ import"./index-sxt7fgcw.js";
63
+ import"./index-bk5tah7q.js";
64
+ import"./index-bpmtbmy9.js";
65
+ import"./index-zpsr8rpc.js";
66
+ import"./index-q1r1cfww.js";
67
+ import"./index-yzjaj53h.js";
68
+ import"./index-zgwm4ryv.js";
69
+ import"./index-a76rekgs.js";
70
+ export {
71
+ handleGuardrailExplain
72
+ };
@@ -1,17 +1,17 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailLog
4
- } from "./index-es13aqdb.js";
5
- import"./index-q265ytw6.js";
4
+ } from "./index-h0e2e3h1.js";
5
+ import"./index-30h1pk05.js";
6
6
  import"./index-p612v1mv.js";
7
- import"./index-qd619x3r.js";
8
- import"./index-qd726agw.js";
9
- import"./index-m21x1bkx.js";
10
- import"./index-f6zgz02s.js";
11
- import"./index-7qefgq4j.js";
7
+ import"./index-a8xbvsse.js";
8
+ import"./index-qwsh0h2g.js";
9
+ import"./index-v3xc4sde.js";
10
+ import"./index-z6qreakh.js";
11
+ import"./index-1xnse449.js";
12
12
  import"./index-ee6ydtfe.js";
13
- import"./index-87agfprq.js";
14
- import"./index-0tc0pcmh.js";
13
+ import"./index-exatbqwj.js";
14
+ import"./index-sxt7fgcw.js";
15
15
  import"./index-bk5tah7q.js";
16
16
  import"./index-bpmtbmy9.js";
17
17
  import"./index-zpsr8rpc.js";