@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.
- package/dist/accept-orchestration-IUAWQZUN.js +18 -0
- package/dist/add-P76GEMGF.js +8 -0
- package/dist/agent-UUTYOFTH.js +33 -0
- package/dist/agent-loader-EPXURMO7.js +2 -0
- package/dist/agent-loader-PYGPX6D2.js +2 -0
- package/dist/agent-state-KSQ3S7OB.js +2 -0
- package/dist/agents-suggest-HYTFMQD3.js +10 -0
- package/dist/aggregate-W66DM3GA.js +10 -0
- package/dist/ambient-HYZR42NX.js +35 -0
- package/dist/assess-UFPYEJKP.js +9 -0
- package/dist/auto-RHJXOZFL.js +14 -0
- package/dist/beacon-5QVYV5DF.js +13 -0
- package/dist/calibration-OLJYB5HN.js +7 -0
- package/dist/check-THVGY4R5.js +14 -0
- package/dist/chunk-22ISTMKI.js +31 -0
- package/dist/chunk-2QO33NYK.js +3 -0
- package/dist/chunk-33LKBMVK.js +134 -0
- package/dist/chunk-4QADCWPU.js +7 -0
- package/dist/chunk-4TXOVRWD.js +3 -0
- package/dist/chunk-4UJ4NIEQ.js +4 -0
- package/dist/chunk-4ZGGWZ32.js +3 -0
- package/dist/chunk-5TAVYPOV.js +2 -0
- package/dist/chunk-6EX37L4Q.js +8 -0
- package/dist/chunk-AD5TAD2A.js +5 -0
- package/dist/chunk-AGVAHVUA.js +2 -0
- package/dist/chunk-AO7ZSRME.js +13 -0
- package/dist/chunk-BFD3GFRK.js +2 -0
- package/dist/chunk-D34YFK4M.js +6 -0
- package/dist/chunk-DVZWCXB6.js +2 -0
- package/dist/chunk-EKZDFEJW.js +2 -0
- package/dist/chunk-ET5XJTSX.js +2 -0
- package/dist/chunk-FYDRENK7.js +3 -0
- package/dist/chunk-HMQ5BHP2.js +743 -0
- package/dist/chunk-HXKWL3VK.js +29 -0
- package/dist/chunk-IZSBGW6E.js +2 -0
- package/dist/chunk-J32OPJEX.js +2 -0
- package/dist/chunk-JBDMCRPP.js +7 -0
- package/dist/chunk-JIXHEBGK.js +7 -0
- package/dist/chunk-JNSJVCTU.js +2 -0
- package/dist/chunk-JQKKVAAN.js +2 -0
- package/dist/chunk-KLBH26PA.js +429 -0
- package/dist/chunk-L6K5HNDL.js +24 -0
- package/dist/chunk-LKAT7IAK.js +2 -0
- package/dist/chunk-M4UMM6DC.js +5 -0
- package/dist/chunk-NKYNHSA5.js +424 -0
- package/dist/chunk-NW6OKHE6.js +5 -0
- package/dist/chunk-NXRVR37G.js +60 -0
- package/dist/chunk-ODVKPZZ4.js +2 -0
- package/dist/chunk-PUBB7LIT.js +5 -0
- package/dist/chunk-Q2J542ST.js +2 -0
- package/dist/chunk-QGZRM6ZB.js +2 -0
- package/dist/chunk-QNZEG7IT.js +13 -0
- package/dist/chunk-QT2LKB3P.js +7 -0
- package/dist/chunk-RVRARWSY.js +9 -0
- package/dist/chunk-T6IDXUUA.js +2 -0
- package/dist/chunk-TYWB5IQJ.js +3 -0
- package/dist/chunk-UIKLE3WD.js +2 -0
- package/dist/chunk-V7K6CQVX.js +111 -0
- package/dist/chunk-VCKKJDLP.js +8 -0
- package/dist/chunk-VG7FN2TU.js +4 -0
- package/dist/chunk-W5IWDW4Y.js +16 -0
- package/dist/chunk-W7C6FFMO.js +8 -0
- package/dist/chunk-WESTEMIM.js +10 -0
- package/dist/chunk-WR6D3SC6.js +5 -0
- package/dist/chunk-WS2N27RX.js +3 -0
- package/dist/chunk-XMAV5AG6.js +2 -0
- package/dist/chunk-XROULIQN.js +2 -0
- package/dist/chunk-XUFYOXOU.js +3 -0
- package/dist/chunk-Y4XFVDZC.js +3 -0
- package/dist/chunk-Y6KXTQBG.js +2 -0
- package/dist/{chunk-GTR2TBIJ.js โ chunk-Z2UZUCY6.js} +237 -1047
- package/dist/chunk-Z34K6GY2.js +8 -0
- package/dist/claude-4LR3LJQZ.js +13 -0
- package/dist/claude-cli-UP6HGH7C.js +6 -0
- package/dist/claude-code-RLJ4GX77.js +11 -0
- package/dist/claude-code-teams-R37HJY3Y.js +29 -0
- package/dist/commands-LMUD5L6R.js +455 -0
- package/dist/compliance-GZ7UAOG3.js +6 -0
- package/dist/conductor-Y5IXELTL.js +4 -0
- package/dist/config-schema-HR7LDEQ6.js +2 -0
- package/dist/constellation-CG7C4WFE.js +13 -0
- package/dist/context-audit-RSSRX6XC.js +6 -0
- package/dist/cost-IDNVMAEV.js +10 -0
- package/dist/cost-PK4KIF7R.js +2 -0
- package/dist/cursor-cli-QKF7Z6M2.js +4 -0
- package/dist/cursorrules-U5O4G5T4.js +14 -0
- package/dist/decision-loader-2XPZE4EZ.js +2 -0
- package/dist/delete-P5VULXR4.js +14 -0
- package/dist/diff-RTFUKJHF.js +9 -0
- package/dist/discipline-H7LDI6NT.js +2 -0
- package/dist/dist-3ZCH25SG.js +2 -0
- package/dist/dist-KGRCLBJP-2QAPFYNF.js +39 -0
- package/dist/dist-R3RWD35F.js +2 -0
- package/dist/dist-VGFSP3XM.js +2 -0
- package/dist/dist-VXCZWVVJ.js +2 -0
- package/dist/dist-W3XCATBJ.js +2 -0
- package/dist/docs-EDQ2STFK.js +2 -0
- package/dist/docs-RXPN6CK7.js +12 -0
- package/dist/doctor-2T2QL6VM.js +2 -0
- package/dist/drift-ILZE5BFJ.js +13 -0
- package/dist/echo-UPTQUEDU.js +46 -0
- package/dist/edit-GUU3HBVW.js +9 -0
- package/dist/event-Y3VXC2RV.js +3 -0
- package/dist/explain-files-3GPZUETV.js +4 -0
- package/dist/export-CV5KCTPS.js +2 -0
- package/dist/flow-S3RQ4YPY.js +11 -0
- package/dist/global-C44FW4G2.js +13 -0
- package/dist/graduate-3BBSC27A.js +5 -0
- package/dist/graph-CNDE5TAT.js +2 -0
- package/dist/graph-server-COZR5C3Z.js +14 -0
- package/dist/habits-4J2KRYUL.js +42 -0
- package/dist/history-UW454SDP.js +12 -0
- package/dist/hooks-XH52VGOU.js +2 -0
- package/dist/index.js +15 -1039
- package/dist/init-24MAQJFM.js +2 -0
- package/dist/integrity-UYDOOJDP.js +7 -0
- package/dist/integrity-checker-DHGMZQDG.js +2 -0
- package/dist/journal-loader-GLH7XFTK.js +2 -0
- package/dist/lint-IGKE6UPS.js +26 -0
- package/dist/list-5IUGP3ZB.js +7 -0
- package/dist/list-YKIQNKGB.js +6 -0
- package/dist/lore-loader-RVQI5GXL.js +2 -0
- package/dist/lore-loader-XY5MZRR2.js +2 -0
- package/dist/lore-server-FC2GMDLT.js +14 -0
- package/dist/manual-RXSPSFLL.js +20 -0
- package/dist/mcp.js +93 -20484
- package/dist/migrate-X5OMAFAQ.js +59 -0
- package/dist/migrate-assessments-GEI5WMI2.js +4 -0
- package/dist/model-discovery-HMB3YI4L.js +2 -0
- package/dist/nomination-engine-XF7TWPAP.js +2 -0
- package/dist/notebook-PE3JSYZI.js +11 -0
- package/dist/notebook-loader-CENTDDUJ.js +2 -0
- package/dist/orchestrate-35HBQ3O3.js +8 -0
- package/dist/peers-P2KXU7ZK.js +5 -0
- package/dist/persona-STQWZH5P.js +29 -0
- package/dist/pipeline-MZUITRVN.js +4 -0
- package/dist/platform-server-2KXHGHFV.js +25 -0
- package/dist/plugin-update-checker-M7PW434O.js +2 -0
- package/dist/portal-check-3JVNLOEP.js +8 -0
- package/dist/portal-compliance-2UG4VKWH.js +2 -0
- package/dist/probe-5L5BQDGE.js +6 -0
- package/dist/project-type-SURTOIG7.js +2 -0
- package/dist/promote-NJQDZBZA.js +8 -0
- package/dist/providers-4PXMWA7V.js +8 -0
- package/dist/quiz-FE5UGAY2.js +10 -0
- package/dist/record-YXPB34MY.js +6 -0
- package/dist/reindex-PGDQSM42.js +2 -0
- package/dist/remember-MJRNTXYS.js +14 -0
- package/dist/retag-N5XF3KXP.js +6 -0
- package/dist/review-6UAH6V3R.js +11 -0
- package/dist/review-77QI6VOC.js +6 -0
- package/dist/ripple-ZGDITCGB.js +10 -0
- package/dist/roster-FLRZ5J42.js +2 -0
- package/dist/sentinel-HYAZ3CO5.js +19 -0
- package/dist/sentinel-bridge-VR357PKL.js +2 -0
- package/dist/sentinel-mcp.js +38 -3808
- package/dist/sentinel.js +1 -34
- package/dist/serve-JE6UF5P2.js +8 -0
- package/dist/serve-L52ZUTU6.js +10 -0
- package/dist/serve-OY6XYL7F.js +12 -0
- package/dist/server-2MNROHF6.js +7 -0
- package/dist/server-4YNUIK4W.js +8 -0
- package/dist/session-tracker-SKOMBDOW.js +2 -0
- package/dist/session-work-log-3MNUDEZ6.js +2 -0
- package/dist/session-work-log-J2H5OZBR.js +2 -0
- package/dist/setup-3F5IK7MO.js +31 -0
- package/dist/setup-KPIMRZ4Q.js +2 -0
- package/dist/shift-6GCNH666.js +11 -0
- package/dist/show-BOAVWZPZ.js +7 -0
- package/dist/show-PJ5LFLIL.js +5 -0
- package/dist/snapshot-L2G56RPL.js +8 -0
- package/dist/spawn-UH5RENSE.js +12 -0
- package/dist/status-77M3SDIF.js +8 -0
- package/dist/status-A37ECYNJ.js +6 -0
- package/dist/summary-ZJLQ6KHB.js +7 -0
- package/dist/sweep-HU74OPVW.js +17 -0
- package/dist/switch-CTW4PDGI.js +17 -0
- package/dist/symphony-3QMBGCZY.js +2 -0
- package/dist/symphony-QI63XL62.js +53 -0
- package/dist/symphony-loader-XACVV2E3.js +2 -0
- package/dist/symphony-peers-U4KHMKGI.js +2 -0
- package/dist/symphony-peers-X5NGWXFP.js +2 -0
- package/dist/symphony-relay-5GY5JIPT.js +3 -0
- package/dist/sync-QRDSFETO.js +2 -0
- package/dist/sync-llms-HL5PPW3M.js +15 -0
- package/dist/task-loader-NZFDTUQ5.js +2 -0
- package/dist/team-WGERKGNP.js +2 -0
- package/dist/test-BQJMS4Y2.js +111 -0
- package/dist/thread-HFXK65D4.js +41 -0
- package/dist/timeline-K3ZFKJ3R.js +6 -0
- package/dist/triage-FCWOZASE.js +18 -0
- package/dist/tutorial-UC6YQMNN.js +305 -0
- package/dist/university-content/courses/.purpose +74 -5
- package/dist/university-content/courses/para-701.json +807 -0
- package/dist/university-content/plsat/.purpose +3 -2
- package/dist/university-ui/assets/{index-BjewBB6s.js โ index-CGFJczb1.js} +2 -2
- package/dist/university-ui/assets/{index-BjewBB6s.js.map โ index-CGFJczb1.js.map} +1 -1
- package/dist/university-ui/index.html +1 -1
- package/dist/upgrade-B4IOLZYK.js +53 -0
- package/dist/validate-C6SMKGYD.js +9 -0
- package/dist/validate-LSCDOLBO.js +13 -0
- package/dist/validate-VZXTJHGO.js +6 -0
- package/dist/watch-LRM5XD46.js +8 -0
- package/dist/watch-PZCCUP6K.js +9 -0
- package/dist/wisdom-XZ3QKPNP.js +7 -0
- package/dist/work-log-loader-DL5GZ2BQ.js +2 -0
- package/dist/workspace-2ODL5WLY.js +2 -0
- package/package.json +1 -1
- package/platform-ui/dist/assets/AmbientSection-DqQ2mfCO.js +1 -0
- package/platform-ui/dist/assets/{CanvasSection-DwPTRdIN.js โ CanvasSection-DLW0s-Bu.js} +1 -1
- package/platform-ui/dist/assets/{DocsSection-BJc_ws4I.js โ DocsSection-BQ9Hi51g.js} +1 -1
- package/platform-ui/dist/assets/{GitSection-DhqBo1xc.js โ GitSection-QQeUX6o3.js} +1 -1
- package/platform-ui/dist/assets/{GraphSection-D9fhVnZ0.js โ GraphSection-0c9C-w7K.js} +2 -2
- package/platform-ui/dist/assets/{GraphSection-BlgXTl53.css โ GraphSection-Bbs2a8sC.css} +1 -1
- package/platform-ui/dist/assets/LoreSection--t56kCj2.js +1 -0
- package/platform-ui/dist/assets/LoreSection-qnmm3o4y.css +1 -0
- package/platform-ui/dist/assets/SentinelSection-C4OoME9U.js +1 -0
- package/platform-ui/dist/assets/{SymphonySection-BRoBaUSS.js โ SymphonySection-B-rvsLxq.js} +1 -1
- package/platform-ui/dist/assets/TeamSection-CBFmNEEo.js +1 -0
- package/platform-ui/dist/assets/index-Bxp0TVaf.css +1 -0
- package/platform-ui/dist/assets/index-DPpOdAtC.js +57 -0
- package/platform-ui/dist/index.html +2 -2
- package/dist/accept-orchestration-UQLM7PTQ.js +0 -189
- package/dist/add-FZRKEGH4.js +0 -81
- package/dist/agent-WERIO2XV.js +0 -523
- package/dist/agent-loader-TFIANSF4.js +0 -44
- package/dist/agent-state-S5DAWPTF.js +0 -24
- package/dist/agents-suggest-DNSYJ6IA.js +0 -83
- package/dist/aggregate-H57K7PNV.js +0 -88
- package/dist/assess-4WVXZLZQ.js +0 -68
- package/dist/auto-QFS5NHQU.js +0 -504
- package/dist/beacon-KXZXYQHX.js +0 -251
- package/dist/calibration-V46G7JTY.js +0 -135
- package/dist/check-OWAIWV23.js +0 -175
- package/dist/chunk-2IO7JAG2.js +0 -148
- package/dist/chunk-2T6BTYBN.js +0 -712
- package/dist/chunk-36TKPM5Z.js +0 -400
- package/dist/chunk-45MUDW6E.js +0 -804
- package/dist/chunk-4BLYIB7J.js +0 -5701
- package/dist/chunk-4L3UTYQX.js +0 -677
- package/dist/chunk-4NCFWYGG.js +0 -110
- package/dist/chunk-54LTTQBH.js +0 -138
- package/dist/chunk-5EWAQHFY.js +0 -269
- package/dist/chunk-5JGJACDU.js +0 -37
- package/dist/chunk-5OUOLN6M.js +0 -659
- package/dist/chunk-5VKJBNJL.js +0 -444
- package/dist/chunk-6N3JTACN.js +0 -2260
- package/dist/chunk-6QC3YGB6.js +0 -114
- package/dist/chunk-7N7GSU6K.js +0 -34
- package/dist/chunk-ABVQGRF7.js +0 -268
- package/dist/chunk-CL7JSK52.js +0 -129
- package/dist/chunk-CSD7IHSN.js +0 -152
- package/dist/chunk-EDOAWN7J.js +0 -717
- package/dist/chunk-EKGMAM62.js +0 -525
- package/dist/chunk-EZ3GOCYC.js +0 -132
- package/dist/chunk-F3BCHPYT.js +0 -143
- package/dist/chunk-FKJUBQU3.js +0 -3081
- package/dist/chunk-GT5QGC2H.js +0 -253
- package/dist/chunk-GZDFVP2N.js +0 -540
- package/dist/chunk-IRKUEJVW.js +0 -405
- package/dist/chunk-J2JEQRT3.js +0 -164
- package/dist/chunk-JASGXLK3.js +0 -679
- package/dist/chunk-KVDYJLTC.js +0 -121
- package/dist/chunk-L27I3CPZ.js +0 -357
- package/dist/chunk-LHLIAYQ3.js +0 -185
- package/dist/chunk-MCMOGQMU.js +0 -145
- package/dist/chunk-NQKQG45G.js +0 -688
- package/dist/chunk-PBHIFAL4.js +0 -259
- package/dist/chunk-PDX44BCA.js +0 -11
- package/dist/chunk-PMXRGPRQ.js +0 -305
- package/dist/chunk-RAB5IKPR.js +0 -487
- package/dist/chunk-RJE5G7WO.js +0 -590
- package/dist/chunk-RTHA3XRE.js +0 -880
- package/dist/chunk-S2HO5MLR.js +0 -621
- package/dist/chunk-S3ORKP3V.js +0 -716
- package/dist/chunk-TAIJOFOE.js +0 -124
- package/dist/chunk-TXESEO7Y.js +0 -245
- package/dist/chunk-UPLDI7CN.js +0 -1334
- package/dist/chunk-VL67H5IC.js +0 -506
- package/dist/chunk-VPPK3SY4.js +0 -1136
- package/dist/chunk-YMDLDELF.js +0 -314
- package/dist/chunk-YO6DVTL7.js +0 -99
- package/dist/chunk-YRZ5RPEB.js +0 -1561
- package/dist/chunk-ZDHLG5VP.js +0 -5676
- package/dist/chunk-ZGUAAVMA.js +0 -756
- package/dist/chunk-ZSYVKSY6.js +0 -2602
- package/dist/claude-FRRWJSTJ.js +0 -362
- package/dist/claude-cli-XJLK2X4L.js +0 -276
- package/dist/claude-code-HTBA4XRB.js +0 -126
- package/dist/claude-code-teams-T4SP24MD.js +0 -199
- package/dist/commands-5N4ILTPH.js +0 -5859
- package/dist/conductor-CQVGTEQN.js +0 -161
- package/dist/config-schema-EA4XALGG.js +0 -154
- package/dist/constellation-A26CCGQS.js +0 -225
- package/dist/context-audit-RLO3ETRP.js +0 -682
- package/dist/cost-BGM32XJU.js +0 -93
- package/dist/cost-VI46A4XL.js +0 -174
- package/dist/cursor-cli-JVEZGHWQ.js +0 -269
- package/dist/cursorrules-HLIKJJZT.js +0 -84
- package/dist/decision-loader-WWCLIQPJ.js +0 -20
- package/dist/delete-KBRPQLPC.js +0 -56
- package/dist/diff-D4X53HAC.js +0 -126
- package/dist/discipline-FA4OZXIS.js +0 -24
- package/dist/dist-34NA5RS5.js +0 -74
- package/dist/dist-5QE2BB2B-5S3T6Y3T.js +0 -6919
- package/dist/dist-77JDTVAY.js +0 -62
- package/dist/dist-OGTSAZ55.js +0 -1358
- package/dist/dist-QK4SQAK7.js +0 -64
- package/dist/dist-TA6LSC2Q.js +0 -20
- package/dist/docs-PBZB7LYP.js +0 -89
- package/dist/docs-QIYKO3BR.js +0 -155
- package/dist/doctor-ULBOHEIC.js +0 -11
- package/dist/drift-R5NRKFHI.js +0 -251
- package/dist/echo-O2LY7CC2.js +0 -248
- package/dist/edit-R2HNLMOG.js +0 -63
- package/dist/event-25OJKDCE.js +0 -31
- package/dist/export-IWVL7XLF.js +0 -38
- package/dist/flow-CRRVV3O3.js +0 -185
- package/dist/global-3NG5JXUB.js +0 -136
- package/dist/graduate-USAWGBJM.js +0 -160
- package/dist/graph-VHUMAAS6.js +0 -12
- package/dist/graph-server-YL22VBBN.js +0 -116
- package/dist/habits-OL5NGPXO.js +0 -1405
- package/dist/history-WOWC573W.js +0 -277
- package/dist/hooks-HFWSCGPV.js +0 -12
- package/dist/integrity-IHO4FZTS.js +0 -194
- package/dist/integrity-checker-PSKJA5SB.js +0 -12
- package/dist/journal-loader-5EYSBFFY.js +0 -18
- package/dist/lint-K6CJGGPH.js +0 -456
- package/dist/list-4YK7QKFF.js +0 -57
- package/dist/list-ENR7Q4CR.js +0 -56
- package/dist/lore-loader-7NO6N6FT.js +0 -26
- package/dist/lore-server-UNJY5KC3.js +0 -118
- package/dist/manual-G6FISID5.js +0 -204
- package/dist/migrate-LS45DNEV.js +0 -889
- package/dist/migrate-assessments-RGH4O6IX.js +0 -97
- package/dist/model-discovery-D2H3VBGC.js +0 -8
- package/dist/nomination-engine-RV5CNO5B.js +0 -42
- package/dist/notebook-YWIYGEHV.js +0 -155
- package/dist/orchestrate-JLILBBJE.js +0 -324
- package/dist/peers-DEOUIZM6.js +0 -82
- package/dist/persona-UHAHIVST.js +0 -390
- package/dist/pipeline-L4HCSBGN.js +0 -263
- package/dist/platform-server-H5YO3DQD.js +0 -1475
- package/dist/plugin-update-checker-KRRSGXMV.js +0 -12
- package/dist/portal-check-NPYGII2D.js +0 -42
- package/dist/portal-compliance-J7DGAPFX.js +0 -18
- package/dist/probe-MHL5HQZ2.js +0 -167
- package/dist/promote-F6ZYZZAL.js +0 -182
- package/dist/providers-GK7PB2OL.js +0 -104
- package/dist/quiz-M66SC7F7.js +0 -99
- package/dist/record-RA4WR2BO.js +0 -49
- package/dist/reindex-5LTD53ZC.js +0 -16
- package/dist/remember-HBWJ655S.js +0 -77
- package/dist/retag-3OLCVDEQ.js +0 -62
- package/dist/review-27ATYTD2.js +0 -33
- package/dist/review-57QMURZV.js +0 -334
- package/dist/ripple-JPBXP5I3.js +0 -215
- package/dist/sentinel-4XIG4STA.js +0 -63
- package/dist/sentinel-bridge-MDUXTQRL.js +0 -109
- package/dist/serve-CAH3PHE7.js +0 -33
- package/dist/serve-INL7SNBK.js +0 -36
- package/dist/serve-KBSE36PL.js +0 -49
- package/dist/server-54SKYFFY.js +0 -1647
- package/dist/server-XUOIO7E6.js +0 -338
- package/dist/session-tracker-C4BMD5WG.js +0 -13
- package/dist/session-work-log-MZ47OAPB.js +0 -20
- package/dist/setup-EDS27WUR.js +0 -25
- package/dist/setup-KO5AFC4K.js +0 -296
- package/dist/shift-D2JOHHBF.js +0 -668
- package/dist/show-5PV5KFJE.js +0 -176
- package/dist/show-NQKYX6WQ.js +0 -82
- package/dist/snapshot-BK4RBPCG.js +0 -62
- package/dist/spawn-RCHNXDHE.js +0 -196
- package/dist/status-WGIAQODY.js +0 -71
- package/dist/summary-NIRABMF5.js +0 -140
- package/dist/sweep-QMHNSIY5.js +0 -934
- package/dist/switch-6EJPZDIA.js +0 -232
- package/dist/symphony-4OCY36AI.js +0 -791
- package/dist/symphony-B75X2MME.js +0 -326
- package/dist/symphony-loader-UZGON56V.js +0 -90
- package/dist/symphony-peers-2ZQYLRNI.js +0 -34
- package/dist/symphony-peers-OL7F6M5S.js +0 -121
- package/dist/symphony-relay-UJYUXN65.js +0 -710
- package/dist/sync-VEHUH4OA.js +0 -11
- package/dist/sync-llms-YHCFIE6X.js +0 -166
- package/dist/task-loader-LDYWQSLM.js +0 -20
- package/dist/team-O5MIIFMA.js +0 -34
- package/dist/test-566CP5KC.js +0 -1017
- package/dist/thread-N754I4D5.js +0 -274
- package/dist/timeline-M3CICQFE.js +0 -112
- package/dist/triage-HHYGT3HY.js +0 -671
- package/dist/tutorial-KD22SUNO.js +0 -666
- package/dist/upgrade-H5PF32BW.js +0 -551
- package/dist/validate-CNKEKO6A.js +0 -134
- package/dist/validate-MB5ULIHS.js +0 -39
- package/dist/validate-QH3LADM6.js +0 -64
- package/dist/watch-2TKP5PVL.js +0 -199
- package/dist/watch-ZF4ML6CD.js +0 -111
- package/dist/wisdom-AATMGNFA.js +0 -319
- package/dist/work-log-loader-5L45XNYZ.js +0 -14
- package/dist/workspace-6E6OSRNU.js +0 -21
- package/platform-ui/dist/assets/AmbientSection-WtHfNedO.js +0 -1
- package/platform-ui/dist/assets/LoreSection-C3EixkjW.css +0 -1
- package/platform-ui/dist/assets/LoreSection-CwDDHrz9.js +0 -1
- package/platform-ui/dist/assets/SentinelSection-Cl7e5oZ6.js +0 -1
- package/platform-ui/dist/assets/TeamSection-CqSIMrKz.js +0 -1
- package/platform-ui/dist/assets/index-CfpZFjea.css +0 -1
- package/platform-ui/dist/assets/index-F0KL9xrN.js +0 -57
package/dist/wisdom-AATMGNFA.js
DELETED
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import "./chunk-PDX44BCA.js";
|
|
3
|
-
|
|
4
|
-
// src/commands/wisdom/index.ts
|
|
5
|
-
import * as fs from "fs";
|
|
6
|
-
import * as path from "path";
|
|
7
|
-
import chalk from "chalk";
|
|
8
|
-
import * as yaml from "js-yaml";
|
|
9
|
-
var WISDOM_DIR = ".paradigm/wisdom";
|
|
10
|
-
async function wisdomShowCommand(symbol, options = {}) {
|
|
11
|
-
const rootDir = process.cwd();
|
|
12
|
-
const wisdomPath = path.join(rootDir, WISDOM_DIR);
|
|
13
|
-
if (!fs.existsSync(wisdomPath)) {
|
|
14
|
-
console.log(chalk.yellow("No wisdom directory found."));
|
|
15
|
-
console.log(chalk.gray(`Run \`paradigm wisdom init\` to create .paradigm/wisdom/`));
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const preferences = loadYaml(path.join(wisdomPath, "preferences.yaml"));
|
|
19
|
-
const antipatterns = loadYaml(
|
|
20
|
-
path.join(wisdomPath, "antipatterns.yaml")
|
|
21
|
-
);
|
|
22
|
-
const expertise = loadYaml(path.join(wisdomPath, "expertise.yaml"));
|
|
23
|
-
const decisions = loadDecisions(wisdomPath);
|
|
24
|
-
if (options.json) {
|
|
25
|
-
console.log(
|
|
26
|
-
JSON.stringify(
|
|
27
|
-
{
|
|
28
|
-
preferences,
|
|
29
|
-
antipatterns: antipatterns?.antipatterns || [],
|
|
30
|
-
expertise: expertise?.experts || [],
|
|
31
|
-
decisions
|
|
32
|
-
},
|
|
33
|
-
null,
|
|
34
|
-
2
|
|
35
|
-
)
|
|
36
|
-
);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
console.log(chalk.magenta("\n Wisdom\n"));
|
|
40
|
-
if (symbol) {
|
|
41
|
-
console.log(chalk.cyan(` Symbol: ${symbol}
|
|
42
|
-
`));
|
|
43
|
-
const pref = preferences?.by_symbol?.[symbol];
|
|
44
|
-
if (pref) {
|
|
45
|
-
console.log(chalk.white(" Preferences:"));
|
|
46
|
-
if (pref.patterns) {
|
|
47
|
-
pref.patterns.forEach((p) => console.log(chalk.gray(` - ${p}`)));
|
|
48
|
-
}
|
|
49
|
-
if (pref.testing) console.log(chalk.gray(` Testing: ${pref.testing}`));
|
|
50
|
-
console.log();
|
|
51
|
-
}
|
|
52
|
-
const symbolAntipatterns = (antipatterns?.antipatterns || []).filter(
|
|
53
|
-
(a) => a.symbols.includes(symbol)
|
|
54
|
-
);
|
|
55
|
-
if (symbolAntipatterns.length > 0) {
|
|
56
|
-
console.log(chalk.red(" Antipatterns:"));
|
|
57
|
-
symbolAntipatterns.forEach((a) => {
|
|
58
|
-
console.log(chalk.gray(` [${a.id}] ${a.description}`));
|
|
59
|
-
console.log(chalk.gray(` Reason: ${a.reason}`));
|
|
60
|
-
console.log(chalk.green(` Alternative: ${a.alternative}`));
|
|
61
|
-
console.log();
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
const symbolDecisions = decisions.filter((d) => d.symbols.includes(symbol));
|
|
65
|
-
if (symbolDecisions.length > 0) {
|
|
66
|
-
console.log(chalk.blue(" Decisions:"));
|
|
67
|
-
symbolDecisions.forEach((d) => {
|
|
68
|
-
console.log(chalk.gray(` [${d.id}] ${d.title} (${d.status})`));
|
|
69
|
-
});
|
|
70
|
-
console.log();
|
|
71
|
-
}
|
|
72
|
-
const experts2 = (expertise?.experts || []).filter((e) => e.symbols?.includes(symbol));
|
|
73
|
-
if (experts2.length > 0) {
|
|
74
|
-
console.log(chalk.yellow(" Experts:"));
|
|
75
|
-
experts2.forEach((e) => {
|
|
76
|
-
console.log(chalk.gray(` - ${e.name}${e.contact ? ` (${e.contact})` : ""}`));
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
console.log(chalk.white(" Global Preferences:"));
|
|
82
|
-
if (preferences?.global) {
|
|
83
|
-
const global = preferences.global;
|
|
84
|
-
if (global.code_style?.length) {
|
|
85
|
-
console.log(chalk.gray(" Code Style:"));
|
|
86
|
-
global.code_style.forEach((s) => console.log(chalk.gray(` - ${s}`)));
|
|
87
|
-
}
|
|
88
|
-
if (global.testing?.length) {
|
|
89
|
-
console.log(chalk.gray(" Testing:"));
|
|
90
|
-
global.testing.forEach((t) => console.log(chalk.gray(` - ${t}`)));
|
|
91
|
-
}
|
|
92
|
-
} else {
|
|
93
|
-
console.log(chalk.gray(" No global preferences defined"));
|
|
94
|
-
}
|
|
95
|
-
console.log();
|
|
96
|
-
const symbolPrefs = Object.keys(preferences?.by_symbol || {});
|
|
97
|
-
if (symbolPrefs.length > 0) {
|
|
98
|
-
console.log(chalk.white(` Symbol Preferences: ${symbolPrefs.length}`));
|
|
99
|
-
symbolPrefs.slice(0, 5).forEach((s) => console.log(chalk.gray(` - ${s}`)));
|
|
100
|
-
if (symbolPrefs.length > 5) {
|
|
101
|
-
console.log(chalk.gray(` ... and ${symbolPrefs.length - 5} more`));
|
|
102
|
-
}
|
|
103
|
-
console.log();
|
|
104
|
-
}
|
|
105
|
-
const antis = antipatterns?.antipatterns || [];
|
|
106
|
-
if (antis.length > 0) {
|
|
107
|
-
console.log(chalk.red(` Antipatterns: ${antis.length}`));
|
|
108
|
-
antis.slice(0, 3).forEach((a) => {
|
|
109
|
-
console.log(chalk.gray(` [${a.id}] ${a.description.slice(0, 60)}...`));
|
|
110
|
-
});
|
|
111
|
-
if (antis.length > 3) {
|
|
112
|
-
console.log(chalk.gray(` ... and ${antis.length - 3} more`));
|
|
113
|
-
}
|
|
114
|
-
console.log();
|
|
115
|
-
}
|
|
116
|
-
if (decisions.length > 0) {
|
|
117
|
-
console.log(chalk.blue(` Decisions: ${decisions.length}`));
|
|
118
|
-
decisions.slice(0, 3).forEach((d) => {
|
|
119
|
-
console.log(chalk.gray(` [${d.id}] ${d.title} (${d.status})`));
|
|
120
|
-
});
|
|
121
|
-
if (decisions.length > 3) {
|
|
122
|
-
console.log(chalk.gray(` ... and ${decisions.length - 3} more`));
|
|
123
|
-
}
|
|
124
|
-
console.log();
|
|
125
|
-
}
|
|
126
|
-
const experts = expertise?.experts || [];
|
|
127
|
-
if (experts.length > 0) {
|
|
128
|
-
console.log(chalk.yellow(` Experts: ${experts.length}`));
|
|
129
|
-
experts.slice(0, 3).forEach((e) => {
|
|
130
|
-
console.log(chalk.gray(` - ${e.name}: ${e.areas?.join(", ") || e.symbols?.join(", ")}`));
|
|
131
|
-
});
|
|
132
|
-
console.log();
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
async function wisdomInitCommand(options = {}) {
|
|
136
|
-
const rootDir = process.cwd();
|
|
137
|
-
const wisdomPath = path.join(rootDir, WISDOM_DIR);
|
|
138
|
-
if (fs.existsSync(wisdomPath) && !options.force) {
|
|
139
|
-
console.log(chalk.yellow("Wisdom directory already exists."));
|
|
140
|
-
console.log(chalk.gray("Use --force to reinitialize"));
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
fs.mkdirSync(wisdomPath, { recursive: true });
|
|
144
|
-
fs.mkdirSync(path.join(wisdomPath, "decisions"), { recursive: true });
|
|
145
|
-
const preferencesTemplate = {
|
|
146
|
-
version: "1.0",
|
|
147
|
-
updated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
148
|
-
by_symbol: {
|
|
149
|
-
"@example": {
|
|
150
|
-
patterns: ["Use optimistic UI updates", "Show skeleton loaders"],
|
|
151
|
-
testing: "Require e2e tests for happy path"
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
global: {
|
|
155
|
-
code_style: ["Prefer early returns", "Named exports only"],
|
|
156
|
-
testing: ["Unit for pure functions", "E2E for critical flows"]
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
const antipatternsTemplate = {
|
|
160
|
-
version: "1.0",
|
|
161
|
-
antipatterns: [
|
|
162
|
-
{
|
|
163
|
-
id: "example-001",
|
|
164
|
-
symbols: ["@example"],
|
|
165
|
-
description: "Example antipattern - do NOT do this",
|
|
166
|
-
reason: "Explain why this is bad",
|
|
167
|
-
alternative: "Do this instead",
|
|
168
|
-
added: (/* @__PURE__ */ new Date()).toISOString()
|
|
169
|
-
}
|
|
170
|
-
]
|
|
171
|
-
};
|
|
172
|
-
const expertiseTemplate = {
|
|
173
|
-
version: "1.0",
|
|
174
|
-
experts: [
|
|
175
|
-
{
|
|
176
|
-
name: "your-name",
|
|
177
|
-
symbols: ["@feature"],
|
|
178
|
-
areas: ["domain-area"],
|
|
179
|
-
contact: "email or slack"
|
|
180
|
-
}
|
|
181
|
-
]
|
|
182
|
-
};
|
|
183
|
-
fs.writeFileSync(
|
|
184
|
-
path.join(wisdomPath, "preferences.yaml"),
|
|
185
|
-
yaml.dump(preferencesTemplate, { lineWidth: -1 })
|
|
186
|
-
);
|
|
187
|
-
fs.writeFileSync(
|
|
188
|
-
path.join(wisdomPath, "antipatterns.yaml"),
|
|
189
|
-
yaml.dump(antipatternsTemplate, { lineWidth: -1 })
|
|
190
|
-
);
|
|
191
|
-
fs.writeFileSync(
|
|
192
|
-
path.join(wisdomPath, "expertise.yaml"),
|
|
193
|
-
yaml.dump(expertiseTemplate, { lineWidth: -1 })
|
|
194
|
-
);
|
|
195
|
-
console.log(chalk.green("Wisdom directory initialized!"));
|
|
196
|
-
console.log(chalk.gray(` ${wisdomPath}/`));
|
|
197
|
-
console.log(chalk.gray(" preferences.yaml"));
|
|
198
|
-
console.log(chalk.gray(" antipatterns.yaml"));
|
|
199
|
-
console.log(chalk.gray(" expertise.yaml"));
|
|
200
|
-
console.log(chalk.gray(" decisions/"));
|
|
201
|
-
}
|
|
202
|
-
async function wisdomAddAntipatternCommand(options) {
|
|
203
|
-
const rootDir = process.cwd();
|
|
204
|
-
const filePath = path.join(rootDir, WISDOM_DIR, "antipatterns.yaml");
|
|
205
|
-
let data = {
|
|
206
|
-
version: "1.0",
|
|
207
|
-
antipatterns: []
|
|
208
|
-
};
|
|
209
|
-
if (fs.existsSync(filePath)) {
|
|
210
|
-
const content = fs.readFileSync(filePath, "utf8");
|
|
211
|
-
data = yaml.load(content);
|
|
212
|
-
} else {
|
|
213
|
-
fs.mkdirSync(path.join(rootDir, WISDOM_DIR), { recursive: true });
|
|
214
|
-
}
|
|
215
|
-
const antipattern = {
|
|
216
|
-
id: options.id,
|
|
217
|
-
symbols: options.symbols.split(",").map((s) => s.trim()),
|
|
218
|
-
description: options.description,
|
|
219
|
-
reason: options.reason,
|
|
220
|
-
alternative: options.alternative,
|
|
221
|
-
added: (/* @__PURE__ */ new Date()).toISOString()
|
|
222
|
-
};
|
|
223
|
-
data.antipatterns.push(antipattern);
|
|
224
|
-
fs.writeFileSync(filePath, yaml.dump(data, { lineWidth: -1 }));
|
|
225
|
-
console.log(chalk.green(`Antipattern ${options.id} added!`));
|
|
226
|
-
}
|
|
227
|
-
async function wisdomDecideCommand(options) {
|
|
228
|
-
const rootDir = process.cwd();
|
|
229
|
-
const decisionsPath = path.join(rootDir, WISDOM_DIR, "decisions");
|
|
230
|
-
fs.mkdirSync(decisionsPath, { recursive: true });
|
|
231
|
-
const decision = {
|
|
232
|
-
id: options.id,
|
|
233
|
-
title: options.title,
|
|
234
|
-
status: options.status || "proposed",
|
|
235
|
-
date: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
236
|
-
symbols: options.symbols.split(",").map((s) => s.trim()),
|
|
237
|
-
context: options.context,
|
|
238
|
-
decision: options.decision,
|
|
239
|
-
rationale: {
|
|
240
|
-
factors: [],
|
|
241
|
-
conclusion: ""
|
|
242
|
-
},
|
|
243
|
-
consequences: {
|
|
244
|
-
positive: [],
|
|
245
|
-
negative: []
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
const fileName = `${decision.id}-${slugify(decision.title)}.yaml`;
|
|
249
|
-
const filePath = path.join(decisionsPath, fileName);
|
|
250
|
-
fs.writeFileSync(filePath, yaml.dump(decision, { lineWidth: -1 }));
|
|
251
|
-
console.log(chalk.green(`Decision ${decision.id} created!`));
|
|
252
|
-
console.log(chalk.gray(` ${filePath}`));
|
|
253
|
-
console.log(chalk.gray(" Edit the file to add rationale and consequences"));
|
|
254
|
-
}
|
|
255
|
-
async function wisdomExpertCommand(query, options = {}) {
|
|
256
|
-
const rootDir = process.cwd();
|
|
257
|
-
const filePath = path.join(rootDir, WISDOM_DIR, "expertise.yaml");
|
|
258
|
-
if (!fs.existsSync(filePath)) {
|
|
259
|
-
console.log(chalk.yellow("No expertise file found."));
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
const data = loadYaml(filePath);
|
|
263
|
-
let experts = data?.experts || [];
|
|
264
|
-
if (query) {
|
|
265
|
-
experts = experts.filter(
|
|
266
|
-
(e) => e.symbols?.some((s) => s.includes(query)) || e.areas?.some((a) => a.toLowerCase().includes(query.toLowerCase()))
|
|
267
|
-
);
|
|
268
|
-
}
|
|
269
|
-
if (options.json) {
|
|
270
|
-
console.log(JSON.stringify({ experts }, null, 2));
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
if (experts.length === 0) {
|
|
274
|
-
console.log(chalk.yellow("No experts found"));
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
console.log(chalk.magenta("\n Experts\n"));
|
|
278
|
-
experts.forEach((e) => {
|
|
279
|
-
console.log(chalk.white(` ${e.name}`));
|
|
280
|
-
if (e.symbols) console.log(chalk.gray(` Symbols: ${e.symbols.join(", ")}`));
|
|
281
|
-
if (e.areas) console.log(chalk.gray(` Areas: ${e.areas.join(", ")}`));
|
|
282
|
-
if (e.contact) console.log(chalk.gray(` Contact: ${e.contact}`));
|
|
283
|
-
console.log();
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
function loadYaml(filePath) {
|
|
287
|
-
if (!fs.existsSync(filePath)) return null;
|
|
288
|
-
try {
|
|
289
|
-
const content = fs.readFileSync(filePath, "utf8");
|
|
290
|
-
return yaml.load(content);
|
|
291
|
-
} catch {
|
|
292
|
-
return null;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
function loadDecisions(wisdomPath) {
|
|
296
|
-
const decisionsPath = path.join(wisdomPath, "decisions");
|
|
297
|
-
if (!fs.existsSync(decisionsPath)) return [];
|
|
298
|
-
const decisions = [];
|
|
299
|
-
const files = fs.readdirSync(decisionsPath);
|
|
300
|
-
for (const file of files) {
|
|
301
|
-
if (!file.endsWith(".yaml") && !file.endsWith(".yml")) continue;
|
|
302
|
-
const content = fs.readFileSync(path.join(decisionsPath, file), "utf8");
|
|
303
|
-
try {
|
|
304
|
-
decisions.push(yaml.load(content));
|
|
305
|
-
} catch {
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
return decisions.sort((a, b) => a.id.localeCompare(b.id));
|
|
309
|
-
}
|
|
310
|
-
function slugify(text) {
|
|
311
|
-
return text.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
312
|
-
}
|
|
313
|
-
export {
|
|
314
|
-
wisdomAddAntipatternCommand,
|
|
315
|
-
wisdomDecideCommand,
|
|
316
|
-
wisdomExpertCommand,
|
|
317
|
-
wisdomInitCommand,
|
|
318
|
-
wisdomShowCommand
|
|
319
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
getWorkLogSummary,
|
|
4
|
-
loadWorkLogEntries,
|
|
5
|
-
loadWorkLogEntry,
|
|
6
|
-
recordWorkLog
|
|
7
|
-
} from "./chunk-TAIJOFOE.js";
|
|
8
|
-
import "./chunk-7N7GSU6K.js";
|
|
9
|
-
export {
|
|
10
|
-
getWorkLogSummary,
|
|
11
|
-
loadWorkLogEntries,
|
|
12
|
-
loadWorkLogEntry,
|
|
13
|
-
recordWorkLog
|
|
14
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
detectProjectRole,
|
|
4
|
-
workspaceInitCommand,
|
|
5
|
-
workspaceReindexCommand,
|
|
6
|
-
workspaceStatusCommand
|
|
7
|
-
} from "./chunk-ABVQGRF7.js";
|
|
8
|
-
import "./chunk-VL67H5IC.js";
|
|
9
|
-
import "./chunk-36TKPM5Z.js";
|
|
10
|
-
import "./chunk-ZGUAAVMA.js";
|
|
11
|
-
import "./chunk-EDOAWN7J.js";
|
|
12
|
-
import "./chunk-IRKUEJVW.js";
|
|
13
|
-
import "./chunk-J2JEQRT3.js";
|
|
14
|
-
import "./chunk-4NCFWYGG.js";
|
|
15
|
-
import "./chunk-PDX44BCA.js";
|
|
16
|
-
export {
|
|
17
|
-
detectProjectRole,
|
|
18
|
-
workspaceInitCommand,
|
|
19
|
-
workspaceReindexCommand,
|
|
20
|
-
workspaceStatusCommand
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as x,r as h,j as n}from"./index-F0KL9xrN.js";const j=x((e,s)=>({events:[],nominations:[],debates:[],loading:!1,eventFilter:{},fetchEvents:async t=>{e({loading:!0});try{const a=t||s().eventFilter,c=new URLSearchParams;a.type&&c.set("type",a.type),a.since&&c.set("since",a.since);const r=await fetch(`/api/ambient/events?${c}`);if(!r.ok)throw new Error(`HTTP ${r.status}`);const o=await r.json();e({events:o.events||[],loading:!1})}catch{e({loading:!1})}},fetchNominations:async()=>{try{const t=await fetch("/api/ambient/nominations?pending_only=true&include_debates=true");if(!t.ok)throw new Error(`HTTP ${t.status}`);const a=await t.json();e({nominations:a.nominations||[],debates:a.debates||[]})}catch{}},engageNomination:async(t,a)=>{try{const c=await fetch(`/api/ambient/nominations/${encodeURIComponent(t)}/engage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:a})});if(!c.ok)throw new Error(`HTTP ${c.status}`);e(r=>({nominations:r.nominations.map(o=>o.id===t?{...o,engaged:!0,response:a}:o)}))}catch{s().fetchNominations()}},setEventFilter:t=>{e({eventFilter:t}),s().fetchEvents(t)},connectSSE:()=>{const t=new EventSource("/api/ambient/stream");return t.onmessage=a=>{try{const c=JSON.parse(a.data);e(r=>({events:[c,...r.events].slice(0,200)}))}catch{}},t.onerror=()=>{},()=>t.close()}})),_={critical:0,high:1,medium:2,low:3};function f(e){try{const s=new Date(e),a=Date.now()-s.getTime();return a<6e4?"just now":a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:a<6048e5?`${Math.floor(a/864e5)}d ago`:s.toLocaleDateString()}catch{return""}}function N(e){return["file_change","tool_call","sentinel","agent"].includes(e)?`ambient__type-badge--${e}`:"ambient__type-badge--default"}function y(e){return["critical","high","medium","low"].includes(e)?`ambient__urgency-badge--${e}`:"ambient__urgency-badge--low"}function w(e){const s=Date.now()-36e5;return e.filter(t=>{try{return new Date(t.timestamp).getTime()>s}catch{return!1}}).length}function d({value:e,label:s,accent:t}){return n.jsxs("div",{className:"stat-card",style:t?{borderTopColor:t,borderTopWidth:2}:void 0,children:[n.jsx("div",{className:"stat-card__value",children:e}),n.jsx("div",{className:"stat-card__label",children:s})]})}function E(e){const s=new Set(e.map(t=>t.type));return Array.from(s).sort()}function S({event:e}){return n.jsxs("div",{className:"ambient__event-item",children:[n.jsx("span",{className:`ambient__type-badge ${N(e.type)}`,children:e.type.replace(/_/g," ")}),n.jsxs("div",{className:"ambient__event-body",children:[n.jsxs("div",{className:"ambient__event-top-row",children:[e.context&&n.jsx("span",{className:"ambient__event-context",children:e.context}),!e.context&&e.source&&n.jsx("span",{className:"ambient__event-context",children:e.source})]}),e.path&&n.jsx("span",{className:"ambient__event-path",children:e.path}),e.symbols&&e.symbols.length>0&&n.jsx("div",{className:"ambient__event-symbols",children:e.symbols.map(s=>n.jsx("span",{className:"ambient__event-symbol",children:s},s))})]}),n.jsx("span",{className:"ambient__event-time",children:f(e.timestamp)})]})}function T({nomination:e,onEngage:s}){const t=e.engaged;return n.jsxs("div",{className:"ambient__nom-item",children:[n.jsxs("div",{className:"ambient__nom-header",children:[n.jsx("span",{className:`ambient__urgency-badge ${y(e.urgency)}`,children:e.urgency}),n.jsx("span",{className:"ambient__nom-agent",children:e.agent}),n.jsx("span",{className:"ambient__nom-type",children:e.type})]}),n.jsx("div",{className:"ambient__nom-brief",children:e.brief}),!t&&n.jsxs("div",{className:"ambient__nom-actions",children:[n.jsx("button",{className:"ambient__nom-btn ambient__nom-btn--accept",onClick:()=>s(e.id,"accepted"),children:"Accept"}),n.jsx("button",{className:"ambient__nom-btn ambient__nom-btn--dismiss",onClick:()=>s(e.id,"dismissed"),children:"Dismiss"})]}),t&&n.jsx("div",{style:{fontSize:11,color:"var(--p-text-muted)",fontStyle:"italic"},children:e.response==="accepted"?"Accepted":e.response==="dismissed"?"Dismissed":"Deferred"})]})}function D({debate:e}){return n.jsxs("div",{className:"ambient__debate-item",children:[n.jsx("div",{className:"ambient__debate-topic",children:e.topic}),n.jsxs("div",{className:"ambient__debate-meta",children:[e.type," ยท ",e.nominations.length," nomination",e.nominations.length!==1?"s":""]})]})}function A(){const{events:e,nominations:s,debates:t,loading:a,eventFilter:c,fetchEvents:r,fetchNominations:o,engageNomination:b,setEventFilter:p,connectSSE:u}=j(),l=h.useRef(null);h.useEffect(()=>{r(),o();const i=u();return l.current=setInterval(()=>{o()},1e4),()=>{i(),l.current&&clearInterval(l.current)}},[]);const m=s.filter(i=>!i.engaged).sort((i,g)=>(_[i.urgency]??99)-(_[g.urgency]??99)),v=E(e);return a&&e.length===0?n.jsxs("div",{className:"ambient",children:[n.jsx("h1",{className:"ambient__title",children:"Ambient"}),n.jsx("p",{style:{color:"var(--p-text-muted)"},children:"Loading..."})]}):n.jsxs("div",{className:"ambient",children:[n.jsx("h1",{className:"ambient__title",children:"Ambient"}),n.jsxs("div",{className:"ambient__cards",children:[n.jsx(d,{value:w(e),label:"Events (last hour)",accent:"var(--p-accent-blue)"}),n.jsx(d,{value:m.length,label:"Pending Nominations",accent:"var(--p-accent-orange)"}),n.jsx(d,{value:t.length,label:"Active Debates",accent:"var(--p-accent-purple)"})]}),n.jsxs("div",{className:"ambient__grid",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"ambient__section-header",children:[n.jsx("span",{className:"ambient__section-header-title",children:"Event Stream"}),n.jsxs("select",{className:"ambient__filter-select",value:c.type||"",onChange:i=>p({...c,type:i.target.value||void 0}),children:[n.jsx("option",{value:"",children:"All types"}),v.map(i=>n.jsx("option",{value:i,children:i.replace(/_/g," ")},i))]})]}),n.jsxs("div",{className:"ambient__events",children:[e.length===0&&n.jsx("div",{className:"ambient__events-empty",children:"No events recorded yet"}),e.map(i=>n.jsx(S,{event:i},i.id))]})]}),n.jsxs("div",{children:[n.jsx("div",{className:"ambient__section-title",children:"Nominations"}),n.jsxs("div",{className:"ambient__nominations",children:[m.length===0&&n.jsx("div",{className:"ambient__nominations-empty",children:"No pending nominations"}),m.map(i=>n.jsx(T,{nomination:i,onEngage:b},i.id))]}),t.length>0&&n.jsxs("div",{className:"ambient__debates",children:[n.jsx("div",{className:"ambient__section-title",children:"Debates"}),t.map(i=>n.jsx(D,{debate:i},i.id))]})]})]})]})}export{A as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:root{--bg-primary: #0a0a0f;--bg-secondary: #111118;--bg-card: #16161e;--bg-hover: #1e1e2a;--bg-panel: #12121a;--text-primary: #e2e8f0;--text-secondary: #94a3b8;--text-muted: #64748b;--border: #1e293b;--border-hover: #334155;--color-component: #7dd3fc;--color-gate: #86efac;--color-flow: #fbbf24;--color-signal: #fde047;--color-aspect: #a78bfa;--color-agent-session: #818cf8;--color-human-note: #34d399;--color-decision: #fbbf24;--color-review: #c084fc;--color-incident: #f87171;--color-milestone: #60a5fa;--spine-color: #1e293b;--spine-width: 2px}[data-theme=light]{--bg-primary: #f8f9fa;--bg-secondary: #ffffff;--bg-card: #ffffff;--bg-hover: #f1f3f5;--bg-panel: #ffffff;--text-primary: #1a1a2e;--text-secondary: #495057;--text-muted: #868e96;--border: #dee2e6;--border-hover: #adb5bd;--color-component: #0c8599;--color-gate: #2b8a3e;--color-flow: #e67700;--color-signal: #c2255c;--color-aspect: #6741d9;--color-agent-session: #5c7cfa;--color-human-note: #20c997;--color-decision: #e67700;--color-review: #9775fa;--color-incident: #fa5252;--color-milestone: #339af0;--spine-color: #dee2e6}*{margin:0;padding:0;box-sizing:border-box}body{background:var(--bg-primary);color:var(--text-primary);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Inter,sans-serif;font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased}#root{min-height:100vh;display:flex;flex-direction:column}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:var(--bg-primary)}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--border-hover)}.header{position:sticky;top:0;z-index:100;background:var(--bg-secondary);border-bottom:1px solid var(--border);padding:12px 24px}.header-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.header-title{display:flex;align-items:center;gap:12px}.header-title h1{font-size:18px;font-weight:600;letter-spacing:-.01em}.header-title .project-name{color:var(--text-secondary);font-size:13px}.header-stats{color:var(--text-muted);font-size:12px}.view-switcher-row{display:flex;align-items:center;gap:8px}.view-switcher{display:flex;gap:2px;background:var(--bg-primary);border-radius:6px;padding:2px}.theme-toggle{width:32px;height:32px;border:1px solid var(--border);background:var(--bg-primary);border-radius:6px;cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center;transition:all .15s}.theme-toggle:hover{border-color:var(--border-hover);background:var(--bg-hover)}.view-tab{padding:6px 16px;border:none;background:none;color:var(--text-secondary);font-size:13px;cursor:pointer;border-radius:4px;transition:all .15s}.view-tab:hover{color:var(--text-primary);background:var(--bg-hover)}.view-tab.active{color:var(--text-primary);background:var(--bg-card)}.filter-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.filter-bar select,.filter-bar input{background:var(--bg-primary);border:1px solid var(--border);color:var(--text-primary);padding:5px 10px;border-radius:4px;font-size:12px;outline:none}.filter-bar select:focus,.filter-bar input:focus{border-color:var(--color-component)}.filter-preset{padding:4px 10px;border:1px solid var(--border);background:none;color:var(--text-secondary);border-radius:12px;font-size:11px;cursor:pointer;transition:all .15s}.filter-preset:hover{border-color:var(--border-hover);color:var(--text-primary)}.filter-preset.active{background:var(--bg-card);color:var(--text-primary);border-color:var(--color-component)}.filter-clear{padding:4px 10px;border:none;background:none;color:var(--text-muted);font-size:11px;cursor:pointer}.filter-clear:hover{color:var(--color-incident)}.thread-view{position:relative;max-width:900px;margin:0 auto;padding:24px 16px}.thread-view.single-column{max-width:600px}.timeline-spine{position:absolute;left:50%;top:0;bottom:0;width:var(--spine-width);background:var(--spine-color);transform:translate(-50%)}.timeline-column-labels{position:sticky;top:90px;z-index:10;display:flex;justify-content:space-between;align-items:center;padding:0 4px;margin-bottom:8px}.column-label-group{display:flex;align-items:center;gap:4px}.column-label-group.left,.column-label-group.right{max-width:48%}.column-label-text{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.1em;color:var(--text-muted);padding:3px 10px;border-radius:3px;background:var(--bg-secondary);white-space:nowrap}.column-author-selector{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.column-author-pill{padding:3px 10px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-secondary);border-radius:12px;font-size:11px;cursor:pointer;transition:all .15s}.column-author-pill:hover{border-color:var(--border-hover);color:var(--text-primary)}.column-author-pill.active{background:#818cf826;border-color:var(--color-agent-session);color:var(--color-agent-session)}.date-separator{position:relative;z-index:3;display:flex;align-items:center;justify-content:center;margin:24px 0 16px;gap:8px}.date-badge{background:var(--bg-secondary);color:var(--text-secondary);font-size:11px;font-weight:600;padding:4px 14px;border-radius:12px;border:1px solid var(--border);letter-spacing:.02em;white-space:nowrap}.date-count{font-size:10px;font-weight:500;padding:2px 6px;border-radius:8px;min-width:20px;text-align:center}.date-count.human{color:var(--color-human-note);background:#34d3991a}.date-count.agent{color:var(--color-agent-session);background:#818cf81a}.lore-card-row{display:flex;align-items:flex-start;margin-bottom:16px;position:relative}.lore-card-row.left{justify-content:flex-start;padding-right:52%}.lore-card-row.right{justify-content:flex-end;padding-left:52%}.single-column .lore-card-row.right{justify-content:flex-start;padding-left:0}.lore-card-row:before{content:"";position:absolute;left:50%;top:16px;width:8px;height:8px;border-radius:50%;background:var(--spine-color);border:2px solid var(--bg-primary);transform:translate(-50%);z-index:2}.single-column .lore-card-row:before{display:none}.lore-card-row.human:before{background:var(--color-human-note)}.lore-card-row.agent:before{background:var(--color-agent-session)}.lore-card-row.left:after,.lore-card-row.right:after{content:"";position:absolute;top:19px;height:1px}.single-column .lore-card-row:after{display:none}.lore-card-row.left:after{left:calc(48% + 8px);right:50%;background:var(--color-human-note);opacity:.4}.lore-card-row.left.agent:after{background:var(--color-agent-session)}.lore-card-row.right:after{left:50%;right:calc(48% + 8px);background:var(--color-agent-session);opacity:.4}.lore-card-row.right.human:after{background:var(--color-human-note)}.lore-card{background:var(--bg-card);border:1px solid var(--border);border-radius:8px;padding:12px 16px;cursor:pointer;transition:all .15s;width:100%}.lore-card:hover{border-color:var(--border-hover);background:var(--bg-hover)}.lore-card-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}.lore-card-author{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--text-secondary)}.author-badge{display:inline-flex;align-items:center;gap:4px;padding:1px 6px;border-radius:4px;font-size:11px;font-weight:500}.author-badge.human{background:#34d3991a;color:var(--color-human-note)}[data-theme=light] .author-badge.human{background:#20c9971f}.author-badge.agent{background:#818cf81a;color:var(--color-agent-session)}[data-theme=light] .author-badge.agent{background:#5c7cfa1f}.lore-card-type{font-size:10px;text-transform:uppercase;letter-spacing:.05em;padding:2px 6px;border-radius:3px}.lore-card-type.agent-session{background:#818cf826;color:var(--color-agent-session)}.lore-card-type.human-note{background:#34d39926;color:var(--color-human-note)}.lore-card-type.decision{background:#fbbf2426;color:var(--color-decision)}.lore-card-type.review{background:#c084fc26;color:var(--color-review)}.lore-card-type.incident{background:#f8717126;color:var(--color-incident)}.lore-card-type.milestone{background:#60a5fa26;color:var(--color-milestone)}.lore-card-title{font-size:14px;font-weight:500;margin-bottom:4px;color:var(--text-primary)}.lore-card-summary{font-size:12px;color:var(--text-secondary);margin-bottom:8px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.lore-card-symbols{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:6px}.lore-card-footer{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:var(--text-muted)}.lore-card-stats{display:flex;gap:8px}.lore-card-verify{display:inline-flex;align-items:center;gap:3px}.lore-card-verify.pass{color:#34d399}.lore-card-verify.fail{color:#f87171}.lore-card-verify.partial{color:#fbbf24}.review-stars{color:#fbbf24;letter-spacing:1px}.symbol-tag{display:inline-flex;align-items:center;padding:1px 6px;border-radius:3px;font-size:11px;font-family:SF Mono,Fira Code,monospace}.symbol-tag.component{background:#7dd3fc1f;color:var(--color-component)}.symbol-tag.gate{background:#86efac1f;color:var(--color-gate)}.symbol-tag.flow{background:#fbbf241f;color:var(--color-flow)}.symbol-tag.signal{background:#fde0471f;color:var(--color-signal)}.symbol-tag.aspect{background:#a78bfa1f;color:var(--color-aspect)}.detail-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:200;display:flex;justify-content:flex-end}.detail-backdrop{position:absolute;top:0;right:0;bottom:0;left:0;background:#0006}[data-theme=light] .detail-backdrop{background:#0003}.detail-panel{position:relative;width:520px;max-width:90vw;background:var(--bg-panel);border-left:1px solid var(--border);overflow-y:auto;animation:slideIn .2s ease-out}@keyframes slideIn{0%{transform:translate(100%)}to{transform:translate(0)}}.detail-header{position:sticky;top:0;background:var(--bg-panel);border-bottom:1px solid var(--border);padding:16px 20px;display:flex;align-items:flex-start;justify-content:space-between;z-index:1}.detail-close{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:18px;padding:4px}.detail-close:hover{color:var(--text-primary)}.detail-body{padding:20px}.detail-section{margin-bottom:20px}.detail-section h3{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);margin-bottom:8px}.detail-meta{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;font-size:13px}.detail-meta dt{color:var(--text-muted)}.detail-meta dd{color:var(--text-primary)}.detail-files{font-size:12px;font-family:SF Mono,Fira Code,monospace}.detail-files li{list-style:none;padding:2px 0;color:var(--text-secondary)}.detail-decision{border-left:2px solid var(--color-decision);padding-left:12px;margin-bottom:8px}.detail-decision .decision-text{font-size:13px;color:var(--text-primary)}.detail-decision .decision-rationale{font-size:12px;color:var(--text-secondary);margin-top:2px}.detail-error{border-left:2px solid var(--color-incident);padding-left:12px;margin-bottom:8px}.detail-learning{padding-left:12px;margin-bottom:4px;font-size:13px;color:var(--text-secondary)}.detail-learning:before{content:"โข";color:var(--color-component);margin-right:8px}.sidebar-view{display:flex;height:calc(100vh - 100px)}.sidebar{width:260px;border-right:1px solid var(--border);overflow-y:auto;flex-shrink:0}.sidebar-item{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;cursor:pointer;border-bottom:1px solid var(--border);transition:background .1s}.sidebar-item:hover{background:var(--bg-hover)}.sidebar-item.active{background:var(--bg-card);border-left:2px solid var(--color-component)}.sidebar-item-name{font-size:13px;font-family:SF Mono,Fira Code,monospace}.sidebar-item-count{font-size:11px;color:var(--text-muted);background:var(--bg-primary);padding:1px 6px;border-radius:8px}.sidebar-content{flex:1;overflow-y:auto;padding:16px}.status-bar{position:fixed;bottom:0;left:0;right:0;background:var(--bg-secondary);border-top:1px solid var(--border);padding:4px 24px;font-size:11px;color:var(--text-muted);display:flex;justify-content:space-between;z-index:50}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:80px 20px;color:var(--text-muted);text-align:center}.empty-state h2{font-size:16px;color:var(--text-secondary);margin-bottom:8px}.empty-state p{font-size:13px;max-width:400px}.empty-state code{background:var(--bg-card);padding:2px 6px;border-radius:3px;font-size:12px}.author-type-toggle{display:flex;gap:2px;background:var(--bg-primary);border-radius:6px;padding:2px}.author-type-pill{padding:4px 10px;border:none;background:none;color:var(--text-secondary);font-size:11px;cursor:pointer;border-radius:4px;transition:all .15s}.author-type-pill:hover{color:var(--text-primary);background:var(--bg-hover)}.author-type-pill.active{color:var(--text-primary);background:var(--bg-card)}.author-type-pill.active.human{color:var(--color-human-note)}.author-type-pill.active.agent{color:var(--color-agent-session)}.symbol-autocomplete-wrapper{position:relative}.symbol-clear{position:absolute;right:6px;top:50%;transform:translateY(-50%);background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:11px;padding:2px 4px}.symbol-clear:hover{color:var(--color-incident)}.symbol-dropdown{position:absolute;top:100%;left:0;right:0;background:var(--bg-card);border:1px solid var(--border);border-radius:4px;max-height:200px;overflow-y:auto;z-index:100;margin-top:2px}.symbol-dropdown-item{display:flex;align-items:center;justify-content:space-between;padding:6px 10px;cursor:pointer;font-size:12px;transition:background .1s}.symbol-dropdown-item:hover,.symbol-dropdown-item.active{background:var(--bg-hover)}.symbol-dropdown-name{font-family:SF Mono,Fira Code,monospace;color:var(--color-component)}.symbol-dropdown-count{font-size:10px;color:var(--text-muted);background:var(--bg-primary);padding:1px 5px;border-radius:6px}.session-date-header{padding:6px 16px;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted);background:var(--bg-primary);border-bottom:1px solid var(--border)}.session-sidebar-item{flex-direction:column;align-items:flex-start;gap:4px}.session-sidebar-info{display:flex;align-items:center;justify-content:space-between;width:100%}.session-author-badge{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:500}.session-author-badge.human{color:var(--color-human-note)}.session-author-badge.agent{color:var(--color-agent-session)}.session-sidebar-meta{font-size:10px;color:var(--text-muted)}.session-sidebar-stats{display:flex;gap:6px}.session-detail{max-width:700px}.session-detail-header{margin-bottom:20px}.session-detail-header h2{font-size:16px;margin-bottom:8px}.session-detail-meta{display:flex;flex-wrap:wrap;gap:12px;font-size:12px;color:var(--text-secondary)}.session-detail-section{margin-bottom:20px}.session-detail-section h3{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);margin-bottom:8px}.session-symbols{display:flex;flex-wrap:wrap;gap:4px}.breadcrumb-list{display:flex;flex-direction:column;gap:8px}.breadcrumb-item{display:flex;align-items:flex-start;gap:8px;padding:8px 12px;background:var(--bg-card);border-radius:6px;border-left:2px solid var(--color-flow);font-size:12px}.breadcrumb-phase{font-weight:600;color:var(--color-flow);text-transform:uppercase;font-size:10px;letter-spacing:.05em;padding:1px 6px;background:#fbbf241a;border-radius:3px;flex-shrink:0}.breadcrumb-context{color:var(--text-secondary);flex:1}.breadcrumb-time{color:var(--text-muted);font-size:10px;flex-shrink:0}.breadcrumb-decisions{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}.breadcrumb-decision{font-size:10px;color:var(--text-muted);padding:1px 6px;background:var(--bg-primary);border-radius:3px}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as A,j as e,r as p,R as y}from"./index-F0KL9xrN.js";function k(){try{const t=localStorage.getItem("paradigm-lore-theme");if(t==="light"||t==="dark")return t}catch{}return"dark"}function T(){try{const t=localStorage.getItem("paradigm-lore-left-authors");if(t)return JSON.parse(t)}catch{}return[]}const c=A((t,r)=>({entries:[],filter:{},view:"timeline",selectedEntryId:null,symbols:[],authors:[],selectedSymbol:null,selectedAuthor:null,sessions:[],selectedSessionId:null,loading:!1,projectName:"",theme:k(),leftAuthors:T(),setView:s=>t({view:s}),setFilter:s=>{t(n=>({filter:{...n.filter,...s}})),r().fetchEntries()},clearFilters:()=>{t({filter:{}}),r().fetchEntries()},selectEntry:s=>t({selectedEntryId:s}),selectSymbol:s=>t({selectedSymbol:s}),selectAuthor:s=>t({selectedAuthor:s}),toggleTheme:()=>{const s=r().theme==="dark"?"light":"dark";document.documentElement.setAttribute("data-theme",s);try{localStorage.setItem("paradigm-lore-theme",s)}catch{}t({theme:s})},toggleLeftAuthor:s=>{const n=r().leftAuthors,a=n.includes(s)?n.filter(i=>i!==s):[...n,s];try{localStorage.setItem("paradigm-lore-left-authors",JSON.stringify(a))}catch{}t({leftAuthors:a})},selectSession:async s=>{if(t({selectedSessionId:s}),s)try{const a=await(await fetch(`/api/sessions/${encodeURIComponent(s)}`)).json();t(i=>({sessions:i.sessions.map(x=>x.id===s?{...x,entries:a.entries}:x)}))}catch{}},fetchEntries:async()=>{var s;t({loading:!0});try{const n=r().filter,a=new URLSearchParams;n.author&&a.set("author",n.author),n.hasAgent!==void 0?a.set("hasAgent",String(n.hasAgent)):n.authorType&&a.set("authorType",n.authorType),n.symbol&&a.set("symbol",n.symbol),n.type&&a.set("type",n.type),n.dateFrom&&a.set("from",n.dateFrom),n.dateTo&&a.set("to",n.dateTo),n.tag&&a.set("tag",n.tag),(s=n.tags)!=null&&s.length&&a.set("tags",n.tags.join(",")),n.hasReview!==void 0&&a.set("hasReview",String(n.hasReview)),n.hasBody!==void 0&&a.set("hasBody",String(n.hasBody)),a.set("limit","200");let d=(await(await fetch(`/api/lore?${a}`)).json()).entries||[];if(n.search){const h=n.search.toLowerCase();d=d.filter(u=>{var m;return u.title.toLowerCase().includes(h)||u.summary.toLowerCase().includes(h)||((m=u.symbols_touched)==null?void 0:m.some(j=>j.toLowerCase().includes(h)))})}t({entries:d,loading:!1})}catch{t({loading:!1})}},fetchSymbols:async()=>{try{const n=await(await fetch("/api/lore/symbols")).json();t({symbols:n.symbols||[]})}catch{}},fetchAuthors:async()=>{try{const n=await(await fetch("/api/lore/authors")).json();t({authors:n.authors||[]})}catch{}},fetchSessions:async()=>{try{const n=await(await fetch("/api/sessions")).json();t({sessions:n.sessions||[]})}catch{}},fetchAll:async()=>{try{const n=await(await fetch("/api/info")).json();t({projectName:n.project||""})}catch{}await Promise.all([r().fetchEntries(),r().fetchSymbols(),r().fetchAuthors(),r().fetchSessions()])}})),C=[{mode:"timeline",label:"Timeline"},{mode:"session",label:"Sessions"},{mode:"symbol",label:"Symbol"},{mode:"author",label:"Author"}];function F(){const t=c(a=>a.view),r=c(a=>a.setView),s=c(a=>a.theme),n=c(a=>a.toggleTheme);return e.jsxs("div",{className:"view-switcher-row",children:[e.jsx("div",{className:"view-switcher",children:C.map(a=>e.jsx("button",{className:`view-tab ${t===a.mode?"active":""}`,onClick:()=>r(a.mode),children:a.label},a.mode))}),e.jsx("button",{className:"theme-toggle",onClick:n,title:s==="dark"?"Switch to light mode":"Switch to dark mode",children:s==="dark"?"โ๏ธ":"๐"})]})}const L=["","agent-session","human-note","decision","review","incident","milestone","retro","insight"],R=[{value:void 0,label:"All"},{value:!1,label:"Human Only"},{value:!0,label:"AI-Assisted"}];function E(){const t=c(l=>l.filter),r=c(l=>l.setFilter),s=c(l=>l.clearFilters),n=c(l=>l.authors),a=c(l=>l.symbols),[i,x]=p.useState(""),[d,h]=p.useState(!1),u=p.useRef(null),m=p.useRef(null),[j,v]=p.useState([]),b=Object.values(t).some(l=>l!==void 0&&l!==""&&(Array.isArray(l)?l.length>0:!0)),o=i?a.filter(l=>l.symbol.toLowerCase().includes(i.toLowerCase())).slice(0,10):a.slice(0,10);return p.useEffect(()=>{fetch("/api/lore/tags").then(l=>l.json()).then(l=>v(l.tags||[])).catch(()=>{})},[]),p.useEffect(()=>{function l(S){m.current&&!m.current.contains(S.target)&&u.current&&!u.current.contains(S.target)&&h(!1)}return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[]),e.jsxs("div",{className:"filter-bar",children:[e.jsx("div",{className:"author-type-toggle",children:R.map(l=>e.jsx("button",{className:`author-type-pill ${t.hasAgent===l.value?"active":""} ${l.value===void 0?"all":l.value?"agent":"human"}`,onClick:()=>r({hasAgent:l.value}),children:l.label},l.label))}),e.jsxs("select",{value:t.author||"",onChange:l=>r({author:l.target.value||void 0}),children:[e.jsx("option",{value:"",children:"All authors"}),n.map(l=>e.jsxs("option",{value:l.id,children:[l.hasAgent?"๐ค":"๐ค"," ",l.id]},l.id))]}),e.jsxs("select",{value:t.type||"",onChange:l=>r({type:l.target.value||void 0}),children:[e.jsx("option",{value:"",children:"All types"}),L.filter(Boolean).map(l=>e.jsx("option",{value:l,children:l},l))]}),j.length>0&&e.jsxs("select",{value:t.tag||"",onChange:l=>r({tag:l.target.value||void 0}),children:[e.jsx("option",{value:"",children:"All tags"}),j.map(l=>e.jsxs("option",{value:l.tag,children:[l.tag," (",l.count,")"]},l.tag))]}),e.jsxs("div",{className:"symbol-autocomplete-wrapper",children:[e.jsx("input",{ref:u,type:"text",placeholder:t.symbol?`Symbol: ${t.symbol}`:"Filter by symbol...",value:i,onChange:l=>{x(l.target.value),h(!0)},onFocus:()=>h(!0),style:{width:160}}),t.symbol&&e.jsx("button",{className:"symbol-clear",onClick:()=>{r({symbol:void 0}),x("")},children:"x"}),d&&o.length>0&&e.jsx("div",{className:"symbol-dropdown",ref:m,children:o.map(l=>e.jsxs("div",{className:`symbol-dropdown-item ${t.symbol===l.symbol?"active":""}`,onClick:()=>{r({symbol:l.symbol}),x(""),h(!1)},children:[e.jsx("span",{className:"symbol-dropdown-name",children:l.symbol}),e.jsx("span",{className:"symbol-dropdown-count",children:l.count})]},l.symbol))})]}),e.jsx("input",{type:"text",placeholder:"Search...",value:t.search||"",onChange:l=>r({search:l.target.value||void 0}),style:{width:140}}),e.jsx("input",{type:"date",value:t.dateFrom||"",onChange:l=>r({dateFrom:l.target.value||void 0}),title:"From date"}),e.jsx("input",{type:"date",value:t.dateTo||"",onChange:l=>r({dateTo:l.target.value||void 0}),title:"To date"}),e.jsx("button",{className:`filter-preset ${t.hasReview===!1?"active":""}`,onClick:()=>r({hasReview:t.hasReview===!1?void 0:!1}),children:"Needs Review"}),b&&e.jsx("button",{className:"filter-clear",onClick:s,children:"Clear filters"})]})}const $={"#":"component","^":"gate",$:"flow","!":"signal","~":"aspect"};function g({symbol:t}){const r=t.charAt(0),s=$[r]||"component";return e.jsx("span",{className:`symbol-tag ${s}`,children:t})}function _({status:t}){if(!t)return null;const r={pass:{icon:"โ",className:"pass"},fail:{icon:"โ",className:"fail"},partial:{icon:"โ ",className:"partial"},untested:{icon:"ยท",className:""}},s=r[t]||r.untested;return e.jsxs("span",{className:`lore-card-verify ${s.className}`,children:[s.icon," ",t]})}function w({rating:t}){return e.jsxs("span",{className:"review-stars",children:["โ
".repeat(t),"โ".repeat(5-t)]})}function z(){var a,i,x,d,h,u,m,j,v,b;const t=c(o=>o.selectedEntryId),r=c(o=>o.selectEntry),[s,n]=p.useState(null);return p.useEffect(()=>{if(!t){n(null);return}fetch(`/api/lore/${t}`).then(o=>o.json()).then(n).catch(()=>n(null))},[t]),!t||!s?null:e.jsxs("div",{className:"detail-overlay",children:[e.jsx("div",{className:"detail-backdrop",onClick:()=>r(null)}),e.jsxs("div",{className:"detail-panel",children:[e.jsxs("div",{className:"detail-header",children:[e.jsxs("div",{children:[e.jsx("div",{className:"lore-card-title",style:{fontSize:16},children:s.title}),e.jsxs("div",{style:{display:"flex",gap:8,marginTop:4,alignItems:"center"},children:[e.jsx("span",{className:`lore-card-type ${s.type}`,children:s.type}),e.jsx("span",{style:{color:"var(--text-muted)",fontSize:12},children:s.id})]})]}),e.jsx("button",{className:"detail-close",onClick:()=>r(null),children:"โ"})]}),e.jsxs("div",{className:"detail-body",children:[e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Details"}),e.jsxs("dl",{className:"detail-meta",children:[e.jsx("dt",{children:"Author"}),e.jsxs("dd",{children:["๐ค"," ",typeof s.author=="string"?s.author:"unknown"]}),s.agent&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"AI Agent"}),e.jsxs("dd",{children:["๐ค"," ",s.agent.model,s.agent.provider?` (${s.agent.provider})`:""]})]}),e.jsx("dt",{children:"Time"}),e.jsx("dd",{children:new Date(s.timestamp).toLocaleString()}),s.duration_minutes&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Duration"}),e.jsxs("dd",{children:[s.duration_minutes," minutes"]})]}),s.commit&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Commit"}),e.jsx("dd",{style:{fontFamily:"monospace",fontSize:12},children:s.commit})]})]})]}),e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Summary"}),e.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)"},children:s.summary})]}),s.body&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Body"}),e.jsx("pre",{style:{fontSize:12,color:"var(--text-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-word",background:"var(--bg-primary)",padding:12,borderRadius:6,border:"1px solid var(--border)",maxHeight:300,overflowY:"auto"},children:s.body})]}),(a=s.linked_lore)!=null&&a.length||(i=s.linked_tasks)!=null&&i.length||(x=s.linked_commits)!=null&&x.length?e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Linked"}),e.jsxs("dl",{className:"detail-meta",children:[s.linked_lore&&s.linked_lore.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Lore"}),e.jsx("dd",{children:s.linked_lore.map(o=>e.jsx("span",{onClick:()=>r(o),style:{cursor:"pointer",color:"var(--color-component)",textDecoration:"underline",marginRight:8,fontSize:12},children:o},o))})]}),s.linked_tasks&&s.linked_tasks.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Tasks"}),e.jsx("dd",{children:s.linked_tasks.map(o=>e.jsx("span",{style:{fontFamily:"monospace",fontSize:12,marginRight:8},children:o},o))})]}),s.linked_commits&&s.linked_commits.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Commits"}),e.jsx("dd",{children:s.linked_commits.map(o=>e.jsx("span",{style:{fontFamily:"monospace",fontSize:12,marginRight:8},children:o.slice(0,8)},o))})]})]})]}):null,((d=s.symbols_touched)==null?void 0:d.length)>0&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Symbols Touched"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:s.symbols_touched.map(o=>e.jsx(g,{symbol:o},o))})]}),s.symbols_created&&s.symbols_created.length>0&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Symbols Created"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:s.symbols_created.map(o=>e.jsx(g,{symbol:o},o))})]}),(h=s.files_created)!=null&&h.length||(u=s.files_modified)!=null&&u.length?e.jsxs("div",{className:"detail-section",children:[e.jsxs("h3",{children:["Files (",(((m=s.files_created)==null?void 0:m.length)||0)+(((j=s.files_modified)==null?void 0:j.length)||0),")"]}),e.jsxs("ul",{className:"detail-files",children:[(v=s.files_created)==null?void 0:v.map(o=>e.jsxs("li",{style:{color:"#34d399"},children:["+ ",o]},o)),(b=s.files_modified)==null?void 0:b.map(o=>e.jsxs("li",{style:{color:"#fbbf24"},children:["~ ",o]},o))]}),s.lines_added||s.lines_removed?e.jsxs("p",{style:{fontSize:12,color:"var(--text-muted)",marginTop:4},children:[e.jsxs("span",{style:{color:"#34d399"},children:["+",s.lines_added||0]})," ",e.jsxs("span",{style:{color:"#f87171"},children:["-",s.lines_removed||0]})," lines"]}):null]}):null,s.decisions&&s.decisions.length>0&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Decisions"}),s.decisions.map(o=>e.jsxs("div",{className:"detail-decision",children:[e.jsx("div",{className:"decision-text",children:o.decision}),e.jsx("div",{className:"decision-rationale",children:o.rationale})]},o.id))]}),s.errors_encountered&&s.errors_encountered.length>0&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Errors Encountered"}),s.errors_encountered.map((o,l)=>e.jsxs("div",{className:"detail-error",children:[e.jsx("div",{style:{color:"var(--color-incident)",fontSize:13},children:o.description}),e.jsxs("div",{style:{color:"var(--text-secondary)",fontSize:12,marginTop:2},children:["โ"," ",o.resolution,o.time_to_fix?` (${o.time_to_fix})`:""]})]},l))]}),s.learnings&&s.learnings.length>0&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Learnings"}),s.learnings.map((o,l)=>e.jsx("div",{className:"detail-learning",children:o},l))]}),s.verification&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Verification"}),e.jsx(_,{status:s.verification.status}),s.verification.details&&e.jsx("dl",{className:"detail-meta",style:{marginTop:8},children:Object.entries(s.verification.details).map(([o,l])=>e.jsxs(y.Fragment,{children:[e.jsx("dt",{children:o}),e.jsx("dd",{style:{color:l==="pass"?"#34d399":"#f87171"},children:l})]},o))})]}),(s.confidence!=null||s.assessment)&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Confidence & Assessment"}),e.jsxs("dl",{className:"detail-meta",children:[s.confidence!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Confidence"}),e.jsx("dd",{children:e.jsxs("span",{style:{padding:"2px 8px",background:"rgba(139, 92, 246, 0.15)",border:"1px solid rgba(139, 92, 246, 0.3)",borderRadius:10,fontSize:12,color:"#8b5cf6"},children:[(s.confidence*100).toFixed(0),"%"]})})]}),s.assessment&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Verdict"}),e.jsx("dd",{children:e.jsx("span",{style:{padding:"2px 8px",background:s.assessment.verdict==="correct"?"rgba(52, 211, 153, 0.15)":s.assessment.verdict==="partial"?"rgba(251, 191, 36, 0.15)":"rgba(248, 113, 113, 0.15)",border:`1px solid ${s.assessment.verdict==="correct"?"rgba(52, 211, 153, 0.3)":s.assessment.verdict==="partial"?"rgba(251, 191, 36, 0.3)":"rgba(248, 113, 113, 0.3)"}`,borderRadius:10,fontSize:12,color:s.assessment.verdict==="correct"?"#34d399":s.assessment.verdict==="partial"?"#fbbf24":"#f87171"},children:s.assessment.verdict})}),e.jsx("dt",{children:"Assessed by"}),e.jsx("dd",{children:s.assessment.assessed_by}),e.jsx("dt",{children:"Assessed at"}),e.jsx("dd",{children:new Date(s.assessment.assessed_at).toLocaleString()}),s.assessment.notes&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Notes"}),e.jsx("dd",{children:s.assessment.notes})]})]}),s.assessment_delta!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Delta"}),e.jsxs("dd",{style:{color:Math.abs(s.assessment_delta)<=.1?"#34d399":Math.abs(s.assessment_delta)<=.3?"#fbbf24":"#f87171"},children:[s.assessment_delta>0?"+":"",s.assessment_delta.toFixed(2)," ",e.jsxs("span",{style:{fontSize:11,color:"var(--text-muted)"},children:["(",s.assessment_delta>.1?"under-confident":s.assessment_delta<-.1?"over-confident":"well-calibrated",")"]})]})]})]})]}),s.review?e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Review"}),e.jsxs("dl",{className:"detail-meta",children:[e.jsx("dt",{children:"Reviewer"}),e.jsx("dd",{children:s.review.reviewer}),e.jsx("dt",{children:"Completeness"}),e.jsx("dd",{children:e.jsx(w,{rating:s.review.completeness})}),e.jsx("dt",{children:"Quality"}),e.jsx("dd",{children:e.jsx(w,{rating:s.review.quality})}),s.review.notes&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Notes"}),e.jsx("dd",{children:s.review.notes})]})]})]}):e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Review"}),e.jsxs("p",{style:{color:"var(--text-muted)",fontSize:13},children:["No review yet. Run ",e.jsxs("code",{style:{background:"var(--bg-card)",padding:"2px 4px",borderRadius:3},children:["paradigm lore review ",s.id]})]})]}),s.git_context&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Git Context"}),e.jsxs("dl",{className:"detail-meta",children:[e.jsx("dt",{children:"Commit"}),e.jsx("dd",{style:{fontFamily:"monospace",fontSize:12},children:s.git_context.ref.slice(0,8)}),e.jsx("dt",{children:"Branch"}),e.jsx("dd",{children:s.git_context.branch}),e.jsx("dt",{children:"Working tree"}),e.jsx("dd",{children:s.git_context.dirty?"Dirty (uncommitted changes)":"Clean"})]})]}),s.meta&&Object.keys(s.meta).length>0&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Metadata"}),e.jsx("dl",{className:"detail-meta",children:Object.entries(s.meta).map(([o,l])=>e.jsxs(y.Fragment,{children:[e.jsx("dt",{children:o}),e.jsx("dd",{children:typeof l=="object"?JSON.stringify(l):String(l)})]},o))})]}),s.tags&&s.tags.length>0&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Tags"}),e.jsx("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:s.tags.map(o=>{const l=o.startsWith("arc:");return e.jsxs("span",{style:{padding:"2px 8px",background:l?"var(--color-flow-bg, rgba(96, 165, 250, 0.15))":"var(--bg-primary)",border:`1px solid ${l?"var(--color-flow, #60a5fa)":"var(--border)"}`,borderRadius:12,fontSize:11,color:l?"var(--color-flow, #60a5fa)":"var(--text-secondary)"},children:[l?"โป ":"",o]},o)})})]})]})]})]})}function D(t){return new Date(t).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})}function N({entry:t,side:r="right"}){var x,d,h,u;const s=c(m=>m.selectEntry),n=t.agent!=null,a=(((x=t.files_created)==null?void 0:x.length)||0)+(((d=t.files_modified)==null?void 0:d.length)||0),i=(t.lines_added||0)+(t.lines_removed||0);return e.jsx("div",{className:`lore-card-row ${r} ${n?"agent":"human"}`,children:e.jsxs("div",{className:"lore-card",onClick:()=>s(t.id),children:[e.jsxs("div",{className:"lore-card-header",children:[e.jsx("div",{className:"lore-card-author",children:e.jsxs("span",{className:`author-badge ${n?"agent":"human"}`,children:[n?"๐ค":"๐ค"," ",typeof t.author=="string"?t.author:"unknown"]})}),e.jsx("span",{className:`lore-card-type ${t.type||"agent-session"}`,children:t.type||"agent-session"})]}),e.jsx("div",{className:"lore-card-title",children:t.title}),e.jsx("div",{className:"lore-card-summary",children:t.summary}),t.body&&e.jsxs("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:4,fontStyle:"italic",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t.body.slice(0,100),t.body.length>100?"...":""]}),((h=t.symbols_touched)==null?void 0:h.length)>0&&e.jsxs("div",{className:"lore-card-symbols",children:[t.symbols_touched.slice(0,5).map(m=>e.jsx(g,{symbol:m},m)),t.symbols_touched.length>5&&e.jsxs("span",{className:"symbol-tag component",children:["+",t.symbols_touched.length-5]})]}),Array.isArray(t.tags)&&t.tags.some(m=>m.startsWith("arc:"))&&e.jsx("div",{style:{display:"flex",gap:4,marginTop:4,flexWrap:"wrap"},children:t.tags.filter(m=>m.startsWith("arc:")).map(m=>e.jsxs("span",{style:{padding:"1px 6px",background:"rgba(96, 165, 250, 0.15)",border:"1px solid rgba(96, 165, 250, 0.3)",borderRadius:10,fontSize:10,color:"#60a5fa"},children:["โป"," ",m]},m))}),e.jsxs("div",{className:"lore-card-footer",children:[e.jsxs("div",{className:"lore-card-stats",children:[a>0&&e.jsxs("span",{children:[a," files"]}),i>0&&e.jsxs("span",{children:[i," loc"]}),t.duration_minutes&&e.jsxs("span",{children:[t.duration_minutes,"m"]}),e.jsx(_,{status:(u=t.verification)==null?void 0:u.status}),t.confidence!=null&&e.jsxs("span",{style:{padding:"1px 5px",background:"rgba(139, 92, 246, 0.15)",border:"1px solid rgba(139, 92, 246, 0.3)",borderRadius:8,fontSize:10,color:"#8b5cf6"},children:[(t.confidence*100).toFixed(0),"%"]}),t.assessment&&e.jsx("span",{style:{padding:"1px 5px",background:t.assessment.verdict==="correct"?"rgba(52, 211, 153, 0.15)":t.assessment.verdict==="partial"?"rgba(251, 191, 36, 0.15)":"rgba(248, 113, 113, 0.15)",border:`1px solid ${t.assessment.verdict==="correct"?"rgba(52, 211, 153, 0.3)":t.assessment.verdict==="partial"?"rgba(251, 191, 36, 0.3)":"rgba(248, 113, 113, 0.3)"}`,borderRadius:8,fontSize:10,color:t.assessment.verdict==="correct"?"#34d399":t.assessment.verdict==="partial"?"#fbbf24":"#f87171"},children:t.assessment.verdict})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[t.review&&e.jsx(w,{rating:t.review.quality}),e.jsx("span",{children:D(t.timestamp)})]})]})]})})}function I({date:t,humanCount:r,agentCount:s}){const a=new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});return e.jsxs("div",{className:"date-separator",children:[e.jsx("span",{className:"date-count human",children:r}),e.jsx("span",{className:"date-badge",children:a}),e.jsx("span",{className:"date-count agent",children:s})]})}function B(){const t=c(d=>d.entries),r=c(d=>d.authors),s=c(d=>d.leftAuthors),n=c(d=>d.toggleLeftAuthor);if(t.length===0)return e.jsxs("div",{className:"empty-state",children:[e.jsx("h2",{children:"No lore entries yet"}),e.jsxs("p",{children:["Record your first entry with ",e.jsx("code",{children:"paradigm lore record"})," or via the MCP tool ",e.jsx("code",{children:"paradigm_lore_record"}),"."]})]});const a=s.length>0,i=new Map;for(const d of t){const h=d.timestamp.slice(0,10);i.has(h)||i.set(h,[]),i.get(h).push(d)}const x=d=>s.includes(d);return e.jsxs("div",{className:`thread-view ${a?"":"single-column"}`,children:[a&&e.jsx("div",{className:"timeline-spine"}),e.jsx("div",{className:"timeline-column-labels",children:a?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"column-label-group left",children:s.map(d=>e.jsxs("button",{className:"column-author-pill active",onClick:()=>n(d),title:"Remove from left column",children:[d," ร"]},d))}),e.jsx("div",{className:"column-label-group right",children:e.jsx("span",{className:"column-label-text",children:"EVERYONE ELSE"})})]}):e.jsxs("div",{className:"column-author-selector",children:[e.jsx("span",{className:"column-label-text",children:"Pick an author for the left column:"}),r.map(d=>e.jsx("button",{className:"column-author-pill",onClick:()=>n(d.id),children:d.id},d.id))]})}),Array.from(i.entries()).map(([d,h])=>{const u=h.filter(j=>x(j.author)).length,m=h.filter(j=>!x(j.author)).length;return e.jsxs(y.Fragment,{children:[e.jsx(I,{date:d,humanCount:u,agentCount:m}),h.map(j=>e.jsx(N,{entry:j,side:a&&x(j.author)?"left":"right"},j.id))]},d)})]})}function O(){const t=c(i=>i.symbols),r=c(i=>i.entries),s=c(i=>i.selectedSymbol),n=c(i=>i.selectSymbol),a=c(i=>i.setFilter);return p.useEffect(()=>{a(s?{symbol:s}:{symbol:void 0})},[s]),e.jsxs("div",{className:"sidebar-view",children:[e.jsxs("div",{className:"sidebar",children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border)",fontSize:11,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:["Symbols (",t.length,")"]}),t.map(i=>e.jsxs("div",{className:`sidebar-item ${s===i.symbol?"active":""}`,onClick:()=>n(s===i.symbol?null:i.symbol),children:[e.jsx("span",{className:"sidebar-item-name",children:e.jsx(g,{symbol:i.symbol})}),e.jsx("span",{className:"sidebar-item-count",children:i.count})]},i.symbol)),t.length===0&&e.jsx("div",{style:{padding:20,color:"var(--text-muted)",textAlign:"center",fontSize:13},children:"No symbols found"})]}),e.jsx("div",{className:"sidebar-content",children:s?e.jsxs(e.Fragment,{children:[e.jsxs("h2",{style:{fontSize:16,marginBottom:16},children:[e.jsx(g,{symbol:s})," entries"]}),r.length===0?e.jsx("div",{style:{color:"var(--text-muted)"},children:"No entries for this symbol"}):r.map(i=>e.jsx("div",{style:{marginBottom:12},children:e.jsx(N,{entry:i})},i.id))]}):e.jsxs("div",{className:"empty-state",children:[e.jsx("h2",{children:"Select a symbol"}),e.jsx("p",{children:"Choose a symbol from the sidebar to view its history."})]})})]})}function V(){const t=c(i=>i.authors),r=c(i=>i.entries),s=c(i=>i.selectedAuthor),n=c(i=>i.selectAuthor),a=c(i=>i.setFilter);return p.useEffect(()=>{a(s?{author:s}:{author:void 0})},[s]),e.jsxs("div",{className:"sidebar-view",children:[e.jsxs("div",{className:"sidebar",children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border)",fontSize:11,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:["Authors (",t.length,")"]}),t.map(i=>e.jsxs("div",{className:`sidebar-item ${s===i.id?"active":""}`,onClick:()=>n(s===i.id?null:i.id),children:[e.jsxs("div",{children:[e.jsxs("span",{className:"sidebar-item-name",children:[i.hasAgent?"๐ค":"๐ค"," ",i.id]}),e.jsxs("div",{style:{fontSize:10,color:"var(--text-muted)",marginTop:2},children:["Last active: ",new Date(i.lastActive).toLocaleDateString()]})]}),e.jsx("span",{className:"sidebar-item-count",children:i.count})]},i.id)),t.length===0&&e.jsx("div",{style:{padding:20,color:"var(--text-muted)",textAlign:"center",fontSize:13},children:"No authors found"})]}),e.jsx("div",{className:"sidebar-content",children:s?e.jsxs(e.Fragment,{children:[e.jsxs("h2",{style:{fontSize:16,marginBottom:16},children:[s,"'s entries"]}),r.length===0?e.jsx("div",{style:{color:"var(--text-muted)"},children:"No entries for this author"}):r.map(i=>e.jsx("div",{style:{marginBottom:12},children:e.jsx(N,{entry:i})},i.id))]}):e.jsxs("div",{className:"empty-state",children:[e.jsx("h2",{children:"Select an author"}),e.jsx("p",{children:"Choose an author from the sidebar to view their work."})]})})]})}function f(t){return new Date(t).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})}function M(t,r){const s=new Date(r).getTime()-new Date(t).getTime(),n=Math.round(s/6e4);if(n<60)return`${n}m`;const a=Math.floor(n/60),i=n%60;return i>0?`${a}h ${i}m`:`${a}h`}function W({session:t,active:r,onClick:s}){var a;const n=t.author.hasAgent;return e.jsxs("div",{className:`sidebar-item session-sidebar-item ${r?"active":""}`,onClick:s,children:[e.jsxs("div",{className:"session-sidebar-info",children:[e.jsxs("span",{className:`session-author-badge ${n?"agent":"human"}`,children:[n?"๐ค":"๐ค"," ",t.author.name]}),e.jsxs("div",{className:"session-sidebar-meta",children:[f(t.startTime),t.startTime!==t.endTime&&` - ${f(t.endTime)}`]})]}),e.jsxs("div",{className:"session-sidebar-stats",children:[e.jsxs("span",{className:"sidebar-item-count",children:[t.entryCount," entries"]}),((a=t.symbolsTouched)==null?void 0:a.length)>0&&e.jsxs("span",{className:"sidebar-item-count",children:[t.symbolsTouched.length," symbols"]})]})]})}function P({session:t}){var n;const r=M(t.startTime,t.endTime),s=new Date(t.date).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"});return e.jsxs("div",{className:"session-detail",children:[e.jsxs("div",{className:"session-detail-header",children:[e.jsx("h2",{children:e.jsxs("span",{className:`session-author-badge ${t.author.hasAgent?"agent":"human"}`,children:[t.author.hasAgent?"๐ค":"๐ค"," ",t.author.name]})}),e.jsxs("div",{className:"session-detail-meta",children:[e.jsx("span",{children:s}),e.jsxs("span",{children:[f(t.startTime)," - ",f(t.endTime)]}),e.jsx("span",{children:r}),e.jsxs("span",{children:[t.entryCount," entries"]})]})]}),((n=t.symbolsTouched)==null?void 0:n.length)>0&&e.jsxs("div",{className:"session-detail-section",children:[e.jsx("h3",{children:"Symbols Touched"}),e.jsx("div",{className:"session-symbols",children:t.symbolsTouched.map(a=>e.jsx(g,{symbol:a},a))})]}),t.breadcrumbs&&t.breadcrumbs.length>0&&e.jsxs("div",{className:"session-detail-section",children:[e.jsx("h3",{children:"Session Breadcrumbs"}),e.jsx("div",{className:"breadcrumb-list",children:t.breadcrumbs.map((a,i)=>e.jsxs("div",{className:"breadcrumb-item",children:[a.phase&&e.jsx("span",{className:"breadcrumb-phase",children:a.phase}),a.context&&e.jsx("span",{className:"breadcrumb-context",children:a.context}),a.timestamp&&e.jsx("span",{className:"breadcrumb-time",children:f(a.timestamp)}),a.decisions&&a.decisions.length>0&&e.jsx("div",{className:"breadcrumb-decisions",children:a.decisions.map((x,d)=>e.jsx("span",{className:"breadcrumb-decision",children:x},d))})]},i))})]}),e.jsxs("div",{className:"session-detail-section",children:[e.jsx("h3",{children:"Lore Entries"}),t.entries?t.entries.map(a=>e.jsx("div",{style:{marginBottom:12},children:e.jsx(N,{entry:a})},a.id)):e.jsx("div",{style:{color:"var(--text-muted)",fontSize:13},children:"Loading entries..."})]})]})}function U(){const t=c(i=>i.sessions),r=c(i=>i.selectedSessionId),s=c(i=>i.selectSession),n=t.find(i=>i.id===r),a=new Map;for(const i of t)a.has(i.date)||a.set(i.date,[]),a.get(i.date).push(i);return e.jsxs("div",{className:"sidebar-view",children:[e.jsxs("div",{className:"sidebar",children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border)",fontSize:11,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:["Sessions (",t.length,")"]}),t.length===0?e.jsx("div",{style:{padding:20,color:"var(--text-muted)",textAlign:"center",fontSize:13},children:"No sessions found"}):Array.from(a.entries()).map(([i,x])=>{const d=new Date(i).toLocaleDateString("en-US",{month:"short",day:"numeric"});return e.jsxs(y.Fragment,{children:[e.jsx("div",{className:"session-date-header",children:d}),x.map(h=>e.jsx(W,{session:h,active:r===h.id,onClick:()=>s(r===h.id?null:h.id)},h.id))]},i)})]}),e.jsx("div",{className:"sidebar-content",children:n?e.jsx(P,{session:n}):e.jsxs("div",{className:"empty-state",children:[e.jsx("h2",{children:"Select a session"}),e.jsx("p",{children:"Choose a session from the sidebar to view its details, entries, and breadcrumbs."})]})})]})}function q(){const t=c(i=>i.view),r=c(i=>i.entries),s=c(i=>i.projectName),n=c(i=>i.authors),a=c(i=>i.fetchAll);return p.useEffect(()=>{a()},[]),e.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--p-border)"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:t==="timeline"?8:0},children:[e.jsxs("div",{children:[e.jsx("span",{style:{fontSize:16,fontWeight:600},children:"Lore"}),e.jsxs("span",{style:{fontSize:12,color:"var(--p-text-muted)",marginLeft:10},children:[s||"project"," ยท ",r.length," entries ยท ",n.length," authors"]})]}),e.jsx(F,{})]}),t==="timeline"&&e.jsx(E,{})]}),e.jsxs("main",{style:{flex:1,overflow:"auto",paddingBottom:32},children:[t==="timeline"&&e.jsx(B,{}),t==="session"&&e.jsx(U,{}),t==="symbol"&&e.jsx(O,{}),t==="author"&&e.jsx(V,{})]}),e.jsx(z,{})]})}export{q as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as _,r,j as e}from"./index-F0KL9xrN.js";const Q=_((t,n)=>({logs:[],services:[],flowEvents:[],isLoading:!1,error:null,isLive:!1,levelFilter:"all",serviceFilter:null,symbolFilter:null,searchQuery:"",excludedSymbols:new Set,excludedSymbolTypes:new Set,excludedMessages:new Set,excludedServices:new Set,loadLogs:async()=>{t({isLoading:!0,error:null});try{const s=new URLSearchParams,l=n();l.levelFilter!=="all"&&s.set("level",l.levelFilter),l.serviceFilter&&s.set("service",l.serviceFilter),l.symbolFilter&&s.set("symbol",l.symbolFilter),l.searchQuery&&s.set("search",l.searchQuery),s.set("limit","200");const a=await fetch(`/api/sentinel/logs?${s}`);if(!a.ok)throw new Error(`API error: ${a.status}`);const i=await a.json();t({logs:i.logs||[],isLoading:!1})}catch(s){t({isLoading:!1,error:s instanceof Error?s.message:"Failed to load logs",logs:[]})}},loadServices:async()=>{try{const s=await fetch("/api/sentinel/services");if(!s.ok)return;const l=await s.json();t({services:l.services||[]})}catch{}},handleWsMessage:s=>{if(s.type==="sentinel:log"&&s.entry&&t(l=>({logs:[s.entry,...l.logs].slice(0,500)})),s.type==="sentinel:flow_event"){const l={type:"flow_event",flowId:s.flowId,nodeSymbol:s.nodeSymbol,event:s.event,timestamp:s.timestamp,service:s.service};t(a=>({flowEvents:[l,...a.flowEvents].slice(0,200)}))}},setIsLive:s=>t({isLive:s}),setLevelFilter:s=>t({levelFilter:s}),setServiceFilter:s=>t({serviceFilter:s}),setSymbolFilter:s=>t({symbolFilter:s}),setSearchQuery:s=>t({searchQuery:s}),clearLogs:()=>t({logs:[],flowEvents:[]}),toggleExcludedSymbol:s=>{const l=new Set(n().excludedSymbols);l.has(s)?l.delete(s):l.add(s),t({excludedSymbols:l})},toggleExcludedSymbolType:s=>{const l=new Set(n().excludedSymbolTypes);l.has(s)?l.delete(s):l.add(s),t({excludedSymbolTypes:l})},toggleExcludedMessage:s=>{const l=new Set(n().excludedMessages);l.has(s)?l.delete(s):l.add(s),t({excludedMessages:l})},toggleExcludedService:s=>{const l=new Set(n().excludedServices);l.has(s)?l.delete(s):l.add(s),t({excludedServices:l})},clearAllExclusions:()=>t({excludedSymbols:new Set,excludedSymbolTypes:new Set,excludedMessages:new Set,excludedServices:new Set}),getFilteredLogs:()=>{const s=n();let l=s.logs;if(s.levelFilter!=="all"&&(l=l.filter(a=>a.level===s.levelFilter)),s.serviceFilter&&(l=l.filter(a=>a.service===s.serviceFilter)),s.symbolFilter&&(l=l.filter(a=>a.symbol.includes(s.symbolFilter))),s.searchQuery){const a=s.searchQuery.toLowerCase();l=l.filter(i=>i.message.toLowerCase().includes(a)||i.symbol.toLowerCase().includes(a))}return s.excludedSymbols.size>0&&(l=l.filter(a=>!s.excludedSymbols.has(a.symbol))),s.excludedSymbolTypes.size>0&&(l=l.filter(a=>!s.excludedSymbolTypes.has(a.symbolType))),s.excludedMessages.size>0&&(l=l.filter(a=>!s.excludedMessages.has(a.message))),s.excludedServices.size>0&&(l=l.filter(a=>!s.excludedServices.has(a.service))),l}})),R=_((t,n)=>({events:[],scopes:[],selectedScope:null,excludedTypes:new Set,excludedServices:new Set,categoryFilter:null,loading:!1,error:null,total:0,fetchEvents:async(s,l={})=>{t({loading:!0,error:null});try{const a=new URLSearchParams({schemaId:s,...l}),i=await fetch(`/api/sentinel/events?${a}`);if(!i.ok)throw new Error(`Failed to fetch events: ${i.status}`);const d=await i.json();t({events:d.events||[],total:d.total||0,loading:!1})}catch(a){t({error:a instanceof Error?a.message:"Failed to fetch events",loading:!1})}},fetchScopes:async s=>{try{const l=await fetch(`/api/sentinel/events/scopes?schemaId=${encodeURIComponent(s)}`);if(!l.ok)throw new Error(`Failed to fetch scopes: ${l.status}`);const a=await l.json();t({scopes:a.scopes||[]})}catch(l){t({error:l instanceof Error?l.message:"Failed to fetch scopes"})}},fetchScopeEvents:async(s,l)=>{t({loading:!0,error:null,selectedScope:l});try{const a=await fetch(`/api/sentinel/events/scope/${encodeURIComponent(l)}?schemaId=${encodeURIComponent(s)}`);if(!a.ok)throw new Error(`Failed to fetch scope events: ${a.status}`);const i=await a.json();t({events:i.events||[],total:i.count||0,loading:!1})}catch(a){t({error:a instanceof Error?a.message:"Failed to fetch scope events",loading:!1})}},selectScope:s=>t({selectedScope:s}),toggleExcludedType:s=>{const l=new Set(n().excludedTypes);l.has(s)?l.delete(s):l.add(s),t({excludedTypes:l})},toggleExcludedService:s=>{const l=new Set(n().excludedServices);l.has(s)?l.delete(s):l.add(s),t({excludedServices:l})},clearAllExclusions:()=>t({excludedTypes:new Set,excludedServices:new Set}),setCategoryFilter:s=>t({categoryFilter:s}),handleWsMessage:s=>{s.type==="sentinel:event"&&s.event&&t(l=>({events:[s.event,...l.events].slice(0,500),total:l.total+1}))}}));function te(){r.useEffect(()=>{function t(n){const s=n.detail;s!=null&&s.type&&((s.type==="sentinel:log"||s.type==="sentinel:flow_event")&&Q.getState().handleWsMessage(s),s.type==="sentinel:event"&&R.getState().handleWsMessage(s))}return window.addEventListener("sentinel-ws",t),()=>window.removeEventListener("sentinel-ws",t)},[])}function ne(t){const[n,s]=r.useState(t),l=r.useRef(null),a=r.useCallback((d,f)=>{f.preventDefault(),l.current={idx:d,startX:f.clientX,startW:n[d]};const p=j=>{const g=l.current;if(!g)return;const x=Math.max(40,g.startW+(j.clientX-g.startX));s(c=>{const v=[...c];return v[g.idx]=x,v})},u=()=>{l.current=null,window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",u)};window.addEventListener("mousemove",p),window.addEventListener("mouseup",u)},[n]);return{gridTemplate:n.map(d=>`${d}px`).join(" ")+" 1fr",onMouseDown:a}}function z({idx:t,onMouseDown:n}){return e.jsx("span",{className:"col-resize-handle",onMouseDown:s=>n(t,s)})}const ae={debug:"#94a3b8",info:"#3b82f6",warn:"#f59e0b",error:"#ef4444"},Y={component:"var(--p-symbol-component)",gate:"var(--p-symbol-gate)",signal:"var(--p-symbol-signal)",flow:"var(--p-symbol-flow)",aspect:"var(--p-symbol-aspect)",raw:"var(--p-text-muted)"};function ie(t){const n=new Date(t),s=(l,a=2)=>String(l).padStart(a,"0");return`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${s(n.getHours())}:${s(n.getMinutes())}:${s(n.getSeconds())}`}function ce({entry:t,isExpanded:n,onToggle:s,onContextMenu:l}){const a=Y[t.symbolType]||Y.raw;return e.jsxs("div",{className:`log-row log-row--${t.level}${n?" log-row--expanded":""}`,onClick:s,onContextMenu:l,children:[e.jsx("span",{className:"log-time",children:ie(t.timestamp)}),e.jsx("span",{className:"log-level",style:{color:ae[t.level]},children:t.level.toUpperCase().padEnd(5)}),e.jsx("span",{className:"log-symbol",style:{color:a},children:t.symbol}),e.jsx("span",{className:"log-service",children:t.service}),e.jsxs("span",{className:"log-message",children:[t.message,t.durationMs!==void 0&&e.jsxs("span",{className:"log-duration",children:[t.durationMs.toFixed(1),"ms"]})]}),n&&t.data&&e.jsx("div",{className:"log-data",onClick:i=>i.stopPropagation(),children:e.jsx("pre",{children:JSON.stringify(t.data,null,2)})})]})}function oe(){const{isLoading:t,error:n,isLive:s,services:l,levelFilter:a,serviceFilter:i,searchQuery:d,excludedSymbols:f,excludedSymbolTypes:p,excludedMessages:u,excludedServices:j,loadLogs:g,loadServices:x,setIsLive:c,setLevelFilter:v,setServiceFilter:m,setSearchQuery:y,getFilteredLogs:N,clearLogs:T,toggleExcludedSymbol:w,toggleExcludedSymbolType:k,toggleExcludedMessage:b,toggleExcludedService:F,clearAllExclusions:h}=Q(),S=N(),L=r.useRef(null),[C,V]=r.useState(new Set),[M,U]=r.useState(!1),[I,q]=r.useState(!0),[E,$]=r.useState(null),{gridTemplate:K,onMouseDown:D}=ne([180,50,160,100]),Z=f.size>0||p.size>0||u.size>0||j.size>0,ee=r.useCallback((o,A)=>{o.preventDefault(),$({x:o.clientX,y:o.clientY,entry:A})},[]);r.useEffect(()=>{if(!E)return;const o=()=>$(null);return window.addEventListener("click",o),()=>window.removeEventListener("click",o)},[E]);const se=o=>{V(A=>{const O=new Set(A);return O.has(o)?(O.delete(o),U(!1)):O.add(o),O})},le=()=>{M?(V(new Set),U(!1)):U(!0)};return r.useEffect(()=>(g(),x(),c(!0),()=>c(!1)),[]),r.useEffect(()=>{I&&L.current&&L.current.scrollIntoView({behavior:"smooth"})},[S.length,I]),t&&S.length===0?e.jsx("div",{className:"logs-view s-loading-state",children:e.jsxs("div",{className:"s-loading-content",children:[e.jsx("div",{className:"s-loading-spinner"}),e.jsx("p",{children:"Loading logs..."})]})}):n&&S.length===0?e.jsx("div",{className:"logs-view s-error-state",children:e.jsxs("div",{className:"s-error-content",children:[e.jsx("h2",{children:"Failed to load logs"}),e.jsx("p",{children:n}),e.jsx("button",{onClick:()=>g(),children:"Retry"})]})}):e.jsxs("div",{className:"logs-view",children:[e.jsxs("div",{className:"logs-toolbar",children:[e.jsxs("div",{className:"logs-filters",children:[e.jsxs("select",{value:a,onChange:o=>v(o.target.value),className:"logs-select",children:[e.jsx("option",{value:"all",children:"All Levels"}),e.jsx("option",{value:"debug",children:"Debug"}),e.jsx("option",{value:"info",children:"Info"}),e.jsx("option",{value:"warn",children:"Warn"}),e.jsx("option",{value:"error",children:"Error"})]}),e.jsxs("select",{value:i||"",onChange:o=>m(o.target.value||null),className:"logs-select",children:[e.jsx("option",{value:"",children:"All Services"}),l.map(o=>e.jsx("option",{value:o.name,children:o.name},o.name))]}),e.jsx("input",{type:"text",placeholder:"Search logs...",value:d,onChange:o=>y(o.target.value),className:"logs-search"})]}),e.jsxs("div",{className:"logs-actions",children:[e.jsxs("span",{className:"logs-count",children:[S.length," entries"]}),e.jsx("button",{className:`logs-expand-btn ${M?"active":""}`,onClick:le,title:M?"Collapse all payloads":"Expand all payloads",children:M?"Collapse All":"Expand All"}),e.jsxs("button",{className:`logs-live-btn ${s?"active":""}`,onClick:()=>c(!s),title:s?"Streaming live":"Click to connect",children:[e.jsx("span",{className:`live-dot ${s?"live":""}`}),s?"Live":"Paused"]}),e.jsx("button",{className:`logs-scroll-btn ${I?"active":""}`,onClick:()=>q(!I),title:"Auto-scroll to new logs",children:I?"Auto":"Manual"}),e.jsx("button",{className:"logs-clear-btn",onClick:T,title:"Clear log buffer",children:"Clear"})]})]}),Z&&e.jsxs("div",{className:"exclusion-bar",children:[[...f].map(o=>e.jsxs("span",{className:"exclusion-chip",children:["symbol: ",o," ",e.jsx("button",{onClick:()=>w(o),children:"ร"})]},`sym-${o}`)),[...p].map(o=>e.jsxs("span",{className:"exclusion-chip",children:["type: ",o," ",e.jsx("button",{onClick:()=>k(o),children:"ร"})]},`type-${o}`)),[...u].map(o=>e.jsxs("span",{className:"exclusion-chip",children:["msg: ",o.length>40?o.slice(0,40)+"...":o," ",e.jsx("button",{onClick:()=>b(o),children:"ร"})]},`msg-${o}`)),[...j].map(o=>e.jsxs("span",{className:"exclusion-chip",children:["service: ",o," ",e.jsx("button",{onClick:()=>F(o),children:"ร"})]},`svc-${o}`)),e.jsx("button",{className:"exclusion-clear",onClick:h,children:"Clear all"})]}),E&&e.jsxs("div",{className:"context-menu",style:{top:E.y,left:E.x},onClick:o=>o.stopPropagation(),children:[e.jsxs("button",{onClick:()=>{w(E.entry.symbol),$(null)},children:['Exclude symbol "',E.entry.symbol,'"']}),e.jsxs("button",{onClick:()=>{k(E.entry.symbolType),$(null)},children:['Exclude type "',E.entry.symbolType,'"']}),e.jsx("button",{onClick:()=>{b(E.entry.message),$(null)},children:"Exclude this message"}),e.jsxs("button",{onClick:()=>{F(E.entry.service),$(null)},children:['Exclude service "',E.entry.service,'"']})]}),e.jsxs("div",{className:"logs-table",style:{"--log-cols":K},children:[e.jsxs("div",{className:"logs-header",children:[e.jsxs("span",{className:"log-time",children:["Time",e.jsx(z,{idx:0,onMouseDown:D})]}),e.jsxs("span",{className:"log-level",children:["Level",e.jsx(z,{idx:1,onMouseDown:D})]}),e.jsxs("span",{className:"log-symbol",children:["Symbol",e.jsx(z,{idx:2,onMouseDown:D})]}),e.jsxs("span",{className:"log-service",children:["Service",e.jsx(z,{idx:3,onMouseDown:D})]}),e.jsx("span",{className:"log-message",children:"Message"})]}),e.jsxs("div",{className:"logs-body",children:[e.jsx("div",{ref:L}),S.length===0?e.jsxs("div",{className:"logs-empty",children:[e.jsx("p",{children:"No logs yet."}),e.jsxs("p",{className:"hint",children:["POST structured logs to ",e.jsx("code",{children:"/api/sentinel/logs"})," or connect an app with the Sentinel client SDK."]})]}):S.map(o=>e.jsx(ce,{entry:o,isExpanded:M||C.has(o.id),onToggle:()=>se(o.id),onContextMenu:A=>ee(A,o)},o.id))]})]})]})}const re=_((t,n)=>({incidents:[],patterns:[],selectedIncidentId:null,isLoading:!1,error:null,statusFilter:"all",environmentFilter:null,symbolFilter:null,loadIncidents:async()=>{t({isLoading:!0,error:null});try{const s=await fetch("/api/sentinel/incidents");if(!s.ok)throw new Error(`API error: ${s.status}`);const l=await s.json();t({incidents:l.incidents||[],isLoading:!1})}catch(s){t({isLoading:!1,error:s instanceof Error?s.message:"Failed to load incidents",incidents:[]})}},loadPatterns:async()=>{try{const s=await fetch("/api/sentinel/patterns");if(!s.ok)throw new Error(`API error: ${s.status}`);const l=await s.json();t({patterns:l.patterns||[]})}catch{}},selectIncident:s=>t({selectedIncidentId:s}),setStatusFilter:s=>t({statusFilter:s}),setEnvironmentFilter:s=>t({environmentFilter:s}),setSymbolFilter:s=>t({symbolFilter:s}),resolveIncident:async s=>{try{const l=await fetch(`/api/sentinel/incidents/${s}/resolve`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!l.ok)throw new Error(`API error: ${l.status}`);await n().loadIncidents()}catch(l){throw l}},getFilteredIncidents:()=>{const s=n();let l=s.incidents;return s.statusFilter!=="all"&&(l=l.filter(a=>a.status===s.statusFilter)),s.environmentFilter&&(l=l.filter(a=>a.environment===s.environmentFilter)),s.symbolFilter&&(l=l.filter(a=>{const i=a.symbols;return i.feature===s.symbolFilter||i.component===s.symbolFilter||i.flow===s.symbolFilter||i.gate===s.symbolFilter||i.signal===s.symbolFilter})),l},getSelectedIncident:()=>{const s=n();return s.incidents.find(l=>l.id===s.selectedIncidentId)}})),H={open:"#ef4444",investigating:"#f59e0b",resolved:"#22c55e","wont-fix":"#6b7280"},B={open:"Open",investigating:"Investigating",resolved:"Resolved","wont-fix":"Won't Fix"};function de(){const{isLoading:t,error:n,statusFilter:s,selectedIncidentId:l,loadIncidents:a,loadPatterns:i,selectIncident:d,setStatusFilter:f,getFilteredIncidents:p,getSelectedIncident:u,resolveIncident:j}=re(),g=p(),x=u();return r.useEffect(()=>{a(),i()},[]),t?e.jsx("div",{className:"incidents-view s-loading-state",children:e.jsxs("div",{className:"s-loading-content",children:[e.jsx("div",{className:"s-loading-spinner"}),e.jsx("p",{children:"Loading incidents..."})]})}):n?e.jsx("div",{className:"incidents-view s-error-state",children:e.jsxs("div",{className:"s-error-content",children:[e.jsx("h2",{children:"Failed to load incidents"}),e.jsx("p",{children:n}),e.jsx("button",{onClick:()=>a(),children:"Retry"})]})}):e.jsxs("div",{className:"incidents-view",children:[e.jsxs("div",{className:"incidents-filters",children:[e.jsxs("div",{className:"filter-group",children:[e.jsx("label",{children:"Status:"}),e.jsxs("select",{value:s,onChange:c=>f(c.target.value),children:[e.jsx("option",{value:"all",children:"All"}),e.jsx("option",{value:"open",children:"Open"}),e.jsx("option",{value:"investigating",children:"Investigating"}),e.jsx("option",{value:"resolved",children:"Resolved"}),e.jsx("option",{value:"wont-fix",children:"Won't Fix"})]})]}),e.jsxs("div",{className:"filter-stats",children:[g.length," incident",g.length!==1?"s":""]})]}),e.jsxs("div",{className:"incidents-content",children:[e.jsx("div",{className:"incidents-list",children:g.length===0?e.jsxs("div",{className:"incidents-empty",children:[e.jsx("p",{children:"No incidents found."}),e.jsx("p",{className:"hint",children:"Incidents are recorded when errors occur in your application."})]}):g.map(c=>e.jsxs("div",{className:`incident-card ${l===c.id?"selected":""}`,onClick:()=>d(c.id),children:[e.jsxs("div",{className:"incident-header",children:[e.jsx("span",{className:"incident-id",children:c.id}),e.jsx("span",{className:"incident-status",style:{color:H[c.status]},children:B[c.status]})]}),e.jsx("div",{className:"incident-error",children:c.error.message}),e.jsxs("div",{className:"incident-meta",children:[e.jsx("span",{className:"incident-env",children:c.environment}),e.jsx("span",{className:"incident-time",children:new Date(c.timestamp).toLocaleString()})]}),c.symbols&&Object.keys(c.symbols).length>0&&e.jsxs("div",{className:"incident-symbols",children:[c.symbols.component&&e.jsxs("span",{className:"symbol-tag component",children:["#",c.symbols.component]}),c.symbols.flow&&e.jsxs("span",{className:"symbol-tag flow",children:["$",c.symbols.flow]}),c.symbols.gate&&e.jsxs("span",{className:"symbol-tag gate",children:["^",c.symbols.gate]}),c.symbols.signal&&e.jsxs("span",{className:"symbol-tag signal",children:["!",c.symbols.signal]})]}),c.patternMatches&&c.patternMatches.length>0&&e.jsx("div",{className:"incident-patterns",children:e.jsxs("span",{className:"pattern-match",children:["Matched: ",c.patternMatches[0].patternName,"(",Math.round(c.patternMatches[0].confidence),"%)"]})})]},c.id))}),x&&e.jsxs("div",{className:"incident-detail",children:[e.jsxs("div",{className:"detail-header",children:[e.jsx("h2",{children:x.id}),e.jsx("button",{className:"detail-close",onClick:()=>d(null),children:"ร"})]}),e.jsxs("div",{className:"detail-content",children:[e.jsxs("section",{className:"detail-section",children:[e.jsx("h3",{children:"Error"}),e.jsx("div",{className:"error-message",children:x.error.message}),x.error.type&&e.jsxs("div",{className:"error-type",children:["Type: ",x.error.type]})]}),e.jsxs("section",{className:"detail-section",children:[e.jsx("h3",{children:"Context"}),e.jsxs("div",{className:"detail-field",children:[e.jsx("label",{children:"Status"}),e.jsx("span",{className:"status-badge",style:{backgroundColor:H[x.status]},children:B[x.status]})]}),e.jsxs("div",{className:"detail-field",children:[e.jsx("label",{children:"Environment"}),e.jsx("span",{children:x.environment})]}),e.jsxs("div",{className:"detail-field",children:[e.jsx("label",{children:"Timestamp"}),e.jsx("span",{children:new Date(x.timestamp).toLocaleString()})]})]}),x.symbols&&Object.keys(x.symbols).length>0&&e.jsxs("section",{className:"detail-section",children:[e.jsx("h3",{children:"Symbols"}),e.jsx("div",{className:"symbols-list",children:Object.entries(x.symbols).map(([c,v])=>v&&e.jsxs("div",{className:"symbol-item",children:[e.jsx("label",{children:c}),e.jsx("span",{className:`symbol-value ${c}`,children:v})]},c))})]}),x.patternMatches&&x.patternMatches.length>0&&e.jsxs("section",{className:"detail-section",children:[e.jsx("h3",{children:"Pattern Matches"}),e.jsx("div",{className:"patterns-list",children:x.patternMatches.map(c=>e.jsxs("div",{className:"pattern-item",children:[e.jsx("div",{className:"pattern-name",children:c.patternName}),e.jsxs("div",{className:"pattern-confidence",children:[Math.round(c.confidence),"% confidence"]})]},c.patternId))})]}),x.status==="open"&&e.jsx("section",{className:"detail-actions",children:e.jsx("button",{className:"action-btn resolve",onClick:()=>j(x.id),children:"Mark Resolved"})})]})]})]})]})}const X=_((t,n)=>({schemas:[],selectedSchemaId:null,loading:!1,error:null,fetchSchemas:async()=>{t({loading:!0,error:null});try{const s=await fetch("/api/sentinel/schemas");if(!s.ok)throw new Error(`Failed to fetch schemas: ${s.status}`);const a=(await s.json()).schemas||[];t({schemas:a,loading:!1}),!n().selectedSchemaId&&a.length>0&&t({selectedSchemaId:a[0].id})}catch(s){t({error:s instanceof Error?s.message:"Failed to fetch schemas",loading:!1})}},selectSchema:s=>t({selectedSchemaId:s}),getSelectedSchema:()=>{const s=n();return s.schemas.find(l=>l.id===s.selectedSchemaId)}}));function ue(t){const[n,s]=r.useState(t),l=r.useRef(null),a=r.useCallback((d,f)=>{f.preventDefault(),l.current={idx:d,startX:f.clientX,startW:n[d]};const p=j=>{const g=l.current;if(!g)return;const x=Math.max(40,g.startW+(j.clientX-g.startX));s(c=>{const v=[...c];return v[g.idx]=x,v})},u=()=>{l.current=null,window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",u)};window.addEventListener("mousemove",p),window.addEventListener("mouseup",u)},[n]);return{gridTemplate:n.map(d=>`${d}px`).join(" ")+" 1fr",onMouseDown:a}}function P({idx:t,onMouseDown:n}){return e.jsx("span",{className:"col-resize-handle",onMouseDown:s=>n(t,s)})}const me={debug:"#94a3b8",info:"#3b82f6",warn:"#f59e0b",error:"#ef4444"},he={logs:"#3b82f6",metrics:"#22c55e",traces:"#a855f7",incidents:"#ef4444",rules:"#f59e0b",state:"#06b6d4",cascade:"#ec4899",lifecycle:"#84cc16"};function pe(t){const n=new Date(t),s=(l,a=2)=>String(l).padStart(a,"0");return`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())} ${s(n.getHours())}:${s(n.getMinutes())}:${s(n.getSeconds())}`}function W(t,n){var l;const s=(l=n==null?void 0:n.visualization)==null?void 0:l.categoryColors;return s&&s[t]?s[t]:he[t]||"var(--p-text-muted)"}function xe(){const{schemas:t,selectedSchemaId:n,selectSchema:s,fetchSchemas:l,loading:a}=X();return r.useEffect(()=>{l()},[]),a?e.jsx("div",{className:"events-loading",children:"Loading schemas..."}):t.length===0?e.jsxs("div",{className:"events-empty-state",children:[e.jsx("p",{children:"No event schemas registered."}),e.jsxs("p",{className:"hint",children:["Applications register schemas via ",e.jsx("code",{children:"POST /api/sentinel/schemas"}),"."]})]}):e.jsx("select",{className:"events-schema-select",value:n||"",onChange:i=>s(i.target.value||null),children:t.map(i=>e.jsxs("option",{value:i.id,children:[i.name," (v",i.version,")"]},i.id))})}function ve({schema:t}){const{scopes:n,selectedScope:s,fetchScopes:l,fetchScopeEvents:a,selectScope:i,fetchEvents:d}=R();r.useEffect(()=>{l(t.id)},[t.id]);const f=p=>{s===p?(i(null),d(t.id)):a(t.id,p)};return n.length===0?null:e.jsxs("div",{className:"events-scope-nav",children:[e.jsxs("div",{className:"events-scope-label",children:[t.scope.label,"s"]}),e.jsx("div",{className:"events-scope-list",children:n.slice(0,50).map(p=>e.jsxs("button",{className:`events-scope-chip ${s===p.scopeValue?"active":""}`,onClick:()=>f(p.scopeValue),title:`${p.eventCount} events`,children:[e.jsx("span",{className:"scope-value",children:t.scope.type==="number"?`#${p.scopeValue}`:p.scopeValue}),e.jsx("span",{className:"scope-count",children:p.eventCount})]},p.scopeValue))})]})}function ge({schema:t}){var p;const{events:n,categoryFilter:s,setCategoryFilter:l,excludedTypes:a,toggleExcludedType:i}=R(),d=[...new Set(n.map(u=>u.category))],f=((p=t.visualization)==null?void 0:p.defaultExcluded)||[];return r.useEffect(()=>{for(const u of f)a.has(u)||i(u)},[t.id]),e.jsxs("div",{className:"events-category-filters",children:[e.jsx("button",{className:`events-category-chip ${s?"":"active"}`,onClick:()=>l(null),children:"All"}),d.map(u=>e.jsx("button",{className:`events-category-chip ${s===u?"active":""}`,onClick:()=>l(s===u?null:u),style:{borderColor:W(u,t),color:s===u?"#fff":W(u,t),backgroundColor:s===u?W(u,t):"transparent"},children:u},u))]})}function fe({event:t,schema:n,isExpanded:s,onToggle:l,onContextMenu:a}){const i=W(t.category,n);return e.jsxs("div",{className:`event-row event-row--${t.severity||"info"}${s?" event-row--expanded":""}`,onClick:l,onContextMenu:a,children:[e.jsx("span",{className:"event-time",children:pe(t.timestamp)}),e.jsx("span",{className:"event-severity",style:{color:me[t.severity||"info"]},children:(t.severity||"info").toUpperCase().padEnd(5)}),e.jsxs("span",{className:"event-type",children:[t.category&&t.category!=="unknown"&&e.jsxs("span",{className:"event-category-badge",style:{color:i},children:["[",t.category,"]"]})," ",t.eventType]}),e.jsx("span",{className:"event-service",children:t.service}),t.scopeValue&&e.jsx("span",{className:"event-scope",children:t.scopeValue}),t.depth!=null&&t.depth>0&&e.jsx("span",{className:"event-depth",style:{paddingLeft:`${t.depth*12}px`},children:" ".repeat(t.depth)}),s&&t.data&&e.jsx("div",{className:"event-data",onClick:d=>d.stopPropagation(),children:e.jsx("pre",{children:JSON.stringify(t.data,null,2)})})]})}function je({schema:t}){const{events:n,excludedTypes:s,excludedServices:l,categoryFilter:a,loading:i,toggleExcludedType:d,toggleExcludedService:f,clearAllExclusions:p}=R(),[u,j]=r.useState(new Set),[g,x]=r.useState(!1),c=r.useRef(null),{gridTemplate:v,onMouseDown:m}=ue([180,50,200,100]),y=h=>{j(S=>{const L=new Set(S);return L.has(h)?(L.delete(h),x(!1)):L.add(h),L})},N=n.filter(h=>!(s.has(h.eventType)||l.has(h.service)||a&&h.category!==a)),T=s.size>0||l.size>0,[w,k]=r.useState(null),b=r.useCallback((h,S)=>{h.preventDefault(),k({x:h.clientX,y:h.clientY,event:S})},[]);r.useEffect(()=>{if(!w)return;const h=()=>k(null);return window.addEventListener("click",h),()=>window.removeEventListener("click",h)},[w]);const F=()=>{g?(j(new Set),x(!1)):x(!0)};return i?e.jsx("div",{className:"events-loading",children:"Loading events..."}):N.length===0?e.jsxs("div",{className:"events-empty-state",children:[e.jsx("p",{children:"No events to display."}),e.jsx("p",{className:"hint",children:"Events will appear here when applications send them to Sentinel."})]}):e.jsxs("div",{className:"events-table",ref:c,style:{"--evt-cols":v},children:[e.jsxs("div",{className:"events-table-actions",children:[e.jsxs("span",{className:"events-count",children:[N.length," events"]}),e.jsx("button",{className:`events-expand-btn ${g?"active":""}`,onClick:F,title:g?"Collapse all payloads":"Expand all payloads",children:g?"Collapse All":"Expand All"})]}),T&&e.jsxs("div",{className:"exclusion-bar",children:[[...s].map(h=>e.jsxs("span",{className:"exclusion-chip",children:["type: ",h," ",e.jsx("button",{onClick:()=>d(h),children:"ร"})]},`type-${h}`)),[...l].map(h=>e.jsxs("span",{className:"exclusion-chip",children:["service: ",h," ",e.jsx("button",{onClick:()=>f(h),children:"ร"})]},`svc-${h}`)),e.jsx("button",{className:"exclusion-clear",onClick:p,children:"Clear all"})]}),w&&e.jsxs("div",{className:"context-menu",style:{top:w.y,left:w.x},onClick:h=>h.stopPropagation(),children:[e.jsxs("button",{onClick:()=>{d(w.event.eventType),k(null)},children:['Exclude type "',w.event.eventType,'"']}),e.jsxs("button",{onClick:()=>{f(w.event.service),k(null)},children:['Exclude service "',w.event.service,'"']})]}),e.jsxs("div",{className:"events-table-header",children:[e.jsxs("span",{className:"event-time",children:["Time",e.jsx(P,{idx:0,onMouseDown:m})]}),e.jsxs("span",{className:"event-severity",children:["Level",e.jsx(P,{idx:1,onMouseDown:m})]}),e.jsxs("span",{className:"event-type",children:["Type",e.jsx(P,{idx:2,onMouseDown:m})]}),e.jsxs("span",{className:"event-service",children:["Service",e.jsx(P,{idx:3,onMouseDown:m})]}),e.jsx("span",{className:"event-scope",children:"Scope"})]}),e.jsx("div",{className:"events-table-body",children:N.map(h=>e.jsx(fe,{event:h,schema:t,isExpanded:g||u.has(h.id),onToggle:()=>y(h.id),onContextMenu:S=>b(S,h)},h.id))})]})}function ye(){const{selectedSchemaId:t}=X(),n=X(l=>l.getSelectedSchema()),{fetchEvents:s}=R();return r.useEffect(()=>{t&&s(t)},[t]),e.jsxs("div",{className:"events-view",children:[e.jsxs("div",{className:"events-toolbar",children:[e.jsx(xe,{}),n&&e.jsx(ge,{schema:n})]}),n&&e.jsx(ve,{schema:n}),n?e.jsx(je,{schema:n}):e.jsx("div",{className:"events-empty-state",children:e.jsx("p",{children:"Select a schema to view events."})})]})}const G={gate:"var(--p-symbol-gate)",action:"var(--p-symbol-component)",signal:"var(--p-symbol-signal)"},be={gate:"^",action:"#",signal:"!"};function J(t,n){const s=Date.now();return n.some(l=>l.nodeSymbol===t&&s-new Date(l.timestamp).getTime()<5e3)}function we({flow:t,flowEvents:n,isSelected:s,onSelect:l}){return e.jsxs("div",{className:`flow-card ${s?"selected":""}`,onClick:l,children:[e.jsxs("div",{className:"flow-card-header",children:[e.jsx("span",{className:"flow-card-id",children:t.id}),t.trigger&&e.jsx("span",{className:"flow-card-trigger",children:t.trigger})]}),e.jsx("div",{className:"flow-card-name",children:t.name}),e.jsx("div",{className:"flow-card-steps",children:t.steps.map((a,i)=>{const d=J(a.symbol,n);return e.jsxs("div",{className:"flow-step-mini",children:[i>0&&e.jsx("span",{className:"flow-arrow",children:"โ"}),e.jsx("span",{className:`flow-step-dot ${d?"active pulse":""}`,style:{backgroundColor:d?G[a.type]:"var(--p-text-muted)"},title:`${a.symbol} (${a.type})`})]},i)})})]})}function Se({flow:t,flowEvents:n}){return e.jsxs("div",{className:"flow-diagram",children:[e.jsx("h3",{children:t.name}),t.trigger&&e.jsxs("div",{className:"flow-trigger-label",children:["Trigger: ",e.jsx("code",{children:t.trigger})]}),e.jsx("div",{className:"flow-steps",children:t.steps.map((s,l)=>{const a=J(s.symbol,n),i=n.find(d=>d.nodeSymbol===s.symbol);return e.jsxs("div",{className:"flow-step-container",children:[l>0&&e.jsx("div",{className:"flow-connector",children:e.jsx("div",{className:`flow-line ${a?"active":""}`})}),e.jsxs("div",{className:`flow-step-node ${a?"active":""}`,style:{borderColor:G[s.type]},children:[e.jsx("span",{className:"flow-step-icon",children:be[s.type]}),e.jsx("span",{className:"flow-step-symbol",children:s.symbol}),e.jsx("span",{className:"flow-step-type",children:s.type}),a&&i&&e.jsxs("span",{className:"flow-step-live",children:[i.service," ยท ",new Date(i.timestamp).toLocaleTimeString()]})]})]},l)})})]})}function Ne({symbols:t,onSave:n,onCancel:s}){const[l,a]=r.useState(""),[i,d]=r.useState(""),[f,p]=r.useState([]),u=r.useCallback(v=>{p(m=>[...m,{type:v,symbol:""}])},[]),j=r.useCallback((v,m,y)=>{p(N=>N.map((T,w)=>w===v?{...T,[m]:y}:T))},[]),g=r.useCallback(v=>{p(m=>m.filter((y,N)=>N!==v))},[]),x=()=>{if(!l||f.length===0)return;const v=`$${l.toLowerCase().replace(/\s+/g,"-")}`;n({id:v,name:l,trigger:i||void 0,steps:f})},c=v=>v==="gate"?t.filter(m=>m.type==="gate"):v==="signal"?t.filter(m=>m.type==="signal"):t.filter(m=>m.type==="component");return e.jsxs("div",{className:"flow-composer",children:[e.jsx("h3",{children:"New Flow"}),e.jsxs("div",{className:"composer-field",children:[e.jsx("label",{children:"Flow Name"}),e.jsx("input",{type:"text",placeholder:"e.g. Checkout Flow",value:l,onChange:v=>a(v.target.value)})]}),e.jsxs("div",{className:"composer-field",children:[e.jsx("label",{children:"Trigger (optional)"}),e.jsx("input",{type:"text",placeholder:"e.g. POST /api/checkout",value:i,onChange:v=>d(v.target.value)})]}),e.jsxs("div",{className:"composer-steps",children:[e.jsx("label",{children:"Steps"}),f.map((v,m)=>e.jsxs("div",{className:"composer-step",children:[e.jsxs("select",{value:v.type,onChange:y=>j(m,"type",y.target.value),children:[e.jsx("option",{value:"gate",children:"Gate (^)"}),e.jsx("option",{value:"action",children:"Action (#)"}),e.jsx("option",{value:"signal",children:"Signal (!)"})]}),e.jsxs("select",{value:v.symbol,onChange:y=>j(m,"symbol",y.target.value),children:[e.jsx("option",{value:"",children:"Select symbol..."}),c(v.type).map(y=>e.jsx("option",{value:y.symbol,children:y.symbol},y.symbol))]}),e.jsx("button",{className:"composer-remove",onClick:()=>g(m),children:"ร"})]},m)),e.jsxs("div",{className:"composer-add-buttons",children:[e.jsx("button",{onClick:()=>u("gate"),children:"+ Gate"}),e.jsx("button",{onClick:()=>u("action"),children:"+ Action"}),e.jsx("button",{onClick:()=>u("signal"),children:"+ Signal"})]})]}),e.jsxs("div",{className:"composer-actions",children:[e.jsx("button",{className:"action-btn",onClick:x,disabled:!l||f.length===0,children:"Save Flow"}),e.jsx("button",{className:"action-btn cancel",onClick:s,children:"Cancel"})]})]})}function Ce(){const{flowEvents:t,isLive:n,setIsLive:s}=Q(),[l,a]=r.useState([]),[i,d]=r.useState([]),[f,p]=r.useState(null),[u,j]=r.useState(!1),[g,x]=r.useState(!0),c=l.find(m=>m.id===f);r.useEffect(()=>{async function m(){try{const y=await fetch("/api/sentinel/symbols");if(!y.ok){x(!1);return}const N=await y.json(),T=(N.symbols||[]).map(b=>({symbol:b.symbol,type:b.type}));d(T);const k=(N.symbols||[]).filter(b=>b.type==="flow").map(b=>{var h,S,L;const F=[];if((h=b.data)!=null&&h.steps&&Array.isArray(b.data.steps))for(const C of b.data.steps)F.push({type:C.type||"action",symbol:C.symbol||"",label:C.label});if(F.length===0&&b.references)for(const C of b.references)C.startsWith("^")?F.push({type:"gate",symbol:C}):C.startsWith("!")?F.push({type:"signal",symbol:C}):C.startsWith("#")&&F.push({type:"action",symbol:C});return{id:b.symbol,name:((S=b.data)==null?void 0:S.name)||b.symbol.replace("$",""),trigger:(L=b.data)==null?void 0:L.trigger,steps:F}});a(k),x(!1)}catch{x(!1)}}m()},[]),r.useEffect(()=>(s(!0),()=>s(!1)),[]);const v=m=>{a(y=>[...y,m]),j(!1),p(m.id)};return g?e.jsx("div",{className:"flows-view s-loading-state",children:e.jsxs("div",{className:"s-loading-content",children:[e.jsx("div",{className:"s-loading-spinner"}),e.jsx("p",{children:"Loading flows..."})]})}):e.jsxs("div",{className:"flows-view",children:[e.jsxs("div",{className:"flows-toolbar",children:[e.jsxs("div",{className:"flows-toolbar-left",children:[e.jsxs("span",{className:"flows-count",children:[l.length," flow",l.length!==1?"s":""]}),e.jsxs("button",{className:`logs-live-btn ${n?"active":""}`,onClick:()=>s(!n),children:[e.jsx("span",{className:`live-dot ${n?"live":""}`}),n?"Live":"Paused"]})]}),e.jsx("div",{className:"flows-toolbar-right",children:e.jsx("button",{className:"action-btn",onClick:()=>{j(!0),p(null)},children:"+ New Flow"})})]}),e.jsxs("div",{className:"flows-content",children:[e.jsx("div",{className:"flows-list",children:l.length===0&&!u?e.jsxs("div",{className:"flows-empty",children:[e.jsx("p",{children:"No flows defined."}),e.jsxs("p",{className:"hint",children:["Define flows in ",e.jsx("code",{children:".purpose"})," files or use the composer to create one."]})]}):l.map(m=>e.jsx(we,{flow:m,flowEvents:t,isSelected:f===m.id,onSelect:()=>{p(m.id),j(!1)}},m.id))}),e.jsx("div",{className:"flows-detail",children:u?e.jsx(Ne,{symbols:i,onSave:v,onCancel:()=>j(!1)}):c?e.jsx(Se,{flow:c,flowEvents:t}):e.jsx("div",{className:"flows-empty-detail",children:e.jsx("p",{children:"Select a flow to visualize or create a new one."})})})]})]})}const Ee=[{id:"logs",label:"Logs"},{id:"incidents",label:"Incidents"},{id:"events",label:"Events"},{id:"flows",label:"Flows"}];function Le(){const[t,n]=r.useState("logs");return te(),e.jsxs("div",{className:"sentinel-section",children:[e.jsx("div",{className:"sentinel-tabs",children:Ee.map(s=>e.jsx("button",{className:`sentinel-tab ${t===s.id?"active":""}`,onClick:()=>n(s.id),children:s.label},s.id))}),e.jsxs("div",{className:"sentinel-tab-content",children:[t==="logs"&&e.jsx(oe,{}),t==="incidents"&&e.jsx(de,{}),t==="events"&&e.jsx(ye,{}),t==="flows"&&e.jsx(Ce,{})]})]})}export{Le as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as x,r as j,j as s}from"./index-F0KL9xrN.js";const g=x((e,a)=>({activeAgents:[],benchedAgents:[],rosterLoading:!1,threads:[],threadsLoading:!1,selectedThread:null,fetchRoster:async()=>{e({rosterLoading:!0});try{const t=await fetch("/api/team/roster");if(!t.ok)throw new Error(`HTTP ${t.status}`);const r=await t.json();e({activeAgents:r.active||[],benchedAgents:r.benched||[],rosterLoading:!1})}catch{e({rosterLoading:!1})}},fetchThreads:async()=>{e({threadsLoading:!0});try{const t=await fetch("/api/team/threads");if(!t.ok)throw new Error(`HTTP ${t.status}`);const r=await t.json();e({threads:r.threads||[],threadsLoading:!1})}catch{e({threadsLoading:!1})}},toggleBench:async(t,r)=>{try{const c=await fetch(`/api/team/agents/${t}/bench`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({benched:r})});if(!c.ok)throw new Error(`HTTP ${c.status}`);a().fetchRoster()}catch{}},selectThread:t=>e({selectedThread:t})})),p={architect:"#8b5cf6",builder:"#3b82f6",tester:"#10b981",reviewer:"#f59e0b",security:"#ef4444"};function _(e){return p[e]||`hsl(${Math.abs(b(e))%360}, 60%, 50%)`}function b(e){let a=0;for(let t=0;t<e.length;t++)a=(a<<5)-a+e.charCodeAt(t),a|=0;return a}const N={question:"#3b82f6",context:"#06b6d4",clarification:"#06b6d4",proposal:"#f97316",verification:"#8b5cf6",action:"#10b981",decision:"#eab308",alert:"#ef4444",approval:"#10b981",rejection:"#ef4444",reference:"#6b7280",progress:"#34d399"};function u(e){const a=Date.now()-new Date(e).getTime();return a<6e4?"just now":a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:`${Math.floor(a/864e5)}d ago`}function v(e){if(e.startsWith("[")){const a=e.indexOf("]");if(a>0){const t=e.slice(a+1);return t.startsWith(" ")?t.slice(1):t}}return e}function w(){const{activeAgents:e,benchedAgents:a,rosterLoading:t,threads:r,threadsLoading:c,selectedThread:d,fetchRoster:l,fetchThreads:o,toggleBench:h,selectThread:f}=g();j.useEffect(()=>{l(),o();const n=setInterval(()=>{l(),o()},1e4);return()=>clearInterval(n)},[]);const i=d?r.find(n=>n.id===d):r[0];return s.jsxs("div",{className:"team",children:[s.jsx("h1",{className:"team__title",children:"Team"}),s.jsxs("div",{className:"team__roster",children:[s.jsxs("div",{className:"team__roster-header",children:[s.jsx("span",{className:"team__roster-label",children:"Agent Roster"}),s.jsxs("span",{className:"team__roster-count",children:[e.length," active",a.length>0&&` ยท ${a.length} benched`]})]}),t&&e.length===0?s.jsx("p",{className:"team__empty",children:"Loading roster..."}):e.length===0&&a.length===0?s.jsx("p",{className:"team__empty",children:"No agents registered"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"team__agent-grid",children:e.map(n=>s.jsx(m,{agent:n,onBench:()=>h(n.id,!0)},n.id))}),a.length>0&&s.jsxs("div",{className:"team__benched",children:[s.jsx("div",{className:"team__benched-label",children:"Benched"}),s.jsx("div",{className:"team__agent-grid",children:a.map(n=>s.jsx(m,{agent:n,benched:!0,onActivate:()=>h(n.id,!1)},n.id))})]})]})]}),s.jsxs("div",{className:"team__threads",children:[s.jsxs("div",{className:"team__threads-header",children:[s.jsx("span",{className:"team__roster-label",children:"Team Threads"}),s.jsxs("span",{className:"team__roster-count",children:[r.length," threads"]})]}),c&&r.length===0?s.jsx("p",{className:"team__empty",children:"Loading threads..."}):r.length===0?s.jsx("p",{className:"team__empty",children:"No orchestration threads yet"}):s.jsxs(s.Fragment,{children:[r.length>1&&s.jsx("div",{className:"team__thread-tabs",children:r.map(n=>s.jsxs("button",{className:`team__thread-tab ${(i==null?void 0:i.id)===n.id?"team__thread-tab--active":""}`,onClick:()=>f(n.id),children:[n.displayName," (",n.messages.length,")"]},n.id))}),i&&s.jsx("div",{className:"team__messages",children:i.messages.map(n=>s.jsx(y,{message:n},n.id))})]})]})]})}function m({agent:e,benched:a,onBench:t,onActivate:r}){const c=_(e.id);return s.jsxs("div",{className:`team__agent-card ${a?"team__agent-card--benched":""}`,children:[s.jsxs("div",{className:"team__agent-header",children:[s.jsxs("div",{children:[s.jsx("span",{className:"team__agent-name",style:{color:c},children:e.nickname||e.id}),e.nickname&&s.jsxs("span",{className:"team__agent-nickname",children:["(",e.id,")"]}),s.jsx("div",{className:"team__agent-role",children:e.role})]}),a?s.jsx("button",{className:"team__bench-btn",onClick:r,children:"Activate"}):s.jsx("button",{className:"team__bench-btn",onClick:t,children:"Bench"})]}),s.jsxs("div",{className:"team__agent-stats",children:[s.jsxs("span",{children:[e.expertiseCount," symbols"]}),e.threshold!=null&&s.jsxs("span",{children:["thr: ",e.threshold.toFixed(2)]}),e.topExpertise.length>0&&s.jsxs("span",{className:"team__agent-stat--good",children:["top: ",e.topExpertise[0].symbol," (",Math.round(e.topExpertise[0].confidence*100),"%)"]})]})]})}function y({message:e}){const a=e.sender.role||e.sender.name,t=_(a),r=N[e.intent]||"#6b7280";return s.jsxs("div",{className:"team__message",children:[s.jsxs("div",{className:"team__message-header",children:[s.jsxs("span",{className:"team__message-sender",style:{color:t},children:["[",a,"]"]}),s.jsx("span",{className:"team__message-time",children:u(e.timestamp)})]}),s.jsxs("div",{children:[s.jsx("span",{className:"team__message-intent",style:{color:r,backgroundColor:`${r}20`},children:e.intent}),e.symbols.length>0&&s.jsx("span",{className:"team__message-symbols",children:e.symbols.join(" ")})]}),s.jsx("div",{className:"team__message-text",children:v(e.text)}),e.diff&&s.jsx("div",{className:"team__message-diff",children:e.diff}),e.decision&&s.jsxs("div",{className:"team__message-decision",children:["โ ",e.decision]})]})}export{w as default};
|