opencode-swarm 7.145.0 → 7.145.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 (105) hide show
  1. package/.opencode/skills/phase-wrap/SKILL.md +3 -2
  2. package/README.md +5 -1
  3. package/dist/background/workspace-snapshot.d.ts +29 -0
  4. package/dist/cli/{config-doctor-dzsv3pqy.js → config-doctor-j1r33f4q.js} +3 -3
  5. package/dist/cli/{core-qkh9me8x.js → core-c2zrd384.js} +4 -4
  6. package/dist/cli/{curation-policy-5x6346tf.js → curation-policy-xv0j8zyt.js} +6 -6
  7. package/dist/cli/{curator-zssndq5x.js → curator-gk2kmrk1.js} +31 -31
  8. package/dist/cli/{curator-llm-factory-q5p4578g.js → curator-llm-factory-sat3mn5n.js} +31 -31
  9. package/dist/cli/{evidence-summary-service-dqcpapj8.js → evidence-summary-service-0mhx0t0v.js} +14 -14
  10. package/dist/cli/{gate-evidence-bkdqryqg.js → gate-evidence-a5adh55x.js} +9 -9
  11. package/dist/cli/{guardrail-explain-kspf83x5.js → guardrail-explain-r50fery8.js} +32 -32
  12. package/dist/cli/{guardrail-log-qg4sq6gr.js → guardrail-log-p69eys6d.js} +4 -4
  13. package/dist/cli/{hive-promoter-3h7dhnek.js → hive-promoter-ay8a7sct.js} +31 -31
  14. package/dist/cli/{index-wk54ey3h.js → index-0a0asz2s.js} +1 -1
  15. package/dist/cli/{index-2dnqazyr.js → index-1g87esfp.js} +2 -2
  16. package/dist/cli/{index-0pcq32y2.js → index-2vefr1f8.js} +1 -1
  17. package/dist/cli/{index-fp464as8.js → index-4p3qfb05.js} +1 -1
  18. package/dist/cli/{index-77ef8gye.js → index-5e5a1y2r.js} +1 -1
  19. package/dist/cli/{index-0jr9zn34.js → index-612rr70a.js} +2 -2
  20. package/dist/cli/{index-apjdytwx.js → index-673axbjx.js} +3 -3
  21. package/dist/cli/{index-qfawexc8.js → index-6wf75rcm.js} +6 -6
  22. package/dist/cli/{index-k6pdsct6.js → index-7y5akvc9.js} +1 -1
  23. package/dist/cli/{index-hfzcztv6.js → index-9080b3de.js} +34 -34
  24. package/dist/cli/{index-v64kjqvg.js → index-917z76qr.js} +25 -18
  25. package/dist/cli/{index-ffdwj1an.js → index-97psh79d.js} +1 -1
  26. package/dist/cli/{index-kp87kr1a.js → index-9gt8g2qj.js} +4 -4
  27. package/dist/cli/{index-4e5a28h7.js → index-b9kxxd6k.js} +2 -2
  28. package/dist/cli/{index-pa86tpgt.js → index-bghwrr59.js} +1 -1
  29. package/dist/cli/{index-6ezbzd5e.js → index-cb2qtetk.js} +682 -181
  30. package/dist/cli/{index-v3y3qg48.js → index-cpg98bh1.js} +17 -1
  31. package/dist/cli/{index-c13ttmak.js → index-cxn95n7q.js} +180 -32
  32. package/dist/cli/{index-7g276m9m.js → index-czde45km.js} +3 -3
  33. package/dist/cli/{index-zfhe7vbb.js → index-gpnv14kq.js} +2 -2
  34. package/dist/cli/{index-6q3agdmr.js → index-j20fzn0w.js} +2 -2
  35. package/dist/cli/{index-mkks7jwg.js → index-jgb7mq2y.js} +4 -4
  36. package/dist/cli/{index-h4hasck4.js → index-jpppcckq.js} +4 -4
  37. package/dist/cli/{index-4evasm2b.js → index-kggqpefz.js} +5 -5
  38. package/dist/cli/{index-s6cwsnrw.js → index-n55a28zr.js} +254 -36
  39. package/dist/cli/{index-b3xret0a.js → index-ncfjxz9n.js} +5 -5
  40. package/dist/cli/{index-e00wbqw5.js → index-np4ytvvv.js} +2 -2
  41. package/dist/cli/{index-jy9bwa9k.js → index-nsr5b69r.js} +2 -2
  42. package/dist/cli/{index-zz5qsjd1.js → index-qyvjp0bq.js} +66 -38
  43. package/dist/cli/{index-6hqhyb0f.js → index-rk80jhef.js} +19 -5
  44. package/dist/cli/{index-4zwjc9sb.js → index-vav705md.js} +101 -4
  45. package/dist/cli/{index-s72naw1j.js → index-x8pm918t.js} +1 -1
  46. package/dist/cli/{index-b30x236n.js → index-z9yhhk6q.js} +96 -8
  47. package/dist/cli/index.js +32 -32
  48. package/dist/cli/{knowledge-escalator-w1mbaktt.js → knowledge-escalator-22apj3dj.js} +14 -14
  49. package/dist/cli/{knowledge-events-a0dj6gy6.js → knowledge-events-bx8xba9z.js} +12 -12
  50. package/dist/cli/{knowledge-link-mzdjvjsd.js → knowledge-link-82ew2yc4.js} +5 -5
  51. package/dist/cli/{knowledge-store-8kk3rghx.js → knowledge-store-nc71kfsg.js} +6 -6
  52. package/dist/cli/{knowledge-validator-91ym56e0.js → knowledge-validator-g8ne80v6.js} +8 -8
  53. package/dist/cli/model-preflight-7ea00h34.js +170 -0
  54. package/dist/cli/{pending-delegations-6vsrmw5w.js → pending-delegations-kkrczqv7.js} +3 -3
  55. package/dist/cli/{pr-subscriptions-zc3skxde.js → pr-subscriptions-2xn238xt.js} +3 -3
  56. package/dist/cli/{runner-jj32v8bk.js → runner-pqsf809k.js} +6 -6
  57. package/dist/cli/{scan-cursor-12jxwd14.js → scan-cursor-6ksgv514.js} +7 -7
  58. package/dist/cli/{schema-nq9tcz87.js → schema-mpcm7nje.js} +2 -2
  59. package/dist/cli/{scope-persistence-dv6z7n08.js → scope-persistence-mj1w3hqw.js} +11 -8
  60. package/dist/cli/{skill-generator-drscnzq9.js → skill-generator-gsa6qwwt.js} +16 -16
  61. package/dist/cli/{telemetry-z54dgdrh.js → telemetry-t109dhv7.js} +1 -1
  62. package/dist/cli/{workspace-snapshot-q21mgbsh.js → workspace-snapshot-kznz5e13.js} +4 -2
  63. package/dist/cli/{worktree-collision-ownership-rfyyjjct.js → worktree-collision-ownership-2jtg2my1.js} +8 -8
  64. package/dist/cli/{worktree-isolation-4tehtym5.js → worktree-isolation-ajzyp2gm.js} +33 -31
  65. package/dist/config/schema.d.ts +2 -2
  66. package/dist/evidence/task-gate-repair.d.ts +26 -0
  67. package/dist/evidence/task-gate-requirements.d.ts +20 -0
  68. package/dist/gate-evidence.d.ts +7 -0
  69. package/dist/hooks/delegation-gate/worktree-isolation.d.ts +4 -0
  70. package/dist/hooks/knowledge-receipt-ledger-storage.d.ts +2 -0
  71. package/dist/hooks/knowledge-receipt-ledger.d.ts +72 -3
  72. package/dist/hooks/knowledge-receipt-observability.d.ts +1 -1
  73. package/dist/hooks/phase-complete-directive-gate.d.ts +9 -0
  74. package/dist/index.js +566 -546
  75. package/dist/observability/catalog.d.ts +2 -2
  76. package/dist/plan/manager.d.ts +8 -0
  77. package/dist/review/diff-source.d.ts +30 -0
  78. package/dist/review/engine.d.ts +1 -0
  79. package/dist/review/evidence.d.ts +16 -2
  80. package/dist/review/phase-runner.d.ts +1 -0
  81. package/dist/scope/scope-binding.d.ts +16 -0
  82. package/dist/services/model-preflight.d.ts +151 -0
  83. package/dist/services/session-reflection.d.ts +24 -0
  84. package/dist/telemetry.d.ts +12 -1
  85. package/dist/tools/completion-verify.d.ts +2 -0
  86. package/dist/tools/convene-council.d.ts +1 -1
  87. package/dist/tools/index.d.ts +4 -0
  88. package/dist/tools/manifest.d.ts +4 -0
  89. package/dist/tools/phase-complete/gates/final-review-gate.d.ts +3 -3
  90. package/dist/tools/phase-complete/gates/types.d.ts +2 -2
  91. package/dist/tools/phase-complete/preflight-report.d.ts +66 -0
  92. package/dist/tools/phase-complete/snapshot-identity.d.ts +1 -0
  93. package/dist/tools/phase-complete.d.ts +66 -3
  94. package/dist/tools/placeholder-scan.d.ts +64 -0
  95. package/dist/tools/record-directive-override.d.ts +14 -0
  96. package/dist/tools/repair-gate-evidence.d.ts +6 -0
  97. package/dist/tools/repair-knowledge-receipt-ledger.d.ts +27 -0
  98. package/dist/tools/run-phase-review.d.ts +37 -0
  99. package/dist/tools/sast-scan.d.ts +6 -0
  100. package/dist/tools/submit-phase-council-verdicts.d.ts +1 -1
  101. package/dist/tools/tool-metadata.d.ts +32 -16
  102. package/dist/tools/write-final-council-evidence.d.ts +1 -1
  103. package/dist/tools/write-retro.d.ts +2 -0
  104. package/package.json +1 -1
  105. package/dist/cli/{curator-drift-yn5d0mvq.js → curator-drift-r50x1rac.js} +1 -1
@@ -1,11 +1,11 @@
1
1
  // @bun
2
- import {
3
- bunSpawn
4
- } from "./index-zj6t9zgx.js";
5
2
  import {
6
3
  init_git_executable,
7
4
  resolveGitExecutable
8
5
  } from "./index-9e6fdz2h.js";
6
+ import {
7
+ bunSpawn
8
+ } from "./index-zj6t9zgx.js";
9
9
 
10
10
  // src/background/workspace-snapshot.ts
11
11
  import * as child_process from "child_process";
@@ -870,6 +870,90 @@ function parsePorcelainPaths(output) {
870
870
  }
871
871
  return [...new Set(paths)];
872
872
  }
873
+ var SWARM_VISIBLE_CODE_EXTENSIONS = new Set([
874
+ ".js",
875
+ ".jsx",
876
+ ".mjs",
877
+ ".cjs",
878
+ ".ts",
879
+ ".tsx",
880
+ ".py",
881
+ ".pyw",
882
+ ".go",
883
+ ".rs",
884
+ ".php",
885
+ ".pl",
886
+ ".java",
887
+ ".kt",
888
+ ".swift",
889
+ ".scala",
890
+ ".c",
891
+ ".h",
892
+ ".cpp",
893
+ ".cs",
894
+ ".rb",
895
+ ".lua",
896
+ ".r",
897
+ ".sh",
898
+ ".bash",
899
+ ".zsh",
900
+ ".ps1",
901
+ ".psm1",
902
+ ".bat",
903
+ ".cmd",
904
+ ".vb",
905
+ ".fs"
906
+ ]);
907
+ function isSwarmRuntimePath(p) {
908
+ if (p === ".swarm")
909
+ return true;
910
+ if (!p.startsWith(".swarm/"))
911
+ return false;
912
+ const dot = p.lastIndexOf(".");
913
+ const extension = dot === -1 ? "" : p.slice(dot).toLowerCase();
914
+ return !SWARM_VISIBLE_CODE_EXTENSIONS.has(extension);
915
+ }
916
+ function filterSwarmRuntimePorcelain(output) {
917
+ const records = output.split("\x00");
918
+ const kept = [];
919
+ for (let index = 0;index < records.length; index++) {
920
+ const record = records[index];
921
+ if (!record) {
922
+ continue;
923
+ }
924
+ if (record.startsWith("# ")) {
925
+ kept.push(record);
926
+ continue;
927
+ }
928
+ let primaryPath = null;
929
+ if (record.startsWith("? ")) {
930
+ primaryPath = record.slice(2);
931
+ } else if (record.startsWith("1 ")) {
932
+ primaryPath = porcelainV2PathAfterFields(record, 8);
933
+ } else if (record.startsWith("2 ")) {
934
+ primaryPath = porcelainV2PathAfterFields(record, 9);
935
+ } else if (record.startsWith("u ")) {
936
+ primaryPath = porcelainV2PathAfterFields(record, 10);
937
+ }
938
+ if (primaryPath !== null && isSwarmRuntimePath(primaryPath)) {
939
+ if (record.startsWith("2 ")) {
940
+ index += 1;
941
+ }
942
+ continue;
943
+ }
944
+ if (record.startsWith("2 ") && primaryPath !== null) {
945
+ const originalRecord = records[index + 1];
946
+ kept.push(record);
947
+ if (typeof originalRecord === "string" && originalRecord !== "" && isSwarmRuntimePath(originalRecord)) {
948
+ kept.push(primaryPath);
949
+ index += 1;
950
+ }
951
+ continue;
952
+ }
953
+ kept.push(record);
954
+ }
955
+ return kept.join("\x00");
956
+ }
873
957
  function parsePorcelainV2Snapshot(output) {
874
958
  const records = output.split("\x00");
875
959
  const headers = [];
@@ -967,13 +1051,14 @@ function captureWorkspaceSnapshot(directory, optionsOrScope = null, prHeadShaArg
967
1051
  })();
968
1052
  const resolveCurrentPrHeadSha = typeof optionsOrScope === "object" && optionsOrScope !== null && optionsOrScope.resolveCurrentPrHeadSha === true;
969
1053
  const upstreamBefore = resolveCurrentPrHeadSha ? runGit(directory, ["rev-parse", "@{upstream}"]) : null;
970
- const porcelain = runGit(directory, [
1054
+ const porcelainRaw = runGit(directory, [
971
1055
  "status",
972
1056
  "--porcelain=v2",
973
1057
  "--branch",
974
1058
  "-z",
975
1059
  "--untracked-files=all"
976
1060
  ]);
1061
+ const porcelain = porcelainRaw === null ? null : filterSwarmRuntimePorcelain(porcelainRaw);
977
1062
  const snapshot = porcelain === null ? null : parsePorcelainV2Snapshot(porcelain);
978
1063
  const upstreamAfter = resolveCurrentPrHeadSha ? runGit(directory, ["rev-parse", "@{upstream}"]) : null;
979
1064
  const prHeadSha = resolveCurrentPrHeadSha ? upstreamBefore && upstreamBefore === upstreamAfter ? upstreamBefore : null : configuredPrHeadSha;
@@ -994,7 +1079,8 @@ function captureWorkspaceSnapshot(directory, optionsOrScope = null, prHeadShaArg
994
1079
  function changedFilesSinceSnapshot(directory, baseline) {
995
1080
  if (!baseline?.gitHead || baseline.changedFiles == null)
996
1081
  return null;
997
- if (baseline.changedFiles.length > 0)
1082
+ const baselineDirt = baseline.changedFiles.filter((p) => !isSwarmRuntimePath(p));
1083
+ if (baselineDirt.length > 0)
998
1084
  return null;
999
1085
  const current = captureWorkspaceSnapshot(directory);
1000
1086
  if (!current.gitHead || current.changedFiles == null)
@@ -1010,8 +1096,10 @@ function changedFilesSinceSnapshot(directory, baseline) {
1010
1096
  ]);
1011
1097
  if (committed === null)
1012
1098
  return null;
1013
- for (const changedPath of parseNulPaths(committed))
1014
- changed.add(changedPath);
1099
+ for (const changedPath of parseNulPaths(committed)) {
1100
+ if (!isSwarmRuntimePath(changedPath))
1101
+ changed.add(changedPath);
1102
+ }
1015
1103
  }
1016
1104
  return [...changed];
1017
1105
  }
@@ -1062,4 +1150,4 @@ var _internals = {
1062
1150
  readChangedFileSync: (filePath) => fs.readFileSync(filePath)
1063
1151
  };
1064
1152
 
1065
- export { readGitTextAtRevision, resolveCurrentGitHead, resolveCurrentGitHeadAsync, resolveExactMergeBase, resolveExactMergeBaseAsync, resolvePrReviewDiffStats, resolvePrReviewDiffStatsAsync, resolveCurrentUpstreamRemoteRef, resolveCurrentUpstreamPushTarget, resolveCurrentUpstreamPushTargetAsync, resolveExactRemoteBranchHead, resolveExactRemoteBranchHeadAsync, resolveGitControlStateDigest, resolveGitControlStateDigestAsync, resolveIsWorkingTreeClean, resolveIsWorkingTreeCleanAsync, resolveCommitCountSince, resolveCommitCountSinceAsync, resolveIsExactSingleChildCommit, resolveIsExactSingleChildCommitAsync, resolveRemoteRefsContainingHead, resolveRemoteRefsContainingHeadAsync, resolvePrFeedbackTrackingCandidatesAsync, switchPrFeedbackTrackingCandidateAsync, resolvePrWorkflowRevisionDigestDetailed, resolvePrWorkflowRevisionDigest, resolvePrWorkflowRevisionDigestDetailedAsync, resolvePrWorkflowRevisionDigestAsync, parsePorcelainPaths, parsePorcelainV2Snapshot, captureWorkspaceSnapshot, changedFilesSinceSnapshot, workspaceSnapshotMatches, compareWorkspaceSnapshot, compareWorkspaceSnapshots, digest, _internals };
1153
+ export { readGitTextAtRevision, resolveCurrentGitHead, resolveCurrentGitHeadAsync, resolveExactMergeBase, resolveExactMergeBaseAsync, resolvePrReviewDiffStats, resolvePrReviewDiffStatsAsync, resolveCurrentUpstreamRemoteRef, resolveCurrentUpstreamPushTarget, resolveCurrentUpstreamPushTargetAsync, resolveExactRemoteBranchHead, resolveExactRemoteBranchHeadAsync, resolveGitControlStateDigest, resolveGitControlStateDigestAsync, resolveIsWorkingTreeClean, resolveIsWorkingTreeCleanAsync, resolveCommitCountSince, resolveCommitCountSinceAsync, resolveIsExactSingleChildCommit, resolveIsExactSingleChildCommitAsync, resolveRemoteRefsContainingHead, resolveRemoteRefsContainingHeadAsync, resolvePrFeedbackTrackingCandidatesAsync, switchPrFeedbackTrackingCandidateAsync, resolvePrWorkflowRevisionDigestDetailed, resolvePrWorkflowRevisionDigest, resolvePrWorkflowRevisionDigestDetailedAsync, resolvePrWorkflowRevisionDigestAsync, parsePorcelainPaths, isSwarmRuntimePath, parsePorcelainV2Snapshot, captureWorkspaceSnapshot, changedFilesSinceSnapshot, workspaceSnapshotMatches, compareWorkspaceSnapshot, compareWorkspaceSnapshots, digest, _internals };
package/dist/cli/index.js CHANGED
@@ -11,65 +11,65 @@ import {
11
11
  readCachePackageVersion,
12
12
  resolveCommand,
13
13
  safeRealpathSync
14
- } from "./index-6ezbzd5e.js";
15
- import"./index-2dnqazyr.js";
16
- import"./index-0jr9zn34.js";
17
- import"./index-v64kjqvg.js";
14
+ } from "./index-cb2qtetk.js";
15
+ import"./index-0a0asz2s.js";
16
+ import"./index-1g87esfp.js";
17
+ import"./index-612rr70a.js";
18
+ import"./index-917z76qr.js";
19
+ import"./index-nsr5b69r.js";
18
20
  import"./index-134d35c1.js";
19
21
  import"./index-abtrcs16.js";
20
- import"./index-wk54ey3h.js";
21
- import"./index-jy9bwa9k.js";
22
22
  import"./index-y8552snf.js";
23
- import"./index-e00wbqw5.js";
23
+ import"./index-ncfjxz9n.js";
24
+ import"./index-np4ytvvv.js";
24
25
  import"./index-70ha9e09.js";
25
26
  import"./index-c8s9a3zh.js";
26
27
  import"./index-9ss2m4rs.js";
27
- import"./index-b30x236n.js";
28
- import"./index-77ef8gye.js";
29
- import"./index-mkks7jwg.js";
30
- import"./index-b3xret0a.js";
31
- import"./index-h4hasck4.js";
32
- import"./index-fp464as8.js";
28
+ import"./index-z9yhhk6q.js";
29
+ import"./index-5e5a1y2r.js";
30
+ import"./index-jgb7mq2y.js";
31
+ import"./index-jpppcckq.js";
32
+ import"./index-4p3qfb05.js";
33
33
  import"./index-rtry5xyf.js";
34
34
  import"./index-zsrtt42s.js";
35
- import"./index-ffdwj1an.js";
35
+ import"./index-97psh79d.js";
36
36
  import"./index-e1pxav9g.js";
37
- import"./index-s6cwsnrw.js";
38
- import"./index-6hqhyb0f.js";
39
- import"./index-4zwjc9sb.js";
40
- import"./index-apjdytwx.js";
37
+ import"./index-n55a28zr.js";
38
+ import"./index-rk80jhef.js";
39
+ import"./index-vav705md.js";
40
+ import"./index-673axbjx.js";
41
41
  import"./index-556ja8an.js";
42
42
  import"./index-7sy3aa9m.js";
43
43
  import"./index-wx8zdh4a.js";
44
44
  import"./index-3g0xk6tk.js";
45
45
  import"./index-85gkedsf.js";
46
- import"./index-qfawexc8.js";
47
- import"./index-c13ttmak.js";
48
- import"./index-7g276m9m.js";
46
+ import"./index-6wf75rcm.js";
47
+ import"./index-cxn95n7q.js";
48
+ import"./index-czde45km.js";
49
49
  import"./index-gprxjmm7.js";
50
50
  import"./index-n832052r.js";
51
- import"./index-w8pgjr75.js";
52
- import"./index-z6xqpmqg.js";
53
- import"./index-zj6t9zgx.js";
54
- import"./index-0pcq32y2.js";
51
+ import"./index-2vefr1f8.js";
55
52
  import {
56
53
  init_package,
57
54
  package_default
58
- } from "./index-zfhe7vbb.js";
55
+ } from "./index-gpnv14kq.js";
59
56
  import {
60
57
  DEFAULT_AGENT_CONFIGS,
61
58
  init_constants
62
- } from "./index-v3y3qg48.js";
59
+ } from "./index-cpg98bh1.js";
63
60
  import"./index-9e6fdz2h.js";
64
61
  import"./index-4rhhvd1a.js";
62
+ import"./index-w8pgjr75.js";
63
+ import"./index-z6xqpmqg.js";
64
+ import"./index-zj6t9zgx.js";
65
65
  import"./index-zjygnfay.js";
66
66
  import"./index-ae75rja9.js";
67
- import"./index-s72naw1j.js";
68
- import"./index-6q3agdmr.js";
67
+ import"./index-x8pm918t.js";
68
+ import"./index-j20fzn0w.js";
69
69
  import"./index-bk5tah7q.js";
70
- import"./index-4evasm2b.js";
71
- import"./index-pa86tpgt.js";
72
- import"./index-zz5qsjd1.js";
70
+ import"./index-kggqpefz.js";
71
+ import"./index-bghwrr59.js";
72
+ import"./index-qyvjp0bq.js";
73
73
  import"./index-7g4c7s5r.js";
74
74
  import"./index-bpmtbmy9.js";
75
75
  import"./index-ed5ykebp.js";
@@ -9,28 +9,28 @@ import {
9
9
  maybeEscalateOnViolation,
10
10
  maybeQuarantineOnContradiction,
11
11
  readRecentEscalations
12
- } from "./index-b3xret0a.js";
13
- import"./index-qfawexc8.js";
14
- import"./index-c13ttmak.js";
15
- import"./index-7g276m9m.js";
12
+ } from "./index-ncfjxz9n.js";
13
+ import"./index-6wf75rcm.js";
14
+ import"./index-cxn95n7q.js";
15
+ import"./index-czde45km.js";
16
16
  import"./index-gprxjmm7.js";
17
17
  import"./index-n832052r.js";
18
+ import"./index-2vefr1f8.js";
19
+ import"./index-gpnv14kq.js";
20
+ import"./index-cpg98bh1.js";
21
+ import"./index-9e6fdz2h.js";
22
+ import"./index-4rhhvd1a.js";
18
23
  import"./index-w8pgjr75.js";
19
24
  import"./index-z6xqpmqg.js";
20
25
  import"./index-zj6t9zgx.js";
21
- import"./index-0pcq32y2.js";
22
- import"./index-zfhe7vbb.js";
23
- import"./index-v3y3qg48.js";
24
- import"./index-9e6fdz2h.js";
25
- import"./index-4rhhvd1a.js";
26
26
  import"./index-zjygnfay.js";
27
27
  import"./index-ae75rja9.js";
28
- import"./index-s72naw1j.js";
29
- import"./index-6q3agdmr.js";
28
+ import"./index-x8pm918t.js";
29
+ import"./index-j20fzn0w.js";
30
30
  import"./index-bk5tah7q.js";
31
- import"./index-4evasm2b.js";
32
- import"./index-pa86tpgt.js";
33
- import"./index-zz5qsjd1.js";
31
+ import"./index-kggqpefz.js";
32
+ import"./index-bghwrr59.js";
33
+ import"./index-qyvjp0bq.js";
34
34
  import"./index-7g4c7s5r.js";
35
35
  import"./index-bpmtbmy9.js";
36
36
  import"./index-ed5ykebp.js";
@@ -29,26 +29,26 @@ import {
29
29
  resolveKnowledgeCounterBaselinePath,
30
30
  resolveKnowledgeEventsPath,
31
31
  resolveLegacyApplicationLogPath
32
- } from "./index-c13ttmak.js";
33
- import"./index-7g276m9m.js";
32
+ } from "./index-cxn95n7q.js";
33
+ import"./index-czde45km.js";
34
34
  import"./index-gprxjmm7.js";
35
35
  import"./index-n832052r.js";
36
+ import"./index-2vefr1f8.js";
37
+ import"./index-gpnv14kq.js";
38
+ import"./index-cpg98bh1.js";
39
+ import"./index-9e6fdz2h.js";
40
+ import"./index-4rhhvd1a.js";
36
41
  import"./index-w8pgjr75.js";
37
42
  import"./index-z6xqpmqg.js";
38
43
  import"./index-zj6t9zgx.js";
39
- import"./index-0pcq32y2.js";
40
- import"./index-zfhe7vbb.js";
41
- import"./index-v3y3qg48.js";
42
- import"./index-9e6fdz2h.js";
43
- import"./index-4rhhvd1a.js";
44
44
  import"./index-zjygnfay.js";
45
45
  import"./index-ae75rja9.js";
46
- import"./index-s72naw1j.js";
47
- import"./index-6q3agdmr.js";
46
+ import"./index-x8pm918t.js";
47
+ import"./index-j20fzn0w.js";
48
48
  import"./index-bk5tah7q.js";
49
- import"./index-4evasm2b.js";
50
- import"./index-pa86tpgt.js";
51
- import"./index-zz5qsjd1.js";
49
+ import"./index-kggqpefz.js";
50
+ import"./index-bghwrr59.js";
51
+ import"./index-qyvjp0bq.js";
52
52
  import"./index-7g4c7s5r.js";
53
53
  import"./index-bpmtbmy9.js";
54
54
  import"./index-ed5ykebp.js";
@@ -12,11 +12,11 @@ import {
12
12
  resolveLinkDir,
13
13
  sanitizeLinkId,
14
14
  writeLinkPointer
15
- } from "./index-s72naw1j.js";
16
- import"./index-6q3agdmr.js";
17
- import"./index-4evasm2b.js";
18
- import"./index-pa86tpgt.js";
19
- import"./index-zz5qsjd1.js";
15
+ } from "./index-x8pm918t.js";
16
+ import"./index-j20fzn0w.js";
17
+ import"./index-kggqpefz.js";
18
+ import"./index-bghwrr59.js";
19
+ import"./index-qyvjp0bq.js";
20
20
  import"./index-7g4c7s5r.js";
21
21
  import"./index-bpmtbmy9.js";
22
22
  import"./index-ed5ykebp.js";
@@ -41,16 +41,16 @@ import {
41
41
  transactKnowledge,
42
42
  transactKnowledgeWithCas,
43
43
  wordBigrams
44
- } from "./index-qfawexc8.js";
44
+ } from "./index-6wf75rcm.js";
45
45
  import {
46
46
  resolveHiveDataDir
47
47
  } from "./index-ae75rja9.js";
48
- import"./index-s72naw1j.js";
49
- import"./index-6q3agdmr.js";
48
+ import"./index-x8pm918t.js";
49
+ import"./index-j20fzn0w.js";
50
50
  import"./index-bk5tah7q.js";
51
- import"./index-4evasm2b.js";
52
- import"./index-pa86tpgt.js";
53
- import"./index-zz5qsjd1.js";
51
+ import"./index-kggqpefz.js";
52
+ import"./index-bghwrr59.js";
53
+ import"./index-qyvjp0bq.js";
54
54
  import"./index-7g4c7s5r.js";
55
55
  import"./index-bpmtbmy9.js";
56
56
  import"./index-ed5ykebp.js";
@@ -23,17 +23,17 @@ import {
23
23
  validateLesson,
24
24
  validateSkillCandidatePath,
25
25
  validateSkillPath
26
- } from "./index-h4hasck4.js";
27
- import"./index-fp464as8.js";
26
+ } from "./index-jpppcckq.js";
27
+ import"./index-4p3qfb05.js";
28
28
  import"./index-rtry5xyf.js";
29
- import"./index-qfawexc8.js";
29
+ import"./index-6wf75rcm.js";
30
30
  import"./index-ae75rja9.js";
31
- import"./index-s72naw1j.js";
32
- import"./index-6q3agdmr.js";
31
+ import"./index-x8pm918t.js";
32
+ import"./index-j20fzn0w.js";
33
33
  import"./index-bk5tah7q.js";
34
- import"./index-4evasm2b.js";
35
- import"./index-pa86tpgt.js";
36
- import"./index-zz5qsjd1.js";
34
+ import"./index-kggqpefz.js";
35
+ import"./index-bghwrr59.js";
36
+ import"./index-qyvjp0bq.js";
37
37
  import"./index-7g4c7s5r.js";
38
38
  import"./index-bpmtbmy9.js";
39
39
  import"./index-ed5ykebp.js";
@@ -0,0 +1,170 @@
1
+ // @bun
2
+ import {
3
+ DEFAULT_MODELS,
4
+ init_constants
5
+ } from "./index-cpg98bh1.js";
6
+ import"./index-zjygnfay.js";
7
+ import"./index-a76rekgs.js";
8
+
9
+ // src/services/model-preflight.ts
10
+ init_constants();
11
+ var PROVIDER_LIST_TIMEOUT_MS = 2000;
12
+ function splitModelId(model) {
13
+ const separator = model.indexOf("/");
14
+ if (separator <= 0 || separator === model.length - 1)
15
+ return null;
16
+ return {
17
+ provider: model.slice(0, separator),
18
+ model: model.slice(separator + 1)
19
+ };
20
+ }
21
+ function collectConfiguredAgentModels(config) {
22
+ const collected = [];
23
+ const overriddenAgents = new Set;
24
+ const overrides = config?.agents ?? {};
25
+ for (const [agent, override] of Object.entries(overrides)) {
26
+ if (typeof override?.model === "string" && override.model.trim()) {
27
+ collected.push({
28
+ agent,
29
+ model: override.model.trim(),
30
+ source: "override"
31
+ });
32
+ overriddenAgents.add(agent);
33
+ }
34
+ for (const fallback of override?.fallback_models ?? []) {
35
+ if (typeof fallback === "string" && fallback.trim()) {
36
+ collected.push({
37
+ agent,
38
+ model: fallback.trim(),
39
+ source: "fallback"
40
+ });
41
+ }
42
+ }
43
+ }
44
+ for (const [agent, model] of Object.entries(DEFAULT_MODELS)) {
45
+ if (overriddenAgents.has(agent))
46
+ continue;
47
+ collected.push({ agent, model, source: "default" });
48
+ }
49
+ return collected;
50
+ }
51
+ var CATALOG_CACHE_TTL_MS = 30000;
52
+ var catalogCacheByClient = new WeakMap;
53
+ function invalidateProviderCatalogCache() {
54
+ catalogCacheByClient = new WeakMap;
55
+ }
56
+ async function fetchProviderCatalog(client) {
57
+ if (!client)
58
+ return null;
59
+ const cached = catalogCacheByClient.get(client);
60
+ if (cached && Date.now() - cached.fetchedAt < CATALOG_CACHE_TTL_MS) {
61
+ return cached.catalog;
62
+ }
63
+ let response;
64
+ try {
65
+ response = await _internals.providerList(client);
66
+ } catch {
67
+ return null;
68
+ }
69
+ const all = response?.data?.all;
70
+ if (!Array.isArray(all))
71
+ return null;
72
+ const catalog = new Map;
73
+ for (const provider of all) {
74
+ if (typeof provider?.id !== "string")
75
+ continue;
76
+ const models = new Set;
77
+ if (provider.models && typeof provider.models === "object") {
78
+ for (const modelKey of Object.keys(provider.models)) {
79
+ models.add(modelKey);
80
+ }
81
+ }
82
+ catalog.set(provider.id, models);
83
+ }
84
+ catalogCacheByClient.set(client, { fetchedAt: Date.now(), catalog });
85
+ return catalog;
86
+ }
87
+ function resolveAgainstCatalog(models, catalog) {
88
+ if (catalog === null) {
89
+ return {
90
+ catalogAvailable: false,
91
+ resolutions: models.map((entry) => ({
92
+ ...entry,
93
+ status: "unknown",
94
+ detail: "provider catalog unavailable; model resolution not checked"
95
+ }))
96
+ };
97
+ }
98
+ const resolutions = models.map((entry) => {
99
+ const split = splitModelId(entry.model);
100
+ if (!split) {
101
+ return {
102
+ ...entry,
103
+ status: "unknown",
104
+ detail: "model id has no provider prefix; resolution not checked against the catalog"
105
+ };
106
+ }
107
+ const providerModels = catalog.get(split.provider);
108
+ if (providerModels === undefined) {
109
+ return {
110
+ ...entry,
111
+ status: "unresolved",
112
+ detail: `provider "${split.provider}" is not present in the provider catalog`
113
+ };
114
+ }
115
+ if (!providerModels.has(split.model)) {
116
+ return {
117
+ ...entry,
118
+ status: "unresolved",
119
+ detail: `provider "${split.provider}" does not list model "${split.model}"`
120
+ };
121
+ }
122
+ return { ...entry, status: "ok" };
123
+ });
124
+ return { catalogAvailable: true, resolutions };
125
+ }
126
+ async function runModelPreflight(config, client) {
127
+ const models = collectConfiguredAgentModels(config);
128
+ const catalog = await fetchProviderCatalog(client);
129
+ return resolveAgainstCatalog(models, catalog);
130
+ }
131
+ async function checkSingleModelResolution(model, client) {
132
+ const catalog = await fetchProviderCatalog(client);
133
+ if (catalog === null)
134
+ return "unknown";
135
+ const split = splitModelId(model);
136
+ if (!split)
137
+ return "unknown";
138
+ const providerModels = catalog.get(split.provider);
139
+ if (providerModels === undefined || !providerModels.has(split.model)) {
140
+ return "unresolved";
141
+ }
142
+ return "ok";
143
+ }
144
+ var _internals = {
145
+ providerList: async (client) => {
146
+ let timer;
147
+ try {
148
+ return await Promise.race([
149
+ client.provider.list(),
150
+ new Promise((_, reject) => {
151
+ timer = setTimeout(() => reject(new Error("provider list timed out")), PROVIDER_LIST_TIMEOUT_MS);
152
+ })
153
+ ]);
154
+ } finally {
155
+ if (timer)
156
+ clearTimeout(timer);
157
+ }
158
+ }
159
+ };
160
+ export {
161
+ splitModelId,
162
+ runModelPreflight,
163
+ resolveAgainstCatalog,
164
+ invalidateProviderCatalogCache,
165
+ fetchProviderCatalog,
166
+ collectConfiguredAgentModels,
167
+ checkSingleModelResolution,
168
+ _internals,
169
+ PROVIDER_LIST_TIMEOUT_MS
170
+ };
@@ -54,13 +54,13 @@ import {
54
54
  sweepStaleDelegations,
55
55
  updateCoderSettlement,
56
56
  writeDelegationFallback
57
- } from "./index-ffdwj1an.js";
57
+ } from "./index-97psh79d.js";
58
58
  import"./index-w8pgjr75.js";
59
59
  import"./index-z6xqpmqg.js";
60
60
  import"./index-zj6t9zgx.js";
61
61
  import"./index-zjygnfay.js";
62
- import"./index-pa86tpgt.js";
63
- import"./index-zz5qsjd1.js";
62
+ import"./index-bghwrr59.js";
63
+ import"./index-qyvjp0bq.js";
64
64
  import"./index-7g4c7s5r.js";
65
65
  import"./index-bpmtbmy9.js";
66
66
  import"./index-ed5ykebp.js";
@@ -9,13 +9,13 @@ import {
9
9
  sweepStale,
10
10
  unsubscribe,
11
11
  updateSnapshot
12
- } from "./index-77ef8gye.js";
12
+ } from "./index-5e5a1y2r.js";
13
13
  import"./index-w8pgjr75.js";
14
14
  import"./index-z6xqpmqg.js";
15
15
  import"./index-zj6t9zgx.js";
16
16
  import"./index-zjygnfay.js";
17
- import"./index-pa86tpgt.js";
18
- import"./index-zz5qsjd1.js";
17
+ import"./index-bghwrr59.js";
18
+ import"./index-qyvjp0bq.js";
19
19
  import"./index-7g4c7s5r.js";
20
20
  import"./index-bpmtbmy9.js";
21
21
  import"./index-ed5ykebp.js";
@@ -3,14 +3,14 @@ import {
3
3
  _internals,
4
4
  createModelEvaluationExecutor,
5
5
  runEvaluation
6
- } from "./index-wk54ey3h.js";
7
- import"./index-jy9bwa9k.js";
6
+ } from "./index-0a0asz2s.js";
7
+ import"./index-nsr5b69r.js";
8
8
  import"./index-y8552snf.js";
9
9
  import"./index-zj6t9zgx.js";
10
- import"./index-6q3agdmr.js";
11
- import"./index-4evasm2b.js";
12
- import"./index-pa86tpgt.js";
13
- import"./index-zz5qsjd1.js";
10
+ import"./index-j20fzn0w.js";
11
+ import"./index-kggqpefz.js";
12
+ import"./index-bghwrr59.js";
13
+ import"./index-qyvjp0bq.js";
14
14
  import"./index-7g4c7s5r.js";
15
15
  import"./index-bpmtbmy9.js";
16
16
  import"./index-ed5ykebp.js";
@@ -4,17 +4,17 @@ import {
4
4
  alreadyCuratedThisGeneration,
5
5
  claimNextScanBatch,
6
6
  getScanStatus
7
- } from "./index-e00wbqw5.js";
8
- import"./index-qfawexc8.js";
7
+ } from "./index-np4ytvvv.js";
8
+ import"./index-6wf75rcm.js";
9
9
  import"./index-9e6fdz2h.js";
10
10
  import"./index-4rhhvd1a.js";
11
11
  import"./index-ae75rja9.js";
12
- import"./index-s72naw1j.js";
13
- import"./index-6q3agdmr.js";
12
+ import"./index-x8pm918t.js";
13
+ import"./index-j20fzn0w.js";
14
14
  import"./index-bk5tah7q.js";
15
- import"./index-4evasm2b.js";
16
- import"./index-pa86tpgt.js";
17
- import"./index-zz5qsjd1.js";
15
+ import"./index-kggqpefz.js";
16
+ import"./index-bghwrr59.js";
17
+ import"./index-qyvjp0bq.js";
18
18
  import"./index-7g4c7s5r.js";
19
19
  import"./index-bpmtbmy9.js";
20
20
  import"./index-ed5ykebp.js";
@@ -97,8 +97,8 @@ import {
97
97
  resolveGeneratedAgentRole,
98
98
  resolveGuardrailsConfig,
99
99
  stripKnownSwarmPrefix
100
- } from "./index-zfhe7vbb.js";
101
- import"./index-v3y3qg48.js";
100
+ } from "./index-gpnv14kq.js";
101
+ import"./index-cpg98bh1.js";
102
102
  import"./index-zjygnfay.js";
103
103
  import"./index-bk5tah7q.js";
104
104
  import"./index-bpmtbmy9.js";