create-principles-disciple 1.124.1 โ†’ 1.125.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/console/dist/server/models/OwnerDecisionConsoleModel.js +13 -2
  2. package/console/dist/ui/api.js +1 -1
  3. package/console/dist/ui/i18n/en.json +6 -2
  4. package/console/dist/ui/i18n/zh-CN.json +6 -2
  5. package/console/dist/ui/pages/settings/SettingsPage.js +40 -4
  6. package/console/dist/web/assets/app.js +45 -10
  7. package/core/dist/index.d.ts +3 -3
  8. package/core/dist/index.js +3 -3
  9. package/core/dist/runtime-v2/__tests__/pain-signal-observability.test.js +93 -0
  10. package/core/dist/runtime-v2/__tests__/pain-signal-observability.test.js.map +1 -1
  11. package/core/dist/runtime-v2/index.d.ts +2 -0
  12. package/core/dist/runtime-v2/index.d.ts.map +1 -1
  13. package/core/dist/runtime-v2/index.js.map +1 -1
  14. package/core/dist/runtime-v2/pain-signal-bridge.d.ts +8 -1
  15. package/core/dist/runtime-v2/pain-signal-bridge.d.ts.map +1 -1
  16. package/core/dist/runtime-v2/pain-signal-bridge.js.map +1 -1
  17. package/core/dist/runtime-v2/pain-signal-observability.d.ts.map +1 -1
  18. package/core/dist/runtime-v2/pain-signal-observability.js +25 -10
  19. package/core/dist/runtime-v2/pain-signal-observability.js.map +1 -1
  20. package/core/package.json +0 -1
  21. package/host-runtime/dist/governance-signal-admission.js +11 -5
  22. package/host-runtime/dist/index.d.ts +3 -0
  23. package/host-runtime/dist/index.js +1 -0
  24. package/host-runtime/dist/production-pain-evidence.d.ts +7 -0
  25. package/host-runtime/dist/production-pain-evidence.js +9 -4
  26. package/package.json +1 -1
  27. package/pd-cli/dist/commands/pain-list.d.ts +45 -0
  28. package/pd-cli/dist/commands/pain-list.d.ts.map +1 -0
  29. package/pd-cli/dist/commands/pain-list.js +165 -0
  30. package/pd-cli/dist/commands/pain-list.js.map +1 -0
  31. package/pd-cli/dist/index.js +11 -0
  32. package/pd-cli/dist/index.js.map +1 -1
  33. package/plugin/dist/bundle.js +27 -23
  34. package/plugin/dist/core/trajectory-types.d.ts +2 -0
  35. package/plugin/dist/rulehost-evidence.js +9 -7
  36. package/core/dist/adapters/__tests__/code-review-pain-adapter.test.d.ts +0 -2
  37. package/core/dist/adapters/__tests__/code-review-pain-adapter.test.d.ts.map +0 -1
  38. package/core/dist/adapters/__tests__/code-review-pain-adapter.test.js +0 -346
  39. package/core/dist/adapters/__tests__/code-review-pain-adapter.test.js.map +0 -1
  40. package/core/dist/adapters/__tests__/openclaw-pain-adapter.test.d.ts +0 -2
  41. package/core/dist/adapters/__tests__/openclaw-pain-adapter.test.d.ts.map +0 -1
  42. package/core/dist/adapters/__tests__/openclaw-pain-adapter.test.js +0 -290
  43. package/core/dist/adapters/__tests__/openclaw-pain-adapter.test.js.map +0 -1
  44. package/core/dist/adapters/__tests__/writing-pain-adapter.test.d.ts +0 -2
  45. package/core/dist/adapters/__tests__/writing-pain-adapter.test.d.ts.map +0 -1
  46. package/core/dist/adapters/__tests__/writing-pain-adapter.test.js +0 -239
  47. package/core/dist/adapters/__tests__/writing-pain-adapter.test.js.map +0 -1
  48. package/core/dist/adapters/code-review/code-review-pain-adapter.d.ts +0 -13
  49. package/core/dist/adapters/code-review/code-review-pain-adapter.d.ts.map +0 -1
  50. package/core/dist/adapters/code-review/code-review-pain-adapter.js +0 -139
  51. package/core/dist/adapters/code-review/code-review-pain-adapter.js.map +0 -1
  52. package/core/dist/adapters/code-review/index.d.ts +0 -6
  53. package/core/dist/adapters/code-review/index.d.ts.map +0 -1
  54. package/core/dist/adapters/code-review/index.js +0 -2
  55. package/core/dist/adapters/code-review/index.js.map +0 -1
  56. package/core/dist/adapters/code-review/review-event-types.d.ts +0 -54
  57. package/core/dist/adapters/code-review/review-event-types.d.ts.map +0 -1
  58. package/core/dist/adapters/code-review/review-event-types.js +0 -8
  59. package/core/dist/adapters/code-review/review-event-types.js.map +0 -1
  60. package/core/dist/adapters/coding/index.d.ts +0 -6
  61. package/core/dist/adapters/coding/index.d.ts.map +0 -1
  62. package/core/dist/adapters/coding/index.js +0 -5
  63. package/core/dist/adapters/coding/index.js.map +0 -1
  64. package/core/dist/adapters/coding/openclaw-event-types.d.ts +0 -26
  65. package/core/dist/adapters/coding/openclaw-event-types.d.ts.map +0 -1
  66. package/core/dist/adapters/coding/openclaw-event-types.js +0 -9
  67. package/core/dist/adapters/coding/openclaw-event-types.js.map +0 -1
  68. package/core/dist/adapters/coding/openclaw-pain-adapter.d.ts +0 -27
  69. package/core/dist/adapters/coding/openclaw-pain-adapter.d.ts.map +0 -1
  70. package/core/dist/adapters/coding/openclaw-pain-adapter.js +0 -102
  71. package/core/dist/adapters/coding/openclaw-pain-adapter.js.map +0 -1
  72. package/core/dist/adapters/writing/index.d.ts +0 -6
  73. package/core/dist/adapters/writing/index.d.ts.map +0 -1
  74. package/core/dist/adapters/writing/index.js +0 -5
  75. package/core/dist/adapters/writing/index.js.map +0 -1
  76. package/core/dist/adapters/writing/writing-pain-adapter.d.ts +0 -22
  77. package/core/dist/adapters/writing/writing-pain-adapter.d.ts.map +0 -1
  78. package/core/dist/adapters/writing/writing-pain-adapter.js +0 -62
  79. package/core/dist/adapters/writing/writing-pain-adapter.js.map +0 -1
  80. package/core/dist/adapters/writing/writing-types.d.ts +0 -34
  81. package/core/dist/adapters/writing/writing-types.d.ts.map +0 -1
  82. package/core/dist/adapters/writing/writing-types.js +0 -9
  83. package/core/dist/adapters/writing/writing-types.js.map +0 -1
  84. package/core/dist/pain-signal-adapter.d.ts +0 -37
  85. package/core/dist/pain-signal-adapter.d.ts.map +0 -1
  86. package/core/dist/pain-signal-adapter.js +0 -2
  87. package/core/dist/pain-signal-adapter.js.map +0 -1
  88. package/core/dist/pain-signal.d.ts +0 -16
  89. package/core/dist/pain-signal.d.ts.map +0 -1
  90. package/core/dist/pain-signal.js +0 -15
  91. package/core/dist/pain-signal.js.map +0 -1
  92. package/core/dist/runtime-v2/__tests__/pain-signal-unification.test.d.ts +0 -2
  93. package/core/dist/runtime-v2/__tests__/pain-signal-unification.test.d.ts.map +0 -1
  94. package/core/dist/runtime-v2/__tests__/pain-signal-unification.test.js +0 -150
  95. package/core/dist/runtime-v2/__tests__/pain-signal-unification.test.js.map +0 -1
@@ -12,6 +12,7 @@
12
12
  import * as fs from 'node:fs';
13
13
  import * as path from 'node:path';
14
14
  import { SqliteConnection, SqlitePIArtifactStore, SqliteApprovalQueueStore, collectOwnerDecisionFacts, deriveOwnerDecisionCapability, buildOwnerDecisionReview, } from '@principles/core/runtime-v2';
15
+ import { ActivationsConsoleModel } from './ActivationsConsoleModel.js';
15
16
  const GOVERNANCE_TASK_KINDS = new Set(['evaluator', 'rollout_reviewer']);
16
17
  /** tasks.status ๅˆๆณ•ๅ€ผ๏ผˆPDTaskStatus๏ผ‰่ฟ่กŒๆ—ถๅฎˆๅซใ€‚ */
17
18
  const TASK_STATUSES = new Set(['pending', 'leased', 'succeeded', 'retry_wait', 'failed', 'needs_human_review']);
@@ -242,12 +243,22 @@ export class OwnerDecisionConsoleModel {
242
243
  const shadowRows = db.prepare(`SELECT activation_id, artifact_id, channel, activated_at FROM activations
243
244
  WHERE action = 'code_tool_hook_shadow_activate'
244
245
  AND promoted_at IS NULL AND deactivated_at IS NULL`).all().filter(isRecordRow);
246
+ const activationModel = new ActivationsConsoleModel(this.workspaceDir);
245
247
  for (const row of shadowRows) {
246
248
  const artifactId = typeof row.artifact_id === 'string' ? row.artifact_id : '';
249
+ const activationId = typeof row.activation_id === 'string' ? row.activation_id : '';
250
+ try {
251
+ const review = await activationModel.getOwnerReview(activationId, true);
252
+ if (review.readiness.status !== 'ready' && review.readiness.status !== 'evidence_insufficient')
253
+ continue;
254
+ }
255
+ catch {
256
+ continue;
257
+ }
247
258
  items.push({
248
- reviewKey: `rulecode:${String(row.activation_id ?? '')}`,
259
+ reviewKey: `rulecode:${activationId}`,
249
260
  kind: 'rulecode_decision',
250
- taskId: String(row.activation_id ?? ''),
261
+ taskId: activationId,
251
262
  title: 'RuleCode ๅฝฑๅญ่ง„ๅˆ™ๅพ…ๅ†ณ',
252
263
  summary: 'ไธ€ๆก code_tool_hook ่ง„ๅˆ™ๅค„ไบŽๅฝฑๅญๆฟ€ๆดปๆœŸ๏ผŒ็ญ‰ๅพ…ๆ‹ฅๆœ‰่€…่ฃๅ†ณ๏ผˆๆๅ‡ / ๆ‹’็ป๏ผ‰ใ€‚',
253
264
  reasonCode: 'rulecode_shadow_pending_promotion',
@@ -110,7 +110,7 @@ async function syncWorkspace(name) {
110
110
  }
111
111
  // โ”€โ”€ Principles โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
112
112
  async function fetchPrinciples(filter) {
113
- const query = filter && filter !== 'all' ? `?filter=${filter}` : '';
113
+ const query = filter === undefined ? '' : `?filter=${filter}`;
114
114
  return request(`/api/principles${query}`, undefined, validatePrinciplesList);
115
115
  }
116
116
  // Principle detail is deeply nested; for now we accept unvalidated until a
@@ -503,8 +503,8 @@
503
503
  "compareField": "Field",
504
504
  "showMore": "Show more",
505
505
  "showLess": "Show less",
506
- "reviewTitle": "Principle Evolution Timeline",
507
- "reviewSubtitle": "Principle Growth",
506
+ "reviewTitle": "Principle Review",
507
+ "reviewSubtitle": "Review the principles distilled from observed behavior.",
508
508
  "reviewDescription": "These are not cold rules โ€” they are behavioral principles your Agent has distilled from real use.",
509
509
  "metricDeposited": "Deposited Principles",
510
510
  "metricActive": "Active Principles",
@@ -1021,7 +1021,11 @@
1021
1021
  "bearerToken": "Bearer Token",
1022
1022
  "enterAccessToken": "Enter access token",
1023
1023
  "tokenSaved": "Token saved",
1024
+ "tokenSavedRestarting": "Token encrypted and saved; restarting Console to apply itโ€ฆ",
1025
+ "tokenSaveFailed": "Token was not saved. Check desktop encryption and Console status, then retry.",
1026
+ "tokenExternalAttached": "Token saved, but an external Console is still connected.",
1024
1027
  "tokenSessionOnly": "Token is stored in browser session only.",
1028
+ "tokenDesktopStored": "Desktop: encrypted with the Windows system store.",
1025
1029
  "ownerIdentity": {
1026
1030
  "title": "Owner identity",
1027
1031
  "intro": "The Owner identity gates governance decision entry points (RuleCode promotion, emergency pause, etc.). Register to ~/.pd/owner.json (install-level, shared across workspaces). If the PD_OWNER_ID and PD_OWNER_CREDENTIAL_ID environment variables are set together, they take precedence as a pair.",
@@ -503,8 +503,8 @@
503
503
  "compareField": "ๅญ—ๆฎต",
504
504
  "showMore": "ๅฑ•ๅผ€ๆ›ดๅคš",
505
505
  "showLess": "ๆ”ถ่ตท",
506
- "reviewTitle": "ๅŽŸๅˆ™ๆผ”ๅŒ–่ฝจ่ฟน",
507
- "reviewSubtitle": "ๅŽŸๅˆ™ๆˆ้•ฟ",
506
+ "reviewTitle": "ๅŽŸๅˆ™ๅฎกๆŸฅ",
507
+ "reviewSubtitle": "ๅฎก้˜…ไปŽ็œŸๅฎž่กŒไธบไธญๆฒ‰ๆท€ๅ‡บ็š„ๅŽŸๅˆ™ใ€‚",
508
508
  "reviewDescription": "่ฟ™ไบ›ไธๆ˜ฏๅ†ฐๅ†ท็š„่ง„ๅˆ™๏ผŒ่€Œๆ˜ฏๆ™บ่ƒฝไฝ“ๅœจ็œŸๅฎžไฝฟ็”จ่ฟ‡็จ‹ไธญๆฒ‰ๆท€ไธ‹ๆฅ็š„่กŒไธบๅ‡†ๅˆ™ใ€‚",
509
509
  "metricDeposited": "ๆฒ‰ๆท€ๅŽŸๅˆ™",
510
510
  "metricActive": "ๅทฒ็”Ÿๆ•ˆๅŽŸๅˆ™",
@@ -1021,7 +1021,11 @@
1021
1021
  "bearerToken": "Bearer ไปค็‰Œ",
1022
1022
  "enterAccessToken": "่พ“ๅ…ฅ่ฎฟ้—ฎไปค็‰Œ",
1023
1023
  "tokenSaved": "ไปค็‰Œๅทฒไฟๅญ˜",
1024
+ "tokenSavedRestarting": "ไปค็‰ŒๅทฒๅŠ ๅฏ†ไฟๅญ˜๏ผŒๆญฃๅœจ้‡ๅฏๆŽงๅˆถๅฐไปฅๅบ”็”จ่ฎค่ฏโ€ฆ",
1025
+ "tokenSaveFailed": "ไปค็‰Œๆœชไฟๅญ˜๏ผŒ่ฏทๆฃ€ๆŸฅๆกŒ้ขๅŠ ๅฏ†ไธŽๆŽงๅˆถๅฐ็Šถๆ€ๅŽ้‡่ฏ•ใ€‚",
1026
+ "tokenExternalAttached": "ไปค็‰Œๅทฒไฟๅญ˜๏ผŒไฝ†ๅฝ“ๅ‰ไป่ฟžๆŽฅ็€ๅค–้ƒจๆŽงๅˆถๅฐใ€‚",
1024
1027
  "tokenSessionOnly": "ไปค็‰Œไป…ๅญ˜ๅ‚จๅœจๆต่งˆๅ™จไผš่ฏไธญใ€‚",
1028
+ "tokenDesktopStored": "ๆกŒ้ข็‰ˆ๏ผšๅทฒ้€š่ฟ‡ Windows ็ณป็ปŸๅŠ ๅฏ†ๅฎ‰ๅ…จไฟๅญ˜ใ€‚",
1025
1029
  "ownerIdentity": {
1026
1030
  "title": "ๆ‹ฅๆœ‰่€…่บซไปฝ",
1027
1031
  "intro": "ๆ‹ฅๆœ‰่€…่บซไปฝๅ†ณๅฎšๆฒป็†ๅ†ณ็ญ–ๅ…ฅๅฃ๏ผˆRuleCode ๆ™‹ๅ‡ใ€็ดงๆ€ฅๆš‚ๅœ็ญ‰๏ผ‰ใ€‚็™ป่ฎฐๅˆฐ ~/.pd/owner.json๏ผˆๅฎ‰่ฃ…็บง๏ผŒ่ทจๅทฅไฝœๅŒบ็”Ÿๆ•ˆ๏ผ‰ใ€‚่‹ฅ็Žฏๅขƒๅ˜้‡ PD_OWNER_ID ไธŽ PD_OWNER_CREDENTIAL_ID ๆˆๅฏน่ฎพ็ฝฎ๏ผŒๅˆ™ไฝœไธบไธ€ๅฏนๆ•ดไฝ“ไผ˜ๅ…ˆ็”Ÿๆ•ˆใ€‚",
@@ -74,6 +74,12 @@ export function validateWorkspaceArray(raw) {
74
74
  }
75
75
  return entries;
76
76
  }
77
+ function getCompanionBridge() {
78
+ if (typeof window === "undefined")
79
+ return undefined;
80
+ const candidate = window.pdCompanion;
81
+ return candidate;
82
+ }
77
83
  export function SettingsPage() {
78
84
  const { t } = useTranslation();
79
85
  const { soundEnabled, setSoundEnabled } = useNotifications();
@@ -203,9 +209,37 @@ export function SettingsPage() {
203
209
  const trimmed = tokenInput.trim();
204
210
  if (trimmed.length === 0)
205
211
  return;
206
- setToken(trimmed);
207
- await loadOnboardingFlag();
208
- toast.success(t("pages.settings.tokenSaved"));
212
+ try {
213
+ const companion = getCompanionBridge();
214
+ if (companion !== undefined) {
215
+ const result = await companion.configureConsoleToken(trimmed);
216
+ if (!result.persisted) {
217
+ toast.error(t("pages.settings.tokenSaveFailed"));
218
+ if (result.nextAction)
219
+ toast.info(result.nextAction);
220
+ return;
221
+ }
222
+ if (result.reason === "external_console_attached") {
223
+ toast.info(t("pages.settings.tokenExternalAttached"));
224
+ if (result.nextAction)
225
+ toast.info(result.nextAction, { duration: 8000 });
226
+ }
227
+ else if (result.restartRequested) {
228
+ toast.success(t("pages.settings.tokenSavedRestarting"));
229
+ }
230
+ else {
231
+ toast.success(t("pages.settings.tokenSaved"));
232
+ }
233
+ }
234
+ else {
235
+ toast.success(t("pages.settings.tokenSaved"));
236
+ }
237
+ setToken(trimmed);
238
+ await loadOnboardingFlag();
239
+ }
240
+ catch {
241
+ toast.error(t("pages.settings.tokenSaveFailed"));
242
+ }
209
243
  }, [tokenInput, loadOnboardingFlag, t]);
210
244
  // โ”€โ”€ Workspace handlers โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
211
245
  const handleAddWorkspace = useCallback(async () => {
@@ -311,7 +345,9 @@ export function SettingsPage() {
311
345
  return (_jsxs(PageShell, { children: [_jsx("div", { className: "font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3", children: t("pages.settings.eyebrow") }), _jsx("h1", { className: "text-[29px] font-semibold tracking-tight text-ink mb-2", children: t("pages.settings.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.settings.loadError") }), errorMessage && (_jsx("p", { className: "mt-2 text-ink-4 text-[13px] font-mono", children: errorMessage }))] })] }));
312
346
  }
313
347
  // โ”€โ”€ Loaded state โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
314
- return (_jsx(PageShell, { 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.settings.eyebrow") }), _jsx("h1", { className: "text-[29px] font-semibold tracking-tight text-ink mb-2", children: t("pages.settings.title") }), _jsx("p", { className: "text-ink-3 text-[14px] max-w-[760px] leading-relaxed mb-7", children: t("pages.settings.subtitle") }), _jsxs("section", { className: "mb-8", "aria-labelledby": "section-auth", children: [_jsx(SectionTitle, { id: "section-auth", children: t("pages.settings.auth") }), _jsxs("div", { className: "bg-panel border border-line rounded-[6px] p-5", children: [_jsx("label", { htmlFor: "bearer-token-input", className: "block text-sm font-medium text-ink mb-2", children: t("pages.settings.bearerToken") }), _jsx("input", { id: "bearer-token-input", type: "password", value: tokenInput, onChange: (e) => setTokenInput(e.target.value), placeholder: t("pages.settings.enterAccessToken"), className: "w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov" }), _jsxs("div", { className: "flex items-center justify-between mt-3", children: [_jsx("button", { onClick: handleSaveToken, disabled: tokenInput.trim().length === 0, className: "border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2", children: t("common.save") }), _jsx("span", { className: "text-ink-4 text-[12px]", children: t("pages.settings.tokenSessionOnly") })] })] })] }), _jsxs("section", { className: "mb-8", "aria-labelledby": "section-owner-identity", children: [_jsx(SectionTitle, { id: "section-owner-identity", children: t("pages.settings.ownerIdentity.title") }), _jsxs("div", { className: "bg-panel border border-line rounded-[6px] p-5", children: [_jsx("p", { className: "text-ink-3 text-[13px] leading-relaxed mb-3", children: t("pages.settings.ownerIdentity.intro") }), ownerIdentity === null ? (_jsx("div", { className: "text-ink-4 text-[12px]", children: t("pages.settings.ownerIdentity.loading") })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center gap-2 text-[13px] mb-2", "data-testid": "owner-identity-status", children: [_jsx("span", { className: `inline-flex items-center rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase ${ownerIdentity.resolved.source === "none"
348
+ return (_jsx(PageShell, { 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.settings.eyebrow") }), _jsx("h1", { className: "text-[29px] font-semibold tracking-tight text-ink mb-2", children: t("pages.settings.title") }), _jsx("p", { className: "text-ink-3 text-[14px] max-w-[760px] leading-relaxed mb-7", children: t("pages.settings.subtitle") }), _jsxs("section", { className: "mb-8", "aria-labelledby": "section-auth", children: [_jsx(SectionTitle, { id: "section-auth", children: t("pages.settings.auth") }), _jsxs("div", { className: "bg-panel border border-line rounded-[6px] p-5", children: [_jsx("label", { htmlFor: "bearer-token-input", className: "block text-sm font-medium text-ink mb-2", children: t("pages.settings.bearerToken") }), _jsx("input", { id: "bearer-token-input", type: "password", value: tokenInput, onChange: (e) => setTokenInput(e.target.value), placeholder: t("pages.settings.enterAccessToken"), className: "w-full border border-line bg-surface rounded-[3px] px-3 py-2 text-sm text-ink focus:outline-none focus:border-gov focus:ring-1 focus:ring-gov" }), _jsxs("div", { className: "flex items-center justify-between mt-3", children: [_jsx("button", { onClick: handleSaveToken, disabled: tokenInput.trim().length === 0, className: "border border-gov bg-gov text-paper rounded-[3px] px-[14px] py-[6px] text-[12.5px] font-medium hover:bg-gov-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed focus-visible:outline-2 focus-visible:outline-gov focus-visible:outline-offset-2", children: t("common.save") }), _jsx("span", { className: "text-ink-4 text-[12px]", children: getCompanionBridge() === undefined
349
+ ? t("pages.settings.tokenSessionOnly")
350
+ : t("pages.settings.tokenDesktopStored") })] })] })] }), _jsxs("section", { className: "mb-8", "aria-labelledby": "section-owner-identity", children: [_jsx(SectionTitle, { id: "section-owner-identity", children: t("pages.settings.ownerIdentity.title") }), _jsxs("div", { className: "bg-panel border border-line rounded-[6px] p-5", children: [_jsx("p", { className: "text-ink-3 text-[13px] leading-relaxed mb-3", children: t("pages.settings.ownerIdentity.intro") }), ownerIdentity === null ? (_jsx("div", { className: "text-ink-4 text-[12px]", children: t("pages.settings.ownerIdentity.loading") })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center gap-2 text-[13px] mb-2", "data-testid": "owner-identity-status", children: [_jsx("span", { className: `inline-flex items-center rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase ${ownerIdentity.resolved.source === "none"
315
351
  ? "bg-amber text-ink"
316
352
  : ownerIdentity.resolved.source === "invalid_env"
317
353
  ? "bg-danger text-paper"