create-principles-disciple 1.146.4 → 1.146.7
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/_release/product-identity.json +1 -1
- package/codex-adapter/package.json +1 -1
- package/core/dist/runtime-v2/evidence-triage/index.d.ts +1 -3
- package/core/dist/runtime-v2/evidence-triage/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/evidence-triage/index.js +1 -2
- package/core/dist/runtime-v2/evidence-triage/index.js.map +1 -1
- package/core/dist/runtime-v2/evidence-triage/observation-resolver.d.ts +0 -19
- package/core/dist/runtime-v2/evidence-triage/observation-resolver.d.ts.map +1 -1
- package/core/dist/runtime-v2/evidence-triage/observation-resolver.js +0 -25
- package/core/dist/runtime-v2/evidence-triage/observation-resolver.js.map +1 -1
- package/core/dist/runtime-v2/index.d.ts +2 -2
- package/core/dist/runtime-v2/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/index.js +1 -1
- package/core/dist/runtime-v2/index.js.map +1 -1
- package/core/dist/telemetry-event.d.ts +2 -2
- package/core/dist/telemetry-event.d.ts.map +1 -1
- package/core/dist/telemetry-event.js +4 -5
- package/core/dist/telemetry-event.js.map +1 -1
- package/core/dist/trajectory-store.d.ts.map +1 -1
- package/core/dist/trajectory-store.js +4 -44
- package/core/dist/trajectory-store.js.map +1 -1
- package/core/package.json +1 -1
- package/host-runtime/package.json +1 -1
- package/package.json +4 -4
- package/plugin/dist/bundle.js +460 -460
- package/plugin/dist/core/config.d.ts +0 -2
- package/plugin/dist/core/trajectory.d.ts +0 -6
- package/plugin/dist/hooks/llm.d.ts +0 -1
- package/plugin/dist/hooks/prompt-helpers.d.ts +2 -1
- package/plugin/dist/hooks/raw-observation-adapter.d.ts +6 -4
- package/plugin/dist/hooks/triage-adapter.d.ts +1 -1
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/dist/rulehost-evidence.js +6 -6
- package/plugin/dist/templates/pain_settings.json +0 -2
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/plugin/templates/pain_settings.json +0 -2
- package/release-manager/package.json +4 -4
- package/workbuddy-adapter/package.json +1 -1
- package/console/dist/ui/App.d.ts +0 -1
- package/console/dist/ui/App.js +0 -172
- package/console/dist/ui/api.d.ts +0 -611
- package/console/dist/ui/api.js +0 -1094
- package/console/dist/ui/components/auth/login-form.d.ts +0 -4
- package/console/dist/ui/components/auth/login-form.js +0 -142
- package/console/dist/ui/components/auth/splash-screen.d.ts +0 -9
- package/console/dist/ui/components/auth/splash-screen.js +0 -22
- package/console/dist/ui/components/error-boundary.d.ts +0 -15
- package/console/dist/ui/components/error-boundary.js +0 -30
- package/console/dist/ui/components/focus/daily-thought-card.d.ts +0 -1
- package/console/dist/ui/components/focus/daily-thought-card.js +0 -41
- package/console/dist/ui/components/language-switcher.d.ts +0 -2
- package/console/dist/ui/components/language-switcher.js +0 -17
- package/console/dist/ui/components/layout/app-sidebar.d.ts +0 -27
- package/console/dist/ui/components/layout/app-sidebar.js +0 -128
- package/console/dist/ui/components/layout/page-loading.d.ts +0 -13
- package/console/dist/ui/components/layout/page-loading.js +0 -14
- package/console/dist/ui/components/layout/page-shell.d.ts +0 -12
- package/console/dist/ui/components/layout/page-shell.js +0 -11
- package/console/dist/ui/components/layout/section-title.d.ts +0 -10
- package/console/dist/ui/components/layout/section-title.js +0 -9
- package/console/dist/ui/components/notifications/NotificationProvider.d.ts +0 -14
- package/console/dist/ui/components/notifications/NotificationProvider.js +0 -136
- package/console/dist/ui/components/notifications/favicon-badge.d.ts +0 -3
- package/console/dist/ui/components/notifications/favicon-badge.js +0 -68
- package/console/dist/ui/components/notifications/notification-reducer.d.ts +0 -9
- package/console/dist/ui/components/notifications/notification-reducer.js +0 -9
- package/console/dist/ui/components/notifications/sound-storage.d.ts +0 -3
- package/console/dist/ui/components/notifications/sound-storage.js +0 -37
- package/console/dist/ui/components/notifications/useNotifications.d.ts +0 -1
- package/console/dist/ui/components/notifications/useNotifications.js +0 -9
- package/console/dist/ui/components/onboarding/CircuitDiagram.d.ts +0 -8
- package/console/dist/ui/components/onboarding/CircuitDiagram.js +0 -18
- package/console/dist/ui/components/onboarding/DemoResultView.d.ts +0 -22
- package/console/dist/ui/components/onboarding/DemoResultView.js +0 -33
- package/console/dist/ui/components/onboarding/SlashCommandsCard.d.ts +0 -16
- package/console/dist/ui/components/onboarding/SlashCommandsCard.js +0 -20
- package/console/dist/ui/components/onboarding/slashCommands.d.ts +0 -20
- package/console/dist/ui/components/onboarding/slashCommands.js +0 -22
- package/console/dist/ui/components/receipts/ReceiptCoverageDisclosure.d.ts +0 -6
- package/console/dist/ui/components/receipts/ReceiptCoverageDisclosure.js +0 -66
- package/console/dist/ui/components/theme-provider.d.ts +0 -14
- package/console/dist/ui/components/theme-provider.js +0 -40
- package/console/dist/ui/components/theme-toggle.d.ts +0 -2
- package/console/dist/ui/components/theme-toggle.js +0 -11
- package/console/dist/ui/components/ui/alert-dialog.d.ts +0 -20
- package/console/dist/ui/components/ui/alert-dialog.js +0 -26
- package/console/dist/ui/components/ui/badge.d.ts +0 -9
- package/console/dist/ui/components/ui/badge.js +0 -22
- package/console/dist/ui/components/ui/button.d.ts +0 -11
- package/console/dist/ui/components/ui/button.js +0 -34
- package/console/dist/ui/components/ui/card.d.ts +0 -8
- package/console/dist/ui/components/ui/card.js +0 -16
- package/console/dist/ui/components/ui/charts.d.ts +0 -51
- package/console/dist/ui/components/ui/charts.js +0 -72
- package/console/dist/ui/components/ui/dialog.d.ts +0 -19
- package/console/dist/ui/components/ui/dialog.js +0 -22
- package/console/dist/ui/components/ui/input.d.ts +0 -3
- package/console/dist/ui/components/ui/input.js +0 -8
- package/console/dist/ui/components/ui/markdown.d.ts +0 -24
- package/console/dist/ui/components/ui/markdown.js +0 -119
- package/console/dist/ui/components/ui/progress-bar.d.ts +0 -20
- package/console/dist/ui/components/ui/progress-bar.js +0 -38
- package/console/dist/ui/components/ui/select.d.ts +0 -13
- package/console/dist/ui/components/ui/select.js +0 -26
- package/console/dist/ui/components/ui/separator.d.ts +0 -3
- package/console/dist/ui/components/ui/separator.js +0 -6
- package/console/dist/ui/components/ui/sheet.d.ts +0 -25
- package/console/dist/ui/components/ui/sheet.js +0 -37
- package/console/dist/ui/components/ui/shiny-text.d.ts +0 -28
- package/console/dist/ui/components/ui/shiny-text.js +0 -46
- package/console/dist/ui/components/ui/skeleton.d.ts +0 -3
- package/console/dist/ui/components/ui/skeleton.js +0 -6
- package/console/dist/ui/components/ui/sonner.d.ts +0 -3
- package/console/dist/ui/components/ui/sonner.js +0 -13
- package/console/dist/ui/components/ui/tooltip.d.ts +0 -7
- package/console/dist/ui/components/ui/tooltip.js +0 -10
- package/console/dist/ui/data/daily-thoughts.d.ts +0 -15
- package/console/dist/ui/data/daily-thoughts.js +0 -164
- package/console/dist/ui/hooks/useNotificationSound.d.ts +0 -12
- package/console/dist/ui/hooks/useNotificationSound.js +0 -74
- package/console/dist/ui/i18n/en.json +0 -2399
- package/console/dist/ui/i18n/index.d.ts +0 -2
- package/console/dist/ui/i18n/index.js +0 -32
- package/console/dist/ui/i18n/zh-CN.json +0 -2399
- package/console/dist/ui/main.d.ts +0 -1
- package/console/dist/ui/main.js +0 -9
- package/console/dist/ui/pages/ReportProblemValidators.d.ts +0 -144
- package/console/dist/ui/pages/ReportProblemValidators.js +0 -418
- package/console/dist/ui/pages/activation/ActivationPage.d.ts +0 -1
- package/console/dist/ui/pages/activation/ActivationPage.js +0 -512
- package/console/dist/ui/pages/activation/ActivationValidators.d.ts +0 -20
- package/console/dist/ui/pages/activation/ActivationValidators.js +0 -160
- package/console/dist/ui/pages/control-center/AgentCard.d.ts +0 -31
- package/console/dist/ui/pages/control-center/AgentCard.js +0 -212
- package/console/dist/ui/pages/control-center/AgentGroup.d.ts +0 -26
- package/console/dist/ui/pages/control-center/AgentGroup.js +0 -38
- package/console/dist/ui/pages/control-center/ControlCenterPage.d.ts +0 -1
- package/console/dist/ui/pages/control-center/ControlCenterPage.js +0 -509
- package/console/dist/ui/pages/control-center/DesignGatePanel.d.ts +0 -1
- package/console/dist/ui/pages/control-center/DesignGatePanel.js +0 -137
- package/console/dist/ui/pages/control-center/RuntimeProfileManager.d.ts +0 -31
- package/console/dist/ui/pages/control-center/RuntimeProfileManager.js +0 -199
- package/console/dist/ui/pages/control-center/WorkflowDiagram.d.ts +0 -17
- package/console/dist/ui/pages/control-center/WorkflowDiagram.js +0 -55
- package/console/dist/ui/pages/debt/DebtPage.d.ts +0 -2
- package/console/dist/ui/pages/debt/DebtPage.js +0 -222
- package/console/dist/ui/pages/design-system/DesignSystemPage.d.ts +0 -2
- package/console/dist/ui/pages/design-system/DesignSystemPage.js +0 -30
- package/console/dist/ui/pages/examiner/ExaminerPage.d.ts +0 -15
- package/console/dist/ui/pages/examiner/ExaminerPage.js +0 -158
- package/console/dist/ui/pages/failed-tasks/FailedTasksPage.d.ts +0 -1
- package/console/dist/ui/pages/failed-tasks/FailedTasksPage.js +0 -421
- package/console/dist/ui/pages/focus/ApprovalSubjectReading.d.ts +0 -24
- package/console/dist/ui/pages/focus/ApprovalSubjectReading.js +0 -133
- package/console/dist/ui/pages/focus/FocusPage.d.ts +0 -123
- package/console/dist/ui/pages/focus/FocusPage.js +0 -567
- package/console/dist/ui/pages/focus/OwnerDecisionCard.d.ts +0 -9
- package/console/dist/ui/pages/focus/OwnerDecisionCard.js +0 -111
- package/console/dist/ui/pages/focus/OwnerWorkbench.d.ts +0 -19
- package/console/dist/ui/pages/focus/OwnerWorkbench.js +0 -75
- package/console/dist/ui/pages/focus/RuleCandidateBindingPanel.d.ts +0 -34
- package/console/dist/ui/pages/focus/RuleCandidateBindingPanel.js +0 -298
- package/console/dist/ui/pages/focus/focus-validation.d.ts +0 -40
- package/console/dist/ui/pages/focus/focus-validation.js +0 -211
- package/console/dist/ui/pages/intent/IntentOnboarding.d.ts +0 -67
- package/console/dist/ui/pages/intent/IntentOnboarding.js +0 -289
- package/console/dist/ui/pages/intent/IntentPage.d.ts +0 -1
- package/console/dist/ui/pages/intent/IntentPage.js +0 -252
- package/console/dist/ui/pages/pain/PainEvidenceValidators.d.ts +0 -59
- package/console/dist/ui/pages/pain/PainEvidenceValidators.js +0 -125
- package/console/dist/ui/pages/pain/PainPage.d.ts +0 -1
- package/console/dist/ui/pages/pain/PainPage.js +0 -420
- package/console/dist/ui/pages/pain/pain-card-helpers.d.ts +0 -175
- package/console/dist/ui/pages/pain/pain-card-helpers.js +0 -181
- package/console/dist/ui/pages/principles/CorePrinciplesPage.d.ts +0 -10
- package/console/dist/ui/pages/principles/CorePrinciplesPage.js +0 -59
- package/console/dist/ui/pages/principles/PrincipleDetailPage.d.ts +0 -60
- package/console/dist/ui/pages/principles/PrincipleDetailPage.js +0 -602
- package/console/dist/ui/pages/principles/PrinciplesPage.d.ts +0 -1
- package/console/dist/ui/pages/principles/PrinciplesPage.js +0 -327
- package/console/dist/ui/pages/principles/PrinciplesViewNav.d.ts +0 -8
- package/console/dist/ui/pages/principles/PrinciplesViewNav.js +0 -15
- package/console/dist/ui/pages/report-problem/ReportProblemPage.d.ts +0 -1
- package/console/dist/ui/pages/report-problem/ReportProblemPage.js +0 -467
- package/console/dist/ui/pages/settings/SettingsPage.d.ts +0 -4
- package/console/dist/ui/pages/settings/SettingsPage.js +0 -457
- package/console/dist/ui/pages/settings/UpdatePage.d.ts +0 -1
- package/console/dist/ui/pages/settings/UpdatePage.js +0 -215
- package/console/dist/ui/pages/welcome/WelcomePage.d.ts +0 -5
- package/console/dist/ui/pages/welcome/WelcomePage.js +0 -187
- package/console/dist/ui/utils/agent-metadata.d.ts +0 -71
- package/console/dist/ui/utils/agent-metadata.js +0 -284
- package/console/dist/ui/utils/approval-review.d.ts +0 -30
- package/console/dist/ui/utils/approval-review.js +0 -50
- package/console/dist/ui/utils/approval-warning-localization.d.ts +0 -34
- package/console/dist/ui/utils/approval-warning-localization.js +0 -148
- package/console/dist/ui/utils/attention-presentation.d.ts +0 -35
- package/console/dist/ui/utils/attention-presentation.js +0 -46
- package/console/dist/ui/utils/blocker-localization.d.ts +0 -23
- package/console/dist/ui/utils/blocker-localization.js +0 -36
- package/console/dist/ui/utils/control-center-helpers.d.ts +0 -79
- package/console/dist/ui/utils/control-center-helpers.js +0 -189
- package/console/dist/ui/utils/enum-labels.d.ts +0 -50
- package/console/dist/ui/utils/enum-labels.js +0 -171
- package/console/dist/ui/utils/format-date.d.ts +0 -11
- package/console/dist/ui/utils/format-date.js +0 -17
- package/console/dist/ui/utils/onboarding-state.d.ts +0 -25
- package/console/dist/ui/utils/onboarding-state.js +0 -77
- package/console/dist/ui/utils/reading-layout.d.ts +0 -20
- package/console/dist/ui/utils/reading-layout.js +0 -46
- package/console/dist/ui/utils/rule-binding-validators.d.ts +0 -13
- package/console/dist/ui/utils/rule-binding-validators.js +0 -188
- package/console/dist/ui/utils/runtime-mode.d.ts +0 -11
- package/console/dist/ui/utils/runtime-mode.js +0 -11
- package/console/dist/ui/utils/token-storage.d.ts +0 -22
- package/console/dist/ui/utils/token-storage.js +0 -47
- package/console/dist/ui/utils/validators.d.ts +0 -1178
- package/console/dist/ui/utils/validators.js +0 -3297
- package/core/dist/runtime-v2/evidence-triage/admission-events.d.ts +0 -126
- package/core/dist/runtime-v2/evidence-triage/admission-events.d.ts.map +0 -1
- package/core/dist/runtime-v2/evidence-triage/admission-events.js +0 -159
- package/core/dist/runtime-v2/evidence-triage/admission-events.js.map +0 -1
- package/plugin/dist/core/detection-funnel.d.ts +0 -47
- package/plugin/dist/core/detection-service.d.ts +0 -15
- package/release-manager/dist/bootstrap-entry.d.ts +0 -2
- package/release-manager/dist/bootstrap-entry.d.ts.map +0 -1
- package/release-manager/dist/bootstrap-entry.js.map +0 -1
- package/release-manager/dist/i18n.d.ts +0 -6
- package/release-manager/dist/i18n.d.ts.map +0 -1
- package/release-manager/dist/i18n.js.map +0 -1
- package/release-manager/dist/index.d.ts +0 -7
- package/release-manager/dist/index.d.ts.map +0 -1
- package/release-manager/dist/index.js +0 -656
- package/release-manager/dist/index.js.map +0 -1
- package/release-manager/dist/installer.d.ts +0 -629
- package/release-manager/dist/installer.d.ts.map +0 -1
- package/release-manager/dist/installer.js.map +0 -1
- package/release-manager/dist/installers/codex-host-installer.d.ts +0 -39
- package/release-manager/dist/installers/codex-host-installer.d.ts.map +0 -1
- package/release-manager/dist/installers/codex-host-installer.js.map +0 -1
- package/release-manager/dist/installers/index.d.ts +0 -51
- package/release-manager/dist/installers/index.d.ts.map +0 -1
- package/release-manager/dist/installers/index.js.map +0 -1
- package/release-manager/dist/installers/openclaw-host-installer.d.ts +0 -14
- package/release-manager/dist/installers/openclaw-host-installer.d.ts.map +0 -1
- package/release-manager/dist/installers/openclaw-host-installer.js.map +0 -1
- package/release-manager/dist/installers/workbuddy-host-installer.d.ts +0 -335
- package/release-manager/dist/installers/workbuddy-host-installer.d.ts.map +0 -1
- package/release-manager/dist/installers/workbuddy-host-installer.js.map +0 -1
- package/release-manager/dist/mvp-config.d.ts +0 -233
- package/release-manager/dist/mvp-config.d.ts.map +0 -1
- package/release-manager/dist/mvp-config.js.map +0 -1
- package/release-manager/dist/prompts.d.ts +0 -43
- package/release-manager/dist/prompts.d.ts.map +0 -1
- package/release-manager/dist/prompts.js +0 -268
- package/release-manager/dist/prompts.js.map +0 -1
- package/release-manager/dist/skill-language.d.ts +0 -32
- package/release-manager/dist/skill-language.d.ts.map +0 -1
- package/release-manager/dist/skill-language.js.map +0 -1
- package/release-manager/dist/uninstaller.d.ts +0 -68
- package/release-manager/dist/uninstaller.d.ts.map +0 -1
- package/release-manager/dist/uninstaller.js +0 -746
- package/release-manager/dist/uninstaller.js.map +0 -1
- package/release-manager/dist/update/apply-payload.d.ts +0 -143
- package/release-manager/dist/update/apply-payload.d.ts.map +0 -1
- package/release-manager/dist/update/apply-payload.js.map +0 -1
- package/release-manager/dist/update/atomic-file.d.ts +0 -35
- package/release-manager/dist/update/atomic-file.d.ts.map +0 -1
- package/release-manager/dist/update/atomic-file.js.map +0 -1
- package/release-manager/dist/update/bootstrap-executor.d.ts +0 -21
- package/release-manager/dist/update/bootstrap-executor.d.ts.map +0 -1
- package/release-manager/dist/update/bootstrap-executor.js.map +0 -1
- package/release-manager/dist/update/bootstrap-protocol.d.ts +0 -56
- package/release-manager/dist/update/bootstrap-protocol.d.ts.map +0 -1
- package/release-manager/dist/update/bootstrap-protocol.js.map +0 -1
- package/release-manager/dist/update/channel-metadata.d.ts +0 -28
- package/release-manager/dist/update/channel-metadata.d.ts.map +0 -1
- package/release-manager/dist/update/channel-metadata.js.map +0 -1
- package/release-manager/dist/update/channel-promotion.d.ts +0 -39
- package/release-manager/dist/update/channel-promotion.d.ts.map +0 -1
- package/release-manager/dist/update/channel-promotion.js +0 -55
- package/release-manager/dist/update/channel-promotion.js.map +0 -1
- package/release-manager/dist/update/console-surface.d.ts +0 -19
- package/release-manager/dist/update/console-surface.d.ts.map +0 -1
- package/release-manager/dist/update/console-surface.js.map +0 -1
- package/release-manager/dist/update/data-compatibility.d.ts +0 -35
- package/release-manager/dist/update/data-compatibility.d.ts.map +0 -1
- package/release-manager/dist/update/data-compatibility.js +0 -45
- package/release-manager/dist/update/data-compatibility.js.map +0 -1
- package/release-manager/dist/update/install-layout.d.ts +0 -105
- package/release-manager/dist/update/install-layout.d.ts.map +0 -1
- package/release-manager/dist/update/install-layout.js.map +0 -1
- package/release-manager/dist/update/product-identity.d.ts +0 -70
- package/release-manager/dist/update/product-identity.d.ts.map +0 -1
- package/release-manager/dist/update/product-identity.js.map +0 -1
- package/release-manager/dist/update/release-asset-manifest.d.ts +0 -31
- package/release-manager/dist/update/release-asset-manifest.d.ts.map +0 -1
- package/release-manager/dist/update/release-asset-manifest.js.map +0 -1
- package/release-manager/dist/update/release-identity.d.ts +0 -33
- package/release-manager/dist/update/release-identity.d.ts.map +0 -1
- package/release-manager/dist/update/release-identity.js.map +0 -1
- package/release-manager/dist/update/release-manager-authority.d.ts +0 -39
- package/release-manager/dist/update/release-manager-authority.d.ts.map +0 -1
- package/release-manager/dist/update/release-manager-authority.js.map +0 -1
- package/release-manager/dist/update/release-manager.d.ts +0 -156
- package/release-manager/dist/update/release-manager.d.ts.map +0 -1
- package/release-manager/dist/update/release-manager.js.map +0 -1
- package/release-manager/dist/update/release-metadata-publisher.d.ts +0 -199
- package/release-manager/dist/update/release-metadata-publisher.d.ts.map +0 -1
- package/release-manager/dist/update/release-metadata-publisher.js +0 -478
- package/release-manager/dist/update/release-metadata-publisher.js.map +0 -1
- package/release-manager/dist/update/release-metadata-source.d.ts +0 -85
- package/release-manager/dist/update/release-metadata-source.d.ts.map +0 -1
- package/release-manager/dist/update/release-metadata-source.js.map +0 -1
- package/release-manager/dist/update/release-metadata.d.ts +0 -60
- package/release-manager/dist/update/release-metadata.d.ts.map +0 -1
- package/release-manager/dist/update/release-metadata.js.map +0 -1
- package/release-manager/dist/update/release-policy.d.ts +0 -51
- package/release-manager/dist/update/release-policy.d.ts.map +0 -1
- package/release-manager/dist/update/release-policy.js.map +0 -1
- package/release-manager/dist/update/rollback-policy.d.ts +0 -56
- package/release-manager/dist/update/rollback-policy.d.ts.map +0 -1
- package/release-manager/dist/update/rollback-policy.js +0 -61
- package/release-manager/dist/update/rollback-policy.js.map +0 -1
- package/release-manager/dist/update/transaction-journal.d.ts +0 -212
- package/release-manager/dist/update/transaction-journal.d.ts.map +0 -1
- package/release-manager/dist/update/transaction-journal.js.map +0 -1
- package/release-manager/dist/update/trust-metadata.d.ts +0 -55
- package/release-manager/dist/update/trust-metadata.d.ts.map +0 -1
- package/release-manager/dist/update/trust-metadata.js.map +0 -1
- package/release-manager/dist/update/trust-root-provisioning.d.ts +0 -99
- package/release-manager/dist/update/trust-root-provisioning.d.ts.map +0 -1
- package/release-manager/dist/update/trust-root-provisioning.js.map +0 -1
- package/release-manager/dist/update/update-history.d.ts +0 -46
- package/release-manager/dist/update/update-history.d.ts.map +0 -1
- package/release-manager/dist/update/update-history.js +0 -123
- package/release-manager/dist/update/update-history.js.map +0 -1
- package/release-manager/dist/utils/config-file-io.d.ts +0 -34
- package/release-manager/dist/utils/config-file-io.d.ts.map +0 -1
- package/release-manager/dist/utils/config-file-io.js.map +0 -1
- package/release-manager/dist/utils/env.d.ts +0 -94
- package/release-manager/dist/utils/env.d.ts.map +0 -1
- package/release-manager/dist/utils/env.js.map +0 -1
- package/release-manager/dist/utils/logger.d.ts +0 -15
- package/release-manager/dist/utils/logger.d.ts.map +0 -1
- package/release-manager/dist/utils/logger.js.map +0 -1
- package/release-manager/dist/utils/workspace-divergence.d.ts +0 -36
- package/release-manager/dist/utils/workspace-divergence.d.ts.map +0 -1
- package/release-manager/dist/utils/workspace-divergence.js.map +0 -1
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* UpdatePage — PD self-update status and history.
|
|
4
|
-
*
|
|
5
|
-
* Contract aligned with backend routes/update.ts:
|
|
6
|
-
* - GET /api/update/check → { hasUpdate, currentVersion, latestVersion, error? }
|
|
7
|
-
* - GET /api/update/history → [{ id, timestamp, fromVersion, toVersion, success }, ...]
|
|
8
|
-
*
|
|
9
|
-
* Privacy boundary: version strings and timestamps only — no session/path data.
|
|
10
|
-
*/
|
|
11
|
-
import { useState, useEffect, useCallback } from "react";
|
|
12
|
-
import { useTranslation } from "react-i18next";
|
|
13
|
-
import { toast } from "sonner";
|
|
14
|
-
import { PageShell } from "../../components/layout/page-shell.js";
|
|
15
|
-
import { PageLoading } from "../../components/layout/page-loading.js";
|
|
16
|
-
import { SectionTitle } from "../../components/layout/section-title.js";
|
|
17
|
-
import { fetchUpdateStatus, fetchUpdateHistory, applyFullUpdate, fetchUpdateRecovery, fetchUpdateTransaction, } from "../../api.js";
|
|
18
|
-
import { validateUpdateStatus, validateUpdateHistory, validateUpdateRecovery, validateUpdateTransaction } from "../../utils/validators.js";
|
|
19
|
-
import { AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction, } from "../../components/ui/alert-dialog.js";
|
|
20
|
-
import { Loader2, CheckCircle2, XCircle, ArrowRight, AlertTriangle } from "lucide-react";
|
|
21
|
-
import { formatDate } from "../../utils/format-date.js";
|
|
22
|
-
export function UpdatePage() {
|
|
23
|
-
const { t, i18n } = useTranslation();
|
|
24
|
-
const [statusData, setStatusData] = useState(null);
|
|
25
|
-
const [historyData, setHistoryData] = useState(null);
|
|
26
|
-
const [loadingState, setLoadingState] = useState("loading");
|
|
27
|
-
const [checking, setChecking] = useState(false);
|
|
28
|
-
const [errorMessage, setErrorMessage] = useState(null);
|
|
29
|
-
const [historyErrorReason, setHistoryErrorReason] = useState(null);
|
|
30
|
-
const [updateResult, setUpdateResult] = useState(null);
|
|
31
|
-
const [showFullUpdateDialog, setShowFullUpdateDialog] = useState(false);
|
|
32
|
-
const [fullUpdating, setFullUpdating] = useState(false);
|
|
33
|
-
const [recoveryData, setRecoveryData] = useState(null);
|
|
34
|
-
// PRI-853 (SPEC §12.1): a running detached update — the page tracks its
|
|
35
|
-
// transaction instead of treating the accepted request as "success".
|
|
36
|
-
const [inProgress, setInProgress] = useState(null);
|
|
37
|
-
const loadData = useCallback(async () => {
|
|
38
|
-
setLoadingState("loading");
|
|
39
|
-
setErrorMessage(null);
|
|
40
|
-
setHistoryErrorReason(null);
|
|
41
|
-
const [statusResult, historyResult, recoveryResult] = await Promise.all([
|
|
42
|
-
fetchUpdateStatus(),
|
|
43
|
-
fetchUpdateHistory(),
|
|
44
|
-
fetchUpdateRecovery(),
|
|
45
|
-
]);
|
|
46
|
-
// Validate status data (H section / ERR-001/005)
|
|
47
|
-
if (!statusResult.success) {
|
|
48
|
-
setLoadingState("error");
|
|
49
|
-
setErrorMessage(statusResult.error);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
const validatedStatus = validateUpdateStatus(statusResult.data);
|
|
53
|
-
if (validatedStatus === null) {
|
|
54
|
-
setLoadingState("error");
|
|
55
|
-
setErrorMessage("Update status data has unexpected shape");
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
setStatusData(validatedStatus);
|
|
59
|
-
// Validate history data (ERR-002: degradation with reason)
|
|
60
|
-
if (!historyResult.success) {
|
|
61
|
-
setHistoryData(null);
|
|
62
|
-
setHistoryErrorReason(historyResult.error ?? "Update history unavailable");
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
const validatedHistory = validateUpdateHistory(historyResult.data);
|
|
66
|
-
setHistoryData(validatedHistory);
|
|
67
|
-
if (validatedHistory === null) {
|
|
68
|
-
setHistoryErrorReason("Update history data has unexpected shape");
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
// PRI-848 (SPEC §12.1): recovery surface — surface an unfinished update
|
|
72
|
-
// transaction instead of letting the Owner start a duplicate update.
|
|
73
|
-
if (recoveryResult.success) {
|
|
74
|
-
setRecoveryData(validateUpdateRecovery(recoveryResult.data));
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
setRecoveryData(null);
|
|
78
|
-
}
|
|
79
|
-
setLoadingState("loaded");
|
|
80
|
-
}, []);
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
loadData();
|
|
83
|
-
}, [loadData]);
|
|
84
|
-
const handleCheckForUpdates = useCallback(async () => {
|
|
85
|
-
setChecking(true);
|
|
86
|
-
const result = await fetchUpdateStatus();
|
|
87
|
-
if (!result.success) {
|
|
88
|
-
toast.error(t("pages.update.checkFailed"));
|
|
89
|
-
setChecking(false);
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
const validated = validateUpdateStatus(result.data);
|
|
93
|
-
if (validated === null) {
|
|
94
|
-
toast.error(t("pages.update.checkFailed"));
|
|
95
|
-
setChecking(false);
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
setStatusData(validated);
|
|
99
|
-
setChecking(false);
|
|
100
|
-
}, [t]);
|
|
101
|
-
const handleApplyFullUpdate = useCallback(async () => {
|
|
102
|
-
setShowFullUpdateDialog(false);
|
|
103
|
-
setFullUpdating(true);
|
|
104
|
-
setUpdateResult(null);
|
|
105
|
-
const result = await applyFullUpdate();
|
|
106
|
-
setFullUpdating(false);
|
|
107
|
-
if (!result.success) {
|
|
108
|
-
setUpdateResult({ success: false, message: result.error ?? 'Unknown error' });
|
|
109
|
-
toast.error(t('pages.update.updateFailed', { message: result.error ?? 'Unknown error' }));
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
const data = result.data;
|
|
113
|
-
if (data.state === 'update_in_progress' && data.transactionId) {
|
|
114
|
-
// PRI-853 (SPEC §12.1): an ACCEPTED request is not a completed update.
|
|
115
|
-
// Track the detached transaction; only its terminal phase ends this flow.
|
|
116
|
-
setInProgress({ transactionId: data.transactionId, phase: null });
|
|
117
|
-
toast.info(t('pages.update.inProgressToast'));
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
if (data.success) {
|
|
121
|
-
setUpdateResult({
|
|
122
|
-
success: true,
|
|
123
|
-
message: data.message,
|
|
124
|
-
newVersion: data.newVersion,
|
|
125
|
-
fromVersion: statusData?.currentVersion,
|
|
126
|
-
requiresRestart: data.requiresRestart,
|
|
127
|
-
gatewayNotice: data.gatewayNotice,
|
|
128
|
-
});
|
|
129
|
-
toast.success(t('pages.update.fullUpdateSuccess'));
|
|
130
|
-
await loadData();
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
setUpdateResult({
|
|
134
|
-
success: false,
|
|
135
|
-
refusal: data.refusal,
|
|
136
|
-
message: data.message,
|
|
137
|
-
reason: data.reason,
|
|
138
|
-
nextAction: data.nextAction,
|
|
139
|
-
gatewayNotice: data.gatewayNotice,
|
|
140
|
-
});
|
|
141
|
-
toast.error(t('pages.update.updateFailed', { message: data.message }));
|
|
142
|
-
}
|
|
143
|
-
}, [t, loadData, statusData?.currentVersion]);
|
|
144
|
-
// PRI-853: poll the detached update's transaction until a terminal phase.
|
|
145
|
-
useEffect(() => {
|
|
146
|
-
if (!inProgress)
|
|
147
|
-
return;
|
|
148
|
-
let cancelled = false;
|
|
149
|
-
let attempts = 0;
|
|
150
|
-
const tick = async () => {
|
|
151
|
-
if (cancelled)
|
|
152
|
-
return;
|
|
153
|
-
attempts += 1;
|
|
154
|
-
const result = await fetchUpdateTransaction(inProgress.transactionId);
|
|
155
|
-
if (cancelled)
|
|
156
|
-
return;
|
|
157
|
-
const tx = result.success ? validateUpdateTransaction(result.data) : null;
|
|
158
|
-
if (tx === null || !tx.exists) {
|
|
159
|
-
if (attempts >= 200) {
|
|
160
|
-
setInProgress(null);
|
|
161
|
-
setUpdateResult({ success: false, message: t('pages.update.inProgressTimeout'), reason: 'transaction_unresolved' });
|
|
162
|
-
}
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
setInProgress({ transactionId: inProgress.transactionId, phase: tx.lastState });
|
|
166
|
-
if (!tx.terminal)
|
|
167
|
-
return;
|
|
168
|
-
setInProgress(null);
|
|
169
|
-
if (tx.lastState === 'confirmed') {
|
|
170
|
-
setUpdateResult({ success: true, message: t('pages.update.inProgressConfirmed', { version: tx.productVersion ?? '' }), requiresRestart: true });
|
|
171
|
-
toast.success(t('pages.update.fullUpdateSuccess'));
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
setUpdateResult({ success: false, message: t('pages.update.inProgressEnded', { state: tx.lastState ?? '' }) });
|
|
175
|
-
}
|
|
176
|
-
await loadData();
|
|
177
|
-
};
|
|
178
|
-
const timer = setInterval(tick, 3000);
|
|
179
|
-
void tick();
|
|
180
|
-
return () => { cancelled = true; clearInterval(timer); };
|
|
181
|
-
}, [inProgress?.transactionId, t, loadData]);
|
|
182
|
-
// ── Loading state ────────────────────────────────────────────────────────
|
|
183
|
-
if (loadingState === "loading") {
|
|
184
|
-
return (_jsx(PageShell, { children: _jsx(PageLoading, { cardCount: 2, label: t("common.loading") }) }));
|
|
185
|
-
}
|
|
186
|
-
// ── Error state (ERR-002: degradation with reason) ───────────────────────
|
|
187
|
-
if (loadingState === "error") {
|
|
188
|
-
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 }))] })] }));
|
|
189
|
-
}
|
|
190
|
-
// ── Loaded state ─────────────────────────────────────────────────────────
|
|
191
|
-
// PRI-848 (SPEC §12.1): explicit state contract. Servers predating the
|
|
192
|
-
// contract fall back to the legacy hasUpdate/error derivation.
|
|
193
|
-
const updateState = statusData?.state ??
|
|
194
|
-
(statusData ? (statusData.error ? 'check_failed' : statusData.hasUpdate ? 'update_available' : 'up_to_date') : 'up_to_date');
|
|
195
|
-
const isUpToDate = updateState === 'up_to_date';
|
|
196
|
-
// SPEC §12.1: reason codes localize; an unmapped code falls back to the raw
|
|
197
|
-
// value instead of hiding it.
|
|
198
|
-
const localizedReason = (reason) => reason ? t(`pages.update.reason.${reason}`, { defaultValue: reason }) : undefined;
|
|
199
|
-
const blockedReason = updateState === 'update_blocked' || updateState === 'check_failed'
|
|
200
|
-
? localizedReason(statusData?.reason)
|
|
201
|
-
: undefined;
|
|
202
|
-
return (_jsxs(PageShell, { children: [_jsxs("div", { className: "animate-[pdFadeIn_400ms_ease-out]", children: [recoveryData?.needsRecovery && recoveryData.unfinished.length > 0 && (_jsxs("div", { className: "mb-6 p-4 bg-amber/5 border border-amber/35 rounded-[6px] text-[13px] leading-relaxed text-ink-2", role: "alert", children: [_jsx("p", { className: "font-medium text-amber", children: t("pages.update.recoveryBanner") }), recoveryData.unfinished.slice(0, 3).map((item) => (_jsx("p", { className: "mt-1 font-mono text-[12px] text-ink-3", children: t("pages.update.recoveryItem", {
|
|
203
|
-
id: item.transactionId,
|
|
204
|
-
phase: item.lastState ?? "—",
|
|
205
|
-
}) }, item.transactionId))), recoveryData.nextAction && (_jsx("p", { className: "mt-2 text-[12px] text-ink-3", children: recoveryData.nextAction }))] })), recoveryData?.needsRecovery && recoveryData.recoveryRequired.length > 0 && (_jsxs("div", { className: "mb-6 p-4 bg-amber/5 border border-amber/35 rounded-[6px] text-[13px] leading-relaxed text-ink-2", role: "alert", children: [_jsx("p", { className: "font-medium text-amber", children: t("pages.update.recoveryRequiredBanner") }), recoveryData.recoveryRequired.slice(0, 3).map((item) => (_jsx("p", { className: "mt-1 font-mono text-[12px] text-ink-3", children: t("pages.update.recoveryRequiredItem", { id: item.transactionId }) }, item.transactionId))), recoveryData.nextAction && (_jsx("p", { className: "mt-2 text-[12px] text-ink-3", children: recoveryData.nextAction }))] })), _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 ?? "—" })] }), statusData?.identityDivergence && (_jsx("div", { className: "border border-amber/35 rounded-[4px] px-3 py-2 text-[12px] leading-relaxed text-ink-2", children: t("pages.update.identityDivergence", {
|
|
206
|
-
active: statusData.identityDivergence.activeVersion,
|
|
207
|
-
plugin: statusData.identityDivergence.pluginVersion,
|
|
208
|
-
}) })), _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: updateState === 'check_failed' ? "—" : (statusData?.latestVersion || "—") }), updateState === 'check_failed' && (_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.checkFailed") })), updateState === 'update_blocked' && (_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.blockedBadge") })), updateState === 'up_to_date' && (_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") })), updateState === 'update_available' && (_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") }))] })] })] }), (updateState === 'update_blocked' || updateState === 'check_failed') && (_jsxs("div", { className: "mt-4 pt-3 border-t border-line text-[12px] leading-relaxed", children: [blockedReason && (_jsxs("p", { className: "text-ink-2", children: [t("pages.update.reasonLabel"), blockedReason] })), statusData?.message && updateState === 'update_blocked' && (_jsx("p", { className: "mt-1 text-ink-3", children: statusData.message })), statusData?.nextAction && (_jsx("p", { className: "mt-1 text-ink-3 font-mono", children: statusData.nextAction }))] })), statusData?.error && (_jsxs("div", { className: "mt-4 pt-3 border-t border-line text-[12px] text-ink-4 font-mono", children: [t("pages.update.checkError"), ": ", statusData.error] })), inProgress && (_jsxs("div", { className: "mt-4 p-4 rounded-[6px] border border-gov/30 bg-surface text-[13px] leading-relaxed", role: "status", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Loader2, { className: "h-4 w-4 animate-spin text-gov" }), _jsx("span", { className: "font-medium text-ink", children: t("pages.update.inProgressPanel") })] }), _jsx("p", { className: "mt-1 font-mono text-[12px] text-ink-3", children: t("pages.update.inProgressPhase", { phase: inProgress.phase ?? "…" }) }), _jsx("p", { className: "mt-1 font-mono text-[12px] text-ink-4", children: inProgress.transactionId })] })), _jsxs("div", { className: "mt-5 pt-4 border-t border-line flex items-center gap-3 flex-wrap", children: [_jsx("button", { type: "button", onClick: handleCheckForUpdates, disabled: checking || fullUpdating || inProgress !== null, 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") }), !isUpToDate && updateState === 'update_available' && (_jsx("button", { type: "button", onClick: () => setShowFullUpdateDialog(true), disabled: checking || fullUpdating || inProgress !== null, className: "bg-gov text-white rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:bg-gov/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2", children: fullUpdating ? (_jsxs("span", { className: "flex items-center gap-1.5", children: [_jsx(Loader2, { className: "h-3.5 w-3.5 animate-spin" }), t("pages.update.updating")] })) : (t("pages.update.applyUpdate")) }))] }), updateResult && (_jsx("div", { className: `mt-4 p-4 rounded-[6px] border animate-[pdFadeIn_400ms_ease-out] ${updateResult.success ? 'bg-green/5 border-green/20' : updateResult.refusal ? 'bg-amber/5 border-amber/25' : 'bg-danger/5 border-danger/20'}`, children: _jsxs("div", { className: "flex items-start gap-3", children: [updateResult.success ? (_jsx(CheckCircle2, { className: "h-6 w-6 text-green shrink-0 mt-0.5 animate-[pdFadeIn_600ms_ease-out]", style: { transform: 'scale(1)', animationFillMode: 'both' } })) : updateResult.refusal ? (_jsx(AlertTriangle, { className: "h-6 w-6 text-amber shrink-0 mt-0.5" })) : (_jsx(XCircle, { className: "h-6 w-6 text-danger shrink-0 mt-0.5" })), _jsxs("div", { className: "flex-1 min-w-0", children: [updateResult.refusal && (_jsx("p", { className: "text-[12px] font-mono uppercase text-amber mb-1", children: t("pages.update.blockedBadge") })), updateResult.success && updateResult.fromVersion && updateResult.newVersion && (_jsxs("div", { className: "flex items-center gap-2 mb-1.5", children: [_jsx("span", { className: "font-mono text-[13px] text-ink-3 line-through", children: updateResult.fromVersion }), _jsx(ArrowRight, { className: "h-3.5 w-3.5 text-green" }), _jsx("span", { className: "font-mono text-[13px] text-green font-medium", children: updateResult.newVersion })] })), _jsx("p", { className: `text-[13px] ${updateResult.success ? 'text-green' : updateResult.refusal ? 'text-ink-2' : 'text-danger'}`, children: updateResult.message }), updateResult.success && updateResult.requiresRestart && (_jsx("p", { className: "mt-2 p-2 rounded-[3px] bg-amber/5 border border-amber/20 text-[12px] text-amber leading-relaxed", children: t("pages.update.fullUpdateRestartPrompt") })), updateResult.gatewayNotice && (_jsx("p", { className: "mt-2 p-2 rounded-[3px] bg-amber/5 border border-amber/20 text-[12px] text-amber leading-relaxed font-mono", children: updateResult.gatewayNotice })), !updateResult.success && updateResult.nextAction && (_jsx("p", { className: "mt-1 text-[12px] text-ink-4 font-mono leading-relaxed", children: updateResult.nextAction })), !updateResult.success && (_jsxs("div", { className: "mt-2 flex items-center gap-2", children: [/network|fetch|timeout|ECONNREFUSED|ENOTFOUND/i.test(updateResult.message) && (_jsx("p", { className: "text-[12px] text-ink-4 font-mono", children: t("pages.update.networkErrorHint") })), _jsx("button", { type: "button", onClick: () => setShowFullUpdateDialog(true), disabled: fullUpdating, className: "text-[12px] text-danger underline hover:text-danger/80 disabled:opacity-50", children: t("pages.update.retry") })] }))] })] }) }))] })] }), _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) => (_jsxs("article", { className: "bg-panel border border-line rounded-[6px] px-5 py-4", children: [_jsxs("div", { className: "flex items-center justify-between", 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") }), _jsxs("span", { className: "font-mono text-[13px] text-ink", children: [entry.fromVersion, " \u2192 ", entry.toVersion === "failed" ? "—" : entry.toVersion] }), entry.kind !== "failure" && (_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.historyKind.${entry.kind}`) })), !entry.success && entry.kind !== 'refusal' && (_jsx("span", { className: "inline-flex items-center border border-danger/35 text-danger rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase", children: t("pages.update.failed") }))] }), _jsx("div", { className: "flex items-center gap-3", children: _jsx("span", { className: "text-ink-3 text-[13px]", children: formatDate(entry.timestamp, i18n.language, {
|
|
209
|
-
year: "numeric",
|
|
210
|
-
month: "short",
|
|
211
|
-
day: "numeric",
|
|
212
|
-
hour: "2-digit",
|
|
213
|
-
minute: "2-digit",
|
|
214
|
-
}) }) })] }), (entry.reason || entry.nextAction) && (_jsxs("div", { className: "mt-3 border-t border-line pt-3 text-[12px] leading-relaxed text-ink-3", children: [entry.reason && _jsx("p", { children: entry.reason }), entry.nextAction && _jsx("p", { className: "mt-1 text-ink-2", children: entry.nextAction })] }))] }, entry.id))) })) : (_jsx("div", { className: "text-ink-3 text-[13px] leading-relaxed py-3", children: t("pages.update.noHistory") }))] })] }), _jsx(AlertDialog, { open: showFullUpdateDialog, onOpenChange: setShowFullUpdateDialog, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: t("pages.update.confirmFullUpdateTitle") }), _jsx(AlertDialogDescription, { children: t("pages.update.confirmFullUpdateDesc") })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: t("common.cancel") }), _jsx(AlertDialogAction, { onClick: handleApplyFullUpdate, children: t("pages.update.applyFullUpdate") })] })] }) })] }));
|
|
215
|
-
}
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect, useCallback, useRef } from 'react';
|
|
3
|
-
import { useNavigate } from 'react-router-dom';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { CircuitDiagram } from '../../components/onboarding/CircuitDiagram.js';
|
|
6
|
-
import { DemoResultView } from '../../components/onboarding/DemoResultView.js';
|
|
7
|
-
import { SlashCommandsCard } from '../../components/onboarding/SlashCommandsCard.js';
|
|
8
|
-
import { ONBOARDING_SLASH_COMMANDS } from '../../components/onboarding/slashCommands.js';
|
|
9
|
-
import { getOnboardingState, setOnboardingState } from '../../utils/onboarding-state.js';
|
|
10
|
-
import { request } from '../../api.js';
|
|
11
|
-
// Polling configuration for step 4 evidence detection (spec 6.5.2).
|
|
12
|
-
const TWO_HOURS_MS = 2 * 60 * 60 * 1000;
|
|
13
|
-
const POLL_INTERVAL_MS = 30 * 1000;
|
|
14
|
-
// rc-1/rc-2/rc-4: validate the demo response shape before use.
|
|
15
|
-
// The backend owns this shape, but parsed JSON is treated as unknown.
|
|
16
|
-
function isDemoStage(value) {
|
|
17
|
-
if (typeof value !== 'object' || value === null)
|
|
18
|
-
return false;
|
|
19
|
-
const name = Object.hasOwn(value, 'name') ? Reflect.get(value, 'name') : undefined;
|
|
20
|
-
const status = Object.hasOwn(value, 'status') ? Reflect.get(value, 'status') : undefined;
|
|
21
|
-
if (typeof name !== 'string')
|
|
22
|
-
return false;
|
|
23
|
-
return status === 'passed' || status === 'failed' || status === 'degraded' || status === 'skipped';
|
|
24
|
-
}
|
|
25
|
-
function parseDemoResponse(value) {
|
|
26
|
-
if (typeof value !== 'object' || value === null)
|
|
27
|
-
return null;
|
|
28
|
-
const v = value;
|
|
29
|
-
if (typeof v.simulated !== 'boolean')
|
|
30
|
-
return null;
|
|
31
|
-
if (typeof v.demo !== 'object' || v.demo === null)
|
|
32
|
-
return null;
|
|
33
|
-
const d = v.demo;
|
|
34
|
-
if (typeof d.status !== 'string')
|
|
35
|
-
return null;
|
|
36
|
-
const demo = { status: d.status };
|
|
37
|
-
if (typeof d.generatedAt === 'string')
|
|
38
|
-
demo.generatedAt = d.generatedAt;
|
|
39
|
-
if (typeof d.narrative === 'string')
|
|
40
|
-
demo.narrative = d.narrative;
|
|
41
|
-
if (typeof d.storyDescription === 'string')
|
|
42
|
-
demo.storyDescription = d.storyDescription;
|
|
43
|
-
if (typeof d.simulated === 'boolean')
|
|
44
|
-
demo.simulated = d.simulated;
|
|
45
|
-
if (Object.hasOwn(d, 'stages')) {
|
|
46
|
-
if (!Array.isArray(d.stages) || !d.stages.every(isDemoStage))
|
|
47
|
-
return null;
|
|
48
|
-
demo.stages = d.stages;
|
|
49
|
-
}
|
|
50
|
-
return { demo, simulated: v.simulated };
|
|
51
|
-
}
|
|
52
|
-
export function WelcomePage({ workspaceId }) {
|
|
53
|
-
const { t } = useTranslation();
|
|
54
|
-
const navigate = useNavigate();
|
|
55
|
-
const [step, setStep] = useState(1);
|
|
56
|
-
const [demoStatus, setDemoStatus] = useState('idle');
|
|
57
|
-
const [demoResult, setDemoResult] = useState(null);
|
|
58
|
-
const [demoError, setDemoError] = useState(null);
|
|
59
|
-
const [stateError, setStateError] = useState(null);
|
|
60
|
-
const [pollingActive, setPollingActive] = useState(false);
|
|
61
|
-
const [pollingStatus, setPollingStatus] = useState('idle');
|
|
62
|
-
const [pollingError, setPollingError] = useState(null);
|
|
63
|
-
// Refs for polling cleanup (spec 6.5.2 test case 3: unmount clears timers).
|
|
64
|
-
const pollingIntervalRef = useRef(null);
|
|
65
|
-
const pollingTimeoutRef = useRef(null);
|
|
66
|
-
// P2-2B: track consecutive polling errors; after 3, stop polling and surface
|
|
67
|
-
// the failure (rc-9: no silent fallback). Reset to 0 on any successful poll.
|
|
68
|
-
const errorCountRef = useRef(0);
|
|
69
|
-
// P2-3: baseline record count captured when polling starts, so we only
|
|
70
|
-
// trigger evidence-found on NEW evidence (not pre-existing records).
|
|
71
|
-
const baselineCountRef = useRef(0);
|
|
72
|
-
// If onboarding was already completed for this workspace, skip the wizard.
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
const state = getOnboardingState(workspaceId);
|
|
75
|
-
if (state.completed) {
|
|
76
|
-
navigate('/focus', { replace: true });
|
|
77
|
-
}
|
|
78
|
-
}, [workspaceId, navigate]);
|
|
79
|
-
const completeOnboarding = useCallback((status) => {
|
|
80
|
-
if (!setOnboardingState(workspaceId, {
|
|
81
|
-
completed: true,
|
|
82
|
-
step: 4,
|
|
83
|
-
status,
|
|
84
|
-
completedAt: new Date().toISOString(),
|
|
85
|
-
})) {
|
|
86
|
-
setStateError(t('pages.welcome.stateSaveError'));
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
navigate('/focus', { replace: true });
|
|
90
|
-
}, [workspaceId, navigate, t]);
|
|
91
|
-
const runDemo = useCallback(async () => {
|
|
92
|
-
setDemoStatus('loading');
|
|
93
|
-
setDemoError(null);
|
|
94
|
-
try {
|
|
95
|
-
const response = await request('/api/v1/onboarding/run-demo', { method: 'POST' }, parseDemoResponse);
|
|
96
|
-
if (!response.success) {
|
|
97
|
-
throw new Error(response.error);
|
|
98
|
-
}
|
|
99
|
-
setDemoResult(response.data.demo);
|
|
100
|
-
setDemoStatus('success');
|
|
101
|
-
}
|
|
102
|
-
catch (err) {
|
|
103
|
-
const message = err instanceof Error ? err.message : 'Demo failed to start';
|
|
104
|
-
setDemoError(message);
|
|
105
|
-
setDemoStatus('error');
|
|
106
|
-
}
|
|
107
|
-
}, []);
|
|
108
|
-
const skipOnboarding = useCallback(() => {
|
|
109
|
-
completeOnboarding('skipped');
|
|
110
|
-
}, [completeOnboarding]);
|
|
111
|
-
// EP-05 (Loop State Freshness): each poll fetches fresh evidence.
|
|
112
|
-
const stopPolling = useCallback(() => {
|
|
113
|
-
setPollingActive(false);
|
|
114
|
-
if (pollingIntervalRef.current) {
|
|
115
|
-
clearInterval(pollingIntervalRef.current);
|
|
116
|
-
pollingIntervalRef.current = null;
|
|
117
|
-
}
|
|
118
|
-
if (pollingTimeoutRef.current) {
|
|
119
|
-
clearTimeout(pollingTimeoutRef.current);
|
|
120
|
-
pollingTimeoutRef.current = null;
|
|
121
|
-
}
|
|
122
|
-
}, []);
|
|
123
|
-
const startPolling = useCallback(() => {
|
|
124
|
-
setPollingActive(true);
|
|
125
|
-
setPollingStatus('polling');
|
|
126
|
-
setPollingError(null);
|
|
127
|
-
errorCountRef.current = 0;
|
|
128
|
-
pollingTimeoutRef.current = setTimeout(() => {
|
|
129
|
-
setPollingStatus('timeout');
|
|
130
|
-
stopPolling();
|
|
131
|
-
}, TWO_HOURS_MS);
|
|
132
|
-
// P2-3: capture baseline count on first poll, then only trigger
|
|
133
|
-
// evidence-found when count exceeds baseline (NEW evidence appeared).
|
|
134
|
-
let baselineCaptured = false;
|
|
135
|
-
const checkForEvidence = async () => {
|
|
136
|
-
try {
|
|
137
|
-
const response = await request('/api/v1/evidence-chain');
|
|
138
|
-
// P2-A: request() returns { success: false, error } on HTTP/network
|
|
139
|
-
// errors instead of throwing. Convert non-success into a thrown error
|
|
140
|
-
// so the catch block (error counter + retry UI) actually fires.
|
|
141
|
-
if (!response.success) {
|
|
142
|
-
throw new Error(response.error || 'Failed to fetch evidence');
|
|
143
|
-
}
|
|
144
|
-
if (response.data) {
|
|
145
|
-
const data = response.data;
|
|
146
|
-
if (typeof data === 'object' && data !== null && Object.hasOwn(data, 'records')) {
|
|
147
|
-
const records = data.records;
|
|
148
|
-
if (Array.isArray(records)) {
|
|
149
|
-
// P2-2B: a successful poll with valid data resets the error streak.
|
|
150
|
-
errorCountRef.current = 0;
|
|
151
|
-
if (!baselineCaptured) {
|
|
152
|
-
// First poll: capture baseline count, do not trigger.
|
|
153
|
-
baselineCountRef.current = records.length;
|
|
154
|
-
baselineCaptured = true;
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
if (records.length > baselineCountRef.current) {
|
|
158
|
-
setPollingStatus('evidence-found');
|
|
159
|
-
stopPolling();
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
catch {
|
|
166
|
-
// P2-2B (rc-9: no silent fallback) — surface the failure instead of
|
|
167
|
-
// swallowing it. After 3 consecutive errors, stop polling and show the
|
|
168
|
-
// error UI so the user can retry rather than waiting up to 2 hours.
|
|
169
|
-
errorCountRef.current += 1;
|
|
170
|
-
setPollingError(t('pages.welcome.step4.pollingError'));
|
|
171
|
-
if (errorCountRef.current >= 3) {
|
|
172
|
-
setPollingStatus('error');
|
|
173
|
-
stopPolling();
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
checkForEvidence();
|
|
178
|
-
pollingIntervalRef.current = setInterval(checkForEvidence, POLL_INTERVAL_MS);
|
|
179
|
-
}, [stopPolling, t]);
|
|
180
|
-
// Cleanup on unmount (spec 6.5.2 test case 3: no memory leak).
|
|
181
|
-
useEffect(() => {
|
|
182
|
-
return () => {
|
|
183
|
-
stopPolling();
|
|
184
|
-
};
|
|
185
|
-
}, [stopPolling]);
|
|
186
|
-
return (_jsxs("div", { className: "welcome-page", role: "main", children: [_jsxs("header", { className: "welcome-header", children: [_jsx("h1", { children: t('pages.welcome.title') }), _jsx("p", { className: "welcome-subtitle", children: t('pages.welcome.subtitle') }), _jsx("div", { className: "welcome-step-indicator", role: "progressbar", "aria-valuetext": t('pages.welcome.stepIndicator', { current: step, total: 4 }), children: [1, 2, 3, 4].map((s) => (_jsx("span", { className: `step-dot ${s === step ? 'active' : ''} ${s < step ? 'completed' : ''}` }, s))) })] }), stateError && _jsx("p", { className: "polling-error", role: "alert", children: stateError }), step === 1 && (_jsxs("section", { className: "welcome-step welcome-step-1", "aria-labelledby": "step1-title", children: [_jsx("h2", { id: "step1-title", children: t('pages.welcome.step1.title') }), _jsx("p", { children: t('pages.welcome.step1.description') }), _jsx(CircuitDiagram, {}), _jsxs("div", { className: "welcome-actions", children: [_jsx("button", { className: "pd-btn pd-btn-brand", onClick: () => setStep(2), children: t('pages.welcome.step1.startButton') }), _jsx("button", { className: "pd-btn pd-btn-alt", onClick: skipOnboarding, children: t('pages.welcome.step1.skipButton') })] })] })), step === 2 && (_jsxs("section", { className: "welcome-step welcome-step-2", "aria-labelledby": "step2-title", children: [_jsx("h2", { id: "step2-title", children: t('pages.welcome.step2.title') }), _jsx("p", { children: t('pages.welcome.step2.description') }), _jsx(DemoResultView, { result: demoResult, loading: demoStatus === 'loading', error: demoError }), _jsxs("div", { className: "welcome-actions", children: [demoStatus === 'idle' && (_jsx("button", { className: "pd-btn pd-btn-brand", onClick: runDemo, children: t('pages.welcome.step2.runDemoButton') })), (demoStatus === 'success' || demoStatus === 'error') && (_jsx("button", { className: "pd-btn pd-btn-alt", onClick: () => setStep(3), children: t('pages.welcome.step2.nextButton') }))] })] })), step === 3 && (_jsxs("section", { className: "welcome-step welcome-step-3", "aria-labelledby": "step3-title", children: [_jsx("h2", { id: "step3-title", children: t('pages.welcome.step3.title') }), _jsx("p", { children: t('pages.welcome.step3.description') }), _jsx("p", { className: "slash-commands-intro", children: t('pages.welcome.step3.commandsIntro') }), _jsx(SlashCommandsCard, { commands: ONBOARDING_SLASH_COMMANDS }), _jsxs("div", { className: "welcome-actions", children: [_jsx("button", { className: "pd-btn pd-btn-brand", onClick: () => setStep(4), children: t('pages.welcome.step3.nextButton') }), _jsx("button", { className: "pd-btn pd-btn-alt", onClick: skipOnboarding, children: t('pages.welcome.step1.skipButton') })] })] })), step === 4 && (_jsxs("section", { className: "welcome-step welcome-step-4", "aria-labelledby": "step4-title", children: [_jsx("h2", { id: "step4-title", children: t('pages.welcome.step4.title') }), _jsx("p", { children: t('pages.welcome.step4.description') }), _jsxs("div", { className: "example-prompt", role: "note", children: [_jsx("span", { className: "prompt-label", children: t('pages.welcome.step4.examplePrompt') }), _jsx("code", { className: "prompt-text", children: t('pages.welcome.step4.examplePromptText') })] }), pollingStatus === 'idle' && (_jsxs(_Fragment, { children: [_jsx("p", { className: "window-hint", children: t('pages.welcome.step4.windowHint') }), _jsxs("div", { className: "welcome-actions", children: [_jsx("button", { className: "pd-btn pd-btn-brand", onClick: () => { startPolling(); }, children: t('pages.welcome.step4.tryNowButton') }), _jsx("button", { className: "pd-btn pd-btn-alt", onClick: () => completeOnboarding('demo'), children: t('pages.welcome.step4.goToFocusButton') }), _jsx("button", { className: "pd-btn pd-btn-alt", onClick: skipOnboarding, children: t('pages.welcome.step4.skipButton') })] })] })), pollingStatus === 'polling' && (_jsxs("div", { className: "polling-active", role: "status", "aria-live": "polite", children: [_jsx("p", { children: t('pages.welcome.step4.pollingActive') }), _jsx("button", { className: "pd-btn pd-btn-alt", onClick: () => { stopPolling(); completeOnboarding('demo'); }, children: t('pages.welcome.step4.stopPollingButton') })] })), pollingStatus === 'evidence-found' && (_jsxs("div", { className: "polling-success", role: "status", children: [_jsx("p", { children: t('pages.welcome.step4.evidenceFound') }), _jsx("button", { className: "pd-btn pd-btn-brand", onClick: () => completeOnboarding('evidence_found'), children: t('pages.welcome.step4.goToFocusButton') })] })), pollingStatus === 'timeout' && (_jsxs("div", { className: "polling-timeout", role: "status", children: [_jsx("p", { children: t('pages.welcome.step4.timeoutHint') }), _jsx("button", { className: "pd-btn pd-btn-brand", onClick: () => completeOnboarding('demo'), children: t('pages.welcome.step4.goToFocusButton') }), _jsx("button", { className: "pd-btn pd-btn-alt", onClick: skipOnboarding, children: t('pages.welcome.step4.skipButton') })] })), pollingStatus === 'error' && (_jsxs("div", { className: "polling-error", role: "alert", children: [_jsx("p", { children: pollingError ?? t('pages.welcome.step4.pollingError') }), _jsxs("div", { className: "welcome-actions", children: [_jsx("button", { className: "pd-btn pd-btn-brand", onClick: () => { startPolling(); }, children: t('pages.welcome.step4.retryButton') }), _jsx("button", { className: "pd-btn pd-btn-alt", onClick: () => completeOnboarding('demo'), children: t('pages.welcome.step4.goToFocusButton') })] })] }))] }))] }));
|
|
187
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent Metadata — Control Center agent grouping & role descriptions
|
|
3
|
-
*
|
|
4
|
-
* Pure data module (no React, no I/O). Defines:
|
|
5
|
-
* - Which dependency cluster each of the 9 internal agents belongs to
|
|
6
|
-
* - Bilingual role / detail / impact / tech-detail text for progressive disclosure
|
|
7
|
-
* - Whether toggling the agent off requires inline confirmation (isCore)
|
|
8
|
-
*
|
|
9
|
-
* Content source: design-prototype/control-center.html (approved prototype).
|
|
10
|
-
* Agent names match INTERNAL_AGENT_NAMES from @principles/core (camelCase).
|
|
11
|
-
*
|
|
12
|
-
* ERR entries:
|
|
13
|
-
* - rc-1: pure static data, no untrusted input
|
|
14
|
-
* - rc-2: no `as` bypasses
|
|
15
|
-
* - rc-5: consumers use Object.hasOwn() to look up metadata by agent name
|
|
16
|
-
*/
|
|
17
|
-
import type { InternalAgentName } from '@principles/core/runtime-v2';
|
|
18
|
-
export type AgentGroup = 'core_trio' | 'code_chain' | 'quality_polish' | 'sidechain';
|
|
19
|
-
export type ImpactLevel = 'danger' | 'amber' | 'green';
|
|
20
|
-
export type GroupTag = 'must' | 'recommend' | 'optional' | 'independent';
|
|
21
|
-
export interface AgentMeta {
|
|
22
|
-
name: InternalAgentName;
|
|
23
|
-
group: AgentGroup;
|
|
24
|
-
/** 中文角色名(如"诊断师") */
|
|
25
|
-
displayNameZh: string;
|
|
26
|
-
displayNameEn: string;
|
|
27
|
-
/** 一句话角色(L1 折叠态显示) */
|
|
28
|
-
roleZh: string;
|
|
29
|
-
roleEn: string;
|
|
30
|
-
/** 展开后的详细说明(L2),段落用 \n\n 分隔 */
|
|
31
|
-
detailZh: string;
|
|
32
|
-
detailEn: string;
|
|
33
|
-
/** 关掉会怎样(L2 impact box) */
|
|
34
|
-
impactLevel: ImpactLevel;
|
|
35
|
-
impactZh: string;
|
|
36
|
-
impactEn: string;
|
|
37
|
-
/** 技术细节(L3 嵌套折叠)— 键为标签,值可含反引号包裹的 code 片段 */
|
|
38
|
-
techDetailZh: Record<string, string>;
|
|
39
|
-
techDetailEn: Record<string, string>;
|
|
40
|
-
/** 是否核心代理(关掉需 inline confirm)。true 对应原型 data-core="true" */
|
|
41
|
-
isCore: boolean;
|
|
42
|
-
/** MVP 状态说明(可选,仅 philosopher/rolloutReviewer 有) */
|
|
43
|
-
mvpNoteZh?: string;
|
|
44
|
-
mvpNoteEn?: string;
|
|
45
|
-
/** 操作入口(可选,仅侧链代理用于跳转管理页面) */
|
|
46
|
-
action?: ActionMeta;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* 操作入口(可选,仅侧链代理用于跳转管理页面)
|
|
50
|
-
*/
|
|
51
|
-
export interface ActionMeta {
|
|
52
|
-
/** 链接文本(中) */
|
|
53
|
-
linkTextZh: string;
|
|
54
|
-
/** 链接文本(英) */
|
|
55
|
-
linkTextEn: string;
|
|
56
|
-
/** 路由路径 */
|
|
57
|
-
to: string;
|
|
58
|
-
}
|
|
59
|
-
export interface AgentGroupMeta {
|
|
60
|
-
id: AgentGroup;
|
|
61
|
-
labelZh: string;
|
|
62
|
-
labelEn: string;
|
|
63
|
-
tag: GroupTag;
|
|
64
|
-
tagLabelZh: string;
|
|
65
|
-
tagLabelEn: string;
|
|
66
|
-
hintZh: string;
|
|
67
|
-
hintEn: string;
|
|
68
|
-
}
|
|
69
|
-
export declare const GROUP_ORDER: AgentGroup[];
|
|
70
|
-
export declare const AGENT_GROUPS: AgentGroupMeta[];
|
|
71
|
-
export declare const AGENT_METADATA: Record<InternalAgentName, AgentMeta>;
|