create-principles-disciple 1.146.3 → 1.146.6
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/console/dist/web/assets/app.js +26 -26
- package/console/package.json +1 -1
- package/package.json +3 -3
- package/pd-cli/package.json +1 -1
- package/release-manager/package.json +3 -3
- 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/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 +0,0 @@
|
|
|
1
|
-
import "@fontsource/jetbrains-mono";
|
package/console/dist/ui/main.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "@fontsource/jetbrains-mono";
|
|
3
|
-
import { createRoot } from "react-dom/client";
|
|
4
|
-
import { App } from "./App.js";
|
|
5
|
-
const rootEl = document.getElementById("root");
|
|
6
|
-
if (!rootEl) {
|
|
7
|
-
throw new Error("Root element not found");
|
|
8
|
-
}
|
|
9
|
-
createRoot(rootEl).render(_jsx(App, {}));
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
export type FeedbackType = 'bug' | 'confusing' | 'privacy_concern' | 'feature_request' | 'other';
|
|
2
|
-
export type UserSeverity = 'low' | 'medium' | 'high';
|
|
3
|
-
export type FeedbackFrequency = 'always' | 'often' | 'sometimes' | 'once';
|
|
4
|
-
export type FeedbackBlockingLevel = 'blocked' | 'workaround' | 'minor';
|
|
5
|
-
export type FeedbackStatus = 'draft' | 'submitted';
|
|
6
|
-
export type FeedbackSubmittedVia = 'ingest' | 'github' | 'email' | 'file';
|
|
7
|
-
export type DraftRecord = {
|
|
8
|
-
id: string;
|
|
9
|
-
createdAt: string;
|
|
10
|
-
type: FeedbackType;
|
|
11
|
-
title: string;
|
|
12
|
-
userText: {
|
|
13
|
-
description: string;
|
|
14
|
-
stepsToReproduce?: string;
|
|
15
|
-
expectedBehavior?: string;
|
|
16
|
-
actualBehavior?: string;
|
|
17
|
-
userSeverity?: UserSeverity;
|
|
18
|
-
goal?: string;
|
|
19
|
-
stuckAt?: string;
|
|
20
|
-
job?: string;
|
|
21
|
-
currentWorkaround?: string;
|
|
22
|
-
sawWhat?: string;
|
|
23
|
-
whereSeen?: string;
|
|
24
|
-
frequency?: FeedbackFrequency;
|
|
25
|
-
blockingLevel?: FeedbackBlockingLevel;
|
|
26
|
-
};
|
|
27
|
-
diagnosticSummary: {
|
|
28
|
-
versions: Record<string, unknown>;
|
|
29
|
-
platform: Record<string, unknown>;
|
|
30
|
-
featureFlags: Record<string, unknown>;
|
|
31
|
-
canary: {
|
|
32
|
-
status: 'available' | 'unavailable';
|
|
33
|
-
summary?: string;
|
|
34
|
-
unavailableReason?: string;
|
|
35
|
-
};
|
|
36
|
-
recentEvents: {
|
|
37
|
-
type: string;
|
|
38
|
-
at: string;
|
|
39
|
-
severity?: string;
|
|
40
|
-
summary: string;
|
|
41
|
-
}[];
|
|
42
|
-
};
|
|
43
|
-
privacy: {
|
|
44
|
-
includedSections: string[];
|
|
45
|
-
excludedByDefault: string[];
|
|
46
|
-
redactionNotes: string[];
|
|
47
|
-
};
|
|
48
|
-
outputs: {
|
|
49
|
-
markdown: string;
|
|
50
|
-
emailText: string;
|
|
51
|
-
githubIssueUrl: string;
|
|
52
|
-
mailtoUrl: string;
|
|
53
|
-
};
|
|
54
|
-
area?: string;
|
|
55
|
-
status?: FeedbackStatus;
|
|
56
|
-
submittedAt?: string;
|
|
57
|
-
submittedVia?: FeedbackSubmittedVia;
|
|
58
|
-
trackingId?: string;
|
|
59
|
-
externalUrl?: string;
|
|
60
|
-
};
|
|
61
|
-
export type FeedbackDraftSummary = {
|
|
62
|
-
id: string;
|
|
63
|
-
createdAt: string;
|
|
64
|
-
type: string;
|
|
65
|
-
title: string;
|
|
66
|
-
status?: string;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* 旧草稿 severity → blockingLevel 的展示映射(仅 UI 展示,不改文件,spec §5.2):
|
|
70
|
-
* high→blocked / medium→workaround / low→minor。
|
|
71
|
-
*/
|
|
72
|
-
export declare function mapSeverityToBlockingLevel(severity: UserSeverity | undefined): FeedbackBlockingLevel | undefined;
|
|
73
|
-
/**
|
|
74
|
-
* 从 context(page / sourceDetail)归一化出反馈来源 area(spec §7)。
|
|
75
|
-
* area 值:failed_tasks / pain / principles / activation / focus / intent / error / general。
|
|
76
|
-
* 匹配失败缺省返回 'general'。
|
|
77
|
-
*/
|
|
78
|
-
export declare function deriveFeedbackArea(context: Record<string, string> | undefined): string | undefined;
|
|
79
|
-
export declare function parseDraftRecord(value: unknown): DraftRecord | null;
|
|
80
|
-
export declare function parseDraftSummary(value: unknown): FeedbackDraftSummary | null;
|
|
81
|
-
export declare function parseEnvelopeReport(value: unknown): DraftRecord | null;
|
|
82
|
-
export declare function getErrorMessage(result: unknown, fallback: string): string;
|
|
83
|
-
export declare function buildFeedbackContextFromSearchParams(searchParams: URLSearchParams): Record<string, string> | undefined;
|
|
84
|
-
export type FeedbackDiagnostics = {
|
|
85
|
-
versions: Record<string, unknown>;
|
|
86
|
-
platform: Record<string, unknown>;
|
|
87
|
-
featureFlags: Record<string, unknown>;
|
|
88
|
-
canary: {
|
|
89
|
-
status: 'available' | 'unavailable';
|
|
90
|
-
summary?: string;
|
|
91
|
-
unavailableReason?: string;
|
|
92
|
-
};
|
|
93
|
-
recentEvents: {
|
|
94
|
-
type: string;
|
|
95
|
-
at: string;
|
|
96
|
-
summary: string;
|
|
97
|
-
severity?: string;
|
|
98
|
-
}[];
|
|
99
|
-
};
|
|
100
|
-
/** Minimal view of Promise.allSettled's settled result, parameterized by value. */
|
|
101
|
-
export type SettledResult<T> = {
|
|
102
|
-
status: 'fulfilled';
|
|
103
|
-
value: T;
|
|
104
|
-
} | {
|
|
105
|
-
status: 'rejected';
|
|
106
|
-
reason: unknown;
|
|
107
|
-
};
|
|
108
|
-
/** ApiResponse-shaped value used by api.ts request(). */
|
|
109
|
-
type ApiResult<T> = {
|
|
110
|
-
success: true;
|
|
111
|
-
data: T;
|
|
112
|
-
} | {
|
|
113
|
-
success: false;
|
|
114
|
-
error: string;
|
|
115
|
-
reason?: string;
|
|
116
|
-
nextAction?: string;
|
|
117
|
-
};
|
|
118
|
-
/**
|
|
119
|
-
* Build a diagnostics object from three concurrent API responses.
|
|
120
|
-
*
|
|
121
|
-
* Each input is a SettledResult<ApiResult<unknown>> — the shape produced by
|
|
122
|
-
* `Promise.allSettled([request(...), ...])`. When an API fails (rejected
|
|
123
|
-
* promise or ApiResult with success=false), the corresponding diagnostics
|
|
124
|
-
* fields record an `unavailableReason` string (rc-9-no-silent-fallback).
|
|
125
|
-
*
|
|
126
|
-
* Field mapping:
|
|
127
|
-
* - versions: P0-2: extracted from /api/health's `versions` field (added
|
|
128
|
-
* by HealthCheckModel.checkSystemHealth). Contains PD/core/node
|
|
129
|
-
* version strings.
|
|
130
|
-
* - platform: P0-2: extracted from /api/health's `platform` field. Contains
|
|
131
|
-
* os/arch/nodeVersion.
|
|
132
|
-
* - featureFlags: built from /api/v1/config/summary's `features` array. The
|
|
133
|
-
* full ConfigSummaryData object is passed through (the server's
|
|
134
|
-
* redactSensitiveFields scrubs it again as defense in depth).
|
|
135
|
-
* - canary: built from /api/health's `overall` field. 'healthy' and
|
|
136
|
-
* 'degraded' map to status='available'; 'error' maps to
|
|
137
|
-
* status='unavailable'.
|
|
138
|
-
* - recentEvents: P1-5: extracted from /api/v1/lifecycle/state's `recentEvents`
|
|
139
|
-
* array (each entry validated; last 5 kept). When the endpoint
|
|
140
|
-
* is absent (current state), falls back to /api/health's
|
|
141
|
-
* `checks` array so the report is not permanently empty.
|
|
142
|
-
*/
|
|
143
|
-
export declare function buildFeedbackDiagnostics(configSettled: SettledResult<ApiResult<unknown>>, lifecycleSettled: SettledResult<ApiResult<unknown>>, healthSettled: SettledResult<ApiResult<unknown>>): FeedbackDiagnostics;
|
|
144
|
-
export {};
|
|
@@ -1,418 +0,0 @@
|
|
|
1
|
-
// ReportProblemValidators.ts
|
|
2
|
-
// Runtime validators for feedback draft payloads received from the server.
|
|
3
|
-
// Extracted from ReportProblemPage.tsx so they can be unit-tested without
|
|
4
|
-
// pulling in React/JSX (vitest in this package runs in `node` environment).
|
|
5
|
-
//
|
|
6
|
-
// The server returns JSON parsed via the standard fetch path. Per ERR-001
|
|
7
|
-
// and ERR-005, every field must be runtime-validated before use; no `as`
|
|
8
|
-
// casts are allowed to bypass validation.
|
|
9
|
-
const FEEDBACK_FREQUENCIES = ['always', 'often', 'sometimes', 'once'];
|
|
10
|
-
const FEEDBACK_BLOCKING_LEVELS = ['blocked', 'workaround', 'minor'];
|
|
11
|
-
const FEEDBACK_SUBMITTED_VIA = ['ingest', 'github', 'email', 'file'];
|
|
12
|
-
function isFeedbackFrequency(value) {
|
|
13
|
-
return typeof value === 'string' && FEEDBACK_FREQUENCIES.includes(value);
|
|
14
|
-
}
|
|
15
|
-
function isFeedbackBlockingLevel(value) {
|
|
16
|
-
return typeof value === 'string' && FEEDBACK_BLOCKING_LEVELS.includes(value);
|
|
17
|
-
}
|
|
18
|
-
function isFeedbackSubmittedVia(value) {
|
|
19
|
-
return typeof value === 'string' && FEEDBACK_SUBMITTED_VIA.includes(value);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* 旧草稿 severity → blockingLevel 的展示映射(仅 UI 展示,不改文件,spec §5.2):
|
|
23
|
-
* high→blocked / medium→workaround / low→minor。
|
|
24
|
-
*/
|
|
25
|
-
export function mapSeverityToBlockingLevel(severity) {
|
|
26
|
-
if (severity === 'high')
|
|
27
|
-
return 'blocked';
|
|
28
|
-
if (severity === 'medium')
|
|
29
|
-
return 'workaround';
|
|
30
|
-
if (severity === 'low')
|
|
31
|
-
return 'minor';
|
|
32
|
-
return undefined;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* 从 context(page / sourceDetail)归一化出反馈来源 area(spec §7)。
|
|
36
|
-
* area 值:failed_tasks / pain / principles / activation / focus / intent / error / general。
|
|
37
|
-
* 匹配失败缺省返回 'general'。
|
|
38
|
-
*/
|
|
39
|
-
export function deriveFeedbackArea(context) {
|
|
40
|
-
if (!context)
|
|
41
|
-
return undefined;
|
|
42
|
-
const haystack = `${context.page ?? ''} ${context.sourceDetail ?? ''}`.toLowerCase();
|
|
43
|
-
const tokens = [
|
|
44
|
-
['failed_tasks', 'failed_tasks'],
|
|
45
|
-
['pain', 'pain'],
|
|
46
|
-
['principle', 'principles'],
|
|
47
|
-
['activation', 'activation'],
|
|
48
|
-
['focus', 'focus'],
|
|
49
|
-
['intent', 'intent'],
|
|
50
|
-
['error', 'error'],
|
|
51
|
-
];
|
|
52
|
-
for (const [token, area] of tokens) {
|
|
53
|
-
if (haystack.includes(token))
|
|
54
|
-
return area;
|
|
55
|
-
}
|
|
56
|
-
return undefined;
|
|
57
|
-
}
|
|
58
|
-
function isString(value) {
|
|
59
|
-
return typeof value === 'string';
|
|
60
|
-
}
|
|
61
|
-
function isRecord(value) {
|
|
62
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
63
|
-
}
|
|
64
|
-
function isStringArray(value) {
|
|
65
|
-
return Array.isArray(value) && value.every(isString);
|
|
66
|
-
}
|
|
67
|
-
function asRecord(v) {
|
|
68
|
-
return isRecord(v) ? v : {};
|
|
69
|
-
}
|
|
70
|
-
export function parseDraftRecord(value) {
|
|
71
|
-
if (!isRecord(value))
|
|
72
|
-
return null;
|
|
73
|
-
if (!isString(value.id) || !isString(value.createdAt) || !isString(value.title))
|
|
74
|
-
return null;
|
|
75
|
-
if (value.type !== 'bug' &&
|
|
76
|
-
value.type !== 'confusing' &&
|
|
77
|
-
value.type !== 'privacy_concern' &&
|
|
78
|
-
value.type !== 'feature_request' &&
|
|
79
|
-
value.type !== 'other') {
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
const userText = asRecord(value.userText);
|
|
83
|
-
if (!isString(userText.description))
|
|
84
|
-
return null;
|
|
85
|
-
const outputs = asRecord(value.outputs);
|
|
86
|
-
if (!isString(outputs.markdown) ||
|
|
87
|
-
!isString(outputs.emailText) ||
|
|
88
|
-
!isString(outputs.githubIssueUrl)) {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
const privacy = asRecord(value.privacy);
|
|
92
|
-
if (!isStringArray(privacy.includedSections) ||
|
|
93
|
-
!isStringArray(privacy.excludedByDefault) ||
|
|
94
|
-
!isStringArray(privacy.redactionNotes)) {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
const diagnostic = asRecord(value.diagnosticSummary);
|
|
98
|
-
const rawCanary = diagnostic.canary;
|
|
99
|
-
const canaryRecord = isRecord(rawCanary) ? rawCanary : null;
|
|
100
|
-
let canaryStatus = null;
|
|
101
|
-
if (canaryRecord && typeof canaryRecord.status === 'string' && (canaryRecord.status === 'available' || canaryRecord.status === 'unavailable')) {
|
|
102
|
-
canaryStatus = canaryRecord.status;
|
|
103
|
-
}
|
|
104
|
-
const validCanary = canaryStatus
|
|
105
|
-
? { status: canaryStatus, summary: typeof canaryRecord?.summary === 'string' ? canaryRecord.summary : undefined, unavailableReason: typeof canaryRecord?.unavailableReason === 'string' ? canaryRecord.unavailableReason : undefined }
|
|
106
|
-
: null;
|
|
107
|
-
return {
|
|
108
|
-
id: value.id,
|
|
109
|
-
createdAt: value.createdAt,
|
|
110
|
-
type: value.type,
|
|
111
|
-
title: value.title,
|
|
112
|
-
userText: {
|
|
113
|
-
description: userText.description,
|
|
114
|
-
stepsToReproduce: isString(userText.stepsToReproduce) ? userText.stepsToReproduce : undefined,
|
|
115
|
-
expectedBehavior: isString(userText.expectedBehavior) ? userText.expectedBehavior : undefined,
|
|
116
|
-
actualBehavior: isString(userText.actualBehavior) ? userText.actualBehavior : undefined,
|
|
117
|
-
userSeverity: userText.userSeverity === 'low' || userText.userSeverity === 'medium' || userText.userSeverity === 'high'
|
|
118
|
-
? userText.userSeverity
|
|
119
|
-
: undefined,
|
|
120
|
-
// 类型化新字段(全部可选,旧草稿缺省兼容;枚举校验同 core)
|
|
121
|
-
goal: isString(userText.goal) ? userText.goal : undefined,
|
|
122
|
-
stuckAt: isString(userText.stuckAt) ? userText.stuckAt : undefined,
|
|
123
|
-
job: isString(userText.job) ? userText.job : undefined,
|
|
124
|
-
currentWorkaround: isString(userText.currentWorkaround) ? userText.currentWorkaround : undefined,
|
|
125
|
-
sawWhat: isString(userText.sawWhat) ? userText.sawWhat : undefined,
|
|
126
|
-
whereSeen: isString(userText.whereSeen) ? userText.whereSeen : undefined,
|
|
127
|
-
frequency: isFeedbackFrequency(userText.frequency) ? userText.frequency : undefined,
|
|
128
|
-
blockingLevel: isFeedbackBlockingLevel(userText.blockingLevel) ? userText.blockingLevel : undefined,
|
|
129
|
-
},
|
|
130
|
-
diagnosticSummary: {
|
|
131
|
-
versions: asRecord(diagnostic.versions),
|
|
132
|
-
platform: asRecord(diagnostic.platform),
|
|
133
|
-
featureFlags: asRecord(diagnostic.featureFlags),
|
|
134
|
-
canary: validCanary ?? { status: 'unavailable', unavailableReason: 'diagnostic summary unavailable' },
|
|
135
|
-
recentEvents: Array.isArray(diagnostic.recentEvents) ? diagnostic.recentEvents : [],
|
|
136
|
-
},
|
|
137
|
-
privacy: {
|
|
138
|
-
includedSections: privacy.includedSections,
|
|
139
|
-
excludedByDefault: privacy.excludedByDefault,
|
|
140
|
-
redactionNotes: privacy.redactionNotes,
|
|
141
|
-
},
|
|
142
|
-
outputs: {
|
|
143
|
-
markdown: outputs.markdown,
|
|
144
|
-
emailText: outputs.emailText,
|
|
145
|
-
githubIssueUrl: outputs.githubIssueUrl,
|
|
146
|
-
// mailtoUrl is newer than the other outputs; older drafts persisted
|
|
147
|
-
// before this field existed. Fall back to '' so the UI can hide the
|
|
148
|
-
// "Open Email" button gracefully (rc-1: treat as unknown, no `as`).
|
|
149
|
-
mailtoUrl: isString(outputs.mailtoUrl) ? outputs.mailtoUrl : '',
|
|
150
|
-
},
|
|
151
|
-
// 来源与提交元数据(全部可选;status/trackingId/externalUrl 仅当枚举/字符串合法时保留)
|
|
152
|
-
area: isString(value.area) ? value.area : undefined,
|
|
153
|
-
status: value.status === 'draft' || value.status === 'submitted' ? value.status : undefined,
|
|
154
|
-
submittedAt: isString(value.submittedAt) ? value.submittedAt : undefined,
|
|
155
|
-
submittedVia: isFeedbackSubmittedVia(value.submittedVia) ? value.submittedVia : undefined,
|
|
156
|
-
trackingId: isString(value.trackingId) ? value.trackingId : undefined,
|
|
157
|
-
externalUrl: isString(value.externalUrl) ? value.externalUrl : undefined,
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
export function parseDraftSummary(value) {
|
|
161
|
-
if (!isRecord(value))
|
|
162
|
-
return null;
|
|
163
|
-
if (!isString(value.id) || !isString(value.createdAt) || !isString(value.type) || !isString(value.title)) {
|
|
164
|
-
return null;
|
|
165
|
-
}
|
|
166
|
-
return {
|
|
167
|
-
id: value.id,
|
|
168
|
-
createdAt: value.createdAt,
|
|
169
|
-
type: value.type,
|
|
170
|
-
title: value.title,
|
|
171
|
-
status: isString(value.status) ? value.status : undefined,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
export function parseEnvelopeReport(value) {
|
|
175
|
-
if (!isRecord(value))
|
|
176
|
-
return null;
|
|
177
|
-
return parseDraftRecord(value.report);
|
|
178
|
-
}
|
|
179
|
-
export function getErrorMessage(result, fallback) {
|
|
180
|
-
if (isRecord(result) && result.success === false && isString(result.error)) {
|
|
181
|
-
return result.error;
|
|
182
|
-
}
|
|
183
|
-
return fallback;
|
|
184
|
-
}
|
|
185
|
-
// ── Context builder (Task 6: frontend context passthrough) ──────────────────
|
|
186
|
-
//
|
|
187
|
-
// Builds a `context` object from URL search params so feedback reports can be
|
|
188
|
-
// associated with specific pain / principle / approval / task entities.
|
|
189
|
-
//
|
|
190
|
-
// P1-3 (rc-9-no-silent-fallback): The `source` field must be a valid
|
|
191
|
-
// FeedbackSource enum (console/cli/agent) because the server-side
|
|
192
|
-
// `validateFeedbackContext` enforces this enum. Non-enum source values
|
|
193
|
-
// (e.g. `failed_tasks_page`, `error`) are NOT silently dropped — they are
|
|
194
|
-
// mapped to the nearest valid enum (`console`, since PD Console is the host
|
|
195
|
-
// for all these entry points) and the original value is preserved in
|
|
196
|
-
// `sourceDetail` so the maintainer can see the concrete entry point.
|
|
197
|
-
//
|
|
198
|
-
// Returns `undefined` when no relevant query params are present so the caller
|
|
199
|
-
// can omit `context` from the request body entirely.
|
|
200
|
-
const FEEDBACK_SOURCE_VALUES = ['console', 'cli', 'agent'];
|
|
201
|
-
const CONTEXT_STRING_FIELDS = [
|
|
202
|
-
'painId',
|
|
203
|
-
'principleId',
|
|
204
|
-
'approvalId',
|
|
205
|
-
'activationId',
|
|
206
|
-
'taskId',
|
|
207
|
-
'page',
|
|
208
|
-
];
|
|
209
|
-
export function buildFeedbackContextFromSearchParams(searchParams) {
|
|
210
|
-
const ctx = {};
|
|
211
|
-
for (const f of CONTEXT_STRING_FIELDS) {
|
|
212
|
-
const v = searchParams.get(f);
|
|
213
|
-
if (v)
|
|
214
|
-
ctx[f] = v;
|
|
215
|
-
}
|
|
216
|
-
const source = searchParams.get('source');
|
|
217
|
-
if (source) {
|
|
218
|
-
if (FEEDBACK_SOURCE_VALUES.includes(source)) {
|
|
219
|
-
ctx.source = source;
|
|
220
|
-
}
|
|
221
|
-
else {
|
|
222
|
-
// P1-3: Non-enum source mapped to 'console' (PD Console hosts all these
|
|
223
|
-
// entry points). Original value preserved in sourceDetail (rc-9: no
|
|
224
|
-
// silent drop). The server-side FeedbackContext now supports sourceDetail.
|
|
225
|
-
ctx.source = 'console';
|
|
226
|
-
ctx.sourceDetail = source;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
return Object.keys(ctx).length > 0 ? ctx : undefined;
|
|
230
|
-
}
|
|
231
|
-
const CONFIG_PATH = '/api/v1/config/summary';
|
|
232
|
-
const LIFECYCLE_PATH = '/api/v1/lifecycle/state';
|
|
233
|
-
const HEALTH_PATH = '/api/health';
|
|
234
|
-
function describeFailure(settled, path) {
|
|
235
|
-
if (settled.status === 'rejected') {
|
|
236
|
-
const { reason } = settled;
|
|
237
|
-
const msg = reason instanceof Error ? reason.message : String(reason);
|
|
238
|
-
return `${path} fetch failed: ${msg}`;
|
|
239
|
-
}
|
|
240
|
-
if (!settled.value.success) {
|
|
241
|
-
return `${path} fetch failed: ${settled.value.error}`;
|
|
242
|
-
}
|
|
243
|
-
return '';
|
|
244
|
-
}
|
|
245
|
-
function pickString(value) {
|
|
246
|
-
return typeof value === 'string' ? value : undefined;
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Extract recentEvents from the /api/v1/lifecycle/state response body.
|
|
250
|
-
*
|
|
251
|
-
* The endpoint is not yet implemented in the current server (only
|
|
252
|
-
* /api/v1/lifecycle/principles/:id exists). When it returns a 404 or other
|
|
253
|
-
* error, the caller passes a failure ApiResult and we return an empty array;
|
|
254
|
-
* the diagnostics `recentEvents` field is then populated with an
|
|
255
|
-
* `unavailableReason` entry by the caller. When the endpoint exists and
|
|
256
|
-
* returns a record with `recentEvents`, we validate each entry's required
|
|
257
|
-
* string fields before keeping it (rc-4-validate-array-elements).
|
|
258
|
-
*/
|
|
259
|
-
function extractRecentEvents(data) {
|
|
260
|
-
if (!isRecord(data) || !Array.isArray(data.recentEvents))
|
|
261
|
-
return [];
|
|
262
|
-
const out = [];
|
|
263
|
-
for (const entry of data.recentEvents) {
|
|
264
|
-
if (!isRecord(entry))
|
|
265
|
-
continue;
|
|
266
|
-
const type = pickString(entry.type);
|
|
267
|
-
const at = pickString(entry.at);
|
|
268
|
-
const summary = pickString(entry.summary);
|
|
269
|
-
if (!type || !at || !summary)
|
|
270
|
-
continue;
|
|
271
|
-
const ev = { type, at, summary };
|
|
272
|
-
const severity = pickString(entry.severity);
|
|
273
|
-
if (severity)
|
|
274
|
-
ev.severity = severity;
|
|
275
|
-
out.push(ev);
|
|
276
|
-
}
|
|
277
|
-
// Keep only the last 5 entries (per task spec: "取最后 5 条")
|
|
278
|
-
return out.slice(-5);
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* P1-5: Extract recentEvents from /api/health's `checks` array as a fallback
|
|
282
|
-
* when /api/v1/lifecycle/state is unavailable. Each health check becomes an
|
|
283
|
-
* event: type=check.id, at=check.lastCheck, summary=check.message, severity
|
|
284
|
-
* mapped from check.status (error→'error', warning→'warn', healthy→none).
|
|
285
|
-
*
|
|
286
|
-
* This ensures the feedback report's "Recent events" section is not permanently
|
|
287
|
-
* empty just because the lifecycle endpoint does not exist yet.
|
|
288
|
-
*/
|
|
289
|
-
function extractEventsFromHealthChecks(healthRecord) {
|
|
290
|
-
if (!healthRecord || !Array.isArray(healthRecord.checks))
|
|
291
|
-
return [];
|
|
292
|
-
const out = [];
|
|
293
|
-
for (const check of healthRecord.checks) {
|
|
294
|
-
if (!isRecord(check))
|
|
295
|
-
continue;
|
|
296
|
-
const type = pickString(check.id) ?? pickString(check.name);
|
|
297
|
-
const at = pickString(check.lastCheck);
|
|
298
|
-
const summary = pickString(check.message);
|
|
299
|
-
if (!type || !at || !summary)
|
|
300
|
-
continue;
|
|
301
|
-
const ev = { type, at, summary };
|
|
302
|
-
const status = pickString(check.status);
|
|
303
|
-
if (status === 'error')
|
|
304
|
-
ev.severity = 'error';
|
|
305
|
-
else if (status === 'warning')
|
|
306
|
-
ev.severity = 'warn';
|
|
307
|
-
out.push(ev);
|
|
308
|
-
}
|
|
309
|
-
return out.slice(-5);
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* Build a diagnostics object from three concurrent API responses.
|
|
313
|
-
*
|
|
314
|
-
* Each input is a SettledResult<ApiResult<unknown>> — the shape produced by
|
|
315
|
-
* `Promise.allSettled([request(...), ...])`. When an API fails (rejected
|
|
316
|
-
* promise or ApiResult with success=false), the corresponding diagnostics
|
|
317
|
-
* fields record an `unavailableReason` string (rc-9-no-silent-fallback).
|
|
318
|
-
*
|
|
319
|
-
* Field mapping:
|
|
320
|
-
* - versions: P0-2: extracted from /api/health's `versions` field (added
|
|
321
|
-
* by HealthCheckModel.checkSystemHealth). Contains PD/core/node
|
|
322
|
-
* version strings.
|
|
323
|
-
* - platform: P0-2: extracted from /api/health's `platform` field. Contains
|
|
324
|
-
* os/arch/nodeVersion.
|
|
325
|
-
* - featureFlags: built from /api/v1/config/summary's `features` array. The
|
|
326
|
-
* full ConfigSummaryData object is passed through (the server's
|
|
327
|
-
* redactSensitiveFields scrubs it again as defense in depth).
|
|
328
|
-
* - canary: built from /api/health's `overall` field. 'healthy' and
|
|
329
|
-
* 'degraded' map to status='available'; 'error' maps to
|
|
330
|
-
* status='unavailable'.
|
|
331
|
-
* - recentEvents: P1-5: extracted from /api/v1/lifecycle/state's `recentEvents`
|
|
332
|
-
* array (each entry validated; last 5 kept). When the endpoint
|
|
333
|
-
* is absent (current state), falls back to /api/health's
|
|
334
|
-
* `checks` array so the report is not permanently empty.
|
|
335
|
-
*/
|
|
336
|
-
export function buildFeedbackDiagnostics(configSettled, lifecycleSettled, healthSettled) {
|
|
337
|
-
// ── health response (used for versions, platform, canary, recentEvents fallback) ──
|
|
338
|
-
const healthFailure = describeFailure(healthSettled, HEALTH_PATH);
|
|
339
|
-
const healthData = (healthSettled.status === 'fulfilled' && healthSettled.value.success)
|
|
340
|
-
? healthSettled.value.data
|
|
341
|
-
: null;
|
|
342
|
-
const healthRecord = isRecord(healthData) ? healthData : null;
|
|
343
|
-
// ── versions / platform (from /api/health) ──────────────────────────────
|
|
344
|
-
// P0-2: /api/health now returns versions and platform via HealthCheckModel.
|
|
345
|
-
// Previously these came from /api/v1/config/summary which never had them.
|
|
346
|
-
let versions;
|
|
347
|
-
let platform;
|
|
348
|
-
if (healthFailure) {
|
|
349
|
-
versions = { unavailableReason: healthFailure };
|
|
350
|
-
platform = { unavailableReason: healthFailure };
|
|
351
|
-
}
|
|
352
|
-
else if (healthRecord && isRecord(healthRecord.versions)) {
|
|
353
|
-
versions = { ...healthRecord.versions };
|
|
354
|
-
platform = isRecord(healthRecord.platform)
|
|
355
|
-
? { ...healthRecord.platform }
|
|
356
|
-
: { unavailableReason: 'platform not in health response' };
|
|
357
|
-
}
|
|
358
|
-
else {
|
|
359
|
-
versions = { unavailableReason: 'versions not in health response' };
|
|
360
|
-
platform = { unavailableReason: 'platform not in health response' };
|
|
361
|
-
}
|
|
362
|
-
// ── featureFlags (from /api/v1/config/summary) ──────────────────────────
|
|
363
|
-
// Best-effort: pass the entire config summary data through as featureFlags.
|
|
364
|
-
// The server's redactSensitiveFields will scrub sensitive values, and the
|
|
365
|
-
// features array (id/category/enabled) is the closest available signal.
|
|
366
|
-
const configFailure = describeFailure(configSettled, CONFIG_PATH);
|
|
367
|
-
let featureFlags;
|
|
368
|
-
if (configFailure) {
|
|
369
|
-
featureFlags = { unavailableReason: configFailure };
|
|
370
|
-
}
|
|
371
|
-
else if (configSettled.status === 'fulfilled' && configSettled.value.success) {
|
|
372
|
-
const { data } = configSettled.value;
|
|
373
|
-
if (isRecord(data) && Object.hasOwn(data, 'features') && Array.isArray(data.features)) {
|
|
374
|
-
featureFlags = { features: data.features, defaultRuntime: pickString(data.defaultRuntime) ?? null };
|
|
375
|
-
}
|
|
376
|
-
else {
|
|
377
|
-
featureFlags = { unavailableReason: 'features field not present in API response' };
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
else {
|
|
381
|
-
featureFlags = { unavailableReason: 'features field not present in API response' };
|
|
382
|
-
}
|
|
383
|
-
// ── canary (from /api/health) ───────────────────────────────────────────
|
|
384
|
-
let canary;
|
|
385
|
-
if (healthFailure) {
|
|
386
|
-
canary = { status: 'unavailable', unavailableReason: healthFailure };
|
|
387
|
-
}
|
|
388
|
-
else if (healthRecord && (healthRecord.overall === 'healthy' || healthRecord.overall === 'degraded' || healthRecord.overall === 'error')) {
|
|
389
|
-
const { overall } = healthRecord;
|
|
390
|
-
if (overall === 'error') {
|
|
391
|
-
canary = { status: 'unavailable', unavailableReason: `system health: ${overall}` };
|
|
392
|
-
}
|
|
393
|
-
else {
|
|
394
|
-
const summary = `overall=${overall}; generatedAt=${pickString(healthRecord.generatedAt) ?? 'unknown'}`;
|
|
395
|
-
canary = { status: 'available', summary };
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
else {
|
|
399
|
-
canary = { status: 'unavailable', unavailableReason: 'overall field not present in API response' };
|
|
400
|
-
}
|
|
401
|
-
// ── recentEvents (from /api/v1/lifecycle/state, fallback to /api/health checks) ──
|
|
402
|
-
// P1-5: /api/v1/lifecycle/state is not yet implemented. When it fails, fall
|
|
403
|
-
// back to /api/health's checks array so the report's "Recent events" section
|
|
404
|
-
// is not permanently empty. We still attempt the lifecycle fetch so that
|
|
405
|
-
// when the endpoint exists in the future, real events flow through.
|
|
406
|
-
const lifecycleFailure = describeFailure(lifecycleSettled, LIFECYCLE_PATH);
|
|
407
|
-
let recentEvents;
|
|
408
|
-
if (lifecycleFailure) {
|
|
409
|
-
recentEvents = extractEventsFromHealthChecks(healthRecord);
|
|
410
|
-
}
|
|
411
|
-
else if (lifecycleSettled.status === 'fulfilled' && lifecycleSettled.value.success) {
|
|
412
|
-
recentEvents = extractRecentEvents(lifecycleSettled.value.data);
|
|
413
|
-
}
|
|
414
|
-
else {
|
|
415
|
-
recentEvents = extractEventsFromHealthChecks(healthRecord);
|
|
416
|
-
}
|
|
417
|
-
return { versions, platform, featureFlags, canary, recentEvents };
|
|
418
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function ActivationPage(): import("react").JSX.Element;
|