@a-company/paradigm 3.46.0 → 5.3.3

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 (166) hide show
  1. package/dist/{accept-orchestration-ZUWQUHSK.js → accept-orchestration-GX2YRWM4.js} +5 -5
  2. package/dist/{add-VSPZ6FM4.js → add-FZRKEGH4.js} +1 -1
  3. package/dist/agent-HYKC2LAK.js +387 -0
  4. package/dist/agent-loader-SJPJJS33.js +36 -0
  5. package/dist/{agents-suggest-65SER5IS.js → agents-suggest-DNSYJ6IA.js} +1 -1
  6. package/dist/{aggregate-SV3VGEIL.js → aggregate-H57K7PNV.js} +1 -1
  7. package/dist/{assess-UHBDYIK7.js → assess-4WVXZLZQ.js} +2 -2
  8. package/dist/{auto-24ICVUH4.js → auto-QFS5NHQU.js} +1 -1
  9. package/dist/{beacon-3SJV4DAP.js → beacon-KXZXYQHX.js} +1 -1
  10. package/dist/{calibration-WWHK73WU.js → calibration-V46G7JTY.js} +2 -2
  11. package/dist/{check-OLI6AUS6.js → check-OWAIWV23.js} +1 -1
  12. package/dist/{chunk-RP6TZYGE.js → chunk-2IO7JAG2.js} +1 -1
  13. package/dist/chunk-2T6BTYBN.js +712 -0
  14. package/dist/{chunk-CDMAMDSG.js → chunk-5VKJBNJL.js} +13 -5
  15. package/dist/{chunk-KB4XJWE3.js → chunk-6N3JTACN.js} +98 -437
  16. package/dist/chunk-7N7GSU6K.js +34 -0
  17. package/dist/chunk-A2L4TSLZ.js +526 -0
  18. package/dist/{chunk-P7XSBJE3.js → chunk-ABVQGRF7.js} +1 -1
  19. package/dist/{chunk-HIKKOCXY.js → chunk-EI32ZBE6.js} +1 -1
  20. package/dist/{chunk-QIOCFXDQ.js → chunk-EKGMAM62.js} +1 -1
  21. package/dist/chunk-EZ3GOCYC.js +132 -0
  22. package/dist/chunk-GGMI6C2L.js +1075 -0
  23. package/dist/{chunk-DS5QY37M.js → chunk-GTR2TBIJ.js} +247 -15
  24. package/dist/{chunk-QDXI2DHR.js → chunk-J2JEQRT3.js} +1 -1
  25. package/dist/{chunk-AKIMFN6I.js → chunk-JASGXLK3.js} +2 -2
  26. package/dist/{chunk-J4E6K5MG.js → chunk-LSRABQIY.js} +25 -1
  27. package/dist/chunk-MCMOGQMU.js +145 -0
  28. package/dist/{chunk-ZXMDA7VB.js → chunk-PDX44BCA.js} +1 -6
  29. package/dist/{chunk-2SKXFXIT.js → chunk-S3ORKP3V.js} +10 -15
  30. package/dist/{chunk-ZMQA6SCO.js → chunk-S6MZ2IEX.js} +628 -228
  31. package/dist/chunk-TAIJOFOE.js +124 -0
  32. package/dist/{chunk-FS3WTUHY.js → chunk-TXESEO7Y.js} +6 -6
  33. package/dist/{chunk-7COU5S2Z.js → chunk-VL67H5IC.js} +1 -1
  34. package/dist/{chunk-QWA26UNO.js → chunk-WQITYKHM.js} +7 -7
  35. package/dist/{chunk-MW5DMGBB.js → chunk-YMDLDELF.js} +114 -55
  36. package/dist/{claude-63ISJAZK.js → claude-FRRWJSTJ.js} +1 -1
  37. package/dist/{claude-cli-ABML5RHX.js → claude-cli-XJLK2X4L.js} +1 -1
  38. package/dist/{claude-code-JRLMRPTO.js → claude-code-HTBA4XRB.js} +1 -1
  39. package/dist/{claude-code-teams-CAJBEFIZ.js → claude-code-teams-T4SP24MD.js} +1 -1
  40. package/dist/{conductor-HLWYWUVH.js → conductor-PGPDVIVE.js} +1 -1
  41. package/dist/{config-schema-3YNIFJCJ.js → config-schema-EA4XALGG.js} +4 -2
  42. package/dist/{constellation-FAGT45TU.js → constellation-A26CCGQS.js} +1 -1
  43. package/dist/{context-audit-557EO6PK.js → context-audit-RLO3ETRP.js} +8 -5
  44. package/dist/{cost-XEBADYFT.js → cost-BGM32XJU.js} +1 -1
  45. package/dist/{cost-UD3WPEKZ.js → cost-VI46A4XL.js} +1 -1
  46. package/dist/{cursor-cli-QUOOF2N4.js → cursor-cli-JVEZGHWQ.js} +1 -1
  47. package/dist/{cursorrules-3TKZ4E4R.js → cursorrules-HLIKJJZT.js} +1 -1
  48. package/dist/decision-loader-WWCLIQPJ.js +20 -0
  49. package/dist/{delete-RRK4RL6Y.js → delete-KBRPQLPC.js} +2 -2
  50. package/dist/{diff-IP5CIARP.js → diff-RQLLNAFI.js} +5 -5
  51. package/dist/{discipline-5F5OVTXB.js → discipline-FA4OZXIS.js} +1 -1
  52. package/dist/{dist-UXWV4OKX.js → dist-34NA5RS5.js} +1 -1
  53. package/dist/{dist-5QE2BB2B-X6DYVSUL.js → dist-5QE2BB2B-5S3T6Y3T.js} +1 -1
  54. package/dist/{dist-CM3MVWWW.js → dist-77JDTVAY.js} +1 -0
  55. package/dist/{dist-POMVY6WP.js → dist-QK4SQAK7.js} +1 -1
  56. package/dist/{dist-3RVKEJRT.js → dist-TA6LSC2Q.js} +1 -1
  57. package/dist/docs-LVLRPBAW.js +155 -0
  58. package/dist/docs-PBZB7LYP.js +89 -0
  59. package/dist/{doctor-GKZJU7QG.js → doctor-ULBOHEIC.js} +3 -3
  60. package/dist/{drift-YGT4LJ7Q.js → drift-R5NRKFHI.js} +1 -1
  61. package/dist/{echo-A6HD5UP7.js → echo-O2LY7CC2.js} +1 -1
  62. package/dist/{edit-4CLNN5JG.js → edit-R2HNLMOG.js} +2 -2
  63. package/dist/event-25OJKDCE.js +31 -0
  64. package/dist/{export-T7CMMJIB.js → export-IWVL7XLF.js} +1 -1
  65. package/dist/{flow-UFMPVOEM.js → flow-CRRVV3O3.js} +2 -2
  66. package/dist/{global-HHUJSBG5.js → global-3NG5JXUB.js} +1 -1
  67. package/dist/graduate-USAWGBJM.js +160 -0
  68. package/dist/{graph-YYUXI3F7.js → graph-VHUMAAS6.js} +2 -2
  69. package/dist/{graph-server-ZPXRSGCW.js → graph-server-YL22VBBN.js} +1 -1
  70. package/dist/{habits-RG5SVKXP.js → habits-OL5NGPXO.js} +3 -3
  71. package/dist/{history-CETCSUCP.js → history-WOWC573W.js} +1 -1
  72. package/dist/{hooks-TCUHQMPF.js → hooks-HFWSCGPV.js} +2 -2
  73. package/dist/index.js +290 -188
  74. package/dist/{integrity-MK2OP5TA.js → integrity-IHO4FZTS.js} +1 -1
  75. package/dist/{integrity-checker-J7YXRTBT.js → integrity-checker-PSKJA5SB.js} +1 -0
  76. package/dist/journal-loader-5EYSBFFY.js +18 -0
  77. package/dist/{lint-HYWGS3JJ.js → lint-K6CJGGPH.js} +1 -1
  78. package/dist/{list-IUCYPGMK.js → list-4YK7QKFF.js} +1 -1
  79. package/dist/{list-BTLFHSRC.js → list-ENR7Q4CR.js} +2 -2
  80. package/dist/{lore-loader-VTEEZDX3.js → lore-loader-7NO6N6FT.js} +4 -1
  81. package/dist/{lore-server-NOOAHKJX.js → lore-server-UNJY5KC3.js} +1 -1
  82. package/dist/{manual-AFJ2J2V3.js → manual-G6FISID5.js} +1 -1
  83. package/dist/mcp.js +3764 -359
  84. package/dist/{migrate-FQVGQNXZ.js → migrate-LS45DNEV.js} +2 -2
  85. package/dist/{migrate-assessments-JP6Q5KME.js → migrate-assessments-RGH4O6IX.js} +2 -2
  86. package/dist/nomination-engine-Q4XSXFKT.js +40 -0
  87. package/dist/notebook-YWIYGEHV.js +155 -0
  88. package/dist/{orchestrate-A226N6FC.js → orchestrate-XZA33TJC.js} +5 -5
  89. package/dist/{peers-RFQCWVLV.js → peers-DEOUIZM6.js} +1 -1
  90. package/dist/persona-UHAHIVST.js +390 -0
  91. package/dist/{pipeline-3G2FRAKM.js → pipeline-L4HCSBGN.js} +1 -1
  92. package/dist/{platform-server-H7Y6Q7O4.js → platform-server-PMD57BEG.js} +264 -18
  93. package/dist/{plugin-update-checker-HMRPGY5Z.js → plugin-update-checker-ELOEEQYS.js} +1 -0
  94. package/dist/{portal-check-FF5EKZE5.js → portal-check-NPYGII2D.js} +2 -2
  95. package/dist/{portal-compliance-VU4NIFEN.js → portal-compliance-J7DGAPFX.js} +2 -2
  96. package/dist/{probe-7JK7IDNI.js → probe-MHL5HQZ2.js} +3 -3
  97. package/dist/{promote-XO63XMAN.js → promote-F6ZYZZAL.js} +2 -2
  98. package/dist/{providers-YNFSL6HK.js → providers-GK7PB2OL.js} +2 -2
  99. package/dist/{quiz-I75NU2QQ.js → quiz-M66SC7F7.js} +1 -1
  100. package/dist/{record-46CLR4OG.js → record-RA4WR2BO.js} +2 -2
  101. package/dist/{reindex-WIJMCJ4A.js → reindex-HRA2AUS6.js} +3 -2
  102. package/dist/{remember-4EUZKIIB.js → remember-HBWJ655S.js} +1 -1
  103. package/dist/{retag-KC4JVRLE.js → retag-3OLCVDEQ.js} +2 -2
  104. package/dist/{review-Q7M4CRB5.js → review-27ATYTD2.js} +2 -2
  105. package/dist/review-57QMURZV.js +334 -0
  106. package/dist/{ripple-RI3LOT6R.js → ripple-JPBXP5I3.js} +1 -1
  107. package/dist/{sentinel-UOIGJWHH.js → sentinel-4XIG4STA.js} +2 -2
  108. package/dist/{sentinel-bridge-APDXYAZS.js → sentinel-bridge-MDUXTQRL.js} +2 -2
  109. package/dist/{serve-KKEHE44G.js → serve-FLTFTM3P.js} +2 -2
  110. package/dist/{serve-22A4XOIG.js → serve-INL7SNBK.js} +2 -2
  111. package/dist/{serve-2YJ6D2Y6.js → serve-KBSE36PL.js} +4 -4
  112. package/dist/{server-JV6UFGWZ.js → server-54SKYFFY.js} +2 -2
  113. package/dist/{server-RDLQ3DK7.js → server-XUOIO7E6.js} +1 -1
  114. package/dist/{setup-YNZJQLW7.js → setup-EDS27WUR.js} +1 -1
  115. package/dist/{setup-M2ZKLKNN.js → setup-KO5AFC4K.js} +2 -2
  116. package/dist/{shift-LNMKFYLR.js → shift-VFG23DLA.js} +16 -16
  117. package/dist/{show-P7GYO43X.js → show-5PV5KFJE.js} +2 -2
  118. package/dist/{show-PKZMYKRN.js → show-NQKYX6WQ.js} +1 -1
  119. package/dist/{snapshot-Y3COXK4T.js → snapshot-BK4RBPCG.js} +1 -1
  120. package/dist/{spawn-SSXZX45U.js → spawn-AW6GDECS.js} +3 -3
  121. package/dist/{status-KLHALGW4.js → status-WGIAQODY.js} +1 -1
  122. package/dist/{summary-5NQNOD3F.js → summary-NIRABMF5.js} +2 -2
  123. package/dist/{sweep-EZU3GU6S.js → sweep-QMHNSIY5.js} +2 -2
  124. package/dist/{switch-WYUMVNA5.js → switch-6EJPZDIA.js} +1 -1
  125. package/dist/{symphony-6K3HD7AW.js → symphony-4OCY36AI.js} +5 -5
  126. package/dist/{symphony-YCHBYN3E.js → symphony-B75X2MME.js} +2 -2
  127. package/dist/{symphony-peers-HSY3RI3S.js → symphony-peers-2ZQYLRNI.js} +1 -1
  128. package/dist/{symphony-peers-APOGJPF4.js → symphony-peers-OL7F6M5S.js} +1 -0
  129. package/dist/{symphony-relay-GTAJRCVF.js → symphony-relay-UJYUXN65.js} +28 -1
  130. package/dist/{sync-ZM4Q3R4U.js → sync-VEHUH4OA.js} +3 -3
  131. package/dist/{sync-llms-JIPP3XX4.js → sync-llms-YHCFIE6X.js} +2 -2
  132. package/dist/{task-loader-7M2FCBX6.js → task-loader-LDYWQSLM.js} +1 -0
  133. package/dist/{team-HGLJXWQG.js → team-7HG7XK5C.js} +6 -6
  134. package/dist/{test-WTR5Q33E.js → test-566CP5KC.js} +1 -1
  135. package/dist/{thread-3WM7KKID.js → thread-N754I4D5.js} +1 -1
  136. package/dist/{timeline-ANC7LVDL.js → timeline-M3CICQFE.js} +2 -2
  137. package/dist/{triage-IZ4MDYNB.js → triage-HHYGT3HY.js} +1 -1
  138. package/dist/{tutorial-GC6QL4US.js → tutorial-KD22SUNO.js} +1 -1
  139. package/dist/university-content/courses/.purpose +66 -0
  140. package/dist/university-content/courses/para-401.json +146 -0
  141. package/dist/university-content/courses/para-501.json +67 -0
  142. package/dist/university-content/courses/para-601.json +608 -0
  143. package/dist/university-content/plsat/.purpose +6 -0
  144. package/dist/university-content/plsat/v2.0.json +2 -2
  145. package/dist/university-content/plsat/v3.0.json +563 -3
  146. package/dist/university-content/reference.json +91 -0
  147. package/dist/{upgrade-ANX3LVSA.js → upgrade-H5PF32BW.js} +2 -2
  148. package/dist/{validate-GD5XWILV.js → validate-CNKEKO6A.js} +1 -1
  149. package/dist/{validate-ITC5D6QG.js → validate-MB5ULIHS.js} +1 -1
  150. package/dist/{validate-ZVPNN4FL.js → validate-QH3LADM6.js} +1 -1
  151. package/dist/{watch-X64UK7K4.js → watch-2TKP5PVL.js} +3 -3
  152. package/dist/{watch-ERBEJUJW.js → watch-ZF4ML6CD.js} +2 -2
  153. package/dist/{wisdom-L2WC7J62.js → wisdom-AATMGNFA.js} +1 -1
  154. package/dist/work-log-loader-5L45XNYZ.js +14 -0
  155. package/dist/{workspace-UIUTHZTD.js → workspace-6E6OSRNU.js} +4 -4
  156. package/package.json +1 -1
  157. package/platform-ui/dist/assets/DocsSection-ByAgPzWV.js +1 -0
  158. package/platform-ui/dist/assets/DocsSection-CjdO6R-u.css +1 -0
  159. package/platform-ui/dist/assets/{GitSection-BD3Ze06e.js → GitSection-BLovj9yT.js} +1 -1
  160. package/platform-ui/dist/assets/{GraphSection-SglITfSs.js → GraphSection-C5PCPUFl.js} +1 -1
  161. package/platform-ui/dist/assets/{LoreSection-bR5Km4Fd.js → LoreSection-BftejTla.js} +1 -1
  162. package/platform-ui/dist/assets/{SentinelSection-QSpAZArG.js → SentinelSection-CnYcasN7.js} +1 -1
  163. package/platform-ui/dist/assets/{SymphonySection-CobYJgvg.js → SymphonySection-BpmqCHeK.js} +1 -1
  164. package/platform-ui/dist/assets/{index-DbxeSMkV.js → index-G9JnWEs_.js} +10 -10
  165. package/platform-ui/dist/index.html +1 -1
  166. package/dist/dist-PSF5CP4I.js +0 -7294
@@ -0,0 +1,124 @@
1
+ #!/usr/bin/env node
2
+
3
+ // ../paradigm-mcp/src/utils/work-log-loader.ts
4
+ import * as fs from "fs";
5
+ import * as path from "path";
6
+ import * as yaml from "js-yaml";
7
+ var WORK_LOG_DIR = ".paradigm/work-log";
8
+ function generateWorkLogId(agent) {
9
+ const now = /* @__PURE__ */ new Date();
10
+ const date = now.toISOString().slice(0, 10);
11
+ const sanitized = agent.toLowerCase().replace(/[^a-z0-9-]/g, "-").slice(0, 20);
12
+ const counter = String(Math.floor(Math.random() * 999) + 1).padStart(3, "0");
13
+ return `WL-${sanitized}-${date}-${counter}`;
14
+ }
15
+ function getDateDir(rootDir, date) {
16
+ return path.join(rootDir, WORK_LOG_DIR, date);
17
+ }
18
+ function recordWorkLog(rootDir, entry) {
19
+ const now = /* @__PURE__ */ new Date();
20
+ const date = now.toISOString().slice(0, 10);
21
+ const id = generateWorkLogId(entry.agent);
22
+ const full = {
23
+ id,
24
+ timestamp: now.toISOString(),
25
+ ...entry
26
+ };
27
+ const dir = getDateDir(rootDir, date);
28
+ fs.mkdirSync(dir, { recursive: true });
29
+ const filePath = path.join(dir, `${id}.yaml`);
30
+ fs.writeFileSync(filePath, yaml.dump(full, { lineWidth: 120, noRefs: true }), "utf8");
31
+ return full;
32
+ }
33
+ function loadWorkLogEntries(rootDir, filter) {
34
+ const baseDir = path.join(rootDir, WORK_LOG_DIR);
35
+ if (!fs.existsSync(baseDir)) return [];
36
+ const entries = [];
37
+ const dateDirs = fs.readdirSync(baseDir, { withFileTypes: true }).filter((d) => d.isDirectory() && /^\d{4}-\d{2}-\d{2}$/.test(d.name)).map((d) => d.name).sort().reverse();
38
+ for (const dateDir of dateDirs) {
39
+ if (filter?.dateFrom && dateDir < filter.dateFrom) continue;
40
+ if (filter?.dateTo && dateDir > filter.dateTo) continue;
41
+ const dirPath = path.join(baseDir, dateDir);
42
+ const files = fs.readdirSync(dirPath).filter((f) => f.endsWith(".yaml"));
43
+ for (const file of files) {
44
+ try {
45
+ const content = fs.readFileSync(path.join(dirPath, file), "utf8");
46
+ const entry = yaml.load(content);
47
+ if (entry && entry.id) {
48
+ entries.push(entry);
49
+ }
50
+ } catch {
51
+ }
52
+ }
53
+ }
54
+ let filtered = entries;
55
+ if (filter?.agent) {
56
+ filtered = filtered.filter((e) => e.agent === filter.agent);
57
+ }
58
+ if (filter?.outcome) {
59
+ filtered = filtered.filter((e) => e.outcome === filter.outcome);
60
+ }
61
+ if (filter?.task_ref) {
62
+ filtered = filtered.filter((e) => e.task_ref === filter.task_ref);
63
+ }
64
+ if (filter?.symbol) {
65
+ filtered = filtered.filter((e) => e.symbols_touched?.includes(filter.symbol));
66
+ }
67
+ filtered.sort((a, b) => b.timestamp.localeCompare(a.timestamp));
68
+ if (filter?.limit) {
69
+ filtered = filtered.slice(0, filter.limit);
70
+ }
71
+ return filtered;
72
+ }
73
+ function loadWorkLogEntry(rootDir, id) {
74
+ const baseDir = path.join(rootDir, WORK_LOG_DIR);
75
+ if (!fs.existsSync(baseDir)) return null;
76
+ const match = id.match(/WL-[^-]+-(\d{4}-\d{2}-\d{2})-/);
77
+ if (match) {
78
+ const filePath = path.join(baseDir, match[1], `${id}.yaml`);
79
+ if (fs.existsSync(filePath)) {
80
+ const content = fs.readFileSync(filePath, "utf8");
81
+ return yaml.load(content);
82
+ }
83
+ }
84
+ const dateDirs = fs.readdirSync(baseDir, { withFileTypes: true }).filter((d) => d.isDirectory());
85
+ for (const dir of dateDirs) {
86
+ const filePath = path.join(baseDir, dir.name, `${id}.yaml`);
87
+ if (fs.existsSync(filePath)) {
88
+ const content = fs.readFileSync(filePath, "utf8");
89
+ return yaml.load(content);
90
+ }
91
+ }
92
+ return null;
93
+ }
94
+ function getWorkLogSummary(rootDir, days = 7) {
95
+ const cutoff = /* @__PURE__ */ new Date();
96
+ cutoff.setDate(cutoff.getDate() - days);
97
+ const dateFrom = cutoff.toISOString().slice(0, 10);
98
+ const entries = loadWorkLogEntries(rootDir, { dateFrom });
99
+ const byOutcome = { pass: 0, fail: 0, partial: 0, blocked: 0 };
100
+ const byAgent = {};
101
+ for (const e of entries) {
102
+ byOutcome[e.outcome] = (byOutcome[e.outcome] || 0) + 1;
103
+ byAgent[e.agent] = (byAgent[e.agent] || 0) + 1;
104
+ }
105
+ return {
106
+ total: entries.length,
107
+ byOutcome,
108
+ byAgent,
109
+ recentEntries: entries.slice(0, 10).map((e) => ({
110
+ id: e.id,
111
+ agent: e.agent,
112
+ summary: e.summary,
113
+ outcome: e.outcome,
114
+ timestamp: e.timestamp
115
+ }))
116
+ };
117
+ }
118
+
119
+ export {
120
+ recordWorkLog,
121
+ loadWorkLogEntries,
122
+ loadWorkLogEntry,
123
+ getWorkLogSummary
124
+ };
@@ -136,32 +136,32 @@ async function initializeProviders(rootDir) {
136
136
  if (initialized) return;
137
137
  const dir = rootDir || process.cwd();
138
138
  try {
139
- const { ClaudeAgentProvider } = await import("./claude-63ISJAZK.js");
139
+ const { ClaudeAgentProvider } = await import("./claude-FRRWJSTJ.js");
140
140
  registerProvider(new ClaudeAgentProvider());
141
141
  } catch {
142
142
  }
143
143
  try {
144
- const { ClaudeCodeTeamsProvider } = await import("./claude-code-teams-CAJBEFIZ.js");
144
+ const { ClaudeCodeTeamsProvider } = await import("./claude-code-teams-T4SP24MD.js");
145
145
  registerProvider(new ClaudeCodeTeamsProvider(dir));
146
146
  } catch {
147
147
  }
148
148
  try {
149
- const { ClaudeCodeTaskProvider } = await import("./claude-code-JRLMRPTO.js");
149
+ const { ClaudeCodeTaskProvider } = await import("./claude-code-HTBA4XRB.js");
150
150
  registerProvider(new ClaudeCodeTaskProvider(dir));
151
151
  } catch {
152
152
  }
153
153
  try {
154
- const { CursorCliProvider } = await import("./cursor-cli-QUOOF2N4.js");
154
+ const { CursorCliProvider } = await import("./cursor-cli-JVEZGHWQ.js");
155
155
  registerProvider(new CursorCliProvider());
156
156
  } catch {
157
157
  }
158
158
  try {
159
- const { ClaudeCliProvider } = await import("./claude-cli-ABML5RHX.js");
159
+ const { ClaudeCliProvider } = await import("./claude-cli-XJLK2X4L.js");
160
160
  registerProvider(new ClaudeCliProvider());
161
161
  } catch {
162
162
  }
163
163
  try {
164
- const { ManualProvider } = await import("./manual-AFJ2J2V3.js");
164
+ const { ManualProvider } = await import("./manual-G6FISID5.js");
165
165
  registerProvider(new ManualProvider(dir));
166
166
  } catch {
167
167
  }
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-ZGUAAVMA.js";
9
9
  import {
10
10
  cliBuildGraphState
11
- } from "./chunk-QDXI2DHR.js";
11
+ } from "./chunk-J2JEQRT3.js";
12
12
 
13
13
  // src/commands/scan/navigator.ts
14
14
  import * as fs from "fs";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  AgentSpawner,
4
4
  extractSymbols
5
- } from "./chunk-J4E6K5MG.js";
5
+ } from "./chunk-LSRABQIY.js";
6
6
  import {
7
7
  AuditLogger
8
8
  } from "./chunk-PBHIFAL4.js";
@@ -12,10 +12,6 @@ import {
12
12
  import {
13
13
  loadAgentsManifest
14
14
  } from "./chunk-PMXRGPRQ.js";
15
- import {
16
- extractDeclaredGates,
17
- loadPortalConfig
18
- } from "./chunk-MW5DMGBB.js";
19
15
  import {
20
16
  calculateCost
21
17
  } from "./chunk-5JGJACDU.js";
@@ -24,6 +20,10 @@ import {
24
20
  getReferencesTo,
25
21
  searchSymbols
26
22
  } from "./chunk-ZGUAAVMA.js";
23
+ import {
24
+ extractDeclaredGates,
25
+ loadPortalConfig
26
+ } from "./chunk-YMDLDELF.js";
27
27
 
28
28
  // src/core/orchestrator.ts
29
29
  import { minimatch } from "minimatch";
@@ -566,7 +566,7 @@ var Orchestrator = class {
566
566
  let preflightResult;
567
567
  if (options.pmGovernance?.enabled) {
568
568
  try {
569
- const { aggregateFromDirectory } = await import("./dist-UXWV4OKX.js");
569
+ const { aggregateFromDirectory } = await import("./dist-34NA5RS5.js");
570
570
  const aggregation = await aggregateFromDirectory(this.rootDir);
571
571
  const index = buildSymbolIndex(aggregation);
572
572
  preflightResult = runPreflight(task, this.rootDir, index);
@@ -593,7 +593,7 @@ var Orchestrator = class {
593
593
  }
594
594
  if (options.pmGovernance?.enabled && preflightResult) {
595
595
  try {
596
- const { aggregateFromDirectory } = await import("./dist-UXWV4OKX.js");
596
+ const { aggregateFromDirectory } = await import("./dist-34NA5RS5.js");
597
597
  const aggregation = await aggregateFromDirectory(this.rootDir);
598
598
  const index = buildSymbolIndex(aggregation);
599
599
  const filesModified = [];
@@ -4,7 +4,7 @@
4
4
  import * as fs from "fs";
5
5
  import * as path from "path";
6
6
  import * as yaml from "js-yaml";
7
- import { execSync } from "child_process";
7
+ import { execFileSync } from "child_process";
8
8
  var SKIP_DIRECTORIES = [
9
9
  "node_modules",
10
10
  ".git",
@@ -13,7 +13,9 @@ var SKIP_DIRECTORIES = [
13
13
  "coverage",
14
14
  ".paradigm",
15
15
  "vendor",
16
- "__pycache__"
16
+ "__pycache__",
17
+ ".next",
18
+ "target"
17
19
  ];
18
20
  function loadPortalConfig(rootDir) {
19
21
  const portalPath = path.join(rootDir, "portal.yaml");
@@ -46,32 +48,62 @@ function extractDeclaredGates(config) {
46
48
  }
47
49
  return Array.from(gates);
48
50
  }
51
+ function extractRouteAttachedGates(config) {
52
+ const gates = /* @__PURE__ */ new Set();
53
+ if (config.routes) {
54
+ for (const routeConfig of Object.values(config.routes)) {
55
+ const gateList = Array.isArray(routeConfig) ? routeConfig : routeConfig.gates || [];
56
+ for (const gate of gateList) {
57
+ const gateName = gate.startsWith("^") ? gate.slice(1) : gate;
58
+ gates.add(gateName);
59
+ }
60
+ }
61
+ }
62
+ return gates;
63
+ }
64
+ function runGrep(rootDir, pattern) {
65
+ const options = {
66
+ encoding: "utf-8",
67
+ maxBuffer: 10 * 1024 * 1024,
68
+ stdio: ["ignore", "pipe", "pipe"]
69
+ };
70
+ try {
71
+ const globArgs = SKIP_DIRECTORIES.flatMap((d) => ["--glob", `!${d}/**`]);
72
+ const rgArgs = ["-n", "--no-ignore-vcs", ...globArgs, "--engine", "auto", pattern, rootDir];
73
+ return execFileSync("rg", rgArgs, options);
74
+ } catch {
75
+ }
76
+ const skipDirArgs = SKIP_DIRECTORIES.map((d) => `--exclude-dir=${d}`);
77
+ const grepArgs = ["-rn", ...skipDirArgs, "-E", pattern, "--", rootDir];
78
+ try {
79
+ return execFileSync("grep", grepArgs, options);
80
+ } catch (err) {
81
+ const code = err?.code;
82
+ if (code === 1 || err?.status === 1) {
83
+ return "";
84
+ }
85
+ return "";
86
+ }
87
+ }
49
88
  function findGateReferences(rootDir) {
50
89
  const references = [];
51
- const skipDirsArg = SKIP_DIRECTORIES.map((d) => `--exclude-dir=${d}`).join(" ");
52
- try {
53
- const symbolPattern = "\\^[a-zA-Z][a-zA-Z0-9_-]+";
54
- const symbolResult = execSync(
55
- `grep -rn ${skipDirsArg} -E "${symbolPattern}" "${rootDir}" 2>/dev/null || true`,
56
- { encoding: "utf-8", maxBuffer: 10 * 1024 * 1024 }
57
- );
58
- for (const line of symbolResult.split("\n").filter(Boolean)) {
59
- const match = line.match(/^(.+?):(\d+):(.*)$/);
60
- if (match) {
61
- const [, file, lineNum, context] = match;
62
- const gateMatch = context.match(/\^([a-zA-Z][a-zA-Z0-9_-]+)/);
63
- if (gateMatch) {
64
- references.push({
65
- gate: gateMatch[1],
66
- file: path.relative(rootDir, file),
67
- line: parseInt(lineNum, 10),
68
- context: context.trim().slice(0, 100),
69
- matchType: "symbol"
70
- });
71
- }
90
+ const symbolPattern = "\\^[a-zA-Z][a-zA-Z0-9_-]+";
91
+ const symbolResult = runGrep(rootDir, symbolPattern);
92
+ for (const line of symbolResult.split("\n").filter(Boolean)) {
93
+ const match = line.match(/^(.+?):(\d+):(.*)$/);
94
+ if (match) {
95
+ const [, file, lineNum, context] = match;
96
+ const gateMatch = context.match(/\^([a-zA-Z][a-zA-Z0-9_-]+)/);
97
+ if (gateMatch) {
98
+ references.push({
99
+ gate: gateMatch[1],
100
+ file: path.relative(rootDir, file),
101
+ line: parseInt(lineNum, 10),
102
+ context: context.trim().slice(0, 100),
103
+ matchType: "symbol"
104
+ });
72
105
  }
73
106
  }
74
- } catch {
75
107
  }
76
108
  const functionPatterns = [
77
109
  { pattern: `checkGate\\s*\\(['"]([^'"]+)['"]`, type: "function" },
@@ -80,29 +112,23 @@ function findGateReferences(rootDir) {
80
112
  { pattern: `@Gate\\s*\\(['"]?([^'"\\)]+)['"]?\\)`, type: "function" }
81
113
  ];
82
114
  for (const { pattern, type } of functionPatterns) {
83
- try {
84
- const result = execSync(
85
- `grep -rn ${skipDirsArg} -E "${pattern}" "${rootDir}" 2>/dev/null || true`,
86
- { encoding: "utf-8", maxBuffer: 10 * 1024 * 1024 }
87
- );
88
- for (const line of result.split("\n").filter(Boolean)) {
89
- const match = line.match(/^(.+?):(\d+):(.*)$/);
90
- if (match) {
91
- const [, file, lineNum, context] = match;
92
- const gateMatch = context.match(new RegExp(pattern));
93
- if (gateMatch && gateMatch[1]) {
94
- const gateName = gateMatch[1].startsWith("^") ? gateMatch[1].slice(1) : gateMatch[1];
95
- references.push({
96
- gate: gateName,
97
- file: path.relative(rootDir, file),
98
- line: parseInt(lineNum, 10),
99
- context: context.trim().slice(0, 100),
100
- matchType: type
101
- });
102
- }
115
+ const result = runGrep(rootDir, pattern);
116
+ for (const line of result.split("\n").filter(Boolean)) {
117
+ const match = line.match(/^(.+?):(\d+):(.*)$/);
118
+ if (match) {
119
+ const [, file, lineNum, context] = match;
120
+ const gateMatch = context.match(new RegExp(pattern));
121
+ if (gateMatch && gateMatch[1]) {
122
+ const gateName = gateMatch[1].startsWith("^") ? gateMatch[1].slice(1) : gateMatch[1];
123
+ references.push({
124
+ gate: gateName,
125
+ file: path.relative(rootDir, file),
126
+ line: parseInt(lineNum, 10),
127
+ context: context.trim().slice(0, 100),
128
+ matchType: type
129
+ });
103
130
  }
104
131
  }
105
- } catch {
106
132
  }
107
133
  }
108
134
  return references;
@@ -119,6 +145,8 @@ async function checkPortalCompliance(rootDir) {
119
145
  return {
120
146
  status: "compliant",
121
147
  declaredButUnused: [],
148
+ routeAttachedUnused: [],
149
+ orphanUnused: [],
122
150
  usedButUndeclared: [],
123
151
  properlyDeclared: [],
124
152
  suggestions: ["No portal.yaml found, and no gate references detected in code."],
@@ -128,6 +156,8 @@ async function checkPortalCompliance(rootDir) {
128
156
  return {
129
157
  status: "violations",
130
158
  declaredButUnused: [],
159
+ routeAttachedUnused: [],
160
+ orphanUnused: [],
131
161
  usedButUndeclared: usedGates2,
132
162
  properlyDeclared: [],
133
163
  suggestions: [
@@ -141,18 +171,28 @@ async function checkPortalCompliance(rootDir) {
141
171
  };
142
172
  }
143
173
  const declaredGates = extractDeclaredGates(config);
174
+ const routeAttachedGates = extractRouteAttachedGates(config);
144
175
  const references = findGateReferences(rootDir);
145
176
  const usedGates = extractUniqueGates(references);
146
177
  const declaredSet = new Set(declaredGates);
147
178
  const usedSet = new Set(usedGates);
148
179
  const declaredButUnused = declaredGates.filter((g) => !usedSet.has(g));
180
+ const routeAttachedUnused = declaredButUnused.filter((g) => routeAttachedGates.has(g));
181
+ const orphanUnused = declaredButUnused.filter((g) => !routeAttachedGates.has(g));
149
182
  const usedButUndeclared = usedGates.filter((g) => !declaredSet.has(g));
150
183
  const properlyDeclared = declaredGates.filter((g) => usedSet.has(g));
151
184
  const suggestions = [];
152
- if (declaredButUnused.length > 0) {
153
- suggestions.push("Gates declared but never referenced:");
154
- for (const gate of declaredButUnused) {
155
- suggestions.push(` - ^${gate} (consider removing from portal.yaml or implementing)`);
185
+ if (routeAttachedUnused.length > 0) {
186
+ suggestions.push("Gates documented on routes but no checkGate/requireGate in code:");
187
+ for (const gate of routeAttachedUnused) {
188
+ suggestions.push(` - ^${gate} (documented on routes; if enforced by middleware, this may be intentional)`);
189
+ }
190
+ suggestions.push("");
191
+ }
192
+ if (orphanUnused.length > 0) {
193
+ suggestions.push("Orphan gates (declared but never on a route or in code):");
194
+ for (const gate of orphanUnused) {
195
+ suggestions.push(` - ^${gate} (add to a route or remove from portal.yaml)`);
156
196
  }
157
197
  suggestions.push("");
158
198
  }
@@ -172,6 +212,8 @@ async function checkPortalCompliance(rootDir) {
172
212
  return {
173
213
  status,
174
214
  declaredButUnused,
215
+ routeAttachedUnused,
216
+ orphanUnused,
175
217
  usedButUndeclared,
176
218
  properlyDeclared,
177
219
  suggestions,
@@ -184,8 +226,11 @@ function formatComplianceReport(report) {
184
226
  lines.push(`Portal Compliance: ${statusIcon} ${report.status.toUpperCase()}`);
185
227
  lines.push("");
186
228
  lines.push(`Properly Declared: ${report.properlyDeclared.length}`);
187
- if (report.declaredButUnused.length > 0) {
188
- lines.push(`Declared but Unused: ${report.declaredButUnused.length}`);
229
+ if (report.routeAttachedUnused.length > 0) {
230
+ lines.push(`Route-Attached, No Code: ${report.routeAttachedUnused.length}`);
231
+ }
232
+ if (report.orphanUnused.length > 0) {
233
+ lines.push(`Orphan Gates: ${report.orphanUnused.length}`);
189
234
  }
190
235
  if (report.usedButUndeclared.length > 0) {
191
236
  lines.push(`Used but Undeclared: ${report.usedButUndeclared.length}`);
@@ -198,9 +243,16 @@ function formatComplianceReport(report) {
198
243
  }
199
244
  lines.push("");
200
245
  }
201
- if (report.declaredButUnused.length > 0) {
202
- lines.push("Unused Gates (declared but never referenced):");
203
- for (const gate of report.declaredButUnused) {
246
+ if (report.routeAttachedUnused.length > 0) {
247
+ lines.push("Route-Attached (no checkGate/requireGate in code):");
248
+ for (const gate of report.routeAttachedUnused) {
249
+ lines.push(` \u26A0 ^${gate}`);
250
+ }
251
+ lines.push("");
252
+ }
253
+ if (report.orphanUnused.length > 0) {
254
+ lines.push("Orphan Gates (declared but never on route or in code):");
255
+ for (const gate of report.orphanUnused) {
204
256
  lines.push(` \u26A0 ^${gate}`);
205
257
  }
206
258
  lines.push("");
@@ -234,9 +286,16 @@ function getComplianceSummary(report) {
234
286
  };
235
287
  }
236
288
  if (report.status === "warnings") {
289
+ const parts = [];
290
+ if (report.routeAttachedUnused.length > 0) {
291
+ parts.push(`${report.routeAttachedUnused.length} route-attached`);
292
+ }
293
+ if (report.orphanUnused.length > 0) {
294
+ parts.push(`${report.orphanUnused.length} orphan`);
295
+ }
237
296
  return {
238
297
  status: "warn",
239
- message: `${report.declaredButUnused.length} unused gates`
298
+ message: parts.length > 0 ? parts.join(", ") + " gate(s)" : `${report.declaredButUnused.length} unused gates`
240
299
  };
241
300
  }
242
301
  return {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  MODEL_PRICING
4
4
  } from "./chunk-5JGJACDU.js";
5
- import "./chunk-ZXMDA7VB.js";
5
+ import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // src/core/providers/claude.ts
8
8
  var MODEL_IDS = {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  MODEL_PRICING
4
4
  } from "./chunk-5JGJACDU.js";
5
- import "./chunk-ZXMDA7VB.js";
5
+ import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // src/core/providers/claude-cli.ts
8
8
  import * as fs from "fs";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  MODEL_PRICING
4
4
  } from "./chunk-5JGJACDU.js";
5
- import "./chunk-ZXMDA7VB.js";
5
+ import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // src/core/providers/claude-code.ts
8
8
  import * as fs from "fs";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  MODEL_PRICING
4
4
  } from "./chunk-5JGJACDU.js";
5
- import "./chunk-ZXMDA7VB.js";
5
+ import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // src/core/providers/claude-code-teams.ts
8
8
  import * as fs from "fs";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  log
4
4
  } from "./chunk-4NCFWYGG.js";
5
- import "./chunk-ZXMDA7VB.js";
5
+ import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // src/commands/conductor.ts
8
8
  import { execSync, spawn } from "child_process";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-ZXMDA7VB.js";
2
+ import "./chunk-PDX44BCA.js";
3
3
 
4
4
  // src/core/config-schema.ts
5
5
  import { z } from "zod";
@@ -106,7 +106,9 @@ var KNOWN_TOP_LEVEL_KEYS = /* @__PURE__ */ new Set([
106
106
  "context",
107
107
  "probe",
108
108
  "states",
109
- "custom-symbols"
109
+ "custom-symbols",
110
+ "docs",
111
+ "features"
110
112
  ]);
111
113
  function validateConfig(content) {
112
114
  const warnings = [];
@@ -11,7 +11,7 @@ import "./chunk-IRKUEJVW.js";
11
11
  import {
12
12
  log
13
13
  } from "./chunk-4NCFWYGG.js";
14
- import "./chunk-ZXMDA7VB.js";
14
+ import "./chunk-PDX44BCA.js";
15
15
 
16
16
  // src/commands/constellation.ts
17
17
  import * as fs from "fs";
@@ -2,11 +2,12 @@
2
2
  import {
3
3
  log
4
4
  } from "./chunk-4NCFWYGG.js";
5
- import "./chunk-ZXMDA7VB.js";
5
+ import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // src/commands/doctor/context-audit.ts
8
8
  import * as fs from "fs";
9
9
  import * as path from "path";
10
+ import * as yaml from "js-yaml";
10
11
  var INSTRUCTION_FILES = ["CLAUDE.md", ".cursorrules", "AGENTS.md"];
11
12
  function loadInstructionFiles(rootDir) {
12
13
  const results = [];
@@ -94,6 +95,9 @@ async function checkStaleReferences(rootDir) {
94
95
  if (cleaned.startsWith("node_modules/")) continue;
95
96
  if (checked.has(cleaned)) continue;
96
97
  checked.add(cleaned);
98
+ const hasExt = /\.(ts|js|py|rs|go|yaml|yml|json|md|toml)(?:\/|$)/.test(cleaned);
99
+ const hasPathPrefix = /^(\.|src\/|packages\/|lib\/|app\/|docs\/)/.test(cleaned);
100
+ if (!hasExt && !hasPathPrefix) continue;
97
101
  const fullPath = path.join(rootDir, cleaned);
98
102
  if (!fs.existsSync(fullPath)) {
99
103
  stale.push(`${file.name}: ${cleaned}`);
@@ -406,8 +410,7 @@ async function checkStalePortal(rootDir) {
406
410
  }
407
411
  let portal;
408
412
  try {
409
- const { parse } = await import("./dist-PSF5CP4I.js");
410
- portal = parse(fs.readFileSync(portalPath, "utf8"));
413
+ portal = yaml.load(fs.readFileSync(portalPath, "utf8"));
411
414
  } catch {
412
415
  results.push({
413
416
  check: "stale-portal",
@@ -486,7 +489,7 @@ var VAGUE_PATTERNS = [
486
489
  { pattern: /\btry to\b/i, label: "try to" },
487
490
  { pattern: /\bmaybe\b/i, label: "maybe" },
488
491
  { pattern: /\bif possible\b/i, label: "if possible" },
489
- { pattern: /\bconsider\b/i, label: "consider" },
492
+ { pattern: /\bconsider\b(?!-handoff)/i, label: "consider" },
490
493
  { pattern: /\bmight want to\b/i, label: "might want to" },
491
494
  { pattern: /\byou could\b/i, label: "you could" },
492
495
  { pattern: /\boptionally\b/i, label: "optionally" }
@@ -547,7 +550,7 @@ async function checkConfigSchema(rootDir) {
547
550
  }
548
551
  try {
549
552
  const content = fs.readFileSync(configPath, "utf8");
550
- const { validateConfig } = await import("./config-schema-3YNIFJCJ.js");
553
+ const { validateConfig } = await import("./config-schema-EA4XALGG.js");
551
554
  const validation = validateConfig(content);
552
555
  const details = [];
553
556
  for (const err of validation.errors) {
@@ -6,7 +6,7 @@ import {
6
6
  formatCost,
7
7
  formatTokens
8
8
  } from "./chunk-5JGJACDU.js";
9
- import "./chunk-ZXMDA7VB.js";
9
+ import "./chunk-PDX44BCA.js";
10
10
 
11
11
  // src/commands/team/cost.ts
12
12
  import * as path from "path";
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  findGateFiles
7
7
  } from "./chunk-IRKUEJVW.js";
8
- import "./chunk-ZXMDA7VB.js";
8
+ import "./chunk-PDX44BCA.js";
9
9
 
10
10
  // src/commands/cost.ts
11
11
  import * as fs from "fs";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  MODEL_PRICING
4
4
  } from "./chunk-5JGJACDU.js";
5
- import "./chunk-ZXMDA7VB.js";
5
+ import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // src/core/providers/cursor-cli.ts
8
8
  import * as fs from "fs";
@@ -11,7 +11,7 @@ import {
11
11
  parseParadigmConfig,
12
12
  serializeParadigmConfig
13
13
  } from "./chunk-YO6DVTL7.js";
14
- import "./chunk-ZXMDA7VB.js";
14
+ import "./chunk-PDX44BCA.js";
15
15
 
16
16
  // src/commands/cursorrules.ts
17
17
  import * as fs from "fs";