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,567 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect, useRef, useCallback } from "react";
|
|
3
|
-
import { Link } from "react-router-dom";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { PageShell } from "../../components/layout/page-shell.js";
|
|
6
|
-
import { PageLoading } from "../../components/layout/page-loading.js";
|
|
7
|
-
import { SectionTitle } from "../../components/layout/section-title.js";
|
|
8
|
-
import { DailyThoughtCard } from "../../components/focus/daily-thought-card.js";
|
|
9
|
-
import { ShinyText } from "../../components/ui/shiny-text.js";
|
|
10
|
-
import { fetchGovernanceQueue, fetchApprovalsGrouped, fetchAllActivations, fetchOwnerDecisions, fetchRuleBindingQueue, } from "../../api.js";
|
|
11
|
-
import { selectApprovalGroupDisplayTitle, showsUnlinkedCandidateNote, validateApprovalsGroupedData } from "./focus-validation.js";
|
|
12
|
-
import { splitReadingTitleBody } from "../../utils/reading-layout.js";
|
|
13
|
-
import { OwnerWorkbench } from "./OwnerWorkbench.js";
|
|
14
|
-
import { ApprovalSubjectReading } from "./ApprovalSubjectReading.js";
|
|
15
|
-
import { OwnerDecisionCard } from "./OwnerDecisionCard.js";
|
|
16
|
-
import { RuleCandidateBindingPanel, deriveRuleBindingCardState } from './RuleCandidateBindingPanel.js';
|
|
17
|
-
import { fetchGovernanceExperience, fetchOwnerDecisionInbox } from "../../api.js";
|
|
18
|
-
/**
|
|
19
|
-
* PRI-889: 「需要你决定」区的决策卡来源选择。
|
|
20
|
-
* 分组审批数据可用时,activation_approval 决策由 PendingReviewCard(带
|
|
21
|
-
* 批准/拒绝/修订按钮)承载,同名的 OwnerDecisionCard(只剩死链 CTA)不再
|
|
22
|
-
* 重复渲染;分组数据不可用时全部保留 —— 决策不静默消失(rc-9)。
|
|
23
|
-
*/
|
|
24
|
-
export function selectDecisionSurfaceItems(ownerDecisionItems, groupedAvailable) {
|
|
25
|
-
return groupedAvailable
|
|
26
|
-
? ownerDecisionItems.filter((item) => item.kind !== "activation_approval")
|
|
27
|
-
: [...ownerDecisionItems];
|
|
28
|
-
}
|
|
29
|
-
export function summarizeDecisionResults(results) {
|
|
30
|
-
const failures = results.filter((result) => !result.success);
|
|
31
|
-
const first = failures[0];
|
|
32
|
-
const successWarnings = results
|
|
33
|
-
.flatMap((result) => (result.success && typeof result.warning === "string" ? [result.warning] : []));
|
|
34
|
-
return {
|
|
35
|
-
allSucceeded: failures.length === 0,
|
|
36
|
-
failedCount: failures.length,
|
|
37
|
-
...(first
|
|
38
|
-
? { failureReason: first.nextAction ? `${first.error} ${first.nextAction}` : first.error }
|
|
39
|
-
: {}),
|
|
40
|
-
successWarnings,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* SPEC-PD-UIUX-001 R2: how the owner-inbox display items map onto the Focus
|
|
45
|
-
* page after the reading-order rework. Pure display partitioning — no
|
|
46
|
-
* permission or lifecycle decisions happen here.
|
|
47
|
-
*
|
|
48
|
-
* - decision items whose principleId matches an on-screen action card are NOT
|
|
49
|
-
* duplicated as full cards (one primary action surface per object); the
|
|
50
|
-
* match uses the verified principleId association field, never titles;
|
|
51
|
-
* - unmatched decision items are preserved (with their own entry) — objects
|
|
52
|
-
* are never hidden for visual tidiness;
|
|
53
|
-
* - two different decisions of the same principle are never merged: each
|
|
54
|
-
* action card keeps its own object; this partition only affects the
|
|
55
|
-
* display-only inbox projection;
|
|
56
|
-
* - blocked items follow the inbox.attention semantics: 'individual' items
|
|
57
|
-
* render one card each, everything else gets one aggregate count;
|
|
58
|
-
* - historical unknowns stay an explanatory notice (not part of the todo
|
|
59
|
-
* count).
|
|
60
|
-
*/
|
|
61
|
-
export function partitionInboxForDisplay(inbox, actionCardPrincipleIds) {
|
|
62
|
-
const blockedIndividual = inbox.groups.blocked.filter((item) => item.inbox.attention === "individual");
|
|
63
|
-
const blockedAggregate = inbox.groups.blocked.filter((item) => item.inbox.attention !== "individual");
|
|
64
|
-
const unmatchedDecisions = inbox.groups.decision.filter((item) => !actionCardPrincipleIds.has(item.principleId));
|
|
65
|
-
return {
|
|
66
|
-
unmatchedDecisions,
|
|
67
|
-
blockedIndividual,
|
|
68
|
-
blockedAggregate,
|
|
69
|
-
recovery: inbox.groups.recovery,
|
|
70
|
-
// 待处理口径: decision + blocked-individual + recovery (INV-01 lineage).
|
|
71
|
-
pendingTotal: inbox.groups.decision.length + blockedIndividual.length + inbox.groups.recovery.length,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* SPEC-PD-UIUX-001 R2 (Owner review round 2): the conclusion strip's headline
|
|
76
|
-
* must never claim the system is clear when the inbox response cannot back
|
|
77
|
-
* that claim.
|
|
78
|
-
*
|
|
79
|
-
* Modes (display-only; no permission derivation):
|
|
80
|
-
* - 'unavailable' — inbox projection off (feature_disabled surfaces as
|
|
81
|
-
* ownerInbox===null with NO error) or the request failed.
|
|
82
|
-
* - 'degraded' — the inbox answered HTTP-success but carries
|
|
83
|
-
* `degraded: { reason, nextAction }` (e.g. principle ledger unreadable, the
|
|
84
|
-
* server then returns EMPTY groups): the strip shows the server's reason.
|
|
85
|
-
* - 'ok' — the inbox answered without degradation.
|
|
86
|
-
*/
|
|
87
|
-
export function deriveConclusionDisplay(input) {
|
|
88
|
-
if (input.ownerInbox === null || input.ownerInboxError !== null)
|
|
89
|
-
return { mode: 'unavailable' };
|
|
90
|
-
if (input.ownerInbox.degraded !== undefined)
|
|
91
|
-
return { mode: 'degraded', degraded: input.ownerInbox.degraded };
|
|
92
|
-
return { mode: 'ok' };
|
|
93
|
-
}
|
|
94
|
-
// ── i18n code mapping helpers ─────────────────────────────────────────────
|
|
95
|
-
/** Map a stateReasonCode to an i18n key, with optional interpolation params. */
|
|
96
|
-
function getStateReasonText(code, t, pendingReviewCount) {
|
|
97
|
-
const i18nKey = `pages.focus.stateReason.${code}`;
|
|
98
|
-
const text = t(i18nKey, { count: pendingReviewCount });
|
|
99
|
-
// If i18n key is not found, t() returns the key itself — fall back to code
|
|
100
|
-
return text === i18nKey ? code : text;
|
|
101
|
-
}
|
|
102
|
-
/** Map a nextActionCode to an i18n key. */
|
|
103
|
-
function getNextActionText(code, t) {
|
|
104
|
-
const i18nKey = `pages.focus.nextAction.${code}`;
|
|
105
|
-
const text = t(i18nKey);
|
|
106
|
-
return text === i18nKey ? code : text;
|
|
107
|
-
}
|
|
108
|
-
/** Map a degraded signal reasonCode to an i18n key. */
|
|
109
|
-
function getDegradedReasonText(code, t) {
|
|
110
|
-
const i18nKey = `pages.focus.degradedReason.${code}`;
|
|
111
|
-
const text = t(i18nKey);
|
|
112
|
-
return text === i18nKey ? code : text;
|
|
113
|
-
}
|
|
114
|
-
/** Map a degraded signal nextActionCode to an i18n key. */
|
|
115
|
-
function getDegradedNextActionText(code, t) {
|
|
116
|
-
const i18nKey = `pages.focus.degradedNextAction.${code}`;
|
|
117
|
-
const text = t(i18nKey);
|
|
118
|
-
return text === i18nKey ? code : text;
|
|
119
|
-
}
|
|
120
|
-
export const OWNER_CONFIGURE_DOC_URL = "https://github.com/csuzngjh/principles/blob/main/docs/runbooks/ops/owner-identity-configuration.md";
|
|
121
|
-
export const OWNER_CONFIGURE_COMMANDS = [
|
|
122
|
-
{
|
|
123
|
-
labelKey: "pages.focus.experience.ownerGuide.cmdPowerShell",
|
|
124
|
-
command: "[Environment]::SetEnvironmentVariable('PD_OWNER_ID', '<owner-id>', 'User')\n[Environment]::SetEnvironmentVariable('PD_OWNER_CREDENTIAL_ID', '<credential-id>', 'User')",
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
labelKey: "pages.focus.experience.ownerGuide.cmdBash",
|
|
128
|
-
command: "echo 'export PD_OWNER_ID=\"<owner-id>\"' >> ~/.bashrc\necho 'export PD_OWNER_CREDENTIAL_ID=\"<credential-id>\"' >> ~/.bashrc\nsource ~/.bashrc",
|
|
129
|
-
},
|
|
130
|
-
];
|
|
131
|
-
/** Returns the configure guide when the Owner identity is missing, else null. */
|
|
132
|
-
export function deriveOwnerConfigureGuide(ownerIdentityConfiguration) {
|
|
133
|
-
if (ownerIdentityConfiguration !== "missing")
|
|
134
|
-
return null;
|
|
135
|
-
return { docUrl: OWNER_CONFIGURE_DOC_URL, commands: OWNER_CONFIGURE_COMMANDS };
|
|
136
|
-
}
|
|
137
|
-
// ── Sub-components ───────────────────────────────────────────────────────────
|
|
138
|
-
function ProseSummary({ pendingCount, deviationCount, stagnationCount, evidenceCount, }) {
|
|
139
|
-
const { t } = useTranslation();
|
|
140
|
-
return (_jsxs("div", { className: "text-sm leading-relaxed text-ink-2 mb-7 px-[18px] py-[14px] bg-panel border border-line rounded-[6px]", role: "status", "aria-live": "polite", children: [_jsx("span", { className: "text-ink-3", children: t("pages.focus.summaryLabel") }), " ", _jsx("span", { className: "font-mono font-semibold text-ink", children: pendingCount }), " ", _jsx("span", { className: "text-ink-3", children: t("pages.focus.summaryPending") }), " ", "/", " ", evidenceCount > 0 ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "font-mono font-semibold text-ink", children: evidenceCount }), " ", _jsx("span", { className: "text-ink-3", children: t("pages.focus.summaryEvidence") }), " "] })) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "font-mono font-semibold text-ink", children: deviationCount }), " ", _jsx("span", { className: "text-ink-3", children: t("pages.focus.summaryDeviation") }), " "] })), "/", " ", _jsx("span", { className: "font-mono font-semibold text-ink", children: stagnationCount }), " ", _jsx("span", { className: "text-ink-3", children: t("pages.focus.summaryStagnation") })] }));
|
|
141
|
-
}
|
|
142
|
-
// ── Wave 4: Feedback Stratification ──────────────────────────────────────────
|
|
143
|
-
// Shows three feedback layers by timescale, so the Owner sees what the system
|
|
144
|
-
// already handled vs. what actually needs their judgment. Implements the
|
|
145
|
-
// "feedback latency stratification" principle from the co-evolution article.
|
|
146
|
-
function FeedbackStratification({ gateBlocksToday, inProgressCount, pendingCount, }) {
|
|
147
|
-
const { t } = useTranslation();
|
|
148
|
-
// Hide entirely when all three are zero — no feedback to stratify.
|
|
149
|
-
if (gateBlocksToday === 0 && inProgressCount === 0 && pendingCount === 0) {
|
|
150
|
-
return null;
|
|
151
|
-
}
|
|
152
|
-
return (_jsxs("div", { className: "mb-7 px-[18px] py-[14px] bg-panel border border-line rounded-[6px]", children: [_jsx("div", { className: "font-mono text-[11px] uppercase tracking-[0.08em] text-ink-4 mb-3", children: t("pages.focus.stratLabel") }), _jsxs("div", { className: "flex items-stretch gap-3 flex-wrap", children: [_jsxs("div", { className: "flex-1 min-w-[140px] px-3 py-2 bg-surface/60 border border-line rounded-[4px]", children: [_jsxs("div", { className: "flex items-baseline gap-1.5", children: [_jsx("span", { className: "font-mono font-semibold text-[18px] text-ink-4 tabular-nums", children: gateBlocksToday }), _jsx("span", { className: "text-[12px] text-ink-3", children: t("pages.focus.stratGateBlocks") })] }), _jsx("div", { className: "text-[11px] text-ink-4 mt-0.5 leading-snug", children: t("pages.focus.stratGateBlocksHint") })] }), _jsxs("div", { className: "flex-1 min-w-[140px] px-3 py-2 bg-surface/60 border border-line rounded-[4px]", children: [_jsxs("div", { className: "flex items-baseline gap-1.5", children: [_jsx("span", { className: "font-mono font-semibold text-[18px] text-teal-600 tabular-nums", children: inProgressCount }), _jsx("span", { className: "text-[12px] text-ink-3", children: t("pages.focus.stratInProgress") })] }), _jsx("div", { className: "text-[11px] text-ink-4 mt-0.5 leading-snug", children: t("pages.focus.stratInProgressHint") })] }), _jsxs("div", { className: "flex-1 min-w-[140px] px-3 py-2 bg-gov/5 border border-gov/30 rounded-[4px] relative", children: [_jsxs("div", { className: "flex items-baseline gap-1.5", children: [_jsx("span", { className: "font-mono font-semibold text-[18px] text-gov tabular-nums", children: pendingCount }), _jsx("span", { className: "text-[12px] text-gov", children: t("pages.focus.stratPendingReview") })] }), _jsx("div", { className: "text-[11px] text-ink-4 mt-0.5 leading-snug", children: t("pages.focus.stratPendingReviewHint") }), _jsx("span", { className: "absolute -top-2 right-2 inline-flex items-center border border-gov/40 text-gov bg-panel rounded-[2px] px-[6px] py-0.5 font-mono text-[9px] uppercase tracking-wider", children: t("pages.focus.stratYouAreHere") })] })] })] }));
|
|
153
|
-
}
|
|
154
|
-
function StagnationSignalCard({ signal }) {
|
|
155
|
-
const { t } = useTranslation();
|
|
156
|
-
const label = signal.type === "never_activated"
|
|
157
|
-
? t("pages.focus.stagnationNeverActivated")
|
|
158
|
-
: t("pages.focus.stagnationNoPain");
|
|
159
|
-
return (_jsxs("article", { className: "relative pl-[22px] py-[14px] pr-[18px] bg-panel border border-amber/20 border-l-[3px] border-l-amber rounded-[6px]", children: [_jsxs("div", { className: "text-ink-2 text-sm leading-relaxed", children: [_jsx("span", { className: "font-medium text-ink", children: label }), " ", "\u2014 ", signal.principleId, " \u00B7 ", signal.daysSince, " ", t("pages.focus.stagnationDaysSince")] }), _jsxs(Link, { to: `/activation`, className: "inline-flex items-center mt-2 text-gov text-[13px] hover:underline focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2", children: [t("pages.focus.viewFullChain"), " \u2192"] })] }));
|
|
160
|
-
}
|
|
161
|
-
function DegradedSignalCard({ signal }) {
|
|
162
|
-
const { t } = useTranslation();
|
|
163
|
-
const sourceLabel = signal.source === "internalization_task"
|
|
164
|
-
? t("pages.focus.degradedSourceInternalization")
|
|
165
|
-
: signal.source === "chain_integrity"
|
|
166
|
-
? t("pages.focus.degradedSourceChainIntegrity")
|
|
167
|
-
: signal.source === "source_unavailable"
|
|
168
|
-
? t("pages.focus.degradedSourceUnavailable")
|
|
169
|
-
: signal.source;
|
|
170
|
-
// Use i18n-mapped text from reasonCode/nextActionCode
|
|
171
|
-
const reasonText = getDegradedReasonText(signal.reasonCode, t);
|
|
172
|
-
const nextActionText = getDegradedNextActionText(signal.nextActionCode, t);
|
|
173
|
-
return (_jsxs("article", { className: "relative pl-[22px] py-[14px] pr-[18px] bg-panel border border-amber/20 border-l-[3px] border-l-amber rounded-[6px]", children: [_jsx("div", { className: "flex items-center gap-2 mb-2", children: _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: sourceLabel }) }), _jsx("div", { className: "text-ink-2 text-sm leading-relaxed", children: reasonText }), signal.reason && (_jsxs("details", { className: "mt-1", children: [_jsx("summary", { className: "text-ink-4 text-[11px] font-mono cursor-pointer hover:underline", children: t("pages.focus.advancedDiagnostics") }), _jsx("div", { className: "text-ink-4 text-[12px] leading-snug mt-1 font-mono bg-surface/40 px-2 py-1 rounded-[3px] break-all", children: signal.reason })] })), _jsxs("div", { className: "mt-2 text-ink-4 text-[13px] leading-snug", children: [_jsx("span", { className: "font-medium", children: t("pages.focus.degradedNextActionLabel") }), " ", nextActionText] })] }));
|
|
174
|
-
}
|
|
175
|
-
function OnboardingGuide() {
|
|
176
|
-
const { t } = useTranslation();
|
|
177
|
-
const steps = [
|
|
178
|
-
t("pages.focus.onboardingStep1"),
|
|
179
|
-
t("pages.focus.onboardingStep2"),
|
|
180
|
-
t("pages.focus.onboardingStep3"),
|
|
181
|
-
t("pages.focus.onboardingStep4"),
|
|
182
|
-
t("pages.focus.onboardingStep5"),
|
|
183
|
-
];
|
|
184
|
-
return (_jsxs("div", { className: "bg-panel border border-line rounded-[6px] p-6", children: [_jsx(SectionTitle, { children: t("pages.focus.onboardingTitle") }), _jsx("ol", { className: "space-y-3", children: steps.map((step, i) => (_jsxs("li", { className: "flex gap-3 text-ink-2 text-sm leading-relaxed", children: [_jsx("span", { className: "font-mono text-ink-4 text-[11px] mt-0.5 shrink-0", children: String(i + 1).padStart(2, "0") }), _jsx("span", { children: step })] }, i))) })] }));
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* PRI-332: Shown when all counts are zero and sources are healthy.
|
|
188
|
-
* Explains to the owner that PD has checked everything — not that PD is broken.
|
|
189
|
-
*/
|
|
190
|
-
function ZeroStateHealthy() {
|
|
191
|
-
const { t } = useTranslation();
|
|
192
|
-
return (_jsx("div", { className: "bg-panel border border-line rounded-[6px] p-6", children: _jsx("p", { className: "text-ink-2 text-sm leading-relaxed", children: t("pages.focus.zeroStateHealthy") }) }));
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* PRI-332: Shown when state_db_missing — first-time setup explanation.
|
|
196
|
-
*/
|
|
197
|
-
function ZeroStateDbMissing() {
|
|
198
|
-
const { t } = useTranslation();
|
|
199
|
-
return (_jsxs("div", { className: "bg-panel border border-line rounded-[6px] p-6", children: [_jsx("p", { className: "text-ink-2 text-sm leading-relaxed", children: t("pages.focus.zeroStateDbMissing") }), _jsxs("div", { className: "mt-3 text-ink-4 text-[13px]", children: [_jsx("span", { className: "font-medium", children: t("pages.focus.nextActionLabel") }), " ", getNextActionText("run_config_doctor", t)] })] }));
|
|
200
|
-
}
|
|
201
|
-
function InProgressGuide({ summary }) {
|
|
202
|
-
const { t } = useTranslation();
|
|
203
|
-
return (_jsxs("div", { className: "bg-panel border border-line rounded-[6px] p-6", children: [_jsx(SectionTitle, { children: t("pages.focus.inProgressTitle") }), _jsx("p", { className: "text-ink-2 text-sm leading-relaxed mt-2", children: summary }), _jsx("p", { className: "text-ink-4 text-[13px] leading-relaxed mt-3", children: t("pages.focus.inProgressDetail") })] }));
|
|
204
|
-
}
|
|
205
|
-
function DegradedSummary({ signals }) {
|
|
206
|
-
const { t } = useTranslation();
|
|
207
|
-
return (_jsxs("div", { className: "bg-panel border border-amber/20 border-l-[3px] border-l-amber rounded-[6px] p-5", children: [_jsx(SectionTitle, { children: t("pages.focus.degradedTitle") }), _jsx("p", { className: "text-ink-2 text-sm leading-relaxed mt-2", children: t("pages.focus.degradedStateReason") }), _jsx("div", { className: "mt-4 space-y-[10px]", children: signals.map((signal, i) => (_jsx(DegradedSignalCard, { signal: signal }, `${signal.source}-${i}`))) })] }));
|
|
208
|
-
}
|
|
209
|
-
// ── PRI-586: Governance Experience Snapshot display ─────────────────────────
|
|
210
|
-
// Exhaustive Record maps over the snapshot enums (ERR-106: no binary ternaries
|
|
211
|
-
// folding union members into a default branch). Exported for the i18n parity
|
|
212
|
-
// test; keys must exist in BOTH en.json and zh-CN.json (cr10).
|
|
213
|
-
export const EXPERIENCE_ATTENTION = {
|
|
214
|
-
setup_required: { labelKey: "pages.focus.experience.attention.setupRequired", badgeClass: "bg-amber/10 text-amber border border-amber/20" },
|
|
215
|
-
owner_decision_required: { labelKey: "pages.focus.experience.attention.ownerDecisionRequired", badgeClass: "bg-gov/10 text-gov border border-gov/20" },
|
|
216
|
-
recovery_required: { labelKey: "pages.focus.experience.attention.recoveryRequired", badgeClass: "bg-amber/10 text-amber border border-amber/20" },
|
|
217
|
-
degraded: { labelKey: "pages.focus.experience.attention.degraded", badgeClass: "bg-amber/10 text-amber border border-amber/20" },
|
|
218
|
-
background_processing: { labelKey: "pages.focus.experience.attention.backgroundProcessing", badgeClass: "bg-green/10 text-green border border-green/20" },
|
|
219
|
-
all_clear: { labelKey: "pages.focus.experience.attention.allClear", badgeClass: "text-ink-4 border border-line bg-surface/80" },
|
|
220
|
-
};
|
|
221
|
-
export const EXPERIENCE_REASON = {
|
|
222
|
-
"governance.exp.reason.owner_identity_missing": "pages.focus.experience.reason.ownerIdentityMissing",
|
|
223
|
-
"governance.exp.reason.owner_identity_invalid": "pages.focus.experience.reason.ownerIdentityInvalid",
|
|
224
|
-
"governance.exp.reason.owner_authentication_missing": "pages.focus.experience.reason.ownerAuthenticationMissing",
|
|
225
|
-
"governance.exp.reason.approval_pending": "pages.focus.experience.reason.approvalPending",
|
|
226
|
-
"governance.exp.reason.rulecode_owner_decision": "pages.focus.experience.reason.rulecodeOwnerDecision",
|
|
227
|
-
"governance.exp.reason.no_pending_decision": "pages.focus.experience.reason.noPendingDecision",
|
|
228
|
-
"governance.exp.reason.owner_decision_available": "pages.focus.experience.reason.ownerDecisionAvailable",
|
|
229
|
-
"governance.exp.reason.break_glass_entry": "pages.focus.experience.reason.breakGlassEntry",
|
|
230
|
-
"governance.exp.reason.recovery_required": "pages.focus.experience.reason.recoveryRequired",
|
|
231
|
-
"governance.exp.reason.source_unavailable": "pages.focus.experience.reason.sourceUnavailable",
|
|
232
|
-
"governance.exp.reason.config_invalid": "pages.focus.experience.reason.configInvalid",
|
|
233
|
-
"governance.exp.reason.processing": "pages.focus.experience.reason.processing",
|
|
234
|
-
"governance.exp.reason.workspace_clear": "pages.focus.experience.reason.workspaceClear",
|
|
235
|
-
"governance.exp.reason.workspace_empty": "pages.focus.experience.reason.workspaceEmpty",
|
|
236
|
-
};
|
|
237
|
-
export const EXPERIENCE_NEXT_ACTION = {
|
|
238
|
-
"governance.exp.next.configure_owner": "pages.focus.experience.next.configureOwner",
|
|
239
|
-
"governance.exp.next.authenticate_console": "pages.focus.experience.next.authenticateConsole",
|
|
240
|
-
"governance.exp.next.review_approvals": "pages.focus.experience.next.reviewApprovals",
|
|
241
|
-
"governance.exp.next.inspect_recovery": "pages.focus.experience.next.inspectRecovery",
|
|
242
|
-
"governance.exp.next.inspect_sources": "pages.focus.experience.next.inspectSources",
|
|
243
|
-
"governance.exp.next.fix_config": "pages.focus.experience.next.fixConfig",
|
|
244
|
-
"governance.exp.next.monitor": "pages.focus.experience.next.monitor",
|
|
245
|
-
"governance.exp.next.none": "pages.focus.experience.next.none",
|
|
246
|
-
};
|
|
247
|
-
const EXPERIENCE_ENVIRONMENT = {
|
|
248
|
-
production: "pages.focus.experience.trust.environment.production",
|
|
249
|
-
development: "pages.focus.experience.trust.environment.development",
|
|
250
|
-
demo: "pages.focus.experience.trust.environment.demo",
|
|
251
|
-
test: "pages.focus.experience.trust.environment.test",
|
|
252
|
-
unknown: "pages.focus.experience.trust.environment.unknown",
|
|
253
|
-
};
|
|
254
|
-
function ExperienceSummaryCard({ snapshot }) {
|
|
255
|
-
const { t } = useTranslation();
|
|
256
|
-
const attention = EXPERIENCE_ATTENTION[snapshot.summary.primaryAttention];
|
|
257
|
-
const categoryOf = (category) => snapshot.activity.categories.find(entry => entry.category === category);
|
|
258
|
-
const decision = categoryOf("needs_decision");
|
|
259
|
-
const recovery = categoryOf("needs_recovery");
|
|
260
|
-
const blocked = categoryOf("blocked");
|
|
261
|
-
const processing = categoryOf("processing");
|
|
262
|
-
const firstIssue = snapshot.dataQuality.issueGroups[0];
|
|
263
|
-
const governanceBlocked = snapshot.readiness.ownerIdentityConfiguration !== "configured"
|
|
264
|
-
|| snapshot.readiness.authenticationMode !== "authenticated";
|
|
265
|
-
const blockerKey = snapshot.readiness.ownerIdentityConfiguration === "invalid"
|
|
266
|
-
? "pages.focus.experience.blocker.identityInvalid"
|
|
267
|
-
: snapshot.readiness.ownerIdentityConfiguration === "missing"
|
|
268
|
-
? "pages.focus.experience.blocker.identityMissing"
|
|
269
|
-
: "pages.focus.experience.blocker.authenticationMissing";
|
|
270
|
-
return (_jsxs("div", { className: "mb-7 px-[18px] py-[14px] bg-panel border border-line rounded-[6px]", "data-testid": "experience-summary", children: [_jsx("div", { className: "flex items-center gap-2 mb-1", children: _jsx("span", { className: `inline-flex items-center rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase ${attention.badgeClass}`, role: "status", children: t(attention.labelKey) }) }), _jsx("div", { className: "text-ink-2 text-[13px] leading-relaxed mt-1", "data-testid": "experience-reason", children: t(EXPERIENCE_REASON[snapshot.summary.reasonCode]) }), _jsxs("div", { className: "text-ink-4 text-[13px] leading-relaxed mt-1", children: [_jsx("span", { className: "font-medium", children: t("pages.focus.nextActionLabel") }), " ", t(EXPERIENCE_NEXT_ACTION[snapshot.summary.nextActionCode])] }), (decision !== undefined || recovery !== undefined || blocked !== undefined || processing !== undefined) && (_jsxs("div", { className: "text-[13px] text-ink-3 mt-2 leading-relaxed", "data-testid": "experience-activity", children: [decision !== undefined && (_jsx("span", { className: "mr-4", children: t("pages.focus.experience.activity.needsDecision", { count: decision.count }) })), recovery !== undefined && (_jsx("span", { className: "mr-4", children: t("pages.focus.experience.activity.needsRecovery", { count: recovery.count }) })), blocked !== undefined && _jsx("span", { className: "mr-4", children: t("pages.focus.experience.activity.blocked") }), processing !== undefined && (_jsx("span", { children: t("pages.focus.experience.activity.processing", { count: processing.count }) }))] })), governanceBlocked && (_jsxs("div", { className: "mt-3 flex items-center justify-between gap-3 border border-amber/30 rounded-[6px] bg-surface px-3 py-2.5", "data-testid": "owner-configure-guide", children: [_jsx("p", { className: "text-[12px] text-ink-3 leading-relaxed", children: t(blockerKey) }), _jsx(Link, { to: "/settings", className: "shrink-0 text-[12px] text-gov underline hover:text-gov-2", children: t("pages.focus.experience.blocker.goSettings") })] })), _jsxs("div", { className: "mt-1 text-[12px] text-ink-4", "data-testid": "experience-trust", children: [t(EXPERIENCE_ENVIRONMENT[snapshot.trustContext.environmentContext.environment]), " · ", t(`pages.focus.experience.trust.lineage.${snapshot.trustContext.lineageTransparency.confidence}`)] }), snapshot.dataQuality.degraded && (_jsx("div", { className: "mt-2 text-[12px] text-amber leading-relaxed", "data-testid": "experience-data-quality", children: t("pages.focus.experience.dataQuality.degraded", { count: firstIssue?.count ?? 0, reasonCode: firstIssue?.reasonCode ?? "" }) }))] }));
|
|
271
|
-
}
|
|
272
|
-
function decisionWorkKind(kind) {
|
|
273
|
-
switch (kind) {
|
|
274
|
-
case 'rulecode_decision': return 'promotion';
|
|
275
|
-
case 'evaluator_review': return 'revision';
|
|
276
|
-
case 'rollout_review': return 'validation';
|
|
277
|
-
case 'activation_approval': return 'approval';
|
|
278
|
-
default: return 'unknown';
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
function approvalWorkKind(channel) {
|
|
282
|
-
switch (channel) {
|
|
283
|
-
case 'prompt': return 'prompt';
|
|
284
|
-
case 'code_tool_hook': return 'rule';
|
|
285
|
-
case 'defer_archive': return 'archive';
|
|
286
|
-
default: return 'unknown';
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
const FOCUS_SOURCES = ['summary', 'approvals', 'activations', 'bindings', 'decisions', 'inbox'];
|
|
290
|
-
export function FocusPage({ featureFlags }) {
|
|
291
|
-
const { t } = useTranslation();
|
|
292
|
-
// PRI-586: when governance_experience_v1 is enabled the governance summary
|
|
293
|
-
// comes ONLY from the experience snapshot — the legacy queue endpoint is not
|
|
294
|
-
// consulted (SPEC §14.2 no old-queue + snapshot merge). Approvals and
|
|
295
|
-
// activations remain the MUTATION surface (action cards), not a status source.
|
|
296
|
-
const experienceMode = featureFlags?.governance_experience_v1?.enabled === true;
|
|
297
|
-
// Flags still loading (undefined): fire NEITHER governance status endpoint —
|
|
298
|
-
// otherwise a transient legacy queue request goes out before the flag turns
|
|
299
|
-
// experience mode on (wasted call + legacy-panel flash). Hold in `loading`.
|
|
300
|
-
const flagsResolved = featureFlags !== undefined;
|
|
301
|
-
const [bindingQueue, setBindingQueue] = useState(null);
|
|
302
|
-
const [bindingError, setBindingError] = useState(null);
|
|
303
|
-
const [completedMessage, setCompletedMessage] = useState(null);
|
|
304
|
-
const requestEpoch = useRef(0);
|
|
305
|
-
const [pendingSources, setPendingSources] = useState(FOCUS_SOURCES);
|
|
306
|
-
const [queueData, setQueueData] = useState(null);
|
|
307
|
-
const [experienceData, setExperienceData] = useState(null);
|
|
308
|
-
const [groupedData, setGroupedData] = useState(null);
|
|
309
|
-
const [loadingState, setLoadingState] = useState("loading");
|
|
310
|
-
const [errorMessage, setErrorMessage] = useState(null);
|
|
311
|
-
const [groupedErrorReason, setGroupedErrorReason] = useState(null);
|
|
312
|
-
const [ruleCodeItems, setRuleCodeItems] = useState([]);
|
|
313
|
-
const [ruleCodeErrorReason, setRuleCodeErrorReason] = useState(null);
|
|
314
|
-
// PRI-629: 统一 Owner Inbox — 两种模式都加载 (决策与治理摘要模式正交)
|
|
315
|
-
const [ownerDecisionItems, setOwnerDecisionItems] = useState([]);
|
|
316
|
-
const [ownerDecisionError, setOwnerDecisionError] = useState(null);
|
|
317
|
-
// Owner Decision Experience v1: canonical decision inbox (3 groups + aggregate
|
|
318
|
-
// historical notice). Display-only; degradation is observable, never silent.
|
|
319
|
-
const [ownerInbox, setOwnerInbox] = useState(null);
|
|
320
|
-
const [ownerInboxError, setOwnerInboxError] = useState(null);
|
|
321
|
-
// PD_PROMPT_CAPACITY_V1 R-A1: request-level target host for the prompt
|
|
322
|
-
// capacity forecast + approve precheck. Set from the 未确认 banner when the
|
|
323
|
-
// workspace's applicable hosts would take different routes; request-scoped
|
|
324
|
-
// only — no persisted host configuration is created here.
|
|
325
|
-
const [promptTargetHost, setPromptTargetHost] = useState(null);
|
|
326
|
-
const loadData = useCallback(async () => {
|
|
327
|
-
const epoch = ++requestEpoch.current;
|
|
328
|
-
setLoadingState("loaded");
|
|
329
|
-
setPendingSources(FOCUS_SOURCES);
|
|
330
|
-
setExperienceData(null);
|
|
331
|
-
setQueueData(null);
|
|
332
|
-
setGroupedData(null);
|
|
333
|
-
setRuleCodeItems([]);
|
|
334
|
-
setBindingQueue(null);
|
|
335
|
-
setOwnerDecisionItems([]);
|
|
336
|
-
setOwnerInbox(null);
|
|
337
|
-
setErrorMessage(null);
|
|
338
|
-
setGroupedErrorReason(null);
|
|
339
|
-
setRuleCodeErrorReason(null);
|
|
340
|
-
setBindingError(null);
|
|
341
|
-
setOwnerDecisionError(null);
|
|
342
|
-
setOwnerInboxError(null);
|
|
343
|
-
// Each source publishes independently. A stalled history/inbox request must
|
|
344
|
-
// not hide already available decisions; old request epochs cannot publish.
|
|
345
|
-
async function settle(source, request, apply, fail) {
|
|
346
|
-
try {
|
|
347
|
-
const result = await request;
|
|
348
|
-
if (epoch === requestEpoch.current)
|
|
349
|
-
apply(result);
|
|
350
|
-
}
|
|
351
|
-
catch (error) {
|
|
352
|
-
if (epoch === requestEpoch.current)
|
|
353
|
-
fail(error instanceof Error ? error.message : t('pages.focus.loadError'));
|
|
354
|
-
}
|
|
355
|
-
finally {
|
|
356
|
-
if (epoch === requestEpoch.current)
|
|
357
|
-
setPendingSources(current => current.filter(item => item !== source));
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
await Promise.all([
|
|
361
|
-
experienceMode
|
|
362
|
-
? settle('summary', fetchGovernanceExperience(), result => {
|
|
363
|
-
if (result.success)
|
|
364
|
-
setExperienceData(result.data);
|
|
365
|
-
else
|
|
366
|
-
setErrorMessage(result.error);
|
|
367
|
-
}, setErrorMessage)
|
|
368
|
-
: settle('summary', fetchGovernanceQueue(), result => {
|
|
369
|
-
if (result.success)
|
|
370
|
-
setQueueData(result.data);
|
|
371
|
-
else
|
|
372
|
-
setErrorMessage(result.error);
|
|
373
|
-
}, setErrorMessage),
|
|
374
|
-
settle('approvals', fetchApprovalsGrouped(promptTargetHost ?? undefined), result => {
|
|
375
|
-
if (!result.success) {
|
|
376
|
-
setGroupedErrorReason(result.error);
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
const data = validateApprovalsGroupedData(result.data);
|
|
380
|
-
setGroupedData(data);
|
|
381
|
-
if (data === null)
|
|
382
|
-
setGroupedErrorReason(t('pages.focus.workbench.approvalsUnavailable'));
|
|
383
|
-
}, setGroupedErrorReason),
|
|
384
|
-
settle('activations', fetchAllActivations(promptTargetHost ?? undefined), result => {
|
|
385
|
-
if (result.success)
|
|
386
|
-
setRuleCodeItems(result.data.activations.filter(item => item.channel === 'code_tool_hook' && item.status === 'active'));
|
|
387
|
-
else
|
|
388
|
-
setRuleCodeErrorReason(result.error);
|
|
389
|
-
}, setRuleCodeErrorReason),
|
|
390
|
-
settle('bindings', fetchRuleBindingQueue(), result => {
|
|
391
|
-
if (result.success)
|
|
392
|
-
setBindingQueue(result.data);
|
|
393
|
-
else
|
|
394
|
-
setBindingError(result.error);
|
|
395
|
-
}, setBindingError),
|
|
396
|
-
settle('decisions', fetchOwnerDecisions(), result => {
|
|
397
|
-
if (result.success)
|
|
398
|
-
setOwnerDecisionItems(result.data.items);
|
|
399
|
-
else
|
|
400
|
-
setOwnerDecisionError(result.error);
|
|
401
|
-
}, setOwnerDecisionError),
|
|
402
|
-
settle('inbox', fetchOwnerDecisionInbox(), result => {
|
|
403
|
-
if (result.success)
|
|
404
|
-
setOwnerInbox(result.data);
|
|
405
|
-
else if (result.reason !== 'feature_disabled')
|
|
406
|
-
setOwnerInboxError(result.error);
|
|
407
|
-
}, setOwnerInboxError),
|
|
408
|
-
]);
|
|
409
|
-
}, [experienceMode, t, promptTargetHost]);
|
|
410
|
-
function changePromptTargetHost(host) {
|
|
411
|
-
if (host === promptTargetHost)
|
|
412
|
-
return;
|
|
413
|
-
requestEpoch.current++;
|
|
414
|
-
setPendingSources(FOCUS_SOURCES);
|
|
415
|
-
setCompletedMessage(null);
|
|
416
|
-
setPromptTargetHost(host);
|
|
417
|
-
}
|
|
418
|
-
useEffect(() => {
|
|
419
|
-
if (!flagsResolved)
|
|
420
|
-
return;
|
|
421
|
-
void loadData();
|
|
422
|
-
return () => { requestEpoch.current++; };
|
|
423
|
-
}, [flagsResolved, loadData]);
|
|
424
|
-
// ── Loading state ────────────────────────────────────────────────────────
|
|
425
|
-
if (loadingState === "loading") {
|
|
426
|
-
return (_jsx(PageShell, { children: _jsx(PageLoading, { cardCount: 3, label: t("common.loading") }) }));
|
|
427
|
-
}
|
|
428
|
-
// ── Error state (ERR-002: degradation with reason) ───────────────────────
|
|
429
|
-
if (loadingState === "error") {
|
|
430
|
-
return (_jsxs(PageShell, { children: [_jsx("div", { className: "font-mono text-[11px] uppercase tracking-[0.1em] text-ink-3 mb-2", children: t("pages.focus.eyebrow") }), _jsx("h1", { className: "text-[29px] font-semibold tracking-tight text-ink mb-2", children: t("pages.focus.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.focus.loadError") }), errorMessage && (_jsx("p", { className: "mt-2 text-ink-4 text-[13px] font-mono", children: errorMessage }))] })] }));
|
|
431
|
-
}
|
|
432
|
-
// ── Loaded state ─────────────────────────────────────────────────────────
|
|
433
|
-
const pendingGroups = groupedData?.groups.filter((g) => g.status === "pending") ?? [];
|
|
434
|
-
const groupedAvailable = groupedData !== null;
|
|
435
|
-
const decisionItems = selectDecisionSurfaceItems(ownerDecisionItems, groupedAvailable);
|
|
436
|
-
const pendingCount = queueData?.pendingReviewCount ?? 0;
|
|
437
|
-
const deviationCount = queueData?.behaviorDeviationCount ?? 0;
|
|
438
|
-
const stagnationSignals = queueData?.stagnationSignals ?? [];
|
|
439
|
-
const stagnationCount = stagnationSignals.length;
|
|
440
|
-
const governanceState = queueData?.governanceState ?? "none";
|
|
441
|
-
const stateReasonCode = queueData?.stateReasonCode ?? "no_pipeline_activity";
|
|
442
|
-
const nextActionCode = queueData?.nextActionCode ?? "wait_for_pipeline";
|
|
443
|
-
const inProgressSummary = queueData?.inProgressSummary;
|
|
444
|
-
const degradedSignals = queueData?.degradedSignals;
|
|
445
|
-
const evidenceCount = queueData?.evidenceInProgressCount ?? 0;
|
|
446
|
-
const gateBlocksToday = queueData?.gateBlocksToday ?? 0;
|
|
447
|
-
const approvalDataUnavailable = (groupedData === null || groupedData.groups.length === 0) && pendingCount > 0;
|
|
448
|
-
const ruleCodePending = ruleCodeItems.filter(item => item.action === 'code_tool_hook_shadow_activate' && item.enforcement !== 'safety_isolated');
|
|
449
|
-
const ruleCodeAlerts = ruleCodeItems.filter(item => item.enforcement === 'safety_isolated');
|
|
450
|
-
// PRI-787: 决策动作被治理就绪门锁定时,必须在卡片上给出可见原因(rc-9 —
|
|
451
|
-
// 未知就绪状态或新宿主的材料仍在读取时,允许阅读,不放行动作。
|
|
452
|
-
const ownerActionsLockedReason = pendingSources.includes('summary') || (experienceMode && experienceData === null)
|
|
453
|
-
? t("pages.focus.workbench.permissionsUnknown")
|
|
454
|
-
: experienceData === null
|
|
455
|
-
|| (experienceData.readiness.authenticationMode === "authenticated"
|
|
456
|
-
&& experienceData.readiness.ownerIdentityConfiguration === "configured")
|
|
457
|
-
? null
|
|
458
|
-
: t(experienceData.readiness.authenticationMode !== "authenticated"
|
|
459
|
-
? "pages.focus.ownerDecision.actionsLockedAuth"
|
|
460
|
-
: "pages.focus.ownerDecision.actionsLockedIdentity");
|
|
461
|
-
// ── SPEC-PD-UIUX-001 R2: one primary action surface per decision object ──
|
|
462
|
-
// Matching uses the verified principleId association field (never titles).
|
|
463
|
-
// See partitionInboxForDisplay for the semantics.
|
|
464
|
-
const actionCardPrincipleIds = new Set();
|
|
465
|
-
for (const item of decisionItems) {
|
|
466
|
-
if (item.principleId !== undefined)
|
|
467
|
-
actionCardPrincipleIds.add(item.principleId);
|
|
468
|
-
}
|
|
469
|
-
for (const group of pendingGroups)
|
|
470
|
-
actionCardPrincipleIds.add(group.principleId);
|
|
471
|
-
const inboxPartition = ownerInbox !== null && ownerInboxError === null
|
|
472
|
-
? partitionInboxForDisplay(ownerInbox, actionCardPrincipleIds)
|
|
473
|
-
: null;
|
|
474
|
-
const inboxBlockedIndividual = inboxPartition?.blockedIndividual ?? [];
|
|
475
|
-
const inboxBlockedAggregate = inboxPartition?.blockedAggregate ?? [];
|
|
476
|
-
const inboxRecovery = inboxPartition?.recovery ?? [];
|
|
477
|
-
const unmatchedInboxDecisions = inboxPartition?.unmatchedDecisions ?? [];
|
|
478
|
-
// 待处理口径 (INV-01 lineage): decision + blocked-individual + recovery —
|
|
479
|
-
// same three groups the inbox renders; historical unknowns stay explanatory.
|
|
480
|
-
// Review round 2 (P2): the headline never claims allClear from the inbox
|
|
481
|
-
// alone; degraded payloads surface their reason — see deriveConclusionDisplay.
|
|
482
|
-
const conclusionDisplay = deriveConclusionDisplay({ ownerInbox, ownerInboxError });
|
|
483
|
-
// Map codes to i18n text
|
|
484
|
-
// Governance Recovery Actions v1: tasks_need_human_review interpolates the
|
|
485
|
-
// needs_human_review task count, not the approvals count.
|
|
486
|
-
const humanReviewCount = queueData?.pendingHumanReviewCount ?? 0;
|
|
487
|
-
const stateReasonCount = stateReasonCode === "tasks_need_human_review" ? humanReviewCount : pendingCount;
|
|
488
|
-
const stateReason = getStateReasonText(stateReasonCode, t, stateReasonCount);
|
|
489
|
-
const nextAction = getNextActionText(nextActionCode, t);
|
|
490
|
-
const sourcesUncertain = pendingSources.length > 0 || conclusionDisplay.mode === 'degraded' || experienceData?.dataQuality.degraded === true
|
|
491
|
-
|| ruleCodeErrorReason !== null || errorMessage !== null || ownerDecisionError !== null || groupedErrorReason !== null || bindingError !== null || ownerInboxError !== null;
|
|
492
|
-
const workItems = [
|
|
493
|
-
...ruleCodePending.filter(item => !decisionItems.some(decision => decision.kind === 'rulecode_decision' && decision.taskId === item.activationId)).map(item => ({ key: `activation:${item.activationId}`, title: splitReadingTitleBody(t('pages.focus.workbench.rulePromotion')).title,
|
|
494
|
-
kind: 'promotion', summary: t('pages.focus.workbench.promotionSummary'), reference: item.activationId,
|
|
495
|
-
content: _jsxs("div", { className: "text-sm leading-relaxed text-ink-2", children: [_jsx("p", { children: t('pages.focus.workbench.promotionSummary') }), _jsx(Link, { to: `/activation?activationId=${encodeURIComponent(item.activationId)}`, className: "mt-4 inline-block text-gov underline", children: t('pages.focus.workbench.openActivation') })] }) })),
|
|
496
|
-
...decisionItems.map(item => ({ key: `decision:${item.reviewKey}`, title: splitReadingTitleBody(item.title).title,
|
|
497
|
-
kind: decisionWorkKind(item.kind), summary: item.summary, reference: item.taskId,
|
|
498
|
-
content: _jsx(OwnerDecisionCard, { item: item, governanceReady: ownerActionsLockedReason === null, actionsLockedReason: ownerActionsLockedReason ?? undefined, onResolved: () => { setCompletedMessage({ key: `decision:${item.reviewKey}`, message: t('pages.focus.workbench.decisionRecorded') }); void loadData(); } }, `${item.reviewKey}:${promptTargetHost ?? 'default'}`) })),
|
|
499
|
-
...pendingGroups.flatMap(group => group.records.filter(record => record.status === 'pending').map((record, index) => ({
|
|
500
|
-
key: `approval:${record.id}`, title: new Set(group.records.map(entry => entry.artifactId)).size > 1 ? t('pages.focus.workbench.versionNeedsReview', { index: index + 1 }) : splitReadingTitleBody(selectApprovalGroupDisplayTitle(group) ?? t('pages.focus.untitledCandidate')).title,
|
|
501
|
-
kind: approvalWorkKind(record.channel),
|
|
502
|
-
summary: t('pages.focus.workbench.approvalSummary'),
|
|
503
|
-
content: _jsx(ApprovalSubjectReading, { principleId: group.principleId, approvalId: record.id, artifactId: record.artifactId, channel: record.channel, lockedReason: ownerActionsLockedReason ?? undefined, targetHost: promptTargetHost ?? undefined, revisionReview: new Set(group.records.filter(entry => entry.status === 'pending').map(entry => entry.artifactId)).size === 1 ? group.revisionReview : undefined, revisionReviewUnavailable: record.revisionReviewUnavailable ?? (group.records.some(entry => entry.status === 'pending' && entry.revisionReviewUnavailable === true) ? false : group.revisionReviewUnavailable), sourceUnlinked: showsUnlinkedCandidateNote(group), promptInjection: groupedData?.promptInjection, budgetNotice: groupedData?.promptInjection?.truncated === true && groupedData.promptInjection.capacityStatus !== 'unconfirmed' ? t(groupedData.promptInjection.productionRotates === true ? group.fitsPromptBudget === true ? group.promptBudgetTierFit === 'model_dependent'
|
|
504
|
-
? 'pages.focus.approveQueueBadgeRotationModelDependent' : 'pages.focus.approveQueueBadgeRotation' : 'pages.focus.approveQueueBadgeOversized' : 'pages.focus.approveQueueBadge', { used: groupedData.promptInjection.usedChars, budget: groupedData.promptInjection.budget }) : undefined, onResolved: message => { setCompletedMessage({ key: `approval:${record.id}`, message }); void loadData(); } }, `${record.id}:${promptTargetHost ?? 'default'}`),
|
|
505
|
-
}))),
|
|
506
|
-
...(bindingQueue?.items ?? []).filter(item => !['bound_generating', 'bound_advanced', 'bound_not_built'].includes(deriveRuleBindingCardState(item))).map(item => ({ key: `binding:${item.candidateId}`, title: splitReadingTitleBody(item.text).title,
|
|
507
|
-
kind: 'binding', summary: item.pain.text ?? t('pages.focus.workbench.bindingSummary'), reference: item.candidateId,
|
|
508
|
-
content: _jsx(RuleCandidateBindingPanel, { candidateId: item.candidateId, onChanged: () => { void loadData(); } }, item.candidateId) })),
|
|
509
|
-
];
|
|
510
|
-
return (_jsx(PageShell, { className: "max-w-[1120px] owner-workbench-container", children: _jsxs("div", { className: "animate-[pdFadeIn_400ms_ease-out]", children: [_jsx("div", { className: "font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3", children: t("pages.focus.eyebrow") }), _jsx(ShinyText, { as: "h1", className: "text-[29px] font-semibold tracking-tight text-ink mb-2", duration: 4.5, brightness: 0.5, disabled: pendingCount === 0, children: t('pages.focus.workbench.title') }), _jsx("p", { className: "text-ink-3 text-[14px] max-w-[760px] leading-relaxed mb-7", children: t('pages.focus.workbench.subtitle') }), _jsxs("section", { "aria-label": t("pages.focus.conclusion.sectionTitle"), "data-testid": "focus-conclusion", className: "mb-7 px-[18px] py-[14px] bg-panel border border-line rounded-[6px]", children: [_jsxs("div", { className: "flex items-center gap-2 mb-1", children: [_jsx("span", { className: `inline-flex items-center rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase ${experienceMode && experienceData !== null
|
|
511
|
-
? EXPERIENCE_ATTENTION[experienceData.summary.primaryAttention].badgeClass
|
|
512
|
-
: governanceState === "owner_review_ready"
|
|
513
|
-
? "bg-gov/10 text-gov border border-gov/20"
|
|
514
|
-
: governanceState === "degraded"
|
|
515
|
-
? "bg-amber/10 text-amber border border-amber/20"
|
|
516
|
-
: governanceState === "in_progress"
|
|
517
|
-
? "bg-green/10 text-green border border-green/20"
|
|
518
|
-
: "text-ink-4 border border-line bg-surface/80"}`, role: "status", "data-testid": "focus-conclusion-badge", children: sourcesUncertain ? t('pages.focus.workbench.sourcesPending') : workItems.length > 0 ? t('pages.focus.workbench.title') : experienceMode && experienceData !== null
|
|
519
|
-
? t(EXPERIENCE_ATTENTION[experienceData.summary.primaryAttention].labelKey)
|
|
520
|
-
: t(`pages.focus.stateLabel.${governanceState}`) }), _jsxs("div", { className: "text-ink-2 text-[13px] leading-relaxed", "data-testid": "focus-conclusion-counts", children: [_jsx("span", { className: "font-medium", children: t('pages.focus.workbench.count', { count: workItems.length }) }), sourcesUncertain && _jsx("span", { className: "ml-2 text-amber", "data-testid": "focus-conclusion-uncertain", children: t('pages.focus.workbench.uncertain') })] })] }), conclusionDisplay.mode === 'degraded' && conclusionDisplay.degraded && (_jsxs("div", { className: "mt-3 border border-amber/30 rounded-[6px] bg-surface px-3 py-2.5", "data-testid": "focus-conclusion-degraded", children: [_jsxs("p", { className: "text-[12px] text-ink-3 leading-relaxed", children: [t("pages.focus.conclusion.degradedLabel"), " ", conclusionDisplay.degraded.reason] }), _jsx("p", { className: "mt-1 text-[12px] text-ink-3 leading-relaxed", children: conclusionDisplay.degraded.nextAction })] })), ownerActionsLockedReason !== null && (_jsxs("div", { id: "focus-global-lock-notice", className: "mt-3 flex items-start justify-between gap-3 border border-amber/30 rounded-[6px] bg-surface px-3 py-2.5", "data-testid": "focus-conclusion-lock", children: [_jsx("p", { className: "text-[12px] text-ink-3 leading-relaxed", children: ownerActionsLockedReason }), _jsx(Link, { to: "/settings", className: "shrink-0 text-[12px] text-gov underline hover:text-gov-2", children: t("pages.focus.ownerDecision.goSettingsCta") })] })), _jsxs("details", { className: "mt-2 text-ink-4 text-[11.5px] leading-relaxed", children: [_jsx("summary", { className: "cursor-pointer", children: t('pages.focus.workbench.countExplanation') }), _jsx("p", { className: "mt-2", "data-testid": "focus-conclusion-scope-note", children: t("pages.focus.conclusion.countsNote") })] })] }), (errorMessage || bindingError) && _jsxs("div", { role: "alert", className: "mb-5 border-l-2 border-amber pl-3 text-sm leading-relaxed text-ink-3", children: [_jsx("p", { children: t('pages.focus.workbench.uncertain') }), _jsx("p", { className: "mt-1 text-[12px]", children: errorMessage ?? bindingError }), _jsx("button", { type: "button", onClick: () => { void loadData(); }, className: "mt-2 text-gov underline", children: t('pages.focus.workbench.retry') })] }), ruleCodeAlerts.length > 0 && _jsxs("section", { role: "alert", className: "mb-5 border-l-2 border-danger pl-3 text-sm text-ink", children: [_jsx("p", { children: t('pages.focus.workbench.safetyAlert', { count: ruleCodeAlerts.length }) }), _jsx(Link, { to: "/activation", className: "mt-2 inline-block text-gov underline", children: t('pages.focus.workbench.openActivation') })] }), groupedErrorReason && _jsx("p", { role: "alert", className: "mb-4 text-[13px] text-amber", children: t('pages.focus.workbench.approvalsUnavailable') }), _jsx(OwnerWorkbench, { items: workItems, completed: completedMessage, uncertain: sourcesUncertain }), _jsxs("section", { "aria-label": t("pages.focus.ownerDecision.sectionTitle"), className: "mb-7", "data-testid": "owner-decisions-section", children: [ownerDecisionError !== null && _jsx("p", { role: "alert", className: "text-amber text-[13px]", children: t('pages.focus.ownerDecision.loadError') }), (() => {
|
|
521
|
-
const unconfirmed = groupedData?.promptInjection;
|
|
522
|
-
if (unconfirmed === undefined || unconfirmed.capacityStatus !== "unconfirmed")
|
|
523
|
-
return null;
|
|
524
|
-
return (_jsxs("div", { className: "mb-4 rounded-[3px] border border-amber/40 bg-amber/5 px-3 py-2 text-[12.5px] leading-relaxed text-amber", "data-testid": "prompt-capacity-unconfirmed-banner", children: [_jsx("p", { children: t("pages.focus.promptCapacityUnconfirmed", {
|
|
525
|
-
defaultValue: "当前宿主容量未确认:本工作区适用的宿主会走不同的注入路由,以下数字未绑定具体宿主。",
|
|
526
|
-
}) }), _jsx("ul", { className: "mt-1 list-disc pl-5", children: (unconfirmed.perHost ?? []).map((entry) => (_jsxs("li", { "data-testid": `prompt-capacity-perhost-${entry.hostKind}`, children: [t("pages.focus.promptCapacityPerHostEntry", {
|
|
527
|
-
host: entry.hostKind === "openclaw" ? "OpenClaw" : entry.hostKind === "workbuddy" ? "WorkBuddy" : "Codex",
|
|
528
|
-
billing: entry.route === "shared_render"
|
|
529
|
-
? t("pages.focus.promptCapacitySharedRoute")
|
|
530
|
-
: t("pages.focus.promptCapacityListRoute"),
|
|
531
|
-
used: entry.usedChars,
|
|
532
|
-
// PRI-1017: each host shows ITS OWN budget basis (runtime
|
|
533
|
-
// observation or its own honest fallback) — never the
|
|
534
|
-
// shared headline number.
|
|
535
|
-
budget: entry.budget ?? unconfirmed.budget,
|
|
536
|
-
full: entry.truncated ? t("pages.focus.promptCapacityPerHostFull") : "",
|
|
537
|
-
observed: entry.budgetObservedAt !== undefined
|
|
538
|
-
? t("pages.focus.promptCapacityPerHostObserved", {
|
|
539
|
-
defaultValue: "(预算来自该宿主最近一次运行时观测,观测于 {{observedAt}})",
|
|
540
|
-
observedAt: entry.budgetObservedAt,
|
|
541
|
-
})
|
|
542
|
-
// PRI-1020: a declared basis is the Owner's own config
|
|
543
|
-
// fact — label it as a declaration, never as an
|
|
544
|
-
// observation.
|
|
545
|
-
: entry.budgetCapacitySource === "operator_declared"
|
|
546
|
-
? t("pages.focus.promptCapacityPerHostDeclared", {
|
|
547
|
-
defaultValue: "(预算来自工作区配置声明)",
|
|
548
|
-
})
|
|
549
|
-
: "",
|
|
550
|
-
}), entry.budgetFallbackReason !== undefined && (_jsxs("span", { "data-testid": `prompt-capacity-perhost-reason-${entry.hostKind}`, children: [" · ", t(`pages.focus.budgetFallbackReason.${entry.budgetFallbackReason}`, {
|
|
551
|
-
defaultValue: entry.budgetFallbackReason,
|
|
552
|
-
})] }))] }, entry.hostKind))) }), unconfirmed.nextAction !== undefined && (_jsx("p", { className: "mt-1 text-ink-2", children: unconfirmed.nextAction })), _jsxs("div", { className: "mt-2 flex gap-2", children: [["openclaw", "codex", "workbuddy"].map((host) => (_jsx("button", { type: "button", onClick: () => changePromptTargetHost(host), "data-testid": `prompt-capacity-pick-${host}`, className: `inline-flex items-center border rounded-[3px] px-[10px] py-[4px] transition-colors ${promptTargetHost === host ? "border-amber bg-amber/10" : "border-line hover:border-line-2"}`, children: t("pages.focus.promptCapacityViewAsHost", { host: host === "openclaw" ? "OpenClaw" : host === "workbuddy" ? "WorkBuddy" : "Codex" }) }, host))), promptTargetHost !== null && (_jsx("button", { type: "button", onClick: () => changePromptTargetHost(null), "data-testid": "prompt-capacity-pick-clear", className: "inline-flex items-center border border-line rounded-[3px] px-[10px] py-[4px] hover:border-line-2", children: t("pages.focus.promptCapacityClearHost", { defaultValue: "清除选择" }) }))] })] }));
|
|
553
|
-
})()] }), _jsxs("section", { "aria-label": t("pages.focus.ownerAttention.sectionTitle"), className: "mb-7", "data-testid": "owner-attention-section", children: [_jsxs("div", { className: "flex items-baseline gap-2 mb-3", children: [_jsx(SectionTitle, { children: t("pages.focus.ownerAttention.sectionTitle") }), ownerInbox !== null && ownerInboxError === null && (_jsx("span", { className: "font-mono text-ink-4 text-[12px]", "data-testid": "owner-attention-counts", children: `· ${t("pages.focus.ownerAttention.blockedCount", { count: ownerInbox.groups.blocked.length })} · ${t("pages.focus.ownerAttention.recoveryCount", { count: inboxRecovery.length })}` }))] }), ownerInboxError !== null && (_jsx("p", { className: "text-ink-4 text-[12.5px]", children: t("pages.focus.ownerInbox.loadError") })), ownerInbox !== null && ownerInboxError === null && (_jsxs(_Fragment, { children: [ownerInbox.groups.blocked.length === 0
|
|
554
|
-
&& inboxRecovery.length === 0
|
|
555
|
-
&& unmatchedInboxDecisions.length === 0 && (_jsx("p", { className: "text-ink-4 text-[13px]", children: t("pages.focus.ownerAttention.empty") })), unmatchedInboxDecisions.length > 0 && (_jsx("p", { className: "mb-2 text-ink-4 text-[12px] leading-relaxed", "data-testid": "owner-attention-unmatched-note", children: t("pages.focus.ownerAttention.unmatchedTitle") })), unmatchedInboxDecisions.map((item) => (_jsx(InboxItem, { item: item, t: t, note: t("pages.focus.ownerAttention.unmatchedItemNote") }, item.principleId))), inboxBlockedIndividual.map((item) => (_jsx(InboxItem, { item: item, t: t }, item.principleId))), inboxRecovery.map((item) => (_jsx(InboxItem, { item: item, t: t }, item.principleId))), inboxBlockedAggregate.length > 0 && (_jsxs("p", { className: "mt-2 text-ink-4 text-[12.5px] leading-relaxed", "data-testid": "owner-attention-aggregate-notice", children: [t("pages.focus.ownerAttention.blockedAggregate", { count: inboxBlockedAggregate.length }), " ", _jsx(Link, { to: "/principles", className: "text-gov hover:underline", children: t("pages.focus.ownerInbox.viewLibrary") })] })), ownerInbox.historicalUnknown.count > 0 && (_jsxs("p", { className: "text-ink-4 text-[12.5px] leading-relaxed mt-2", "data-testid": "owner-inbox-aggregate-notice", children: [ownerInbox.historicalUnknown.reasonText, " ", _jsx(Link, { to: "/principles", className: "text-gov hover:underline", children: t("pages.focus.ownerInbox.viewLibrary") })] }))] }))] }), _jsxs("details", { className: "mt-8 border-t border-line pt-5", "data-testid": "focus-runtime-records", children: [_jsx("summary", { className: "cursor-pointer text-[14px] text-ink-3", children: t('pages.focus.workbench.runtimeRecords') }), _jsxs("div", { className: "mt-5", children: [_jsxs("details", { className: "mb-6", children: [_jsx("summary", { className: "cursor-pointer text-sm text-gov", children: t('pages.focus.ruleBinding.title') }), _jsx(RuleCandidateBindingPanel, { onChanged: () => { void loadData(); } })] }), experienceMode && experienceData !== null && !(experienceData.summary.primaryAttention === 'all_clear' && (sourcesUncertain || workItems.length > 0)) ? (_jsx(ExperienceSummaryCard, { snapshot: experienceData })) : !experienceMode ? (_jsxs("div", { className: "mb-7 px-[18px] py-[14px] bg-panel border border-line rounded-[6px]", children: [_jsx("div", { className: "flex items-center gap-2 mb-1", children: _jsx("span", { className: `inline-flex items-center rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase ${governanceState === "owner_review_ready" ? "bg-gov/10 text-gov border border-gov/20"
|
|
556
|
-
: governanceState === "degraded" ? "bg-amber/10 text-amber border border-amber/20"
|
|
557
|
-
: governanceState === "in_progress" ? "bg-green/10 text-green border border-green/20"
|
|
558
|
-
: "text-ink-4 border border-line bg-surface/80"}`, role: "status", children: t(`pages.focus.stateLabel.${governanceState}`) }) }), _jsx("div", { className: "text-ink-2 text-[13px] leading-relaxed mt-1", children: stateReason }), _jsxs("div", { className: "text-ink-4 text-[13px] leading-relaxed mt-1", children: [_jsx("span", { className: "font-medium", children: t("pages.focus.nextActionLabel") }), " ", nextAction] })] })) : null, !experienceMode && (_jsxs(_Fragment, { children: [_jsx(ProseSummary, { pendingCount: pendingCount, deviationCount: deviationCount, stagnationCount: stagnationCount, evidenceCount: evidenceCount }), _jsx(FeedbackStratification, { gateBlocksToday: gateBlocksToday, inProgressCount: evidenceCount, pendingCount: pendingCount }), !experienceMode && governanceState === "none" && pendingCount === 0 && deviationCount === 0 && stagnationCount === 0 && (stateReasonCode === "state_db_missing" ? (_jsx(ZeroStateDbMissing, {})) : (_jsxs(_Fragment, { children: [_jsx(ZeroStateHealthy, {}), _jsx("div", { className: "mt-4", children: _jsx(OnboardingGuide, {}) })] }))), governanceState === "in_progress" && inProgressSummary && (_jsx(InProgressGuide, { summary: inProgressSummary })), degradedSignals && degradedSignals.length > 0 && (_jsx(DegradedSummary, { signals: degradedSignals }))] })), experienceMode && experienceData !== null && experienceData.summary.primaryAttention === "all_clear" && !sourcesUncertain && workItems.length === 0 && (_jsx("div", { className: "mt-4", children: _jsx(OnboardingGuide, {}) })), !experienceMode && (_jsxs("section", { className: "mt-8", "aria-labelledby": "section-deviation", children: [_jsx(SectionTitle, { id: "section-deviation", children: evidenceCount > 0
|
|
559
|
-
? t("pages.focus.sectionEvidenceInProgress")
|
|
560
|
-
: t("pages.focus.sectionDeviation") }), deviationCount > 0 ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "text-ink-2 text-sm mb-3", children: [_jsx("span", { className: "font-mono font-semibold text-ink", children: deviationCount }), " ", t("pages.focus.deviationCount", { count: deviationCount })] }), _jsx("div", { className: "text-ink-4 text-[13px] bg-surface/60 border-l-2 border-amber px-3 py-2 mb-4", children: t("pages.focus.deviationDisclaimer") }), _jsxs("details", { className: "group", children: [_jsx("summary", { className: "text-gov text-[13px] cursor-pointer hover:underline focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2", children: t("pages.focus.viewFullChain") }), _jsx("div", { className: "mt-2 pl-4 border-l-2 border-line text-ink-3 text-[13px]", children: t("pages.focus.deviationDetailPending") })] })] })) : evidenceCount > 0 ? (_jsx("div", { className: "text-ink-3 text-[13px] leading-relaxed py-3", children: t("pages.focus.evidenceInProgress", { count: evidenceCount }) })) : (_jsx("div", { className: "text-ink-3 text-[13px] leading-relaxed py-3", children: t("pages.focus.emptyDeviation") }))] })), !experienceMode && (_jsxs("section", { className: "mt-8", "aria-labelledby": "section-signals", children: [_jsx(SectionTitle, { id: "section-signals", children: t("pages.focus.sectionSignals") }), stagnationSignals.length > 0 ? (_jsx("div", { className: "space-y-[10px]", children: stagnationSignals.map((signal) => (_jsx(StagnationSignalCard, { signal: signal }, signal.principleId))) })) : (_jsx("div", { className: "text-ink-3 text-[13px] leading-relaxed py-3", children: t("pages.focus.emptySignals") }))] }))] })] }), _jsx("div", { className: "mt-8", children: _jsx(DailyThoughtCard, {}) }), _jsx("footer", { className: "mt-12 pt-6 border-t border-line text-ink-3 text-[13px]", children: t("pages.focus.footer") })] }) }));
|
|
561
|
-
}
|
|
562
|
-
/** Owner Decision Experience v1 inbox item — display-only (SPEC §11.1). */
|
|
563
|
-
function InboxItem({ item, t, note }) {
|
|
564
|
-
return (_jsxs("div", { className: "mb-2 rounded-[var(--radius-md)] border border-line p-3", "data-testid": "owner-inbox-item", children: [_jsxs("div", { className: "flex flex-wrap items-baseline gap-2", children: [_jsx(Link, { to: `/principles/${encodeURIComponent(item.principleId)}`, className: "text-ink text-[13.5px] font-medium hover:underline", children: item.learnedPrinciple.status === 'known'
|
|
565
|
-
? item.learnedPrinciple.text
|
|
566
|
-
: item.learnedPrinciple.reasonText }), _jsx("span", { className: "font-mono text-[11px] text-ink-4 border border-line rounded-[2px] px-1.5 py-0.5", children: t(`pages.focus.ownerInbox.group.${item.inbox.group}`) })] }), _jsx("p", { className: "mt-1 text-ink-3 text-[12.5px] leading-relaxed", children: note ?? item.nextAction.ownerText })] }));
|
|
567
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { OwnerDecisionItemData } from "../../utils/validators.js";
|
|
2
|
-
export interface OwnerDecisionCardProps {
|
|
3
|
-
item: OwnerDecisionItemData;
|
|
4
|
-
onResolved: () => void;
|
|
5
|
-
governanceReady?: boolean;
|
|
6
|
-
/** 非空时在动作区渲染可见的锁定原因(rc-9:禁用不允许是无声的)。 */
|
|
7
|
-
actionsLockedReason?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function OwnerDecisionCard({ item, onResolved, governanceReady, actionsLockedReason, }: OwnerDecisionCardProps): import("react").JSX.Element;
|