project-athena 0.3.0 → 0.5.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 (140) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +56 -4
  3. package/dist/{activity-P4UUFHWV.js → activity-XCHKBZTG.js} +6 -6
  4. package/dist/{agents-3HTSQGL2.js → agents-HUJ4JXIB.js} +6 -6
  5. package/dist/{ai-ASL4FFQ7.js → ai-LGTLQKL4.js} +3 -3
  6. package/dist/{analyze-F3YOILNL.js → analyze-AP4XJT7D.js} +10 -9
  7. package/dist/{chunk-ZB7LC6FP.js → chunk-3KFOI2X4.js} +2 -2
  8. package/dist/{chunk-PANVPNYF.js → chunk-44EGCEB2.js} +59 -251
  9. package/dist/{chunk-SJOOXO34.js → chunk-4FETKOY3.js} +9 -8
  10. package/dist/chunk-4IIBVTBS.js +76 -0
  11. package/dist/{chunk-LEMPCNAY.js → chunk-56EXAGTM.js} +3 -3
  12. package/dist/{chunk-32PRS2MG.js → chunk-6OSQMXUP.js} +5 -5
  13. package/dist/{chunk-OLPSEQS5.js → chunk-AKOI4VTD.js} +10 -1
  14. package/dist/{chunk-EF6GHOIN.js → chunk-C25FDXOO.js} +133 -23
  15. package/dist/{chunk-S7T6VX56.js → chunk-DH5AGULY.js} +8 -4
  16. package/dist/chunk-F65QINMR.js +702 -0
  17. package/dist/chunk-GU3ZX2J7.js +166 -0
  18. package/dist/chunk-GYQG4Q2N.js +108 -0
  19. package/dist/chunk-IDODPGTX.js +595 -0
  20. package/dist/chunk-KJYSNZXS.js +934 -0
  21. package/dist/{chunk-PR53DT7I.js → chunk-L2EHJCH4.js} +8 -8
  22. package/dist/{chunk-65TSRDQ3.js → chunk-P4TRQMES.js} +2 -2
  23. package/dist/{chunk-TGJUUB44.js → chunk-PZPMWCXS.js} +5 -5
  24. package/dist/chunk-QCC4VJUH.js +217 -0
  25. package/dist/{chunk-DOQMAZL5.js → chunk-R5AX7VST.js} +3 -3
  26. package/dist/{chunk-JY6BFIJJ.js → chunk-RQKGT2EK.js} +3 -3
  27. package/dist/{chunk-PDFQ5BFG.js → chunk-SVTEJYMS.js} +4 -155
  28. package/dist/{chunk-VSYBC3VY.js → chunk-UMWX4UTK.js} +2 -2
  29. package/dist/{chunk-RXNRMIZP.js → chunk-WUIC65QO.js} +2 -2
  30. package/dist/{chunk-JCGDR4UV.js → chunk-WWQ5NKEC.js} +3 -1
  31. package/dist/{chunk-XB66PZ6Z.js → chunk-X7EYOAEX.js} +2 -2
  32. package/dist/chunk-Y6SDMZET.js +278 -0
  33. package/dist/{chunk-2RS6TA3D.js → chunk-YRIS7ZS6.js} +28 -17
  34. package/dist/{clean-S7PKCOLM.js → clean-LQOG56AM.js} +4 -4
  35. package/dist/cli.js +2 -2
  36. package/dist/{context-AH5MFHRG.js → context-G5YHY3L2.js} +24 -10
  37. package/dist/{doctor-RSJMLE2P.js → doctor-L34QJ7WR.js} +17 -10
  38. package/dist/{event-TNT6CQZR.js → event-6YW6TGFI.js} +3 -3
  39. package/dist/{git-hook-YZNZGAAP.js → git-hook-Y7Y262F7.js} +2 -2
  40. package/dist/{init-2V34DVRQ.js → init-427QR5AS.js} +10 -9
  41. package/dist/{mcp-T2GRTEX5.js → mcp-DWNWRGJW.js} +196 -21
  42. package/dist/memory-XBZCYQLW.js +393 -0
  43. package/dist/{open-2QSZKKUG.js → open-LJMOB6U2.js} +262 -69
  44. package/dist/{program-V2USHGXN.js → program-DCP526LU.js} +63 -32
  45. package/dist/{review-R3R2J5BJ.js → review-VEJBPACX.js} +14 -11
  46. package/dist/{rules-4FXJUCXB.js → rules-M4DLLXBL.js} +4 -4
  47. package/dist/scan-JVKCVHPD.js +939 -0
  48. package/dist/{security-PI4LXCOB.js → security-JTJN3E7K.js} +15 -11
  49. package/dist/{staged-check-HHIBKKMR.js → staged-check-PQSLGQBW.js} +15 -13
  50. package/dist/{status-6M73WX5I.js → status-PO27BSOZ.js} +10 -4
  51. package/dist/{sync-3ZNJDSSU.js → sync-GVO2VHPI.js} +14 -12
  52. package/dist/{watch-USN5CQIV.js → watch-TEHFO47V.js} +14 -12
  53. package/dist/web/assets/{Editor-BI56-HX5.js → Editor-Bnilgch0.js} +1 -1
  54. package/dist/web/assets/{abnfDiagram-O67JEVCF-y_9px2ob.js → abnfDiagram-O67JEVCF-DW9LWr8f.js} +1 -1
  55. package/dist/web/assets/architecture-7GRP2DOG-BWDZV2yn.js +1 -0
  56. package/dist/web/assets/{architectureDiagram-NJMV4G6O-lB6fcVzU.js → architectureDiagram-NJMV4G6O-0eKeQRhj.js} +1 -1
  57. package/dist/web/assets/{blockDiagram-BEXU5L5S-DcM5pEjM.js → blockDiagram-BEXU5L5S-D5i3-ogI.js} +1 -1
  58. package/dist/web/assets/{c4Diagram-YGBWAQC7-CJgqxTY2.js → c4Diagram-YGBWAQC7-BAWQZrEu.js} +1 -1
  59. package/dist/web/assets/channel-Bkh05NKd.js +1 -0
  60. package/dist/web/assets/{chunk-3FUC2YCW-B8l_VuWR.js → chunk-3FUC2YCW-fKRGOZF3.js} +1 -1
  61. package/dist/web/assets/{chunk-5DYCD2WN-CZecgNhf.js → chunk-5DYCD2WN-C5jOlx42.js} +1 -1
  62. package/dist/web/assets/{chunk-742MDFTN-BeZ7P5jB.js → chunk-742MDFTN-urY4RP_A.js} +1 -1
  63. package/dist/web/assets/{chunk-7INBJB4K-IKy0pr5m.js → chunk-7INBJB4K-nk48sKqZ.js} +1 -1
  64. package/dist/web/assets/{chunk-7M6MHVWA-Dg_QqJEX.js → chunk-7M6MHVWA-BfBD9X0F.js} +1 -1
  65. package/dist/web/assets/{chunk-7PRAP22T-DqQNS8oq.js → chunk-7PRAP22T-jYf59QlI.js} +1 -1
  66. package/dist/web/assets/{chunk-GTNCS2PH-x4sM51nJ.js → chunk-GTNCS2PH-BOCxryKf.js} +1 -1
  67. package/dist/web/assets/{chunk-GWA4HPMP-CE5GcwVN.js → chunk-GWA4HPMP-CFpaW0ru.js} +1 -1
  68. package/dist/web/assets/{chunk-MBY4JIJT-DA_D1hjF.js → chunk-MBY4JIJT-BIB8HctN.js} +1 -1
  69. package/dist/web/assets/{chunk-NETBCI7D-CeJ3XBZ2.js → chunk-NETBCI7D-CpUUK6rh.js} +1 -1
  70. package/dist/web/assets/{chunk-O7XYJQB3-BH2gESvO.js → chunk-O7XYJQB3-BNx_V4Oi.js} +1 -1
  71. package/dist/web/assets/{chunk-UA2S7LBM-BWr0xCux.js → chunk-UA2S7LBM-D3tMiIOY.js} +1 -1
  72. package/dist/web/assets/{chunk-WEXAMYUT-B4QwUZPM.js → chunk-WEXAMYUT-CC-3C32l.js} +1 -1
  73. package/dist/web/assets/{chunk-Z7XXMR3K-BxcA-y5B.js → chunk-Z7XXMR3K-BzhxKQUc.js} +1 -1
  74. package/dist/web/assets/{chunk-ZIGJFQKS-BZYvP63G.js → chunk-ZIGJFQKS-D4tBHzxg.js} +1 -1
  75. package/dist/web/assets/{classDiagram-v2-NBCMYWYE-BS3P_NXb.js → classDiagram-v2-NBCMYWYE-BbtyanXR.js} +1 -1
  76. package/dist/web/assets/{cynefin-OW5HDTMX-BALD4Pve.js → cynefin-OW5HDTMX-BIArb8W1.js} +1 -1
  77. package/dist/web/assets/{cynefinDiagram-VND7K2PF-BM2y4W6d.js → cynefinDiagram-VND7K2PF-BrAcfkXL.js} +1 -1
  78. package/dist/web/assets/{dagre-6A5THRUB-PTfOrIdF.js → dagre-6A5THRUB-BcHXRl4s.js} +1 -1
  79. package/dist/web/assets/{diagram-22UHCM2B-CpXEHhUl.js → diagram-22UHCM2B-Dx9tSCdE.js} +1 -1
  80. package/dist/web/assets/{diagram-3UASUU5V-DPHfXzr6.js → diagram-3UASUU5V-CLLDP9yH.js} +1 -1
  81. package/dist/web/assets/{diagram-ATOU4E4O-DMBNXvAC.js → diagram-ATOU4E4O-B46H9iPt.js} +1 -1
  82. package/dist/web/assets/{diagram-CDSNMT55-CDLe1M7G.js → diagram-CDSNMT55-CYtvB6aG.js} +1 -1
  83. package/dist/web/assets/{diagram-MLGK6HIB-D6L8oE7j.js → diagram-MLGK6HIB-Dar7ktoX.js} +1 -1
  84. package/dist/web/assets/{diagram-MPIPVDR6-CP-S7rrQ.js → diagram-MPIPVDR6-C-DljnYN.js} +1 -1
  85. package/dist/web/assets/{ebnfDiagram-ZINNZB2B-CkUc63TK.js → ebnfDiagram-ZINNZB2B-Dv_3jWnh.js} +1 -1
  86. package/dist/web/assets/{elk-276RUBZZ-C1CAJLH_.js → elk-276RUBZZ-DnHciE9k.js} +1 -1
  87. package/dist/web/assets/{erDiagram-OPXOYQCR-DXBnaTHm.js → erDiagram-OPXOYQCR-Bn46KrHz.js} +1 -1
  88. package/dist/web/assets/eventmodeling-NTZA5JFV-DYwoptMd.js +1 -0
  89. package/dist/web/assets/flowDiagram-KWPJA3E3-y4rS0gIB.js +1 -0
  90. package/dist/web/assets/{ganttDiagram-FUAMR5RP-BVm8SiGg.js → ganttDiagram-FUAMR5RP-DOjjJtqz.js} +1 -1
  91. package/dist/web/assets/{gitGraph-4MIJSDKK-Dm7xBrW0.js → gitGraph-4MIJSDKK-BIoMXJRQ.js} +1 -1
  92. package/dist/web/assets/{gitGraphDiagram-X574FWY7-D_PIKKhx.js → gitGraphDiagram-X574FWY7-BsJ01R0v.js} +1 -1
  93. package/dist/web/assets/{index-CeOIBpu2.js → index-Cen0jOXj.js} +5 -4
  94. package/dist/web/assets/{index-DKE3ojTe.css → index-WwRY6n68.css} +1 -1
  95. package/dist/web/assets/{info-A6RAGUB7-CLGrx8pn.js → info-A6RAGUB7-BmlXzRWj.js} +1 -1
  96. package/dist/web/assets/{infoDiagram-VRGFBTTK-BlBjaKm7.js → infoDiagram-VRGFBTTK-CYPJPmBP.js} +1 -1
  97. package/dist/web/assets/{ishikawaDiagram-OU5B5YK6-Kxe7GGS3.js → ishikawaDiagram-OU5B5YK6-YN96geky.js} +1 -1
  98. package/dist/web/assets/{journeyDiagram-ZHPQQLJL-wCMoHK4M.js → journeyDiagram-ZHPQQLJL-20juojKY.js} +1 -1
  99. package/dist/web/assets/{kanban-definition-PNTS6WVX-BxdCz9Ko.js → kanban-definition-PNTS6WVX-BhCKIEbP.js} +1 -1
  100. package/dist/web/assets/{line-Zf11FnWF.js → line-BERsMFG6.js} +1 -1
  101. package/dist/web/assets/{mermaid-parser.core-BvFFklev.js → mermaid-parser.core-Bis_wTB-.js} +3 -3
  102. package/dist/web/assets/{mermaid.core-Cd_Ssti9.js → mermaid.core-DMsM3ZX7.js} +4 -4
  103. package/dist/web/assets/{mindmap-definition-NLK3R4M7-BGPQl-GY.js → mindmap-definition-NLK3R4M7-BkcGdOfv.js} +1 -1
  104. package/dist/web/assets/{packet-AYTQ26CC-6lI3cEX_.js → packet-AYTQ26CC-Bh30-JJX.js} +1 -1
  105. package/dist/web/assets/{pegDiagram-GJSIUBJH-BPIjlSAj.js → pegDiagram-GJSIUBJH-DxnIo9RF.js} +1 -1
  106. package/dist/web/assets/{pie-WAS4IAKB-D6Dzj3Ja.js → pie-WAS4IAKB-ChaTr-GD.js} +1 -1
  107. package/dist/web/assets/{pieDiagram-5QR66LMP-DtA-vZmv.js → pieDiagram-5QR66LMP-CzAp78FM.js} +1 -1
  108. package/dist/web/assets/{quadrantDiagram-O4NWA36T-EettyqQn.js → quadrantDiagram-O4NWA36T-BDSE-cfY.js} +1 -1
  109. package/dist/web/assets/{radar-RG4KPBEZ-xmRc3Dl8.js → radar-RG4KPBEZ-DgJ-o_dq.js} +1 -1
  110. package/dist/web/assets/{railroad-74A4TZTK-BLB7dhOn.js → railroad-74A4TZTK-C8MmcBKz.js} +1 -1
  111. package/dist/web/assets/railroad-abnf-HS5TGJTU-CTLXjcdP.js +1 -0
  112. package/dist/web/assets/railroad-ebnf-LZEXJU2U-ggWsTTL0.js +1 -0
  113. package/dist/web/assets/railroad-peg-WCYAUIDC-D1mCX705.js +1 -0
  114. package/dist/web/assets/{railroadDiagram-XR7U4H2S-PBw4We6b.js → railroadDiagram-XR7U4H2S-DfbcWRNh.js} +1 -1
  115. package/dist/web/assets/{requirementDiagram-PLB6GJNP-DjQpaUFA.js → requirementDiagram-PLB6GJNP-DM3nksxs.js} +1 -1
  116. package/dist/web/assets/{sankeyDiagram-IPEJSGJF-CBW-_AoF.js → sankeyDiagram-IPEJSGJF-DthUpiiC.js} +1 -1
  117. package/dist/web/assets/{sequenceDiagram-PO4LG4MO-DEoPYqY9.js → sequenceDiagram-PO4LG4MO-DLA3nuvA.js} +1 -1
  118. package/dist/web/assets/{stateDiagram-v2-GCMORJYK-UZq5rPud.js → stateDiagram-v2-GCMORJYK-B0X6ihBW.js} +1 -1
  119. package/dist/web/assets/{swimlanes-2SLR337P-CACfuXJR.js → swimlanes-2SLR337P-B4qWe6vE.js} +1 -1
  120. package/dist/web/assets/swimlanesDiagram-TC7HE7FX-ClIk3e7S.js +8 -0
  121. package/dist/web/assets/{timeline-definition-EJHVYXUP-CYJl7mP-.js → timeline-definition-EJHVYXUP-F-cDzYrj.js} +1 -1
  122. package/dist/web/assets/{treeView-Q6P3EWNA-DtZ5nkPQ.js → treeView-Q6P3EWNA-BaI30nLZ.js} +1 -1
  123. package/dist/web/assets/{treemap-WGGIJYW6-m49GDM-M.js → treemap-WGGIJYW6-D2jGGoMl.js} +1 -1
  124. package/dist/web/assets/{usecaseDiagram-POWQR4AR-C2Vg20UK.js → usecaseDiagram-POWQR4AR-B9qoAQCy.js} +1 -1
  125. package/dist/web/assets/{vennDiagram-UO4OBE2U-C07v5OGI.js → vennDiagram-UO4OBE2U-DGVNOaKO.js} +1 -1
  126. package/dist/web/assets/{wardley-WFR3VGLG-C9Z7EZtz.js → wardley-WFR3VGLG-DbKqhNAh.js} +1 -1
  127. package/dist/web/assets/{wardleyDiagram-VNRHLVJA-DdA8CcSC.js → wardleyDiagram-VNRHLVJA-BgZ1gprw.js} +1 -1
  128. package/dist/web/assets/{xychartDiagram-PMCCYNJV-C9EZw07b.js → xychartDiagram-PMCCYNJV-D73RYid1.js} +1 -1
  129. package/dist/web/index.html +2 -2
  130. package/package.json +3 -1
  131. package/dist/chunk-CXUTYCZX.js +0 -238
  132. package/dist/chunk-LMOFZNTQ.js +0 -379
  133. package/dist/web/assets/architecture-7GRP2DOG-DyxkwYiW.js +0 -1
  134. package/dist/web/assets/channel-BvDD7AMO.js +0 -1
  135. package/dist/web/assets/eventmodeling-NTZA5JFV-cLIzvgDp.js +0 -1
  136. package/dist/web/assets/flowDiagram-KWPJA3E3-D7Zq63VQ.js +0 -1
  137. package/dist/web/assets/railroad-abnf-HS5TGJTU-DBFym6g8.js +0 -1
  138. package/dist/web/assets/railroad-ebnf-LZEXJU2U-CkG28ig8.js +0 -1
  139. package/dist/web/assets/railroad-peg-WCYAUIDC-Df_Ifaad.js +0 -1
  140. package/dist/web/assets/swimlanesDiagram-TC7HE7FX-CDSrqdgx.js +0 -8
@@ -1,32 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- configureAgents,
4
- listAgents,
5
- removeAgents
6
- } from "./chunk-JY6BFIJJ.js";
7
- import {
8
- getRelevantContext,
9
- graphSummary,
10
- refreshGraph
11
- } from "./chunk-CXUTYCZX.js";
12
- import {
13
- runSecurityScan
14
- } from "./chunk-LMOFZNTQ.js";
15
- import {
16
- reviewChanges
17
- } from "./chunk-EF6GHOIN.js";
18
- import {
19
- buildStatus
20
- } from "./chunk-ZB7LC6FP.js";
21
2
  import {
22
3
  INSTANCE_FILE,
23
4
  findRunningInstance,
24
5
  runDoctor
25
- } from "./chunk-PR53DT7I.js";
26
- import {
27
- aiStatus
28
- } from "./chunk-RXNRMIZP.js";
29
- import "./chunk-VSYBC3VY.js";
6
+ } from "./chunk-L2EHJCH4.js";
30
7
  import {
31
8
  contentHash,
32
9
  docAtRevision,
@@ -39,8 +16,39 @@ import {
39
16
  rulesUpdate,
40
17
  saveDoc,
41
18
  searchDocs
42
- } from "./chunk-LEMPCNAY.js";
43
- import "./chunk-3IS2X2Z7.js";
19
+ } from "./chunk-56EXAGTM.js";
20
+ import {
21
+ configureAgents,
22
+ listAgents,
23
+ removeAgents
24
+ } from "./chunk-RQKGT2EK.js";
25
+ import {
26
+ watchProject
27
+ } from "./chunk-6OSQMXUP.js";
28
+ import {
29
+ AnalysisScheduler
30
+ } from "./chunk-X7EYOAEX.js";
31
+ import {
32
+ getRelevantContext,
33
+ graphSummary,
34
+ refreshGraph
35
+ } from "./chunk-GYQG4Q2N.js";
36
+ import {
37
+ aiStatus
38
+ } from "./chunk-WUIC65QO.js";
39
+ import {
40
+ runSecurityScan,
41
+ saveScan
42
+ } from "./chunk-4IIBVTBS.js";
43
+ import "./chunk-IDODPGTX.js";
44
+ import "./chunk-UMWX4UTK.js";
45
+ import {
46
+ reviewChanges
47
+ } from "./chunk-C25FDXOO.js";
48
+ import "./chunk-Y6SDMZET.js";
49
+ import {
50
+ buildStatus
51
+ } from "./chunk-3KFOI2X4.js";
44
52
  import {
45
53
  ACTIVITY_FILE,
46
54
  activityFile,
@@ -48,16 +56,25 @@ import {
48
56
  readRecentEvents,
49
57
  rotatedActivityFile,
50
58
  summarizeSessions
51
- } from "./chunk-65TSRDQ3.js";
59
+ } from "./chunk-P4TRQMES.js";
52
60
  import {
53
61
  printHeader
54
62
  } from "./chunk-SHKXELUX.js";
55
63
  import {
56
- watchProject
57
- } from "./chunk-32PRS2MG.js";
58
- import {
59
- AnalysisScheduler
60
- } from "./chunk-XB66PZ6Z.js";
64
+ MEMORY_DIR,
65
+ MEMORY_FILES,
66
+ MEMORY_KINDS,
67
+ MEMORY_STATUSES,
68
+ addMemory,
69
+ confirmMemory,
70
+ forgetMemory,
71
+ getMemory,
72
+ listMemory,
73
+ memoryDir,
74
+ supersedeMemory,
75
+ updateMemory
76
+ } from "./chunk-F65QINMR.js";
77
+ import "./chunk-3IS2X2Z7.js";
61
78
  import {
62
79
  c,
63
80
  dim,
@@ -76,28 +93,30 @@ import {
76
93
  applySync,
77
94
  ignorePlan,
78
95
  staleForCheck
79
- } from "./chunk-TGJUUB44.js";
96
+ } from "./chunk-PZPMWCXS.js";
80
97
  import {
81
98
  projectSession,
82
99
  releaseProjectSession
83
- } from "./chunk-PDFQ5BFG.js";
100
+ } from "./chunk-GU3ZX2J7.js";
84
101
  import "./chunk-GR4DL2VM.js";
85
102
  import {
86
103
  runPipeline
87
- } from "./chunk-SJOOXO34.js";
88
- import {
89
- SCAN_FILE,
90
- saveScan
91
- } from "./chunk-PANVPNYF.js";
92
- import "./chunk-ELKFRTZT.js";
104
+ } from "./chunk-4FETKOY3.js";
93
105
  import {
94
106
  ATHENA_VERSION
95
107
  } from "./chunk-2R6PXY6Z.js";
108
+ import {
109
+ SCAN_FILE
110
+ } from "./chunk-44EGCEB2.js";
96
111
  import "./chunk-PVCIGUIT.js";
97
- import "./chunk-OLPSEQS5.js";
98
- import "./chunk-JCGDR4UV.js";
99
- import "./chunk-2RS6TA3D.js";
112
+ import "./chunk-ELKFRTZT.js";
113
+ import "./chunk-AKOI4VTD.js";
114
+ import "./chunk-SVTEJYMS.js";
115
+ import "./chunk-QCC4VJUH.js";
116
+ import "./chunk-WWQ5NKEC.js";
117
+ import "./chunk-YRIS7ZS6.js";
100
118
  import "./chunk-GHFRQAYT.js";
119
+ import "./chunk-INT3IGMQ.js";
101
120
  import "./chunk-673EPYYH.js";
102
121
  import {
103
122
  KNOWLEDGE_DOCS,
@@ -113,7 +132,6 @@ import {
113
132
  AthenaError,
114
133
  notFound
115
134
  } from "./chunk-AD4OZCU2.js";
116
- import "./chunk-INT3IGMQ.js";
117
135
  import "./chunk-XW3MLHI2.js";
118
136
  import "./chunk-EUPETUWA.js";
119
137
 
@@ -121,8 +139,8 @@ import "./chunk-EUPETUWA.js";
121
139
  import { execFile } from "child_process";
122
140
 
123
141
  // src/server/instance.ts
124
- import { promises as fs6 } from "fs";
125
- import path4 from "path";
142
+ import { promises as fs7 } from "fs";
143
+ import path5 from "path";
126
144
  import { fileURLToPath } from "url";
127
145
 
128
146
  // src/server/app.ts
@@ -568,6 +586,111 @@ function registerGraphRoutes({ app, root, events, state }) {
568
586
  });
569
587
  }
570
588
 
589
+ // src/server/routes/memory.ts
590
+ import { promises as fs2 } from "fs";
591
+ import path from "path";
592
+ var memoryWriteKey = (file) => `memory/${file}`;
593
+ var ID = "^m-[a-z0-9]{4,16}$";
594
+ var idParams = { type: "object", required: ["id"], additionalProperties: false, properties: { id: { type: "string", pattern: ID } } };
595
+ var fields = {
596
+ title: { type: "string", maxLength: 1e3 },
597
+ details: { type: "string", maxLength: 1e4 },
598
+ files: { type: "array", maxItems: 50, items: { type: "string", maxLength: 500 } },
599
+ tags: { type: "array", maxItems: 30, items: { type: "string", maxLength: 100 } },
600
+ evidence: { type: "string", maxLength: 2e3 }
601
+ };
602
+ function memoryCounts(entries) {
603
+ return {
604
+ total: entries.length,
605
+ unreviewed: entries.filter((e) => e.status === "unreviewed").length,
606
+ confirmed: entries.filter((e) => e.status === "confirmed").length,
607
+ superseded: entries.filter((e) => e.status === "superseded").length,
608
+ stale: entries.filter((e) => e.stale).length,
609
+ flagged: entries.filter((e) => e.flags.length > 0).length
610
+ };
611
+ }
612
+ function registerMemoryRoutes({ app, root, events, recentWrites }) {
613
+ const recordWrites = async () => {
614
+ for (const file of Object.values(MEMORY_FILES)) {
615
+ const text = await fs2.readFile(path.join(memoryDir(root), file), "utf8").catch(() => null);
616
+ if (text !== null) recentWrites.set(memoryWriteKey(file), contentHash(text));
617
+ }
618
+ };
619
+ const changed = async (action, id, message) => {
620
+ await recordWrites();
621
+ events.emit({ source: "web-ui", type: "memory.changed", level: "success", message, data: { action, id } });
622
+ };
623
+ app.get(
624
+ "/api/memory",
625
+ {
626
+ schema: {
627
+ querystring: {
628
+ type: "object",
629
+ additionalProperties: false,
630
+ properties: { kind: { type: "string", enum: [...MEMORY_KINDS] }, status: { type: "string", enum: [...MEMORY_STATUSES] }, stale: { type: "string", enum: ["true", "false"] } }
631
+ }
632
+ }
633
+ },
634
+ async (req) => {
635
+ const all = await listMemory(root);
636
+ const { kind, status, stale } = req.query;
637
+ const entries = all.filter((e) => (!kind || e.kind === kind) && (!status || e.status === status) && (stale === void 0 || e.stale === (stale === "true")));
638
+ return { entries, counts: memoryCounts(all) };
639
+ }
640
+ );
641
+ app.get("/api/memory/:id", { schema: { params: idParams } }, async (req) => getMemory(root, req.params.id));
642
+ app.post(
643
+ "/api/memory",
644
+ {
645
+ schema: {
646
+ body: {
647
+ type: "object",
648
+ required: ["kind", "title"],
649
+ additionalProperties: false,
650
+ properties: { kind: { type: "string", enum: [...MEMORY_KINDS] }, ...fields, supersedes: { type: "string", pattern: ID } }
651
+ }
652
+ }
653
+ },
654
+ async (req, reply) => {
655
+ const entry = await addMemory(root, req.body, "developer");
656
+ await changed("add", entry.id, `Added memory: ${entry.title}`);
657
+ return reply.code(201).send(entry);
658
+ }
659
+ );
660
+ app.post("/api/memory/:id/confirm", { schema: { params: idParams } }, async (req) => {
661
+ const entry = await confirmMemory(root, req.params.id);
662
+ await changed("confirm", entry.id, `Confirmed memory: ${entry.title}`);
663
+ return entry;
664
+ });
665
+ app.post(
666
+ "/api/memory/:id/supersede",
667
+ { schema: { params: idParams, body: { type: "object", required: ["by"], additionalProperties: false, properties: { by: { type: "string", pattern: ID } } } } },
668
+ async (req) => {
669
+ const { id } = req.params;
670
+ const { by } = req.body;
671
+ await getMemory(root, id);
672
+ if (id !== by && !(await listMemory(root)).some((e) => e.id === by)) throw new AthenaError(`Cannot supersede ${id}: no memory with id ${by}.`);
673
+ const entry = await supersedeMemory(root, id, by);
674
+ await changed("supersede", entry.id, `Memory ${id} superseded by ${by}`);
675
+ return entry;
676
+ }
677
+ );
678
+ app.patch(
679
+ "/api/memory/:id",
680
+ { schema: { params: idParams, body: { type: "object", minProperties: 1, additionalProperties: false, properties: fields } } },
681
+ async (req) => {
682
+ const entry = await updateMemory(root, req.params.id, req.body);
683
+ await changed("edit", entry.id, `Edited memory: ${entry.title}`);
684
+ return entry;
685
+ }
686
+ );
687
+ app.delete("/api/memory/:id", { schema: { params: idParams } }, async (req) => {
688
+ await forgetMemory(root, req.params.id);
689
+ await changed("forget", req.params.id, `Forgot memory ${req.params.id}`);
690
+ return { ok: true };
691
+ });
692
+ }
693
+
571
694
  // src/server/routes/review.ts
572
695
  function registerReviewRoutes({ app, root, scheduler }) {
573
696
  app.get("/api/review", async (req) => {
@@ -711,11 +834,11 @@ function registerSessionRoutes({ app, root, instanceId, getStatus }) {
711
834
  }
712
835
 
713
836
  // src/server/routes/static.ts
714
- import { promises as fs3 } from "fs";
837
+ import { promises as fs4 } from "fs";
715
838
 
716
839
  // src/server/static.ts
717
- import { promises as fs2 } from "fs";
718
- import path from "path";
840
+ import { promises as fs3 } from "fs";
841
+ import path2 from "path";
719
842
  var TYPES = {
720
843
  ".html": "text/html; charset=utf-8",
721
844
  ".js": "text/javascript; charset=utf-8",
@@ -731,20 +854,20 @@ var TYPES = {
731
854
  };
732
855
  async function buildAssetMap(webDir) {
733
856
  try {
734
- await fs2.access(path.join(webDir, "index.html"));
857
+ await fs3.access(path2.join(webDir, "index.html"));
735
858
  } catch {
736
859
  return null;
737
860
  }
738
861
  const map = /* @__PURE__ */ new Map();
739
862
  async function walk(dir) {
740
- for (const ent of await fs2.readdir(dir, { withFileTypes: true })) {
741
- const abs = path.join(dir, ent.name);
863
+ for (const ent of await fs3.readdir(dir, { withFileTypes: true })) {
864
+ const abs = path2.join(dir, ent.name);
742
865
  if (ent.isDirectory()) await walk(abs);
743
866
  else if (ent.isFile()) {
744
- const ext = path.extname(ent.name).toLowerCase();
867
+ const ext = path2.extname(ent.name).toLowerCase();
745
868
  const type = TYPES[ext];
746
869
  if (!type) continue;
747
- const urlPath = `/${path.relative(webDir, abs).split(path.sep).join("/")}`;
870
+ const urlPath = `/${path2.relative(webDir, abs).split(path2.sep).join("/")}`;
748
871
  map.set(urlPath, { abs, type, immutable: urlPath.startsWith("/assets/") });
749
872
  }
750
873
  }
@@ -763,7 +886,7 @@ function registerStaticRoutes(app, assets) {
763
886
  const sendAsset = async (reply, urlPath) => {
764
887
  if (!assets) return reply.code(503).type("text/html; charset=utf-8").send(MISSING_UI_HTML);
765
888
  const asset = assets.get(urlPath) ?? assets.get("/index.html");
766
- const body = await fs3.readFile(asset.abs);
889
+ const body = await fs4.readFile(asset.abs);
767
890
  reply.header("Cache-Control", asset.immutable ? "public, max-age=31536000, immutable" : "no-cache");
768
891
  return reply.type(asset.type).send(body);
769
892
  };
@@ -785,8 +908,8 @@ function registerStaticRoutes(app, assets) {
785
908
  }
786
909
 
787
910
  // src/server/routes/sync.ts
788
- import { promises as fs4 } from "fs";
789
- import path2 from "path";
911
+ import { promises as fs5 } from "fs";
912
+ import path3 from "path";
790
913
  function summarizePlan(plan) {
791
914
  if (!plan) return null;
792
915
  return { ...plan, documents: plan.documents.map(({ diff: _diff, ...rest }) => rest) };
@@ -824,7 +947,7 @@ function registerSyncRoutes(ctx) {
824
947
  try {
825
948
  const result = await ctx.scheduler.exclusive(() => applySync(root, plan));
826
949
  for (const d of plan.documents) {
827
- const text = await fs4.readFile(path2.join(athenaDir(root), d.file), "utf8").catch(() => null);
950
+ const text = await fs5.readFile(path3.join(athenaDir(root), d.file), "utf8").catch(() => null);
828
951
  if (text !== null) ctx.recentWrites.set(d.file, contentHash(text));
829
952
  }
830
953
  state.currentPlan = null;
@@ -950,8 +1073,8 @@ var SseHub = class {
950
1073
  };
951
1074
 
952
1075
  // src/server/watchers.ts
953
- import { promises as fs5, watch } from "fs";
954
- import path3 from "path";
1076
+ import { promises as fs6, watch } from "fs";
1077
+ import path4 from "path";
955
1078
  function watchKnowledgeDir(ctx, feed) {
956
1079
  const { events, recentWrites } = ctx;
957
1080
  let docsWatcher = null;
@@ -974,7 +1097,7 @@ function watchKnowledgeDir(ctx, feed) {
974
1097
  name,
975
1098
  setTimeout(async () => {
976
1099
  pending.delete(name);
977
- const text = await fs5.readFile(path3.join(dir, name), "utf8").catch(() => null);
1100
+ const text = await fs6.readFile(path4.join(dir, name), "utf8").catch(() => null);
978
1101
  const hash = text === null ? null : contentHash(text);
979
1102
  if (hash && recentWrites.get(name) === hash) return;
980
1103
  ctx.invalidateStatus();
@@ -992,6 +1115,73 @@ function watchKnowledgeDir(ctx, feed) {
992
1115
  for (const t of pending.values()) clearTimeout(t);
993
1116
  };
994
1117
  }
1118
+ var MEMORY_FILE_NAMES = new Set(Object.values(MEMORY_FILES));
1119
+ function watchMemoryDir(ctx, debounceMs = 150) {
1120
+ const { events, recentWrites } = ctx;
1121
+ const dir = memoryDir(ctx.root);
1122
+ const pending = /* @__PURE__ */ new Map();
1123
+ let memWatcher = null;
1124
+ let parentWatcher = null;
1125
+ let stopped = false;
1126
+ const onChange = (name) => {
1127
+ clearTimeout(pending.get(name));
1128
+ pending.set(
1129
+ name,
1130
+ setTimeout(async () => {
1131
+ pending.delete(name);
1132
+ const text = await fs6.readFile(path4.join(dir, name), "utf8").catch(() => null);
1133
+ const hash = text === null ? null : contentHash(text);
1134
+ const key = memoryWriteKey(name);
1135
+ if ((recentWrites.get(key) ?? null) === hash) return;
1136
+ if (hash) recentWrites.set(key, hash);
1137
+ else recentWrites.delete(key);
1138
+ if (stopped) return;
1139
+ events.emit({ source: "filesystem", type: "memory.changed", level: "info", message: text === null ? `memory/${name} was deleted on disk` : `memory/${name} changed on disk`, data: { action: "external", file: name } });
1140
+ }, debounceMs)
1141
+ );
1142
+ };
1143
+ const attach = () => {
1144
+ if (memWatcher || stopped) return true;
1145
+ try {
1146
+ memWatcher = watch(dir, { persistent: false }, (_type, filename) => {
1147
+ const name = filename?.toString();
1148
+ if (name && MEMORY_FILE_NAMES.has(name)) onChange(name);
1149
+ });
1150
+ memWatcher.on("error", () => {
1151
+ });
1152
+ } catch {
1153
+ return false;
1154
+ }
1155
+ for (const name of MEMORY_FILE_NAMES) onChange(name);
1156
+ return true;
1157
+ };
1158
+ void Promise.all(
1159
+ [...MEMORY_FILE_NAMES].map(async (name) => {
1160
+ const text = await fs6.readFile(path4.join(dir, name), "utf8").catch(() => null);
1161
+ if (text !== null && !recentWrites.has(memoryWriteKey(name))) recentWrites.set(memoryWriteKey(name), contentHash(text));
1162
+ })
1163
+ ).then(() => {
1164
+ if (stopped || attach()) return;
1165
+ try {
1166
+ parentWatcher = watch(athenaDir(ctx.root), { persistent: false }, (_type, filename) => {
1167
+ if (filename?.toString() === MEMORY_DIR && attach()) {
1168
+ parentWatcher?.close();
1169
+ parentWatcher = null;
1170
+ }
1171
+ });
1172
+ parentWatcher.on("error", () => {
1173
+ });
1174
+ } catch {
1175
+ parentWatcher = null;
1176
+ }
1177
+ });
1178
+ return () => {
1179
+ stopped = true;
1180
+ memWatcher?.close();
1181
+ parentWatcher?.close();
1182
+ for (const t of pending.values()) clearTimeout(t);
1183
+ };
1184
+ }
995
1185
  async function watchProjectFiles(ctx, debounceMs) {
996
1186
  const { events, state } = ctx;
997
1187
  try {
@@ -1108,9 +1298,11 @@ async function createServer(opts) {
1108
1298
  registerContextRoutes(ctx);
1109
1299
  registerGraphRoutes(ctx);
1110
1300
  registerActivityRoutes(ctx);
1301
+ registerMemoryRoutes(ctx);
1111
1302
  registerEventRoutes(app, hub);
1112
1303
  registerStaticRoutes(app, assets);
1113
1304
  const stopDocsWatcher = watchKnowledgeDir(ctx, feed);
1305
+ const stopMemoryWatcher = watchMemoryDir(ctx, opts.watchDebounceMs === void 0 ? void 0 : Math.min(opts.watchDebounceMs, 150));
1114
1306
  await feed.seed();
1115
1307
  if (opts.watch) await watchProjectFiles(ctx, opts.watchDebounceMs);
1116
1308
  return {
@@ -1123,6 +1315,7 @@ async function createServer(opts) {
1123
1315
  ctx.state.watcher = null;
1124
1316
  ctx.scheduler.close();
1125
1317
  stopDocsWatcher();
1318
+ stopMemoryWatcher();
1126
1319
  events.close();
1127
1320
  await app.close();
1128
1321
  hub.close();
@@ -1151,8 +1344,8 @@ async function findAvailablePort(host, start = DEFAULT_PORT, attempts = 100) {
1151
1344
 
1152
1345
  // src/server/instance.ts
1153
1346
  function defaultWebDir() {
1154
- const here = path4.dirname(fileURLToPath(import.meta.url));
1155
- return path4.basename(here) === "dist" ? path4.join(here, "web") : path4.resolve(here, "../../dist/web");
1347
+ const here = path5.dirname(fileURLToPath(import.meta.url));
1348
+ return path5.basename(here) === "dist" ? path5.join(here, "web") : path5.resolve(here, "../../dist/web");
1156
1349
  }
1157
1350
  function browserUrl(info) {
1158
1351
  const host = info.host.includes(":") ? `[${info.host}]` : info.host;
@@ -1168,8 +1361,8 @@ async function startServer(opts) {
1168
1361
  const server = await createServer({ root: opts.root, token, host, port, webDir: opts.webDir ?? defaultWebDir(), allowRemote: opts.allowRemote, watch: opts.watch ?? true });
1169
1362
  await server.app.listen({ host, port });
1170
1363
  const info = { pid: process.pid, host, port, instanceId: server.instanceId, token, startedAt: (/* @__PURE__ */ new Date()).toISOString() };
1171
- const file = path4.join(athenaDir(opts.root), INSTANCE_FILE);
1172
- await fs6.writeFile(file, `${JSON.stringify(info, null, 2)}
1364
+ const file = path5.join(athenaDir(opts.root), INSTANCE_FILE);
1365
+ await fs7.writeFile(file, `${JSON.stringify(info, null, 2)}
1173
1366
  `, { mode: 384 });
1174
1367
  await ensureGitignored(opts.root, INSTANCE_FILE);
1175
1368
  return {
@@ -1178,16 +1371,16 @@ async function startServer(opts) {
1178
1371
  url: browserUrl(info),
1179
1372
  async close() {
1180
1373
  const current = await readTextIfExists(file);
1181
- if (current && current.includes(server.instanceId)) await fs6.rm(file, { force: true });
1374
+ if (current && current.includes(server.instanceId)) await fs7.rm(file, { force: true });
1182
1375
  await server.close();
1183
1376
  }
1184
1377
  };
1185
1378
  }
1186
1379
  async function ensureGitignored(root, entry) {
1187
- const file = path4.join(athenaDir(root), ".gitignore");
1380
+ const file = path5.join(athenaDir(root), ".gitignore");
1188
1381
  const text = await readTextIfExists(file) ?? "";
1189
1382
  if (text.split(/\r?\n/).includes(entry)) return;
1190
- await fs6.writeFile(file, `${text}${text.endsWith("\n") || !text ? "" : "\n"}${entry}
1383
+ await fs7.writeFile(file, `${text}${text.endsWith("\n") || !text ? "" : "\n"}${entry}
1191
1384
  `);
1192
1385
  }
1193
1386
 
@@ -1256,4 +1449,4 @@ export {
1256
1449
  openBrowser,
1257
1450
  openCommand
1258
1451
  };
1259
- //# sourceMappingURL=open-2QSZKKUG.js.map
1452
+ //# sourceMappingURL=open-LJMOB6U2.js.map