@legioncodeinc/hive 0.1.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 (190) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +262 -0
  3. package/dist/cli-commands.d.ts +41 -0
  4. package/dist/cli-commands.js +76 -0
  5. package/dist/cli-commands.js.map +1 -0
  6. package/dist/cli.d.ts +2 -0
  7. package/dist/cli.js +46 -0
  8. package/dist/cli.js.map +1 -0
  9. package/dist/daemon/dashboard/app.js +118 -0
  10. package/dist/daemon/dashboard/host.d.ts +90 -0
  11. package/dist/daemon/dashboard/host.js +172 -0
  12. package/dist/daemon/dashboard/host.js.map +1 -0
  13. package/dist/daemon/dashboard/web-assets.d.ts +88 -0
  14. package/dist/daemon/dashboard/web-assets.js +195 -0
  15. package/dist/daemon/dashboard/web-assets.js.map +1 -0
  16. package/dist/daemon/fleet-status.d.ts +15 -0
  17. package/dist/daemon/fleet-status.js +56 -0
  18. package/dist/daemon/fleet-status.js.map +1 -0
  19. package/dist/daemon/gate.d.ts +55 -0
  20. package/dist/daemon/gate.js +128 -0
  21. package/dist/daemon/gate.js.map +1 -0
  22. package/dist/daemon/proxy.d.ts +38 -0
  23. package/dist/daemon/proxy.js +126 -0
  24. package/dist/daemon/proxy.js.map +1 -0
  25. package/dist/daemon/registry.d.ts +31 -0
  26. package/dist/daemon/registry.js +120 -0
  27. package/dist/daemon/registry.js.map +1 -0
  28. package/dist/daemon/server.d.ts +41 -0
  29. package/dist/daemon/server.js +126 -0
  30. package/dist/daemon/server.js.map +1 -0
  31. package/dist/daemon/setup-auth.d.ts +37 -0
  32. package/dist/daemon/setup-auth.js +51 -0
  33. package/dist/daemon/setup-auth.js.map +1 -0
  34. package/dist/daemon/telemetry-proxy.d.ts +47 -0
  35. package/dist/daemon/telemetry-proxy.js +63 -0
  36. package/dist/daemon/telemetry-proxy.js.map +1 -0
  37. package/dist/dashboard/contracts.d.ts +235 -0
  38. package/dist/dashboard/contracts.js +43 -0
  39. package/dist/dashboard/contracts.js.map +1 -0
  40. package/dist/dashboard/web/app.d.ts +44 -0
  41. package/dist/dashboard/web/app.js +179 -0
  42. package/dist/dashboard/web/app.js.map +1 -0
  43. package/dist/dashboard/web/boot-route.d.ts +23 -0
  44. package/dist/dashboard/web/boot-route.js +29 -0
  45. package/dist/dashboard/web/boot-route.js.map +1 -0
  46. package/dist/dashboard/web/build-graph-button.d.ts +46 -0
  47. package/dist/dashboard/web/build-graph-button.js +81 -0
  48. package/dist/dashboard/web/build-graph-button.js.map +1 -0
  49. package/dist/dashboard/web/buzzing-screen.d.ts +30 -0
  50. package/dist/dashboard/web/buzzing-screen.js +135 -0
  51. package/dist/dashboard/web/buzzing-screen.js.map +1 -0
  52. package/dist/dashboard/web/folder-picker.d.ts +54 -0
  53. package/dist/dashboard/web/folder-picker.js +125 -0
  54. package/dist/dashboard/web/folder-picker.js.map +1 -0
  55. package/dist/dashboard/web/graph-layout.d.ts +101 -0
  56. package/dist/dashboard/web/graph-layout.js +0 -0
  57. package/dist/dashboard/web/graph-layout.js.map +1 -0
  58. package/dist/dashboard/web/harness-strip.d.ts +38 -0
  59. package/dist/dashboard/web/harness-strip.js +65 -0
  60. package/dist/dashboard/web/harness-strip.js.map +1 -0
  61. package/dist/dashboard/web/health-rail.d.ts +26 -0
  62. package/dist/dashboard/web/health-rail.js +61 -0
  63. package/dist/dashboard/web/health-rail.js.map +1 -0
  64. package/dist/dashboard/web/main.d.ts +22 -0
  65. package/dist/dashboard/web/main.js +51 -0
  66. package/dist/dashboard/web/main.js.map +1 -0
  67. package/dist/dashboard/web/needs-project.d.ts +51 -0
  68. package/dist/dashboard/web/needs-project.js +69 -0
  69. package/dist/dashboard/web/needs-project.js.map +1 -0
  70. package/dist/dashboard/web/page-frame.d.ts +95 -0
  71. package/dist/dashboard/web/page-frame.js +98 -0
  72. package/dist/dashboard/web/page-frame.js.map +1 -0
  73. package/dist/dashboard/web/pages/coming-soon.d.ts +23 -0
  74. package/dist/dashboard/web/pages/coming-soon.js +19 -0
  75. package/dist/dashboard/web/pages/coming-soon.js.map +1 -0
  76. package/dist/dashboard/web/pages/dashboard.d.ts +32 -0
  77. package/dist/dashboard/web/pages/dashboard.js +205 -0
  78. package/dist/dashboard/web/pages/dashboard.js.map +1 -0
  79. package/dist/dashboard/web/pages/graph.d.ts +72 -0
  80. package/dist/dashboard/web/pages/graph.js +362 -0
  81. package/dist/dashboard/web/pages/graph.js.map +1 -0
  82. package/dist/dashboard/web/pages/harnesses.d.ts +65 -0
  83. package/dist/dashboard/web/pages/harnesses.js +210 -0
  84. package/dist/dashboard/web/pages/harnesses.js.map +1 -0
  85. package/dist/dashboard/web/pages/health.d.ts +22 -0
  86. package/dist/dashboard/web/pages/health.js +91 -0
  87. package/dist/dashboard/web/pages/health.js.map +1 -0
  88. package/dist/dashboard/web/pages/lifecycle-panel.d.ts +60 -0
  89. package/dist/dashboard/web/pages/lifecycle-panel.js +187 -0
  90. package/dist/dashboard/web/pages/lifecycle-panel.js.map +1 -0
  91. package/dist/dashboard/web/pages/logs.d.ts +55 -0
  92. package/dist/dashboard/web/pages/logs.js +311 -0
  93. package/dist/dashboard/web/pages/logs.js.map +1 -0
  94. package/dist/dashboard/web/pages/memories.d.ts +35 -0
  95. package/dist/dashboard/web/pages/memories.js +439 -0
  96. package/dist/dashboard/web/pages/memories.js.map +1 -0
  97. package/dist/dashboard/web/pages/projects.d.ts +38 -0
  98. package/dist/dashboard/web/pages/projects.js +325 -0
  99. package/dist/dashboard/web/pages/projects.js.map +1 -0
  100. package/dist/dashboard/web/pages/roi-chart.d.ts +52 -0
  101. package/dist/dashboard/web/pages/roi-chart.js +133 -0
  102. package/dist/dashboard/web/pages/roi-chart.js.map +1 -0
  103. package/dist/dashboard/web/pages/roi.d.ts +93 -0
  104. package/dist/dashboard/web/pages/roi.js +375 -0
  105. package/dist/dashboard/web/pages/roi.js.map +1 -0
  106. package/dist/dashboard/web/pages/settings.d.ts +103 -0
  107. package/dist/dashboard/web/pages/settings.js +420 -0
  108. package/dist/dashboard/web/pages/settings.js.map +1 -0
  109. package/dist/dashboard/web/pages/sync.d.ts +59 -0
  110. package/dist/dashboard/web/pages/sync.js +280 -0
  111. package/dist/dashboard/web/pages/sync.js.map +1 -0
  112. package/dist/dashboard/web/panels.d.ts +178 -0
  113. package/dist/dashboard/web/panels.js +471 -0
  114. package/dist/dashboard/web/panels.js.map +1 -0
  115. package/dist/dashboard/web/primitives.d.ts +80 -0
  116. package/dist/dashboard/web/primitives.js +208 -0
  117. package/dist/dashboard/web/primitives.js.map +1 -0
  118. package/dist/dashboard/web/readiness-splash.d.ts +39 -0
  119. package/dist/dashboard/web/readiness-splash.js +201 -0
  120. package/dist/dashboard/web/readiness-splash.js.map +1 -0
  121. package/dist/dashboard/web/registry.d.ts +96 -0
  122. package/dist/dashboard/web/registry.js +99 -0
  123. package/dist/dashboard/web/registry.js.map +1 -0
  124. package/dist/dashboard/web/router.d.ts +48 -0
  125. package/dist/dashboard/web/router.js +76 -0
  126. package/dist/dashboard/web/router.js.map +1 -0
  127. package/dist/dashboard/web/scope-context.d.ts +155 -0
  128. package/dist/dashboard/web/scope-context.js +266 -0
  129. package/dist/dashboard/web/scope-context.js.map +1 -0
  130. package/dist/dashboard/web/service-icons.d.ts +33 -0
  131. package/dist/dashboard/web/service-icons.js +80 -0
  132. package/dist/dashboard/web/service-icons.js.map +1 -0
  133. package/dist/dashboard/web/setup-gate.d.ts +116 -0
  134. package/dist/dashboard/web/setup-gate.js +272 -0
  135. package/dist/dashboard/web/setup-gate.js.map +1 -0
  136. package/dist/dashboard/web/sidebar.d.ts +63 -0
  137. package/dist/dashboard/web/sidebar.js +91 -0
  138. package/dist/dashboard/web/sidebar.js.map +1 -0
  139. package/dist/dashboard/web/use-fleet-telemetry.d.ts +111 -0
  140. package/dist/dashboard/web/use-fleet-telemetry.js +278 -0
  141. package/dist/dashboard/web/use-fleet-telemetry.js.map +1 -0
  142. package/dist/dashboard/web/wire.d.ts +1937 -0
  143. package/dist/dashboard/web/wire.js +1837 -0
  144. package/dist/dashboard/web/wire.js.map +1 -0
  145. package/dist/errors.d.ts +5 -0
  146. package/dist/errors.js +11 -0
  147. package/dist/errors.js.map +1 -0
  148. package/dist/install/registry.d.ts +35 -0
  149. package/dist/install/registry.js +110 -0
  150. package/dist/install/registry.js.map +1 -0
  151. package/dist/lock.d.ts +10 -0
  152. package/dist/lock.js +87 -0
  153. package/dist/lock.js.map +1 -0
  154. package/dist/service/commands.d.ts +15 -0
  155. package/dist/service/commands.js +49 -0
  156. package/dist/service/commands.js.map +1 -0
  157. package/dist/service/index.d.ts +38 -0
  158. package/dist/service/index.js +174 -0
  159. package/dist/service/index.js.map +1 -0
  160. package/dist/service/platform.d.ts +37 -0
  161. package/dist/service/platform.js +67 -0
  162. package/dist/service/platform.js.map +1 -0
  163. package/dist/service/templates.d.ts +10 -0
  164. package/dist/service/templates.js +120 -0
  165. package/dist/service/templates.js.map +1 -0
  166. package/dist/shared/constants.d.ts +15 -0
  167. package/dist/shared/constants.js +19 -0
  168. package/dist/shared/constants.js.map +1 -0
  169. package/dist/shared/daemon-routing.d.ts +11 -0
  170. package/dist/shared/daemon-routing.js +38 -0
  171. package/dist/shared/daemon-routing.js.map +1 -0
  172. package/dist/shared/fleet-readiness.d.ts +18 -0
  173. package/dist/shared/fleet-readiness.js +9 -0
  174. package/dist/shared/fleet-readiness.js.map +1 -0
  175. package/dist/shared/fleet-telemetry.d.ts +68 -0
  176. package/dist/shared/fleet-telemetry.js +61 -0
  177. package/dist/shared/fleet-telemetry.js.map +1 -0
  178. package/dist/shared/lifecycle-flags.d.ts +34 -0
  179. package/dist/shared/lifecycle-flags.js +39 -0
  180. package/dist/shared/lifecycle-flags.js.map +1 -0
  181. package/dist/shared/memory-types.d.ts +55 -0
  182. package/dist/shared/memory-types.js +75 -0
  183. package/dist/shared/memory-types.js.map +1 -0
  184. package/dist/shared/service-status.d.ts +82 -0
  185. package/dist/shared/service-status.js +97 -0
  186. package/dist/shared/service-status.js.map +1 -0
  187. package/dist/telemetry/emit.d.ts +197 -0
  188. package/dist/telemetry/emit.js +196 -0
  189. package/dist/telemetry/emit.js.map +1 -0
  190. package/package.json +50 -0
@@ -0,0 +1,103 @@
1
+ /**
2
+ * The SETTINGS page — PRD-044 (the 7th and final page of the dashboard mini-site).
3
+ *
4
+ * Mounted at the PRD-037 `#/settings` slot (the registry already routes it; this fills the
5
+ * `ComingSoon` placeholder). ONE coherent page, THREE sections over the INJECTED `wire` (never
6
+ * `createWireClient`), all on the existing DS tokens + primitives (`Badge`/`Button`/`Input`/
7
+ * `Panel`/`PageFrame`) — NO new design system, NO CDN React, NO in-browser Babel. Every value
8
+ * renders as escaped React text (XSS-safe; never `dangerouslySetInnerHTML`). No token/secret value
9
+ * EVER appears in page state, the DOM, a parsed response, or a log line (D-3 / D-6).
10
+ *
11
+ * 044a — DeepLake auth (SECURITY-CRITICAL, the token is SACRED):
12
+ * · `DeeplakeAuthSection` reads the REDACTED `wire.authStatus()` (`GET /api/auth/status`) and
13
+ * renders it TRUTHFULLY: connected org/workspace/agent, the credentials SOURCE
14
+ * (`env` "via HONEYCOMB_TOKEN" vs `file`), `savedAt`, and expiry ONLY when a real
15
+ * `expiresAt` exists (else "expiry unknown" — never fabricated). Disconnected → an honest
16
+ * "Not connected to DeepLake" state. OQ-1 RESOLVED: STATUS-FIRST + a CLI hand-off (the exact
17
+ * `honeycomb login` commands) — NO in-page device-flow, NO mock success. The section RE-READS
18
+ * `authStatus()` on a focus/poll so a CLI login reflects here. The token is never rendered.
19
+ *
20
+ * 044b — provider API keys (write-only into the encrypted vault):
21
+ * · `ProviderKeysSection` renders one row per provider (Anthropic, OpenAI, OpenRouter, Cohere):
22
+ * a password-type write-only `Input`, a "Save key" `Button`, and a presence `Badge`. A save
23
+ * POSTs `wire.setSecret(name, value)` (`POST /api/secrets/:name`); presence comes from
24
+ * `wire.secretNames()` (NAMES only — there is NO value-returning route, ever). On success the
25
+ * input is CLEARED and `secretNames()` is RE-READ. A secret value never enters page state,
26
+ * the DOM, the response, or a log line (AC-3 write-only discipline).
27
+ *
28
+ * 044c — search mode + migrated inference settings:
29
+ * · `SearchAndInferenceSection` renders a NEW recall-mode `Select` (`keyword | semantic |
30
+ * hybrid` + a "default" option that leaves the `recallMode` key UNSET) PLUS the MIGRATED
31
+ * provider→model selector + pollinating toggle (the existing `SettingsPanel`, REUSED not forked
32
+ * — D-5). All persist through the EXISTING `vaultSettings()`/`setSetting()` surface
33
+ * (persist-then-re-read); `recallMode` adds NO new wire method.
34
+ */
35
+ import React from "react";
36
+ import type { PageProps } from "../page-frame.js";
37
+ import { type SettingValueWire, type VaultSettingsWire } from "../wire.js";
38
+ /**
39
+ * The DeepLake auth section (044a). Reads the REDACTED `authStatus()` and renders it truthfully —
40
+ * connected identity + source + expiry-when-known, or an honest disconnected state with the CLI
41
+ * hand-off. RE-READS on a poll so a CLI `honeycomb login` reflects here. The token is NEVER
42
+ * rendered (the wire schema has no token field by construction).
43
+ */
44
+ export declare function DeeplakeAuthSection({ wire }: {
45
+ wire: PageProps["wire"];
46
+ }): React.JSX.Element;
47
+ /**
48
+ * The provider API keys section (044b). One row per provider (Anthropic, OpenAI, OpenRouter,
49
+ * Cohere). A save POSTs `setSecret(name, value)` then RE-READS `secretNames()` so the presence
50
+ * badge reflects the persisted truth (mirroring the `setSetting` re-read). There is NO `getSecret`
51
+ * — a stored key cannot be read back. The presence is by NAME only (`PROVIDER_KEY_NAME`).
52
+ */
53
+ export declare function ProviderKeysSection({ wire, secretNames, onSaved, }: {
54
+ wire: PageProps["wire"];
55
+ secretNames: readonly string[];
56
+ onSaved: () => void;
57
+ }): React.JSX.Element;
58
+ /**
59
+ * The search-mode + inference section (044c). Composes the NEW recall-mode selector with the
60
+ * MIGRATED provider/model/pollinating controls (the existing `SettingsPanel`, REUSED verbatim — D-5).
61
+ * Everything persists through the SAME `vaultSettings()`/`setSetting()` surface with a persist-then
62
+ * re-read contract; `recallMode` adds no new wire method.
63
+ *
64
+ * PRD-063a (D-2): when `portkeyEnabled` is true, the provider/model rows are rendered but visually
65
+ * de-emphasized with a "superseded by Portkey" hint. Turning Portkey off restores them without
66
+ * re-entry (the keys are still persisted — only the hint disappears).
67
+ */
68
+ export declare function SearchAndInferenceSection({ settings, catalog, secretNames, onSave, portkeyEnabled, }: {
69
+ settings: Readonly<Record<string, SettingValueWire>>;
70
+ catalog: VaultSettingsWire["catalog"];
71
+ secretNames: readonly string[];
72
+ onSave: (key: string, value: SettingValueWire) => Promise<boolean>;
73
+ /** PRD-063a D-2: when true, de-emphasize the per-provider rows + activeProvider selector. */
74
+ portkeyEnabled?: boolean;
75
+ }): React.JSX.Element;
76
+ /**
77
+ * The embeddings toggle. Reads the LIVE on/off state from `wire.health()` (`reasons.embeddings`) and
78
+ * flips it through `wire.setEmbeddings(...)`, which actuates the daemon's embed supervisor (spawn+warm
79
+ * / stop) AND persists the choice so it survives a restart. Off = lexical (BM25) recall only. The
80
+ * state re-reads from `health()` after a toggle so the badge reflects the persisted truth, never an
81
+ * optimistic flip.
82
+ */
83
+ export declare function EmbeddingsSection({ wire }: {
84
+ wire: PageProps["wire"];
85
+ }): React.JSX.Element;
86
+ /**
87
+ * The destructive system actions, each gated behind an inline two-step confirm (no new modal
88
+ * dependency). Restart respawns the daemon (the page then waits for `/health` to recover); Uninstall
89
+ * returns the guided removal (detected harnesses + the exact `honeycomb uninstall` command — the
90
+ * daemon does not self-remove the page out from under itself). Both POST through the origin/CSRF +
91
+ * local-mode gated `/api/actions` surface.
92
+ */
93
+ export declare function SystemActionsSection({ wire }: {
94
+ wire: PageProps["wire"];
95
+ }): React.JSX.Element;
96
+ /**
97
+ * The Settings page (PRD-044). Hydrates the vault settings + secret-name presence over the shared
98
+ * `wire`, and renders the THREE sections: DeepLake auth (044a), provider keys (044b), and search
99
+ * mode + inference (044c). Every setting/secret write goes through the wire with a persist-then
100
+ * re-read contract — the page never trusts a local-only toggle. NO token/secret value crosses into
101
+ * page state, the DOM, a response, or a log line.
102
+ */
103
+ export declare function SettingsPage({ wire }: PageProps): React.JSX.Element;
@@ -0,0 +1,420 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /**
3
+ * The SETTINGS page — PRD-044 (the 7th and final page of the dashboard mini-site).
4
+ *
5
+ * Mounted at the PRD-037 `#/settings` slot (the registry already routes it; this fills the
6
+ * `ComingSoon` placeholder). ONE coherent page, THREE sections over the INJECTED `wire` (never
7
+ * `createWireClient`), all on the existing DS tokens + primitives (`Badge`/`Button`/`Input`/
8
+ * `Panel`/`PageFrame`) — NO new design system, NO CDN React, NO in-browser Babel. Every value
9
+ * renders as escaped React text (XSS-safe; never `dangerouslySetInnerHTML`). No token/secret value
10
+ * EVER appears in page state, the DOM, a parsed response, or a log line (D-3 / D-6).
11
+ *
12
+ * 044a — DeepLake auth (SECURITY-CRITICAL, the token is SACRED):
13
+ * · `DeeplakeAuthSection` reads the REDACTED `wire.authStatus()` (`GET /api/auth/status`) and
14
+ * renders it TRUTHFULLY: connected org/workspace/agent, the credentials SOURCE
15
+ * (`env` "via HONEYCOMB_TOKEN" vs `file`), `savedAt`, and expiry ONLY when a real
16
+ * `expiresAt` exists (else "expiry unknown" — never fabricated). Disconnected → an honest
17
+ * "Not connected to DeepLake" state. OQ-1 RESOLVED: STATUS-FIRST + a CLI hand-off (the exact
18
+ * `honeycomb login` commands) — NO in-page device-flow, NO mock success. The section RE-READS
19
+ * `authStatus()` on a focus/poll so a CLI login reflects here. The token is never rendered.
20
+ *
21
+ * 044b — provider API keys (write-only into the encrypted vault):
22
+ * · `ProviderKeysSection` renders one row per provider (Anthropic, OpenAI, OpenRouter, Cohere):
23
+ * a password-type write-only `Input`, a "Save key" `Button`, and a presence `Badge`. A save
24
+ * POSTs `wire.setSecret(name, value)` (`POST /api/secrets/:name`); presence comes from
25
+ * `wire.secretNames()` (NAMES only — there is NO value-returning route, ever). On success the
26
+ * input is CLEARED and `secretNames()` is RE-READ. A secret value never enters page state,
27
+ * the DOM, the response, or a log line (AC-3 write-only discipline).
28
+ *
29
+ * 044c — search mode + migrated inference settings:
30
+ * · `SearchAndInferenceSection` renders a NEW recall-mode `Select` (`keyword | semantic |
31
+ * hybrid` + a "default" option that leaves the `recallMode` key UNSET) PLUS the MIGRATED
32
+ * provider→model selector + pollinating toggle (the existing `SettingsPanel`, REUSED not forked
33
+ * — D-5). All persist through the EXISTING `vaultSettings()`/`setSetting()` surface
34
+ * (persist-then-re-read); `recallMode` adds NO new wire method.
35
+ */
36
+ import React from "react";
37
+ import { Badge, Button, Input } from "../primitives.js";
38
+ import { Panel, PortkeyGatewaySection, PROVIDER_KEY_NAME, SETTING_KEY, SettingsPanel } from "../panels.js";
39
+ import { isTabHidden, PageFrame } from "../page-frame.js";
40
+ import { LIFECYCLE_FLAG_REFERENCE } from "../../../shared/lifecycle-flags.js";
41
+ import { DISCONNECTED_AUTH_STATUS, EMPTY_VAULT_SETTINGS, } from "../wire.js";
42
+ /** How often the auth section re-reads `authStatus()` so a CLI login reflects here (ms). */
43
+ const AUTH_POLL_MS = 5000;
44
+ // ─────────────────────────────────────────────────────────────────────────────
45
+ // A shared section shell — a titled Panel with consistent rhythm across the three
46
+ // sections (jscpd discipline: one wrapper, not three copies of the same markup).
47
+ // ─────────────────────────────────────────────────────────────────────────────
48
+ /** One labeled metadata row (a left label + a right value) — shared by the auth section. */
49
+ function MetaRow({ label, children }) {
50
+ return (_jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, padding: "8px 6px", borderTop: "1px solid var(--border-subtle)" }, children: [_jsx("span", { style: { fontFamily: "var(--font-mono)", fontSize: 12, color: "var(--text-tertiary)", minWidth: 120 }, children: label }), _jsx("span", { style: { flex: 1 } }), _jsx("span", { style: { fontFamily: "var(--font-mono)", fontSize: 13, color: "var(--text-primary)", textAlign: "right", wordBreak: "break-word" }, children: children })] }));
51
+ }
52
+ // ─────────────────────────────────────────────────────────────────────────────
53
+ // 044a — the DeepLake auth section (status-first + CLI hand-off; token is sacred).
54
+ // ─────────────────────────────────────────────────────────────────────────────
55
+ /** Human label for the credentials source (`env` → "via HONEYCOMB_TOKEN", honest about the env win). */
56
+ function sourceLabel(source) {
57
+ if (source === "env")
58
+ return "via HONEYCOMB_TOKEN";
59
+ if (source === "file")
60
+ return "saved login (~/.deeplake)";
61
+ return "none";
62
+ }
63
+ /** Render a token-expiry value HONESTLY: a real `expiresAt` as an ISO instant, else "expiry unknown". */
64
+ function expiryLabel(expiresAt) {
65
+ // `expiresAt` is epoch SECONDS (a real `TokenClaims.exp`); absent → never computed/faked.
66
+ if (typeof expiresAt !== "number" || !Number.isFinite(expiresAt))
67
+ return "expiry unknown";
68
+ return new Date(expiresAt * 1000).toISOString();
69
+ }
70
+ /**
71
+ * The connect affordance — an IN-PAGE device flow (the dashboard is now a peer of the CLI for login).
72
+ * "Connect to DeepLake" POSTs `wire.setupLogin()` (the existing 050c device-flow endpoint) and renders
73
+ * the returned `user_code` + verification link; the daemon polls → mints → persists in the background,
74
+ * and the parent {@link DeeplakeAuthSection}'s `authStatus()` poll flips the section to connected the
75
+ * moment the credential lands — same tab, no `honeycomb login`. The exact CLI command is kept as a
76
+ * secondary hint. NO token ever crosses the wire (the setup-login schema has no token field).
77
+ */
78
+ function ConnectHandoff({ wire }) {
79
+ const [grant, setGrant] = React.useState(null);
80
+ const [busy, setBusy] = React.useState(false);
81
+ const [error, setError] = React.useState(false);
82
+ // A synchronous in-flight guard so a rapid double-click never starts two device flows.
83
+ const inFlightRef = React.useRef(false);
84
+ const begin = React.useCallback(async () => {
85
+ if (inFlightRef.current)
86
+ return;
87
+ inFlightRef.current = true;
88
+ setBusy(true);
89
+ setError(false);
90
+ const result = await wire.setupLogin();
91
+ if (result === null) {
92
+ setError(true);
93
+ setBusy(false);
94
+ inFlightRef.current = false;
95
+ return;
96
+ }
97
+ // Leave `busy` true: the section now waits for the background `authStatus()` poll to flip to
98
+ // connected once the credential lands. The button stays disabled meanwhile.
99
+ setGrant(result);
100
+ }, [wire]);
101
+ return (_jsxs("div", { "data-testid": "auth-connect", style: { display: "flex", flexDirection: "column", gap: 10, padding: "10px 6px" }, children: [_jsx("span", { style: { fontSize: 13, color: "var(--text-secondary)" }, children: "Not connected to DeepLake." }), grant === null ? (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "primary", size: "sm", disabled: busy, onClick: () => void begin(), "data-testid": "auth-connect-button", children: busy ? "Starting…" : "Connect to DeepLake" }), error && (_jsxs("span", { "data-testid": "auth-connect-error", style: { fontFamily: "var(--font-mono)", fontSize: 11, color: "var(--severity-critical)" }, children: ["Could not start sign-in. Retry, or run ", _jsx("code", { children: "honeycomb login" }), " in your terminal."] }))] })) : (_jsxs("div", { "data-testid": "auth-connect-grant", style: { display: "flex", flexDirection: "column", gap: 6 }, children: [_jsx("span", { style: { fontSize: 13, color: "var(--text-secondary)" }, children: "Enter this code to finish signing in:" }), _jsx("code", { style: { fontFamily: "var(--font-mono)", fontSize: 16, color: "var(--honey)", letterSpacing: "0.08em" }, children: grant.user_code }), _jsx("a", { href: grant.verification_uri_complete ?? grant.verification_uri, target: "_blank", rel: "noreferrer", style: { fontSize: 13, color: "var(--text-secondary)" }, children: "Open the verification page" }), _jsx("span", { style: { fontSize: 11, color: "var(--text-tertiary)" }, children: "Waiting for you to finish in the browser\u2026" })] })), _jsxs("span", { style: { fontSize: 11, color: "var(--text-tertiary)" }, children: ["or, from your terminal: ", _jsx("code", { style: { fontFamily: "var(--font-mono)", color: "var(--honey)" }, children: "honeycomb login" })] })] }));
102
+ }
103
+ /**
104
+ * The DeepLake auth section (044a). Reads the REDACTED `authStatus()` and renders it truthfully —
105
+ * connected identity + source + expiry-when-known, or an honest disconnected state with the CLI
106
+ * hand-off. RE-READS on a poll so a CLI `honeycomb login` reflects here. The token is NEVER
107
+ * rendered (the wire schema has no token field by construction).
108
+ */
109
+ export function DeeplakeAuthSection({ wire }) {
110
+ const [status, setStatus] = React.useState(DISCONNECTED_AUTH_STATUS);
111
+ const [loading, setLoading] = React.useState(true);
112
+ const [loggingOut, setLoggingOut] = React.useState(false);
113
+ const load = React.useCallback(async () => {
114
+ // `authStatus()` never throws — it degrades to DISCONNECTED on any failure (AC-4).
115
+ const next = await wire.authStatus();
116
+ setStatus(next);
117
+ setLoading(false);
118
+ }, [wire]);
119
+ // Log out (dashboard action): remove the shared credential through the daemon, then RE-READ the
120
+ // status so the section flips to the disconnected/connect state on success (never an optimistic flip).
121
+ const onLogout = React.useCallback(async () => {
122
+ setLoggingOut(true);
123
+ await wire.logout();
124
+ await load();
125
+ setLoggingOut(false);
126
+ }, [wire, load]);
127
+ // Fetch on mount + re-read on a poll (so a CLI login reflects here) + on window focus.
128
+ React.useEffect(() => {
129
+ let alive = true;
130
+ const tick = async () => {
131
+ if (!alive || isTabHidden())
132
+ return; // background-tab pause: no auth poll while hidden (focus still refreshes)
133
+ await load();
134
+ };
135
+ void tick();
136
+ const id = setInterval(() => void tick(), AUTH_POLL_MS);
137
+ const onFocus = () => void tick();
138
+ if (typeof window !== "undefined")
139
+ window.addEventListener("focus", onFocus);
140
+ return () => {
141
+ alive = false;
142
+ clearInterval(id);
143
+ if (typeof window !== "undefined")
144
+ window.removeEventListener("focus", onFocus);
145
+ };
146
+ }, [load]);
147
+ return (_jsx(Panel, { title: "DeepLake", eyebrow: "auth \u00B7 org \u00B7 workspace", right: _jsx(Badge, { tone: status.connected ? "verified" : "neutral", mono: true, dot: true, children: status.connected ? "connected" : "not connected" }), children: loading ? (_jsx("div", { "data-testid": "auth-loading", style: { padding: "12px 4px", fontSize: 13, color: "var(--text-tertiary)", fontFamily: "var(--font-mono)" }, children: "loading\u2026" })) : status.connected ? (_jsxs("div", { "data-testid": "auth-connected", children: [_jsx(MetaRow, { label: "org", children: status.orgName || status.orgId || "—" }), _jsx(MetaRow, { label: "org id", children: status.orgId || "—" }), _jsx(MetaRow, { label: "workspace", children: status.workspace || "—" }), _jsx(MetaRow, { label: "agent", children: status.agentId || "—" }), _jsx(MetaRow, { label: "source", children: sourceLabel(status.source) }), _jsx(MetaRow, { label: "last login", children: status.savedAt || "unknown" }), _jsx(MetaRow, { label: "token expiry", children: expiryLabel(status.expiresAt) }), _jsx("div", { style: { display: "flex", justifyContent: "flex-end", paddingTop: 10 }, children: _jsx(Button, { variant: "secondary", size: "sm", disabled: loggingOut, onClick: () => void onLogout(), "data-testid": "auth-logout-button", children: loggingOut ? "Logging out…" : "Log out" }) })] })) : (_jsx("div", { "data-testid": "auth-disconnected", children: _jsx(ConnectHandoff, { wire: wire }) })) }));
148
+ }
149
+ // ─────────────────────────────────────────────────────────────────────────────
150
+ // 044b — the provider API keys section (write-only into the encrypted vault).
151
+ // ─────────────────────────────────────────────────────────────────────────────
152
+ /** The four providers this section manages, in display order (label + the conventional key name). */
153
+ const PROVIDER_ROWS = [
154
+ { id: "anthropic", label: "Anthropic (Claude)" },
155
+ { id: "openai", label: "OpenAI (ChatGPT)" },
156
+ { id: "openrouter", label: "OpenRouter" },
157
+ { id: "cohere", label: "Cohere" },
158
+ ];
159
+ /**
160
+ * One provider key row (044b): a label, a write-only password `Input`, a "Save key" `Button`, and
161
+ * a presence `Badge`. The input value lives in a LOCAL draft that is CLEARED on a successful save
162
+ * (never pre-filled — there is no value to fetch). An empty value is rejected client-side BEFORE
163
+ * the POST. The secret value never leaves this row's draft state, never enters the parsed response
164
+ * (the wire returns a boolean), and is never logged.
165
+ */
166
+ function ProviderKeyRow({ id, label, present, onSave, }) {
167
+ const [draft, setDraft] = React.useState("");
168
+ const [saving, setSaving] = React.useState(false);
169
+ const [rejected, setRejected] = React.useState(false);
170
+ const submit = React.useCallback(async () => {
171
+ const value = draft;
172
+ // Client-side empty-value reject BEFORE the POST (AC-1) — an empty key is never sent.
173
+ if (value.length === 0) {
174
+ setRejected(true);
175
+ return;
176
+ }
177
+ setSaving(true);
178
+ setRejected(false);
179
+ const ok = await onSave(id, value);
180
+ setSaving(false);
181
+ // Write-only discipline (AC-3): CLEAR the input on a successful save (no lingering value in
182
+ // state), leave it for a retry on a rejected write. Either way the value is never echoed.
183
+ if (ok) {
184
+ setDraft("");
185
+ }
186
+ else {
187
+ setRejected(true);
188
+ }
189
+ }, [draft, id, onSave]);
190
+ return (_jsxs("div", { "data-testid": `provider-row-${id}`, style: { display: "flex", alignItems: "center", gap: 12, padding: "10px 6px", borderTop: "1px solid var(--border-subtle)", flexWrap: "wrap" }, children: [_jsx("span", { style: { fontSize: 14, color: "var(--text-primary)", minWidth: 150 }, children: label }), _jsx("div", { style: { flex: "1 1 220px", minWidth: 180 }, children: _jsx(Input, { type: "password", mono: true, size: "sm", value: draft, placeholder: present ? "replace key…" : "paste key…", onChange: (e) => {
191
+ setDraft(e.target.value);
192
+ if (rejected)
193
+ setRejected(false);
194
+ }, onKeyDown: (e) => {
195
+ if (e.key === "Enter")
196
+ void submit();
197
+ }, "data-testid": `provider-input-${id}` }) }), _jsx(Button, { variant: "primary", size: "sm", disabled: saving, "data-testid": `provider-save-${id}`, onClick: () => void submit(), children: saving ? "saving…" : "Save key" }), _jsx(Badge, { tone: present ? "verified" : "neutral", mono: true, dot: true, children: present ? "key set ✓" : "not set" }), rejected && (_jsx("span", { "data-testid": `provider-rejected-${id}`, style: { fontFamily: "var(--font-mono)", fontSize: 11, color: "var(--severity-critical)" }, children: "not accepted" }))] }));
198
+ }
199
+ /**
200
+ * The provider API keys section (044b). One row per provider (Anthropic, OpenAI, OpenRouter,
201
+ * Cohere). A save POSTs `setSecret(name, value)` then RE-READS `secretNames()` so the presence
202
+ * badge reflects the persisted truth (mirroring the `setSetting` re-read). There is NO `getSecret`
203
+ * — a stored key cannot be read back. The presence is by NAME only (`PROVIDER_KEY_NAME`).
204
+ */
205
+ export function ProviderKeysSection({ wire, secretNames, onSaved, }) {
206
+ // The single write path: POST the value (write-only), then re-read names on success so the
207
+ // parent's `secretNames` (and thus the presence badge) reflects the persisted truth. The value
208
+ // is consumed here and never returned/stored beyond the row's draft (which clears on success).
209
+ const onSave = React.useCallback(async (id, value) => {
210
+ const keyName = PROVIDER_KEY_NAME[id];
211
+ if (keyName === undefined)
212
+ return false;
213
+ const ok = await wire.setSecret(keyName, value);
214
+ if (ok)
215
+ onSaved(); // re-read secretNames (presence) — mirrors saveSetting's re-read.
216
+ return ok;
217
+ }, [wire, onSaved]);
218
+ return (_jsx(Panel, { title: "Provider keys", eyebrow: "write-only \u00B7 names-only presence", children: _jsx("div", { "data-testid": "provider-keys", children: PROVIDER_ROWS.map((p) => {
219
+ const keyName = PROVIDER_KEY_NAME[p.id] ?? "";
220
+ const present = keyName !== "" && secretNames.includes(keyName);
221
+ return _jsx(ProviderKeyRow, { id: p.id, label: p.label, present: present, onSave: onSave }, p.id);
222
+ }) }) }));
223
+ }
224
+ // ─────────────────────────────────────────────────────────────────────────────
225
+ // 044c — the search mode + migrated inference settings section.
226
+ // ─────────────────────────────────────────────────────────────────────────────
227
+ /** The recall-mode options: a "default" (unset) plus the three explicit modes (044c). */
228
+ const RECALL_MODE_OPTIONS = [
229
+ { value: "", label: "default (semantic when embeddings on)" },
230
+ { value: "keyword", label: "keyword — lexical only" },
231
+ { value: "semantic", label: "semantic — vector (fallback when off)" },
232
+ { value: "hybrid", label: "hybrid — both arms" },
233
+ ];
234
+ /**
235
+ * The recall-mode selector (044c). A controlled `<select>` whose value is the persisted
236
+ * `recallMode` setting (or "" for the "default" option, which leaves the key UNSET — preserving the
237
+ * PRD-025 runtime default). Choosing a value persists through the EXISTING `setSetting` (no new
238
+ * wire method); the daemon REJECTS any value outside `keyword | semantic | hybrid` (fail-closed).
239
+ */
240
+ function RecallModeRow({ value, onChange, }) {
241
+ return (_jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, padding: "10px 6px", flexWrap: "wrap" }, children: [_jsxs("div", { style: { display: "flex", flexDirection: "column", minWidth: 120 }, children: [_jsx("span", { style: { fontSize: 14, color: "var(--text-primary)" }, children: "Search mode" }), _jsx("span", { style: { fontFamily: "var(--font-mono)", fontSize: 11, color: "var(--text-tertiary)" }, children: "recall channels" })] }), _jsx("span", { style: { flex: 1 } }), _jsx("select", { "aria-label": "search mode", value: value, onChange: (e) => onChange(e.target.value), "data-testid": "recall-mode-select", style: {
242
+ height: 36,
243
+ padding: "0 10px",
244
+ background: "var(--bg-surface)",
245
+ border: "1px solid var(--border-default)",
246
+ borderRadius: "var(--radius-md)",
247
+ color: "var(--text-primary)",
248
+ fontFamily: "var(--font-mono)",
249
+ fontSize: 13,
250
+ minWidth: 220,
251
+ }, children: RECALL_MODE_OPTIONS.map((o) => (_jsx("option", { value: o.value, children: o.label }, o.value))) })] }));
252
+ }
253
+ /**
254
+ * The search-mode + inference section (044c). Composes the NEW recall-mode selector with the
255
+ * MIGRATED provider/model/pollinating controls (the existing `SettingsPanel`, REUSED verbatim — D-5).
256
+ * Everything persists through the SAME `vaultSettings()`/`setSetting()` surface with a persist-then
257
+ * re-read contract; `recallMode` adds no new wire method.
258
+ *
259
+ * PRD-063a (D-2): when `portkeyEnabled` is true, the provider/model rows are rendered but visually
260
+ * de-emphasized with a "superseded by Portkey" hint. Turning Portkey off restores them without
261
+ * re-entry (the keys are still persisted — only the hint disappears).
262
+ */
263
+ export function SearchAndInferenceSection({ settings, catalog, secretNames, onSave, portkeyEnabled, }) {
264
+ // The persisted recall mode (controlled). The "default" option maps to "" → the key stays UNSET
265
+ // (preserving the PRD-025 runtime decision). String() defends against a non-string scalar.
266
+ const recallMode = String(settings[SETTING_KEY.recallMode] ?? "");
267
+ return (_jsx(Panel, { title: "Search & inference", eyebrow: "recall mode \u00B7 provider \u00B7 model \u00B7 pollinating", children: _jsxs("div", { "data-testid": "search-inference", children: [_jsx(RecallModeRow, { value: recallMode, onChange: (v) => void onSave(SETTING_KEY.recallMode, v) }), portkeyEnabled === true && (_jsx("div", { "data-testid": "portkey-supersedes-hint", style: { padding: "6px 6px 2px", fontFamily: "var(--font-mono)", fontSize: 11, color: "var(--text-tertiary)" }, children: "superseded by Portkey \u2014 provider keys still stored, not the active inference path" })), _jsx("div", { style: { marginTop: 8, opacity: portkeyEnabled === true ? 0.45 : 1, transition: "opacity 0.15s" }, children: _jsx(SettingsPanel, { catalog: catalog, settings: settings, secretNames: secretNames, onSave: onSave }) })] }) }));
268
+ }
269
+ // ─────────────────────────────────────────────────────────────────────────────
270
+ // PRD-058d — the lifecycle config REFERENCE section (AC-55d.1.3): every
271
+ // `memory.lifecycle.*` flag with its symbol, default, master-equation effect, and
272
+ // env override. Read-only on the settings page (the values are governed by
273
+ // `agent.yaml` / `HONEYCOMB_LIFECYCLE_*` per the documented precedence); the table
274
+ // is the SINGLE-SOURCED {@link LIFECYCLE_FLAG_REFERENCE} the config doc also lists,
275
+ // so the symbol/default/effect can never drift between the surface and the doc.
276
+ // ─────────────────────────────────────────────────────────────────────────────
277
+ /** One flag-reference row (symbol · config path · default · effect · env). Escaped text. */
278
+ function LifecycleFlagRow({ symbol, configPath, envOverride, defaultValue, effect }) {
279
+ return (_jsxs("div", { "data-testid": "lifecycle-flag", "data-config-path": configPath, style: { display: "flex", flexDirection: "column", gap: 2, padding: "8px 0", borderBottom: "1px solid var(--border-subtle)" }, children: [_jsxs("div", { style: { display: "flex", gap: 10, alignItems: "baseline", flexWrap: "wrap" }, children: [_jsx(Badge, { tone: "honey", mono: true, children: symbol }), _jsx("span", { style: { fontFamily: "var(--font-mono)", fontSize: 12, color: "var(--text-secondary)", wordBreak: "break-all" }, children: configPath }), _jsxs("span", { style: { fontFamily: "var(--font-mono)", fontSize: 11, color: "var(--text-tertiary)" }, children: ["default: ", defaultValue] })] }), _jsx("div", { style: { fontSize: 12, color: "var(--text-tertiary)" }, children: effect }), _jsxs("div", { style: { fontFamily: "var(--font-mono)", fontSize: 10, color: "var(--text-tertiary)" }, children: ["env: ", envOverride] })] }));
280
+ }
281
+ /**
282
+ * The lifecycle config reference (PRD-058d AC-55d.1.3): the full `memory.lifecycle.*` flag table on the
283
+ * settings page. Each flag shows its symbol, config path, default, master-equation effect, and env
284
+ * override. Read from the single-sourced {@link LIFECYCLE_FLAG_REFERENCE} so the surface and the config
285
+ * doc never drift. Precedence is documented inline (env > yaml > default) per the `HONEYCOMB_PIPELINE_*`
286
+ * precedent. Non-destructive defaults are visible: `a = 1`, `c = 0`, `s = 0`, auto-resolve `false`.
287
+ */
288
+ function LifecycleConfigSection() {
289
+ return (_jsx(Panel, { title: "Memory lifecycle", eyebrow: "memory.lifecycle.* \u00B7 symbol \u00B7 default \u00B7 effect", children: _jsxs("div", { "data-testid": "lifecycle-config-reference", style: { display: "flex", flexDirection: "column" }, children: [_jsx("div", { style: { fontFamily: "var(--font-mono)", fontSize: 11, color: "var(--text-tertiary)", marginBottom: 8 }, children: "Precedence: HONEYCOMB_LIFECYCLE_* env > agent.yaml memory.lifecycle.* > the documented default. Defaults are non-destructive \u2014 a = 1, c = 0, s = 0 (posture observe), auto-resolve off." }), LIFECYCLE_FLAG_REFERENCE.map((flag) => (_jsx(LifecycleFlagRow, { ...flag }, flag.configPath)))] }) }));
290
+ }
291
+ // ─────────────────────────────────────────────────────────────────────────────
292
+ // Embeddings on/off (dashboard action) — turn semantic recall on/off LIVE + persisted.
293
+ // ─────────────────────────────────────────────────────────────────────────────
294
+ /**
295
+ * The embeddings toggle. Reads the LIVE on/off state from `wire.health()` (`reasons.embeddings`) and
296
+ * flips it through `wire.setEmbeddings(...)`, which actuates the daemon's embed supervisor (spawn+warm
297
+ * / stop) AND persists the choice so it survives a restart. Off = lexical (BM25) recall only. The
298
+ * state re-reads from `health()` after a toggle so the badge reflects the persisted truth, never an
299
+ * optimistic flip.
300
+ */
301
+ export function EmbeddingsSection({ wire }) {
302
+ // `null` while the first health read is in flight (so we never render a wrong default).
303
+ const [on, setOn] = React.useState(null);
304
+ const [busy, setBusy] = React.useState(false);
305
+ const load = React.useCallback(async () => {
306
+ // Fail-soft like the rest of the dashboard: a failed/absent health read degrades to "off"
307
+ // rather than throwing into React (the badge shows off; the toggle still works).
308
+ try {
309
+ const health = await wire.health();
310
+ setOn(health?.reasons?.embeddings === "on");
311
+ }
312
+ catch {
313
+ setOn(false);
314
+ }
315
+ }, [wire]);
316
+ React.useEffect(() => {
317
+ void load();
318
+ }, [load]);
319
+ const toggle = React.useCallback(async () => {
320
+ if (on === null)
321
+ return;
322
+ setBusy(true);
323
+ const want = !on;
324
+ const ok = await wire.setEmbeddings(want);
325
+ if (ok)
326
+ setOn(want);
327
+ setBusy(false);
328
+ // Re-read the live truth (a disabled toggle may already be reflected; an enable warms async).
329
+ void load();
330
+ }, [on, wire, load]);
331
+ const label = on === null ? "…" : on ? "on" : "off";
332
+ return (_jsx(Panel, { title: "Embeddings", eyebrow: "semantic recall \u00B7 local model", right: _jsx(Badge, { tone: on ? "verified" : "neutral", mono: true, dot: true, children: label }), children: _jsxs("div", { "data-testid": "embeddings-section", style: { display: "flex", alignItems: "center", gap: 12, padding: "10px 6px", flexWrap: "wrap" }, children: [_jsxs("div", { style: { display: "flex", flexDirection: "column", minWidth: 200, flex: 1 }, children: [_jsx("span", { style: { fontSize: 14, color: "var(--text-primary)" }, children: "Semantic vector recall" }), _jsx("span", { style: { fontSize: 12, color: "var(--text-tertiary)" }, children: "On runs the local embedding model for semantic search. Off falls back to lexical (BM25) recall only." })] }), _jsx(Button, { variant: on ? "secondary" : "primary", size: "sm", disabled: busy || on === null, onClick: () => void toggle(), "data-testid": "embeddings-toggle", children: busy ? "saving…" : on ? "Turn off" : "Turn on" })] }) }));
333
+ }
334
+ // ─────────────────────────────────────────────────────────────────────────────
335
+ // System actions (dashboard) — restart the daemon + uninstall (two-step confirm).
336
+ // ─────────────────────────────────────────────────────────────────────────────
337
+ /**
338
+ * The destructive system actions, each gated behind an inline two-step confirm (no new modal
339
+ * dependency). Restart respawns the daemon (the page then waits for `/health` to recover); Uninstall
340
+ * returns the guided removal (detected harnesses + the exact `honeycomb uninstall` command — the
341
+ * daemon does not self-remove the page out from under itself). Both POST through the origin/CSRF +
342
+ * local-mode gated `/api/actions` surface.
343
+ */
344
+ export function SystemActionsSection({ wire }) {
345
+ const [restartConfirm, setRestartConfirm] = React.useState(false);
346
+ const [restarting, setRestarting] = React.useState(false);
347
+ const [uninstallConfirm, setUninstallConfirm] = React.useState(false);
348
+ const [uninstalling, setUninstalling] = React.useState(false);
349
+ const [uninstallResult, setUninstallResult] = React.useState(null);
350
+ const [uninstallError, setUninstallError] = React.useState(false);
351
+ const doRestart = React.useCallback(async () => {
352
+ setRestartConfirm(false);
353
+ setRestarting(true);
354
+ const ok = await wire.restartDaemon();
355
+ // Leave `restarting` true on success — the daemon is going down + coming back; the rest of the
356
+ // dashboard re-hydrates from live endpoints once it answers again. On failure, clear it.
357
+ if (!ok)
358
+ setRestarting(false);
359
+ }, [wire]);
360
+ const doUninstall = React.useCallback(async () => {
361
+ setUninstallConfirm(false);
362
+ setUninstalling(true);
363
+ setUninstallError(false);
364
+ const result = await wire.uninstall();
365
+ // `uninstall()` returns null on a non-2xx / network failure — surface that honestly rather than
366
+ // silently rendering nothing, so the user knows to retry (the wire contract: null = failed).
367
+ setUninstallResult(result);
368
+ setUninstallError(result === null);
369
+ setUninstalling(false);
370
+ }, [wire]);
371
+ return (_jsxs(Panel, { title: "System", eyebrow: "restart \u00B7 uninstall", children: [_jsxs("div", { "data-testid": "system-restart", style: { display: "flex", alignItems: "center", gap: 12, padding: "10px 6px", borderBottom: "1px solid var(--border-subtle)", flexWrap: "wrap" }, children: [_jsxs("div", { style: { display: "flex", flexDirection: "column", minWidth: 200, flex: 1 }, children: [_jsx("span", { style: { fontSize: 14, color: "var(--text-primary)" }, children: "Restart the daemon" }), _jsx("span", { style: { fontSize: 12, color: "var(--text-tertiary)" }, children: "Stops and relaunches the background daemon. The dashboard reconnects automatically." })] }), restarting ? (_jsx("span", { "data-testid": "system-restarting", style: { fontFamily: "var(--font-mono)", fontSize: 12, color: "var(--text-secondary)" }, children: "restarting\u2026" })) : restartConfirm ? (_jsxs("div", { style: { display: "flex", gap: 8 }, children: [_jsx(Button, { variant: "secondary", size: "sm", onClick: () => setRestartConfirm(false), children: "Cancel" }), _jsx(Button, { variant: "danger", size: "sm", onClick: () => void doRestart(), "data-testid": "system-restart-confirm", children: "Confirm restart" })] })) : (_jsx(Button, { variant: "secondary", size: "sm", onClick: () => setRestartConfirm(true), "data-testid": "system-restart-button", children: "Restart" }))] }), _jsxs("div", { "data-testid": "system-uninstall", style: { display: "flex", flexDirection: "column", gap: 8, padding: "10px 6px" }, children: [_jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, flexWrap: "wrap" }, children: [_jsxs("div", { style: { display: "flex", flexDirection: "column", minWidth: 200, flex: 1 }, children: [_jsx("span", { style: { fontSize: 14, color: "var(--text-primary)" }, children: "Uninstall Honeycomb" }), _jsx("span", { style: { fontSize: 12, color: "var(--text-tertiary)" }, children: "Reverses Honeycomb's changes to your coding assistants. Your DeepLake login is left intact." })] }), uninstallConfirm ? (_jsxs("div", { style: { display: "flex", gap: 8 }, children: [_jsx(Button, { variant: "secondary", size: "sm", onClick: () => setUninstallConfirm(false), children: "Cancel" }), _jsx(Button, { variant: "danger", size: "sm", disabled: uninstalling, onClick: () => void doUninstall(), "data-testid": "system-uninstall-confirm", children: uninstalling ? "Working…" : "Confirm uninstall" })] })) : (_jsx(Button, { variant: "danger", size: "sm", onClick: () => setUninstallConfirm(true), "data-testid": "system-uninstall-button", children: "Uninstall" }))] }), uninstallResult !== null && (_jsxs("div", { "data-testid": "system-uninstall-result", style: { display: "flex", flexDirection: "column", gap: 6, padding: "8px 0" }, children: [_jsx("span", { style: { fontSize: 13, color: "var(--text-secondary)" }, children: uninstallResult.note }), uninstallResult.harnesses.length > 0 && (_jsxs("span", { style: { fontSize: 12, color: "var(--text-tertiary)" }, children: ["Detected: ", uninstallResult.harnesses.join(", ")] })), _jsx("code", { style: { fontFamily: "var(--font-mono)", fontSize: 13, color: "var(--honey)" }, children: uninstallResult.command })] })), uninstallError && (_jsxs("span", { "data-testid": "system-uninstall-error", style: { fontSize: 12, color: "var(--severity-critical)" }, children: ["Could not load uninstall guidance. Retry, or run ", _jsx("code", { style: { fontFamily: "var(--font-mono)" }, children: "honeycomb uninstall" }), " in your terminal."] }))] })] }));
372
+ }
373
+ // ─────────────────────────────────────────────────────────────────────────────
374
+ // The routed page.
375
+ // ─────────────────────────────────────────────────────────────────────────────
376
+ /**
377
+ * The Settings page (PRD-044). Hydrates the vault settings + secret-name presence over the shared
378
+ * `wire`, and renders the THREE sections: DeepLake auth (044a), provider keys (044b), and search
379
+ * mode + inference (044c). Every setting/secret write goes through the wire with a persist-then
380
+ * re-read contract — the page never trusts a local-only toggle. NO token/secret value crosses into
381
+ * page state, the DOM, a response, or a log line.
382
+ */
383
+ export function SettingsPage({ wire }) {
384
+ const [vault, setVault] = React.useState(EMPTY_VAULT_SETTINGS);
385
+ const [secretNames, setSecretNames] = React.useState([]);
386
+ // Hydrate the vault settings + the names-only secret presence (both already-served, secret-free).
387
+ const hydrateSettings = React.useCallback(async () => {
388
+ setVault(await wire.vaultSettings());
389
+ }, [wire]);
390
+ const hydrateSecretNames = React.useCallback(async () => {
391
+ setSecretNames(await wire.secretNames());
392
+ }, [wire]);
393
+ React.useEffect(() => {
394
+ void hydrateSettings();
395
+ void hydrateSecretNames();
396
+ }, [hydrateSettings, hydrateSecretNames]);
397
+ // Persist one setting then RE-READ so the rendered value is the PERSISTED vault value, never a
398
+ // local-only optimistic toggle (mirrors the dashboard `SettingsPanel` contract). A rejected
399
+ // write (the daemon fail-closes an invalid `recallMode`/model) leaves the persisted value
400
+ // unchanged — the re-read reflects whatever actually persisted.
401
+ const onSaveSetting = React.useCallback(async (key, value) => {
402
+ const ok = await wire.setSetting(key, value);
403
+ await hydrateSettings();
404
+ return ok;
405
+ }, [wire, hydrateSettings]);
406
+ // PRD-063a (D-2): derive portkeyEnabled from persisted vault settings so the SearchAndInference
407
+ // section can de-emphasize per-provider rows. The raw value is a SettingValueWire (string|number|
408
+ // boolean|"") coming through the tolerant z.record() catch; coerce to boolean explicitly.
409
+ const portkeyEnabled = vault.settings[SETTING_KEY.portkeyEnabled] === true;
410
+ // PRD-063a (a-AC-4): write the PORTKEY_API_KEY secret then re-read the names-only presence so the
411
+ // badge updates. The value is NEVER stored in component state; it is consumed by the key input,
412
+ // cleared immediately on success, and the only trace of it is the names list confirming presence.
413
+ const onSavePortkeyKey = React.useCallback(async (value) => {
414
+ const ok = await wire.setSecret(PROVIDER_KEY_NAME.portkey, value);
415
+ await hydrateSecretNames();
416
+ return ok;
417
+ }, [wire, hydrateSecretNames]);
418
+ return (_jsx(PageFrame, { title: "Settings", eyebrow: "deeplake \u00B7 provider keys \u00B7 search mode", children: _jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 16 }, children: [_jsx(DeeplakeAuthSection, { wire: wire }), _jsx(ProviderKeysSection, { wire: wire, secretNames: secretNames, onSaved: () => void hydrateSecretNames() }), _jsx(EmbeddingsSection, { wire: wire }), _jsx(PortkeyGatewaySection, { settings: vault.settings, secretNames: secretNames, onSaveSetting: onSaveSetting, onSaveKey: onSavePortkeyKey }), _jsx(SearchAndInferenceSection, { settings: vault.settings, catalog: vault.catalog, secretNames: secretNames, onSave: onSaveSetting, portkeyEnabled: portkeyEnabled }), _jsx(LifecycleConfigSection, {}), _jsx(SystemActionsSection, { wire: wire })] }) }));
419
+ }
420
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../src/dashboard/web/pages/settings.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE3G,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAk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