@a-company/paradigm 5.10.0 → 5.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (409) hide show
  1. package/dist/accept-orchestration-IUAWQZUN.js +18 -0
  2. package/dist/add-P76GEMGF.js +8 -0
  3. package/dist/agent-UUTYOFTH.js +33 -0
  4. package/dist/agent-loader-EPXURMO7.js +2 -0
  5. package/dist/agent-loader-PYGPX6D2.js +2 -0
  6. package/dist/agent-state-KSQ3S7OB.js +2 -0
  7. package/dist/agents-suggest-HYTFMQD3.js +10 -0
  8. package/dist/aggregate-W66DM3GA.js +10 -0
  9. package/dist/ambient-HYZR42NX.js +35 -0
  10. package/dist/assess-UFPYEJKP.js +9 -0
  11. package/dist/auto-RHJXOZFL.js +14 -0
  12. package/dist/beacon-5QVYV5DF.js +13 -0
  13. package/dist/calibration-OLJYB5HN.js +7 -0
  14. package/dist/check-THVGY4R5.js +14 -0
  15. package/dist/chunk-22ISTMKI.js +31 -0
  16. package/dist/chunk-2QO33NYK.js +3 -0
  17. package/dist/chunk-33LKBMVK.js +134 -0
  18. package/dist/chunk-4QADCWPU.js +7 -0
  19. package/dist/chunk-4TXOVRWD.js +3 -0
  20. package/dist/chunk-4UJ4NIEQ.js +4 -0
  21. package/dist/chunk-4ZGGWZ32.js +3 -0
  22. package/dist/chunk-5TAVYPOV.js +2 -0
  23. package/dist/chunk-6EX37L4Q.js +8 -0
  24. package/dist/chunk-AD5TAD2A.js +5 -0
  25. package/dist/chunk-AGVAHVUA.js +2 -0
  26. package/dist/chunk-AO7ZSRME.js +13 -0
  27. package/dist/chunk-BFD3GFRK.js +2 -0
  28. package/dist/chunk-D34YFK4M.js +6 -0
  29. package/dist/chunk-DVZWCXB6.js +2 -0
  30. package/dist/chunk-EKZDFEJW.js +2 -0
  31. package/dist/chunk-ET5XJTSX.js +2 -0
  32. package/dist/chunk-FYDRENK7.js +3 -0
  33. package/dist/chunk-HMQ5BHP2.js +743 -0
  34. package/dist/chunk-HXKWL3VK.js +29 -0
  35. package/dist/chunk-IZSBGW6E.js +2 -0
  36. package/dist/chunk-J32OPJEX.js +2 -0
  37. package/dist/chunk-JBDMCRPP.js +7 -0
  38. package/dist/chunk-JIXHEBGK.js +7 -0
  39. package/dist/chunk-JNSJVCTU.js +2 -0
  40. package/dist/chunk-JQKKVAAN.js +2 -0
  41. package/dist/chunk-KLBH26PA.js +429 -0
  42. package/dist/chunk-L6K5HNDL.js +24 -0
  43. package/dist/chunk-LKAT7IAK.js +2 -0
  44. package/dist/chunk-M4UMM6DC.js +5 -0
  45. package/dist/chunk-NKYNHSA5.js +424 -0
  46. package/dist/chunk-NW6OKHE6.js +5 -0
  47. package/dist/chunk-NXRVR37G.js +60 -0
  48. package/dist/chunk-ODVKPZZ4.js +2 -0
  49. package/dist/chunk-PUBB7LIT.js +5 -0
  50. package/dist/chunk-Q2J542ST.js +2 -0
  51. package/dist/chunk-QGZRM6ZB.js +2 -0
  52. package/dist/chunk-QNZEG7IT.js +13 -0
  53. package/dist/chunk-QT2LKB3P.js +7 -0
  54. package/dist/chunk-RVRARWSY.js +9 -0
  55. package/dist/chunk-T6IDXUUA.js +2 -0
  56. package/dist/chunk-TYWB5IQJ.js +3 -0
  57. package/dist/chunk-UIKLE3WD.js +2 -0
  58. package/dist/chunk-V7K6CQVX.js +111 -0
  59. package/dist/chunk-VCKKJDLP.js +8 -0
  60. package/dist/chunk-VG7FN2TU.js +4 -0
  61. package/dist/chunk-W5IWDW4Y.js +16 -0
  62. package/dist/chunk-W7C6FFMO.js +8 -0
  63. package/dist/chunk-WESTEMIM.js +10 -0
  64. package/dist/chunk-WR6D3SC6.js +5 -0
  65. package/dist/chunk-WS2N27RX.js +3 -0
  66. package/dist/chunk-XMAV5AG6.js +2 -0
  67. package/dist/chunk-XROULIQN.js +2 -0
  68. package/dist/chunk-XUFYOXOU.js +3 -0
  69. package/dist/chunk-Y4XFVDZC.js +3 -0
  70. package/dist/chunk-Y6KXTQBG.js +2 -0
  71. package/dist/{chunk-GTR2TBIJ.js → chunk-Z2UZUCY6.js} +237 -1047
  72. package/dist/chunk-Z34K6GY2.js +8 -0
  73. package/dist/claude-4LR3LJQZ.js +13 -0
  74. package/dist/claude-cli-UP6HGH7C.js +6 -0
  75. package/dist/claude-code-RLJ4GX77.js +11 -0
  76. package/dist/claude-code-teams-R37HJY3Y.js +29 -0
  77. package/dist/commands-LMUD5L6R.js +455 -0
  78. package/dist/compliance-GZ7UAOG3.js +6 -0
  79. package/dist/conductor-Y5IXELTL.js +4 -0
  80. package/dist/config-schema-HR7LDEQ6.js +2 -0
  81. package/dist/constellation-CG7C4WFE.js +13 -0
  82. package/dist/context-audit-RSSRX6XC.js +6 -0
  83. package/dist/cost-IDNVMAEV.js +10 -0
  84. package/dist/cost-PK4KIF7R.js +2 -0
  85. package/dist/cursor-cli-QKF7Z6M2.js +4 -0
  86. package/dist/cursorrules-U5O4G5T4.js +14 -0
  87. package/dist/decision-loader-2XPZE4EZ.js +2 -0
  88. package/dist/delete-P5VULXR4.js +14 -0
  89. package/dist/diff-RTFUKJHF.js +9 -0
  90. package/dist/discipline-H7LDI6NT.js +2 -0
  91. package/dist/dist-3ZCH25SG.js +2 -0
  92. package/dist/dist-KGRCLBJP-2QAPFYNF.js +39 -0
  93. package/dist/dist-R3RWD35F.js +2 -0
  94. package/dist/dist-VGFSP3XM.js +2 -0
  95. package/dist/dist-VXCZWVVJ.js +2 -0
  96. package/dist/dist-W3XCATBJ.js +2 -0
  97. package/dist/docs-EDQ2STFK.js +2 -0
  98. package/dist/docs-RXPN6CK7.js +12 -0
  99. package/dist/doctor-2T2QL6VM.js +2 -0
  100. package/dist/drift-ILZE5BFJ.js +13 -0
  101. package/dist/echo-UPTQUEDU.js +46 -0
  102. package/dist/edit-GUU3HBVW.js +9 -0
  103. package/dist/event-Y3VXC2RV.js +3 -0
  104. package/dist/explain-files-3GPZUETV.js +4 -0
  105. package/dist/export-CV5KCTPS.js +2 -0
  106. package/dist/flow-S3RQ4YPY.js +11 -0
  107. package/dist/global-C44FW4G2.js +13 -0
  108. package/dist/graduate-3BBSC27A.js +5 -0
  109. package/dist/graph-CNDE5TAT.js +2 -0
  110. package/dist/graph-server-COZR5C3Z.js +14 -0
  111. package/dist/habits-4J2KRYUL.js +42 -0
  112. package/dist/history-UW454SDP.js +12 -0
  113. package/dist/hooks-XH52VGOU.js +2 -0
  114. package/dist/index.js +15 -1039
  115. package/dist/init-24MAQJFM.js +2 -0
  116. package/dist/integrity-UYDOOJDP.js +7 -0
  117. package/dist/integrity-checker-DHGMZQDG.js +2 -0
  118. package/dist/journal-loader-GLH7XFTK.js +2 -0
  119. package/dist/lint-IGKE6UPS.js +26 -0
  120. package/dist/list-5IUGP3ZB.js +7 -0
  121. package/dist/list-YKIQNKGB.js +6 -0
  122. package/dist/lore-loader-RVQI5GXL.js +2 -0
  123. package/dist/lore-loader-XY5MZRR2.js +2 -0
  124. package/dist/lore-server-FC2GMDLT.js +14 -0
  125. package/dist/manual-RXSPSFLL.js +20 -0
  126. package/dist/mcp.js +93 -20484
  127. package/dist/migrate-X5OMAFAQ.js +59 -0
  128. package/dist/migrate-assessments-GEI5WMI2.js +4 -0
  129. package/dist/model-discovery-HMB3YI4L.js +2 -0
  130. package/dist/nomination-engine-XF7TWPAP.js +2 -0
  131. package/dist/notebook-PE3JSYZI.js +11 -0
  132. package/dist/notebook-loader-CENTDDUJ.js +2 -0
  133. package/dist/orchestrate-35HBQ3O3.js +8 -0
  134. package/dist/peers-P2KXU7ZK.js +5 -0
  135. package/dist/persona-STQWZH5P.js +29 -0
  136. package/dist/pipeline-MZUITRVN.js +4 -0
  137. package/dist/platform-server-2KXHGHFV.js +25 -0
  138. package/dist/plugin-update-checker-M7PW434O.js +2 -0
  139. package/dist/portal-check-3JVNLOEP.js +8 -0
  140. package/dist/portal-compliance-2UG4VKWH.js +2 -0
  141. package/dist/probe-5L5BQDGE.js +6 -0
  142. package/dist/project-type-SURTOIG7.js +2 -0
  143. package/dist/promote-NJQDZBZA.js +8 -0
  144. package/dist/providers-4PXMWA7V.js +8 -0
  145. package/dist/quiz-FE5UGAY2.js +10 -0
  146. package/dist/record-YXPB34MY.js +6 -0
  147. package/dist/reindex-PGDQSM42.js +2 -0
  148. package/dist/remember-MJRNTXYS.js +14 -0
  149. package/dist/retag-N5XF3KXP.js +6 -0
  150. package/dist/review-6UAH6V3R.js +11 -0
  151. package/dist/review-77QI6VOC.js +6 -0
  152. package/dist/ripple-ZGDITCGB.js +10 -0
  153. package/dist/roster-FLRZ5J42.js +2 -0
  154. package/dist/sentinel-HYAZ3CO5.js +19 -0
  155. package/dist/sentinel-bridge-VR357PKL.js +2 -0
  156. package/dist/sentinel-mcp.js +38 -3808
  157. package/dist/sentinel.js +1 -34
  158. package/dist/serve-JE6UF5P2.js +8 -0
  159. package/dist/serve-L52ZUTU6.js +10 -0
  160. package/dist/serve-OY6XYL7F.js +12 -0
  161. package/dist/server-2MNROHF6.js +7 -0
  162. package/dist/server-4YNUIK4W.js +8 -0
  163. package/dist/session-tracker-SKOMBDOW.js +2 -0
  164. package/dist/session-work-log-3MNUDEZ6.js +2 -0
  165. package/dist/session-work-log-J2H5OZBR.js +2 -0
  166. package/dist/setup-3F5IK7MO.js +31 -0
  167. package/dist/setup-KPIMRZ4Q.js +2 -0
  168. package/dist/shift-6GCNH666.js +11 -0
  169. package/dist/show-BOAVWZPZ.js +7 -0
  170. package/dist/show-PJ5LFLIL.js +5 -0
  171. package/dist/snapshot-L2G56RPL.js +8 -0
  172. package/dist/spawn-UH5RENSE.js +12 -0
  173. package/dist/status-77M3SDIF.js +8 -0
  174. package/dist/status-A37ECYNJ.js +6 -0
  175. package/dist/summary-ZJLQ6KHB.js +7 -0
  176. package/dist/sweep-HU74OPVW.js +17 -0
  177. package/dist/switch-CTW4PDGI.js +17 -0
  178. package/dist/symphony-3QMBGCZY.js +2 -0
  179. package/dist/symphony-QI63XL62.js +53 -0
  180. package/dist/symphony-loader-XACVV2E3.js +2 -0
  181. package/dist/symphony-peers-U4KHMKGI.js +2 -0
  182. package/dist/symphony-peers-X5NGWXFP.js +2 -0
  183. package/dist/symphony-relay-5GY5JIPT.js +3 -0
  184. package/dist/sync-QRDSFETO.js +2 -0
  185. package/dist/sync-llms-HL5PPW3M.js +15 -0
  186. package/dist/task-loader-NZFDTUQ5.js +2 -0
  187. package/dist/team-WGERKGNP.js +2 -0
  188. package/dist/test-BQJMS4Y2.js +111 -0
  189. package/dist/thread-HFXK65D4.js +41 -0
  190. package/dist/timeline-K3ZFKJ3R.js +6 -0
  191. package/dist/triage-FCWOZASE.js +18 -0
  192. package/dist/tutorial-UC6YQMNN.js +305 -0
  193. package/dist/university-content/courses/.purpose +74 -5
  194. package/dist/university-content/courses/para-701.json +807 -0
  195. package/dist/university-content/plsat/.purpose +3 -2
  196. package/dist/university-ui/assets/{index-BjewBB6s.js → index-CGFJczb1.js} +2 -2
  197. package/dist/university-ui/assets/{index-BjewBB6s.js.map → index-CGFJczb1.js.map} +1 -1
  198. package/dist/university-ui/index.html +1 -1
  199. package/dist/upgrade-B4IOLZYK.js +53 -0
  200. package/dist/validate-C6SMKGYD.js +9 -0
  201. package/dist/validate-LSCDOLBO.js +13 -0
  202. package/dist/validate-VZXTJHGO.js +6 -0
  203. package/dist/watch-LRM5XD46.js +8 -0
  204. package/dist/watch-PZCCUP6K.js +9 -0
  205. package/dist/wisdom-XZ3QKPNP.js +7 -0
  206. package/dist/work-log-loader-DL5GZ2BQ.js +2 -0
  207. package/dist/workspace-2ODL5WLY.js +2 -0
  208. package/package.json +1 -1
  209. package/platform-ui/dist/assets/AmbientSection-DqQ2mfCO.js +1 -0
  210. package/platform-ui/dist/assets/{CanvasSection-DwPTRdIN.js → CanvasSection-DLW0s-Bu.js} +1 -1
  211. package/platform-ui/dist/assets/{DocsSection-BJc_ws4I.js → DocsSection-BQ9Hi51g.js} +1 -1
  212. package/platform-ui/dist/assets/{GitSection-DhqBo1xc.js → GitSection-QQeUX6o3.js} +1 -1
  213. package/platform-ui/dist/assets/{GraphSection-D9fhVnZ0.js → GraphSection-0c9C-w7K.js} +2 -2
  214. package/platform-ui/dist/assets/{GraphSection-BlgXTl53.css → GraphSection-Bbs2a8sC.css} +1 -1
  215. package/platform-ui/dist/assets/LoreSection--t56kCj2.js +1 -0
  216. package/platform-ui/dist/assets/LoreSection-qnmm3o4y.css +1 -0
  217. package/platform-ui/dist/assets/SentinelSection-C4OoME9U.js +1 -0
  218. package/platform-ui/dist/assets/{SymphonySection-BRoBaUSS.js → SymphonySection-B-rvsLxq.js} +1 -1
  219. package/platform-ui/dist/assets/TeamSection-CBFmNEEo.js +1 -0
  220. package/platform-ui/dist/assets/index-Bxp0TVaf.css +1 -0
  221. package/platform-ui/dist/assets/index-DPpOdAtC.js +57 -0
  222. package/platform-ui/dist/index.html +2 -2
  223. package/dist/accept-orchestration-UQLM7PTQ.js +0 -189
  224. package/dist/add-FZRKEGH4.js +0 -81
  225. package/dist/agent-WERIO2XV.js +0 -523
  226. package/dist/agent-loader-TFIANSF4.js +0 -44
  227. package/dist/agent-state-S5DAWPTF.js +0 -24
  228. package/dist/agents-suggest-DNSYJ6IA.js +0 -83
  229. package/dist/aggregate-H57K7PNV.js +0 -88
  230. package/dist/assess-4WVXZLZQ.js +0 -68
  231. package/dist/auto-QFS5NHQU.js +0 -504
  232. package/dist/beacon-KXZXYQHX.js +0 -251
  233. package/dist/calibration-V46G7JTY.js +0 -135
  234. package/dist/check-OWAIWV23.js +0 -175
  235. package/dist/chunk-2IO7JAG2.js +0 -148
  236. package/dist/chunk-2T6BTYBN.js +0 -712
  237. package/dist/chunk-36TKPM5Z.js +0 -400
  238. package/dist/chunk-45MUDW6E.js +0 -804
  239. package/dist/chunk-4BLYIB7J.js +0 -5701
  240. package/dist/chunk-4L3UTYQX.js +0 -677
  241. package/dist/chunk-4NCFWYGG.js +0 -110
  242. package/dist/chunk-54LTTQBH.js +0 -138
  243. package/dist/chunk-5EWAQHFY.js +0 -269
  244. package/dist/chunk-5JGJACDU.js +0 -37
  245. package/dist/chunk-5OUOLN6M.js +0 -659
  246. package/dist/chunk-5VKJBNJL.js +0 -444
  247. package/dist/chunk-6N3JTACN.js +0 -2260
  248. package/dist/chunk-6QC3YGB6.js +0 -114
  249. package/dist/chunk-7N7GSU6K.js +0 -34
  250. package/dist/chunk-ABVQGRF7.js +0 -268
  251. package/dist/chunk-CL7JSK52.js +0 -129
  252. package/dist/chunk-CSD7IHSN.js +0 -152
  253. package/dist/chunk-EDOAWN7J.js +0 -717
  254. package/dist/chunk-EKGMAM62.js +0 -525
  255. package/dist/chunk-EZ3GOCYC.js +0 -132
  256. package/dist/chunk-F3BCHPYT.js +0 -143
  257. package/dist/chunk-FKJUBQU3.js +0 -3081
  258. package/dist/chunk-GT5QGC2H.js +0 -253
  259. package/dist/chunk-GZDFVP2N.js +0 -540
  260. package/dist/chunk-IRKUEJVW.js +0 -405
  261. package/dist/chunk-J2JEQRT3.js +0 -164
  262. package/dist/chunk-JASGXLK3.js +0 -679
  263. package/dist/chunk-KVDYJLTC.js +0 -121
  264. package/dist/chunk-L27I3CPZ.js +0 -357
  265. package/dist/chunk-LHLIAYQ3.js +0 -185
  266. package/dist/chunk-MCMOGQMU.js +0 -145
  267. package/dist/chunk-NQKQG45G.js +0 -688
  268. package/dist/chunk-PBHIFAL4.js +0 -259
  269. package/dist/chunk-PDX44BCA.js +0 -11
  270. package/dist/chunk-PMXRGPRQ.js +0 -305
  271. package/dist/chunk-RAB5IKPR.js +0 -487
  272. package/dist/chunk-RJE5G7WO.js +0 -590
  273. package/dist/chunk-RTHA3XRE.js +0 -880
  274. package/dist/chunk-S2HO5MLR.js +0 -621
  275. package/dist/chunk-S3ORKP3V.js +0 -716
  276. package/dist/chunk-TAIJOFOE.js +0 -124
  277. package/dist/chunk-TXESEO7Y.js +0 -245
  278. package/dist/chunk-UPLDI7CN.js +0 -1334
  279. package/dist/chunk-VL67H5IC.js +0 -506
  280. package/dist/chunk-VPPK3SY4.js +0 -1136
  281. package/dist/chunk-YMDLDELF.js +0 -314
  282. package/dist/chunk-YO6DVTL7.js +0 -99
  283. package/dist/chunk-YRZ5RPEB.js +0 -1561
  284. package/dist/chunk-ZDHLG5VP.js +0 -5676
  285. package/dist/chunk-ZGUAAVMA.js +0 -756
  286. package/dist/chunk-ZSYVKSY6.js +0 -2602
  287. package/dist/claude-FRRWJSTJ.js +0 -362
  288. package/dist/claude-cli-XJLK2X4L.js +0 -276
  289. package/dist/claude-code-HTBA4XRB.js +0 -126
  290. package/dist/claude-code-teams-T4SP24MD.js +0 -199
  291. package/dist/commands-5N4ILTPH.js +0 -5859
  292. package/dist/conductor-CQVGTEQN.js +0 -161
  293. package/dist/config-schema-EA4XALGG.js +0 -154
  294. package/dist/constellation-A26CCGQS.js +0 -225
  295. package/dist/context-audit-RLO3ETRP.js +0 -682
  296. package/dist/cost-BGM32XJU.js +0 -93
  297. package/dist/cost-VI46A4XL.js +0 -174
  298. package/dist/cursor-cli-JVEZGHWQ.js +0 -269
  299. package/dist/cursorrules-HLIKJJZT.js +0 -84
  300. package/dist/decision-loader-WWCLIQPJ.js +0 -20
  301. package/dist/delete-KBRPQLPC.js +0 -56
  302. package/dist/diff-D4X53HAC.js +0 -126
  303. package/dist/discipline-FA4OZXIS.js +0 -24
  304. package/dist/dist-34NA5RS5.js +0 -74
  305. package/dist/dist-5QE2BB2B-5S3T6Y3T.js +0 -6919
  306. package/dist/dist-77JDTVAY.js +0 -62
  307. package/dist/dist-OGTSAZ55.js +0 -1358
  308. package/dist/dist-QK4SQAK7.js +0 -64
  309. package/dist/dist-TA6LSC2Q.js +0 -20
  310. package/dist/docs-PBZB7LYP.js +0 -89
  311. package/dist/docs-QIYKO3BR.js +0 -155
  312. package/dist/doctor-ULBOHEIC.js +0 -11
  313. package/dist/drift-R5NRKFHI.js +0 -251
  314. package/dist/echo-O2LY7CC2.js +0 -248
  315. package/dist/edit-R2HNLMOG.js +0 -63
  316. package/dist/event-25OJKDCE.js +0 -31
  317. package/dist/export-IWVL7XLF.js +0 -38
  318. package/dist/flow-CRRVV3O3.js +0 -185
  319. package/dist/global-3NG5JXUB.js +0 -136
  320. package/dist/graduate-USAWGBJM.js +0 -160
  321. package/dist/graph-VHUMAAS6.js +0 -12
  322. package/dist/graph-server-YL22VBBN.js +0 -116
  323. package/dist/habits-OL5NGPXO.js +0 -1405
  324. package/dist/history-WOWC573W.js +0 -277
  325. package/dist/hooks-HFWSCGPV.js +0 -12
  326. package/dist/integrity-IHO4FZTS.js +0 -194
  327. package/dist/integrity-checker-PSKJA5SB.js +0 -12
  328. package/dist/journal-loader-5EYSBFFY.js +0 -18
  329. package/dist/lint-K6CJGGPH.js +0 -456
  330. package/dist/list-4YK7QKFF.js +0 -57
  331. package/dist/list-ENR7Q4CR.js +0 -56
  332. package/dist/lore-loader-7NO6N6FT.js +0 -26
  333. package/dist/lore-server-UNJY5KC3.js +0 -118
  334. package/dist/manual-G6FISID5.js +0 -204
  335. package/dist/migrate-LS45DNEV.js +0 -889
  336. package/dist/migrate-assessments-RGH4O6IX.js +0 -97
  337. package/dist/model-discovery-D2H3VBGC.js +0 -8
  338. package/dist/nomination-engine-RV5CNO5B.js +0 -42
  339. package/dist/notebook-YWIYGEHV.js +0 -155
  340. package/dist/orchestrate-JLILBBJE.js +0 -324
  341. package/dist/peers-DEOUIZM6.js +0 -82
  342. package/dist/persona-UHAHIVST.js +0 -390
  343. package/dist/pipeline-L4HCSBGN.js +0 -263
  344. package/dist/platform-server-H5YO3DQD.js +0 -1475
  345. package/dist/plugin-update-checker-KRRSGXMV.js +0 -12
  346. package/dist/portal-check-NPYGII2D.js +0 -42
  347. package/dist/portal-compliance-J7DGAPFX.js +0 -18
  348. package/dist/probe-MHL5HQZ2.js +0 -167
  349. package/dist/promote-F6ZYZZAL.js +0 -182
  350. package/dist/providers-GK7PB2OL.js +0 -104
  351. package/dist/quiz-M66SC7F7.js +0 -99
  352. package/dist/record-RA4WR2BO.js +0 -49
  353. package/dist/reindex-5LTD53ZC.js +0 -16
  354. package/dist/remember-HBWJ655S.js +0 -77
  355. package/dist/retag-3OLCVDEQ.js +0 -62
  356. package/dist/review-27ATYTD2.js +0 -33
  357. package/dist/review-57QMURZV.js +0 -334
  358. package/dist/ripple-JPBXP5I3.js +0 -215
  359. package/dist/sentinel-4XIG4STA.js +0 -63
  360. package/dist/sentinel-bridge-MDUXTQRL.js +0 -109
  361. package/dist/serve-CAH3PHE7.js +0 -33
  362. package/dist/serve-INL7SNBK.js +0 -36
  363. package/dist/serve-KBSE36PL.js +0 -49
  364. package/dist/server-54SKYFFY.js +0 -1647
  365. package/dist/server-XUOIO7E6.js +0 -338
  366. package/dist/session-tracker-C4BMD5WG.js +0 -13
  367. package/dist/session-work-log-MZ47OAPB.js +0 -20
  368. package/dist/setup-EDS27WUR.js +0 -25
  369. package/dist/setup-KO5AFC4K.js +0 -296
  370. package/dist/shift-D2JOHHBF.js +0 -668
  371. package/dist/show-5PV5KFJE.js +0 -176
  372. package/dist/show-NQKYX6WQ.js +0 -82
  373. package/dist/snapshot-BK4RBPCG.js +0 -62
  374. package/dist/spawn-RCHNXDHE.js +0 -196
  375. package/dist/status-WGIAQODY.js +0 -71
  376. package/dist/summary-NIRABMF5.js +0 -140
  377. package/dist/sweep-QMHNSIY5.js +0 -934
  378. package/dist/switch-6EJPZDIA.js +0 -232
  379. package/dist/symphony-4OCY36AI.js +0 -791
  380. package/dist/symphony-B75X2MME.js +0 -326
  381. package/dist/symphony-loader-UZGON56V.js +0 -90
  382. package/dist/symphony-peers-2ZQYLRNI.js +0 -34
  383. package/dist/symphony-peers-OL7F6M5S.js +0 -121
  384. package/dist/symphony-relay-UJYUXN65.js +0 -710
  385. package/dist/sync-VEHUH4OA.js +0 -11
  386. package/dist/sync-llms-YHCFIE6X.js +0 -166
  387. package/dist/task-loader-LDYWQSLM.js +0 -20
  388. package/dist/team-O5MIIFMA.js +0 -34
  389. package/dist/test-566CP5KC.js +0 -1017
  390. package/dist/thread-N754I4D5.js +0 -274
  391. package/dist/timeline-M3CICQFE.js +0 -112
  392. package/dist/triage-HHYGT3HY.js +0 -671
  393. package/dist/tutorial-KD22SUNO.js +0 -666
  394. package/dist/upgrade-H5PF32BW.js +0 -551
  395. package/dist/validate-CNKEKO6A.js +0 -134
  396. package/dist/validate-MB5ULIHS.js +0 -39
  397. package/dist/validate-QH3LADM6.js +0 -64
  398. package/dist/watch-2TKP5PVL.js +0 -199
  399. package/dist/watch-ZF4ML6CD.js +0 -111
  400. package/dist/wisdom-AATMGNFA.js +0 -319
  401. package/dist/work-log-loader-5L45XNYZ.js +0 -14
  402. package/dist/workspace-6E6OSRNU.js +0 -21
  403. package/platform-ui/dist/assets/AmbientSection-WtHfNedO.js +0 -1
  404. package/platform-ui/dist/assets/LoreSection-C3EixkjW.css +0 -1
  405. package/platform-ui/dist/assets/LoreSection-CwDDHrz9.js +0 -1
  406. package/platform-ui/dist/assets/SentinelSection-Cl7e5oZ6.js +0 -1
  407. package/platform-ui/dist/assets/TeamSection-CqSIMrKz.js +0 -1
  408. package/platform-ui/dist/assets/index-CfpZFjea.css +0 -1
  409. package/platform-ui/dist/assets/index-F0KL9xrN.js +0 -57
@@ -1,804 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- loadAgentsManifest
4
- } from "./chunk-PMXRGPRQ.js";
5
- import {
6
- AuditLogger
7
- } from "./chunk-PBHIFAL4.js";
8
- import {
9
- getProvider,
10
- initializeProviders
11
- } from "./chunk-TXESEO7Y.js";
12
- import {
13
- calculateCost,
14
- formatCost,
15
- formatTokens
16
- } from "./chunk-5JGJACDU.js";
17
-
18
- // src/core/agent-spawner.ts
19
- import * as fs3 from "fs";
20
- import * as path3 from "path";
21
- import * as yaml3 from "js-yaml";
22
-
23
- // src/core/context-builder.ts
24
- import * as fs from "fs";
25
- import * as path from "path";
26
- import * as yaml from "js-yaml";
27
- import { glob } from "glob";
28
- var SYMBOL_PATTERN = /[#$^!~][a-zA-Z0-9_-]+/g;
29
- function extractSymbols(text) {
30
- const matches = text.match(SYMBOL_PATTERN) || [];
31
- return [...new Set(matches)];
32
- }
33
- function getSymbolType(symbol) {
34
- const prefix = symbol.charAt(0);
35
- const types = {
36
- "#": "component",
37
- "$": "flow",
38
- "^": "gate",
39
- "!": "signal",
40
- "~": "aspect"
41
- };
42
- return types[prefix] || "unknown";
43
- }
44
- async function buildAgentContext(agent, task, rootDir, facetConfig) {
45
- const paradigmDir = path.join(rootDir, ".paradigm");
46
- const taskSymbols = extractSymbols(task);
47
- const contextConfig = getContextPatterns(agent, facetConfig);
48
- const expandedInclude = expandPatterns(contextConfig.include || [], taskSymbols);
49
- const exclude = contextConfig.exclude || [];
50
- const files = await gatherFiles(rootDir, expandedInclude, exclude);
51
- const systemPrompt = await buildRoleSpecificPrompt(agent, paradigmDir, taskSymbols);
52
- return {
53
- systemPrompt,
54
- files,
55
- symbols: taskSymbols
56
- };
57
- }
58
- function getContextPatterns(agent, facetConfig) {
59
- if (facetConfig?.contextInclude || facetConfig?.contextExclude) {
60
- return {
61
- include: facetConfig.contextInclude,
62
- exclude: facetConfig.contextExclude
63
- };
64
- }
65
- const defaults = {
66
- architect: {
67
- include: [
68
- "specs/*.md",
69
- ".purpose",
70
- "**/.purpose",
71
- "portal.yaml",
72
- ".paradigm/config.yaml"
73
- ],
74
- exclude: [
75
- "src/**",
76
- "tests/**",
77
- "node_modules/**",
78
- "dist/**"
79
- ]
80
- },
81
- builder: {
82
- include: [
83
- "src/**",
84
- "tests/**",
85
- "{feature}.purpose",
86
- "specs/{feature}.md"
87
- ],
88
- exclude: [
89
- "specs/*.md",
90
- "node_modules/**",
91
- "dist/**"
92
- ]
93
- },
94
- reviewer: {
95
- include: [
96
- "src/**",
97
- "specs/*.md",
98
- "portal.yaml",
99
- ".purpose"
100
- ],
101
- exclude: [
102
- "tests/**",
103
- "node_modules/**",
104
- "dist/**"
105
- ]
106
- },
107
- tester: {
108
- include: [
109
- "tests/**",
110
- "health.yaml",
111
- "{feature}.purpose"
112
- ],
113
- exclude: [
114
- "src/**",
115
- "specs/**",
116
- "node_modules/**",
117
- "dist/**"
118
- ]
119
- },
120
- security: {
121
- include: [
122
- "portal.yaml",
123
- "src/middleware/**",
124
- "src/auth/**",
125
- ".paradigm/wisdom/antipatterns.yaml"
126
- ],
127
- exclude: [
128
- "src/routes/**",
129
- "tests/**",
130
- "node_modules/**",
131
- "dist/**"
132
- ]
133
- }
134
- };
135
- return defaults[agent.name] || {
136
- include: [".purpose", "portal.yaml"],
137
- exclude: ["node_modules/**", "dist/**"]
138
- };
139
- }
140
- function expandPatterns(patterns, symbols) {
141
- const expanded = [];
142
- for (const pattern of patterns) {
143
- if (pattern.includes("{feature}") || pattern.includes("{symbol}")) {
144
- for (const symbol of symbols) {
145
- const name = symbol.substring(1);
146
- expanded.push(
147
- pattern.replace(/\{feature\}/g, name).replace(/\{symbol\}/g, name)
148
- );
149
- }
150
- } else {
151
- expanded.push(pattern);
152
- }
153
- }
154
- return expanded;
155
- }
156
- async function gatherFiles(rootDir, include, exclude) {
157
- const files = /* @__PURE__ */ new Set();
158
- for (const pattern of include) {
159
- try {
160
- const matches = await glob(pattern, {
161
- cwd: rootDir,
162
- ignore: exclude,
163
- nodir: true,
164
- absolute: false
165
- });
166
- for (const match of matches) {
167
- files.add(match);
168
- }
169
- } catch {
170
- }
171
- }
172
- return Array.from(files);
173
- }
174
- async function buildRoleSpecificPrompt(agent, paradigmDir, symbols) {
175
- const parts = [];
176
- const configPath = path.join(paradigmDir, "config.yaml");
177
- let config = null;
178
- if (fs.existsSync(configPath)) {
179
- try {
180
- config = yaml.load(fs.readFileSync(configPath, "utf-8"));
181
- } catch {
182
- }
183
- }
184
- parts.push(`# ${agent.name.charAt(0).toUpperCase() + agent.name.slice(1)} Agent Context
185
- `);
186
- if (config?.project) {
187
- parts.push(`> Project: ${config.project}`);
188
- if (config.discipline && config.discipline !== "auto") {
189
- parts.push(`> Discipline: ${config.discipline}`);
190
- }
191
- parts.push("");
192
- }
193
- if (config?.["agent-guidelines"]?.overview) {
194
- parts.push("## Project Overview\n");
195
- parts.push(config["agent-guidelines"].overview);
196
- parts.push("");
197
- }
198
- if (config?.["symbol-system"]) {
199
- parts.push("## Symbol System\n");
200
- parts.push("| Symbol | Meaning | Description |");
201
- parts.push("|--------|---------|-------------|");
202
- for (const [prefix, info] of Object.entries(config["symbol-system"])) {
203
- parts.push(`| \`${prefix}\` | ${info.name} | ${info.description} |`);
204
- }
205
- parts.push("");
206
- }
207
- if (config?.conventions) {
208
- const roleConventions = filterConventionsForRole(config.conventions, agent.name);
209
- if (roleConventions.length > 0) {
210
- parts.push("## Conventions\n");
211
- for (const conv of roleConventions) {
212
- parts.push(`- ${conv}`);
213
- }
214
- parts.push("");
215
- }
216
- }
217
- if (symbols.length > 0) {
218
- parts.push("## Symbols in Scope\n");
219
- for (const symbol of symbols) {
220
- const type = getSymbolType(symbol);
221
- parts.push(`- \`${symbol}\` (${type})`);
222
- }
223
- parts.push("");
224
- }
225
- const tips = getRoleTips(agent.name);
226
- if (tips.length > 0) {
227
- parts.push("## Tips for This Role\n");
228
- for (const tip of tips) {
229
- parts.push(`- ${tip}`);
230
- }
231
- parts.push("");
232
- }
233
- return parts.join("\n");
234
- }
235
- function filterConventionsForRole(conventions, role) {
236
- const roleKeywords = {
237
- architect: ["design", "spec", "document", "flow", "symbol", "reference"],
238
- builder: ["code", "implement", "component", "logger", "test"],
239
- reviewer: ["review", "portal", "gate", "check", "validate"],
240
- tester: ["test", "verify", "health", "validate"],
241
- security: ["portal", "gate", "auth", "security", "vulnerability"]
242
- };
243
- const keywords = roleKeywords[role] || [];
244
- return conventions.filter(
245
- (conv) => keywords.some((kw) => conv.toLowerCase().includes(kw))
246
- );
247
- }
248
- function getRoleTips(role) {
249
- const tips = {
250
- architect: [
251
- "Focus on design decisions, not implementation details",
252
- "Use paradigm symbols to reference features and components",
253
- "Document flows that span 3+ components",
254
- "Hand off to builder when spec is ready"
255
- ],
256
- builder: [
257
- "Follow the spec from architect exactly",
258
- "If spec is unclear, ask for clarification or hand back",
259
- "Use the Paradigm logger, not raw console.log",
260
- "Hand off to reviewer when implementation is ready"
261
- ],
262
- reviewer: [
263
- "Check that all ^gate requirements are met",
264
- "Verify adherence to specs",
265
- "Do NOT implement fixes - hand back to builder",
266
- "Approve or request changes with clear feedback"
267
- ],
268
- tester: [
269
- "Run tests and verify health status",
270
- "Check portal validations",
271
- "Update health.yaml when verified",
272
- "Report issues with reproduction steps"
273
- ],
274
- security: [
275
- "Focus on ^gate implementations",
276
- "Check for OWASP top 10 vulnerabilities",
277
- "Flag issues but do NOT implement fixes",
278
- "Review auth flows and session handling"
279
- ]
280
- };
281
- return tips[role] || [];
282
- }
283
-
284
- // src/core/budget-tracker.ts
285
- import * as fs2 from "fs";
286
- import * as path2 from "path";
287
- import * as yaml2 from "js-yaml";
288
- import { EventEmitter } from "events";
289
- var BudgetTracker = class extends EventEmitter {
290
- config;
291
- usage;
292
- records = [];
293
- configPath;
294
- constructor(_rootDir) {
295
- super();
296
- this.configPath = path2.join(_rootDir, ".paradigm", "config.yaml");
297
- this.config = this.loadConfig();
298
- this.usage = this.initializeUsage();
299
- }
300
- // ==========================================================================
301
- // Public API
302
- // ==========================================================================
303
- /**
304
- * Check if a request is within budget
305
- */
306
- checkBudget(agent, requestedTokens) {
307
- const estimatedCost = this.estimateCost(requestedTokens, "sonnet");
308
- if (this.config.maxTokens) {
309
- const projectedTokens = this.usage.tokens.total + requestedTokens;
310
- if (projectedTokens > this.config.maxTokens) {
311
- return {
312
- allowed: false,
313
- reason: `Global token limit exceeded: ${formatTokens(projectedTokens)} > ${formatTokens(this.config.maxTokens)}`,
314
- usage: this.usage,
315
- warningLevel: "exceeded"
316
- };
317
- }
318
- }
319
- if (this.config.maxCostUsd) {
320
- const projectedCost = this.usage.cost + estimatedCost;
321
- if (projectedCost > this.config.maxCostUsd) {
322
- return {
323
- allowed: false,
324
- reason: `Cost ceiling exceeded: ${formatCost(projectedCost)} > ${formatCost(this.config.maxCostUsd)}`,
325
- usage: this.usage,
326
- warningLevel: "exceeded"
327
- };
328
- }
329
- }
330
- const agentLimit = this.config.agentLimits?.[agent];
331
- if (agentLimit) {
332
- const agentUsage = this.usage.byAgent[agent] || { tokens: { input: 0, output: 0, total: 0 }, cost: 0 };
333
- if (agentLimit.maxTokens) {
334
- const projectedAgentTokens = agentUsage.tokens.total + requestedTokens;
335
- if (projectedAgentTokens > agentLimit.maxTokens) {
336
- return {
337
- allowed: false,
338
- reason: `Agent '${agent}' token limit exceeded: ${formatTokens(projectedAgentTokens)} > ${formatTokens(agentLimit.maxTokens)}`,
339
- usage: this.usage,
340
- warningLevel: "exceeded"
341
- };
342
- }
343
- }
344
- if (agentLimit.maxCostUsd) {
345
- const projectedAgentCost = agentUsage.cost + estimatedCost;
346
- if (projectedAgentCost > agentLimit.maxCostUsd) {
347
- return {
348
- allowed: false,
349
- reason: `Agent '${agent}' cost limit exceeded: ${formatCost(projectedAgentCost)} > ${formatCost(agentLimit.maxCostUsd)}`,
350
- usage: this.usage,
351
- warningLevel: "exceeded"
352
- };
353
- }
354
- }
355
- }
356
- let warningLevel = "none";
357
- if (this.config.warnAtPercent && this.config.maxTokens) {
358
- const projectedTokens = this.usage.tokens.total + requestedTokens;
359
- const percentage = projectedTokens / this.config.maxTokens * 100;
360
- if (percentage >= this.config.warnAtPercent) {
361
- warningLevel = "approaching";
362
- }
363
- }
364
- return {
365
- allowed: true,
366
- usage: this.usage,
367
- warningLevel
368
- };
369
- }
370
- /**
371
- * Record usage after an agent completes
372
- */
373
- recordUsage(agent, tokens, model, orchestrationId) {
374
- const cost = calculateCost(tokens, model);
375
- this.usage.tokens.input += tokens.input;
376
- this.usage.tokens.output += tokens.output;
377
- this.usage.tokens.total += tokens.total;
378
- this.usage.cost += cost;
379
- if (this.config.maxTokens) {
380
- this.usage.percentage = this.usage.tokens.total / this.config.maxTokens * 100;
381
- }
382
- if (!this.usage.byAgent[agent]) {
383
- this.usage.byAgent[agent] = {
384
- tokens: { input: 0, output: 0, total: 0 },
385
- cost: 0
386
- };
387
- }
388
- this.usage.byAgent[agent].tokens.input += tokens.input;
389
- this.usage.byAgent[agent].tokens.output += tokens.output;
390
- this.usage.byAgent[agent].tokens.total += tokens.total;
391
- this.usage.byAgent[agent].cost += cost;
392
- const record = {
393
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
394
- agent,
395
- model,
396
- tokens,
397
- cost,
398
- orchestrationId
399
- };
400
- this.records.push(record);
401
- this.emit("usage", { agent, tokens, cost, total: this.usage });
402
- if (this.config.warnAtPercent && this.usage.percentage >= this.config.warnAtPercent) {
403
- this.emit("warning", {
404
- type: "budget_approaching",
405
- percentage: this.usage.percentage,
406
- usage: this.usage
407
- });
408
- }
409
- }
410
- /**
411
- * Get current usage
412
- */
413
- getUsage() {
414
- return { ...this.usage };
415
- }
416
- /**
417
- * Get usage records
418
- */
419
- getRecords() {
420
- return [...this.records];
421
- }
422
- /**
423
- * Get remaining budget
424
- */
425
- getRemaining() {
426
- return {
427
- tokens: this.config.maxTokens ? this.config.maxTokens - this.usage.tokens.total : null,
428
- cost: this.config.maxCostUsd ? this.config.maxCostUsd - this.usage.cost : null
429
- };
430
- }
431
- /**
432
- * Reset usage (for new orchestration)
433
- */
434
- reset() {
435
- this.usage = this.initializeUsage();
436
- this.records = [];
437
- }
438
- /**
439
- * Estimate cost for tokens
440
- */
441
- estimateCost(tokens, model) {
442
- const usage = {
443
- input: Math.floor(tokens / 2),
444
- output: Math.ceil(tokens / 2),
445
- total: tokens
446
- };
447
- return calculateCost(usage, model);
448
- }
449
- /**
450
- * Estimate time for tokens (rough approximation)
451
- */
452
- estimateTime(tokens, model) {
453
- const tps = {
454
- opus: 50,
455
- sonnet: 100,
456
- haiku: 200
457
- };
458
- return Math.ceil(tokens / tps[model]) * 1e3;
459
- }
460
- /**
461
- * Get summary for display
462
- */
463
- getSummary() {
464
- const lines = [];
465
- lines.push("Budget Summary:");
466
- lines.push(` Tokens: ${formatTokens(this.usage.tokens.total)}`);
467
- lines.push(` Cost: ${formatCost(this.usage.cost)}`);
468
- if (this.config.maxTokens) {
469
- lines.push(` Token limit: ${formatTokens(this.config.maxTokens)} (${this.usage.percentage.toFixed(1)}% used)`);
470
- }
471
- if (this.config.maxCostUsd) {
472
- const costPercent = this.usage.cost / this.config.maxCostUsd * 100;
473
- lines.push(` Cost limit: ${formatCost(this.config.maxCostUsd)} (${costPercent.toFixed(1)}% used)`);
474
- }
475
- if (Object.keys(this.usage.byAgent).length > 0) {
476
- lines.push(" By agent:");
477
- for (const [agent, agentUsage] of Object.entries(this.usage.byAgent)) {
478
- lines.push(` ${agent}: ${formatTokens(agentUsage.tokens.total)} (${formatCost(agentUsage.cost)})`);
479
- }
480
- }
481
- return lines.join("\n");
482
- }
483
- // ==========================================================================
484
- // Private Methods
485
- // ==========================================================================
486
- loadConfig() {
487
- const defaultConfig = {
488
- maxTokens: 5e5,
489
- maxCostUsd: 5,
490
- warnAtPercent: 80
491
- };
492
- if (!fs2.existsSync(this.configPath)) {
493
- return defaultConfig;
494
- }
495
- try {
496
- const content = fs2.readFileSync(this.configPath, "utf-8");
497
- const config = yaml2.load(content);
498
- const orchestration = config.orchestration;
499
- if (orchestration?.budget) {
500
- const budget = orchestration.budget;
501
- return {
502
- maxTokens: budget.max_tokens,
503
- maxCostUsd: budget.max_cost_usd,
504
- warnAtPercent: budget.warn_at_percent,
505
- agentLimits: orchestration.agent_limits
506
- };
507
- }
508
- return defaultConfig;
509
- } catch {
510
- return defaultConfig;
511
- }
512
- }
513
- initializeUsage() {
514
- return {
515
- tokens: { input: 0, output: 0, total: 0 },
516
- cost: 0,
517
- percentage: 0,
518
- byAgent: {}
519
- };
520
- }
521
- };
522
-
523
- // src/core/agent-spawner.ts
524
- var AgentSpawner = class {
525
- provider = null;
526
- budgetTracker = null;
527
- auditLogger = null;
528
- rootDir;
529
- constructor(rootDir) {
530
- this.rootDir = rootDir;
531
- }
532
- /**
533
- * Initialize the spawner
534
- */
535
- async initialize() {
536
- await initializeProviders();
537
- this.provider = getProvider();
538
- this.budgetTracker = new BudgetTracker(this.rootDir);
539
- this.auditLogger = new AuditLogger(this.rootDir);
540
- }
541
- /**
542
- * Check if spawner is ready
543
- */
544
- isReady() {
545
- return this.provider !== null;
546
- }
547
- /**
548
- * Get the current provider
549
- */
550
- getProvider() {
551
- return this.provider;
552
- }
553
- /**
554
- * Spawn a single agent
555
- */
556
- async spawn(agentName, task, options = {}) {
557
- if (!this.provider) {
558
- return {
559
- success: false,
560
- error: "Spawner not initialized",
561
- sessionId: ""
562
- };
563
- }
564
- const manifest = loadAgentsManifest(this.rootDir);
565
- if (!manifest) {
566
- return {
567
- success: false,
568
- error: "Team not configured. Run `paradigm team init` first.",
569
- sessionId: ""
570
- };
571
- }
572
- const agent = manifest.agents[agentName];
573
- if (!agent) {
574
- return {
575
- success: false,
576
- error: `Unknown agent: ${agentName}. Available: ${Object.keys(manifest.agents).join(", ")}`,
577
- sessionId: ""
578
- };
579
- }
580
- const providerName = options.provider || this.provider.name;
581
- const provider = getProvider(providerName);
582
- if (!provider) {
583
- return {
584
- success: false,
585
- error: `Provider '${providerName}' not available`,
586
- sessionId: ""
587
- };
588
- }
589
- const isAvailable = await provider.isAvailable();
590
- if (!isAvailable) {
591
- return {
592
- success: false,
593
- error: `Provider '${providerName}' not configured (missing API key?)`,
594
- sessionId: ""
595
- };
596
- }
597
- const sessionId = this.generateSessionId(agentName);
598
- const facetConfig = this.loadFacetConfig(agentName);
599
- const context = await buildAgentContext(agent, task, this.rootDir, facetConfig);
600
- const model = options.model || facetConfig?.defaultModel || "sonnet";
601
- const spawnOptions = {
602
- model,
603
- task,
604
- context,
605
- budget: options.budget,
606
- mcpServerPath: options.mcpServerPath,
607
- workingDirectory: options.workingDirectory || this.rootDir,
608
- checkpoints: options.checkpoints,
609
- timeout: options.timeout
610
- };
611
- const startTime = Date.now();
612
- const startTimestamp = (/* @__PURE__ */ new Date()).toISOString();
613
- const relay = {
614
- agent: agentName,
615
- task,
616
- status: "success",
617
- completionVerified: false,
618
- outputs: {
619
- artifacts: [],
620
- symbols: context.symbols,
621
- decisions: []
622
- },
623
- metrics: {
624
- tokens_used: { input: 0, output: 0, total: 0 },
625
- duration_ms: 0,
626
- files_read: 0,
627
- files_written: 0
628
- }
629
- };
630
- try {
631
- for await (const message of provider.spawn(agent, spawnOptions)) {
632
- if (message.usage) {
633
- relay.metrics.tokens_used = message.usage;
634
- }
635
- if (message.type === "tool_use") {
636
- if (message.toolName === "read_file") {
637
- relay.metrics.files_read++;
638
- } else if (message.toolName === "write_file") {
639
- relay.metrics.files_written++;
640
- const filePath = message.toolInput?.path;
641
- if (filePath) {
642
- relay.outputs.artifacts.push({
643
- path: filePath,
644
- action: "modified"
645
- });
646
- }
647
- }
648
- }
649
- if (options.checkpoints && message.type === "tool_use") {
650
- const shouldPause = this.shouldPauseForCheckpoint(
651
- message,
652
- options.checkpoints
653
- );
654
- if (shouldPause && options.onCheckpoint) {
655
- const approved = await options.onCheckpoint(
656
- `Agent wants to ${message.toolName}: ${JSON.stringify(message.toolInput)}`
657
- );
658
- if (!approved) {
659
- relay.status = "blocked";
660
- break;
661
- }
662
- }
663
- }
664
- if (options.onMessage) {
665
- options.onMessage(message);
666
- }
667
- if (message.type === "error") {
668
- relay.status = "failed";
669
- }
670
- if (this.budgetTracker && message.usage) {
671
- const budgetResult = this.budgetTracker.checkBudget(
672
- agentName,
673
- message.usage.total
674
- );
675
- if (!budgetResult.allowed) {
676
- relay.status = "failed";
677
- break;
678
- }
679
- }
680
- }
681
- relay.metrics.duration_ms = Date.now() - startTime;
682
- if (this.budgetTracker) {
683
- this.budgetTracker.recordUsage(agentName, relay.metrics.tokens_used, model);
684
- }
685
- if (relay.status === "success") {
686
- const hasArtifacts = relay.outputs.artifacts.length > 0;
687
- const hasDecisions = relay.outputs.decisions.length > 0;
688
- const hasHandoff = !!relay.handoff;
689
- const didFileWork = relay.metrics.files_written > 0;
690
- const isArchitect = agentName === "architect";
691
- const isBuilder = agentName === "builder";
692
- if (isBuilder && !didFileWork && !hasHandoff) {
693
- relay.status = "partial";
694
- } else if (!hasArtifacts && !hasDecisions && !hasHandoff && !didFileWork) {
695
- relay.status = "partial";
696
- }
697
- relay.completionVerified = true;
698
- if (relay.status === "partial" && !isArchitect) {
699
- if (options.onMessage) {
700
- options.onMessage({
701
- type: "text",
702
- content: `[completion-check] Agent "${agentName}" downgraded from success \u2192 partial: no meaningful output detected.`,
703
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
704
- });
705
- }
706
- }
707
- }
708
- if (this.auditLogger) {
709
- const agentLog = {
710
- name: agentName,
711
- model,
712
- started: startTimestamp,
713
- completed: (/* @__PURE__ */ new Date()).toISOString(),
714
- duration_ms: relay.metrics.duration_ms,
715
- tokens: relay.metrics.tokens_used,
716
- cost_usd: calculateCost(relay.metrics.tokens_used, model),
717
- status: relay.status,
718
- artifacts: relay.outputs.artifacts,
719
- symbols: relay.outputs.symbols
720
- };
721
- this.auditLogger.logAgentCompletion(sessionId, agentLog);
722
- }
723
- return {
724
- success: relay.status === "success" || relay.status === "partial",
725
- relay,
726
- sessionId
727
- };
728
- } catch (error) {
729
- return {
730
- success: false,
731
- error: error instanceof Error ? error.message : String(error),
732
- sessionId,
733
- relay: {
734
- ...relay,
735
- status: "failed",
736
- metrics: {
737
- ...relay.metrics,
738
- duration_ms: Date.now() - startTime
739
- }
740
- }
741
- };
742
- }
743
- }
744
- /**
745
- * Spawn multiple agents in parallel
746
- */
747
- async spawnParallel(agents) {
748
- const promises = agents.map(
749
- ({ name, task, options }) => this.spawn(name, task, options)
750
- );
751
- return Promise.all(promises);
752
- }
753
- // ==========================================================================
754
- // Private Methods
755
- // ==========================================================================
756
- generateSessionId(agentName) {
757
- const timestamp = Date.now();
758
- const random = Math.random().toString(36).substring(2, 8);
759
- return `${agentName}-${timestamp}-${random}`;
760
- }
761
- loadFacetConfig(agentName) {
762
- const facetsPath = path3.join(this.rootDir, ".paradigm", "facets.yaml");
763
- if (!fs3.existsSync(facetsPath)) {
764
- const defaults = {
765
- architect: { defaultModel: "opus" },
766
- security: { defaultModel: "opus" },
767
- reviewer: { defaultModel: "sonnet" },
768
- builder: { defaultModel: "haiku" },
769
- tester: { defaultModel: "haiku" }
770
- };
771
- return defaults[agentName];
772
- }
773
- try {
774
- const content = fs3.readFileSync(facetsPath, "utf-8");
775
- const facets = yaml3.load(content);
776
- return facets[agentName];
777
- } catch {
778
- return void 0;
779
- }
780
- }
781
- shouldPauseForCheckpoint(message, config) {
782
- if (!config.beforeActions || message.type !== "tool_use") {
783
- return false;
784
- }
785
- const actionMap = {
786
- write: ["write_file", "edit_file"],
787
- delete: ["delete_file", "rm"],
788
- execute: ["run_command", "bash"],
789
- external_api: ["mcp_call", "http_request"]
790
- };
791
- for (const action of config.beforeActions) {
792
- const tools = actionMap[action] || [];
793
- if (message.toolName && tools.includes(message.toolName)) {
794
- return true;
795
- }
796
- }
797
- return false;
798
- }
799
- };
800
-
801
- export {
802
- extractSymbols,
803
- AgentSpawner
804
- };