opencode-swarm 7.166.0 → 7.166.2

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 (107) 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/background/candidate-contract.d.ts +14 -0
  4. package/dist/background/pr-subscriptions.d.ts +33 -1
  5. package/dist/background/workspace-snapshot.d.ts +41 -0
  6. package/dist/cli/{coder-settlement-ydg2jfrk.js → coder-settlement-pv86n7n4.js} +14 -14
  7. package/dist/cli/{config-doctor-drqx6tzc.js → config-doctor-fy1aytwt.js} +5 -5
  8. package/dist/cli/{core-x6sftfwt.js → core-1d9vqbt4.js} +4 -4
  9. package/dist/cli/{curation-policy-jtzwz6bc.js → curation-policy-gnpgc3z7.js} +7 -5
  10. package/dist/cli/{curator-kg2h8jjf.js → curator-a4rbehfr.js} +40 -40
  11. package/dist/cli/{curator-drift-2vwtkegg.js → curator-drift-efmgp1v2.js} +6 -6
  12. package/dist/cli/curator-llm-factory-cwg62ynw.js +70 -0
  13. package/dist/cli/{dispatch-c7xjt7js.js → dispatch-tmb929w8.js} +3 -3
  14. package/dist/cli/{evidence-summary-service-ry5ebnmq.js → evidence-summary-service-dvp1kbm4.js} +18 -18
  15. package/dist/cli/{gate-evidence-qgeceqy8.js → gate-evidence-qf27gdfx.js} +10 -9
  16. package/dist/cli/guardrail-explain-zskpzgsr.js +71 -0
  17. package/dist/cli/guardrail-log-qhw3knjt.js +23 -0
  18. package/dist/cli/{guardrail-reset-4nmy7xas.js → guardrail-reset-84ydxdg3.js} +40 -40
  19. package/dist/cli/hive-promoter-y2daybf6.js +85 -0
  20. package/dist/cli/{index-mg43w8p2.js → index-0a0jsbhg.js} +16 -7
  21. package/dist/cli/{index-a0d4fp6r.js → index-0tc0pcmh.js} +1 -1
  22. package/dist/cli/{index-a7rw4g4s.js → index-14z9en94.js} +3 -3
  23. package/dist/cli/{index-gy0nyfbw.js → index-19hjpqsy.js} +61 -16
  24. package/dist/cli/{index-fywshabz.js → index-22sannyk.js} +7 -7
  25. package/dist/cli/{index-p04pa9c9.js → index-2n1v8ft1.js} +2 -2
  26. package/dist/cli/{index-jc9cxh90.js → index-3nww2vnx.js} +11 -11
  27. package/dist/cli/{index-9hy5q7gp.js → index-3wtfrjcx.js} +4 -4
  28. package/dist/cli/{index-anxs69ad.js → index-4kwxpnf8.js} +13 -6
  29. package/dist/cli/{index-8m12y79g.js → index-7mxrqy4r.js} +7 -7
  30. package/dist/cli/{index-jx9f4ke1.js → index-7pp8fz4j.js} +1 -1
  31. package/dist/cli/{index-a5w71m8f.js → index-8nv3bc9h.js} +4 -4
  32. package/dist/cli/{index-30f4fe30.js → index-9ccxcjdm.js} +4 -4
  33. package/dist/cli/{index-hwj25q9r.js → index-bks56jbg.js} +70 -53
  34. package/dist/cli/{index-8hqkrd2j.js → index-bysyj3z4.js} +1 -1
  35. package/dist/cli/{index-8n62bphd.js → index-c0eyq4rp.js} +4 -4
  36. package/dist/cli/{index-c20gf089.js → index-c23w8t46.js} +1 -1
  37. package/dist/cli/{index-8d90gzaz.js → index-d5qf7hvh.js} +3 -3
  38. package/dist/cli/{index-nb924ar6.js → index-e0bjbadr.js} +2 -2
  39. package/dist/cli/{index-z6xqpmqg.js → index-ee6ydtfe.js} +1 -1
  40. package/dist/cli/{index-axf65x87.js → index-fkk7x6sy.js} +5 -5
  41. package/dist/cli/{index-17yszqs5.js → index-ft1tnx0e.js} +1 -1
  42. package/dist/cli/{index-an89qzd9.js → index-gy55mc55.js} +749 -755
  43. package/dist/cli/{index-2dvk153d.js → index-hbjax6hy.js} +17 -17
  44. package/dist/cli/{index-2v17wb75.js → index-hgphhnrp.js} +2 -2
  45. package/dist/cli/{index-hvk3zs62.js → index-j81kpway.js} +1 -1
  46. package/dist/cli/{index-hrkamw9q.js → index-jgtje76m.js} +7 -7
  47. package/dist/cli/{index-czr3jcg6.js → index-jr6tppv9.js} +47 -13
  48. package/dist/cli/{index-apxaa755.js → index-kd68b6mg.js} +3 -3
  49. package/dist/cli/{index-289epdpc.js → index-nrdj94za.js} +42 -42
  50. package/dist/cli/{index-79sr3fd1.js → index-nthqfxzz.js} +2 -2
  51. package/dist/cli/{index-6chhqq2n.js → index-p0r5fn7y.js} +94 -3
  52. package/dist/cli/{index-2rm5x9ps.js → index-qmp4gxac.js} +2 -2
  53. package/dist/cli/{index-rkn17q5e.js → index-st47knj6.js} +5 -5
  54. package/dist/cli/{index-edm41q4j.js → index-sxe3t040.js} +2 -2
  55. package/dist/cli/{index-52jfm5s0.js → index-sxsyd7kf.js} +9 -9
  56. package/dist/cli/{index-359djbj1.js → index-ty0wg9yp.js} +5 -5
  57. package/dist/cli/{index-qkq56zyr.js → index-wz258yje.js} +69 -18
  58. package/dist/cli/{index-bw7r2b2m.js → index-x4azb6qj.js} +2 -2
  59. package/dist/cli/{index-8bdk7124.js → index-x8cvbkjs.js} +2 -2
  60. package/dist/cli/{index-aftapk6j.js → index-y3dtdn2f.js} +3 -3
  61. package/dist/cli/{index-4mpdy32j.js → index-ytsts0zj.js} +1 -1
  62. package/dist/cli/{index-ejf6w8vw.js → index-z1kmkh72.js} +2 -2
  63. package/dist/cli/index-zpsr8rpc.js +68 -0
  64. package/dist/cli/index.js +40 -40
  65. package/dist/cli/{knowledge-escalator-xdzmr31d.js → knowledge-escalator-aq7gzhpd.js} +15 -15
  66. package/dist/cli/{knowledge-events-1t1t0bv7.js → knowledge-events-9z5sskyv.js} +13 -13
  67. package/dist/cli/{knowledge-link-1zykfk1p.js → knowledge-link-ps2v4s18.js} +6 -4
  68. package/dist/cli/{knowledge-store-m2snb0xg.js → knowledge-store-1hzt2a0t.js} +7 -5
  69. package/dist/cli/{knowledge-validator-tf7yq2pd.js → knowledge-validator-xe1fza7c.js} +9 -7
  70. package/dist/cli/{model-preflight-3s1c0zpc.js → model-preflight-b3b5pgsc.js} +2 -2
  71. package/dist/cli/{pending-delegations-jr8hwxrz.js → pending-delegations-0nfjg7vp.js} +13 -13
  72. package/dist/cli/{pr-subscriptions-ca1xmf9r.js → pr-subscriptions-8974hwa0.js} +19 -13
  73. package/dist/cli/{pr-workflow-gate-fb1dj0zx.js → pr-workflow-gate-xgak5wvz.js} +40 -40
  74. package/dist/cli/{runner-j3acybhs.js → runner-7zqbp81n.js} +8 -5
  75. package/dist/cli/{scan-cursor-3gdvy0ym.js → scan-cursor-hc4v0c90.js} +8 -6
  76. package/dist/cli/{schema-mzb1354k.js → schema-w1hsvw1h.js} +3 -3
  77. package/dist/cli/{scope-persistence-c4n21b5n.js → scope-persistence-k17003v4.js} +17 -16
  78. package/dist/cli/{skill-generator-dvpvwt8k.js → skill-generator-tbxgpc9x.js} +17 -17
  79. package/dist/cli/{snapshot-coordination-init-g7v63zcm.js → snapshot-coordination-init-vaf34wf0.js} +40 -40
  80. package/dist/cli/{telemetry-9h1z2w9d.js → telemetry-8qn4eag5.js} +5 -1
  81. package/dist/cli/{workspace-snapshot-6z9rk7xw.js → workspace-snapshot-y85jy6gs.js} +11 -1
  82. package/dist/cli/{worktree-collision-ownership-k15qrpy9.js → worktree-collision-ownership-r3jdke7h.js} +14 -14
  83. package/dist/cli/{worktree-isolation-y7ec1pm5.js → worktree-isolation-sa1tbqff.js} +40 -40
  84. package/dist/evidence/phase-participation.d.ts +1 -1
  85. package/dist/git/pr.d.ts +4 -2
  86. package/dist/git/safe-ref.d.ts +51 -0
  87. package/dist/hooks/guardrails/execution-stall.d.ts +10 -5
  88. package/dist/hooks/hive-promoter.d.ts +28 -5
  89. package/dist/hooks/repo-graph-builder.d.ts +14 -0
  90. package/dist/hooks/system-enhancer.d.ts +21 -0
  91. package/dist/index.js +250 -248
  92. package/dist/observability/catalog.d.ts +1 -1
  93. package/dist/session/snapshot-writer.d.ts +42 -0
  94. package/dist/telemetry.d.ts +31 -1
  95. package/dist/tools/co-change-analyzer.d.ts +7 -0
  96. package/dist/tools/gh-evidence.d.ts +15 -8
  97. package/dist/tools/pkg-audit.d.ts +23 -0
  98. package/dist/utils/atomic-write.d.ts +32 -0
  99. package/dist/utils/gh-executable.d.ts +106 -0
  100. package/dist/utils/merge.d.ts +26 -0
  101. package/dist/utils/swarm-artifact-cache.d.ts +6 -0
  102. package/package.json +1 -1
  103. package/dist/cli/curator-llm-factory-7znajprp.js +0 -70
  104. package/dist/cli/guardrail-explain-jdv4n2j3.js +0 -71
  105. package/dist/cli/guardrail-log-s7c3rpde.js +0 -23
  106. package/dist/cli/hive-promoter-w5tsgttc.js +0 -85
  107. package/dist/cli/index-zjygnfay.js +0 -33
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-anxs69ad.js";
4
+ } from "./index-4kwxpnf8.js";
5
5
  import {
6
6
  bunWrite
7
7
  } from "./index-p612v1mv.js";
@@ -18,22 +18,22 @@ import {
18
18
  releaseCoordinationLease,
19
19
  transitionCoordinationState,
20
20
  withCoordinationTransaction
21
- } from "./index-jx9f4ke1.js";
21
+ } from "./index-7pp8fz4j.js";
22
22
  import {
23
23
  getProjectDb,
24
24
  projectDbExists
25
- } from "./index-aftapk6j.js";
25
+ } from "./index-y3dtdn2f.js";
26
26
  import {
27
27
  observeDelegationLedgerPressure
28
- } from "./index-axf65x87.js";
28
+ } from "./index-fkk7x6sy.js";
29
+ import {
30
+ EvidenceLockTimeoutError,
31
+ withEvidenceLock
32
+ } from "./index-sxe3t040.js";
29
33
  import {
30
34
  canonicalRootKeyFresh,
31
35
  sameProjectRoot
32
36
  } from "./index-7qefgq4j.js";
33
- import {
34
- EvidenceLockTimeoutError,
35
- withEvidenceLock
36
- } from "./index-edm41q4j.js";
37
37
  import {
38
38
  exports_external,
39
39
  init_zod
@@ -4524,7 +4524,7 @@ async function reconcileLegacyCoderSettlements(directory, maxRecords, onReconcil
4524
4524
  const candidates = readDelegations(directory).filter((record) => record.normalizedAgent === "coder" && Boolean(record.legacyCoderSettlementTransfer) && Boolean(record.terminalResult)).slice(0, maxRecords);
4525
4525
  if (candidates.length === 0)
4526
4526
  return 0;
4527
- const { transferCoderSettlementToBackground } = await import("./coder-settlement-ydg2jfrk.js");
4527
+ const { transferCoderSettlementToBackground } = await import("./coder-settlement-pv86n7n4.js");
4528
4528
  let transferred = 0;
4529
4529
  for (const record of candidates) {
4530
4530
  try {
@@ -3,7 +3,7 @@ import {
3
3
  queryHistoricalOutcomes,
4
4
  readKnowledgeEvents,
5
5
  recordKnowledgeEvent
6
- } from "./index-jc9cxh90.js";
6
+ } from "./index-3nww2vnx.js";
7
7
  import {
8
8
  jaccardBigram,
9
9
  readKnowledge,
@@ -11,7 +11,7 @@ import {
11
11
  resolveSwarmKnowledgePath,
12
12
  transactKnowledge,
13
13
  wordBigrams
14
- } from "./index-fywshabz.js";
14
+ } from "./index-22sannyk.js";
15
15
  import {
16
16
  init_knowledge_types,
17
17
  isActiveStatus
@@ -224,11 +224,11 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
224
224
  alreadyInactive: true
225
225
  };
226
226
  }
227
- const { quarantineEntry } = await import("./knowledge-validator-tf7yq2pd.js");
227
+ const { quarantineEntry } = await import("./knowledge-validator-xe1fza7c.js");
228
228
  let policyConfig;
229
229
  try {
230
- const { KnowledgeConfigSchema } = await import("./schema-mzb1354k.js");
231
- const { loadPluginConfigWithMeta } = await import("./index-rkn17q5e.js");
230
+ const { KnowledgeConfigSchema } = await import("./schema-w1hsvw1h.js");
231
+ const { loadPluginConfigWithMeta } = await import("./index-st47knj6.js");
232
232
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
233
233
  policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
234
234
  } catch {
@@ -3,7 +3,7 @@ import {
3
3
  EvaluationRunV1Schema,
4
4
  GateAuditResultV1Schema,
5
5
  getProtectedEvaluationRunIds
6
- } from "./index-17yszqs5.js";
6
+ } from "./index-ft1tnx0e.js";
7
7
  import {
8
8
  validateWorkspaceRoot
9
9
  } from "./index-cw912re7.js";
@@ -23,13 +23,13 @@ import {
23
23
  readTaskEvidence,
24
24
  readTaskEvidenceRaw,
25
25
  sanitizeTaskId
26
- } from "./index-8n62bphd.js";
26
+ } from "./index-c0eyq4rp.js";
27
27
  import {
28
28
  estimateCharsForTokens,
29
29
  estimateTokens,
30
30
  readSwarmFileAsync,
31
31
  validateSwarmPath
32
- } from "./index-anxs69ad.js";
32
+ } from "./index-4kwxpnf8.js";
33
33
  import {
34
34
  bunHash,
35
35
  bunWrite,
@@ -57,10 +57,10 @@ import {
57
57
  replayFromLedgerWithStatus,
58
58
  takeSnapshotEvent,
59
59
  takeSnapshotWithRetry
60
- } from "./index-30f4fe30.js";
60
+ } from "./index-9ccxcjdm.js";
61
61
  import {
62
62
  appendCoreEventSync
63
- } from "./index-2v17wb75.js";
63
+ } from "./index-hgphhnrp.js";
64
64
  import {
65
65
  derivePlanId,
66
66
  derivePlanIdentityHash,
@@ -68,32 +68,32 @@ import {
68
68
  importCoordinationOnce,
69
69
  listCoordinationStates,
70
70
  transitionCoordinationState
71
- } from "./index-jx9f4ke1.js";
71
+ } from "./index-7pp8fz4j.js";
72
72
  import {
73
73
  DURABILITY_CLASSES,
74
74
  getProjectDb,
75
75
  projectDbExists,
76
76
  withDurabilityClass
77
- } from "./index-aftapk6j.js";
78
- import {
79
- canonicalRootKeyFresh
80
- } from "./index-7qefgq4j.js";
77
+ } from "./index-y3dtdn2f.js";
81
78
  import {
82
79
  assertProjectRoot,
83
80
  tryAcquireLock,
84
81
  withEvidenceLock
85
- } from "./index-edm41q4j.js";
82
+ } from "./index-sxe3t040.js";
86
83
  import {
87
84
  atomicWriteSwarmFileSync,
88
85
  invalidateCachedArtifact,
89
86
  readCachedParsedFile
90
- } from "./index-gy0nyfbw.js";
87
+ } from "./index-19hjpqsy.js";
91
88
  import {
92
89
  emit
93
- } from "./index-hwj25q9r.js";
90
+ } from "./index-bks56jbg.js";
91
+ import {
92
+ canonicalRootKeyFresh
93
+ } from "./index-7qefgq4j.js";
94
94
  import {
95
95
  PlanSchema
96
- } from "./index-mg43w8p2.js";
96
+ } from "./index-0a0jsbhg.js";
97
97
  import {
98
98
  GIT_BINARY_ENV_VAR,
99
99
  describeGitResolution,
@@ -316,6 +316,33 @@ function transientBackoff(attempt) {
316
316
  }
317
317
  }
318
318
 
319
+ // src/git/safe-ref.ts
320
+ class UnsafeGitRefError extends Error {
321
+ ref;
322
+ context;
323
+ constructor(ref, context) {
324
+ super(`Refused unsafe git ref "${ref}" at ${context}: a ref argument ` + 'starting with "-" can be parsed by git as an option (issue #2265/#2476)');
325
+ this.ref = ref;
326
+ this.context = context;
327
+ this.name = "UnsafeGitRefError";
328
+ }
329
+ }
330
+ function isSafeGitRefArg(value) {
331
+ if (value.length === 0)
332
+ return false;
333
+ for (const side of value.split("..")) {
334
+ if (side.startsWith("-"))
335
+ return false;
336
+ }
337
+ return true;
338
+ }
339
+ function assertSafeGitRefArg(value, context) {
340
+ if (!isSafeGitRefArg(value)) {
341
+ throw new UnsafeGitRefError(value, context);
342
+ }
343
+ return value;
344
+ }
345
+
319
346
  // src/git/branch.ts
320
347
  var GIT_TIMEOUT_MS = 30000;
321
348
  var GIT_MAX_BUFFER_BYTES = 5 * 1024 * 1024;
@@ -519,6 +546,8 @@ async function resetToRemoteBranch(cwd, options) {
519
546
  warnings: []
520
547
  };
521
548
  }
549
+ assertSafeGitRefArg(currentBranch, "resetToRemoteBranch currentBranch");
550
+ assertSafeGitRefArg(defaultRemoteBranch, "resetToRemoteBranch defaultRemoteBranch");
522
551
  const targetBranch = `origin/${defaultRemoteBranch}`;
523
552
  if (currentBranch === "HEAD") {
524
553
  return {
@@ -631,7 +660,12 @@ async function resetToRemoteBranch(cwd, options) {
631
660
  continue;
632
661
  }
633
662
  try {
634
- gitExec(["branch", "-d", trimmedLine], cwd);
663
+ gitExec([
664
+ "branch",
665
+ "-d",
666
+ "--",
667
+ assertSafeGitRefArg(trimmedLine, "resetToRemoteBranch prune merged branch")
668
+ ], cwd);
635
669
  prunedBranches.push(trimmedLine);
636
670
  } catch {
637
671
  warnings.push(`Could not safely delete branch: ${trimmedLine}`);
@@ -653,7 +687,12 @@ async function resetToRemoteBranch(cwd, options) {
653
687
  const parts = trimmedLine.split(/\s+/);
654
688
  const branchName = parts[0];
655
689
  try {
656
- gitExec(["branch", "-d", branchName], cwd);
690
+ gitExec([
691
+ "branch",
692
+ "-d",
693
+ "--",
694
+ assertSafeGitRefArg(branchName, "resetToRemoteBranch prune gone branch")
695
+ ], cwd);
657
696
  prunedBranches.push(branchName);
658
697
  } catch {
659
698
  warnings.push(`Could not delete gone branch: ${branchName}`);
@@ -702,6 +741,8 @@ async function resetToMainAfterMerge(cwd, options) {
702
741
  };
703
742
  }
704
743
  const currentBranch = getCurrentBranch(cwd);
744
+ assertSafeGitRefArg(currentBranch, "resetToMainAfterMerge currentBranch");
745
+ assertSafeGitRefArg(defaultBranch, "resetToMainAfterMerge defaultBranch");
705
746
  const targetBranch = `origin/${defaultBranch}`;
706
747
  if (currentBranch === "HEAD") {
707
748
  return {
@@ -834,7 +875,12 @@ async function resetToMainAfterMerge(cwd, options) {
834
875
  const isMerged = mergedOutput.split(`
835
876
  `).some((line) => line.trim() === previousBranch || line.trim() === `* ${previousBranch}`);
836
877
  if (isMerged) {
837
- _internals.gitExec(["branch", "-d", previousBranch], cwd);
878
+ _internals.gitExec([
879
+ "branch",
880
+ "-d",
881
+ "--",
882
+ assertSafeGitRefArg(previousBranch, "resetToMainAfterMerge previousBranch")
883
+ ], cwd);
838
884
  branchDeleted = true;
839
885
  } else {
840
886
  warnings.push(`Branch ${previousBranch} is not merged into ${defaultBranch} \u2014 keeping it`);
@@ -854,7 +900,12 @@ async function resetToMainAfterMerge(cwd, options) {
854
900
  continue;
855
901
  }
856
902
  try {
857
- _internals.gitExec(["branch", "-d", trimmedLine], cwd);
903
+ _internals.gitExec([
904
+ "branch",
905
+ "-d",
906
+ "--",
907
+ assertSafeGitRefArg(trimmedLine, "resetToMainAfterMerge prune branch")
908
+ ], cwd);
858
909
  } catch {
859
910
  warnings.push(`Could not prune branch: ${trimmedLine}`);
860
911
  }
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  readKnowledge,
4
4
  transactKnowledge
5
- } from "./index-fywshabz.js";
5
+ } from "./index-22sannyk.js";
6
6
  import {
7
7
  resolveKnowledgeStoreDir
8
- } from "./index-a7rw4g4s.js";
8
+ } from "./index-14z9en94.js";
9
9
  import {
10
10
  init_git_executable,
11
11
  resolveGitExecutableAsync
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  validateSwarmPath
4
- } from "./index-anxs69ad.js";
4
+ } from "./index-4kwxpnf8.js";
5
5
  import {
6
6
  atomicWriteSwarmFileSync
7
- } from "./index-gy0nyfbw.js";
7
+ } from "./index-19hjpqsy.js";
8
8
 
9
9
  // src/hooks/delegation-gate/worktree-provisioning-owner.ts
10
10
  import { createHash } from "crypto";
@@ -5,13 +5,13 @@ import {
5
5
  import {
6
6
  loadDatabaseCtor
7
7
  } from "./index-n4fzmqz8.js";
8
+ import {
9
+ atomicWriteSwarmFileSync
10
+ } from "./index-19hjpqsy.js";
8
11
  import {
9
12
  canonicalRootKeyFresh,
10
13
  lexicalRootAliasKey
11
14
  } from "./index-7qefgq4j.js";
12
- import {
13
- atomicWriteSwarmFileSync
14
- } from "./index-gy0nyfbw.js";
15
15
 
16
16
  // src/db/project-db.ts
17
17
  import { existsSync, mkdirSync, unlinkSync } from "fs";
@@ -4,7 +4,7 @@ import {
4
4
  readShellAuditTail,
5
5
  redactPath,
6
6
  redactShellCommand
7
- } from "./index-9hy5q7gp.js";
7
+ } from "./index-3wtfrjcx.js";
8
8
 
9
9
  // src/services/guardrail-log-service.ts
10
10
  var BLOCK_TYPES = new Set([
@@ -14,14 +14,14 @@ import {
14
14
  detectWindowsWrites,
15
15
  getSharedClassifierGuardrailBlock,
16
16
  resolveWriteTargets
17
- } from "./index-an89qzd9.js";
17
+ } from "./index-gy55mc55.js";
18
18
  import {
19
19
  checkFileAuthority,
20
20
  classifyFile,
21
21
  isInDeclaredScope,
22
22
  redactPath,
23
23
  redactShellCommand
24
- } from "./index-9hy5q7gp.js";
24
+ } from "./index-3wtfrjcx.js";
25
25
 
26
26
  // src/services/guardrail-explain-service.ts
27
27
  import path from "path";
@@ -0,0 +1,68 @@
1
+ // @bun
2
+ import {
3
+ __esm
4
+ } from "./index-a76rekgs.js";
5
+
6
+ // src/utils/merge.ts
7
+ function scanOverrideForDangerousKeys(value, path, depth) {
8
+ if (depth >= MAX_MERGE_DEPTH)
9
+ return;
10
+ if (Array.isArray(value)) {
11
+ for (let i = 0;i < value.length; i++) {
12
+ scanOverrideForDangerousKeys(value[i], `${path}[${i}]`, depth + 1);
13
+ }
14
+ return;
15
+ }
16
+ if (typeof value !== "object" || value === null)
17
+ return;
18
+ for (const key of Object.keys(value)) {
19
+ if (DANGEROUS_MERGE_KEYS.has(key)) {
20
+ throw new DangerousMergeKeyError(key, path);
21
+ }
22
+ scanOverrideForDangerousKeys(value[key], `${path}.${key}`, depth + 1);
23
+ }
24
+ }
25
+ function deepMergeInternal(base, override, depth, path) {
26
+ if (depth >= MAX_MERGE_DEPTH) {
27
+ throw new Error(`deepMerge exceeded maximum depth of ${MAX_MERGE_DEPTH}`);
28
+ }
29
+ const result = { ...base };
30
+ for (const key of Object.keys(override)) {
31
+ const baseVal = base[key];
32
+ const overrideVal = override[key];
33
+ if (typeof baseVal === "object" && baseVal !== null && typeof overrideVal === "object" && overrideVal !== null && !Array.isArray(baseVal) && !Array.isArray(overrideVal)) {
34
+ result[key] = deepMergeInternal(baseVal, overrideVal, depth + 1, `${path}.${key}`);
35
+ } else {
36
+ result[key] = overrideVal;
37
+ }
38
+ }
39
+ return result;
40
+ }
41
+ function deepMerge(base, override) {
42
+ if (!base)
43
+ return override;
44
+ if (!override)
45
+ return base;
46
+ scanOverrideForDangerousKeys(override, "$", 0);
47
+ return deepMergeInternal(base, override, 0, "$");
48
+ }
49
+ var MAX_MERGE_DEPTH = 10, DANGEROUS_MERGE_KEYS, DangerousMergeKeyError;
50
+ var init_merge = __esm(() => {
51
+ DANGEROUS_MERGE_KEYS = new Set([
52
+ "__proto__",
53
+ "constructor",
54
+ "prototype"
55
+ ]);
56
+ DangerousMergeKeyError = class DangerousMergeKeyError extends Error {
57
+ key;
58
+ path;
59
+ constructor(key, path) {
60
+ super(`deepMerge refused dangerous key "${key}" at "${path}": ` + "prototype-pollution carriers (__proto__/constructor/prototype) are never merged");
61
+ this.key = key;
62
+ this.path = path;
63
+ this.name = "DangerousMergeKeyError";
64
+ }
65
+ };
66
+ });
67
+
68
+ export { MAX_MERGE_DEPTH, DangerousMergeKeyError, deepMerge, init_merge };
package/dist/cli/index.js CHANGED
@@ -13,72 +13,72 @@ import {
13
13
  readCachePackageVersion,
14
14
  resolveCommand,
15
15
  safeRealpathSync
16
- } from "./index-an89qzd9.js";
17
- import"./index-8d90gzaz.js";
18
- import"./index-hvk3zs62.js";
19
- import"./index-9hy5q7gp.js";
20
- import"./index-p04pa9c9.js";
21
- import"./index-qkq56zyr.js";
22
- import"./index-17yszqs5.js";
16
+ } from "./index-gy55mc55.js";
17
+ import"./index-d5qf7hvh.js";
18
+ import"./index-j81kpway.js";
19
+ import"./index-3wtfrjcx.js";
20
+ import"./index-2n1v8ft1.js";
21
+ import"./index-wz258yje.js";
22
+ import"./index-ft1tnx0e.js";
23
23
  import"./index-txdagbh7.js";
24
24
  import"./index-cw912re7.js";
25
- import"./index-hrkamw9q.js";
26
- import"./index-359djbj1.js";
27
- import"./index-bw7r2b2m.js";
25
+ import"./index-jgtje76m.js";
26
+ import"./index-ty0wg9yp.js";
27
+ import"./index-x4azb6qj.js";
28
28
  import"./index-70ha9e09.js";
29
- import"./index-8hqkrd2j.js";
29
+ import"./index-bysyj3z4.js";
30
30
  import"./index-9ss2m4rs.js";
31
- import"./index-czr3jcg6.js";
31
+ import"./index-jr6tppv9.js";
32
32
  import"./index-zsrtt42s.js";
33
- import"./index-2dvk153d.js";
34
- import"./index-6chhqq2n.js";
35
- import"./index-8bdk7124.js";
33
+ import"./index-hbjax6hy.js";
34
+ import"./index-p0r5fn7y.js";
35
+ import"./index-x8cvbkjs.js";
36
36
  import"./index-b43rt5ph.js";
37
37
  import"./index-q7sjgr1y.js";
38
- import"./index-8n62bphd.js";
39
- import"./index-2rm5x9ps.js";
40
- import"./index-52jfm5s0.js";
41
- import"./index-jc9cxh90.js";
42
- import"./index-anxs69ad.js";
43
- import"./index-z6xqpmqg.js";
38
+ import"./index-c0eyq4rp.js";
39
+ import"./index-qmp4gxac.js";
40
+ import"./index-sxsyd7kf.js";
41
+ import"./index-3nww2vnx.js";
42
+ import"./index-4kwxpnf8.js";
44
43
  import"./index-p612v1mv.js";
45
- import"./index-a5w71m8f.js";
46
- import"./index-c20gf089.js";
44
+ import"./index-8nv3bc9h.js";
45
+ import"./index-c23w8t46.js";
47
46
  import"./index-rtry5xyf.js";
48
- import"./index-apxaa755.js";
47
+ import"./index-kd68b6mg.js";
49
48
  import"./index-3qf1vxtb.js";
50
49
  import"./index-n832052r.js";
51
- import"./index-8m12y79g.js";
52
- import"./index-30f4fe30.js";
53
- import"./index-2v17wb75.js";
54
- import"./index-79sr3fd1.js";
55
- import"./index-jx9f4ke1.js";
56
- import"./index-aftapk6j.js";
50
+ import"./index-7mxrqy4r.js";
51
+ import"./index-9ccxcjdm.js";
52
+ import"./index-hgphhnrp.js";
53
+ import"./index-nthqfxzz.js";
54
+ import"./index-7pp8fz4j.js";
55
+ import"./index-y3dtdn2f.js";
57
56
  import"./index-ry16d01s.js";
58
57
  import"./index-n4fzmqz8.js";
59
- import"./index-axf65x87.js";
60
- import"./index-fywshabz.js";
58
+ import"./index-fkk7x6sy.js";
59
+ import"./index-22sannyk.js";
61
60
  import"./index-ae75rja9.js";
62
- import"./index-a7rw4g4s.js";
61
+ import"./index-14z9en94.js";
62
+ import"./index-sxe3t040.js";
63
+ import"./index-19hjpqsy.js";
64
+ import"./index-bks56jbg.js";
63
65
  import"./index-7qefgq4j.js";
64
- import"./index-edm41q4j.js";
65
- import"./index-gy0nyfbw.js";
66
- import"./index-hwj25q9r.js";
66
+ import"./index-ee6ydtfe.js";
67
67
  import"./index-7g4c7s5r.js";
68
- import"./index-mg43w8p2.js";
68
+ import"./index-0a0jsbhg.js";
69
69
  import"./index-9e6fdz2h.js";
70
70
  import"./index-4rhhvd1a.js";
71
71
  import {
72
72
  init_package,
73
73
  package_default
74
- } from "./index-nb924ar6.js";
74
+ } from "./index-e0bjbadr.js";
75
75
  import {
76
76
  DEFAULT_AGENT_CONFIGS,
77
77
  init_constants
78
- } from "./index-a0d4fp6r.js";
79
- import"./index-zjygnfay.js";
78
+ } from "./index-0tc0pcmh.js";
80
79
  import"./index-bk5tah7q.js";
81
80
  import"./index-bpmtbmy9.js";
81
+ import"./index-zpsr8rpc.js";
82
82
  import"./index-q1r1cfww.js";
83
83
  import"./index-yzjaj53h.js";
84
84
  import"./index-zgwm4ryv.js";
@@ -9,31 +9,31 @@ import {
9
9
  maybeEscalateOnViolation,
10
10
  maybeQuarantineOnContradiction,
11
11
  readRecentEscalations
12
- } from "./index-359djbj1.js";
13
- import"./index-jc9cxh90.js";
14
- import"./index-anxs69ad.js";
15
- import"./index-z6xqpmqg.js";
12
+ } from "./index-ty0wg9yp.js";
13
+ import"./index-3nww2vnx.js";
14
+ import"./index-4kwxpnf8.js";
16
15
  import"./index-p612v1mv.js";
17
- import"./index-apxaa755.js";
16
+ import"./index-kd68b6mg.js";
18
17
  import"./index-3qf1vxtb.js";
19
18
  import"./index-n832052r.js";
20
- import"./index-axf65x87.js";
21
- import"./index-fywshabz.js";
19
+ import"./index-fkk7x6sy.js";
20
+ import"./index-22sannyk.js";
22
21
  import"./index-ae75rja9.js";
23
- import"./index-a7rw4g4s.js";
22
+ import"./index-14z9en94.js";
23
+ import"./index-sxe3t040.js";
24
+ import"./index-19hjpqsy.js";
25
+ import"./index-bks56jbg.js";
24
26
  import"./index-7qefgq4j.js";
25
- import"./index-edm41q4j.js";
26
- import"./index-gy0nyfbw.js";
27
- import"./index-hwj25q9r.js";
27
+ import"./index-ee6ydtfe.js";
28
28
  import"./index-7g4c7s5r.js";
29
- import"./index-mg43w8p2.js";
29
+ import"./index-0a0jsbhg.js";
30
30
  import"./index-9e6fdz2h.js";
31
31
  import"./index-4rhhvd1a.js";
32
- import"./index-nb924ar6.js";
33
- import"./index-a0d4fp6r.js";
34
- import"./index-zjygnfay.js";
32
+ import"./index-e0bjbadr.js";
33
+ import"./index-0tc0pcmh.js";
35
34
  import"./index-bk5tah7q.js";
36
35
  import"./index-bpmtbmy9.js";
36
+ import"./index-zpsr8rpc.js";
37
37
  import"./index-zgwm4ryv.js";
38
38
  import"./index-a76rekgs.js";
39
39
  export {
@@ -29,29 +29,29 @@ import {
29
29
  resolveKnowledgeCounterBaselinePath,
30
30
  resolveKnowledgeEventsPath,
31
31
  resolveLegacyApplicationLogPath
32
- } from "./index-jc9cxh90.js";
33
- import"./index-anxs69ad.js";
34
- import"./index-z6xqpmqg.js";
32
+ } from "./index-3nww2vnx.js";
33
+ import"./index-4kwxpnf8.js";
35
34
  import"./index-p612v1mv.js";
36
- import"./index-apxaa755.js";
35
+ import"./index-kd68b6mg.js";
37
36
  import"./index-3qf1vxtb.js";
38
37
  import"./index-n832052r.js";
39
- import"./index-axf65x87.js";
38
+ import"./index-fkk7x6sy.js";
40
39
  import"./index-ae75rja9.js";
41
- import"./index-a7rw4g4s.js";
40
+ import"./index-14z9en94.js";
41
+ import"./index-sxe3t040.js";
42
+ import"./index-19hjpqsy.js";
43
+ import"./index-bks56jbg.js";
42
44
  import"./index-7qefgq4j.js";
43
- import"./index-edm41q4j.js";
44
- import"./index-gy0nyfbw.js";
45
- import"./index-hwj25q9r.js";
45
+ import"./index-ee6ydtfe.js";
46
46
  import"./index-7g4c7s5r.js";
47
- import"./index-mg43w8p2.js";
47
+ import"./index-0a0jsbhg.js";
48
48
  import"./index-9e6fdz2h.js";
49
49
  import"./index-4rhhvd1a.js";
50
- import"./index-nb924ar6.js";
51
- import"./index-a0d4fp6r.js";
52
- import"./index-zjygnfay.js";
50
+ import"./index-e0bjbadr.js";
51
+ import"./index-0tc0pcmh.js";
53
52
  import"./index-bk5tah7q.js";
54
53
  import"./index-bpmtbmy9.js";
54
+ import"./index-zpsr8rpc.js";
55
55
  import"./index-zgwm4ryv.js";
56
56
  import"./index-a76rekgs.js";
57
57
  export {
@@ -12,13 +12,15 @@ import {
12
12
  resolveLinkDir,
13
13
  sanitizeLinkId,
14
14
  writeLinkPointer
15
- } from "./index-a7rw4g4s.js";
15
+ } from "./index-14z9en94.js";
16
+ import"./index-sxe3t040.js";
17
+ import"./index-19hjpqsy.js";
18
+ import"./index-bks56jbg.js";
16
19
  import"./index-7qefgq4j.js";
17
- import"./index-edm41q4j.js";
18
- import"./index-gy0nyfbw.js";
19
- import"./index-hwj25q9r.js";
20
+ import"./index-ee6ydtfe.js";
20
21
  import"./index-7g4c7s5r.js";
21
22
  import"./index-bpmtbmy9.js";
23
+ import"./index-zpsr8rpc.js";
22
24
  import"./index-zgwm4ryv.js";
23
25
  import"./index-a76rekgs.js";
24
26
  export {
@@ -42,18 +42,20 @@ import {
42
42
  transactKnowledge,
43
43
  transactKnowledgeWithCas,
44
44
  wordBigrams
45
- } from "./index-fywshabz.js";
45
+ } from "./index-22sannyk.js";
46
46
  import {
47
47
  resolveHiveDataDir
48
48
  } from "./index-ae75rja9.js";
49
- import"./index-a7rw4g4s.js";
49
+ import"./index-14z9en94.js";
50
+ import"./index-sxe3t040.js";
51
+ import"./index-19hjpqsy.js";
52
+ import"./index-bks56jbg.js";
50
53
  import"./index-7qefgq4j.js";
51
- import"./index-edm41q4j.js";
52
- import"./index-gy0nyfbw.js";
53
- import"./index-hwj25q9r.js";
54
+ import"./index-ee6ydtfe.js";
54
55
  import"./index-7g4c7s5r.js";
55
56
  import"./index-bk5tah7q.js";
56
57
  import"./index-bpmtbmy9.js";
58
+ import"./index-zpsr8rpc.js";
57
59
  import"./index-zgwm4ryv.js";
58
60
  import"./index-a76rekgs.js";
59
61
  export {