opencode-swarm 7.145.0 → 7.145.1

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 (71) hide show
  1. package/dist/background/workspace-snapshot.d.ts +29 -0
  2. package/dist/cli/{config-doctor-dzsv3pqy.js → config-doctor-96jmxr7s.js} +3 -3
  3. package/dist/cli/{core-qkh9me8x.js → core-w78pc1hh.js} +3 -3
  4. package/dist/cli/{curation-policy-5x6346tf.js → curation-policy-smyc2mrm.js} +5 -5
  5. package/dist/cli/{curator-zssndq5x.js → curator-59hzdxrv.js} +30 -30
  6. package/dist/cli/{curator-llm-factory-q5p4578g.js → curator-llm-factory-g794pv51.js} +30 -30
  7. package/dist/cli/{evidence-summary-service-dqcpapj8.js → evidence-summary-service-41m0cna6.js} +13 -13
  8. package/dist/cli/{gate-evidence-bkdqryqg.js → gate-evidence-7aywx7qa.js} +8 -8
  9. package/dist/cli/{guardrail-explain-kspf83x5.js → guardrail-explain-j88dhm6w.js} +31 -31
  10. package/dist/cli/{guardrail-log-qg4sq6gr.js → guardrail-log-xcb3ke8s.js} +4 -4
  11. package/dist/cli/{hive-promoter-3h7dhnek.js → hive-promoter-nnnx5692.js} +30 -30
  12. package/dist/cli/{index-0pcq32y2.js → index-17e73wac.js} +1 -1
  13. package/dist/cli/{index-4e5a28h7.js → index-19v4tccw.js} +2 -2
  14. package/dist/cli/{index-fp464as8.js → index-2qrd8mfa.js} +1 -1
  15. package/dist/cli/{index-wk54ey3h.js → index-34tawmyx.js} +1 -1
  16. package/dist/cli/{index-s6cwsnrw.js → index-41t3hgaa.js} +10 -10
  17. package/dist/cli/{index-zfhe7vbb.js → index-7axx11dt.js} +1 -1
  18. package/dist/cli/{index-h4hasck4.js → index-8ef23wex.js} +4 -4
  19. package/dist/cli/{index-4zwjc9sb.js → index-90w06fqr.js} +100 -3
  20. package/dist/cli/{index-kp87kr1a.js → index-b7ntt9cw.js} +3 -3
  21. package/dist/cli/{index-6ezbzd5e.js → index-bst6epnr.js} +298 -160
  22. package/dist/cli/{index-apjdytwx.js → index-cqfp05jb.js} +3 -3
  23. package/dist/cli/{index-zz5qsjd1.js → index-dppzthm9.js} +64 -36
  24. package/dist/cli/{index-s72naw1j.js → index-dzan8czb.js} +1 -1
  25. package/dist/cli/{index-e00wbqw5.js → index-evpgszmp.js} +2 -2
  26. package/dist/cli/{index-c13ttmak.js → index-ff66fbjt.js} +10 -10
  27. package/dist/cli/{index-jy9bwa9k.js → index-fwnhh6s7.js} +2 -2
  28. package/dist/cli/{index-77ef8gye.js → index-gey2257h.js} +1 -1
  29. package/dist/cli/{index-pa86tpgt.js → index-gf03198s.js} +1 -1
  30. package/dist/cli/{index-v64kjqvg.js → index-kxzgnz2h.js} +17 -17
  31. package/dist/cli/{index-6q3agdmr.js → index-mpf01swm.js} +1 -1
  32. package/dist/cli/{index-mkks7jwg.js → index-mrkgxfeh.js} +3 -3
  33. package/dist/cli/{index-7g276m9m.js → index-neh8azwc.js} +2 -2
  34. package/dist/cli/{index-qfawexc8.js → index-qpke2x5h.js} +6 -6
  35. package/dist/cli/{index-ffdwj1an.js → index-rtkttser.js} +1 -1
  36. package/dist/cli/{index-b3xret0a.js → index-sfemjcb8.js} +5 -5
  37. package/dist/cli/{index-k6pdsct6.js → index-tm0bezd9.js} +1 -1
  38. package/dist/cli/{index-0jr9zn34.js → index-tw8ck794.js} +1 -1
  39. package/dist/cli/{index-hfzcztv6.js → index-xz4x17z0.js} +32 -32
  40. package/dist/cli/{index-2dnqazyr.js → index-ymyke19q.js} +1 -1
  41. package/dist/cli/{index-b30x236n.js → index-z9yhhk6q.js} +96 -8
  42. package/dist/cli/{index-6hqhyb0f.js → index-zpp507z0.js} +18 -4
  43. package/dist/cli/index.js +30 -30
  44. package/dist/cli/{knowledge-escalator-w1mbaktt.js → knowledge-escalator-s6acdpwj.js} +13 -13
  45. package/dist/cli/{knowledge-events-a0dj6gy6.js → knowledge-events-jprkz49t.js} +11 -11
  46. package/dist/cli/{knowledge-link-mzdjvjsd.js → knowledge-link-zvtmj756.js} +4 -4
  47. package/dist/cli/{knowledge-store-8kk3rghx.js → knowledge-store-mc4awds4.js} +5 -5
  48. package/dist/cli/{knowledge-validator-91ym56e0.js → knowledge-validator-pe4ncrvj.js} +7 -7
  49. package/dist/cli/model-preflight-77dwxfv5.js +170 -0
  50. package/dist/cli/{pending-delegations-6vsrmw5w.js → pending-delegations-epzht3d7.js} +3 -3
  51. package/dist/cli/{pr-subscriptions-zc3skxde.js → pr-subscriptions-2ahy8g87.js} +3 -3
  52. package/dist/cli/{runner-jj32v8bk.js → runner-ra9pjhp2.js} +5 -5
  53. package/dist/cli/{scan-cursor-12jxwd14.js → scan-cursor-hdzhqwzj.js} +6 -6
  54. package/dist/cli/{schema-nq9tcz87.js → schema-pg85z06v.js} +1 -1
  55. package/dist/cli/{scope-persistence-dv6z7n08.js → scope-persistence-v8we8ja7.js} +9 -6
  56. package/dist/cli/{skill-generator-drscnzq9.js → skill-generator-ctskfct2.js} +15 -15
  57. package/dist/cli/{telemetry-z54dgdrh.js → telemetry-c21dgffc.js} +1 -1
  58. package/dist/cli/{workspace-snapshot-q21mgbsh.js → workspace-snapshot-kznz5e13.js} +4 -2
  59. package/dist/cli/{worktree-collision-ownership-rfyyjjct.js → worktree-collision-ownership-f7se4wbf.js} +8 -8
  60. package/dist/cli/{worktree-isolation-4tehtym5.js → worktree-isolation-j4qb7mgb.js} +32 -30
  61. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +4 -0
  62. package/dist/index.js +307 -293
  63. package/dist/observability/catalog.d.ts +2 -2
  64. package/dist/scope/scope-binding.d.ts +16 -0
  65. package/dist/services/model-preflight.d.ts +151 -0
  66. package/dist/services/session-reflection.d.ts +24 -0
  67. package/dist/telemetry.d.ts +12 -1
  68. package/dist/tools/placeholder-scan.d.ts +64 -0
  69. package/dist/tools/sast-scan.d.ts +6 -0
  70. package/package.json +1 -1
  71. package/dist/cli/{curator-drift-yn5d0mvq.js → curator-drift-r50x1rac.js} +1 -1
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  authorizeCuration
4
- } from "./index-fp464as8.js";
4
+ } from "./index-2qrd8mfa.js";
5
5
  import {
6
6
  findNearDuplicate,
7
7
  inferTags,
@@ -9,13 +9,13 @@ import {
9
9
  resolveSwarmKnowledgePath,
10
10
  resolveSwarmRejectedPath,
11
11
  transactKnowledge
12
- } from "./index-qfawexc8.js";
12
+ } from "./index-qpke2x5h.js";
13
13
  import {
14
14
  resolveKnowledgeStoreDir
15
- } from "./index-s72naw1j.js";
15
+ } from "./index-dzan8czb.js";
16
16
  import {
17
17
  atomicWriteFile
18
- } from "./index-6q3agdmr.js";
18
+ } from "./index-mpf01swm.js";
19
19
  import {
20
20
  require_proper_lockfile
21
21
  } from "./index-7g4c7s5r.js";
@@ -2,20 +2,23 @@
2
2
  import {
3
3
  computePlanStructureHash,
4
4
  derivePlanId
5
- } from "./index-apjdytwx.js";
5
+ } from "./index-cqfp05jb.js";
6
6
  import {
7
7
  unsafePathTextReason
8
8
  } from "./index-556ja8an.js";
9
9
  import {
10
10
  PlanSchema
11
- } from "./index-0pcq32y2.js";
11
+ } from "./index-17e73wac.js";
12
+ import {
13
+ validateSwarmPath
14
+ } from "./index-w8pgjr75.js";
12
15
  import {
13
16
  atomicWriteSwarmFile,
14
17
  atomicWriteSwarmFileSync
15
18
  } from "./index-4evasm2b.js";
16
19
  import {
17
20
  assertProjectRoot
18
- } from "./index-pa86tpgt.js";
21
+ } from "./index-gf03198s.js";
19
22
  import {
20
23
  require_proper_lockfile
21
24
  } from "./index-7g4c7s5r.js";
@@ -195,6 +198,16 @@ function hasScopeBindingDenyOverlay(binding) {
195
198
  const tombstone = scopeBindingTombstones.get(binding.generationId);
196
199
  return Boolean(tombstone && tombstone.bindingId === binding.bindingId && tombstone.revision >= binding.revision && tombstone.lifecycleState !== "live");
197
200
  }
201
+ function hasDeliberateScopeBindingDenyOverlay(binding) {
202
+ const tombstone = scopeBindingTombstones.get(binding.generationId);
203
+ return Boolean(tombstone && tombstone.bindingId === binding.bindingId && tombstone.revision >= binding.revision && tombstone.lifecycleState !== "live" && tombstone.lifecycleState !== "expired");
204
+ }
205
+ function clearSweepTombstoneForRevival(binding) {
206
+ const tombstone = scopeBindingTombstones.get(binding.generationId);
207
+ if (tombstone && tombstone.bindingId === binding.bindingId && tombstone.lifecycleState === "expired" && tombstone.revision <= binding.revision) {
208
+ scopeBindingTombstones.delete(binding.generationId);
209
+ }
210
+ }
198
211
  function installFailedRevocationOverlay(binding, reason) {
199
212
  const current = pendingScopeBindings.get(binding.generationId);
200
213
  if (!current || current.bindingId !== binding.bindingId || current.revision !== binding.revision)
@@ -1428,6 +1441,82 @@ function readCurrentPlan(directory) {
1428
1441
  return null;
1429
1442
  }
1430
1443
  }
1444
+ var SCOPE_BINDING_AUTO_REVIVE_WINDOW_MS = 24 * 60 * 60 * 1000;
1445
+ function appendScopeBindingRevivalEvent(workspace, revived) {
1446
+ try {
1447
+ const eventsPath = validateSwarmPath(workspace, "events.jsonl");
1448
+ fs2.mkdirSync(path2.dirname(eventsPath), { recursive: true });
1449
+ fs2.appendFileSync(eventsPath, `${JSON.stringify({
1450
+ type: "scope_binding_auto_recovered",
1451
+ timestamp: new Date().toISOString(),
1452
+ taskId: revived.taskId,
1453
+ sessionId: revived.ownerSessionId,
1454
+ generationId: revived.generationId,
1455
+ revision: revived.revision,
1456
+ expiresAt: new Date(revived.expiresAt).toISOString()
1457
+ })}
1458
+ `, "utf-8");
1459
+ } catch {}
1460
+ }
1461
+ function attemptIdleScopeBindingRevival(directory, resolution) {
1462
+ if (resolution.status !== "expired")
1463
+ return null;
1464
+ if (resolution.totalCandidates !== 1 || resolution.candidates.length !== 1)
1465
+ return null;
1466
+ const candidate = resolution.candidates[0];
1467
+ if (!candidate)
1468
+ return null;
1469
+ const now = Date.now();
1470
+ if (candidate.lifecycleState !== "live")
1471
+ return null;
1472
+ if (candidate.expiresAt > now)
1473
+ return null;
1474
+ if (now - candidate.expiresAt > SCOPE_BINDING_AUTO_REVIVE_WINDOW_MS)
1475
+ return null;
1476
+ if (hasDeliberateScopeBindingDenyOverlay(candidate))
1477
+ return null;
1478
+ let release;
1479
+ try {
1480
+ const resolvedWorkspace = fs2.realpathSync(directory);
1481
+ assertProjectRoot(resolvedWorkspace);
1482
+ const scopePath = getBindingFilePath(resolvedWorkspace, candidate);
1483
+ if (!isScopesDirSafe(resolvedWorkspace, getScopesDir(resolvedWorkspace)))
1484
+ return null;
1485
+ const lockPath = getGenerationLockPath(scopePath);
1486
+ if (!ensureLockTargetSync(lockPath))
1487
+ return null;
1488
+ release = lockSyncWithBoundedRetry(lockPath);
1489
+ const raw = readBoundedFile(scopePath);
1490
+ if (!raw)
1491
+ return null;
1492
+ const current = validateScopeBindingPayload(resolvedWorkspace, JSON.parse(raw));
1493
+ if (!current || current.bindingId !== candidate.bindingId || current.generationId !== candidate.generationId || current.revision !== candidate.revision || current.lifecycleState !== "live" || current.expiresAt > Date.now() || Date.now() - current.expiresAt > SCOPE_BINDING_AUTO_REVIVE_WINDOW_MS)
1494
+ return null;
1495
+ const revivedAt = Date.now();
1496
+ const revived = {
1497
+ ...current,
1498
+ revision: current.revision + 1,
1499
+ updatedAt: revivedAt,
1500
+ leaseStartedAt: revivedAt,
1501
+ expiresAt: revivedAt + DEFAULT_SCOPE_BINDING_TTL_MS
1502
+ };
1503
+ atomicWriteSync(scopePath, JSON.stringify(revived, null, 2));
1504
+ const verifiedRaw = readBoundedFile(scopePath);
1505
+ const verified = verifiedRaw ? validateScopeBindingPayload(resolvedWorkspace, JSON.parse(verifiedRaw)) : null;
1506
+ if (!verified || verified.revision !== revived.revision || verified.lifecycleState !== "live" || verified.expiresAt !== revived.expiresAt)
1507
+ return null;
1508
+ clearSweepTombstoneForRevival(revived);
1509
+ appendScopeBindingRevivalEvent(resolvedWorkspace, revived);
1510
+ return revived;
1511
+ } catch {
1512
+ return null;
1513
+ } finally {
1514
+ if (release)
1515
+ try {
1516
+ release();
1517
+ } catch {}
1518
+ }
1519
+ }
1431
1520
  function resolveAuthorizedScopeBindingForPlan(input) {
1432
1521
  const resolution = resolveAuthorizedScopeBindingForPlanDetailed(input);
1433
1522
  return resolution.status === "found" ? resolution.binding : null;
@@ -1451,6 +1540,14 @@ function resolveAuthorizedScopeBindingForPlanDetailed(input) {
1451
1540
  const admission = registerScopeBinding(durable.binding);
1452
1541
  return admission.ok ? durable : { status: "overloaded" };
1453
1542
  }
1543
+ if (durable.status === "expired") {
1544
+ const revived = attemptIdleScopeBindingRevival(input.directory, durable);
1545
+ if (revived) {
1546
+ const admission = registerScopeBinding(revived);
1547
+ if (admission.ok)
1548
+ return { status: "found", binding: revived };
1549
+ }
1550
+ }
1454
1551
  if (durable.status !== "not_declared")
1455
1552
  return durable;
1456
1553
  return { status: "not_declared" };
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  _internals,
4
4
  resolveWorktreeIsolationConfig
5
- } from "./index-7g276m9m.js";
5
+ } from "./index-neh8azwc.js";
6
6
  import {
7
7
  ApprovalEvidenceSchema,
8
8
  BaseEvidenceSchema,
@@ -42,7 +42,7 @@ import {
42
42
  loadPluginConfig,
43
43
  loadPluginConfigWithMeta,
44
44
  loadPluginConfigWithMetaAsync
45
- } from "./index-0pcq32y2.js";
45
+ } from "./index-17e73wac.js";
46
46
  import {
47
47
  AUTO_REVIEW_V8_BURN_IN_DECISION,
48
48
  AgentOverrideConfigSchema,
@@ -64,7 +64,7 @@ import {
64
64
  TurboConfigSchema,
65
65
  WorktreeIsolationConfigSchema,
66
66
  resolveAutoReviewConfig
67
- } from "./index-zfhe7vbb.js";
67
+ } from "./index-7axx11dt.js";
68
68
  import {
69
69
  ALL_AGENT_NAMES,
70
70
  ALL_SUBAGENT_NAMES,