@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
@@ -8,13 +8,13 @@ import {
8
8
  createGraphsRouter,
9
9
  createSymbolsRouter
10
10
  } from "./chunk-F3BCHPYT.js";
11
- import "./chunk-ZXMDA7VB.js";
11
+ import "./chunk-PDX44BCA.js";
12
12
 
13
13
  // src/platform-server/index.ts
14
14
  import express from "express";
15
15
  import * as http from "http";
16
- import * as path2 from "path";
17
- import * as fs2 from "fs";
16
+ import * as path3 from "path";
17
+ import * as fs3 from "fs";
18
18
  import { fileURLToPath } from "url";
19
19
  import chalk from "chalk";
20
20
 
@@ -716,9 +716,243 @@ function createGitRouter(projectDir) {
716
716
  return router;
717
717
  }
718
718
 
719
+ // src/platform-server/routes/ambient.ts
720
+ import { Router as Router3 } from "express";
721
+ import * as fs2 from "fs";
722
+ import * as path2 from "path";
723
+ import * as yaml2 from "js-yaml";
724
+ function readJsonlSafe(filePath) {
725
+ if (!fs2.existsSync(filePath)) return [];
726
+ try {
727
+ const content = fs2.readFileSync(filePath, "utf-8");
728
+ const lines = content.split("\n").filter((l) => l.trim());
729
+ const results = [];
730
+ for (const line of lines) {
731
+ try {
732
+ results.push(JSON.parse(line));
733
+ } catch {
734
+ }
735
+ }
736
+ return results;
737
+ } catch {
738
+ return [];
739
+ }
740
+ }
741
+ function writeJsonl(filePath, items) {
742
+ const dir = path2.dirname(filePath);
743
+ if (!fs2.existsSync(dir)) {
744
+ fs2.mkdirSync(dir, { recursive: true });
745
+ }
746
+ const content = items.map((item) => JSON.stringify(item)).join("\n") + "\n";
747
+ fs2.writeFileSync(filePath, content, "utf-8");
748
+ }
749
+ function parseSince(since) {
750
+ const match = since.match(/^(\d+)(m|h|d)$/);
751
+ if (!match) return null;
752
+ const value = parseInt(match[1], 10);
753
+ const unit = match[2];
754
+ const now = Date.now();
755
+ switch (unit) {
756
+ case "m":
757
+ return new Date(now - value * 60 * 1e3);
758
+ case "h":
759
+ return new Date(now - value * 60 * 60 * 1e3);
760
+ case "d":
761
+ return new Date(now - value * 24 * 60 * 60 * 1e3);
762
+ default:
763
+ return null;
764
+ }
765
+ }
766
+ function createAmbientRouter(projectDir, wsContext) {
767
+ const router = Router3();
768
+ const eventsPath = path2.join(projectDir, ".paradigm", "events", "stream.jsonl");
769
+ const nominationsPath = path2.join(projectDir, ".paradigm", "events", "nominations.jsonl");
770
+ const debatesPath = path2.join(projectDir, ".paradigm", "events", "debates.jsonl");
771
+ const policyPath = path2.join(projectDir, ".paradigm", "data-policy.yaml");
772
+ router.get("/events", (req, res) => {
773
+ try {
774
+ const {
775
+ type: typeFilter,
776
+ source: sourceFilter,
777
+ symbol: symbolFilter,
778
+ agent: agentFilter,
779
+ since: sinceParam,
780
+ limit: limitParam
781
+ } = req.query;
782
+ const limit = limitParam ? parseInt(limitParam, 10) : 50;
783
+ const sinceDate = sinceParam ? parseSince(sinceParam) : null;
784
+ let events = readJsonlSafe(eventsPath);
785
+ if (typeFilter) {
786
+ events = events.filter((e) => e.type === typeFilter);
787
+ }
788
+ if (sourceFilter) {
789
+ events = events.filter((e) => e.source === sourceFilter);
790
+ }
791
+ if (symbolFilter) {
792
+ events = events.filter((e) => e.symbol === symbolFilter);
793
+ }
794
+ if (agentFilter) {
795
+ events = events.filter((e) => e.agent === agentFilter);
796
+ }
797
+ if (sinceDate) {
798
+ events = events.filter((e) => {
799
+ if (!e.timestamp) return false;
800
+ return new Date(e.timestamp).getTime() >= sinceDate.getTime();
801
+ });
802
+ }
803
+ const result = events.slice(-limit);
804
+ wsContext.broadcast({ type: "ambient:event", action: "query", count: result.length });
805
+ res.json(result);
806
+ } catch (err) {
807
+ res.status(500).json({ error: "Failed to query events", detail: String(err) });
808
+ }
809
+ });
810
+ router.get("/nominations", (req, res) => {
811
+ try {
812
+ const {
813
+ agent: agentFilter,
814
+ urgency: urgencyFilter,
815
+ pending_only: pendingOnlyParam,
816
+ include_debates: includeDebatesParam,
817
+ limit: limitParam
818
+ } = req.query;
819
+ const limit = limitParam ? parseInt(limitParam, 10) : 20;
820
+ const pendingOnly = pendingOnlyParam !== "false";
821
+ const includeDebates = includeDebatesParam === "true";
822
+ let nominations = readJsonlSafe(nominationsPath);
823
+ if (agentFilter) {
824
+ nominations = nominations.filter((n) => n.agent === agentFilter);
825
+ }
826
+ if (urgencyFilter) {
827
+ nominations = nominations.filter((n) => n.urgency === urgencyFilter);
828
+ }
829
+ if (pendingOnly) {
830
+ nominations = nominations.filter((n) => !n.engaged);
831
+ }
832
+ nominations = nominations.slice(-limit);
833
+ let debateMap;
834
+ if (includeDebates) {
835
+ const debates = readJsonlSafe(debatesPath);
836
+ debateMap = /* @__PURE__ */ new Map();
837
+ for (const debate of debates) {
838
+ if (debate.nominationId) {
839
+ const existing = debateMap.get(debate.nominationId) || [];
840
+ existing.push(debate);
841
+ debateMap.set(debate.nominationId, existing);
842
+ }
843
+ }
844
+ }
845
+ const result = nominations.map((n) => {
846
+ const entry = { ...n };
847
+ if (includeDebates && debateMap && n.id) {
848
+ entry.debates = debateMap.get(n.id) || [];
849
+ }
850
+ return entry;
851
+ });
852
+ res.json(result);
853
+ } catch (err) {
854
+ res.status(500).json({ error: "Failed to query nominations", detail: String(err) });
855
+ }
856
+ });
857
+ router.post("/nominations/:id/engage", (req, res) => {
858
+ try {
859
+ const { id } = req.params;
860
+ const { response } = req.body;
861
+ if (!response || !["accepted", "dismissed", "deferred"].includes(response)) {
862
+ res.status(400).json({ error: "response must be one of: accepted, dismissed, deferred" });
863
+ return;
864
+ }
865
+ const nominations = readJsonlSafe(nominationsPath);
866
+ const index = nominations.findIndex((n) => n.id === id);
867
+ if (index === -1) {
868
+ res.status(404).json({ error: `Nomination not found: ${id}` });
869
+ return;
870
+ }
871
+ nominations[index] = {
872
+ ...nominations[index],
873
+ engaged: true,
874
+ response
875
+ };
876
+ writeJsonl(nominationsPath, nominations);
877
+ wsContext.broadcast({
878
+ type: "ambient:nomination",
879
+ action: "engaged",
880
+ nominationId: id,
881
+ response
882
+ });
883
+ res.json(nominations[index]);
884
+ } catch (err) {
885
+ res.status(500).json({ error: "Failed to engage nomination", detail: String(err) });
886
+ }
887
+ });
888
+ router.get("/stream", (req, res) => {
889
+ res.setHeader("Content-Type", "text/event-stream");
890
+ res.setHeader("Cache-Control", "no-cache");
891
+ res.setHeader("Connection", "keep-alive");
892
+ res.flushHeaders();
893
+ let lastSize = 0;
894
+ try {
895
+ const stat = fs2.statSync(eventsPath);
896
+ lastSize = stat.size;
897
+ } catch {
898
+ }
899
+ const pollInterval = 1e3;
900
+ const watcher = setInterval(() => {
901
+ try {
902
+ if (!fs2.existsSync(eventsPath)) return;
903
+ const stat = fs2.statSync(eventsPath);
904
+ if (stat.size <= lastSize) {
905
+ if (stat.size < lastSize) lastSize = 0;
906
+ else return;
907
+ }
908
+ const fd = fs2.openSync(eventsPath, "r");
909
+ const buffer = Buffer.alloc(stat.size - lastSize);
910
+ fs2.readSync(fd, buffer, 0, buffer.length, lastSize);
911
+ fs2.closeSync(fd);
912
+ lastSize = stat.size;
913
+ const newContent = buffer.toString("utf-8");
914
+ const lines = newContent.split("\n").filter((l) => l.trim());
915
+ for (const line of lines) {
916
+ try {
917
+ const event = JSON.parse(line);
918
+ res.write(`data: ${JSON.stringify(event)}
919
+
920
+ `);
921
+ } catch {
922
+ }
923
+ }
924
+ } catch {
925
+ }
926
+ }, pollInterval);
927
+ res.write(": connected\n\n");
928
+ req.on("close", () => {
929
+ clearInterval(watcher);
930
+ });
931
+ });
932
+ router.get("/policy", (_req, res) => {
933
+ try {
934
+ if (fs2.existsSync(policyPath)) {
935
+ const content = fs2.readFileSync(policyPath, "utf-8");
936
+ const policy = yaml2.load(content);
937
+ res.json(policy);
938
+ } else {
939
+ res.json({
940
+ version: "1.0",
941
+ retention: { events: "30d", nominations: "90d", debates: "90d" },
942
+ collection: { telemetry: false, usage: false },
943
+ sharing: { external: false }
944
+ });
945
+ }
946
+ } catch (err) {
947
+ res.status(500).json({ error: "Failed to read data policy", detail: String(err) });
948
+ }
949
+ });
950
+ return router;
951
+ }
952
+
719
953
  // src/platform-server/index.ts
720
954
  var __filename = fileURLToPath(import.meta.url);
721
- var __dirname = path2.dirname(__filename);
955
+ var __dirname = path3.dirname(__filename);
722
956
  var log = {
723
957
  component(name) {
724
958
  const symbol = chalk.magenta(`#${name}`);
@@ -743,8 +977,8 @@ var log = {
743
977
  }
744
978
  };
745
979
  function resolveSections(options) {
746
- const always = ["overview", "lore", "graph", "git"];
747
- const requested = options.sections ?? [...always, "sentinel", "university", "symphony"];
980
+ const always = ["overview", "lore", "graph", "git", "ambient"];
981
+ const requested = options.sections ?? [...always, "sentinel", "university", "symphony", "docs"];
748
982
  const enabled = /* @__PURE__ */ new Set();
749
983
  for (const section of requested) {
750
984
  if (always.includes(section)) {
@@ -752,15 +986,15 @@ function resolveSections(options) {
752
986
  continue;
753
987
  }
754
988
  if (section === "sentinel") {
755
- const sentinelRoutesPath = path2.join(options.projectDir, ".paradigm");
756
- if (fs2.existsSync(sentinelRoutesPath)) {
989
+ const sentinelRoutesPath = path3.join(options.projectDir, ".paradigm");
990
+ if (fs3.existsSync(sentinelRoutesPath)) {
757
991
  enabled.add(section);
758
992
  }
759
993
  } else if (section === "university") {
760
994
  enabled.add(section);
761
995
  } else if (section === "symphony") {
762
- const mailDir = path2.join(process.env.HOME || "~", ".paradigm", "score");
763
- if (fs2.existsSync(mailDir)) {
996
+ const mailDir = path3.join(process.env.HOME || "~", ".paradigm", "score");
997
+ if (fs3.existsSync(mailDir)) {
764
998
  enabled.add(section);
765
999
  }
766
1000
  } else {
@@ -804,15 +1038,17 @@ function createPlatformApp(options) {
804
1038
  res.json({ status: "ok", timestamp: (/* @__PURE__ */ new Date()).toISOString() });
805
1039
  });
806
1040
  app.set("agentRouterSlot", true);
807
- let uiDistPath = path2.join(__dirname, "..", "platform-ui", "dist");
808
- if (!fs2.existsSync(uiDistPath)) {
809
- uiDistPath = path2.join(__dirname, "..", "..", "platform-ui", "dist");
1041
+ let uiDistPath = path3.join(__dirname, "..", "platform-ui", "dist");
1042
+ if (!fs3.existsSync(uiDistPath)) {
1043
+ uiDistPath = path3.join(__dirname, "..", "..", "platform-ui", "dist");
810
1044
  }
811
- if (fs2.existsSync(uiDistPath)) {
1045
+ if (fs3.existsSync(uiDistPath)) {
812
1046
  app.use(express.static(uiDistPath));
813
- app.get("{*path}", (req, res) => {
1047
+ app.get("{*path}", (req, res, next) => {
814
1048
  if (!req.path.startsWith("/api")) {
815
- res.sendFile(path2.join(uiDistPath, "index.html"));
1049
+ res.sendFile(path3.join(uiDistPath, "index.html"));
1050
+ } else {
1051
+ next();
816
1052
  }
817
1053
  });
818
1054
  } else {
@@ -843,9 +1079,10 @@ async function startPlatformServer(options) {
843
1079
  const httpServer = http.createServer(app);
844
1080
  const wsContext = attachWebSocket(httpServer);
845
1081
  app.use("/api/platform/agent-command", createAgentRouter(wsContext));
1082
+ app.use("/api/ambient", createAmbientRouter(options.projectDir, wsContext));
846
1083
  if (sections.has("sentinel")) {
847
1084
  try {
848
- const { createSentinelBridge } = await import("./sentinel-bridge-APDXYAZS.js");
1085
+ const { createSentinelBridge } = await import("./sentinel-bridge-MDUXTQRL.js");
849
1086
  const sentinelRouter = await createSentinelBridge(options.projectDir, wsContext.broadcast);
850
1087
  if (sentinelRouter) {
851
1088
  app.use("/api/sentinel", sentinelRouter);
@@ -857,13 +1094,22 @@ async function startPlatformServer(options) {
857
1094
  }
858
1095
  if (sections.has("symphony")) {
859
1096
  try {
860
- const { createSymphonyRouter } = await import("./symphony-YCHBYN3E.js");
1097
+ const { createSymphonyRouter } = await import("./symphony-B75X2MME.js");
861
1098
  app.use("/api/symphony", createSymphonyRouter(options.projectDir, wsContext.broadcast));
862
1099
  log.component("platform-server").success("Symphony routes mounted");
863
1100
  } catch (err) {
864
1101
  log.component("platform-server").warn("Symphony routes failed to mount");
865
1102
  }
866
1103
  }
1104
+ if (sections.has("docs")) {
1105
+ try {
1106
+ const { createDocsRouter } = await import("./docs-PBZB7LYP.js");
1107
+ app.use("/api/docs", createDocsRouter(options.projectDir));
1108
+ log.component("platform-server").success("Docs routes mounted");
1109
+ } catch (err) {
1110
+ log.component("platform-server").warn("Docs routes failed to mount");
1111
+ }
1112
+ }
867
1113
  return new Promise((resolve, reject) => {
868
1114
  httpServer.listen(options.port, () => {
869
1115
  log.component("platform-server").success("Platform running", { url: `http://localhost:${options.port}` });
@@ -4,6 +4,7 @@ import {
4
4
  runPluginUpdateCheck,
5
5
  schedulePluginUpdateCheck
6
6
  } from "./chunk-MP73YDXF.js";
7
+ import "./chunk-7N7GSU6K.js";
7
8
  export {
8
9
  getPluginUpdateNotice,
9
10
  runPluginUpdateCheck,
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  checkPortalCompliance,
4
4
  formatComplianceReport
5
- } from "./chunk-MW5DMGBB.js";
6
- import "./chunk-ZXMDA7VB.js";
5
+ } from "./chunk-YMDLDELF.js";
6
+ import "./chunk-PDX44BCA.js";
7
7
 
8
8
  // src/commands/portal-check.ts
9
9
  import chalk from "chalk";
@@ -6,8 +6,8 @@ import {
6
6
  formatComplianceReport,
7
7
  getComplianceSummary,
8
8
  loadPortalConfig
9
- } from "./chunk-MW5DMGBB.js";
10
- import "./chunk-ZXMDA7VB.js";
9
+ } from "./chunk-YMDLDELF.js";
10
+ import "./chunk-PDX44BCA.js";
11
11
  export {
12
12
  checkPortalCompliance,
13
13
  extractDeclaredGates,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  generateFlowIndex,
4
4
  generateNavigator
5
- } from "./chunk-7COU5S2Z.js";
5
+ } from "./chunk-VL67H5IC.js";
6
6
  import {
7
7
  generateScanIndex,
8
8
  serializeScanIndex
@@ -12,11 +12,11 @@ import {
12
12
  } from "./chunk-ZGUAAVMA.js";
13
13
  import "./chunk-EDOAWN7J.js";
14
14
  import "./chunk-IRKUEJVW.js";
15
- import "./chunk-QDXI2DHR.js";
15
+ import "./chunk-J2JEQRT3.js";
16
16
  import {
17
17
  parseParadigmConfig
18
18
  } from "./chunk-YO6DVTL7.js";
19
- import "./chunk-ZXMDA7VB.js";
19
+ import "./chunk-PDX44BCA.js";
20
20
 
21
21
  // src/commands/probe/index.ts
22
22
  import * as fs from "fs";
@@ -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/commands/promote.ts
5
5
  import * as fs from "fs";
@@ -138,7 +138,7 @@ ${err instanceof Error ? err.message : err}
138
138
  }
139
139
  spinner.start("Switching MCP configs to PROD...");
140
140
  try {
141
- const { mcpUseProdCommand } = await import("./switch-WYUMVNA5.js");
141
+ const { mcpUseProdCommand } = await import("./switch-6EJPZDIA.js");
142
142
  await mcpUseProdCommand({ json: true });
143
143
  spinner.succeed("MCP configs switched to PROD");
144
144
  } catch {
@@ -4,8 +4,8 @@ import {
4
4
  getBestProvider,
5
5
  getConfiguredProvider,
6
6
  setConfiguredProvider
7
- } from "./chunk-FS3WTUHY.js";
8
- import "./chunk-ZXMDA7VB.js";
7
+ } from "./chunk-TXESEO7Y.js";
8
+ import "./chunk-PDX44BCA.js";
9
9
 
10
10
  // src/commands/team/providers.ts
11
11
  import * as path from "path";
@@ -3,7 +3,7 @@ import {
3
3
  loadQuiz,
4
4
  saveDiploma
5
5
  } from "./chunk-GT5QGC2H.js";
6
- import "./chunk-ZXMDA7VB.js";
6
+ import "./chunk-PDX44BCA.js";
7
7
 
8
8
  // src/commands/university/quiz.ts
9
9
  import chalk from "chalk";
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  recordLore,
4
4
  resolveAuthor
5
- } from "./chunk-QIOCFXDQ.js";
6
- import "./chunk-ZXMDA7VB.js";
5
+ } from "./chunk-EKGMAM62.js";
6
+ import "./chunk-PDX44BCA.js";
7
7
 
8
8
  // src/commands/lore/record.ts
9
9
  import chalk from "chalk";
@@ -3,9 +3,10 @@ import {
3
3
  getReindexToolsList,
4
4
  handleReindexTool,
5
5
  rebuildStaticFiles
6
- } from "./chunk-ZMQA6SCO.js";
7
- import "./chunk-CDMAMDSG.js";
6
+ } from "./chunk-S6MZ2IEX.js";
7
+ import "./chunk-5VKJBNJL.js";
8
8
  import "./chunk-L27I3CPZ.js";
9
+ import "./chunk-7N7GSU6K.js";
9
10
  export {
10
11
  getReindexToolsList,
11
12
  handleReindexTool,
@@ -3,7 +3,7 @@ import {
3
3
  aggregatePurposes,
4
4
  getAllPurposeFiles
5
5
  } from "./chunk-EDOAWN7J.js";
6
- import "./chunk-ZXMDA7VB.js";
6
+ import "./chunk-PDX44BCA.js";
7
7
 
8
8
  // src/commands/purpose/remember.ts
9
9
  import * as path from "path";
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  loadLoreEntries,
4
4
  updateLoreEntry
5
- } from "./chunk-QIOCFXDQ.js";
6
- import "./chunk-ZXMDA7VB.js";
5
+ } from "./chunk-EKGMAM62.js";
6
+ import "./chunk-PDX44BCA.js";
7
7
 
8
8
  // src/commands/lore/retag.ts
9
9
  import chalk from "chalk";
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  addReview
4
- } from "./chunk-QIOCFXDQ.js";
5
- import "./chunk-ZXMDA7VB.js";
4
+ } from "./chunk-EKGMAM62.js";
5
+ import "./chunk-PDX44BCA.js";
6
6
 
7
7
  // src/commands/lore/review.ts
8
8
  import chalk from "chalk";