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
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, useCallback } from "react";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import { toast } from "sonner";
|
|
5
|
+
import { PageShell } from "../../components/layout/page-shell.js";
|
|
6
|
+
import { SectionTitle } from "../../components/layout/section-title.js";
|
|
7
|
+
import { fetchUpdateStatus, fetchUpdateHistory, } from "../../api.js";
|
|
8
|
+
// ── Runtime validators (H section / ERR-001/005/009/013) ─────────────────────
|
|
9
|
+
/** Type guard: is this a non-null object with own properties (not inherited)? */
|
|
10
|
+
function isRecord(value) {
|
|
11
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12
|
+
}
|
|
13
|
+
export function validateUpdateStatusData(raw) {
|
|
14
|
+
if (!isRecord(raw))
|
|
15
|
+
return null;
|
|
16
|
+
if (!Object.hasOwn(raw, "currentVersion") ||
|
|
17
|
+
!Object.hasOwn(raw, "latestVersion") ||
|
|
18
|
+
!Object.hasOwn(raw, "updateAvailable") ||
|
|
19
|
+
!Object.hasOwn(raw, "lastChecked")) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const currentVersion = raw.currentVersion;
|
|
23
|
+
const latestVersion = raw.latestVersion;
|
|
24
|
+
const updateAvailable = raw.updateAvailable;
|
|
25
|
+
const lastChecked = raw.lastChecked;
|
|
26
|
+
if (typeof currentVersion !== "string" ||
|
|
27
|
+
typeof latestVersion !== "string" ||
|
|
28
|
+
typeof updateAvailable !== "boolean" ||
|
|
29
|
+
typeof lastChecked !== "string") {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return { currentVersion, latestVersion, updateAvailable, lastChecked };
|
|
33
|
+
}
|
|
34
|
+
export function validateUpdateHistoryEntry(raw) {
|
|
35
|
+
if (!isRecord(raw))
|
|
36
|
+
return null;
|
|
37
|
+
if (!Object.hasOwn(raw, "version") ||
|
|
38
|
+
!Object.hasOwn(raw, "appliedAt") ||
|
|
39
|
+
!Object.hasOwn(raw, "notes")) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
const version = raw.version;
|
|
43
|
+
const appliedAt = raw.appliedAt;
|
|
44
|
+
const notes = raw.notes;
|
|
45
|
+
if (typeof version !== "string" ||
|
|
46
|
+
typeof appliedAt !== "string" ||
|
|
47
|
+
typeof notes !== "string") {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
return { version, appliedAt, notes };
|
|
51
|
+
}
|
|
52
|
+
export function validateUpdateHistoryData(raw) {
|
|
53
|
+
if (!isRecord(raw))
|
|
54
|
+
return null;
|
|
55
|
+
if (!Object.hasOwn(raw, "updates")) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
const updates = raw.updates;
|
|
59
|
+
if (!Array.isArray(updates)) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
// Fail loud: any invalid entry rejects the entire payload (ERR-009)
|
|
63
|
+
const validatedEntries = [];
|
|
64
|
+
for (const entry of updates) {
|
|
65
|
+
const validated = validateUpdateHistoryEntry(entry);
|
|
66
|
+
if (validated === null)
|
|
67
|
+
return null;
|
|
68
|
+
validatedEntries.push(validated);
|
|
69
|
+
}
|
|
70
|
+
return { updates: validatedEntries };
|
|
71
|
+
}
|
|
72
|
+
// ── Helper: format ISO date string to locale-aware display ────────────────────
|
|
73
|
+
function formatDate(isoString, locale) {
|
|
74
|
+
try {
|
|
75
|
+
const date = new Date(isoString);
|
|
76
|
+
if (Number.isNaN(date.getTime()))
|
|
77
|
+
return isoString;
|
|
78
|
+
return date.toLocaleDateString(locale, {
|
|
79
|
+
year: "numeric",
|
|
80
|
+
month: "short",
|
|
81
|
+
day: "numeric",
|
|
82
|
+
hour: "2-digit",
|
|
83
|
+
minute: "2-digit",
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
return isoString;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export function UpdatePage() {
|
|
91
|
+
const { t, i18n } = useTranslation();
|
|
92
|
+
const [statusData, setStatusData] = useState(null);
|
|
93
|
+
const [historyData, setHistoryData] = useState(null);
|
|
94
|
+
const [loadingState, setLoadingState] = useState("loading");
|
|
95
|
+
const [checking, setChecking] = useState(false);
|
|
96
|
+
const [errorMessage, setErrorMessage] = useState(null);
|
|
97
|
+
const [historyErrorReason, setHistoryErrorReason] = useState(null);
|
|
98
|
+
const locale = i18n.language === "zh-CN" ? "zh-CN" : "en-US";
|
|
99
|
+
const loadData = useCallback(async () => {
|
|
100
|
+
setLoadingState("loading");
|
|
101
|
+
setErrorMessage(null);
|
|
102
|
+
setHistoryErrorReason(null);
|
|
103
|
+
const [statusResult, historyResult] = await Promise.all([
|
|
104
|
+
fetchUpdateStatus(),
|
|
105
|
+
fetchUpdateHistory(),
|
|
106
|
+
]);
|
|
107
|
+
// Validate status data (H section / ERR-001/005)
|
|
108
|
+
if (!statusResult.success) {
|
|
109
|
+
setLoadingState("error");
|
|
110
|
+
setErrorMessage(statusResult.error);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const validatedStatus = validateUpdateStatusData(statusResult.data);
|
|
114
|
+
if (validatedStatus === null) {
|
|
115
|
+
setLoadingState("error");
|
|
116
|
+
setErrorMessage("Update status data has unexpected shape");
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
setStatusData(validatedStatus);
|
|
120
|
+
// Validate history data (ERR-002: degradation with reason)
|
|
121
|
+
if (!historyResult.success) {
|
|
122
|
+
setHistoryData(null);
|
|
123
|
+
setHistoryErrorReason(historyResult.error ?? "Update history unavailable");
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
const validatedHistory = validateUpdateHistoryData(historyResult.data);
|
|
127
|
+
setHistoryData(validatedHistory);
|
|
128
|
+
if (validatedHistory === null) {
|
|
129
|
+
setHistoryErrorReason("Update history data has unexpected shape");
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
setLoadingState("loaded");
|
|
133
|
+
}, []);
|
|
134
|
+
useEffect(() => {
|
|
135
|
+
loadData();
|
|
136
|
+
}, [loadData]);
|
|
137
|
+
const handleCheckForUpdates = useCallback(async () => {
|
|
138
|
+
setChecking(true);
|
|
139
|
+
const result = await fetchUpdateStatus();
|
|
140
|
+
if (!result.success) {
|
|
141
|
+
toast.error(t("pages.update.checkFailed"));
|
|
142
|
+
setChecking(false);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const validated = validateUpdateStatusData(result.data);
|
|
146
|
+
if (validated === null) {
|
|
147
|
+
toast.error(t("pages.update.checkFailed"));
|
|
148
|
+
setChecking(false);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
setStatusData(validated);
|
|
152
|
+
setChecking(false);
|
|
153
|
+
}, [t]);
|
|
154
|
+
// ── Loading state ────────────────────────────────────────────────────────
|
|
155
|
+
if (loadingState === "loading") {
|
|
156
|
+
return (_jsx(PageShell, { children: _jsxs("div", { className: "text-ink-3 text-sm", role: "status", "aria-live": "polite", children: [t("common.loading"), "\u2026"] }) }));
|
|
157
|
+
}
|
|
158
|
+
// ── Error state (ERR-002: degradation with reason) ───────────────────────
|
|
159
|
+
if (loadingState === "error") {
|
|
160
|
+
return (_jsxs(PageShell, { children: [_jsx("div", { className: "font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3", children: t("pages.update.eyebrow") }), _jsx("h1", { className: "text-[29px] font-semibold tracking-tight text-ink mb-2", children: t("pages.update.title") }), _jsxs("div", { className: "mt-6 p-4 bg-panel border border-line rounded-[6px] text-ink-2 text-sm", children: [_jsx("p", { children: t("pages.update.loadError") }), errorMessage && (_jsx("p", { className: "mt-2 text-ink-4 text-[13px] font-mono", children: errorMessage }))] })] }));
|
|
161
|
+
}
|
|
162
|
+
// ── Loaded state ─────────────────────────────────────────────────────────
|
|
163
|
+
const isUpToDate = statusData ? !statusData.updateAvailable : true;
|
|
164
|
+
const lastCheckedDisplay = statusData
|
|
165
|
+
? (statusData.lastChecked ? formatDate(statusData.lastChecked, locale) : t("pages.update.neverChecked"))
|
|
166
|
+
: t("pages.update.neverChecked");
|
|
167
|
+
return (_jsxs(PageShell, { children: [_jsx("div", { className: "font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3", children: t("pages.update.eyebrow") }), _jsx("h1", { className: "text-[29px] font-semibold tracking-tight text-ink mb-2", children: t("pages.update.title") }), _jsx("p", { className: "text-ink-3 text-[14px] max-w-[760px] leading-relaxed mb-7", children: t("pages.update.subtitle") }), _jsxs("section", { className: "mb-8", "aria-labelledby": "section-update-status", children: [_jsx(SectionTitle, { id: "section-update-status", children: t("pages.update.currentVersion") }), _jsxs("div", { className: "bg-panel border border-line rounded-[6px] p-5", children: [_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-ink-3 text-[13px]", children: t("pages.update.currentVersion") }), _jsx("span", { className: "font-mono text-[13px] text-ink", children: statusData?.currentVersion ?? "—" })] }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-ink-3 text-[13px]", children: t("pages.update.latestVersion") }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "font-mono text-[13px] text-ink", children: statusData?.latestVersion ?? "—" }), isUpToDate ? (_jsx("span", { className: "inline-flex items-center border border-green/35 text-green rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase", children: t("pages.update.upToDate") })) : (_jsx("span", { className: "inline-flex items-center border border-amber/35 text-amber rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase", children: t("pages.update.updateAvailable") }))] })] }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-ink-3 text-[13px]", children: t("pages.update.lastChecked") }), _jsx("span", { className: "text-ink-3 text-[13px]", children: lastCheckedDisplay })] })] }), _jsx("div", { className: "mt-5 pt-4 border-t border-line", children: _jsx("button", { type: "button", onClick: handleCheckForUpdates, disabled: checking, className: "border border-line bg-surface text-ink rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2", children: checking ? t("pages.update.checking") : t("pages.update.checkForUpdates") }) })] })] }), _jsxs("section", { "aria-labelledby": "section-update-history", children: [_jsx(SectionTitle, { id: "section-update-history", children: t("pages.update.history") }), historyErrorReason ? (_jsxs("div", { className: "text-ink-3 text-[13px] leading-relaxed py-3", children: [t("pages.update.loadError"), " (", historyErrorReason, ")"] })) : historyData && historyData.updates.length > 0 ? (_jsx("div", { className: "space-y-[10px]", children: historyData.updates.map((entry, index) => (_jsxs("article", { className: "bg-panel border border-line rounded-[6px] px-5 py-4", children: [_jsxs("div", { className: "flex items-center justify-between mb-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "inline-flex items-center border border-line rounded-[2px] px-[7px] py-1 font-mono text-[11px] text-ink-3 bg-surface/80 uppercase", children: t("pages.update.version") }), _jsx("span", { className: "font-mono text-[13px] text-ink", children: entry.version })] }), _jsx("span", { className: "text-ink-3 text-[13px]", children: formatDate(entry.appliedAt, locale) })] }), entry.notes && (_jsx("div", { className: "text-ink-2 text-[13px] leading-relaxed mt-1", children: entry.notes }))] }, `${entry.version}-${index}`))) })) : (_jsx("div", { className: "text-ink-3 text-[13px] leading-relaxed py-3", children: t("pages.update.noHistory") }))] })] }));
|
|
168
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Control Center Helpers — PRI-303
|
|
3
|
+
*
|
|
4
|
+
* Pure logic for the Control Center UI:
|
|
5
|
+
* - Readiness badge/label mapping
|
|
6
|
+
* - Overall readiness computation
|
|
7
|
+
* - Agent grouping by readiness
|
|
8
|
+
* - Redacted diagnostics for clipboard copy
|
|
9
|
+
*
|
|
10
|
+
* ERR entries:
|
|
11
|
+
* - ERR-001/ERR-005: No `as` bypasses on untrusted data
|
|
12
|
+
* - ERR-014/ERR-016/ERR-017: Safe serialization for diagnostics copy
|
|
13
|
+
* - ERR-045: ANY-segment redaction for sensitive keys
|
|
14
|
+
*/
|
|
15
|
+
import type { ReadinessStatus } from '../api.js';
|
|
16
|
+
export interface RedactedRuntimeProfileSummary {
|
|
17
|
+
id: string;
|
|
18
|
+
type: string;
|
|
19
|
+
label: string;
|
|
20
|
+
apiKeyEnv?: string;
|
|
21
|
+
readiness: ReadinessStatus;
|
|
22
|
+
}
|
|
23
|
+
export interface RedactedAgentSummary {
|
|
24
|
+
name: string;
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
runtimeProfileId: string;
|
|
27
|
+
runtimeProfileLabel: string;
|
|
28
|
+
readiness: ReadinessStatus;
|
|
29
|
+
}
|
|
30
|
+
export interface RedactedFeatureSummary {
|
|
31
|
+
id: string;
|
|
32
|
+
category: string;
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface ControlCenterDiagnostics {
|
|
36
|
+
version: number;
|
|
37
|
+
source: 'defaults' | 'user_config';
|
|
38
|
+
features: RedactedFeatureSummary[];
|
|
39
|
+
runtimeProfiles: RedactedRuntimeProfileSummary[];
|
|
40
|
+
defaultRuntime: string;
|
|
41
|
+
agents: RedactedAgentSummary[];
|
|
42
|
+
ui: {
|
|
43
|
+
diagnostics: {
|
|
44
|
+
mode: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
warnings: string[];
|
|
48
|
+
errors?: {
|
|
49
|
+
path: string;
|
|
50
|
+
reason: string;
|
|
51
|
+
nextAction: string;
|
|
52
|
+
}[];
|
|
53
|
+
}
|
|
54
|
+
export declare function getReadinessBadgeVariant(readiness: ReadinessStatus): 'default' | 'secondary' | 'destructive' | 'outline';
|
|
55
|
+
export declare function getReadinessLabel(readiness: ReadinessStatus): string;
|
|
56
|
+
export declare function computeOverallReadiness(diag: ControlCenterDiagnostics): ReadinessStatus;
|
|
57
|
+
export declare function groupAgentsByReadiness(diag: ControlCenterDiagnostics): Record<ReadinessStatus, RedactedAgentSummary[]>;
|
|
58
|
+
export declare function redactDiagnosticsForCopy(diag: ControlCenterDiagnostics): string;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Control Center Helpers — PRI-303
|
|
3
|
+
*
|
|
4
|
+
* Pure logic for the Control Center UI:
|
|
5
|
+
* - Readiness badge/label mapping
|
|
6
|
+
* - Overall readiness computation
|
|
7
|
+
* - Agent grouping by readiness
|
|
8
|
+
* - Redacted diagnostics for clipboard copy
|
|
9
|
+
*
|
|
10
|
+
* ERR entries:
|
|
11
|
+
* - ERR-001/ERR-005: No `as` bypasses on untrusted data
|
|
12
|
+
* - ERR-014/ERR-016/ERR-017: Safe serialization for diagnostics copy
|
|
13
|
+
* - ERR-045: ANY-segment redaction for sensitive keys
|
|
14
|
+
*/
|
|
15
|
+
// ── Readiness Badge Variant ──────────────────────────────────────────────────
|
|
16
|
+
export function getReadinessBadgeVariant(readiness) {
|
|
17
|
+
switch (readiness) {
|
|
18
|
+
case 'ready': return 'default';
|
|
19
|
+
case 'needs_setup': return 'secondary';
|
|
20
|
+
case 'disabled': return 'outline';
|
|
21
|
+
case 'not_ready': return 'destructive';
|
|
22
|
+
case 'unknown': return 'secondary';
|
|
23
|
+
default: return 'secondary';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// ── Readiness Label ──────────────────────────────────────────────────────────
|
|
27
|
+
export function getReadinessLabel(readiness) {
|
|
28
|
+
switch (readiness) {
|
|
29
|
+
case 'ready': return 'Ready';
|
|
30
|
+
case 'needs_setup': return 'Needs Setup';
|
|
31
|
+
case 'disabled': return 'Disabled';
|
|
32
|
+
case 'not_ready': return 'Not Ready';
|
|
33
|
+
case 'unknown': return 'Unknown';
|
|
34
|
+
default: return 'Unknown';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// ── Overall Readiness ────────────────────────────────────────────────────────
|
|
38
|
+
export function computeOverallReadiness(diag) {
|
|
39
|
+
const enabledAgents = diag.agents.filter(a => a.enabled);
|
|
40
|
+
if (enabledAgents.length === 0) {
|
|
41
|
+
return diag.agents.length === 0 ? 'unknown' : 'disabled';
|
|
42
|
+
}
|
|
43
|
+
const readinessOrder = ['not_ready', 'needs_setup', 'unknown', 'disabled', 'ready'];
|
|
44
|
+
for (const status of readinessOrder) {
|
|
45
|
+
if (status === 'disabled')
|
|
46
|
+
continue; // disabled agents are filtered out above
|
|
47
|
+
if (enabledAgents.some(a => a.readiness === status)) {
|
|
48
|
+
return status;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return 'ready';
|
|
52
|
+
}
|
|
53
|
+
// ── Group Agents by Readiness ────────────────────────────────────────────────
|
|
54
|
+
export function groupAgentsByReadiness(diag) {
|
|
55
|
+
const groups = {
|
|
56
|
+
ready: [],
|
|
57
|
+
needs_setup: [],
|
|
58
|
+
disabled: [],
|
|
59
|
+
not_ready: [],
|
|
60
|
+
unknown: [],
|
|
61
|
+
};
|
|
62
|
+
for (const agent of diag.agents) {
|
|
63
|
+
const status = agent.readiness;
|
|
64
|
+
if (Object.hasOwn(groups, status)) {
|
|
65
|
+
groups[status].push(agent);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
groups.unknown.push(agent);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return groups;
|
|
72
|
+
}
|
|
73
|
+
// ── Redacted Diagnostics for Copy ────────────────────────────────────────────
|
|
74
|
+
/** Maximum items per section in diagnostics output (ERR-014/ERR-016/ERR-017) */
|
|
75
|
+
const MAX_ITEMS_PER_SECTION = 50;
|
|
76
|
+
function takeBounded(arr) {
|
|
77
|
+
if (arr.length <= MAX_ITEMS_PER_SECTION)
|
|
78
|
+
return { items: arr, truncated: 0 };
|
|
79
|
+
return {
|
|
80
|
+
items: arr.slice(0, MAX_ITEMS_PER_SECTION),
|
|
81
|
+
truncated: arr.length - MAX_ITEMS_PER_SECTION,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export function redactDiagnosticsForCopy(diag) {
|
|
85
|
+
const overall = computeOverallReadiness(diag);
|
|
86
|
+
const lines = [];
|
|
87
|
+
lines.push('=== PD Control Center Diagnostics ===');
|
|
88
|
+
lines.push(`Overall Status: ${getReadinessLabel(overall)}`);
|
|
89
|
+
lines.push(`Config Source: ${diag.source}`);
|
|
90
|
+
lines.push(`Config Version: ${diag.version}`);
|
|
91
|
+
lines.push('');
|
|
92
|
+
// Features
|
|
93
|
+
lines.push('--- Features ---');
|
|
94
|
+
const features = takeBounded(diag.features);
|
|
95
|
+
for (const f of features.items) {
|
|
96
|
+
lines.push(` ${f.id}: ${f.category} / ${f.enabled ? 'enabled' : 'disabled'}`);
|
|
97
|
+
}
|
|
98
|
+
if (features.truncated > 0)
|
|
99
|
+
lines.push(` ... +${features.truncated} more`);
|
|
100
|
+
lines.push('');
|
|
101
|
+
// Runtime Profiles (redacted)
|
|
102
|
+
lines.push('--- Runtime Profiles ---');
|
|
103
|
+
const profiles = takeBounded(diag.runtimeProfiles);
|
|
104
|
+
for (const p of profiles.items) {
|
|
105
|
+
const parts = [` ${p.id}: ${p.label} [${getReadinessLabel(p.readiness)}]`];
|
|
106
|
+
// apiKeyEnv is a secret-like key — redact it (ERR-045)
|
|
107
|
+
if (p.apiKeyEnv) {
|
|
108
|
+
parts.push(` apiKeyEnv: [REDACTED]`);
|
|
109
|
+
}
|
|
110
|
+
lines.push(parts.join('\n'));
|
|
111
|
+
}
|
|
112
|
+
if (profiles.truncated > 0)
|
|
113
|
+
lines.push(` ... +${profiles.truncated} more`);
|
|
114
|
+
lines.push('');
|
|
115
|
+
// Default Runtime
|
|
116
|
+
lines.push(`Default Runtime: ${diag.defaultRuntime}`);
|
|
117
|
+
lines.push('');
|
|
118
|
+
// Agents
|
|
119
|
+
lines.push('--- Agents ---');
|
|
120
|
+
const agents = takeBounded(diag.agents);
|
|
121
|
+
for (const a of agents.items) {
|
|
122
|
+
const status = a.enabled ? getReadinessLabel(a.readiness) : 'Disabled';
|
|
123
|
+
lines.push(` ${a.name}: ${status} (profile: ${a.runtimeProfileLabel})`);
|
|
124
|
+
}
|
|
125
|
+
if (agents.truncated > 0)
|
|
126
|
+
lines.push(` ... +${agents.truncated} more`);
|
|
127
|
+
lines.push('');
|
|
128
|
+
// Warnings
|
|
129
|
+
if (diag.warnings.length > 0) {
|
|
130
|
+
lines.push('--- Warnings ---');
|
|
131
|
+
const warnings = takeBounded(diag.warnings);
|
|
132
|
+
for (const w of warnings.items) {
|
|
133
|
+
lines.push(` - ${w}`);
|
|
134
|
+
}
|
|
135
|
+
if (warnings.truncated > 0)
|
|
136
|
+
lines.push(` ... +${warnings.truncated} more`);
|
|
137
|
+
lines.push('');
|
|
138
|
+
}
|
|
139
|
+
// Errors
|
|
140
|
+
if (diag.errors && diag.errors.length > 0) {
|
|
141
|
+
lines.push('--- Errors ---');
|
|
142
|
+
const errors = takeBounded(diag.errors);
|
|
143
|
+
for (const e of errors.items) {
|
|
144
|
+
lines.push(` ${e.path}: ${e.reason} → ${e.nextAction}`);
|
|
145
|
+
}
|
|
146
|
+
if (errors.truncated > 0)
|
|
147
|
+
lines.push(` ... +${errors.truncated} more`);
|
|
148
|
+
lines.push('');
|
|
149
|
+
}
|
|
150
|
+
lines.push('=== End Diagnostics ===');
|
|
151
|
+
return lines.join('\n');
|
|
152
|
+
}
|