create-principles-disciple 1.82.0 → 1.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/console/dist/server/config/pd-config-store.d.ts +135 -0
- package/console/dist/server/config/pd-config-store.js +660 -0
- package/console/dist/server/index.js +40 -389
- package/console/dist/server/models/ActivationsConsoleModel.d.ts +33 -0
- package/console/dist/server/models/ActivationsConsoleModel.js +112 -0
- package/console/dist/server/models/ApprovalsConsoleModel.d.ts +5 -0
- package/console/dist/server/models/ApprovalsConsoleModel.js +14 -0
- package/console/dist/server/models/ApprovalsGroupedConsoleModel.d.ts +25 -0
- package/console/dist/server/models/ApprovalsGroupedConsoleModel.js +126 -0
- package/console/dist/server/models/ConsoleLifecycleDatasource.d.ts +13 -0
- package/console/dist/server/models/ConsoleLifecycleDatasource.js +73 -0
- package/console/dist/server/models/EvidenceChainConsoleModel.d.ts +58 -0
- package/console/dist/server/models/EvidenceChainConsoleModel.js +493 -0
- package/console/dist/server/models/GovernanceConsoleModel.d.ts +74 -0
- package/console/dist/server/models/GovernanceConsoleModel.js +246 -0
- package/console/dist/server/models/HealthCheckModel.d.ts +0 -4
- package/console/dist/server/models/HealthCheckModel.js +49 -80
- package/console/dist/server/models/LifecycleConsoleModel.d.ts +19 -0
- package/console/dist/server/models/LifecycleConsoleModel.js +55 -0
- package/console/dist/server/models/PrincipleClassifier.d.ts +41 -0
- package/console/dist/server/models/PrincipleClassifier.js +100 -0
- package/console/dist/server/models/PrinciplesConsoleModel.d.ts +12 -1
- package/console/dist/server/models/PrinciplesConsoleModel.js +53 -6
- package/console/dist/server/models/WorkspaceService.d.ts +2 -1
- package/console/dist/server/models/WorkspaceService.js +51 -23
- package/console/dist/server/routes/activations.d.ts +3 -0
- package/console/dist/server/routes/activations.js +111 -0
- package/console/dist/server/routes/approvals-grouped.d.ts +3 -0
- package/console/dist/server/routes/approvals-grouped.js +32 -0
- package/console/dist/server/routes/approvals.js +28 -4
- package/console/dist/server/routes/config.d.ts +27 -0
- package/console/dist/server/routes/config.js +213 -0
- package/console/dist/server/routes/evidence-chain.d.ts +9 -0
- package/console/dist/server/routes/evidence-chain.js +32 -0
- package/console/dist/server/routes/governance.d.ts +3 -0
- package/console/dist/server/routes/governance.js +32 -0
- package/console/dist/server/routes/{evolution.d.ts → lifecycle.d.ts} +2 -2
- package/console/dist/server/routes/lifecycle.js +48 -0
- package/console/dist/server/routes/principles.js +74 -1
- package/console/dist/server/routes/workspaces.js +8 -1
- package/console/dist/server/utils/response.d.ts +1 -1
- package/console/dist/server/utils/response.js +6 -2
- package/console/dist/types.d.ts +1 -0
- package/console/dist/ui/App.js +116 -40
- package/console/dist/ui/api.d.ts +88 -501
- package/console/dist/ui/api.js +139 -162
- package/console/dist/ui/components/approval-card.js +1 -1
- package/console/dist/ui/components/approval-detail-dialog.js +1 -1
- package/console/dist/ui/components/auth/login-form.d.ts +3 -0
- package/console/dist/ui/components/auth/login-form.js +36 -0
- package/console/dist/ui/components/auth/splash-screen.d.ts +8 -0
- package/console/dist/ui/components/auth/splash-screen.js +22 -0
- package/console/dist/ui/components/layout/app-sidebar.d.ts +1 -0
- package/console/dist/ui/components/layout/app-sidebar.js +56 -0
- package/console/dist/ui/components/layout/page-shell.d.ts +11 -0
- package/console/dist/ui/components/layout/page-shell.js +10 -0
- package/console/dist/ui/components/layout/section-title.d.ts +10 -0
- package/console/dist/ui/components/layout/section-title.js +9 -0
- package/console/dist/ui/components/theme-provider.d.ts +1 -1
- package/console/dist/ui/components/theme-provider.js +13 -8
- package/console/dist/ui/components/theme-toggle.js +2 -21
- package/console/dist/ui/components/ui/badge.d.ts +1 -1
- package/console/dist/ui/components/ui/badge.js +7 -5
- package/console/dist/ui/components/ui/button.d.ts +2 -2
- package/console/dist/ui/components/ui/button.js +12 -11
- package/console/dist/ui/components/ui/card.js +6 -6
- package/console/dist/ui/components/ui/sheet.d.ts +1 -1
- package/console/dist/ui/i18n/en.json +401 -343
- package/console/dist/ui/i18n/index.js +2 -2
- package/console/dist/ui/i18n/zh-CN.json +406 -348
- package/console/dist/ui/main.d.ts +1 -1
- package/console/dist/ui/main.js +1 -0
- package/console/dist/ui/pages/activation/ActivationPage.d.ts +1 -0
- package/console/dist/ui/pages/activation/ActivationPage.js +150 -0
- package/console/dist/ui/pages/activation/ActivationValidators.d.ts +20 -0
- package/console/dist/ui/pages/activation/ActivationValidators.js +156 -0
- package/console/dist/ui/pages/control-center/ControlCenterPage.d.ts +1 -0
- package/console/dist/ui/pages/control-center/ControlCenterPage.js +447 -0
- package/console/dist/ui/pages/debt/DebtPage.d.ts +1 -0
- package/console/dist/ui/pages/debt/DebtPage.js +5 -0
- package/console/dist/ui/pages/design-system/DesignSystemPage.d.ts +1 -0
- package/console/dist/ui/pages/design-system/DesignSystemPage.js +30 -0
- package/console/dist/ui/pages/focus/FocusPage.d.ts +1 -0
- package/console/dist/ui/pages/focus/FocusPage.js +265 -0
- package/console/dist/ui/pages/pain/PainEvidenceValidators.d.ts +59 -0
- package/console/dist/ui/pages/pain/PainEvidenceValidators.js +125 -0
- package/console/dist/ui/pages/pain/PainPage.js +136 -0
- package/console/dist/ui/pages/principles/PrincipleDetailPage.js +264 -0
- package/console/dist/ui/pages/principles/PrinciplesPage.js +244 -0
- package/console/dist/ui/pages/report-problem/ReportProblemPage.js +245 -0
- package/console/dist/ui/pages/settings/SettingsPage.d.ts +4 -0
- package/console/dist/ui/pages/settings/SettingsPage.js +202 -0
- package/console/dist/ui/pages/settings/UpdatePage.d.ts +5 -0
- package/console/dist/ui/pages/settings/UpdatePage.js +168 -0
- package/console/dist/ui/utils/control-center-helpers.d.ts +58 -0
- package/console/dist/ui/utils/control-center-helpers.js +152 -0
- package/console/dist/ui/utils/validators.d.ts +350 -0
- package/console/dist/ui/utils/validators.js +995 -0
- package/console/dist/web/assets/app.css +672 -902
- package/console/dist/web/assets/app.js +6404 -15347
- package/console/dist/web/assets/jetbrains-mono-cyrillic-400-normal-C5JECUCT.woff2 +0 -0
- package/console/dist/web/assets/jetbrains-mono-cyrillic-400-normal-FGCZYWMY.woff +0 -0
- package/console/dist/web/assets/jetbrains-mono-cyrillic-ext-400-normal-C7IFWGF6.woff2 +0 -0
- package/console/dist/web/assets/jetbrains-mono-cyrillic-ext-400-normal-PWXUA557.woff +0 -0
- package/console/dist/web/assets/jetbrains-mono-greek-400-normal-JJNQZMPZ.woff +0 -0
- package/console/dist/web/assets/jetbrains-mono-greek-400-normal-O7JTTR3P.woff2 +0 -0
- package/console/dist/web/assets/jetbrains-mono-latin-400-normal-3OOWLGQ2.woff2 +0 -0
- package/console/dist/web/assets/jetbrains-mono-latin-400-normal-WDD34GPP.woff +0 -0
- package/console/dist/web/assets/jetbrains-mono-latin-ext-400-normal-55RNMRQS.woff +0 -0
- package/console/dist/web/assets/jetbrains-mono-latin-ext-400-normal-JVR3IR4Z.woff2 +0 -0
- package/console/dist/web/assets/jetbrains-mono-vietnamese-400-normal-7ULXAK72.woff +0 -0
- package/console/dist/web/assets/jetbrains-mono-vietnamese-400-normal-KU7YLUPA.woff2 +0 -0
- package/console/package.json +2 -1
- package/core/dist/runtime-v2/__tests__/admission-gate.test.js +49 -0
- package/core/dist/runtime-v2/__tests__/admission-gate.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/architecture-regression.test.js +16 -1
- package/core/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/evidence-sanitizer.test.d.ts +21 -0
- package/core/dist/runtime-v2/__tests__/evidence-sanitizer.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/evidence-sanitizer.test.js +354 -0
- package/core/dist/runtime-v2/__tests__/evidence-sanitizer.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/language-directive.test.d.ts +12 -0
- package/core/dist/runtime-v2/__tests__/language-directive.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/language-directive.test.js +162 -0
- package/core/dist/runtime-v2/__tests__/language-directive.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/pain-signal-observability.test.js +23 -1
- package/core/dist/runtime-v2/__tests__/pain-signal-observability.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/pain-to-principle-service.test.js +48 -3
- package/core/dist/runtime-v2/__tests__/pain-to-principle-service.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/proven-channel-baseline.test.js +13 -1
- package/core/dist/runtime-v2/__tests__/proven-channel-baseline.test.js.map +1 -1
- package/core/dist/runtime-v2/__tests__/resolve-runtime-config-from-pd-config.test.d.ts +12 -0
- package/core/dist/runtime-v2/__tests__/resolve-runtime-config-from-pd-config.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/resolve-runtime-config-from-pd-config.test.js +194 -0
- package/core/dist/runtime-v2/__tests__/resolve-runtime-config-from-pd-config.test.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/runtime-config-boundary.test.js +5 -3
- package/core/dist/runtime-v2/__tests__/runtime-config-boundary.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/activation-dispatcher.test.js +1 -0
- package/core/dist/runtime-v2/activation/__tests__/activation-dispatcher.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/approval-queue.test.js +54 -0
- package/core/dist/runtime-v2/activation/__tests__/approval-queue.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/memory-activation-state-store.test.js +15 -2
- package/core/dist/runtime-v2/activation/__tests__/memory-activation-state-store.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/prompt-activation-reader-contract.test.js +10 -0
- package/core/dist/runtime-v2/activation/__tests__/prompt-activation-reader-contract.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.js +17 -2
- package/core/dist/runtime-v2/activation/__tests__/sqlite-activation-state-store.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store.test.js +36 -0
- package/core/dist/runtime-v2/activation/__tests__/sqlite-approval-store.test.js.map +1 -1
- package/core/dist/runtime-v2/activation/activation-dispatcher.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/activation-dispatcher.js +1 -1
- package/core/dist/runtime-v2/activation/activation-dispatcher.js.map +1 -1
- package/core/dist/runtime-v2/activation/activation-types.d.ts +10 -0
- package/core/dist/runtime-v2/activation/activation-types.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/activation-types.js.map +1 -1
- package/core/dist/runtime-v2/activation/approval-queue.d.ts +6 -0
- package/core/dist/runtime-v2/activation/approval-queue.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/approval-queue.js +3 -0
- package/core/dist/runtime-v2/activation/approval-queue.js.map +1 -1
- package/core/dist/runtime-v2/activation/memory-activation-state-store.d.ts +2 -0
- package/core/dist/runtime-v2/activation/memory-activation-state-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/memory-activation-state-store.js +17 -1
- package/core/dist/runtime-v2/activation/memory-activation-state-store.js.map +1 -1
- package/core/dist/runtime-v2/activation/memory-approval-store.d.ts +6 -0
- package/core/dist/runtime-v2/activation/memory-approval-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/memory-approval-store.js +16 -0
- package/core/dist/runtime-v2/activation/memory-approval-store.js.map +1 -1
- package/core/dist/runtime-v2/activation/prompt-activation-reader-contract.js +1 -1
- package/core/dist/runtime-v2/activation/prompt-activation-reader-contract.js.map +1 -1
- package/core/dist/runtime-v2/activation/sqlite-activation-state-store.d.ts +2 -0
- package/core/dist/runtime-v2/activation/sqlite-activation-state-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/sqlite-activation-state-store.js +34 -6
- package/core/dist/runtime-v2/activation/sqlite-activation-state-store.js.map +1 -1
- package/core/dist/runtime-v2/activation/sqlite-approval-store.d.ts +6 -0
- package/core/dist/runtime-v2/activation/sqlite-approval-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/activation/sqlite-approval-store.js +10 -0
- package/core/dist/runtime-v2/activation/sqlite-approval-store.js.map +1 -1
- package/core/dist/runtime-v2/adapter/__tests__/json-extractor.test.js +51 -1
- package/core/dist/runtime-v2/adapter/__tests__/json-extractor.test.js.map +1 -1
- package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter.test.js +145 -0
- package/core/dist/runtime-v2/adapter/__tests__/openclaw-cli-runtime-adapter.test.js.map +1 -1
- package/core/dist/runtime-v2/adapter/json-extractor.d.ts +13 -0
- package/core/dist/runtime-v2/adapter/json-extractor.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/json-extractor.js +103 -0
- package/core/dist/runtime-v2/adapter/json-extractor.js.map +1 -1
- package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.d.ts +4 -2
- package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.js +57 -5
- package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.js.map +1 -1
- package/core/dist/runtime-v2/config/__tests__/pd-config-agent-binding.test.d.ts +18 -0
- package/core/dist/runtime-v2/config/__tests__/pd-config-agent-binding.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/config/__tests__/pd-config-agent-binding.test.js +633 -0
- package/core/dist/runtime-v2/config/__tests__/pd-config-agent-binding.test.js.map +1 -0
- package/core/dist/runtime-v2/config/__tests__/pd-config-validation-edge-cases.test.js +92 -0
- package/core/dist/runtime-v2/config/__tests__/pd-config-validation-edge-cases.test.js.map +1 -1
- package/core/dist/runtime-v2/config/index.d.ts +3 -1
- package/core/dist/runtime-v2/config/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/index.js +1 -0
- package/core/dist/runtime-v2/config/index.js.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-agent-binding.d.ts +93 -0
- package/core/dist/runtime-v2/config/pd-config-agent-binding.d.ts.map +1 -0
- package/core/dist/runtime-v2/config/pd-config-agent-binding.js +184 -0
- package/core/dist/runtime-v2/config/pd-config-agent-binding.js.map +1 -0
- package/core/dist/runtime-v2/config/pd-config-defaults.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-defaults.js +2 -0
- package/core/dist/runtime-v2/config/pd-config-defaults.js.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-effective.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-effective.js +3 -0
- package/core/dist/runtime-v2/config/pd-config-effective.js.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-types.d.ts +8 -0
- package/core/dist/runtime-v2/config/pd-config-types.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-types.js.map +1 -1
- package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-language.test.d.ts +13 -0
- package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-language.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-language.test.js +97 -0
- package/core/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-language.test.js.map +1 -0
- package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts +3 -2
- package/core/dist/runtime-v2/diagnostician-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/diagnostician-prompt-builder.js +6 -4
- package/core/dist/runtime-v2/diagnostician-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/evidence-sanitizer.d.ts +57 -0
- package/core/dist/runtime-v2/evidence-sanitizer.d.ts.map +1 -0
- package/core/dist/runtime-v2/evidence-sanitizer.js +213 -0
- package/core/dist/runtime-v2/evidence-sanitizer.js.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/__tests__/admission-events.test.d.ts +7 -0
- package/core/dist/runtime-v2/evidence-triage/__tests__/admission-events.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/__tests__/admission-events.test.js +170 -0
- package/core/dist/runtime-v2/evidence-triage/__tests__/admission-events.test.js.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/__tests__/source-descriptors.test.d.ts +18 -0
- package/core/dist/runtime-v2/evidence-triage/__tests__/source-descriptors.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/__tests__/source-descriptors.test.js +277 -0
- package/core/dist/runtime-v2/evidence-triage/__tests__/source-descriptors.test.js.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/__tests__/triage-policy.test.d.ts +13 -0
- package/core/dist/runtime-v2/evidence-triage/__tests__/triage-policy.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/__tests__/triage-policy.test.js +264 -0
- package/core/dist/runtime-v2/evidence-triage/__tests__/triage-policy.test.js.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/__tests__/trigger-controller.test.d.ts +16 -0
- package/core/dist/runtime-v2/evidence-triage/__tests__/trigger-controller.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/__tests__/trigger-controller.test.js +316 -0
- package/core/dist/runtime-v2/evidence-triage/__tests__/trigger-controller.test.js.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/admission-events.d.ts +126 -0
- package/core/dist/runtime-v2/evidence-triage/admission-events.d.ts.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/admission-events.js +159 -0
- package/core/dist/runtime-v2/evidence-triage/admission-events.js.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/index.d.ts +16 -0
- package/core/dist/runtime-v2/evidence-triage/index.d.ts.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/index.js +13 -0
- package/core/dist/runtime-v2/evidence-triage/index.js.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/source-descriptors.d.ts +48 -0
- package/core/dist/runtime-v2/evidence-triage/source-descriptors.d.ts.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/source-descriptors.js +131 -0
- package/core/dist/runtime-v2/evidence-triage/source-descriptors.js.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/triage-policy.d.ts +32 -0
- package/core/dist/runtime-v2/evidence-triage/triage-policy.d.ts.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/triage-policy.js +95 -0
- package/core/dist/runtime-v2/evidence-triage/triage-policy.js.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/trigger-controller.d.ts +116 -0
- package/core/dist/runtime-v2/evidence-triage/trigger-controller.d.ts.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/trigger-controller.js +218 -0
- package/core/dist/runtime-v2/evidence-triage/trigger-controller.js.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/types.d.ts +65 -0
- package/core/dist/runtime-v2/evidence-triage/types.d.ts.map +1 -0
- package/core/dist/runtime-v2/evidence-triage/types.js +38 -0
- package/core/dist/runtime-v2/evidence-triage/types.js.map +1 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js +10 -0
- package/core/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js.map +1 -1
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts.map +1 -1
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js +1 -0
- package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
- package/core/dist/runtime-v2/index.d.ts +8 -1
- package/core/dist/runtime-v2/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/index.js +7 -1
- package/core/dist/runtime-v2/index.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/scribe-prompt-language.test.d.ts +12 -0
- package/core/dist/runtime-v2/internalization/__tests__/scribe-prompt-language.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/scribe-prompt-language.test.js +83 -0
- package/core/dist/runtime-v2/internalization/__tests__/scribe-prompt-language.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts +10 -0
- package/core/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/scribe-prompt-builder.js +13 -1
- package/core/dist/runtime-v2/internalization/scribe-prompt-builder.js.map +1 -1
- package/core/dist/runtime-v2/internalization/scribe-runner.d.ts +3 -0
- package/core/dist/runtime-v2/internalization/scribe-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/scribe-runner.js +2 -0
- package/core/dist/runtime-v2/internalization/scribe-runner.js.map +1 -1
- package/core/dist/runtime-v2/internalization-chain-integrity-read-model.js +1 -1
- package/core/dist/runtime-v2/internalization-chain-integrity-read-model.js.map +1 -1
- package/core/dist/runtime-v2/language-directive.d.ts +80 -0
- package/core/dist/runtime-v2/language-directive.d.ts.map +1 -0
- package/core/dist/runtime-v2/language-directive.js +108 -0
- package/core/dist/runtime-v2/language-directive.js.map +1 -0
- package/core/dist/runtime-v2/pain-signal-observability.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-signal-observability.js +24 -11
- package/core/dist/runtime-v2/pain-signal-observability.js.map +1 -1
- package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts +16 -0
- package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-signal-runtime-factory.js +97 -6
- package/core/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
- package/core/dist/runtime-v2/pain-to-principle-service.d.ts +7 -0
- package/core/dist/runtime-v2/pain-to-principle-service.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-to-principle-service.js +2 -0
- package/core/dist/runtime-v2/pain-to-principle-service.js.map +1 -1
- package/core/dist/runtime-v2/proven-channel-baseline.d.ts.map +1 -1
- package/core/dist/runtime-v2/proven-channel-baseline.js +14 -0
- package/core/dist/runtime-v2/proven-channel-baseline.js.map +1 -1
- package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.js +40 -0
- package/core/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.js.map +1 -1
- package/core/dist/runtime-v2/runner/base-peer-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/runner/base-peer-runner.js +1 -0
- package/core/dist/runtime-v2/runner/base-peer-runner.js.map +1 -1
- package/core/dist/runtime-v2/runner/diagnostician-runner-options.d.ts +10 -0
- package/core/dist/runtime-v2/runner/diagnostician-runner-options.d.ts.map +1 -1
- package/core/dist/runtime-v2/runner/diagnostician-runner-options.js +1 -0
- package/core/dist/runtime-v2/runner/diagnostician-runner-options.js.map +1 -1
- package/core/dist/runtime-v2/runner/diagnostician-runner.d.ts.map +1 -1
- package/core/dist/runtime-v2/runner/diagnostician-runner.js +28 -4
- package/core/dist/runtime-v2/runner/diagnostician-runner.js.map +1 -1
- package/core/dist/runtime-v2/runner/peer-runner-types.d.ts +9 -0
- package/core/dist/runtime-v2/runner/peer-runner-types.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/runtime-state-manager.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/runtime-state-manager.integration.test.js +34 -1
- package/core/dist/runtime-v2/store/runtime-state-manager.integration.test.js.map +1 -1
- package/core/dist/runtime-v2/store/runtime-state-manager.js +1 -0
- package/core/dist/runtime-v2/store/runtime-state-manager.js.map +1 -1
- package/core/dist/runtime-v2/store/sqlite-connection.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/sqlite-connection.js +9 -1
- package/core/dist/runtime-v2/store/sqlite-connection.js.map +1 -1
- package/core/dist/runtime-v2/store/task/sqlite-task-store.js +1 -1
- package/core/dist/runtime-v2/store/task/sqlite-task-store.js.map +1 -1
- package/core/dist/runtime-v2/task-status.d.ts +4 -4
- package/core/dist/runtime-v2/task-status.d.ts.map +1 -1
- package/core/dist/runtime-v2/task-status.js +2 -2
- package/core/dist/runtime-v2/task-status.js.map +1 -1
- package/core/package.json +1 -1
- package/package.json +2 -2
- package/pd-cli/dist/commands/console.d.ts +2 -0
- package/pd-cli/dist/commands/console.d.ts.map +1 -1
- package/pd-cli/dist/commands/console.js +6 -1
- package/pd-cli/dist/commands/console.js.map +1 -1
- package/pd-cli/dist/commands/diagnose.d.ts.map +1 -1
- package/pd-cli/dist/commands/diagnose.js +18 -1
- package/pd-cli/dist/commands/diagnose.js.map +1 -1
- package/pd-cli/dist/commands/pain-evidence.d.ts +41 -0
- package/pd-cli/dist/commands/pain-evidence.d.ts.map +1 -0
- package/pd-cli/dist/commands/pain-evidence.js +177 -0
- package/pd-cli/dist/commands/pain-evidence.js.map +1 -0
- package/pd-cli/dist/commands/pain-record.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-record.js +24 -9
- package/pd-cli/dist/commands/pain-record.js.map +1 -1
- package/pd-cli/dist/commands/pain-retry.d.ts +19 -0
- package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -0
- package/pd-cli/dist/commands/pain-retry.js +485 -0
- package/pd-cli/dist/commands/pain-retry.js.map +1 -0
- package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-run-once.js +59 -9
- package/pd-cli/dist/commands/runtime-internalization-run-once.js.map +1 -1
- package/pd-cli/dist/commands/runtime-uat.d.ts +1 -0
- package/pd-cli/dist/commands/runtime-uat.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-uat.guard.test.d.ts +2 -0
- package/pd-cli/dist/commands/runtime-uat.guard.test.d.ts.map +1 -0
- package/pd-cli/dist/commands/runtime-uat.guard.test.js +155 -0
- package/pd-cli/dist/commands/runtime-uat.guard.test.js.map +1 -0
- package/pd-cli/dist/commands/runtime-uat.js +29 -3
- package/pd-cli/dist/commands/runtime-uat.js.map +1 -1
- package/pd-cli/dist/config-reader.d.ts +25 -0
- package/pd-cli/dist/config-reader.d.ts.map +1 -0
- package/pd-cli/dist/config-reader.js +109 -0
- package/pd-cli/dist/config-reader.js.map +1 -0
- package/pd-cli/dist/index.js +40 -5
- package/pd-cli/dist/index.js.map +1 -1
- package/pd-cli/dist/services/console-launcher.d.ts.map +1 -1
- package/pd-cli/dist/services/console-launcher.js +29 -15
- package/pd-cli/dist/services/console-launcher.js.map +1 -1
- package/pd-cli/dist/services/demo-story-a-runner.d.ts.map +1 -1
- package/pd-cli/dist/services/demo-story-a-runner.js +1 -0
- package/pd-cli/dist/services/demo-story-a-runner.js.map +1 -1
- package/pd-cli/dist/utils/production-workspace-guard.d.ts +77 -0
- package/pd-cli/dist/utils/production-workspace-guard.d.ts.map +1 -0
- package/pd-cli/dist/utils/production-workspace-guard.js +170 -0
- package/pd-cli/dist/utils/production-workspace-guard.js.map +1 -0
- package/pd-cli/dist/utils/production-workspace-guard.test.d.ts +2 -0
- package/pd-cli/dist/utils/production-workspace-guard.test.d.ts.map +1 -0
- package/pd-cli/dist/utils/production-workspace-guard.test.js +95 -0
- package/pd-cli/dist/utils/production-workspace-guard.test.js.map +1 -0
- package/pd-cli/package.json +1 -1
- package/plugin/dist/commands/pain.js +27 -2
- package/plugin/dist/core/pain-diagnostic-gate.d.ts +6 -0
- package/plugin/dist/core/pain-diagnostic-gate.js +9 -0
- package/plugin/dist/hooks/after-tool-call-helpers.d.ts +90 -0
- package/plugin/dist/hooks/after-tool-call-helpers.js +486 -0
- package/plugin/dist/hooks/after-tool-call-types.d.ts +92 -0
- package/plugin/dist/hooks/after-tool-call-types.js +13 -0
- package/plugin/dist/hooks/gate-block-helper.js +73 -29
- package/plugin/dist/hooks/llm.js +49 -29
- package/plugin/dist/hooks/message-sanitize.d.ts +21 -0
- package/plugin/dist/hooks/message-sanitize.js +30 -0
- package/plugin/dist/hooks/pain.d.ts +26 -3
- package/plugin/dist/hooks/pain.js +165 -425
- package/plugin/dist/hooks/prompt.js +3 -2
- package/plugin/dist/hooks/trajectory-evidence.d.ts +11 -0
- package/plugin/dist/hooks/trajectory-evidence.js +65 -0
- package/plugin/dist/hooks/triage-adapter.d.ts +82 -0
- package/plugin/dist/hooks/triage-adapter.js +121 -0
- package/console/dist/server/models/EventLogReadModel.d.ts +0 -33
- package/console/dist/server/models/EventLogReadModel.js +0 -218
- package/console/dist/server/models/EvolutionConsoleModel.d.ts +0 -79
- package/console/dist/server/models/EvolutionConsoleModel.js +0 -179
- package/console/dist/server/models/FeedbackConsoleModel.d.ts +0 -38
- package/console/dist/server/models/FeedbackConsoleModel.js +0 -129
- package/console/dist/server/models/GateConsoleModel.d.ts +0 -50
- package/console/dist/server/models/GateConsoleModel.js +0 -151
- package/console/dist/server/models/OverviewConsoleModel.d.ts +0 -22
- package/console/dist/server/models/OverviewConsoleModel.js +0 -202
- package/console/dist/server/models/PipelineStatsModel.d.ts +0 -35
- package/console/dist/server/models/PipelineStatsModel.js +0 -129
- package/console/dist/server/models/SampleConsoleModel.d.ts +0 -21
- package/console/dist/server/models/SampleConsoleModel.js +0 -188
- package/console/dist/server/models/ThinkingModelsConsoleModel.d.ts +0 -22
- package/console/dist/server/models/ThinkingModelsConsoleModel.js +0 -75
- package/console/dist/server/routes/agents.d.ts +0 -3
- package/console/dist/server/routes/agents.js +0 -442
- package/console/dist/server/routes/central.d.ts +0 -5
- package/console/dist/server/routes/central.js +0 -31
- package/console/dist/server/routes/events.d.ts +0 -10
- package/console/dist/server/routes/events.js +0 -99
- package/console/dist/server/routes/evolution.js +0 -73
- package/console/dist/server/routes/feedback.d.ts +0 -3
- package/console/dist/server/routes/feedback.js +0 -65
- package/console/dist/server/routes/gates.d.ts +0 -3
- package/console/dist/server/routes/gates.js +0 -52
- package/console/dist/server/routes/overview.d.ts +0 -3
- package/console/dist/server/routes/overview.js +0 -49
- package/console/dist/server/routes/pipeline.d.ts +0 -3
- package/console/dist/server/routes/pipeline.js +0 -33
- package/console/dist/server/routes/samples.d.ts +0 -3
- package/console/dist/server/routes/samples.js +0 -101
- package/console/dist/server/routes/thinking-models.d.ts +0 -3
- package/console/dist/server/routes/thinking-models.js +0 -54
- package/console/dist/ui/components/app-sidebar.d.ts +0 -7
- package/console/dist/ui/components/app-sidebar.js +0 -75
- package/console/dist/ui/components/compare-view.d.ts +0 -7
- package/console/dist/ui/components/compare-view.js +0 -32
- package/console/dist/ui/components/data-freshness-indicator.d.ts +0 -10
- package/console/dist/ui/components/data-freshness-indicator.js +0 -63
- package/console/dist/ui/components/health-diagnostic-card.d.ts +0 -15
- package/console/dist/ui/components/health-diagnostic-card.js +0 -42
- package/console/dist/ui/components/page-header.d.ts +0 -10
- package/console/dist/ui/components/page-header.js +0 -37
- package/console/dist/ui/hooks/useAutoRefresh.d.ts +0 -13
- package/console/dist/ui/hooks/useAutoRefresh.js +0 -64
- package/console/dist/ui/hooks/useBookmarks.d.ts +0 -6
- package/console/dist/ui/hooks/useBookmarks.js +0 -43
- package/console/dist/ui/hooks/useDebounce.d.ts +0 -2
- package/console/dist/ui/hooks/useDebounce.js +0 -32
- package/console/dist/ui/hooks/useKeyboardNavigation.d.ts +0 -14
- package/console/dist/ui/hooks/useKeyboardNavigation.js +0 -75
- package/console/dist/ui/pages/AgentsPage.d.ts +0 -1
- package/console/dist/ui/pages/AgentsPage.js +0 -167
- package/console/dist/ui/pages/ApprovalsPage.d.ts +0 -1
- package/console/dist/ui/pages/ApprovalsPage.js +0 -123
- package/console/dist/ui/pages/CentralPage.d.ts +0 -1
- package/console/dist/ui/pages/CentralPage.js +0 -57
- package/console/dist/ui/pages/DataFlowPage.d.ts +0 -1
- package/console/dist/ui/pages/DataFlowPage.js +0 -158
- package/console/dist/ui/pages/EventLogPage.d.ts +0 -1
- package/console/dist/ui/pages/EventLogPage.js +0 -176
- package/console/dist/ui/pages/EvolutionPage.d.ts +0 -1
- package/console/dist/ui/pages/EvolutionPage.js +0 -118
- package/console/dist/ui/pages/FeedbackPage.d.ts +0 -1
- package/console/dist/ui/pages/FeedbackPage.js +0 -46
- package/console/dist/ui/pages/GatesPage.d.ts +0 -1
- package/console/dist/ui/pages/GatesPage.js +0 -31
- package/console/dist/ui/pages/LoginPage.d.ts +0 -5
- package/console/dist/ui/pages/LoginPage.js +0 -39
- package/console/dist/ui/pages/OverviewPage.d.ts +0 -1
- package/console/dist/ui/pages/OverviewPage.js +0 -50
- package/console/dist/ui/pages/PainPage.js +0 -50
- package/console/dist/ui/pages/PrincipleDetailPage.js +0 -145
- package/console/dist/ui/pages/PrinciplesPage.js +0 -322
- package/console/dist/ui/pages/ReportProblemPage.js +0 -186
- package/console/dist/ui/pages/SamplesPage.d.ts +0 -1
- package/console/dist/ui/pages/SamplesPage.js +0 -105
- package/console/dist/ui/pages/SettingsPage.d.ts +0 -1
- package/console/dist/ui/pages/SettingsPage.js +0 -86
- package/console/dist/ui/pages/TasksPage.d.ts +0 -1
- package/console/dist/ui/pages/TasksPage.js +0 -373
- package/console/dist/ui/pages/ThinkingModelsPage.d.ts +0 -1
- package/console/dist/ui/pages/ThinkingModelsPage.js +0 -32
- package/console/dist/ui/pages/UpdatePage.d.ts +0 -1
- package/console/dist/ui/pages/UpdatePage.js +0 -142
- /package/console/dist/ui/pages/{PainPage.d.ts → pain/PainPage.d.ts} +0 -0
- /package/console/dist/ui/pages/{PrincipleDetailPage.d.ts → principles/PrincipleDetailPage.d.ts} +0 -0
- /package/console/dist/ui/pages/{PrinciplesPage.d.ts → principles/PrinciplesPage.d.ts} +0 -0
- /package/console/dist/ui/pages/{ReportProblemPage.d.ts → report-problem/ReportProblemPage.d.ts} +0 -0
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { FeedbackConsoleModel } from '../models/FeedbackConsoleModel.js';
|
|
2
|
-
import { sendSuccess, sendError, sendNotFound } from '../utils/response.js';
|
|
3
|
-
const models = new Map();
|
|
4
|
-
function getModel(workspaceDir) {
|
|
5
|
-
let model = models.get(workspaceDir);
|
|
6
|
-
if (!model) {
|
|
7
|
-
model = new FeedbackConsoleModel(workspaceDir);
|
|
8
|
-
models.set(workspaceDir, model);
|
|
9
|
-
}
|
|
10
|
-
return model;
|
|
11
|
-
}
|
|
12
|
-
function getErrorMessage(err) {
|
|
13
|
-
return err instanceof Error ? err.message : String(err);
|
|
14
|
-
}
|
|
15
|
-
/* eslint-disable @typescript-eslint/max-params */
|
|
16
|
-
export async function handleFeedbackRoute(req, res, workspaceDir, subPath) {
|
|
17
|
-
const model = getModel(workspaceDir);
|
|
18
|
-
if (req.method !== 'GET') {
|
|
19
|
-
sendError(res, 405, 'method_not_allowed', 'Method not allowed');
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (subPath === '/gfi') {
|
|
23
|
-
try {
|
|
24
|
-
const gfi = await model.getGfi();
|
|
25
|
-
sendSuccess(res, gfi);
|
|
26
|
-
}
|
|
27
|
-
catch (err) {
|
|
28
|
-
sendError(res, 500, 'gfi_error', getErrorMessage(err));
|
|
29
|
-
}
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (subPath === '/empathy-events') {
|
|
33
|
-
try {
|
|
34
|
-
const limitParam = new URL(req.url ?? '/', 'http://localhost').searchParams.get('limit');
|
|
35
|
-
const parsedLimit = limitParam ? parseInt(limitParam, 10) : 100;
|
|
36
|
-
const limit = Number.isNaN(parsedLimit) || parsedLimit < 1 ? 100 : Math.min(parsedLimit, 500);
|
|
37
|
-
const events = await model.getEmpathyEvents(limit);
|
|
38
|
-
sendSuccess(res, events);
|
|
39
|
-
}
|
|
40
|
-
catch (err) {
|
|
41
|
-
sendError(res, 500, 'empathy_error', getErrorMessage(err));
|
|
42
|
-
}
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (subPath === '/gate-blocks') {
|
|
46
|
-
try {
|
|
47
|
-
const limitParam = new URL(req.url ?? '/', 'http://localhost').searchParams.get('limit');
|
|
48
|
-
const parsedLimit = limitParam ? parseInt(limitParam, 10) : 100;
|
|
49
|
-
const limit = Number.isNaN(parsedLimit) || parsedLimit < 1 ? 100 : Math.min(parsedLimit, 500);
|
|
50
|
-
const blocks = await model.getGateBlocks(limit);
|
|
51
|
-
sendSuccess(res, blocks);
|
|
52
|
-
}
|
|
53
|
-
catch (err) {
|
|
54
|
-
sendError(res, 500, 'gate_blocks_error', getErrorMessage(err));
|
|
55
|
-
}
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
sendNotFound(res, `Route /api/feedback${subPath} not found`);
|
|
59
|
-
}
|
|
60
|
-
export function disposeFeedbackModels() {
|
|
61
|
-
for (const model of models.values()) {
|
|
62
|
-
model.dispose();
|
|
63
|
-
}
|
|
64
|
-
models.clear();
|
|
65
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { GateConsoleModel } from '../models/GateConsoleModel.js';
|
|
2
|
-
import { sendSuccess, sendError, sendNotFound } from '../utils/response.js';
|
|
3
|
-
const models = new Map();
|
|
4
|
-
function getModel(workspaceDir) {
|
|
5
|
-
let model = models.get(workspaceDir);
|
|
6
|
-
if (!model) {
|
|
7
|
-
model = new GateConsoleModel(workspaceDir);
|
|
8
|
-
models.set(workspaceDir, model);
|
|
9
|
-
}
|
|
10
|
-
return model;
|
|
11
|
-
}
|
|
12
|
-
function getErrorMessage(err) {
|
|
13
|
-
return err instanceof Error ? err.message : String(err);
|
|
14
|
-
}
|
|
15
|
-
/* eslint-disable @typescript-eslint/max-params */
|
|
16
|
-
export async function handleGatesRoute(req, res, workspaceDir, subPath) {
|
|
17
|
-
const model = getModel(workspaceDir);
|
|
18
|
-
if (req.method !== 'GET') {
|
|
19
|
-
sendError(res, 405, 'method_not_allowed', 'Method not allowed');
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (subPath === '/stats' || subPath === '') {
|
|
23
|
-
try {
|
|
24
|
-
const stats = await model.getGateStats();
|
|
25
|
-
sendSuccess(res, stats);
|
|
26
|
-
}
|
|
27
|
-
catch (err) {
|
|
28
|
-
sendError(res, 500, 'gate_stats_error', getErrorMessage(err));
|
|
29
|
-
}
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (subPath === '/blocks') {
|
|
33
|
-
try {
|
|
34
|
-
const limitParam = new URL(req.url ?? '/', 'http://localhost').searchParams.get('limit');
|
|
35
|
-
const parsedLimit = limitParam ? parseInt(limitParam, 10) : 100;
|
|
36
|
-
const limit = Number.isNaN(parsedLimit) || parsedLimit < 1 ? 100 : Math.min(parsedLimit, 500);
|
|
37
|
-
const blocks = await model.getGateBlocks(limit);
|
|
38
|
-
sendSuccess(res, blocks);
|
|
39
|
-
}
|
|
40
|
-
catch (err) {
|
|
41
|
-
sendError(res, 500, 'gate_blocks_error', getErrorMessage(err));
|
|
42
|
-
}
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
sendNotFound(res, `Route /api/gate${subPath} not found`);
|
|
46
|
-
}
|
|
47
|
-
export function disposeGateModels() {
|
|
48
|
-
for (const model of models.values()) {
|
|
49
|
-
model.dispose();
|
|
50
|
-
}
|
|
51
|
-
models.clear();
|
|
52
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { OverviewConsoleModel } from '../models/OverviewConsoleModel.js';
|
|
2
|
-
import { sendSuccess, sendError, sendNotFound } from '../utils/response.js';
|
|
3
|
-
const models = new Map();
|
|
4
|
-
function getModel(workspaceDir) {
|
|
5
|
-
let model = models.get(workspaceDir);
|
|
6
|
-
if (!model) {
|
|
7
|
-
model = new OverviewConsoleModel(workspaceDir);
|
|
8
|
-
models.set(workspaceDir, model);
|
|
9
|
-
}
|
|
10
|
-
return model;
|
|
11
|
-
}
|
|
12
|
-
function getErrorMessage(err) {
|
|
13
|
-
return err instanceof Error ? err.message : String(err);
|
|
14
|
-
}
|
|
15
|
-
/* eslint-disable @typescript-eslint/max-params */
|
|
16
|
-
export async function handleOverviewRoute(req, res, workspaceDir, subPath) {
|
|
17
|
-
const model = getModel(workspaceDir);
|
|
18
|
-
if (req.method !== 'GET') {
|
|
19
|
-
sendError(res, 405, 'method_not_allowed', 'Only GET is allowed for this route');
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (subPath === '' || subPath === '/') {
|
|
23
|
-
try {
|
|
24
|
-
const overview = await model.getOverview();
|
|
25
|
-
sendSuccess(res, overview);
|
|
26
|
-
}
|
|
27
|
-
catch (err) {
|
|
28
|
-
sendError(res, 500, 'overview_error', getErrorMessage(err));
|
|
29
|
-
}
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (subPath === '/health') {
|
|
33
|
-
try {
|
|
34
|
-
const health = await model.getHealth();
|
|
35
|
-
sendSuccess(res, health);
|
|
36
|
-
}
|
|
37
|
-
catch (err) {
|
|
38
|
-
sendError(res, 500, 'health_error', getErrorMessage(err));
|
|
39
|
-
}
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
sendNotFound(res, `Route /api/overview${subPath} not found`);
|
|
43
|
-
}
|
|
44
|
-
export function disposeOverviewModels() {
|
|
45
|
-
for (const model of models.values()) {
|
|
46
|
-
model.dispose();
|
|
47
|
-
}
|
|
48
|
-
models.clear();
|
|
49
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { PipelineStatsModel } from '../models/PipelineStatsModel.js';
|
|
2
|
-
import { sendSuccess, sendError } from '../utils/response.js';
|
|
3
|
-
const MODEL_CACHE_TTL_MS = 5 * 60 * 1000; // 5 minutes
|
|
4
|
-
const models = new Map();
|
|
5
|
-
function getModel(workspaceDir) {
|
|
6
|
-
const cached = models.get(workspaceDir);
|
|
7
|
-
if (cached && Date.now() - cached.cachedAt < MODEL_CACHE_TTL_MS) {
|
|
8
|
-
return cached.model;
|
|
9
|
-
}
|
|
10
|
-
const model = new PipelineStatsModel(workspaceDir);
|
|
11
|
-
models.set(workspaceDir, { model, cachedAt: Date.now() });
|
|
12
|
-
return model;
|
|
13
|
-
}
|
|
14
|
-
export async function handlePipelineRoute(req, res, workspaceDir) {
|
|
15
|
-
if (req.method !== 'GET') {
|
|
16
|
-
sendError(res, 405, 'method_not_allowed', 'Only GET method is allowed');
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const model = getModel(workspaceDir);
|
|
20
|
-
try {
|
|
21
|
-
const stats = await model.getPipelineStats();
|
|
22
|
-
sendSuccess(res, stats);
|
|
23
|
-
}
|
|
24
|
-
catch (err) {
|
|
25
|
-
sendError(res, 500, 'pipeline_stats_error', err.message);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export function disposePipelineModels() {
|
|
29
|
-
for (const [, cached] of models) {
|
|
30
|
-
cached.model.dispose();
|
|
31
|
-
}
|
|
32
|
-
models.clear();
|
|
33
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { SampleConsoleModel } from '../models/SampleConsoleModel.js';
|
|
2
|
-
import { sendSuccess, sendError, sendNotFound, sendBadRequest } from '../utils/response.js';
|
|
3
|
-
import { parseQuery, readBody, safeParseInt } from '../utils/request.js';
|
|
4
|
-
const models = new Map();
|
|
5
|
-
function getModel(workspaceDir) {
|
|
6
|
-
let model = models.get(workspaceDir);
|
|
7
|
-
if (!model) {
|
|
8
|
-
model = new SampleConsoleModel(workspaceDir);
|
|
9
|
-
models.set(workspaceDir, model);
|
|
10
|
-
}
|
|
11
|
-
return model;
|
|
12
|
-
}
|
|
13
|
-
function getErrorMessage(err) {
|
|
14
|
-
return err instanceof Error ? err.message : String(err);
|
|
15
|
-
}
|
|
16
|
-
/* eslint-disable @typescript-eslint/max-params */
|
|
17
|
-
export async function handleSamplesRoute(req, res, workspaceDir, subPath) {
|
|
18
|
-
const model = getModel(workspaceDir);
|
|
19
|
-
if (req.method === 'GET' && (subPath === '' || subPath === '/')) {
|
|
20
|
-
try {
|
|
21
|
-
const query = parseQuery(req.url ?? '');
|
|
22
|
-
const result = await model.listSamples({
|
|
23
|
-
status: query.status,
|
|
24
|
-
page: safeParseInt(query.page, 1, 1, 10000),
|
|
25
|
-
pageSize: safeParseInt(query.pageSize, 20, 1, 100),
|
|
26
|
-
});
|
|
27
|
-
sendSuccess(res, result);
|
|
28
|
-
}
|
|
29
|
-
catch (err) {
|
|
30
|
-
sendError(res, 500, 'samples_error', getErrorMessage(err));
|
|
31
|
-
}
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const detailMatch = /^\/([^/]+)$/.exec(subPath);
|
|
35
|
-
if (req.method === 'GET' && detailMatch) {
|
|
36
|
-
const sampleId = decodeURIComponent(detailMatch[1]);
|
|
37
|
-
try {
|
|
38
|
-
const detail = await model.getSampleDetail(sampleId);
|
|
39
|
-
if (!detail) {
|
|
40
|
-
sendNotFound(res, `Sample ${sampleId} not found`);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
sendSuccess(res, detail);
|
|
44
|
-
}
|
|
45
|
-
catch (err) {
|
|
46
|
-
sendError(res, 500, 'sample_detail_error', getErrorMessage(err));
|
|
47
|
-
}
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
const reviewMatch = /^\/([^/]+)\/review$/.exec(subPath);
|
|
51
|
-
if (req.method === 'POST' && reviewMatch) {
|
|
52
|
-
const sampleId = decodeURIComponent(reviewMatch[1]);
|
|
53
|
-
try {
|
|
54
|
-
const body = await readBody(req);
|
|
55
|
-
let parsed = undefined;
|
|
56
|
-
try {
|
|
57
|
-
parsed = JSON.parse(body);
|
|
58
|
-
}
|
|
59
|
-
catch {
|
|
60
|
-
sendBadRequest(res, 'Invalid JSON body');
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
if (!parsed.decision || (parsed.decision !== 'approved' && parsed.decision !== 'rejected')) {
|
|
64
|
-
sendBadRequest(res, 'decision must be "approved" or "rejected"');
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
if (parsed.note !== undefined && typeof parsed.note !== 'string') {
|
|
68
|
-
sendBadRequest(res, 'note must be a string');
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
const result = await model.reviewSample(sampleId, {
|
|
72
|
-
decision: parsed.decision,
|
|
73
|
-
note: parsed.note,
|
|
74
|
-
});
|
|
75
|
-
sendSuccess(res, result);
|
|
76
|
-
}
|
|
77
|
-
catch (err) {
|
|
78
|
-
const message = getErrorMessage(err);
|
|
79
|
-
if (message === 'Request body too large') {
|
|
80
|
-
sendError(res, 413, 'payload_too_large', message);
|
|
81
|
-
}
|
|
82
|
-
else if (message.includes('not found')) {
|
|
83
|
-
sendNotFound(res, message);
|
|
84
|
-
}
|
|
85
|
-
else if (message.includes('not pending')) {
|
|
86
|
-
sendError(res, 409, 'conflict', message);
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
sendError(res, 500, 'review_error', message);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
sendNotFound(res, `Route /api/samples${subPath} not found`);
|
|
95
|
-
}
|
|
96
|
-
export function disposeSampleModels() {
|
|
97
|
-
for (const model of models.values()) {
|
|
98
|
-
model.dispose();
|
|
99
|
-
}
|
|
100
|
-
models.clear();
|
|
101
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { ThinkingModelsConsoleModel } from '../models/ThinkingModelsConsoleModel.js';
|
|
2
|
-
import { sendSuccess, sendError, sendNotFound } from '../utils/response.js';
|
|
3
|
-
const models = new Map();
|
|
4
|
-
function getModel(workspaceDir) {
|
|
5
|
-
let model = models.get(workspaceDir);
|
|
6
|
-
if (!model) {
|
|
7
|
-
model = new ThinkingModelsConsoleModel(workspaceDir);
|
|
8
|
-
models.set(workspaceDir, model);
|
|
9
|
-
}
|
|
10
|
-
return model;
|
|
11
|
-
}
|
|
12
|
-
/* eslint-disable @typescript-eslint/max-params */
|
|
13
|
-
export async function handleThinkingModelsRoute(req, res, workspaceDir, subPath) {
|
|
14
|
-
if (req.method !== 'GET') {
|
|
15
|
-
sendNotFound(res, `Route /api/thinking-models${subPath} not found`);
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const model = getModel(workspaceDir);
|
|
19
|
-
// GET /api/thinking-models
|
|
20
|
-
if (subPath === '' || subPath === '/') {
|
|
21
|
-
try {
|
|
22
|
-
const result = model.getOverview();
|
|
23
|
-
sendSuccess(res, result);
|
|
24
|
-
}
|
|
25
|
-
catch (err) {
|
|
26
|
-
sendError(res, 500, 'thinking_models_error', err.message);
|
|
27
|
-
}
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
// GET /api/thinking-models/:id
|
|
31
|
-
const detailMatch = /^\/([^/]+)$/.exec(subPath);
|
|
32
|
-
if (detailMatch) {
|
|
33
|
-
const modelId = decodeURIComponent(detailMatch[1]);
|
|
34
|
-
try {
|
|
35
|
-
const detail = model.getModelDetail(modelId);
|
|
36
|
-
if (!detail) {
|
|
37
|
-
sendNotFound(res, `Thinking model ${modelId} not found`);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
sendSuccess(res, detail);
|
|
41
|
-
}
|
|
42
|
-
catch (err) {
|
|
43
|
-
sendError(res, 500, 'thinking_model_detail_error', err.message);
|
|
44
|
-
}
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
sendNotFound(res, `Route /api/thinking-models${subPath} not found`);
|
|
48
|
-
}
|
|
49
|
-
export function disposeThinkingModels() {
|
|
50
|
-
for (const model of models.values()) {
|
|
51
|
-
model.dispose();
|
|
52
|
-
}
|
|
53
|
-
models.clear();
|
|
54
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
interface AppSidebarProps {
|
|
2
|
-
className?: string;
|
|
3
|
-
collapsed?: boolean;
|
|
4
|
-
onCollapsedChange?: (collapsed: boolean) => void;
|
|
5
|
-
}
|
|
6
|
-
export declare function AppSidebar({ className, collapsed, onCollapsedChange }: AppSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect } from "react";
|
|
3
|
-
import { Link, useLocation } from "react-router-dom";
|
|
4
|
-
import { Flame, ScrollText, ShieldCheck, Settings, ChevronLeft, ChevronRight, ChevronDown, ChevronUp, AlertTriangle, Activity, FileText, Dna, Wrench, MessageSquare, } from "lucide-react";
|
|
5
|
-
import { cn } from "../../lib/utils.js";
|
|
6
|
-
import { isNavActive } from "../utils/navigation.js";
|
|
7
|
-
import { Button } from "./ui/button.js";
|
|
8
|
-
import { Badge } from "./ui/badge.js";
|
|
9
|
-
import { fetchSystemHealth } from "../api.js";
|
|
10
|
-
const mvpNavItems = [
|
|
11
|
-
{ id: "pain", label: "Pain", icon: Flame, href: "/pain", alsoActive: ["/"] },
|
|
12
|
-
{ id: "principles", label: "Principle", icon: ScrollText, href: "/principles" },
|
|
13
|
-
{ id: "approvals", label: "Approval", icon: ShieldCheck, href: "/approvals" },
|
|
14
|
-
{ id: "report-problem", label: "Report Problem", icon: MessageSquare, href: "/report-problem" },
|
|
15
|
-
];
|
|
16
|
-
const diagnosticNavItems = [
|
|
17
|
-
{ id: "overview", label: "Overview", icon: Activity, href: "/overview" },
|
|
18
|
-
{ id: "data-flow", label: "Data Flow", icon: Activity, href: "/data-flow" },
|
|
19
|
-
{ id: "event-log", label: "Event Log", icon: FileText, href: "/event-log" },
|
|
20
|
-
{ id: "evolution", label: "Evolution", icon: Dna, href: "/evolution" },
|
|
21
|
-
];
|
|
22
|
-
export function AppSidebar({ className, collapsed = false, onCollapsedChange }) {
|
|
23
|
-
const location = useLocation();
|
|
24
|
-
const [healthData, setHealthData] = useState(null);
|
|
25
|
-
const [alertCount, setAlertCount] = useState(0);
|
|
26
|
-
const [healthError, setHealthError] = useState(null);
|
|
27
|
-
const [diagnosticsOpen, setDiagnosticsOpen] = useState(false);
|
|
28
|
-
const isActive = (href, alsoActive) => isNavActive(href, location.pathname, alsoActive);
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
const fetchHealth = async () => {
|
|
31
|
-
try {
|
|
32
|
-
setHealthError(null);
|
|
33
|
-
const result = await fetchSystemHealth();
|
|
34
|
-
if (result.success && result.data) {
|
|
35
|
-
setHealthData(result.data);
|
|
36
|
-
const errorChecks = result.data.checks.filter(c => c.status === "error").length;
|
|
37
|
-
const warningChecks = result.data.checks.filter(c => c.status === "warning").length;
|
|
38
|
-
setAlertCount(errorChecks + warningChecks);
|
|
39
|
-
}
|
|
40
|
-
else if (!result.success) {
|
|
41
|
-
setHealthError(result.error ?? "Failed to load health status");
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
catch (err) {
|
|
45
|
-
setHealthError(err instanceof Error ? err.message : "Network error");
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
fetchHealth();
|
|
49
|
-
const interval = setInterval(fetchHealth, 30000);
|
|
50
|
-
return () => clearInterval(interval);
|
|
51
|
-
}, []);
|
|
52
|
-
const getAlertBadgeVariant = () => {
|
|
53
|
-
if (!healthData)
|
|
54
|
-
return "secondary";
|
|
55
|
-
if (healthData.overall === "error")
|
|
56
|
-
return "destructive";
|
|
57
|
-
if (healthData.overall === "degraded")
|
|
58
|
-
return "secondary";
|
|
59
|
-
return "default";
|
|
60
|
-
};
|
|
61
|
-
const isDiagnosticsActive = diagnosticNavItems.some(d => isActive(d.href));
|
|
62
|
-
return (_jsxs("aside", { className: cn("fixed left-0 top-0 h-screen bg-sidebar border-r border-border flex flex-col transition-all duration-300 ease-in-out z-50", collapsed ? "w-16" : "w-56", className), children: [_jsx("div", { className: "p-4 border-b border-border", children: _jsxs("div", { className: cn("flex items-center gap-3 font-bold text-lg text-primary", collapsed && "justify-center"), children: [_jsxs("div", { className: "relative", children: [_jsx(Dna, { className: "h-6 w-6", "aria-hidden": "true" }), alertCount > 0 && (_jsx(Badge, { variant: getAlertBadgeVariant(), className: "absolute -top-2 -right-2 h-5 min-w-5 flex items-center justify-center p-0 text-[10px]", children: alertCount }))] }), !collapsed && (_jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { children: "PD Console" }), alertCount > 0 && (_jsxs("div", { className: "flex items-center gap-1 text-xs text-destructive", children: [_jsx(AlertTriangle, { className: "h-3 w-3" }), _jsx("span", { children: alertCount })] })), healthError && (_jsxs("div", { className: "flex items-center gap-1 text-xs text-destructive", title: healthError, children: [_jsx(AlertTriangle, { className: "h-3 w-3" }), _jsx("span", { children: "!" })] }))] }), _jsx("span", { className: "text-[10px] text-muted-foreground mt-0.5 tracking-wider", children: "Burn pain, drive evolution" })] }))] }) }), _jsxs("nav", { className: "flex-1 py-4 overflow-y-auto", children: [_jsxs("div", { className: "mb-2", children: [!collapsed && (_jsx("div", { className: "px-4 pb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: "MVP Journey" })), mvpNavItems.map((item) => {
|
|
63
|
-
const Icon = item.icon;
|
|
64
|
-
return (_jsxs(Link, { to: item.href, "data-testid": `nav-${item.id}`, className: cn("flex items-center gap-3 px-4 py-3 text-sm transition-all duration-200", "hover:bg-accent hover:text-accent-foreground", isActive(item.href, item.alsoActive)
|
|
65
|
-
? "bg-primary/10 text-primary border-r-2 border-primary"
|
|
66
|
-
: "text-muted-foreground", collapsed && "justify-center"), children: [_jsx(Icon, { className: "h-5 w-5 flex-shrink-0", "aria-hidden": "true" }), !collapsed && _jsx("span", { children: item.label })] }, item.id));
|
|
67
|
-
})] }), _jsxs("div", { className: "border-t border-border pt-2 mt-2", children: [_jsxs("button", { type: "button", "data-testid": "diagnostics-toggle", onClick: () => setDiagnosticsOpen(!diagnosticsOpen), className: cn("flex items-center gap-3 px-4 py-2 text-xs w-full text-left transition-all duration-200", "hover:bg-accent hover:text-accent-foreground", isDiagnosticsActive ? "text-primary" : "text-muted-foreground", collapsed && "justify-center"), children: [_jsx(Wrench, { className: "h-4 w-4 flex-shrink-0", "aria-hidden": "true" }), !collapsed && (_jsxs(_Fragment, { children: [_jsx("span", { className: "flex-1 uppercase tracking-wider font-semibold", children: "Diagnostics" }), diagnosticsOpen ? (_jsx(ChevronUp, { className: "h-3 w-3" })) : (_jsx(ChevronDown, { className: "h-3 w-3" }))] }))] }), (diagnosticsOpen || collapsed) && diagnosticNavItems.map((item) => {
|
|
68
|
-
const Icon = item.icon;
|
|
69
|
-
return (_jsxs(Link, { to: item.href, "data-testid": `nav-${item.id}`, className: cn("flex items-center gap-3 px-4 py-2 text-xs transition-all duration-200", "hover:bg-accent hover:text-accent-foreground", isActive(item.href)
|
|
70
|
-
? "bg-primary/10 text-primary border-r-2 border-primary"
|
|
71
|
-
: "text-muted-foreground", collapsed && "justify-center"), children: [_jsx(Icon, { className: "h-4 w-4 flex-shrink-0", "aria-hidden": "true" }), !collapsed && _jsx("span", { children: item.label })] }, item.id));
|
|
72
|
-
})] }), _jsx("div", { className: "border-t border-border pt-2 mt-2", children: _jsxs(Link, { to: "/settings", "data-testid": "nav-settings", className: cn("flex items-center gap-3 px-4 py-2 text-xs transition-all duration-200", "hover:bg-accent hover:text-accent-foreground", isActive("/settings")
|
|
73
|
-
? "bg-primary/10 text-primary border-r-2 border-primary"
|
|
74
|
-
: "text-muted-foreground", collapsed && "justify-center"), children: [_jsx(Settings, { className: "h-4 w-4 flex-shrink-0", "aria-hidden": "true" }), !collapsed && _jsx("span", { children: "Settings" })] }) })] }), _jsx("div", { className: "p-2 border-t border-border", children: _jsx(Button, { variant: "ghost", size: "icon", onClick: () => onCollapsedChange?.(!collapsed), className: "w-full justify-center", children: collapsed ? (_jsx(ChevronRight, { className: "h-5 w-5" })) : (_jsx(ChevronLeft, { className: "h-5 w-5" })) }) })] }));
|
|
75
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { PrincipleListItem } from "../api.js";
|
|
2
|
-
interface CompareViewProps {
|
|
3
|
-
principles: PrincipleListItem[];
|
|
4
|
-
onClose: () => void;
|
|
5
|
-
}
|
|
6
|
-
export declare function CompareView({ principles, onClose }: CompareViewProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useTranslation } from "react-i18next";
|
|
3
|
-
import { Card, CardContent, CardHeader, CardTitle } from "./ui/card.js";
|
|
4
|
-
import { Badge } from "./ui/badge.js";
|
|
5
|
-
import { Button } from "./ui/button.js";
|
|
6
|
-
import { ValueScoreBar, AdherenceBar } from "./ui/progress-bar.js";
|
|
7
|
-
import { X } from "lucide-react";
|
|
8
|
-
import { cn } from "../../lib/utils.js";
|
|
9
|
-
const STATUS_COLORS = {
|
|
10
|
-
candidate: "text-amber-500",
|
|
11
|
-
probation: "text-blue-500",
|
|
12
|
-
active: "text-primary",
|
|
13
|
-
deprecated: "text-destructive",
|
|
14
|
-
archived: "text-muted-foreground",
|
|
15
|
-
};
|
|
16
|
-
const PRIORITY_COLORS = {
|
|
17
|
-
P0: "text-destructive",
|
|
18
|
-
P1: "text-amber-500",
|
|
19
|
-
P2: "text-muted-foreground",
|
|
20
|
-
};
|
|
21
|
-
function DiffRow({ label, left, right, highlight }) {
|
|
22
|
-
const isDifferent = String(left) !== String(right);
|
|
23
|
-
return (_jsxs("div", { className: cn("grid grid-cols-[1fr_2fr_2fr] gap-2 py-1.5 px-2 text-xs", isDifferent && highlight && "bg-amber-50 dark:bg-amber-950/20"), children: [_jsx("span", { className: "text-muted-foreground font-medium", children: label }), _jsx("span", { className: cn(isDifferent && highlight && "font-medium"), children: String(left) || "—" }), _jsx("span", { className: cn(isDifferent && highlight && "font-medium"), children: String(right) || "—" })] }));
|
|
24
|
-
}
|
|
25
|
-
export function CompareView({ principles, onClose }) {
|
|
26
|
-
const { t } = useTranslation();
|
|
27
|
-
if (principles.length !== 2) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
const [a, b] = principles;
|
|
31
|
-
return (_jsxs(Card, { className: "border-2 border-primary/20", children: [_jsx(CardHeader, { className: "pb-2", children: _jsxs("div", { className: "flex items-center justify-between", children: [_jsx(CardTitle, { className: "text-sm flex items-center gap-2", children: t("pages:principles.compareTitle") }), _jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, children: _jsx(X, { className: "h-4 w-4" }) })] }) }), _jsxs(CardContent, { children: [_jsxs("div", { className: "grid grid-cols-[1fr_2fr_2fr] gap-2 mb-2 text-xs font-medium text-muted-foreground border-b border-border pb-2", children: [_jsx("span", { children: t("pages:principles.compareField") }), _jsxs("span", { className: "flex items-center gap-1", children: [_jsx(Badge, { variant: "outline", className: cn("text-xs", STATUS_COLORS[a.status]), children: a.status }), a.id] }), _jsxs("span", { className: "flex items-center gap-1", children: [_jsx(Badge, { variant: "outline", className: cn("text-xs", STATUS_COLORS[b.status]), children: b.status }), b.id] })] }), _jsxs("div", { className: "divide-y divide-border", children: [_jsx(DiffRow, { label: t("pages:principles.text"), left: a.text, right: b.text, highlight: true }), _jsx(DiffRow, { label: t("pages:principles.status"), left: a.status, right: b.status, highlight: true }), _jsx(DiffRow, { label: t("pages:principles.priority"), left: a.priority, right: b.priority, highlight: true }), _jsx(DiffRow, { label: t("pages:principles.scope"), left: a.scope + (a.domain ? ` / ${a.domain}` : ""), right: b.scope + (b.domain ? ` / ${b.domain}` : ""), highlight: true }), _jsx(DiffRow, { label: t("pages:principles.evaluability"), left: a.evaluability, right: b.evaluability, highlight: true }), _jsx(DiffRow, { label: t("pages:principles.triggerPattern"), left: a.triggerPattern, right: b.triggerPattern, highlight: true }), _jsx(DiffRow, { label: t("pages:principles.action"), left: a.action, right: b.action, highlight: true })] }), _jsxs("div", { className: "grid grid-cols-[1fr_2fr_2fr] gap-2 mt-4 pt-4 border-t border-border", children: [_jsx("span", { className: "text-xs text-muted-foreground font-medium", children: t("pages:principles.valueScore") }), _jsx("div", { children: _jsx(ValueScoreBar, { valueScore: a.valueScore }) }), _jsx("div", { children: _jsx(ValueScoreBar, { valueScore: b.valueScore }) }), _jsx("span", { className: "text-xs text-muted-foreground font-medium", children: t("pages:principles.adherence") }), _jsx("div", { children: _jsx(AdherenceBar, { adherenceRate: a.adherenceRate }) }), _jsx("div", { children: _jsx(AdherenceBar, { adherenceRate: b.adherenceRate }) }), _jsx("span", { className: "text-xs text-muted-foreground font-medium", children: t("pages:principles.painPrevented") }), _jsx("span", { className: "text-xs", children: a.painPreventedCount }), _jsx("span", { className: "text-xs", children: b.painPreventedCount }), _jsx("span", { className: "text-xs text-muted-foreground font-medium", children: t("pages:principles.rules") }), _jsx("span", { className: "text-xs", children: a.ruleCount }), _jsx("span", { className: "text-xs", children: b.ruleCount })] })] })] }));
|
|
32
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface DataFreshnessIndicatorProps {
|
|
2
|
-
lastUpdateTime: string | null | undefined;
|
|
3
|
-
label: string;
|
|
4
|
-
thresholdMinutes?: {
|
|
5
|
-
stale: number;
|
|
6
|
-
critical: number;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
export declare function DataFreshnessIndicator({ lastUpdateTime, label, thresholdMinutes, }: DataFreshnessIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { Badge } from './ui/badge.js';
|
|
5
|
-
function formatTimeAgo(timestamp, t) {
|
|
6
|
-
const now = new Date();
|
|
7
|
-
const time = new Date(timestamp);
|
|
8
|
-
const diffMs = now.getTime() - time.getTime();
|
|
9
|
-
const diffSec = Math.floor(diffMs / 1000);
|
|
10
|
-
const diffMin = Math.floor(diffSec / 60);
|
|
11
|
-
const diffHour = Math.floor(diffMin / 60);
|
|
12
|
-
const diffDay = Math.floor(diffHour / 24);
|
|
13
|
-
if (diffMin < 1)
|
|
14
|
-
return t('components:dataFreshness.justNow');
|
|
15
|
-
if (diffMin < 60)
|
|
16
|
-
return t('components:pageHeader.minutesAgo', { count: diffMin });
|
|
17
|
-
if (diffHour < 24)
|
|
18
|
-
return t('components:pageHeader.hoursAgo', { count: diffHour });
|
|
19
|
-
return t('components:pageHeader.daysAgo', { count: diffDay });
|
|
20
|
-
}
|
|
21
|
-
export function DataFreshnessIndicator({ lastUpdateTime, label, thresholdMinutes = { stale: 5, critical: 15 }, }) {
|
|
22
|
-
const { t } = useTranslation();
|
|
23
|
-
const [freshness, setFreshness] = useState('fresh');
|
|
24
|
-
const [timeAgo, setTimeAgo] = useState('');
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
if (!lastUpdateTime) {
|
|
27
|
-
setFreshness('critical');
|
|
28
|
-
setTimeAgo(t('components:dataFreshness.never'));
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const update = () => {
|
|
32
|
-
const now = new Date();
|
|
33
|
-
const time = new Date(lastUpdateTime);
|
|
34
|
-
const diffMs = now.getTime() - time.getTime();
|
|
35
|
-
const diffMin = diffMs / (1000 * 60);
|
|
36
|
-
let level = 'fresh';
|
|
37
|
-
if (diffMin > thresholdMinutes.critical)
|
|
38
|
-
level = 'critical';
|
|
39
|
-
else if (diffMin > thresholdMinutes.stale)
|
|
40
|
-
level = 'stale';
|
|
41
|
-
setFreshness(level);
|
|
42
|
-
setTimeAgo(formatTimeAgo(lastUpdateTime, t));
|
|
43
|
-
};
|
|
44
|
-
update();
|
|
45
|
-
const interval = setInterval(update, 10000);
|
|
46
|
-
return () => clearInterval(interval);
|
|
47
|
-
}, [lastUpdateTime, thresholdMinutes, t]);
|
|
48
|
-
const getBadgeVariant = () => {
|
|
49
|
-
switch (freshness) {
|
|
50
|
-
case 'fresh': return 'default';
|
|
51
|
-
case 'stale': return 'secondary';
|
|
52
|
-
case 'critical': return 'destructive';
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const getStatusText = () => {
|
|
56
|
-
switch (freshness) {
|
|
57
|
-
case 'fresh': return t('components:dataFreshness.upToDate');
|
|
58
|
-
case 'stale': return t('components:dataFreshness.slightlyDelayed');
|
|
59
|
-
case 'critical': return t('components:dataFreshness.stale');
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
return (_jsxs(Badge, { variant: getBadgeVariant(), children: [label, ": ", getStatusText(), " (", timeAgo, ")"] }));
|
|
63
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
interface HealthCheckItem {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
status: 'healthy' | 'warning' | 'error';
|
|
5
|
-
message: string;
|
|
6
|
-
lastCheck: string;
|
|
7
|
-
}
|
|
8
|
-
interface HealthDiagnosticCardProps {
|
|
9
|
-
overall: 'healthy' | 'degraded' | 'error';
|
|
10
|
-
checks: HealthCheckItem[];
|
|
11
|
-
onRefresh?: () => void;
|
|
12
|
-
loading?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare function HealthDiagnosticCard({ overall, checks, onRefresh, loading, }: HealthDiagnosticCardProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export {};
|