@a-company/paradigm 5.38.0 → 6.0.2
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-OATWIRHP.js → accept-orchestration-QQISPINV.js} +1 -1
- package/dist/add-UOR4INIV.js +8 -0
- package/dist/{agent-loader-RIVI6QPP.js → agent-loader-2WJHD46U.js} +1 -1
- package/dist/{agent-loader-RJRVO5GQ.js → agent-loader-YKS2PQWO.js} +1 -1
- package/dist/{ambient-76YMUA5Q.js → ambient-BE3SQXNN.js} +1 -1
- package/dist/{ambient-WTLYUAQM.js → ambient-NVKQCW2A.js} +12 -12
- package/dist/{assess-UFPYEJKP.js → assess-63WXHWJV.js} +1 -1
- package/dist/{calibration-OLJYB5HN.js → calibration-BDHGYJOK.js} +1 -1
- package/dist/{chunk-5QOCKWK5.js → chunk-4PSD5R7N.js} +2 -2
- package/dist/{chunk-HOBHJPTL.js → chunk-6SKSV5B2.js} +1 -1
- package/dist/{chunk-4L7665QV.js → chunk-FEYOQMZ5.js} +1 -1
- package/dist/{chunk-NEJ4ZLCY.js → chunk-GAFKOFAV.js} +1 -1
- package/dist/chunk-GRZQIKST.js +2 -0
- package/dist/{chunk-RLCH7DXQ.js → chunk-K7X3Z3GL.js} +1 -1
- package/dist/{chunk-4VKSEOXZ.js → chunk-LPBCQM5Y.js} +3 -3
- package/dist/{chunk-74SGKSRQ.js → chunk-M2HKWR25.js} +1 -1
- package/dist/{chunk-BOYQAMGC.js → chunk-M3PPXJU4.js} +1 -1
- package/dist/chunk-PHEX6LU4.js +111 -0
- package/dist/chunk-Q527BPUF.js +2 -0
- package/dist/chunk-R5ECMBIV.js +11 -0
- package/dist/{chunk-X3U3IGYT.js → chunk-TBWWFRL5.js} +1 -1
- package/dist/{chunk-MQIG6SMF.js → chunk-TNVWGPCE.js} +1 -1
- package/dist/chunk-TZDYIPVU.js +521 -0
- package/dist/{chunk-3XGNXXCT.js → chunk-UZ5H7K6Q.js} +1 -1
- package/dist/chunk-VIG5LSGZ.js +2 -0
- package/dist/chunk-VNIX5KBT.js +3 -0
- package/dist/{chunk-AGFPVSX5.js → chunk-VXIIVMTM.js} +1 -1
- package/dist/{chunk-ORDKEGII.js → chunk-WESTEMIM.js} +1 -1
- package/dist/{chunk-DOCDDDTD.js → chunk-YNDPSWOE.js} +5 -5
- package/dist/chunk-Z5QW6USC.js +2 -0
- package/dist/{compliance-D7GD6ZYC.js → compliance-BNFWQPKM.js} +1 -1
- package/dist/config-schema-FLHRVZMI.js +2 -0
- package/dist/{context-audit-XRPT3OU2.js → context-audit-JVCA6GSV.js} +1 -1
- package/dist/{cursorrules-U5O4G5T4.js → cursorrules-ZXPXPZ3P.js} +1 -1
- package/dist/decision-loader-HELL2AMX.js +2 -0
- package/dist/{delete-P5VULXR4.js → delete-2C6ALLYY.js} +1 -1
- package/dist/{diff-YGHBIJY5.js → diff-MF55KQZH.js} +1 -1
- package/dist/{dist-KGRCLBJP-2QAPFYNF.js → dist-GQ42YS5N-4HIJZVBB.js} +10 -10
- package/dist/{docs-USDAF26F.js → docs-O37YLLRN.js} +1 -1
- package/dist/doctor-IG5XM4C4.js +2 -0
- package/dist/{edit-GUU3HBVW.js → edit-P3MDAZLU.js} +1 -1
- package/dist/{flow-FVZR3YJ4.js → flow-BGXOVE2V.js} +1 -1
- package/dist/index.js +6 -6
- package/dist/init-M44SO65G.js +2 -0
- package/dist/{init-XYB62Q3X.js → init-V4KSEKPK.js} +1 -1
- package/dist/{list-YKIQNKGB.js → list-2XIWUEMA.js} +1 -1
- package/dist/list-CFHINXIS.js +12 -0
- package/dist/lore-loader-D2ISOASW.js +2 -0
- package/dist/lore-loader-PXFKMKAN.js +2 -0
- package/dist/mcp.js +4 -4
- package/dist/metrics-UESGUHTA.js +2 -0
- package/dist/migrate-assessments-YSITX7KM.js +4 -0
- package/dist/migrate-decisions-NPLQOEEH.js +6 -0
- package/dist/migrate-plsat-EM2ACIQ3.js +6 -0
- package/dist/{nomination-engine-EALA5MGI.js → nomination-engine-QPZJH6XO.js} +1 -1
- package/dist/{notebook-loader-PXNRBBXD.js → notebook-loader-3J2OFMS3.js} +1 -1
- package/dist/{orchestrate-M5PBZBJQ.js → orchestrate-RID7HHHH.js} +1 -1
- package/dist/{platform-server-DNAMH4YI.js → platform-server-UD45NTGV.js} +1 -1
- package/dist/{portal-check-ZMLVBIGW.js → portal-check-DV2VSJ5E.js} +1 -1
- package/dist/portal-compliance-JONQ4SOP.js +2 -0
- package/dist/{probe-3FTG6LYO.js → probe-5HAXULAD.js} +1 -1
- package/dist/{providers-AWA7WLLM.js → providers-4PXMWA7V.js} +1 -1
- package/dist/quiz-WYIZJG5K.js +10 -0
- package/dist/{record-YXPB34MY.js → record-N3VNYYKJ.js} +1 -1
- package/dist/reindex-FWPD2VGM.js +2 -0
- package/dist/{retag-N5XF3KXP.js → retag-72R2OSZV.js} +1 -1
- package/dist/{review-77QI6VOC.js → review-2INNWLTW.js} +1 -1
- package/dist/{sentinel-HYAZ3CO5.js → sentinel-EFPEX246.js} +1 -1
- package/dist/{sentinel-bridge-VR357PKL.js → sentinel-bridge-UR2MKARY.js} +1 -1
- package/dist/{serve-U47GULB6.js → serve-MO35XIZE.js} +1 -1
- package/dist/serve-OQYUO7CR.js +12 -0
- package/dist/{server-4YNUIK4W.js → server-4D77LCST.js} +1 -1
- package/dist/server-FGUL2FWQ.js +7 -0
- package/dist/session-tracker-KGORN6B5.js +2 -0
- package/dist/{session-work-log-PAKXOFGL.js → session-work-log-4IEVE4KK.js} +1 -1
- package/dist/{session-work-log-ZP45TREI.js → session-work-log-EE4UIZ33.js} +1 -1
- package/dist/{setup-FEWSYS3Y.js → setup-ZSEC72BS.js} +1 -1
- package/dist/{shift-PC6C7NUX.js → shift-TVNY2CQF.js} +6 -6
- package/dist/{show-PJ5LFLIL.js → show-JH7LJ5MT.js} +1 -1
- package/dist/show-WVHAL4VU.js +7 -0
- package/dist/{spawn-M5BAV252.js → spawn-UH5RENSE.js} +1 -1
- package/dist/status-S7Z5FVIE.js +6 -0
- package/dist/{summary-PYTEIJ4U.js → summary-WLI3NF4G.js} +2 -2
- package/dist/{sweep-HU74OPVW.js → sweep-7TZFN5NS.js} +1 -1
- package/dist/sync-55U6QPIA.js +2 -0
- package/dist/{sync-llms-7CAI74QL.js → sync-llms-GF7DDQDI.js} +1 -1
- package/dist/{team-PDK64JXI.js → team-MGT66HZQ.js} +1 -1
- package/dist/{timeline-K3ZFKJ3R.js → timeline-RK7O2SCM.js} +1 -1
- package/dist/tools-QJHAVYI6.js +2 -0
- package/dist/university-content/notes/N-para-001-build-something.md +126 -0
- package/dist/university-content/notes/N-para-001-meet-the-team.md +85 -0
- package/dist/university-content/notes/N-para-001-shift-setup.md +74 -0
- package/dist/university-content/notes/N-para-101-component-types.md +99 -0
- package/dist/university-content/notes/N-para-101-first-steps.md +134 -0
- package/dist/university-content/notes/N-para-101-five-symbols.md +128 -0
- package/dist/university-content/notes/N-para-101-paradigm-logger.md +89 -0
- package/dist/university-content/notes/N-para-101-portal-yaml.md +112 -0
- package/dist/university-content/notes/N-para-101-project-structure.md +143 -0
- package/dist/university-content/notes/N-para-101-purpose-files.md +121 -0
- package/dist/university-content/notes/N-para-101-tags-and-classification.md +93 -0
- package/dist/university-content/notes/N-para-101-welcome.md +51 -0
- package/dist/university-content/notes/N-para-201-architecture-review.md +175 -0
- package/dist/university-content/notes/N-para-201-aspect-graph.md +79 -0
- package/dist/university-content/notes/N-para-201-aspects-and-anchors.md +112 -0
- package/dist/university-content/notes/N-para-201-component-patterns.md +138 -0
- package/dist/university-content/notes/N-para-201-cross-cutting-concerns.md +145 -0
- package/dist/university-content/notes/N-para-201-disciplines.md +187 -0
- package/dist/university-content/notes/N-para-201-flows-deep-dive.md +119 -0
- package/dist/university-content/notes/N-para-201-gates-deep-dive.md +165 -0
- package/dist/university-content/notes/N-para-201-portal-protocol.md +133 -0
- package/dist/university-content/notes/N-para-201-signal-patterns.md +159 -0
- package/dist/university-content/notes/N-para-201-symbol-naming.md +149 -0
- package/dist/university-content/notes/N-para-301-context-management.md +53 -0
- package/dist/university-content/notes/N-para-301-decisions.md +99 -0
- package/dist/university-content/notes/N-para-301-doctor-and-validation.md +70 -0
- package/dist/university-content/notes/N-para-301-enforcement-levels.md +102 -0
- package/dist/university-content/notes/N-para-301-fragility-tracking.md +50 -0
- package/dist/university-content/notes/N-para-301-history-system.md +42 -0
- package/dist/university-content/notes/N-para-301-navigation-system.md +55 -0
- package/dist/university-content/notes/N-para-301-operations-review.md +55 -0
- package/dist/university-content/notes/N-para-301-paradigm-shift.md +93 -0
- package/dist/university-content/notes/N-para-301-protocols.md +113 -0
- package/dist/university-content/notes/N-para-301-ripple-analysis.md +53 -0
- package/dist/university-content/notes/N-para-301-sentinel-observability.md +87 -0
- package/dist/university-content/notes/N-para-301-sync-and-maintenance.md +57 -0
- package/dist/university-content/notes/N-para-301-wisdom-system.md +89 -0
- package/dist/university-content/notes/N-para-401-agent-identity.md +99 -0
- package/dist/university-content/notes/N-para-401-agent-interop.md +87 -0
- package/dist/university-content/notes/N-para-401-agent-roles.md +107 -0
- package/dist/university-content/notes/N-para-401-commit-conventions.md +82 -0
- package/dist/university-content/notes/N-para-401-mastery-review.md +71 -0
- package/dist/university-content/notes/N-para-401-mcp-tools-overview.md +102 -0
- package/dist/university-content/notes/N-para-401-multi-agent-coordination.md +80 -0
- package/dist/university-content/notes/N-para-401-notebooks-permissions.md +66 -0
- package/dist/university-content/notes/N-para-401-orchestration-workflow.md +101 -0
- package/dist/university-content/notes/N-para-401-pm-governance.md +71 -0
- package/dist/university-content/notes/N-para-401-provider-cascade.md +75 -0
- package/dist/university-content/notes/N-para-401-quick-check.md +95 -0
- package/dist/university-content/notes/N-para-501-advanced-workflows.md +122 -0
- package/dist/university-content/notes/N-para-501-aspect-graph-advanced.md +195 -0
- package/dist/university-content/notes/N-para-501-aspect-graph-internals.md +97 -0
- package/dist/university-content/notes/N-para-501-assessment-loops.md +116 -0
- package/dist/university-content/notes/N-para-501-conductor-workspace.md +77 -0
- package/dist/university-content/notes/N-para-501-habits-practice.md +164 -0
- package/dist/university-content/notes/N-para-501-hook-enforcement.md +100 -0
- package/dist/university-content/notes/N-para-501-lore-system.md +155 -0
- package/dist/university-content/notes/N-para-501-platform-agent-ui.md +108 -0
- package/dist/university-content/notes/N-para-501-review-compliance.md +72 -0
- package/dist/university-content/notes/N-para-501-sentinel-deep-dive.md +173 -0
- package/dist/university-content/notes/N-para-501-session-intelligence.md +104 -0
- package/dist/university-content/notes/N-para-501-symphony-a-mail.md +120 -0
- package/dist/university-content/notes/N-para-501-symphony-networking.md +119 -0
- package/dist/university-content/notes/N-para-501-task-management.md +100 -0
- package/dist/university-content/notes/N-para-601-agent-renaissance.md +121 -0
- package/dist/university-content/notes/N-para-601-attention-scoring.md +129 -0
- package/dist/university-content/notes/N-para-601-context-composition.md +146 -0
- package/dist/university-content/notes/N-para-601-data-sovereignty.md +140 -0
- package/dist/university-content/notes/N-para-601-event-stream.md +126 -0
- package/dist/university-content/notes/N-para-601-knowledge-streams.md +144 -0
- package/dist/university-content/notes/N-para-601-learning-loop.md +68 -0
- package/dist/university-content/notes/N-para-601-maestro-team-collab.md +136 -0
- package/dist/university-content/notes/N-para-601-nominations-debates.md +115 -0
- package/dist/university-content/notes/N-para-701-agent-notebooks.md +131 -0
- package/dist/university-content/notes/N-para-701-agent-pods-nevrland.md +182 -0
- package/dist/university-content/notes/N-para-701-agent-profiles.md +197 -0
- package/dist/university-content/notes/N-para-701-agent-roster.md +82 -0
- package/dist/university-content/notes/N-para-701-agent-state.md +180 -0
- package/dist/university-content/notes/N-para-701-learning-feedback-loop.md +188 -0
- package/dist/university-content/notes/N-para-701-model-tier-resolution.md +204 -0
- package/dist/university-content/notes/N-para-701-orchestration-enforcement.md +169 -0
- package/dist/university-content/notes/N-para-701-per-project-rosters.md +198 -0
- package/dist/university-content/notes/N-para-701-symphony-visibility.md +142 -0
- package/dist/university-content/paths/LP-para-001.yaml +29 -0
- package/dist/university-content/paths/LP-para-101.yaml +59 -0
- package/dist/university-content/paths/LP-para-201.yaml +69 -0
- package/dist/university-content/paths/LP-para-301.yaml +84 -0
- package/dist/university-content/paths/LP-para-401.yaml +74 -0
- package/dist/university-content/paths/LP-para-501.yaml +89 -0
- package/dist/university-content/paths/LP-para-601.yaml +59 -0
- package/dist/university-content/paths/LP-para-701.yaml +64 -0
- package/dist/university-content/quizzes/Q-para-001-build-something.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-001-meet-the-team.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-001-shift-setup.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-101-component-types.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-101-first-steps.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-101-five-symbols.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-101-paradigm-logger.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-101-portal-yaml.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-101-project-structure.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-101-purpose-files.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-101-tags-and-classification.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-101-welcome.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-201-architecture-review.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-201-aspect-graph.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-201-aspects-and-anchors.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-201-component-patterns.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-201-cross-cutting-concerns.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-201-disciplines.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-201-flows-deep-dive.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-201-gates-deep-dive.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-201-portal-protocol.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-201-signal-patterns.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-201-symbol-naming.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-301-context-management.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-301-decisions.yaml +76 -0
- package/dist/university-content/quizzes/Q-para-301-doctor-and-validation.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-301-enforcement-levels.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-301-fragility-tracking.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-301-history-system.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-301-navigation-system.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-301-operations-review.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-301-paradigm-shift.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-301-protocols.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-301-ripple-analysis.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-301-sentinel-observability.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-301-sync-and-maintenance.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-301-wisdom-system.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-401-agent-identity.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-401-agent-interop.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-401-agent-roles.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-401-commit-conventions.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-401-mastery-review.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-401-mcp-tools-overview.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-401-multi-agent-coordination.yaml +76 -0
- package/dist/university-content/quizzes/Q-para-401-notebooks-permissions.yaml +61 -0
- package/dist/university-content/quizzes/Q-para-401-orchestration-workflow.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-401-pm-governance.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-401-provider-cascade.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-401-quick-check.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-501-advanced-workflows.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-aspect-graph-advanced.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-aspect-graph-internals.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-assessment-loops.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-501-conductor-workspace.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-501-habits-practice.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-501-hook-enforcement.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-lore-system.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-platform-agent-ui.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-review-compliance.yaml +61 -0
- package/dist/university-content/quizzes/Q-para-501-sentinel-deep-dive.yaml +86 -0
- package/dist/university-content/quizzes/Q-para-501-session-intelligence.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-symphony-a-mail.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-symphony-networking.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-501-task-management.yaml +46 -0
- package/dist/university-content/quizzes/Q-para-601-agent-renaissance.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-601-attention-scoring.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-601-context-composition.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-601-data-sovereignty.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-601-event-stream.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-601-knowledge-streams.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-601-learning-loop.yaml +56 -0
- package/dist/university-content/quizzes/Q-para-601-maestro-team-collab.yaml +86 -0
- package/dist/university-content/quizzes/Q-para-601-nominations-debates.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-agent-notebooks.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-agent-pods-nevrland.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-agent-profiles.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-agent-roster.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-agent-state.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-learning-feedback-loop.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-model-tier-resolution.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-orchestration-enforcement.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-per-project-rosters.yaml +66 -0
- package/dist/university-content/quizzes/Q-para-701-symphony-visibility.yaml +66 -0
- package/dist/university-content/quizzes/Q-plsat-v2.yaml +904 -0
- package/dist/university-content/quizzes/Q-plsat-v3.yaml +2909 -0
- package/dist/university-content/reference.json +2 -2
- package/dist/university-ui/assets/{index-CecQrfSn.js → index-nNgzO1il.js} +2 -2
- package/dist/university-ui/assets/{index-CecQrfSn.js.map → index-nNgzO1il.js.map} +1 -1
- package/dist/university-ui/index.html +1 -1
- package/dist/{upgrade-GX56QE3C.js → upgrade-NKN63VTY.js} +2 -2
- package/dist/validate-XUQZTF3H.js +9 -0
- package/dist/{watch-YCODNIET.js → watch-25GJHQYT.js} +1 -1
- package/lore-ui/dist/assets/{index-Bk-K0qgN.js → index-DKhNxgtW.js} +10 -10
- package/lore-ui/dist/index.html +1 -1
- package/package.json +2 -2
- package/platform-ui/dist/assets/{AmbientSection-BYjt75R1.js → AmbientSection-CwatqcBD.js} +1 -1
- package/platform-ui/dist/assets/{CanvasSection-rKvA_vZj.js → CanvasSection-dFAthehN.js} +1 -1
- package/platform-ui/dist/assets/{DocsSection-CI9K73M-.js → DocsSection-BZ2SFJBZ.js} +1 -1
- package/platform-ui/dist/assets/{GitSection-DSGj_c6S.js → GitSection-MNNYU1tO.js} +1 -1
- package/platform-ui/dist/assets/{GraphSection-CawN7pC5.js → GraphSection-COYjb4Pt.js} +1 -1
- package/platform-ui/dist/assets/LoreSection-B0hUbfsJ.js +1 -0
- package/platform-ui/dist/assets/{SentinelSection-DNgoYMH0.js → SentinelSection-BCxW1DCp.js} +1 -1
- package/platform-ui/dist/assets/{SymphonySection-C0zfcqv3.js → SymphonySection-BsucZRqy.js} +1 -1
- package/platform-ui/dist/assets/{TeamSection-Bzd3Dt9Q.js → TeamSection-C0QNTudW.js} +1 -1
- package/platform-ui/dist/assets/{UniversitySection-tBr62R0S.js → UniversitySection-DN1-g9pw.js} +1 -1
- package/platform-ui/dist/assets/{index-BaOmyn11.js → index-DwUT8pju.js} +2 -2
- package/platform-ui/dist/index.html +1 -1
- package/dist/add-P76GEMGF.js +0 -8
- package/dist/chunk-JQKKVAAN.js +0 -2
- package/dist/chunk-NQ47TA6C.js +0 -111
- package/dist/chunk-ODVKPZZ4.js +0 -2
- package/dist/chunk-Q2J542ST.js +0 -2
- package/dist/chunk-RBLK34IA.js +0 -11
- package/dist/chunk-RN4VE6P3.js +0 -521
- package/dist/chunk-WS2N27RX.js +0 -3
- package/dist/config-schema-GUQY2QN7.js +0 -2
- package/dist/decision-loader-2XPZE4EZ.js +0 -2
- package/dist/doctor-WMVULMQD.js +0 -2
- package/dist/list-5IUGP3ZB.js +0 -7
- package/dist/lore-loader-RVQI5GXL.js +0 -2
- package/dist/lore-loader-XY5MZRR2.js +0 -2
- package/dist/migrate-assessments-GEI5WMI2.js +0 -4
- package/dist/portal-compliance-6YR27IQU.js +0 -2
- package/dist/quiz-FE5UGAY2.js +0 -10
- package/dist/reindex-I6LPAKCC.js +0 -2
- package/dist/serve-OY6XYL7F.js +0 -12
- package/dist/server-2MNROHF6.js +0 -7
- package/dist/session-tracker-MWJAJA6Z.js +0 -2
- package/dist/show-BOAVWZPZ.js +0 -7
- package/dist/status-A37ECYNJ.js +0 -6
- package/dist/sync-DLUBV5HQ.js +0 -2
- package/dist/tools-5ITPEPSV.js +0 -2
- package/dist/university-content/courses/.purpose +0 -492
- package/dist/university-content/courses/para-001.json +0 -166
- package/dist/university-content/courses/para-101.json +0 -615
- package/dist/university-content/courses/para-201.json +0 -794
- package/dist/university-content/courses/para-301.json +0 -830
- package/dist/university-content/courses/para-401.json +0 -868
- package/dist/university-content/courses/para-501.json +0 -1166
- package/dist/university-content/courses/para-601.json +0 -719
- package/dist/university-content/courses/para-701.json +0 -807
- package/dist/university-content/plsat/.purpose +0 -162
- package/dist/university-content/plsat/v2.0.json +0 -760
- package/dist/university-content/plsat/v3.0.json +0 -3453
- package/dist/validate-C6SMKGYD.js +0 -9
- package/platform-ui/dist/assets/LoreSection-oO5dCe6O.js +0 -1
- /package/dist/{chunk-BV5PRPLB.js → chunk-IZSBGW6E.js} +0 -0
- /package/templates/paradigm/specs/{scan.md → probe.md} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as R,j as e,r as p,R as S}from"./index-DwUT8pju.js";function L(){try{const s=localStorage.getItem("paradigm-lore-theme");if(s==="light"||s==="dark")return s}catch{}return"dark"}function $(){try{const s=localStorage.getItem("paradigm-lore-left-authors");if(s)return JSON.parse(s)}catch{}return[]}let g=null,v=null,f=null,b=null,y=null,N=null;const d=R((s,r)=>({entries:[],filter:{},view:"timeline",selectedEntryId:null,symbols:[],authors:[],selectedSymbol:null,selectedAuthor:null,sessions:[],selectedSessionId:null,loading:!1,projectName:"",theme:L(),leftAuthors:$(),setView:t=>s({view:t}),setFilter:t=>{s(n=>({filter:{...n.filter,...t}})),r().fetchEntries()},clearFilters:()=>{s({filter:{}}),r().fetchEntries()},selectEntry:t=>s({selectedEntryId:t}),selectSymbol:t=>s({selectedSymbol:t}),selectAuthor:t=>s({selectedAuthor:t}),toggleTheme:()=>{const t=r().theme==="dark"?"light":"dark";document.documentElement.setAttribute("data-theme",t);try{localStorage.setItem("paradigm-lore-theme",t)}catch{}s({theme:t})},toggleLeftAuthor:t=>{const n=r().leftAuthors,i=n.includes(t)?n.filter(a=>a!==t):[...n,t];try{localStorage.setItem("paradigm-lore-left-authors",JSON.stringify(i))}catch{}s({leftAuthors:i})},selectSession:async t=>{if(s({selectedSessionId:t}),t){y==null||y.abort(),y=new AbortController;const{signal:n}=y;try{const a=await(await fetch(`/api/sessions/${encodeURIComponent(t)}`,{signal:n})).json();s(c=>({sessions:c.sessions.map(o=>o.id===t?{...o,entries:a.entries}:o)}))}catch(i){if(i instanceof Error&&i.name==="AbortError")return}}},fetchEntries:async()=>{var n;g==null||g.abort(),g=new AbortController;const{signal:t}=g;s({loading:!0});try{const i=r().filter,a=new URLSearchParams;i.author&&a.set("author",i.author),i.hasAgent!==void 0?a.set("hasAgent",String(i.hasAgent)):i.authorType&&a.set("authorType",i.authorType),i.symbol&&a.set("symbol",i.symbol),i.type&&a.set("type",i.type),i.dateFrom&&a.set("from",i.dateFrom),i.dateTo&&a.set("to",i.dateTo),i.tag&&a.set("tag",i.tag),(n=i.tags)!=null&&n.length&&a.set("tags",i.tags.join(",")),i.hasReview!==void 0&&a.set("hasReview",String(i.hasReview)),i.hasBody!==void 0&&a.set("hasBody",String(i.hasBody)),a.set("limit","200");let m=(await(await fetch(`/api/lore?${a}`,{signal:t})).json()).entries||[];if(i.search){const u=i.search.toLowerCase();m=m.filter(h=>{var x;return h.title.toLowerCase().includes(u)||h.summary.toLowerCase().includes(u)||((x=h.symbols_touched)==null?void 0:x.some(_=>_.toLowerCase().includes(u)))})}s({entries:m,loading:!1})}catch(i){if(i instanceof Error&&i.name==="AbortError")return;s({loading:!1})}},fetchSymbols:async()=>{v==null||v.abort(),v=new AbortController;const{signal:t}=v;try{const i=await(await fetch("/api/lore/symbols",{signal:t})).json();s({symbols:i.symbols||[]})}catch(n){if(n instanceof Error&&n.name==="AbortError")return}},fetchAuthors:async()=>{f==null||f.abort(),f=new AbortController;const{signal:t}=f;try{const i=await(await fetch("/api/lore/authors",{signal:t})).json();s({authors:i.authors||[]})}catch(n){if(n instanceof Error&&n.name==="AbortError")return}},fetchSessions:async()=>{b==null||b.abort(),b=new AbortController;const{signal:t}=b;try{const i=await(await fetch("/api/sessions",{signal:t})).json();s({sessions:i.sessions||[]})}catch(n){if(n instanceof Error&&n.name==="AbortError")return}},fetchAll:async()=>{N==null||N.abort(),N=new AbortController;const{signal:t}=N;try{const i=await(await fetch("/api/info",{signal:t})).json();s({projectName:i.project||""})}catch(n){if(n instanceof Error&&n.name==="AbortError")return}await Promise.all([r().fetchEntries(),r().fetchSymbols(),r().fetchAuthors(),r().fetchSessions()])}})),z=[{mode:"timeline",label:"Timeline"},{mode:"session",label:"Sessions"},{mode:"symbol",label:"Symbol"},{mode:"author",label:"Author"}];function D(){const s=d(t=>t.view),r=d(t=>t.setView);return e.jsx("div",{className:"view-switcher-row",children:e.jsx("div",{className:"view-switcher",children:z.map(t=>e.jsx("button",{className:`view-tab ${s===t.mode?"active":""}`,onClick:()=>r(t.mode),children:t.label},t.mode))})})}const B=["","agent-session","human-note","review","incident","milestone","retro","insight"],I=[{value:void 0,label:"All"},{value:!1,label:"Human Only"},{value:!0,label:"AI-Assisted"}];function V(){const s=d(l=>l.filter),r=d(l=>l.setFilter),t=d(l=>l.clearFilters),n=d(l=>l.authors),i=d(l=>l.symbols),[a,c]=p.useState(""),[o,m]=p.useState(!1),u=p.useRef(null),h=p.useRef(null),[x,_]=p.useState([]),F=Object.values(s).some(l=>l!==void 0&&l!==""&&(Array.isArray(l)?l.length>0:!0)),k=a?i.filter(l=>l.symbol.toLowerCase().includes(a.toLowerCase())).slice(0,10):i.slice(0,10);return p.useEffect(()=>{fetch("/api/lore/tags").then(l=>l.json()).then(l=>_(l.tags||[])).catch(()=>{})},[]),p.useEffect(()=>{function l(C){h.current&&!h.current.contains(C.target)&&u.current&&!u.current.contains(C.target)&&m(!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:I.map(l=>e.jsx("button",{className:`author-type-pill ${s.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:s.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:s.type||"",onChange:l=>r({type:l.target.value||void 0}),children:[e.jsx("option",{value:"",children:"All types"}),B.filter(Boolean).map(l=>e.jsx("option",{value:l,children:l},l))]}),x.length>0&&e.jsxs("select",{value:s.tag||"",onChange:l=>r({tag:l.target.value||void 0}),children:[e.jsx("option",{value:"",children:"All tags"}),x.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:s.symbol?`Symbol: ${s.symbol}`:"Filter by symbol...",value:a,onChange:l=>{c(l.target.value),m(!0)},onFocus:()=>m(!0),style:{width:160}}),s.symbol&&e.jsx("button",{className:"symbol-clear",onClick:()=>{r({symbol:void 0}),c("")},children:"x"}),o&&k.length>0&&e.jsx("div",{className:"symbol-dropdown",ref:h,children:k.map(l=>e.jsxs("div",{className:`symbol-dropdown-item ${s.symbol===l.symbol?"active":""}`,onClick:()=>{r({symbol:l.symbol}),c(""),m(!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:s.search||"",onChange:l=>r({search:l.target.value||void 0}),style:{width:140}}),e.jsx("input",{type:"date",value:s.dateFrom||"",onChange:l=>r({dateFrom:l.target.value||void 0}),title:"From date"}),e.jsx("input",{type:"date",value:s.dateTo||"",onChange:l=>r({dateTo:l.target.value||void 0}),title:"To date"}),e.jsx("button",{className:`filter-preset ${s.hasReview===!1?"active":""}`,onClick:()=>r({hasReview:s.hasReview===!1?void 0:!1}),children:"Needs Review"}),F&&e.jsx("button",{className:"filter-clear",onClick:t,children:"Clear filters"})]})}function O({entry:s}){return 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})]})]}),(s.confidence!=null||s.assessment)&&e.jsxs("dl",{className:"detail-meta",style:{marginTop:12},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:"color-mix(in srgb, var(--p-accent-purple) 15%, transparent)",border:"1px solid color-mix(in srgb, var(--p-accent-purple) 30%, transparent)",borderRadius:10,fontSize:12,color:"var(--p-accent-purple)"},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"?"color-mix(in srgb, var(--p-accent-green) 15%, transparent)":s.assessment.verdict==="partial"?"color-mix(in srgb, var(--p-accent-orange) 15%, transparent)":"color-mix(in srgb, var(--p-accent-red) 15%, transparent)",border:`1px solid ${s.assessment.verdict==="correct"?"color-mix(in srgb, var(--p-accent-green) 30%, transparent)":s.assessment.verdict==="partial"?"color-mix(in srgb, var(--p-accent-orange) 30%, transparent)":"color-mix(in srgb, var(--p-accent-red) 30%, transparent)"}`,borderRadius:10,fontSize:12,color:s.assessment.verdict==="correct"?"var(--p-accent-green)":s.assessment.verdict==="partial"?"var(--p-accent-orange)":"var(--p-accent-red)"},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?"var(--p-accent-green)":Math.abs(s.assessment_delta)<=.3?"var(--p-accent-orange)":"var(--p-accent-red)"},children:[s.assessment_delta>0?"+":"",s.assessment_delta.toFixed(2)," ",e.jsxs("span",{style:{fontSize:11,color:"var(--p-text-muted)"},children:["(",s.assessment_delta>.1?"under-confident":s.assessment_delta<-.1?"over-confident":"well-calibrated",")"]})]})]})]}),s.tags&&s.tags.length>0&&e.jsx("div",{style:{marginTop:12},children:e.jsx("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:s.tags.map(r=>{const t=r.startsWith("arc:");return e.jsxs("span",{style:{padding:"2px 8px",background:t?"color-mix(in srgb, var(--p-lore-milestone) 15%, transparent)":"var(--p-bg-primary)",border:`1px solid ${t?"var(--p-lore-milestone)":"var(--p-border)"}`,borderRadius:12,fontSize:11,color:t?"var(--p-lore-milestone)":"var(--p-text-secondary)"},children:[t?"↻ ":"",r]},r)})})}),s.git_context&&e.jsxs("dl",{className:"detail-meta",style:{marginTop:12},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.jsx("dl",{className:"detail-meta",style:{marginTop:12},children:Object.entries(s.meta).map(([r,t])=>e.jsxs(S.Fragment,{children:[e.jsx("dt",{children:r}),e.jsx("dd",{children:typeof t=="object"?JSON.stringify(t):String(t)})]},r))})]})}const M={"#":"component","^":"gate",$:"flow","!":"signal","~":"aspect"};function j({symbol:s}){const r=s.charAt(0),t=M[r]||"component";return e.jsx("span",{className:`symbol-tag ${t}`,children:s})}function W({entry:s,onSelectEntry:r}){var t,n,i,a;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Summary"}),e.jsx("p",{style:{fontSize:13,color:"var(--p-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(--p-text-secondary)",whiteSpace:"pre-wrap",wordBreak:"break-word",background:"var(--p-bg-primary)",padding:12,borderRadius:6,border:"1px solid var(--p-border)",maxHeight:300,overflowY:"auto"},children:s.body})]}),(t=s.linked_lore)!=null&&t.length||(n=s.linked_tasks)!=null&&n.length||(i=s.linked_commits)!=null&&i.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(c=>e.jsx("span",{onClick:()=>r(c),style:{cursor:"pointer",color:"var(--p-symbol-component)",textDecoration:"underline",marginRight:8,fontSize:12},children:c},c))})]}),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(c=>e.jsx("span",{style:{fontFamily:"monospace",fontSize:12,marginRight:8},children:c},c))})]}),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(c=>e.jsx("span",{style:{fontFamily:"monospace",fontSize:12,marginRight:8},children:c.slice(0,8)},c))})]})]})]}):null,((a=s.symbols_touched)==null?void 0:a.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(c=>e.jsx(j,{symbol:c},c))})]}),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(c=>e.jsx(j,{symbol:c},c))})]}),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((c,o)=>e.jsxs("div",{className:"detail-error",children:[e.jsx("div",{style:{color:"var(--p-lore-incident)",fontSize:13},children:c.description}),e.jsxs("div",{style:{color:"var(--p-text-secondary)",fontSize:12,marginTop:2},children:["→"," ",c.resolution,c.time_to_fix?` (${c.time_to_fix})`:""]})]},o))]}),s.learnings&&s.learnings.length>0&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Learnings"}),s.learnings.map((c,o)=>e.jsx("div",{className:"detail-learning",children:c},o))]})]})}function P({entry:s}){return!s.decisions||s.decisions.length===0?null:e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Decisions"}),s.decisions.map(r=>e.jsxs("div",{className:"detail-decision",children:[e.jsx("div",{className:"decision-text",children:r.decision}),e.jsx("div",{className:"decision-rationale",children:r.rationale})]},r.id))]})}function E({status:s}){if(!s)return null;const r={pass:{icon:"✓",className:"pass"},fail:{icon:"✗",className:"fail"},partial:{icon:"⚠",className:"partial"},untested:{icon:"·",className:""}},t=r[s]||r.untested;return e.jsxs("span",{className:`lore-card-verify ${t.className}`,children:[t.icon," ",s]})}function T({rating:s}){return e.jsxs("span",{className:"review-stars",children:["★".repeat(s),"☆".repeat(5-s)]})}function U({entry:s}){const r=!!s.verification,t=!!s.review;return!r&&!t?null:e.jsxs(e.Fragment,{children:[s.verification&&e.jsxs("div",{className:"detail-section",children:[e.jsx("h3",{children:"Verification"}),e.jsx(E,{status:s.verification.status}),s.verification.details&&e.jsx("dl",{className:"detail-meta",style:{marginTop:8},children:Object.entries(s.verification.details).map(([n,i])=>e.jsxs(S.Fragment,{children:[e.jsx("dt",{children:n}),e.jsx("dd",{style:{color:i==="pass"?"var(--p-accent-green)":"var(--p-accent-red)"},children:i})]},n))})]}),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(T,{rating:s.review.completeness})}),e.jsx("dt",{children:"Quality"}),e.jsx("dd",{children:e.jsx(T,{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(--p-text-muted)",fontSize:13},children:["No review yet. Run ",e.jsxs("code",{style:{background:"var(--p-bg-card)",padding:"2px 4px",borderRadius:3},children:["paradigm lore review ",s.id]})]})]})]})}function Y({entry:s}){var r,t,n,i,a,c;return!((r=s.files_created)!=null&&r.length)&&!((t=s.files_modified)!=null&&t.length)?null:e.jsxs("div",{className:"detail-section",children:[e.jsxs("h3",{children:["Files (",(((n=s.files_created)==null?void 0:n.length)||0)+(((i=s.files_modified)==null?void 0:i.length)||0),")"]}),e.jsxs("ul",{className:"detail-files",children:[(a=s.files_created)==null?void 0:a.map(o=>e.jsxs("li",{style:{color:"var(--p-accent-green)"},children:["+ ",o]},o)),(c=s.files_modified)==null?void 0:c.map(o=>e.jsxs("li",{style:{color:"var(--p-accent-orange)"},children:["~ ",o]},o))]}),s.lines_added||s.lines_removed?e.jsxs("p",{style:{fontSize:12,color:"var(--p-text-muted)",marginTop:4},children:[e.jsxs("span",{style:{color:"var(--p-accent-green)"},children:["+",s.lines_added||0]})," ",e.jsxs("span",{style:{color:"var(--p-accent-red)"},children:["-",s.lines_removed||0]})," lines"]}):null]})}function q(){const s=d(i=>i.selectedEntryId),r=d(i=>i.selectEntry),[t,n]=p.useState(null);return p.useEffect(()=>{if(!s){n(null);return}fetch(`/api/lore/${s}`).then(i=>i.json()).then(n).catch(()=>n(null))},[s]),!s||!t?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:t.title}),e.jsxs("div",{style:{display:"flex",gap:8,marginTop:4,alignItems:"center"},children:[e.jsx("span",{className:`lore-card-type ${t.type}`,children:t.type}),e.jsx("span",{style:{color:"var(--p-text-muted)",fontSize:12},children:t.id})]})]}),e.jsx("button",{className:"detail-close",onClick:()=>r(null),children:"✕"})]}),e.jsxs("div",{className:"detail-body",children:[e.jsx(O,{entry:t}),e.jsx(W,{entry:t,onSelectEntry:r}),e.jsx(Y,{entry:t}),e.jsx(P,{entry:t}),e.jsx(U,{entry:t})]})]})]})}function J(s){return new Date(s).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})}function A({entry:s,side:r="right"}){var c,o,m,u;const t=d(h=>h.selectEntry),n=s.agent!=null,i=(((c=s.files_created)==null?void 0:c.length)||0)+(((o=s.files_modified)==null?void 0:o.length)||0),a=(s.lines_added||0)+(s.lines_removed||0);return e.jsx("div",{className:`lore-card-row ${r} ${n?"agent":"human"}`,children:e.jsxs("div",{className:"lore-card",onClick:()=>t(s.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 s.author=="string"?s.author:"unknown"]})}),e.jsx("span",{className:`lore-card-type ${s.type||"agent-session"}`,children:s.type||"agent-session"})]}),e.jsx("div",{className:"lore-card-title",children:s.title}),e.jsx("div",{className:"lore-card-summary",children:s.summary}),s.body&&e.jsxs("div",{style:{fontSize:11,color:"var(--p-text-muted)",marginTop:4,fontStyle:"italic",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[s.body.slice(0,100),s.body.length>100?"...":""]}),((m=s.symbols_touched)==null?void 0:m.length)>0&&e.jsxs("div",{className:"lore-card-symbols",children:[s.symbols_touched.slice(0,5).map(h=>e.jsx(j,{symbol:h},h)),s.symbols_touched.length>5&&e.jsxs("span",{className:"symbol-tag component",children:["+",s.symbols_touched.length-5]})]}),Array.isArray(s.tags)&&s.tags.some(h=>h.startsWith("arc:"))&&e.jsx("div",{style:{display:"flex",gap:4,marginTop:4,flexWrap:"wrap"},children:s.tags.filter(h=>h.startsWith("arc:")).map(h=>e.jsxs("span",{style:{padding:"1px 6px",background:"color-mix(in srgb, var(--p-lore-milestone) 15%, transparent)",border:"1px solid color-mix(in srgb, var(--p-lore-milestone) 30%, transparent)",borderRadius:10,fontSize:10,color:"var(--p-lore-milestone)"},children:["↻"," ",h]},h))}),e.jsxs("div",{className:"lore-card-footer",children:[e.jsxs("div",{className:"lore-card-stats",children:[i>0&&e.jsxs("span",{children:[i," files"]}),a>0&&e.jsxs("span",{children:[a," loc"]}),s.duration_minutes&&e.jsxs("span",{children:[s.duration_minutes,"m"]}),e.jsx(E,{status:(u=s.verification)==null?void 0:u.status}),s.confidence!=null&&e.jsxs("span",{style:{padding:"1px 5px",background:"color-mix(in srgb, var(--p-accent-purple) 15%, transparent)",border:"1px solid color-mix(in srgb, var(--p-accent-purple) 30%, transparent)",borderRadius:8,fontSize:10,color:"var(--p-accent-purple)"},children:[(s.confidence*100).toFixed(0),"%"]}),s.assessment&&e.jsx("span",{style:{padding:"1px 5px",background:s.assessment.verdict==="correct"?"color-mix(in srgb, var(--p-accent-green) 15%, transparent)":s.assessment.verdict==="partial"?"color-mix(in srgb, var(--p-accent-orange) 15%, transparent)":"color-mix(in srgb, var(--p-accent-red) 15%, transparent)",border:`1px solid ${s.assessment.verdict==="correct"?"color-mix(in srgb, var(--p-accent-green) 30%, transparent)":s.assessment.verdict==="partial"?"color-mix(in srgb, var(--p-accent-orange) 30%, transparent)":"color-mix(in srgb, var(--p-accent-red) 30%, transparent)"}`,borderRadius:8,fontSize:10,color:s.assessment.verdict==="correct"?"var(--p-accent-green)":s.assessment.verdict==="partial"?"var(--p-accent-orange)":"var(--p-accent-red)"},children:s.assessment.verdict})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s.review&&e.jsx(T,{rating:s.review.quality}),e.jsx("span",{children:J(s.timestamp)})]})]})]})})}function Q({date:s,humanCount:r,agentCount:t}){const i=new Date(s).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:i}),e.jsx("span",{className:"date-count agent",children:t})]})}function H(){const s=d(o=>o.entries),r=d(o=>o.authors),t=d(o=>o.leftAuthors),n=d(o=>o.toggleLeftAuthor);if(s.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 i=t.length>0,a=new Map;for(const o of s){const m=o.timestamp.slice(0,10);a.has(m)||a.set(m,[]),a.get(m).push(o)}const c=o=>t.includes(o);return e.jsxs("div",{className:`thread-view ${i?"":"single-column"}`,children:[i&&e.jsx("div",{className:"timeline-spine"}),e.jsx("div",{className:"timeline-column-labels",children:i?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"column-label-group left",children:t.map(o=>e.jsxs("button",{className:"column-author-pill active",onClick:()=>n(o),title:"Remove from left column",children:[o," ×"]},o))}),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(o=>e.jsx("button",{className:"column-author-pill",onClick:()=>n(o.id),children:o.id},o.id))]})}),Array.from(a.entries()).map(([o,m])=>{const u=m.filter(x=>c(x.author)).length,h=m.filter(x=>!c(x.author)).length;return e.jsxs(S.Fragment,{children:[e.jsx(Q,{date:o,humanCount:u,agentCount:h}),m.map(x=>e.jsx(A,{entry:x,side:i&&c(x.author)?"left":"right"},x.id))]},o)})]})}function G(){const s=d(a=>a.symbols),r=d(a=>a.entries),t=d(a=>a.selectedSymbol),n=d(a=>a.selectSymbol),i=d(a=>a.setFilter);return p.useEffect(()=>{i(t?{symbol:t}:{symbol:void 0})},[t]),e.jsxs("div",{className:"sidebar-view",children:[e.jsxs("div",{className:"sidebar",children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--p-border)",fontSize:11,color:"var(--p-text-muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:["Symbols (",s.length,")"]}),s.map(a=>e.jsxs("div",{className:`sidebar-item ${t===a.symbol?"active":""}`,onClick:()=>n(t===a.symbol?null:a.symbol),children:[e.jsx("span",{className:"sidebar-item-name",children:e.jsx(j,{symbol:a.symbol})}),e.jsx("span",{className:"sidebar-item-count",children:a.count})]},a.symbol)),s.length===0&&e.jsx("div",{style:{padding:20,color:"var(--p-text-muted)",textAlign:"center",fontSize:13},children:"No symbols found"})]}),e.jsx("div",{className:"sidebar-content",children:t?e.jsxs(e.Fragment,{children:[e.jsxs("h2",{style:{fontSize:16,marginBottom:16},children:[e.jsx(j,{symbol:t})," entries"]}),r.length===0?e.jsx("div",{style:{color:"var(--p-text-muted)"},children:"No entries for this symbol"}):r.map(a=>e.jsx("div",{style:{marginBottom:12},children:e.jsx(A,{entry:a})},a.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 K(){const s=d(a=>a.authors),r=d(a=>a.entries),t=d(a=>a.selectedAuthor),n=d(a=>a.selectAuthor),i=d(a=>a.setFilter);return p.useEffect(()=>{i(t?{author:t}:{author:void 0})},[t]),e.jsxs("div",{className:"sidebar-view",children:[e.jsxs("div",{className:"sidebar",children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--p-border)",fontSize:11,color:"var(--p-text-muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:["Authors (",s.length,")"]}),s.map(a=>e.jsxs("div",{className:`sidebar-item ${t===a.id?"active":""}`,onClick:()=>n(t===a.id?null:a.id),children:[e.jsxs("div",{children:[e.jsxs("span",{className:"sidebar-item-name",children:[a.hasAgent?"🤖":"👤"," ",a.id]}),e.jsxs("div",{style:{fontSize:10,color:"var(--p-text-muted)",marginTop:2},children:["Last active: ",new Date(a.lastActive).toLocaleDateString()]})]}),e.jsx("span",{className:"sidebar-item-count",children:a.count})]},a.id)),s.length===0&&e.jsx("div",{style:{padding:20,color:"var(--p-text-muted)",textAlign:"center",fontSize:13},children:"No authors found"})]}),e.jsx("div",{className:"sidebar-content",children:t?e.jsxs(e.Fragment,{children:[e.jsxs("h2",{style:{fontSize:16,marginBottom:16},children:[t,"'s entries"]}),r.length===0?e.jsx("div",{style:{color:"var(--p-text-muted)"},children:"No entries for this author"}):r.map(a=>e.jsx("div",{style:{marginBottom:12},children:e.jsx(A,{entry:a})},a.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 w(s){return new Date(s).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})}function X(s,r){const t=new Date(r).getTime()-new Date(s).getTime(),n=Math.round(t/6e4);if(n<60)return`${n}m`;const i=Math.floor(n/60),a=n%60;return a>0?`${i}h ${a}m`:`${i}h`}function Z({session:s,active:r,onClick:t}){var i;const n=s.author.hasAgent;return e.jsxs("div",{className:`sidebar-item session-sidebar-item ${r?"active":""}`,onClick:t,children:[e.jsxs("div",{className:"session-sidebar-info",children:[e.jsxs("span",{className:`session-author-badge ${n?"agent":"human"}`,children:[n?"🤖":"👤"," ",s.author.name]}),e.jsxs("div",{className:"session-sidebar-meta",children:[w(s.startTime),s.startTime!==s.endTime&&` - ${w(s.endTime)}`]})]}),e.jsxs("div",{className:"session-sidebar-stats",children:[e.jsxs("span",{className:"sidebar-item-count",children:[s.entryCount," entries"]}),((i=s.symbolsTouched)==null?void 0:i.length)>0&&e.jsxs("span",{className:"sidebar-item-count",children:[s.symbolsTouched.length," symbols"]})]})]})}function ee({session:s}){var n;const r=X(s.startTime,s.endTime),t=new Date(s.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 ${s.author.hasAgent?"agent":"human"}`,children:[s.author.hasAgent?"🤖":"👤"," ",s.author.name]})}),e.jsxs("div",{className:"session-detail-meta",children:[e.jsx("span",{children:t}),e.jsxs("span",{children:[w(s.startTime)," - ",w(s.endTime)]}),e.jsx("span",{children:r}),e.jsxs("span",{children:[s.entryCount," entries"]})]})]}),((n=s.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:s.symbolsTouched.map(i=>e.jsx(j,{symbol:i},i))})]}),s.breadcrumbs&&s.breadcrumbs.length>0&&e.jsxs("div",{className:"session-detail-section",children:[e.jsx("h3",{children:"Session Breadcrumbs"}),e.jsx("div",{className:"breadcrumb-list",children:s.breadcrumbs.map((i,a)=>e.jsxs("div",{className:"breadcrumb-item",children:[i.phase&&e.jsx("span",{className:"breadcrumb-phase",children:i.phase}),i.context&&e.jsx("span",{className:"breadcrumb-context",children:i.context}),i.timestamp&&e.jsx("span",{className:"breadcrumb-time",children:w(i.timestamp)}),i.decisions&&i.decisions.length>0&&e.jsx("div",{className:"breadcrumb-decisions",children:i.decisions.map((c,o)=>e.jsx("span",{className:"breadcrumb-decision",children:c},o))})]},a))})]}),e.jsxs("div",{className:"session-detail-section",children:[e.jsx("h3",{children:"Lore Entries"}),s.entries?s.entries.map(i=>e.jsx("div",{style:{marginBottom:12},children:e.jsx(A,{entry:i})},i.id)):e.jsx("div",{style:{color:"var(--p-text-muted)",fontSize:13},children:"Loading entries..."})]})]})}function se(){const s=d(a=>a.sessions),r=d(a=>a.selectedSessionId),t=d(a=>a.selectSession),n=s.find(a=>a.id===r),i=new Map;for(const a of s)i.has(a.date)||i.set(a.date,[]),i.get(a.date).push(a);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(--p-border)",fontSize:11,color:"var(--p-text-muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:["Sessions (",s.length,")"]}),s.length===0?e.jsx("div",{style:{padding:20,color:"var(--p-text-muted)",textAlign:"center",fontSize:13},children:"No sessions found"}):Array.from(i.entries()).map(([a,c])=>{const o=new Date(a).toLocaleDateString("en-US",{month:"short",day:"numeric"});return e.jsxs(S.Fragment,{children:[e.jsx("div",{className:"session-date-header",children:o}),c.map(m=>e.jsx(Z,{session:m,active:r===m.id,onClick:()=>t(r===m.id?null:m.id)},m.id))]},a)})]}),e.jsx("div",{className:"sidebar-content",children:n?e.jsx(ee,{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 ae(){const s=d(a=>a.view),r=d(a=>a.entries),t=d(a=>a.projectName),n=d(a=>a.authors),i=d(a=>a.fetchAll);return p.useEffect(()=>{i()},[]),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:s==="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:[t||"project"," · ",r.length," entries · ",n.length," authors"]})]}),e.jsx(D,{})]}),s==="timeline"&&e.jsx(V,{})]}),e.jsxs("main",{style:{flex:1,overflow:"auto",paddingBottom:32},children:[s==="timeline"&&e.jsx(H,{}),s==="session"&&e.jsx(se,{}),s==="symbol"&&e.jsx(G,{}),s==="author"&&e.jsx(K,{})]}),e.jsx(q,{})]})}export{ae as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as _,r,j as e}from"./index-BaOmyn11.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 c=await a.json();t({logs:c.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(c=>c.message.toLowerCase().includes(a)||c.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}),c=await fetch(`/api/sentinel/events?${a}`);if(!c.ok)throw new Error(`Failed to fetch events: ${c.status}`);const d=await c.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 c=await a.json();t({events:c.events||[],total:c.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 h=j=>{const g=l.current;if(!g)return;const v=Math.max(40,g.startW+(j.clientX-g.startX));s(i=>{const x=[...i];return x[g.idx]=v,x})},u=()=>{l.current=null,window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",u)};window.addEventListener("mousemove",h),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:"var(--p-accent-slate)",info:"var(--p-accent-blue)",warn:"var(--p-accent-amber)",error:"var(--p-accent-red)"},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 ce(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 ie({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:ce(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:c=>c.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:c,searchQuery:d,excludedSymbols:f,excludedSymbolTypes:h,excludedMessages:u,excludedServices:j,loadLogs:g,loadServices:v,setIsLive:i,setLevelFilter:x,setServiceFilter:m,setSearchQuery:y,getFilteredLogs:N,clearLogs:T,toggleExcludedSymbol:w,toggleExcludedSymbolType:k,toggleExcludedMessage:b,toggleExcludedService:F,clearAllExclusions:p}=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||h.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(),v(),i(!0),()=>i(!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=>x(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:c||"",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:()=>i(!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}`)),[...h].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:p,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(ie,{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 c=a.symbols;return c.feature===s.symbolFilter||c.component===s.symbolFilter||c.flow===s.symbolFilter||c.gate===s.symbolFilter||c.signal===s.symbolFilter})),l},getSelectedIncident:()=>{const s=n();return s.incidents.find(l=>l.id===s.selectedIncidentId)}})),H={open:"var(--p-accent-red)",investigating:"var(--p-accent-amber)",resolved:"var(--p-accent-green)","wont-fix":"var(--p-text-muted)"},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:c,selectIncident:d,setStatusFilter:f,getFilteredIncidents:h,getSelectedIncident:u,resolveIncident:j}=re(),g=h(),v=u();return r.useEffect(()=>{a(),c()},[]),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:i=>f(i.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(i=>e.jsxs("div",{className:`incident-card ${l===i.id?"selected":""}`,onClick:()=>d(i.id),children:[e.jsxs("div",{className:"incident-header",children:[e.jsx("span",{className:"incident-id",children:i.id}),e.jsx("span",{className:"incident-status",style:{color:H[i.status]},children:B[i.status]})]}),e.jsx("div",{className:"incident-error",children:i.error.message}),e.jsxs("div",{className:"incident-meta",children:[e.jsx("span",{className:"incident-env",children:i.environment}),e.jsx("span",{className:"incident-time",children:new Date(i.timestamp).toLocaleString()})]}),i.symbols&&Object.keys(i.symbols).length>0&&e.jsxs("div",{className:"incident-symbols",children:[i.symbols.component&&e.jsxs("span",{className:"symbol-tag component",children:["#",i.symbols.component]}),i.symbols.flow&&e.jsxs("span",{className:"symbol-tag flow",children:["$",i.symbols.flow]}),i.symbols.gate&&e.jsxs("span",{className:"symbol-tag gate",children:["^",i.symbols.gate]}),i.symbols.signal&&e.jsxs("span",{className:"symbol-tag signal",children:["!",i.symbols.signal]})]}),i.patternMatches&&i.patternMatches.length>0&&e.jsx("div",{className:"incident-patterns",children:e.jsxs("span",{className:"pattern-match",children:["Matched: ",i.patternMatches[0].patternName,"(",Math.round(i.patternMatches[0].confidence),"%)"]})})]},i.id))}),v&&e.jsxs("div",{className:"incident-detail",children:[e.jsxs("div",{className:"detail-header",children:[e.jsx("h2",{children:v.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:v.error.message}),v.error.type&&e.jsxs("div",{className:"error-type",children:["Type: ",v.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[v.status]},children:B[v.status]})]}),e.jsxs("div",{className:"detail-field",children:[e.jsx("label",{children:"Environment"}),e.jsx("span",{children:v.environment})]}),e.jsxs("div",{className:"detail-field",children:[e.jsx("label",{children:"Timestamp"}),e.jsx("span",{children:new Date(v.timestamp).toLocaleString()})]})]}),v.symbols&&Object.keys(v.symbols).length>0&&e.jsxs("section",{className:"detail-section",children:[e.jsx("h3",{children:"Symbols"}),e.jsx("div",{className:"symbols-list",children:Object.entries(v.symbols).map(([i,x])=>x&&e.jsxs("div",{className:"symbol-item",children:[e.jsx("label",{children:i}),e.jsx("span",{className:`symbol-value ${i}`,children:x})]},i))})]}),v.patternMatches&&v.patternMatches.length>0&&e.jsxs("section",{className:"detail-section",children:[e.jsx("h3",{children:"Pattern Matches"}),e.jsx("div",{className:"patterns-list",children:v.patternMatches.map(i=>e.jsxs("div",{className:"pattern-item",children:[e.jsx("div",{className:"pattern-name",children:i.patternName}),e.jsxs("div",{className:"pattern-confidence",children:[Math.round(i.confidence),"% confidence"]})]},i.patternId))})]}),v.status==="open"&&e.jsx("section",{className:"detail-actions",children:e.jsx("button",{className:"action-btn resolve",onClick:()=>j(v.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 h=j=>{const g=l.current;if(!g)return;const v=Math.max(40,g.startW+(j.clientX-g.startX));s(i=>{const x=[...i];return x[g.idx]=v,x})},u=()=>{l.current=null,window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",u)};window.addEventListener("mousemove",h),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:"var(--p-accent-slate)",info:"var(--p-accent-blue)",warn:"var(--p-accent-amber)",error:"var(--p-accent-red)"},pe={logs:"var(--p-accent-blue)",metrics:"var(--p-accent-green)",traces:"var(--p-accent-purple)",incidents:"var(--p-accent-red)",rules:"var(--p-accent-amber)",state:"var(--p-accent-cyan)",cascade:"var(--p-accent-pink)",lifecycle:"var(--p-accent-lime)"};function he(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]:pe[t]||"var(--p-text-muted)"}function ve(){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:c=>s(c.target.value||null),children:t.map(c=>e.jsxs("option",{value:c.id,children:[c.name," (v",c.version,")"]},c.id))})}function xe({schema:t}){const{scopes:n,selectedScope:s,fetchScopes:l,fetchScopeEvents:a,selectScope:c,fetchEvents:d}=R();r.useEffect(()=>{l(t.id)},[t.id]);const f=h=>{s===h?(c(null),d(t.id)):a(t.id,h)};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(h=>e.jsxs("button",{className:`events-scope-chip ${s===h.scopeValue?"active":""}`,onClick:()=>f(h.scopeValue),title:`${h.eventCount} events`,children:[e.jsx("span",{className:"scope-value",children:t.scope.type==="number"?`#${h.scopeValue}`:h.scopeValue}),e.jsx("span",{className:"scope-count",children:h.eventCount})]},h.scopeValue))})]})}function ge({schema:t}){var h;const{events:n,categoryFilter:s,setCategoryFilter:l,excludedTypes:a,toggleExcludedType:c}=R(),d=[...new Set(n.map(u=>u.category))],f=((h=t.visualization)==null?void 0:h.defaultExcluded)||[];return r.useEffect(()=>{for(const u of f)a.has(u)||c(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?"var(--p-bg-primary)":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 c=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:he(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:c},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:c,toggleExcludedType:d,toggleExcludedService:f,clearAllExclusions:h}=R(),[u,j]=r.useState(new Set),[g,v]=r.useState(!1),i=r.useRef(null),{gridTemplate:x,onMouseDown:m}=ue([180,50,200,100]),y=p=>{j(S=>{const L=new Set(S);return L.has(p)?(L.delete(p),v(!1)):L.add(p),L})},N=n.filter(p=>!(s.has(p.eventType)||l.has(p.service)||a&&p.category!==a)),T=s.size>0||l.size>0,[w,k]=r.useState(null),b=r.useCallback((p,S)=>{p.preventDefault(),k({x:p.clientX,y:p.clientY,event:S})},[]);r.useEffect(()=>{if(!w)return;const p=()=>k(null);return window.addEventListener("click",p),()=>window.removeEventListener("click",p)},[w]);const F=()=>{g?(j(new Set),v(!1)):v(!0)};return c?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:i,style:{"--evt-cols":x},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(p=>e.jsxs("span",{className:"exclusion-chip",children:["type: ",p," ",e.jsx("button",{onClick:()=>d(p),children:"×"})]},`type-${p}`)),[...l].map(p=>e.jsxs("span",{className:"exclusion-chip",children:["service: ",p," ",e.jsx("button",{onClick:()=>f(p),children:"×"})]},`svc-${p}`)),e.jsx("button",{className:"exclusion-clear",onClick:h,children:"Clear all"})]}),w&&e.jsxs("div",{className:"context-menu",style:{top:w.y,left:w.x},onClick:p=>p.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(p=>e.jsx(fe,{event:p,schema:t,isExpanded:g||u.has(p.id),onToggle:()=>y(p.id),onContextMenu:S=>b(S,p)},p.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(ve,{}),n&&e.jsx(ge,{schema:n})]}),n&&e.jsx(xe,{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,c)=>{const d=J(a.symbol,n);return e.jsxs("div",{className:"flow-step-mini",children:[c>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})`})]},c)})})]})}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),c=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&&c&&e.jsxs("span",{className:"flow-step-live",children:[c.service," · ",new Date(c.timestamp).toLocaleTimeString()]})]})]},l)})})]})}function Ne({symbols:t,onSave:n,onCancel:s}){const[l,a]=r.useState(""),[c,d]=r.useState(""),[f,h]=r.useState([]),u=r.useCallback(x=>{h(m=>[...m,{type:x,symbol:""}])},[]),j=r.useCallback((x,m,y)=>{h(N=>N.map((T,w)=>w===x?{...T,[m]:y}:T))},[]),g=r.useCallback(x=>{h(m=>m.filter((y,N)=>N!==x))},[]),v=()=>{if(!l||f.length===0)return;const x=`$${l.toLowerCase().replace(/\s+/g,"-")}`;n({id:x,name:l,trigger:c||void 0,steps:f})},i=x=>x==="gate"?t.filter(m=>m.type==="gate"):x==="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:x=>a(x.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:c,onChange:x=>d(x.target.value)})]}),e.jsxs("div",{className:"composer-steps",children:[e.jsx("label",{children:"Steps"}),f.map((x,m)=>e.jsxs("div",{className:"composer-step",children:[e.jsxs("select",{value:x.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:x.symbol,onChange:y=>j(m,"symbol",y.target.value),children:[e.jsx("option",{value:"",children:"Select symbol..."}),i(x.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:v,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([]),[c,d]=r.useState([]),[f,h]=r.useState(null),[u,j]=r.useState(!1),[g,v]=r.useState(!0),i=l.find(m=>m.id===f);r.useEffect(()=>{async function m(){try{const y=await fetch("/api/sentinel/symbols");if(!y.ok){v(!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 p,S,L;const F=[];if((p=b.data)!=null&&p.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),v(!1)}catch{v(!1)}}m()},[]),r.useEffect(()=>(s(!0),()=>s(!1)),[]);const x=m=>{a(y=>[...y,m]),j(!1),h(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),h(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:()=>{h(m.id),j(!1)}},m.id))}),e.jsx("div",{className:"flows-detail",children:u?e.jsx(Ne,{symbols:c,onSave:x,onCancel:()=>j(!1)}):i?e.jsx(Se,{flow:i,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
|
+
import{c as _,r,j as e}from"./index-DwUT8pju.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 c=await a.json();t({logs:c.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(c=>c.message.toLowerCase().includes(a)||c.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}),c=await fetch(`/api/sentinel/events?${a}`);if(!c.ok)throw new Error(`Failed to fetch events: ${c.status}`);const d=await c.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 c=await a.json();t({events:c.events||[],total:c.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 h=j=>{const g=l.current;if(!g)return;const v=Math.max(40,g.startW+(j.clientX-g.startX));s(i=>{const x=[...i];return x[g.idx]=v,x})},u=()=>{l.current=null,window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",u)};window.addEventListener("mousemove",h),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:"var(--p-accent-slate)",info:"var(--p-accent-blue)",warn:"var(--p-accent-amber)",error:"var(--p-accent-red)"},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 ce(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 ie({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:ce(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:c=>c.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:c,searchQuery:d,excludedSymbols:f,excludedSymbolTypes:h,excludedMessages:u,excludedServices:j,loadLogs:g,loadServices:v,setIsLive:i,setLevelFilter:x,setServiceFilter:m,setSearchQuery:y,getFilteredLogs:N,clearLogs:T,toggleExcludedSymbol:w,toggleExcludedSymbolType:k,toggleExcludedMessage:b,toggleExcludedService:F,clearAllExclusions:p}=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||h.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(),v(),i(!0),()=>i(!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=>x(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:c||"",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:()=>i(!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}`)),[...h].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:p,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(ie,{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 c=a.symbols;return c.feature===s.symbolFilter||c.component===s.symbolFilter||c.flow===s.symbolFilter||c.gate===s.symbolFilter||c.signal===s.symbolFilter})),l},getSelectedIncident:()=>{const s=n();return s.incidents.find(l=>l.id===s.selectedIncidentId)}})),H={open:"var(--p-accent-red)",investigating:"var(--p-accent-amber)",resolved:"var(--p-accent-green)","wont-fix":"var(--p-text-muted)"},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:c,selectIncident:d,setStatusFilter:f,getFilteredIncidents:h,getSelectedIncident:u,resolveIncident:j}=re(),g=h(),v=u();return r.useEffect(()=>{a(),c()},[]),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:i=>f(i.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(i=>e.jsxs("div",{className:`incident-card ${l===i.id?"selected":""}`,onClick:()=>d(i.id),children:[e.jsxs("div",{className:"incident-header",children:[e.jsx("span",{className:"incident-id",children:i.id}),e.jsx("span",{className:"incident-status",style:{color:H[i.status]},children:B[i.status]})]}),e.jsx("div",{className:"incident-error",children:i.error.message}),e.jsxs("div",{className:"incident-meta",children:[e.jsx("span",{className:"incident-env",children:i.environment}),e.jsx("span",{className:"incident-time",children:new Date(i.timestamp).toLocaleString()})]}),i.symbols&&Object.keys(i.symbols).length>0&&e.jsxs("div",{className:"incident-symbols",children:[i.symbols.component&&e.jsxs("span",{className:"symbol-tag component",children:["#",i.symbols.component]}),i.symbols.flow&&e.jsxs("span",{className:"symbol-tag flow",children:["$",i.symbols.flow]}),i.symbols.gate&&e.jsxs("span",{className:"symbol-tag gate",children:["^",i.symbols.gate]}),i.symbols.signal&&e.jsxs("span",{className:"symbol-tag signal",children:["!",i.symbols.signal]})]}),i.patternMatches&&i.patternMatches.length>0&&e.jsx("div",{className:"incident-patterns",children:e.jsxs("span",{className:"pattern-match",children:["Matched: ",i.patternMatches[0].patternName,"(",Math.round(i.patternMatches[0].confidence),"%)"]})})]},i.id))}),v&&e.jsxs("div",{className:"incident-detail",children:[e.jsxs("div",{className:"detail-header",children:[e.jsx("h2",{children:v.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:v.error.message}),v.error.type&&e.jsxs("div",{className:"error-type",children:["Type: ",v.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[v.status]},children:B[v.status]})]}),e.jsxs("div",{className:"detail-field",children:[e.jsx("label",{children:"Environment"}),e.jsx("span",{children:v.environment})]}),e.jsxs("div",{className:"detail-field",children:[e.jsx("label",{children:"Timestamp"}),e.jsx("span",{children:new Date(v.timestamp).toLocaleString()})]})]}),v.symbols&&Object.keys(v.symbols).length>0&&e.jsxs("section",{className:"detail-section",children:[e.jsx("h3",{children:"Symbols"}),e.jsx("div",{className:"symbols-list",children:Object.entries(v.symbols).map(([i,x])=>x&&e.jsxs("div",{className:"symbol-item",children:[e.jsx("label",{children:i}),e.jsx("span",{className:`symbol-value ${i}`,children:x})]},i))})]}),v.patternMatches&&v.patternMatches.length>0&&e.jsxs("section",{className:"detail-section",children:[e.jsx("h3",{children:"Pattern Matches"}),e.jsx("div",{className:"patterns-list",children:v.patternMatches.map(i=>e.jsxs("div",{className:"pattern-item",children:[e.jsx("div",{className:"pattern-name",children:i.patternName}),e.jsxs("div",{className:"pattern-confidence",children:[Math.round(i.confidence),"% confidence"]})]},i.patternId))})]}),v.status==="open"&&e.jsx("section",{className:"detail-actions",children:e.jsx("button",{className:"action-btn resolve",onClick:()=>j(v.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 h=j=>{const g=l.current;if(!g)return;const v=Math.max(40,g.startW+(j.clientX-g.startX));s(i=>{const x=[...i];return x[g.idx]=v,x})},u=()=>{l.current=null,window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",u)};window.addEventListener("mousemove",h),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:"var(--p-accent-slate)",info:"var(--p-accent-blue)",warn:"var(--p-accent-amber)",error:"var(--p-accent-red)"},pe={logs:"var(--p-accent-blue)",metrics:"var(--p-accent-green)",traces:"var(--p-accent-purple)",incidents:"var(--p-accent-red)",rules:"var(--p-accent-amber)",state:"var(--p-accent-cyan)",cascade:"var(--p-accent-pink)",lifecycle:"var(--p-accent-lime)"};function he(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]:pe[t]||"var(--p-text-muted)"}function ve(){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:c=>s(c.target.value||null),children:t.map(c=>e.jsxs("option",{value:c.id,children:[c.name," (v",c.version,")"]},c.id))})}function xe({schema:t}){const{scopes:n,selectedScope:s,fetchScopes:l,fetchScopeEvents:a,selectScope:c,fetchEvents:d}=R();r.useEffect(()=>{l(t.id)},[t.id]);const f=h=>{s===h?(c(null),d(t.id)):a(t.id,h)};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(h=>e.jsxs("button",{className:`events-scope-chip ${s===h.scopeValue?"active":""}`,onClick:()=>f(h.scopeValue),title:`${h.eventCount} events`,children:[e.jsx("span",{className:"scope-value",children:t.scope.type==="number"?`#${h.scopeValue}`:h.scopeValue}),e.jsx("span",{className:"scope-count",children:h.eventCount})]},h.scopeValue))})]})}function ge({schema:t}){var h;const{events:n,categoryFilter:s,setCategoryFilter:l,excludedTypes:a,toggleExcludedType:c}=R(),d=[...new Set(n.map(u=>u.category))],f=((h=t.visualization)==null?void 0:h.defaultExcluded)||[];return r.useEffect(()=>{for(const u of f)a.has(u)||c(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?"var(--p-bg-primary)":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 c=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:he(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:c},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:c,toggleExcludedType:d,toggleExcludedService:f,clearAllExclusions:h}=R(),[u,j]=r.useState(new Set),[g,v]=r.useState(!1),i=r.useRef(null),{gridTemplate:x,onMouseDown:m}=ue([180,50,200,100]),y=p=>{j(S=>{const L=new Set(S);return L.has(p)?(L.delete(p),v(!1)):L.add(p),L})},N=n.filter(p=>!(s.has(p.eventType)||l.has(p.service)||a&&p.category!==a)),T=s.size>0||l.size>0,[w,k]=r.useState(null),b=r.useCallback((p,S)=>{p.preventDefault(),k({x:p.clientX,y:p.clientY,event:S})},[]);r.useEffect(()=>{if(!w)return;const p=()=>k(null);return window.addEventListener("click",p),()=>window.removeEventListener("click",p)},[w]);const F=()=>{g?(j(new Set),v(!1)):v(!0)};return c?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:i,style:{"--evt-cols":x},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(p=>e.jsxs("span",{className:"exclusion-chip",children:["type: ",p," ",e.jsx("button",{onClick:()=>d(p),children:"×"})]},`type-${p}`)),[...l].map(p=>e.jsxs("span",{className:"exclusion-chip",children:["service: ",p," ",e.jsx("button",{onClick:()=>f(p),children:"×"})]},`svc-${p}`)),e.jsx("button",{className:"exclusion-clear",onClick:h,children:"Clear all"})]}),w&&e.jsxs("div",{className:"context-menu",style:{top:w.y,left:w.x},onClick:p=>p.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(p=>e.jsx(fe,{event:p,schema:t,isExpanded:g||u.has(p.id),onToggle:()=>y(p.id),onContextMenu:S=>b(S,p)},p.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(ve,{}),n&&e.jsx(ge,{schema:n})]}),n&&e.jsx(xe,{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,c)=>{const d=J(a.symbol,n);return e.jsxs("div",{className:"flow-step-mini",children:[c>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})`})]},c)})})]})}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),c=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&&c&&e.jsxs("span",{className:"flow-step-live",children:[c.service," · ",new Date(c.timestamp).toLocaleTimeString()]})]})]},l)})})]})}function Ne({symbols:t,onSave:n,onCancel:s}){const[l,a]=r.useState(""),[c,d]=r.useState(""),[f,h]=r.useState([]),u=r.useCallback(x=>{h(m=>[...m,{type:x,symbol:""}])},[]),j=r.useCallback((x,m,y)=>{h(N=>N.map((T,w)=>w===x?{...T,[m]:y}:T))},[]),g=r.useCallback(x=>{h(m=>m.filter((y,N)=>N!==x))},[]),v=()=>{if(!l||f.length===0)return;const x=`$${l.toLowerCase().replace(/\s+/g,"-")}`;n({id:x,name:l,trigger:c||void 0,steps:f})},i=x=>x==="gate"?t.filter(m=>m.type==="gate"):x==="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:x=>a(x.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:c,onChange:x=>d(x.target.value)})]}),e.jsxs("div",{className:"composer-steps",children:[e.jsx("label",{children:"Steps"}),f.map((x,m)=>e.jsxs("div",{className:"composer-step",children:[e.jsxs("select",{value:x.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:x.symbol,onChange:y=>j(m,"symbol",y.target.value),children:[e.jsx("option",{value:"",children:"Select symbol..."}),i(x.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:v,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([]),[c,d]=r.useState([]),[f,h]=r.useState(null),[u,j]=r.useState(!1),[g,v]=r.useState(!0),i=l.find(m=>m.id===f);r.useEffect(()=>{async function m(){try{const y=await fetch("/api/sentinel/symbols");if(!y.ok){v(!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 p,S,L;const F=[];if((p=b.data)!=null&&p.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),v(!1)}catch{v(!1)}}m()},[]),r.useEffect(()=>(s(!0),()=>s(!1)),[]);const x=m=>{a(y=>[...y,m]),j(!1),h(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),h(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:()=>{h(m.id),j(!1)}},m.id))}),e.jsx("div",{className:"flows-detail",children:u?e.jsx(Ne,{symbols:c,onSave:x,onCancel:()=>j(!1)}):i?e.jsx(Se,{flow:i,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 +1 @@
|
|
|
1
|
-
import{c as b,r as f,j as e}from"./index-BaOmyn11.js";let u=null,m=null,v=null,p=null,j=null,x=null;const d=b((a,i)=>({agents:[],myIdentity:null,threads:[],activeThreadId:null,activeThread:null,fileRequests:[],status:null,loading:!1,activeTab:"threads",threadFilter:"active",fileFilter:"pending",fetchAgents:async()=>{u==null||u.abort(),u=new AbortController;const{signal:s}=u;try{const t=await fetch("/api/symphony/agents",{signal:s});if(!t.ok)return;const n=await t.json();a({agents:n.agents||[]})}catch(t){if(t instanceof Error&&t.name==="AbortError")return}},fetchMyIdentity:async()=>{m==null||m.abort(),m=new AbortController;const{signal:s}=m;try{const t=await fetch("/api/symphony/agents/me",{signal:s});if(!t.ok)return;const n=await t.json();a({myIdentity:n.identity||null})}catch(t){if(t instanceof Error&&t.name==="AbortError")return}},fetchThreads:async()=>{v==null||v.abort(),v=new AbortController;const{signal:s}=v;try{const t=i().threadFilter,n=t!=="all"?`?status=${t}`:"",c=await fetch(`/api/symphony/threads${n}`,{signal:s});if(!c.ok)return;const r=await c.json();a({threads:r.threads||[]})}catch(t){if(t instanceof Error&&t.name==="AbortError")return}},fetchThread:async s=>{p==null||p.abort(),p=new AbortController;const{signal:t}=p;try{const n=await fetch(`/api/symphony/threads/${s}`,{signal:t});if(!n.ok)return;const c=await n.json();a({activeThreadId:s,activeThread:{thread:c.thread,messages:c.messages||[],symbolsDiscussed:c.symbolsDiscussed||[]}})}catch(n){if(n instanceof Error&&n.name==="AbortError")return}},fetchFileRequests:async()=>{j==null||j.abort(),j=new AbortController;const{signal:s}=j;try{const t=i().fileFilter,n=t!=="all"?`?status=${t}`:"",c=await fetch(`/api/symphony/file-requests${n}`,{signal:s});if(!c.ok)return;const r=await c.json();a({fileRequests:r.fileRequests||[]})}catch(t){if(t instanceof Error&&t.name==="AbortError")return}},fetchStatus:async()=>{x==null||x.abort(),x=new AbortController;const{signal:s}=x;try{const t=await fetch("/api/symphony/status",{signal:s});if(!t.ok)return;const n=await t.json();a({status:n})}catch(t){if(t instanceof Error&&t.name==="AbortError")return}},sendMessage:async s=>{try{const t=await fetch("/api/symphony/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!t.ok)return;const{activeThreadId:n}=i(),r=(await t.json()).threadId||n;r&&await i().fetchThread(r),await i().fetchThreads()}catch{}},resolveThread:async(s,t)=>{try{(await fetch(`/api/symphony/threads/${s}/resolve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:t})})).ok&&(await i().fetchThread(s),await i().fetchThreads())}catch{}},handleFileAction:async(s,t,n)=>{try{(await fetch(`/api/symphony/file-requests/${s}/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,reason:n})})).ok&&await i().fetchFileRequests()}catch{}},setActiveTab:s=>a({activeTab:s}),setActiveThread:s=>{s?i().fetchThread(s):a({activeThreadId:null,activeThread:null})},setThreadFilter:s=>{a({threadFilter:s}),i().fetchThreads()},setFileFilter:s=>{a({fileFilter:s}),i().fetchFileRequests()},handleWsMessage:s=>{if(s.type==="symphony:message"){const{activeThreadId:t,activeThread:n}=i();s.threadId&&s.threadId===t&&n&&s.message&&(n.messages.some(r=>r.id===s.message.id)||a({activeThread:{...n,messages:[...n.messages,s.message]}})),i().fetchThreads()}if(s.type==="symphony:thread_resolved"){const{activeThreadId:t}=i();s.threadId===t&&i().fetchThread(s.threadId),i().fetchThreads()}},refresh:async()=>{a({loading:!0}),await Promise.all([i().fetchThreads(),i().fetchAgents(),i().fetchStatus()]),a({loading:!1})}}));function T(){f.useEffect(()=>{function a(i){const s=i.detail;s!=null&&s.type&&(s.type==="symphony:message"||s.type==="symphony:thread_resolved")&&d.getState().handleWsMessage(s)}return window.addEventListener("symphony-ws",a),()=>window.removeEventListener("symphony-ws",a)},[])}const w={question:"dialogue",context:"dialogue",clarification:"dialogue",verification:"dialogue",reference:"dialogue",proposal:"action",action:"action",decision:"outcome",approval:"outcome",rejection:"outcome",alert:"system",handoff:"lifecycle",fileRequest:"transfer",fileApproved:"transfer",fileDenied:"transfer",fileDelivery:"transfer"};function k(a){return w[a]||"dialogue"}function A(a){const i=Date.now()-new Date(a).getTime(),s=Math.floor(i/1e3);if(s<60)return`${s}s ago`;const t=Math.floor(s/60);if(t<60)return`${t}m ago`;const n=Math.floor(t/60);return n<24?`${n}h ago`:`${Math.floor(n/24)}d ago`}function F(a){return new Date(a).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function I(){const a=d(r=>r.threads),i=d(r=>r.activeThreadId),s=d(r=>r.threadFilter),t=d(r=>r.setActiveThread),n=d(r=>r.setThreadFilter),c=[{id:"active",label:"Active"},{id:"resolved",label:"Resolved"},{id:"all",label:"All"}];return e.jsxs("div",{className:"thread-list-sidebar",children:[e.jsx("div",{className:"thread-list-toolbar",children:c.map(r=>e.jsx("button",{className:`thread-filter-btn ${s===r.id?"active":""}`,onClick:()=>n(r.id),children:r.label},r.id))}),e.jsx("div",{className:"thread-list-items",children:a.length===0?e.jsxs("div",{className:"thread-list-empty",children:["No threads yet.",e.jsx("br",{}),e.jsx("br",{}),"Agents create threads via ",e.jsx("code",{children:"paradigm_symphony_send"})]}):a.map(r=>e.jsxs("div",{className:`thread-card ${i===r.id?"selected":""}`,onClick:()=>t(r.id),children:[e.jsx("div",{className:"thread-card-topic",children:r.topic}),e.jsxs("div",{className:"thread-card-meta",children:[e.jsxs("div",{className:"thread-card-participants",children:[r.participants.slice(0,4).map(h=>e.jsx("span",{className:`participant-avatar ${h.type==="human"?"human":""}`,title:h.name,children:h.name.charAt(0).toUpperCase()},h.id)),r.participants.length>4&&e.jsxs("span",{className:"participant-avatar",style:{background:"var(--p-text-muted)"},children:["+",r.participants.length-4]})]}),e.jsxs("div",{className:"thread-card-stats",children:[e.jsx("span",{className:"thread-card-count",children:r.messageCount}),e.jsx("span",{className:`thread-card-status ${r.status}`,children:r.status}),e.jsx("span",{children:A(r.lastActivity)})]})]})]},r.id))})]})}function R({msg:a}){const[i,s]=f.useState(!1),t=k(a.intent);return e.jsxs("div",{className:"message-bubble",children:[e.jsxs("div",{className:"message-bubble-header",children:[e.jsx("span",{className:"message-sender",children:a.sender.name}),e.jsx("span",{className:`message-sender-type ${a.sender.type}`,children:a.sender.type}),e.jsx("span",{className:`intent-pill ${t}`,children:a.intent})]}),e.jsx("div",{className:"message-text",children:a.text}),a.symbols.length>0&&e.jsx("div",{className:"message-symbols",children:a.symbols.map(n=>e.jsx("span",{className:"message-symbol-tag",children:n},n))}),a.diff&&e.jsxs("div",{className:"message-diff",children:[e.jsx("button",{className:"message-diff-toggle",onClick:()=>s(!i),children:i?"Hide diff":"Show diff"}),i&&e.jsx("pre",{className:"message-diff-content",children:a.diff})]}),a.decision&&e.jsxs("div",{className:"message-decision",children:[e.jsx("div",{className:"message-decision-label",children:"Decision"}),a.decision]}),e.jsx("div",{className:"message-time",children:F(a.timestamp)})]})}const S=["question","context","proposal","decision","action","alert","approval","rejection","reference","clarification","verification"];function $({threadId:a}){const[i,s]=f.useState("question"),[t,n]=f.useState(""),c=d(o=>o.sendMessage);async function r(){const o=t.trim();o&&(await c({intent:i,text:o,threadRoot:a||void 0}),n(""))}function h(o){o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),r())}return e.jsx("div",{className:"compose-box",children:e.jsxs("div",{className:"compose-row",children:[e.jsx("select",{className:"compose-intent-select",value:i,onChange:o=>s(o.target.value),children:S.map(o=>e.jsx("option",{value:o,children:o},o))}),e.jsx("textarea",{className:"compose-textarea",value:t,onChange:o=>n(o.target.value),onKeyDown:h,placeholder:"Type a message... (Enter to send, Shift+Enter for newline)",rows:1}),e.jsx("button",{className:"compose-send-btn",onClick:r,disabled:!t.trim(),children:"Send"})]})})}function C(){const a=d(r=>r.activeThread),i=d(r=>r.activeThreadId),s=d(r=>r.resolveThread),t=f.useRef(null);if(f.useEffect(()=>{var r;(r=t.current)==null||r.scrollIntoView({behavior:"smooth"})},[a==null?void 0:a.messages.length]),!a)return e.jsx("div",{className:"conversation",children:e.jsx("div",{className:"conversation-empty",children:"Select a thread to view"})});const{thread:n,messages:c}=a;return e.jsxs("div",{className:"conversation",children:[e.jsxs("div",{className:"conversation-header",children:[e.jsxs("div",{className:"conversation-header-left",children:[e.jsx("div",{className:"conversation-topic",children:n.topic}),e.jsx("div",{className:"conversation-participants",children:n.participants.map(r=>r.name).join(", ")})]}),e.jsxs("div",{className:"conversation-actions",children:[e.jsx("span",{className:`thread-card-status ${n.status}`,children:n.status}),n.status==="active"&&e.jsx("button",{className:"resolve-btn",onClick:()=>s(i),children:"Resolve"})]})]}),e.jsxs("div",{className:"conversation-messages",children:[c.map(r=>e.jsx(R,{msg:r},r.id)),e.jsx("div",{ref:t})]}),e.jsx($,{threadId:i})]})}function E(){return e.jsxs("div",{className:"threads-layout",children:[e.jsx(I,{}),e.jsx(C,{})]})}function N(a){if(!a)return"never";const i=Date.now()-new Date(a).getTime(),s=Math.floor(i/1e3);if(s<60)return`${s}s ago`;const t=Math.floor(s/60);if(t<60)return`${t}m ago`;const n=Math.floor(t/60);return n<24?`${n}h ago`:`${Math.floor(n/24)}d ago`}function q(){const a=d(s=>s.agents),i=d(s=>s.status);return e.jsxs("div",{className:"network-view",children:[i&&e.jsxs("div",{className:"network-status-bar",children:[e.jsxs("div",{className:"network-stat",children:[e.jsx("div",{className:"network-stat-value",children:i.agentCount}),e.jsx("div",{className:"network-stat-label",children:"Agents"})]}),e.jsxs("div",{className:"network-stat",children:[e.jsx("div",{className:"network-stat-value",style:{color:"var(--p-accent-green)"},children:i.awakeCount}),e.jsx("div",{className:"network-stat-label",children:"Awake"})]}),e.jsxs("div",{className:"network-stat",children:[e.jsx("div",{className:"network-stat-value",children:i.activeThreadCount}),e.jsx("div",{className:"network-stat-label",children:"Active Threads"})]}),e.jsxs("div",{className:"network-stat",children:[e.jsx("div",{className:"network-stat-value",children:i.unreadCount}),e.jsx("div",{className:"network-stat-label",children:"Unread"})]}),e.jsxs("div",{className:"network-stat",children:[e.jsx("div",{className:"network-stat-value",children:i.pendingFileRequests}),e.jsx("div",{className:"network-stat-label",children:"Pending Files"})]})]}),a.length===0?e.jsxs("div",{className:"network-empty",children:[e.jsx("p",{children:"No agents registered."}),e.jsxs("p",{style:{marginTop:8},children:["Run ",e.jsx("code",{children:"paradigm symphony join"})," in a project to register an agent."]})]}):e.jsx("div",{className:"agent-grid",children:a.map(s=>e.jsxs("div",{className:"agent-card",children:[e.jsxs("div",{className:"agent-card-header",children:[e.jsx("span",{className:"agent-card-id",children:s.id}),e.jsx("span",{className:`agent-status-dot ${s.status}`,title:s.status})]}),e.jsx("div",{className:"agent-card-name",children:s.name}),s.statusBlurb&&e.jsx("div",{className:"agent-card-blurb",children:s.statusBlurb}),e.jsxs("div",{className:"agent-card-details",children:[e.jsxs("div",{className:"agent-card-detail",children:[e.jsx("span",{className:"agent-card-detail-label",children:"Project"}),e.jsx("span",{className:"agent-card-detail-value",children:s.project})]}),e.jsxs("div",{className:"agent-card-detail",children:[e.jsx("span",{className:"agent-card-detail-label",children:"Role"}),e.jsx("span",{className:"agent-card-detail-value",children:s.role})]}),e.jsxs("div",{className:"agent-card-detail",children:[e.jsx("span",{className:"agent-card-detail-label",children:"Last Poll"}),e.jsx("span",{className:"agent-card-detail-value",children:N(s.lastPoll)})]}),e.jsxs("div",{className:"agent-card-detail",children:[e.jsx("span",{className:"agent-card-detail-label",children:"Started"}),e.jsx("span",{className:"agent-card-detail-value",children:N(s.startedAt)})]})]})]},s.id))})]})}function g(a){const i=Date.now()-new Date(a).getTime(),s=Math.floor(i/1e3);if(s<60)return`${s}s ago`;const t=Math.floor(s/60);if(t<60)return`${t}m ago`;const n=Math.floor(t/60);return n<24?`${n}h ago`:`${Math.floor(n/24)}d ago`}function D({request:a}){const[i,s]=f.useState(!1),[t,n]=f.useState(""),c=d(h=>h.handleFileAction),r=a.status==="pending";return e.jsxs("div",{className:"file-request-card",children:[e.jsxs("div",{className:"file-request-header",children:[e.jsxs("span",{className:"file-request-path",children:[a.filePath,a.urgency==="urgent"&&e.jsx("span",{className:"urgency-badge urgent",children:"urgent"})]}),e.jsx("span",{className:`file-request-status ${a.status}`,children:a.status})]}),e.jsxs("div",{className:"file-request-requester",children:["From: ",a.requester.name]}),e.jsx("div",{className:"file-request-body",children:a.reason}),a.snippet&&e.jsxs("div",{className:"file-request-snippet",children:["Snippet: ",a.snippet]}),e.jsxs("div",{className:"file-request-meta",children:[e.jsx("span",{children:g(a.createdAt)}),a.resolvedAt&&e.jsxs("span",{children:["Resolved ",g(a.resolvedAt)]}),a.denyReason&&e.jsxs("span",{children:["Reason: ",a.denyReason]})]}),r&&e.jsxs("div",{className:"file-request-actions",children:[e.jsx("button",{className:"file-action-btn approve",onClick:()=>c(a.requestId,"approve"),children:"Approve"}),e.jsx("button",{className:"file-action-btn approve-redacted",onClick:()=>c(a.requestId,"approve-redacted"),children:"Approve (redacted)"}),i?e.jsxs(e.Fragment,{children:[e.jsx("input",{className:"deny-reason-input",value:t,onChange:h=>n(h.target.value),placeholder:"Reason for denial...",onKeyDown:h=>{h.key==="Enter"&&(c(a.requestId,"deny",t||void 0),s(!1),n("")),h.key==="Escape"&&(s(!1),n(""))},autoFocus:!0}),e.jsx("button",{className:"file-action-btn deny",onClick:()=>{c(a.requestId,"deny",t||void 0),s(!1),n("")},children:"Confirm Deny"})]}):e.jsx("button",{className:"file-action-btn deny",onClick:()=>s(!0),children:"Deny"})]})]})}function M(){const a=d(n=>n.fileRequests),i=d(n=>n.fileFilter),s=d(n=>n.setFileFilter),t=[{id:"pending",label:"Pending"},{id:"all",label:"All"}];return e.jsxs("div",{className:"files-view",children:[e.jsxs("div",{className:"files-toolbar",children:[e.jsx("div",{className:"files-filter-group",children:t.map(n=>e.jsx("button",{className:`thread-filter-btn ${i===n.id?"active":""}`,onClick:()=>s(n.id),children:n.label},n.id))}),e.jsxs("span",{className:"files-count",children:[a.length," request",a.length!==1?"s":""]})]}),e.jsx("div",{className:"files-list",children:a.length===0?e.jsxs("div",{className:"files-empty",children:[e.jsx("p",{children:"No file requests."}),e.jsxs("p",{style:{marginTop:8,fontSize:13},children:["Agents request files via ",e.jsx("code",{children:"paradigm_symphony_request_file"})]})]}):a.map(n=>e.jsx(D,{request:n},n.requestId))})]})}const P=[{id:"threads",label:"Threads"},{id:"network",label:"Network"},{id:"files",label:"Files"}];function _(){const a=d(l=>l.activeTab),i=d(l=>l.setActiveTab),s=d(l=>l.refresh),t=d(l=>l.fetchThread),n=d(l=>l.fetchFileRequests),c=d(l=>l.activeThreadId),r=d(l=>l.status);T(),f.useEffect(()=>{s(),d.getState().fetchMyIdentity(),d.getState().fetchFileRequests()},[]);const h=f.useRef(s);h.current=s,f.useEffect(()=>{const l=setInterval(()=>h.current(),1e4);return()=>clearInterval(l)},[]);const o=f.useRef(c);o.current=c;const y=f.useRef(t);return y.current=t,f.useEffect(()=>{const l=setInterval(()=>{o.current&&y.current(o.current)},3e3);return()=>clearInterval(l)},[]),f.useEffect(()=>{if(a!=="files")return;const l=setInterval(()=>n(),1e4);return()=>clearInterval(l)},[a,n]),e.jsxs("div",{className:"symphony-section",children:[e.jsx("div",{className:"symphony-tabs",children:P.map(l=>e.jsxs("button",{className:`symphony-tab ${a===l.id?"active":""}`,onClick:()=>i(l.id),children:[l.label,l.id==="threads"&&r&&r.activeThreadCount>0&&e.jsx("span",{className:"tab-badge",children:r.activeThreadCount}),l.id==="files"&&r&&r.pendingFileRequests>0&&e.jsx("span",{className:"tab-badge",children:r.pendingFileRequests})]},l.id))}),e.jsxs("div",{className:"symphony-tab-content",children:[a==="threads"&&e.jsx(E,{}),a==="network"&&e.jsx(q,{}),a==="files"&&e.jsx(M,{})]})]})}export{_ as default};
|
|
1
|
+
import{c as b,r as f,j as e}from"./index-DwUT8pju.js";let u=null,m=null,v=null,p=null,j=null,x=null;const d=b((a,i)=>({agents:[],myIdentity:null,threads:[],activeThreadId:null,activeThread:null,fileRequests:[],status:null,loading:!1,activeTab:"threads",threadFilter:"active",fileFilter:"pending",fetchAgents:async()=>{u==null||u.abort(),u=new AbortController;const{signal:s}=u;try{const t=await fetch("/api/symphony/agents",{signal:s});if(!t.ok)return;const n=await t.json();a({agents:n.agents||[]})}catch(t){if(t instanceof Error&&t.name==="AbortError")return}},fetchMyIdentity:async()=>{m==null||m.abort(),m=new AbortController;const{signal:s}=m;try{const t=await fetch("/api/symphony/agents/me",{signal:s});if(!t.ok)return;const n=await t.json();a({myIdentity:n.identity||null})}catch(t){if(t instanceof Error&&t.name==="AbortError")return}},fetchThreads:async()=>{v==null||v.abort(),v=new AbortController;const{signal:s}=v;try{const t=i().threadFilter,n=t!=="all"?`?status=${t}`:"",c=await fetch(`/api/symphony/threads${n}`,{signal:s});if(!c.ok)return;const r=await c.json();a({threads:r.threads||[]})}catch(t){if(t instanceof Error&&t.name==="AbortError")return}},fetchThread:async s=>{p==null||p.abort(),p=new AbortController;const{signal:t}=p;try{const n=await fetch(`/api/symphony/threads/${s}`,{signal:t});if(!n.ok)return;const c=await n.json();a({activeThreadId:s,activeThread:{thread:c.thread,messages:c.messages||[],symbolsDiscussed:c.symbolsDiscussed||[]}})}catch(n){if(n instanceof Error&&n.name==="AbortError")return}},fetchFileRequests:async()=>{j==null||j.abort(),j=new AbortController;const{signal:s}=j;try{const t=i().fileFilter,n=t!=="all"?`?status=${t}`:"",c=await fetch(`/api/symphony/file-requests${n}`,{signal:s});if(!c.ok)return;const r=await c.json();a({fileRequests:r.fileRequests||[]})}catch(t){if(t instanceof Error&&t.name==="AbortError")return}},fetchStatus:async()=>{x==null||x.abort(),x=new AbortController;const{signal:s}=x;try{const t=await fetch("/api/symphony/status",{signal:s});if(!t.ok)return;const n=await t.json();a({status:n})}catch(t){if(t instanceof Error&&t.name==="AbortError")return}},sendMessage:async s=>{try{const t=await fetch("/api/symphony/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!t.ok)return;const{activeThreadId:n}=i(),r=(await t.json()).threadId||n;r&&await i().fetchThread(r),await i().fetchThreads()}catch{}},resolveThread:async(s,t)=>{try{(await fetch(`/api/symphony/threads/${s}/resolve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:t})})).ok&&(await i().fetchThread(s),await i().fetchThreads())}catch{}},handleFileAction:async(s,t,n)=>{try{(await fetch(`/api/symphony/file-requests/${s}/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,reason:n})})).ok&&await i().fetchFileRequests()}catch{}},setActiveTab:s=>a({activeTab:s}),setActiveThread:s=>{s?i().fetchThread(s):a({activeThreadId:null,activeThread:null})},setThreadFilter:s=>{a({threadFilter:s}),i().fetchThreads()},setFileFilter:s=>{a({fileFilter:s}),i().fetchFileRequests()},handleWsMessage:s=>{if(s.type==="symphony:message"){const{activeThreadId:t,activeThread:n}=i();s.threadId&&s.threadId===t&&n&&s.message&&(n.messages.some(r=>r.id===s.message.id)||a({activeThread:{...n,messages:[...n.messages,s.message]}})),i().fetchThreads()}if(s.type==="symphony:thread_resolved"){const{activeThreadId:t}=i();s.threadId===t&&i().fetchThread(s.threadId),i().fetchThreads()}},refresh:async()=>{a({loading:!0}),await Promise.all([i().fetchThreads(),i().fetchAgents(),i().fetchStatus()]),a({loading:!1})}}));function T(){f.useEffect(()=>{function a(i){const s=i.detail;s!=null&&s.type&&(s.type==="symphony:message"||s.type==="symphony:thread_resolved")&&d.getState().handleWsMessage(s)}return window.addEventListener("symphony-ws",a),()=>window.removeEventListener("symphony-ws",a)},[])}const w={question:"dialogue",context:"dialogue",clarification:"dialogue",verification:"dialogue",reference:"dialogue",proposal:"action",action:"action",decision:"outcome",approval:"outcome",rejection:"outcome",alert:"system",handoff:"lifecycle",fileRequest:"transfer",fileApproved:"transfer",fileDenied:"transfer",fileDelivery:"transfer"};function k(a){return w[a]||"dialogue"}function A(a){const i=Date.now()-new Date(a).getTime(),s=Math.floor(i/1e3);if(s<60)return`${s}s ago`;const t=Math.floor(s/60);if(t<60)return`${t}m ago`;const n=Math.floor(t/60);return n<24?`${n}h ago`:`${Math.floor(n/24)}d ago`}function F(a){return new Date(a).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function I(){const a=d(r=>r.threads),i=d(r=>r.activeThreadId),s=d(r=>r.threadFilter),t=d(r=>r.setActiveThread),n=d(r=>r.setThreadFilter),c=[{id:"active",label:"Active"},{id:"resolved",label:"Resolved"},{id:"all",label:"All"}];return e.jsxs("div",{className:"thread-list-sidebar",children:[e.jsx("div",{className:"thread-list-toolbar",children:c.map(r=>e.jsx("button",{className:`thread-filter-btn ${s===r.id?"active":""}`,onClick:()=>n(r.id),children:r.label},r.id))}),e.jsx("div",{className:"thread-list-items",children:a.length===0?e.jsxs("div",{className:"thread-list-empty",children:["No threads yet.",e.jsx("br",{}),e.jsx("br",{}),"Agents create threads via ",e.jsx("code",{children:"paradigm_symphony_send"})]}):a.map(r=>e.jsxs("div",{className:`thread-card ${i===r.id?"selected":""}`,onClick:()=>t(r.id),children:[e.jsx("div",{className:"thread-card-topic",children:r.topic}),e.jsxs("div",{className:"thread-card-meta",children:[e.jsxs("div",{className:"thread-card-participants",children:[r.participants.slice(0,4).map(h=>e.jsx("span",{className:`participant-avatar ${h.type==="human"?"human":""}`,title:h.name,children:h.name.charAt(0).toUpperCase()},h.id)),r.participants.length>4&&e.jsxs("span",{className:"participant-avatar",style:{background:"var(--p-text-muted)"},children:["+",r.participants.length-4]})]}),e.jsxs("div",{className:"thread-card-stats",children:[e.jsx("span",{className:"thread-card-count",children:r.messageCount}),e.jsx("span",{className:`thread-card-status ${r.status}`,children:r.status}),e.jsx("span",{children:A(r.lastActivity)})]})]})]},r.id))})]})}function R({msg:a}){const[i,s]=f.useState(!1),t=k(a.intent);return e.jsxs("div",{className:"message-bubble",children:[e.jsxs("div",{className:"message-bubble-header",children:[e.jsx("span",{className:"message-sender",children:a.sender.name}),e.jsx("span",{className:`message-sender-type ${a.sender.type}`,children:a.sender.type}),e.jsx("span",{className:`intent-pill ${t}`,children:a.intent})]}),e.jsx("div",{className:"message-text",children:a.text}),a.symbols.length>0&&e.jsx("div",{className:"message-symbols",children:a.symbols.map(n=>e.jsx("span",{className:"message-symbol-tag",children:n},n))}),a.diff&&e.jsxs("div",{className:"message-diff",children:[e.jsx("button",{className:"message-diff-toggle",onClick:()=>s(!i),children:i?"Hide diff":"Show diff"}),i&&e.jsx("pre",{className:"message-diff-content",children:a.diff})]}),a.decision&&e.jsxs("div",{className:"message-decision",children:[e.jsx("div",{className:"message-decision-label",children:"Decision"}),a.decision]}),e.jsx("div",{className:"message-time",children:F(a.timestamp)})]})}const S=["question","context","proposal","decision","action","alert","approval","rejection","reference","clarification","verification"];function $({threadId:a}){const[i,s]=f.useState("question"),[t,n]=f.useState(""),c=d(o=>o.sendMessage);async function r(){const o=t.trim();o&&(await c({intent:i,text:o,threadRoot:a||void 0}),n(""))}function h(o){o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),r())}return e.jsx("div",{className:"compose-box",children:e.jsxs("div",{className:"compose-row",children:[e.jsx("select",{className:"compose-intent-select",value:i,onChange:o=>s(o.target.value),children:S.map(o=>e.jsx("option",{value:o,children:o},o))}),e.jsx("textarea",{className:"compose-textarea",value:t,onChange:o=>n(o.target.value),onKeyDown:h,placeholder:"Type a message... (Enter to send, Shift+Enter for newline)",rows:1}),e.jsx("button",{className:"compose-send-btn",onClick:r,disabled:!t.trim(),children:"Send"})]})})}function C(){const a=d(r=>r.activeThread),i=d(r=>r.activeThreadId),s=d(r=>r.resolveThread),t=f.useRef(null);if(f.useEffect(()=>{var r;(r=t.current)==null||r.scrollIntoView({behavior:"smooth"})},[a==null?void 0:a.messages.length]),!a)return e.jsx("div",{className:"conversation",children:e.jsx("div",{className:"conversation-empty",children:"Select a thread to view"})});const{thread:n,messages:c}=a;return e.jsxs("div",{className:"conversation",children:[e.jsxs("div",{className:"conversation-header",children:[e.jsxs("div",{className:"conversation-header-left",children:[e.jsx("div",{className:"conversation-topic",children:n.topic}),e.jsx("div",{className:"conversation-participants",children:n.participants.map(r=>r.name).join(", ")})]}),e.jsxs("div",{className:"conversation-actions",children:[e.jsx("span",{className:`thread-card-status ${n.status}`,children:n.status}),n.status==="active"&&e.jsx("button",{className:"resolve-btn",onClick:()=>s(i),children:"Resolve"})]})]}),e.jsxs("div",{className:"conversation-messages",children:[c.map(r=>e.jsx(R,{msg:r},r.id)),e.jsx("div",{ref:t})]}),e.jsx($,{threadId:i})]})}function E(){return e.jsxs("div",{className:"threads-layout",children:[e.jsx(I,{}),e.jsx(C,{})]})}function N(a){if(!a)return"never";const i=Date.now()-new Date(a).getTime(),s=Math.floor(i/1e3);if(s<60)return`${s}s ago`;const t=Math.floor(s/60);if(t<60)return`${t}m ago`;const n=Math.floor(t/60);return n<24?`${n}h ago`:`${Math.floor(n/24)}d ago`}function q(){const a=d(s=>s.agents),i=d(s=>s.status);return e.jsxs("div",{className:"network-view",children:[i&&e.jsxs("div",{className:"network-status-bar",children:[e.jsxs("div",{className:"network-stat",children:[e.jsx("div",{className:"network-stat-value",children:i.agentCount}),e.jsx("div",{className:"network-stat-label",children:"Agents"})]}),e.jsxs("div",{className:"network-stat",children:[e.jsx("div",{className:"network-stat-value",style:{color:"var(--p-accent-green)"},children:i.awakeCount}),e.jsx("div",{className:"network-stat-label",children:"Awake"})]}),e.jsxs("div",{className:"network-stat",children:[e.jsx("div",{className:"network-stat-value",children:i.activeThreadCount}),e.jsx("div",{className:"network-stat-label",children:"Active Threads"})]}),e.jsxs("div",{className:"network-stat",children:[e.jsx("div",{className:"network-stat-value",children:i.unreadCount}),e.jsx("div",{className:"network-stat-label",children:"Unread"})]}),e.jsxs("div",{className:"network-stat",children:[e.jsx("div",{className:"network-stat-value",children:i.pendingFileRequests}),e.jsx("div",{className:"network-stat-label",children:"Pending Files"})]})]}),a.length===0?e.jsxs("div",{className:"network-empty",children:[e.jsx("p",{children:"No agents registered."}),e.jsxs("p",{style:{marginTop:8},children:["Run ",e.jsx("code",{children:"paradigm symphony join"})," in a project to register an agent."]})]}):e.jsx("div",{className:"agent-grid",children:a.map(s=>e.jsxs("div",{className:"agent-card",children:[e.jsxs("div",{className:"agent-card-header",children:[e.jsx("span",{className:"agent-card-id",children:s.id}),e.jsx("span",{className:`agent-status-dot ${s.status}`,title:s.status})]}),e.jsx("div",{className:"agent-card-name",children:s.name}),s.statusBlurb&&e.jsx("div",{className:"agent-card-blurb",children:s.statusBlurb}),e.jsxs("div",{className:"agent-card-details",children:[e.jsxs("div",{className:"agent-card-detail",children:[e.jsx("span",{className:"agent-card-detail-label",children:"Project"}),e.jsx("span",{className:"agent-card-detail-value",children:s.project})]}),e.jsxs("div",{className:"agent-card-detail",children:[e.jsx("span",{className:"agent-card-detail-label",children:"Role"}),e.jsx("span",{className:"agent-card-detail-value",children:s.role})]}),e.jsxs("div",{className:"agent-card-detail",children:[e.jsx("span",{className:"agent-card-detail-label",children:"Last Poll"}),e.jsx("span",{className:"agent-card-detail-value",children:N(s.lastPoll)})]}),e.jsxs("div",{className:"agent-card-detail",children:[e.jsx("span",{className:"agent-card-detail-label",children:"Started"}),e.jsx("span",{className:"agent-card-detail-value",children:N(s.startedAt)})]})]})]},s.id))})]})}function g(a){const i=Date.now()-new Date(a).getTime(),s=Math.floor(i/1e3);if(s<60)return`${s}s ago`;const t=Math.floor(s/60);if(t<60)return`${t}m ago`;const n=Math.floor(t/60);return n<24?`${n}h ago`:`${Math.floor(n/24)}d ago`}function D({request:a}){const[i,s]=f.useState(!1),[t,n]=f.useState(""),c=d(h=>h.handleFileAction),r=a.status==="pending";return e.jsxs("div",{className:"file-request-card",children:[e.jsxs("div",{className:"file-request-header",children:[e.jsxs("span",{className:"file-request-path",children:[a.filePath,a.urgency==="urgent"&&e.jsx("span",{className:"urgency-badge urgent",children:"urgent"})]}),e.jsx("span",{className:`file-request-status ${a.status}`,children:a.status})]}),e.jsxs("div",{className:"file-request-requester",children:["From: ",a.requester.name]}),e.jsx("div",{className:"file-request-body",children:a.reason}),a.snippet&&e.jsxs("div",{className:"file-request-snippet",children:["Snippet: ",a.snippet]}),e.jsxs("div",{className:"file-request-meta",children:[e.jsx("span",{children:g(a.createdAt)}),a.resolvedAt&&e.jsxs("span",{children:["Resolved ",g(a.resolvedAt)]}),a.denyReason&&e.jsxs("span",{children:["Reason: ",a.denyReason]})]}),r&&e.jsxs("div",{className:"file-request-actions",children:[e.jsx("button",{className:"file-action-btn approve",onClick:()=>c(a.requestId,"approve"),children:"Approve"}),e.jsx("button",{className:"file-action-btn approve-redacted",onClick:()=>c(a.requestId,"approve-redacted"),children:"Approve (redacted)"}),i?e.jsxs(e.Fragment,{children:[e.jsx("input",{className:"deny-reason-input",value:t,onChange:h=>n(h.target.value),placeholder:"Reason for denial...",onKeyDown:h=>{h.key==="Enter"&&(c(a.requestId,"deny",t||void 0),s(!1),n("")),h.key==="Escape"&&(s(!1),n(""))},autoFocus:!0}),e.jsx("button",{className:"file-action-btn deny",onClick:()=>{c(a.requestId,"deny",t||void 0),s(!1),n("")},children:"Confirm Deny"})]}):e.jsx("button",{className:"file-action-btn deny",onClick:()=>s(!0),children:"Deny"})]})]})}function M(){const a=d(n=>n.fileRequests),i=d(n=>n.fileFilter),s=d(n=>n.setFileFilter),t=[{id:"pending",label:"Pending"},{id:"all",label:"All"}];return e.jsxs("div",{className:"files-view",children:[e.jsxs("div",{className:"files-toolbar",children:[e.jsx("div",{className:"files-filter-group",children:t.map(n=>e.jsx("button",{className:`thread-filter-btn ${i===n.id?"active":""}`,onClick:()=>s(n.id),children:n.label},n.id))}),e.jsxs("span",{className:"files-count",children:[a.length," request",a.length!==1?"s":""]})]}),e.jsx("div",{className:"files-list",children:a.length===0?e.jsxs("div",{className:"files-empty",children:[e.jsx("p",{children:"No file requests."}),e.jsxs("p",{style:{marginTop:8,fontSize:13},children:["Agents request files via ",e.jsx("code",{children:"paradigm_symphony_request_file"})]})]}):a.map(n=>e.jsx(D,{request:n},n.requestId))})]})}const P=[{id:"threads",label:"Threads"},{id:"network",label:"Network"},{id:"files",label:"Files"}];function _(){const a=d(l=>l.activeTab),i=d(l=>l.setActiveTab),s=d(l=>l.refresh),t=d(l=>l.fetchThread),n=d(l=>l.fetchFileRequests),c=d(l=>l.activeThreadId),r=d(l=>l.status);T(),f.useEffect(()=>{s(),d.getState().fetchMyIdentity(),d.getState().fetchFileRequests()},[]);const h=f.useRef(s);h.current=s,f.useEffect(()=>{const l=setInterval(()=>h.current(),1e4);return()=>clearInterval(l)},[]);const o=f.useRef(c);o.current=c;const y=f.useRef(t);return y.current=t,f.useEffect(()=>{const l=setInterval(()=>{o.current&&y.current(o.current)},3e3);return()=>clearInterval(l)},[]),f.useEffect(()=>{if(a!=="files")return;const l=setInterval(()=>n(),1e4);return()=>clearInterval(l)},[a,n]),e.jsxs("div",{className:"symphony-section",children:[e.jsx("div",{className:"symphony-tabs",children:P.map(l=>e.jsxs("button",{className:`symphony-tab ${a===l.id?"active":""}`,onClick:()=>i(l.id),children:[l.label,l.id==="threads"&&r&&r.activeThreadCount>0&&e.jsx("span",{className:"tab-badge",children:r.activeThreadCount}),l.id==="files"&&r&&r.pendingFileRequests>0&&e.jsx("span",{className:"tab-badge",children:r.pendingFileRequests})]},l.id))}),e.jsxs("div",{className:"symphony-tab-content",children:[a==="threads"&&e.jsx(E,{}),a==="network"&&e.jsx(q,{}),a==="files"&&e.jsx(M,{})]})]})}export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f,r as j,e as u,j as a}from"./index-
|
|
1
|
+
import{c as f,r as j,e as u,j as a}from"./index-DwUT8pju.js";let l=null,o=null;const v=f((e,t)=>({activeAgents:[],benchedAgents:[],rosterLoading:!1,threads:[],threadsLoading:!1,selectedThread:null,fetchRoster:async()=>{l==null||l.abort(),l=new AbortController;const{signal:r}=l;e({rosterLoading:!0});try{const s=await fetch("/api/team/roster",{signal:r});if(!s.ok)throw new Error(`HTTP ${s.status}`);const c=await s.json();e({activeAgents:c.active||[],benchedAgents:c.benched||[],rosterLoading:!1})}catch(s){if(s instanceof Error&&s.name==="AbortError")return;e({rosterLoading:!1})}},fetchThreads:async()=>{o==null||o.abort(),o=new AbortController;const{signal:r}=o;e({threadsLoading:!0});try{const s=await fetch("/api/team/threads",{signal:r});if(!s.ok)throw new Error(`HTTP ${s.status}`);const c=await s.json();e({threads:c.threads||[],threadsLoading:!1})}catch(s){if(s instanceof Error&&s.name==="AbortError")return;e({threadsLoading:!1})}},toggleBench:async(r,s)=>{try{const c=await fetch(`/api/team/agents/${r}/bench`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({benched:s})});if(!c.ok)throw new Error(`HTTP ${c.status}`);t().fetchRoster()}catch{}},selectThread:r=>e({selectedThread:r})})),N={architect:"var(--p-accent-purple)",builder:"var(--p-accent-blue)",tester:"var(--p-accent-green)",reviewer:"var(--p-accent-orange)",security:"var(--p-accent-red)"};function x(e){return N[e]||`hsl(${Math.abs(b(e))%360}, 60%, 50%)`}function b(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}const y={question:"var(--p-accent-blue)",context:"var(--p-accent-cyan)",clarification:"var(--p-accent-cyan)",proposal:"var(--p-accent-orange)",verification:"var(--p-accent-purple)",action:"var(--p-accent-green)",decision:"var(--p-accent-yellow)",alert:"var(--p-accent-red)",approval:"var(--p-accent-green)",rejection:"var(--p-accent-red)",reference:"var(--p-text-muted)",progress:"var(--p-accent-emerald)"};function T(e){const t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}function w(e){if(e.startsWith("[")){const t=e.indexOf("]");if(t>0){const r=e.slice(t+1);return r.startsWith(" ")?r.slice(1):r}}return e}function C(){const{activeAgents:e,benchedAgents:t,rosterLoading:r,threads:s,threadsLoading:c,selectedThread:d,fetchRoster:h,fetchThreads:m,toggleBench:_,selectThread:g}=v();j.useEffect(()=>{h(),m();const n=setInterval(()=>{u.getState().activeSection==="team"&&(h(),m())},1e4);return()=>clearInterval(n)},[]);const i=d?s.find(n=>n.id===d):s[0];return a.jsxs("div",{className:"team",children:[a.jsx("h1",{className:"team__title",children:"Team"}),a.jsxs("div",{className:"team__roster",children:[a.jsxs("div",{className:"team__roster-header",children:[a.jsx("span",{className:"team__roster-label",children:"Agent Roster"}),a.jsxs("span",{className:"team__roster-count",children:[e.length," active",t.length>0&&` · ${t.length} benched`]})]}),r&&e.length===0?a.jsx("p",{className:"team__empty",children:"Loading roster..."}):e.length===0&&t.length===0?a.jsx("p",{className:"team__empty",children:"No agents registered"}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"team__agent-grid",children:e.map(n=>a.jsx(p,{agent:n,onBench:()=>_(n.id,!0)},n.id))}),t.length>0&&a.jsxs("div",{className:"team__benched",children:[a.jsx("div",{className:"team__benched-label",children:"Benched"}),a.jsx("div",{className:"team__agent-grid",children:t.map(n=>a.jsx(p,{agent:n,benched:!0,onActivate:()=>_(n.id,!1)},n.id))})]})]})]}),a.jsxs("div",{className:"team__threads",children:[a.jsxs("div",{className:"team__threads-header",children:[a.jsx("span",{className:"team__roster-label",children:"Team Threads"}),a.jsxs("span",{className:"team__roster-count",children:[s.length," threads"]})]}),c&&s.length===0?a.jsx("p",{className:"team__empty",children:"Loading threads..."}):s.length===0?a.jsx("p",{className:"team__empty",children:"No orchestration threads yet"}):a.jsxs(a.Fragment,{children:[s.length>1&&a.jsx("div",{className:"team__thread-tabs",children:s.map(n=>a.jsxs("button",{className:`team__thread-tab ${(i==null?void 0:i.id)===n.id?"team__thread-tab--active":""}`,onClick:()=>g(n.id),children:[n.displayName," (",n.messages.length,")"]},n.id))}),i&&a.jsx("div",{className:"team__messages",children:i.messages.map(n=>a.jsx(A,{message:n},n.id))})]})]})]})}function p({agent:e,benched:t,onBench:r,onActivate:s}){const c=x(e.id);return a.jsxs("div",{className:`team__agent-card ${t?"team__agent-card--benched":""}`,children:[a.jsxs("div",{className:"team__agent-header",children:[a.jsxs("div",{children:[a.jsx("span",{className:"team__agent-name",style:{color:c},children:e.nickname||e.id}),e.nickname&&a.jsxs("span",{className:"team__agent-nickname",children:["(",e.id,")"]}),a.jsx("div",{className:"team__agent-role",children:e.role})]}),t?a.jsx("button",{className:"team__bench-btn",onClick:s,children:"Activate"}):a.jsx("button",{className:"team__bench-btn",onClick:r,children:"Bench"})]}),a.jsxs("div",{className:"team__agent-stats",children:[a.jsxs("span",{children:[e.expertiseCount," symbols"]}),e.threshold!=null&&a.jsxs("span",{children:["thr: ",e.threshold.toFixed(2)]}),e.topExpertise.length>0&&a.jsxs("span",{className:"team__agent-stat--good",children:["top: ",e.topExpertise[0].symbol," (",Math.round(e.topExpertise[0].confidence*100),"%)"]})]})]})}function A({message:e}){const t=e.sender.role||e.sender.name,r=x(t),s=y[e.intent]||"var(--p-text-muted)";return a.jsxs("div",{className:"team__message",children:[a.jsxs("div",{className:"team__message-header",children:[a.jsxs("span",{className:"team__message-sender",style:{color:r},children:["[",t,"]"]}),a.jsx("span",{className:"team__message-time",children:T(e.timestamp)})]}),a.jsxs("div",{children:[a.jsx("span",{className:"team__message-intent",style:{color:s,backgroundColor:`color-mix(in srgb, ${s} 12%, transparent)`},children:e.intent}),e.symbols.length>0&&a.jsx("span",{className:"team__message-symbols",children:e.symbols.join(" ")})]}),a.jsx("div",{className:"team__message-text",children:w(e.text)}),e.diff&&a.jsx("div",{className:"team__message-diff",children:e.diff}),e.decision&&a.jsxs("div",{className:"team__message-decision",children:["✓ ",e.decision]})]})}export{C as default};
|
package/platform-ui/dist/assets/{UniversitySection-tBr62R0S.js → UniversitySection-DN1-g9pw.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as h,r as m,e as p,j as s}from"./index-
|
|
1
|
+
import{c as h,r as m,e as p,j as s}from"./index-DwUT8pju.js";let n=null;const x=h((e,t)=>({courses:[],plsatVersions:[],diplomas:[],coursesLoading:!1,selectedCourse:null,fetchCourses:async()=>{n==null||n.abort(),n=new AbortController,e({coursesLoading:!0});try{const a=await fetch("/api/university/courses",{signal:n.signal});if(!a.ok)throw new Error(`HTTP ${a.status}`);const i=await a.json();e({courses:i.courses||[],coursesLoading:!1})}catch(a){a instanceof Error&&a.name==="AbortError"||e({coursesLoading:!1})}},fetchPlsat:async()=>{try{const a=await fetch("/api/university/plsat");if(!a.ok)return;const i=await a.json();e({plsatVersions:i.versions||[]})}catch{}},fetchDiplomas:async()=>{try{const a=await fetch("/api/university/diplomas");if(!a.ok)return;const i=await a.json();e({diplomas:i.diplomas||[]})}catch{}},selectCourse:a=>e({selectedCourse:a})}));function j({course:e,onSelect:t}){return s.jsxs("div",{className:"u-course-card",onClick:t,role:"button",tabIndex:0,onKeyDown:a=>a.key==="Enter"&&t(),children:[s.jsxs("div",{className:"u-course-header",children:[s.jsx("span",{className:"u-course-id",children:e.id}),s.jsxs("span",{className:"u-course-meta",children:[e.lessonCount," lessons",e.quizCount>0?` · ${e.quizCount} quizzes`:""]})]}),s.jsx("h3",{className:"u-course-title",children:e.title}),s.jsx("p",{className:"u-course-desc",children:e.description})]})}function f({version:e}){return s.jsxs("div",{className:"u-plsat-card",children:[s.jsxs("div",{className:"u-plsat-header",children:[s.jsxs("span",{className:"u-plsat-version",children:["PLSAT ",e.version]}),e.passThreshold&&s.jsxs("span",{className:"u-plsat-threshold",children:["Pass: ",e.passThreshold,"%"]})]}),s.jsxs("div",{className:"u-plsat-meta",children:[e.questionCount," questions",e.timeLimit?` · ${e.timeLimit} min`:"",e.frameworkVersion?` · Framework ${e.frameworkVersion}`:""]})]})}function N({diploma:e}){return s.jsxs("div",{className:`u-diploma-card ${e.passed?"u-diploma-passed":"u-diploma-failed"}`,children:[s.jsxs("div",{className:"u-diploma-header",children:[s.jsx("span",{className:"u-diploma-type",children:e.type.toUpperCase()}),s.jsx("span",{className:"u-diploma-date",children:new Date(e.earnedAt).toLocaleDateString()})]}),s.jsxs("div",{className:"u-diploma-score",children:[e.score,"/",e.total," (",e.percentage,"%)",e.passed?" — Passed":" — Not passed"]})]})}function C(){const{courses:e,plsatVersions:t,diplomas:a,coursesLoading:i,selectedCourse:v,fetchCourses:l,fetchPlsat:o,fetchDiplomas:c,selectCourse:d}=x();return m.useEffect(()=>{l(),o(),c();const r=setInterval(()=>{p.getState().activeSection==="university"&&c()},3e4);return()=>clearInterval(r)},[]),s.jsxs("div",{className:"u-section",children:[s.jsxs("div",{className:"u-header",children:[s.jsx("h1",{children:"University"}),s.jsx("span",{className:"u-subtitle",children:"Courses, certifications, and learning paths"})]}),a.length>0&&s.jsxs("div",{className:"u-block",children:[s.jsx("h2",{children:"Earned Diplomas"}),s.jsx("div",{className:"u-grid",children:a.map((r,u)=>s.jsx(N,{diploma:r},r.id||u))})]}),s.jsxs("div",{className:"u-block",children:[s.jsx("h2",{children:"Courses"}),i&&s.jsx("p",{className:"u-loading",children:"Loading courses..."}),!i&&e.length===0&&s.jsxs("p",{className:"u-empty",children:["No courses available. Run ",s.jsx("code",{children:"paradigm university"})," to set up content."]}),s.jsx("div",{className:"u-grid",children:e.map(r=>s.jsx(j,{course:r,onSelect:()=>d(r.id)},r.id))})]}),t.length>0&&s.jsxs("div",{className:"u-block",children:[s.jsx("h2",{children:"PLSAT Certification Exams"}),s.jsx("div",{className:"u-grid",children:t.map(r=>s.jsx(f,{version:r},r.version))})]})]})}export{C as default};
|