@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.
- package/LICENSE +661 -0
- package/README.md +262 -0
- package/dist/cli-commands.d.ts +41 -0
- package/dist/cli-commands.js +76 -0
- package/dist/cli-commands.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +46 -0
- package/dist/cli.js.map +1 -0
- package/dist/daemon/dashboard/app.js +118 -0
- package/dist/daemon/dashboard/host.d.ts +90 -0
- package/dist/daemon/dashboard/host.js +172 -0
- package/dist/daemon/dashboard/host.js.map +1 -0
- package/dist/daemon/dashboard/web-assets.d.ts +88 -0
- package/dist/daemon/dashboard/web-assets.js +195 -0
- package/dist/daemon/dashboard/web-assets.js.map +1 -0
- package/dist/daemon/fleet-status.d.ts +15 -0
- package/dist/daemon/fleet-status.js +56 -0
- package/dist/daemon/fleet-status.js.map +1 -0
- package/dist/daemon/gate.d.ts +55 -0
- package/dist/daemon/gate.js +128 -0
- package/dist/daemon/gate.js.map +1 -0
- package/dist/daemon/proxy.d.ts +38 -0
- package/dist/daemon/proxy.js +126 -0
- package/dist/daemon/proxy.js.map +1 -0
- package/dist/daemon/registry.d.ts +31 -0
- package/dist/daemon/registry.js +120 -0
- package/dist/daemon/registry.js.map +1 -0
- package/dist/daemon/server.d.ts +41 -0
- package/dist/daemon/server.js +126 -0
- package/dist/daemon/server.js.map +1 -0
- package/dist/daemon/setup-auth.d.ts +37 -0
- package/dist/daemon/setup-auth.js +51 -0
- package/dist/daemon/setup-auth.js.map +1 -0
- package/dist/daemon/telemetry-proxy.d.ts +47 -0
- package/dist/daemon/telemetry-proxy.js +63 -0
- package/dist/daemon/telemetry-proxy.js.map +1 -0
- package/dist/dashboard/contracts.d.ts +235 -0
- package/dist/dashboard/contracts.js +43 -0
- package/dist/dashboard/contracts.js.map +1 -0
- package/dist/dashboard/web/app.d.ts +44 -0
- package/dist/dashboard/web/app.js +179 -0
- package/dist/dashboard/web/app.js.map +1 -0
- package/dist/dashboard/web/boot-route.d.ts +23 -0
- package/dist/dashboard/web/boot-route.js +29 -0
- package/dist/dashboard/web/boot-route.js.map +1 -0
- package/dist/dashboard/web/build-graph-button.d.ts +46 -0
- package/dist/dashboard/web/build-graph-button.js +81 -0
- package/dist/dashboard/web/build-graph-button.js.map +1 -0
- package/dist/dashboard/web/buzzing-screen.d.ts +30 -0
- package/dist/dashboard/web/buzzing-screen.js +135 -0
- package/dist/dashboard/web/buzzing-screen.js.map +1 -0
- package/dist/dashboard/web/folder-picker.d.ts +54 -0
- package/dist/dashboard/web/folder-picker.js +125 -0
- package/dist/dashboard/web/folder-picker.js.map +1 -0
- package/dist/dashboard/web/graph-layout.d.ts +101 -0
- package/dist/dashboard/web/graph-layout.js +0 -0
- package/dist/dashboard/web/graph-layout.js.map +1 -0
- package/dist/dashboard/web/harness-strip.d.ts +38 -0
- package/dist/dashboard/web/harness-strip.js +65 -0
- package/dist/dashboard/web/harness-strip.js.map +1 -0
- package/dist/dashboard/web/health-rail.d.ts +26 -0
- package/dist/dashboard/web/health-rail.js +61 -0
- package/dist/dashboard/web/health-rail.js.map +1 -0
- package/dist/dashboard/web/main.d.ts +22 -0
- package/dist/dashboard/web/main.js +51 -0
- package/dist/dashboard/web/main.js.map +1 -0
- package/dist/dashboard/web/needs-project.d.ts +51 -0
- package/dist/dashboard/web/needs-project.js +69 -0
- package/dist/dashboard/web/needs-project.js.map +1 -0
- package/dist/dashboard/web/page-frame.d.ts +95 -0
- package/dist/dashboard/web/page-frame.js +98 -0
- package/dist/dashboard/web/page-frame.js.map +1 -0
- package/dist/dashboard/web/pages/coming-soon.d.ts +23 -0
- package/dist/dashboard/web/pages/coming-soon.js +19 -0
- package/dist/dashboard/web/pages/coming-soon.js.map +1 -0
- package/dist/dashboard/web/pages/dashboard.d.ts +32 -0
- package/dist/dashboard/web/pages/dashboard.js +205 -0
- package/dist/dashboard/web/pages/dashboard.js.map +1 -0
- package/dist/dashboard/web/pages/graph.d.ts +72 -0
- package/dist/dashboard/web/pages/graph.js +362 -0
- package/dist/dashboard/web/pages/graph.js.map +1 -0
- package/dist/dashboard/web/pages/harnesses.d.ts +65 -0
- package/dist/dashboard/web/pages/harnesses.js +210 -0
- package/dist/dashboard/web/pages/harnesses.js.map +1 -0
- package/dist/dashboard/web/pages/health.d.ts +22 -0
- package/dist/dashboard/web/pages/health.js +91 -0
- package/dist/dashboard/web/pages/health.js.map +1 -0
- package/dist/dashboard/web/pages/lifecycle-panel.d.ts +60 -0
- package/dist/dashboard/web/pages/lifecycle-panel.js +187 -0
- package/dist/dashboard/web/pages/lifecycle-panel.js.map +1 -0
- package/dist/dashboard/web/pages/logs.d.ts +55 -0
- package/dist/dashboard/web/pages/logs.js +311 -0
- package/dist/dashboard/web/pages/logs.js.map +1 -0
- package/dist/dashboard/web/pages/memories.d.ts +35 -0
- package/dist/dashboard/web/pages/memories.js +439 -0
- package/dist/dashboard/web/pages/memories.js.map +1 -0
- package/dist/dashboard/web/pages/projects.d.ts +38 -0
- package/dist/dashboard/web/pages/projects.js +325 -0
- package/dist/dashboard/web/pages/projects.js.map +1 -0
- package/dist/dashboard/web/pages/roi-chart.d.ts +52 -0
- package/dist/dashboard/web/pages/roi-chart.js +133 -0
- package/dist/dashboard/web/pages/roi-chart.js.map +1 -0
- package/dist/dashboard/web/pages/roi.d.ts +93 -0
- package/dist/dashboard/web/pages/roi.js +375 -0
- package/dist/dashboard/web/pages/roi.js.map +1 -0
- package/dist/dashboard/web/pages/settings.d.ts +103 -0
- package/dist/dashboard/web/pages/settings.js +420 -0
- package/dist/dashboard/web/pages/settings.js.map +1 -0
- package/dist/dashboard/web/pages/sync.d.ts +59 -0
- package/dist/dashboard/web/pages/sync.js +280 -0
- package/dist/dashboard/web/pages/sync.js.map +1 -0
- package/dist/dashboard/web/panels.d.ts +178 -0
- package/dist/dashboard/web/panels.js +471 -0
- package/dist/dashboard/web/panels.js.map +1 -0
- package/dist/dashboard/web/primitives.d.ts +80 -0
- package/dist/dashboard/web/primitives.js +208 -0
- package/dist/dashboard/web/primitives.js.map +1 -0
- package/dist/dashboard/web/readiness-splash.d.ts +39 -0
- package/dist/dashboard/web/readiness-splash.js +201 -0
- package/dist/dashboard/web/readiness-splash.js.map +1 -0
- package/dist/dashboard/web/registry.d.ts +96 -0
- package/dist/dashboard/web/registry.js +99 -0
- package/dist/dashboard/web/registry.js.map +1 -0
- package/dist/dashboard/web/router.d.ts +48 -0
- package/dist/dashboard/web/router.js +76 -0
- package/dist/dashboard/web/router.js.map +1 -0
- package/dist/dashboard/web/scope-context.d.ts +155 -0
- package/dist/dashboard/web/scope-context.js +266 -0
- package/dist/dashboard/web/scope-context.js.map +1 -0
- package/dist/dashboard/web/service-icons.d.ts +33 -0
- package/dist/dashboard/web/service-icons.js +80 -0
- package/dist/dashboard/web/service-icons.js.map +1 -0
- package/dist/dashboard/web/setup-gate.d.ts +116 -0
- package/dist/dashboard/web/setup-gate.js +272 -0
- package/dist/dashboard/web/setup-gate.js.map +1 -0
- package/dist/dashboard/web/sidebar.d.ts +63 -0
- package/dist/dashboard/web/sidebar.js +91 -0
- package/dist/dashboard/web/sidebar.js.map +1 -0
- package/dist/dashboard/web/use-fleet-telemetry.d.ts +111 -0
- package/dist/dashboard/web/use-fleet-telemetry.js +278 -0
- package/dist/dashboard/web/use-fleet-telemetry.js.map +1 -0
- package/dist/dashboard/web/wire.d.ts +1937 -0
- package/dist/dashboard/web/wire.js +1837 -0
- package/dist/dashboard/web/wire.js.map +1 -0
- package/dist/errors.d.ts +5 -0
- package/dist/errors.js +11 -0
- package/dist/errors.js.map +1 -0
- package/dist/install/registry.d.ts +35 -0
- package/dist/install/registry.js +110 -0
- package/dist/install/registry.js.map +1 -0
- package/dist/lock.d.ts +10 -0
- package/dist/lock.js +87 -0
- package/dist/lock.js.map +1 -0
- package/dist/service/commands.d.ts +15 -0
- package/dist/service/commands.js +49 -0
- package/dist/service/commands.js.map +1 -0
- package/dist/service/index.d.ts +38 -0
- package/dist/service/index.js +174 -0
- package/dist/service/index.js.map +1 -0
- package/dist/service/platform.d.ts +37 -0
- package/dist/service/platform.js +67 -0
- package/dist/service/platform.js.map +1 -0
- package/dist/service/templates.d.ts +10 -0
- package/dist/service/templates.js +120 -0
- package/dist/service/templates.js.map +1 -0
- package/dist/shared/constants.d.ts +15 -0
- package/dist/shared/constants.js +19 -0
- package/dist/shared/constants.js.map +1 -0
- package/dist/shared/daemon-routing.d.ts +11 -0
- package/dist/shared/daemon-routing.js +38 -0
- package/dist/shared/daemon-routing.js.map +1 -0
- package/dist/shared/fleet-readiness.d.ts +18 -0
- package/dist/shared/fleet-readiness.js +9 -0
- package/dist/shared/fleet-readiness.js.map +1 -0
- package/dist/shared/fleet-telemetry.d.ts +68 -0
- package/dist/shared/fleet-telemetry.js +61 -0
- package/dist/shared/fleet-telemetry.js.map +1 -0
- package/dist/shared/lifecycle-flags.d.ts +34 -0
- package/dist/shared/lifecycle-flags.js +39 -0
- package/dist/shared/lifecycle-flags.js.map +1 -0
- package/dist/shared/memory-types.d.ts +55 -0
- package/dist/shared/memory-types.js +75 -0
- package/dist/shared/memory-types.js.map +1 -0
- package/dist/shared/service-status.d.ts +82 -0
- package/dist/shared/service-status.js +97 -0
- package/dist/shared/service-status.js.map +1 -0
- package/dist/telemetry/emit.d.ts +197 -0
- package/dist/telemetry/emit.js +196 -0
- package/dist/telemetry/emit.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,1937 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The dashboard web app's WIRE LAYER — PRD-024 Wave 2 (AC-2..AC-6).
|
|
3
|
+
*
|
|
4
|
+
* The browser app is a THIN CLIENT: it hydrates entirely from the daemon's already-served
|
|
5
|
+
* JSON endpoints (D-2, no canned `data.js`). This module is the single typed boundary
|
|
6
|
+
* between the untyped `fetch` Response and the kit's React props:
|
|
7
|
+
*
|
|
8
|
+
* - It declares a zod schema PER endpoint, mirroring the daemon-side view-model contracts
|
|
9
|
+
* in `src/dashboard/contracts.ts` (D-5 — reuse the shapes, do not re-derive them). The
|
|
10
|
+
* WIRE truth (what `src/daemon/runtime/dashboard/api.ts` + the recall/logs routes
|
|
11
|
+
* actually return) is what these schemas validate, NOT the canned `data.js` shapes.
|
|
12
|
+
* - It parses every payload through zod, so a malformed/partial response degrades to a
|
|
13
|
+
* safe empty/zero state rather than throwing into React (AC-2 empty states).
|
|
14
|
+
* - No `any` crosses the fetch boundary: each fetcher returns a typed, validated value.
|
|
15
|
+
*
|
|
16
|
+
* Wire endpoints (all loopback, all already served — this app NEVER rebuilds them):
|
|
17
|
+
* GET /api/diagnostics/kpis|sessions|settings|rules|skills → the dashboard view-models
|
|
18
|
+
* GET /api/graph → the codebase graph view
|
|
19
|
+
* POST /api/memories/recall → recall hits
|
|
20
|
+
* GET /api/logs → the request-log ring buffer
|
|
21
|
+
* GET /health → daemon liveness
|
|
22
|
+
* POST /api/diagnostics/pollinate → the Wave-1 Pollinate trigger
|
|
23
|
+
*/
|
|
24
|
+
import { z } from "zod";
|
|
25
|
+
import { type RoiTrendView, type RoiView } from "../contracts.js";
|
|
26
|
+
/** The diagnostics view-model endpoints (served under `/api/diagnostics/*` + `/api/graph`). */
|
|
27
|
+
export declare const ENDPOINTS: Readonly<{
|
|
28
|
+
readonly kpis: "/api/diagnostics/kpis";
|
|
29
|
+
readonly sessions: "/api/diagnostics/sessions";
|
|
30
|
+
readonly settings: "/api/diagnostics/settings";
|
|
31
|
+
readonly rules: "/api/diagnostics/rules";
|
|
32
|
+
readonly skills: "/api/diagnostics/skills";
|
|
33
|
+
readonly graph: "/api/graph";
|
|
34
|
+
readonly graphBuild: "/api/graph/build";
|
|
35
|
+
readonly memoryGraph: "/api/diagnostics/memory-graph";
|
|
36
|
+
readonly recall: "/api/memories/recall";
|
|
37
|
+
readonly memories: "/api/memories";
|
|
38
|
+
readonly compact: "/api/diagnostics/compact";
|
|
39
|
+
readonly lifecycleConflicts: "/api/memories/conflicts";
|
|
40
|
+
readonly lifecycleStaleRefs: "/api/memories/stale-refs";
|
|
41
|
+
readonly lifecycleHistory: "/api/memories/history";
|
|
42
|
+
readonly calibration: "/api/memories/calibration";
|
|
43
|
+
readonly logs: "/api/logs";
|
|
44
|
+
readonly logsStream: "/api/logs/stream";
|
|
45
|
+
readonly harnesses: "/api/diagnostics/harnesses";
|
|
46
|
+
readonly assets: "/api/diagnostics/assets";
|
|
47
|
+
readonly syncAction: "/api/diagnostics/sync";
|
|
48
|
+
readonly health: "/health";
|
|
49
|
+
readonly pollinate: "/api/diagnostics/pollinate";
|
|
50
|
+
readonly vaultSettings: "/api/settings";
|
|
51
|
+
readonly secrets: "/api/secrets";
|
|
52
|
+
readonly authStatus: "/api/auth/status";
|
|
53
|
+
readonly setupState: "/setup/state";
|
|
54
|
+
readonly setupLogin: "/setup/login";
|
|
55
|
+
readonly setupMigrate: "/setup/migrate-from-hivemind";
|
|
56
|
+
readonly setupMigrateRollback: "/setup/migrate-from-hivemind/rollback";
|
|
57
|
+
readonly scopeOrgs: "/api/diagnostics/scope/orgs";
|
|
58
|
+
readonly scopeWorkspaces: "/api/diagnostics/scope/workspaces";
|
|
59
|
+
readonly scopeProjects: "/api/diagnostics/scope/projects";
|
|
60
|
+
readonly fsBrowse: "/api/diagnostics/fs/browse";
|
|
61
|
+
readonly projectsBind: "/api/diagnostics/projects/bind";
|
|
62
|
+
readonly projectsBindExisting: "/api/diagnostics/projects/bind-existing";
|
|
63
|
+
readonly projectsUnbind: "/api/diagnostics/projects/unbind";
|
|
64
|
+
readonly scopeOrgSwitch: "/api/diagnostics/scope/org-switch";
|
|
65
|
+
readonly scopeWorkspaceSwitch: "/api/diagnostics/scope/workspace-switch";
|
|
66
|
+
readonly roi: "/api/diagnostics/roi";
|
|
67
|
+
readonly roiTrend: "/api/diagnostics/roi/trend";
|
|
68
|
+
readonly actionsLogout: "/api/actions/logout";
|
|
69
|
+
readonly actionsEmbeddings: "/api/actions/embeddings";
|
|
70
|
+
readonly actionsRestart: "/api/actions/restart";
|
|
71
|
+
readonly actionsUninstall: "/api/actions/uninstall";
|
|
72
|
+
}>;
|
|
73
|
+
/**
|
|
74
|
+
* PRD-049e (49e-AC-2) — the header carrying the dashboard's SELECTED project id. The switcher's
|
|
75
|
+
* selection is VIEWER-SIDE: stamping this header on a read narrows the daemon's project-segment
|
|
76
|
+
* predicate to exactly that project (the daemon honors it in `resolveRequestProject`), WITHOUT
|
|
77
|
+
* touching any per-folder CLI binding (49e-AC-4 — it is a request header, never a write). An empty
|
|
78
|
+
* selection omits the header (the read stays project-agnostic / cwd-resolved, back-compat).
|
|
79
|
+
*/
|
|
80
|
+
export declare const PROJECT_HEADER: "x-honeycomb-project";
|
|
81
|
+
/** Build the per-request project header, or an empty object when no project is selected. */
|
|
82
|
+
export declare function projectHeader(projectId: string | undefined): Record<string, string>;
|
|
83
|
+
/** PRD-040a — the default first-page size the Memories list requests (the daemon clamps to 500). */
|
|
84
|
+
export declare const DEFAULT_MEMORY_LIST_LIMIT: 50;
|
|
85
|
+
/** `GET /api/diagnostics/kpis` → {@link import("../contracts.js").KpisView}. */
|
|
86
|
+
export declare const KpisSchema: z.ZodObject<{
|
|
87
|
+
memoryCount: z.ZodCatch<z.ZodNumber>;
|
|
88
|
+
sessionCount: z.ZodCatch<z.ZodNumber>;
|
|
89
|
+
turnCount: z.ZodCatch<z.ZodNumber>;
|
|
90
|
+
estimatedSavings: z.ZodCatch<z.ZodNumber>;
|
|
91
|
+
teamSkillCount: z.ZodCatch<z.ZodNumber>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
export type KpisWire = z.infer<typeof KpisSchema>;
|
|
94
|
+
/** One row of `GET /api/diagnostics/sessions` → {@link import("../contracts.js").SessionRow}. */
|
|
95
|
+
export declare const SessionRowSchema: z.ZodObject<{
|
|
96
|
+
sessionId: z.ZodCatch<z.ZodString>;
|
|
97
|
+
project: z.ZodCatch<z.ZodString>;
|
|
98
|
+
startedAt: z.ZodCatch<z.ZodString>;
|
|
99
|
+
eventCount: z.ZodCatch<z.ZodNumber>;
|
|
100
|
+
status: z.ZodCatch<z.ZodString>;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
export declare const SessionsSchema: z.ZodObject<{
|
|
103
|
+
sessions: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
104
|
+
sessionId: z.ZodCatch<z.ZodString>;
|
|
105
|
+
project: z.ZodCatch<z.ZodString>;
|
|
106
|
+
startedAt: z.ZodCatch<z.ZodString>;
|
|
107
|
+
eventCount: z.ZodCatch<z.ZodNumber>;
|
|
108
|
+
status: z.ZodCatch<z.ZodString>;
|
|
109
|
+
}, z.core.$strip>>>;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
export type SessionRowWire = z.infer<typeof SessionRowSchema>;
|
|
112
|
+
/** `GET /api/diagnostics/settings` → {@link import("../contracts.js").SettingsView}. */
|
|
113
|
+
export declare const SettingsSchema: z.ZodObject<{
|
|
114
|
+
orgId: z.ZodCatch<z.ZodString>;
|
|
115
|
+
orgName: z.ZodCatch<z.ZodString>;
|
|
116
|
+
workspace: z.ZodCatch<z.ZodString>;
|
|
117
|
+
settings: z.ZodCatch<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
118
|
+
}, z.core.$strip>;
|
|
119
|
+
export type SettingsWire = z.infer<typeof SettingsSchema>;
|
|
120
|
+
/** A graph node/edge → {@link import("../contracts.js").GraphNode} / `GraphEdge`. */
|
|
121
|
+
export declare const GraphNodeSchema: z.ZodObject<{
|
|
122
|
+
id: z.ZodCatch<z.ZodString>;
|
|
123
|
+
label: z.ZodCatch<z.ZodString>;
|
|
124
|
+
kind: z.ZodCatch<z.ZodString>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
export declare const GraphEdgeSchema: z.ZodObject<{
|
|
127
|
+
from: z.ZodCatch<z.ZodString>;
|
|
128
|
+
to: z.ZodCatch<z.ZodString>;
|
|
129
|
+
kind: z.ZodCatch<z.ZodString>;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
/** Bounded-view metadata → {@link import("../contracts.js").GraphViewMeta} (the graph memory cap — the graph cap). */
|
|
132
|
+
export declare const GraphMetaSchema: z.ZodObject<{
|
|
133
|
+
totalNodes: z.ZodCatch<z.ZodNumber>;
|
|
134
|
+
totalEdges: z.ZodCatch<z.ZodNumber>;
|
|
135
|
+
shownNodes: z.ZodCatch<z.ZodNumber>;
|
|
136
|
+
shownEdges: z.ZodCatch<z.ZodNumber>;
|
|
137
|
+
truncated: z.ZodCatch<z.ZodBoolean>;
|
|
138
|
+
}, z.core.$strip>;
|
|
139
|
+
export declare const GraphSchema: z.ZodObject<{
|
|
140
|
+
built: z.ZodCatch<z.ZodBoolean>;
|
|
141
|
+
nodes: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
142
|
+
id: z.ZodCatch<z.ZodString>;
|
|
143
|
+
label: z.ZodCatch<z.ZodString>;
|
|
144
|
+
kind: z.ZodCatch<z.ZodString>;
|
|
145
|
+
}, z.core.$strip>>>;
|
|
146
|
+
edges: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
147
|
+
from: z.ZodCatch<z.ZodString>;
|
|
148
|
+
to: z.ZodCatch<z.ZodString>;
|
|
149
|
+
kind: z.ZodCatch<z.ZodString>;
|
|
150
|
+
}, z.core.$strip>>>;
|
|
151
|
+
meta: z.ZodCatch<z.ZodOptional<z.ZodObject<{
|
|
152
|
+
totalNodes: z.ZodCatch<z.ZodNumber>;
|
|
153
|
+
totalEdges: z.ZodCatch<z.ZodNumber>;
|
|
154
|
+
shownNodes: z.ZodCatch<z.ZodNumber>;
|
|
155
|
+
shownEdges: z.ZodCatch<z.ZodNumber>;
|
|
156
|
+
truncated: z.ZodCatch<z.ZodBoolean>;
|
|
157
|
+
}, z.core.$strip>>>;
|
|
158
|
+
}, z.core.$strip>;
|
|
159
|
+
export type GraphWire = z.infer<typeof GraphSchema>;
|
|
160
|
+
/** One rule of `GET /api/diagnostics/rules` → {@link import("../contracts.js").RuleRow}. */
|
|
161
|
+
export declare const RuleRowSchema: z.ZodObject<{
|
|
162
|
+
id: z.ZodCatch<z.ZodString>;
|
|
163
|
+
title: z.ZodCatch<z.ZodString>;
|
|
164
|
+
active: z.ZodCatch<z.ZodBoolean>;
|
|
165
|
+
}, z.core.$strip>;
|
|
166
|
+
export declare const RulesSchema: z.ZodObject<{
|
|
167
|
+
rules: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
168
|
+
id: z.ZodCatch<z.ZodString>;
|
|
169
|
+
title: z.ZodCatch<z.ZodString>;
|
|
170
|
+
active: z.ZodCatch<z.ZodBoolean>;
|
|
171
|
+
}, z.core.$strip>>>;
|
|
172
|
+
}, z.core.$strip>;
|
|
173
|
+
export type RuleRowWire = z.infer<typeof RuleRowSchema>;
|
|
174
|
+
/** One skill of `GET /api/diagnostics/skills` → {@link import("../contracts.js").SkillSyncRow}. */
|
|
175
|
+
export declare const SkillRowSchema: z.ZodObject<{
|
|
176
|
+
name: z.ZodCatch<z.ZodString>;
|
|
177
|
+
scope: z.ZodCatch<z.ZodString>;
|
|
178
|
+
syncState: z.ZodCatch<z.ZodString>;
|
|
179
|
+
}, z.core.$strip>;
|
|
180
|
+
export declare const SkillsSchema: z.ZodObject<{
|
|
181
|
+
skills: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
182
|
+
name: z.ZodCatch<z.ZodString>;
|
|
183
|
+
scope: z.ZodCatch<z.ZodString>;
|
|
184
|
+
syncState: z.ZodCatch<z.ZodString>;
|
|
185
|
+
}, z.core.$strip>>>;
|
|
186
|
+
}, z.core.$strip>;
|
|
187
|
+
export type SkillRowWire = z.infer<typeof SkillRowSchema>;
|
|
188
|
+
/** The per-section status discriminant → {@link import("../contracts.js").RoiSectionStatus}. */
|
|
189
|
+
export declare const RoiSectionStatusSchema: z.ZodCatch<z.ZodEnum<{
|
|
190
|
+
ok: "ok";
|
|
191
|
+
unreachable: "unreachable";
|
|
192
|
+
partial: "partial";
|
|
193
|
+
absent: "absent";
|
|
194
|
+
unauthenticated: "unauthenticated";
|
|
195
|
+
}>>;
|
|
196
|
+
/** The status default for a BILLING-backed line — `unreachable` (couldn't read), not `absent` (no data). */
|
|
197
|
+
export declare const RoiBillingStatusSchema: z.ZodCatch<z.ZodEnum<{
|
|
198
|
+
ok: "ok";
|
|
199
|
+
unreachable: "unreachable";
|
|
200
|
+
partial: "partial";
|
|
201
|
+
absent: "absent";
|
|
202
|
+
unauthenticated: "unauthenticated";
|
|
203
|
+
}>>;
|
|
204
|
+
/** The cost-basis tag → {@link import("../contracts.js").RoiCostBasisTag}. */
|
|
205
|
+
export declare const RoiCostBasisSchema: z.ZodCatch<z.ZodEnum<{
|
|
206
|
+
measured: "measured";
|
|
207
|
+
allocated: "allocated";
|
|
208
|
+
none: "none";
|
|
209
|
+
}>>;
|
|
210
|
+
/** The modeled assumption carried as data (e-AC-8) → {@link import("../contracts.js").RoiAssumption}. */
|
|
211
|
+
export declare const RoiAssumptionSchema: z.ZodObject<{
|
|
212
|
+
kind: z.ZodCatch<z.ZodString>;
|
|
213
|
+
assumptionText: z.ZodCatch<z.ZodString>;
|
|
214
|
+
signedOff: z.ZodCatch<z.ZodBoolean>;
|
|
215
|
+
}, z.core.$strip>;
|
|
216
|
+
/** The savings section (e-AC-3) → {@link import("../contracts.js").RoiSavingsSection}. */
|
|
217
|
+
export declare const RoiSavingsSectionSchema: z.ZodObject<{
|
|
218
|
+
status: z.ZodCatch<z.ZodEnum<{
|
|
219
|
+
ok: "ok";
|
|
220
|
+
unreachable: "unreachable";
|
|
221
|
+
partial: "partial";
|
|
222
|
+
absent: "absent";
|
|
223
|
+
unauthenticated: "unauthenticated";
|
|
224
|
+
}>>;
|
|
225
|
+
measuredCents: z.ZodCatch<z.ZodNumber>;
|
|
226
|
+
modeledCents: z.ZodCatch<z.ZodNumber>;
|
|
227
|
+
assumption: z.ZodCatch<z.ZodObject<{
|
|
228
|
+
kind: z.ZodCatch<z.ZodString>;
|
|
229
|
+
assumptionText: z.ZodCatch<z.ZodString>;
|
|
230
|
+
signedOff: z.ZodCatch<z.ZodBoolean>;
|
|
231
|
+
}, z.core.$strip>>;
|
|
232
|
+
blendedCentsPerMtok: z.ZodCatch<z.ZodNullable<z.ZodNumber>>;
|
|
233
|
+
}, z.core.$strip>;
|
|
234
|
+
/** The infra cost section (e-AC-6) → {@link import("../contracts.js").RoiInfraSection}. */
|
|
235
|
+
export declare const RoiInfraSectionSchema: z.ZodObject<{
|
|
236
|
+
status: z.ZodCatch<z.ZodEnum<{
|
|
237
|
+
ok: "ok";
|
|
238
|
+
unreachable: "unreachable";
|
|
239
|
+
partial: "partial";
|
|
240
|
+
absent: "absent";
|
|
241
|
+
unauthenticated: "unauthenticated";
|
|
242
|
+
}>>;
|
|
243
|
+
cents: z.ZodCatch<z.ZodNumber>;
|
|
244
|
+
costBasis: z.ZodCatch<z.ZodEnum<{
|
|
245
|
+
measured: "measured";
|
|
246
|
+
allocated: "allocated";
|
|
247
|
+
none: "none";
|
|
248
|
+
}>>;
|
|
249
|
+
}, z.core.$strip>;
|
|
250
|
+
/** One pollination split line → {@link import("../contracts.js").RoiPollinationLine}. */
|
|
251
|
+
export declare const RoiPollinationLineSchema: z.ZodObject<{
|
|
252
|
+
label: z.ZodCatch<z.ZodString>;
|
|
253
|
+
cents: z.ZodCatch<z.ZodNumber>;
|
|
254
|
+
}, z.core.$strip>;
|
|
255
|
+
/** The pollination cost section (e-AC-6) → {@link import("../contracts.js").RoiPollinationSection}. */
|
|
256
|
+
export declare const RoiPollinationSectionSchema: z.ZodObject<{
|
|
257
|
+
status: z.ZodCatch<z.ZodEnum<{
|
|
258
|
+
ok: "ok";
|
|
259
|
+
unreachable: "unreachable";
|
|
260
|
+
partial: "partial";
|
|
261
|
+
absent: "absent";
|
|
262
|
+
unauthenticated: "unauthenticated";
|
|
263
|
+
}>>;
|
|
264
|
+
cents: z.ZodCatch<z.ZodNumber>;
|
|
265
|
+
lines: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
266
|
+
label: z.ZodCatch<z.ZodString>;
|
|
267
|
+
cents: z.ZodCatch<z.ZodNumber>;
|
|
268
|
+
}, z.core.$strip>>>;
|
|
269
|
+
}, z.core.$strip>;
|
|
270
|
+
/** The net-ROI section (e-AC-6) → {@link import("../contracts.js").RoiNetSection}. */
|
|
271
|
+
export declare const RoiNetSectionSchema: z.ZodObject<{
|
|
272
|
+
status: z.ZodCatch<z.ZodEnum<{
|
|
273
|
+
ok: "ok";
|
|
274
|
+
unreachable: "unreachable";
|
|
275
|
+
partial: "partial";
|
|
276
|
+
absent: "absent";
|
|
277
|
+
unauthenticated: "unauthenticated";
|
|
278
|
+
}>>;
|
|
279
|
+
computed: z.ZodCatch<z.ZodBoolean>;
|
|
280
|
+
netCents: z.ZodCatch<z.ZodNumber>;
|
|
281
|
+
modeled: z.ZodCatch<z.ZodBoolean>;
|
|
282
|
+
costBasis: z.ZodCatch<z.ZodEnum<{
|
|
283
|
+
measured: "measured";
|
|
284
|
+
allocated: "allocated";
|
|
285
|
+
none: "none";
|
|
286
|
+
}>>;
|
|
287
|
+
}, z.core.$strip>;
|
|
288
|
+
/** One rollup row → {@link import("../contracts.js").RoiRollupRow}. */
|
|
289
|
+
export declare const RoiRollupRowSchema: z.ZodObject<{
|
|
290
|
+
key: z.ZodCatch<z.ZodString>;
|
|
291
|
+
label: z.ZodCatch<z.ZodString>;
|
|
292
|
+
measuredSavingsCents: z.ZodCatch<z.ZodNumber>;
|
|
293
|
+
netCents: z.ZodCatch<z.ZodNumber>;
|
|
294
|
+
infraCostCents: z.ZodCatch<z.ZodNumber>;
|
|
295
|
+
costBasis: z.ZodCatch<z.ZodEnum<{
|
|
296
|
+
measured: "measured";
|
|
297
|
+
allocated: "allocated";
|
|
298
|
+
none: "none";
|
|
299
|
+
}>>;
|
|
300
|
+
sessions: z.ZodCatch<z.ZodNumber>;
|
|
301
|
+
}, z.core.$strip>;
|
|
302
|
+
/** One rollup view (e-AC-13) → {@link import("../contracts.js").RoiRollup}. */
|
|
303
|
+
export declare const RoiRollupSchema: z.ZodObject<{
|
|
304
|
+
dimension: z.ZodCatch<z.ZodEnum<{
|
|
305
|
+
org: "org";
|
|
306
|
+
team: "team";
|
|
307
|
+
agent: "agent";
|
|
308
|
+
project: "project";
|
|
309
|
+
}>>;
|
|
310
|
+
rows: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
311
|
+
key: z.ZodCatch<z.ZodString>;
|
|
312
|
+
label: z.ZodCatch<z.ZodString>;
|
|
313
|
+
measuredSavingsCents: z.ZodCatch<z.ZodNumber>;
|
|
314
|
+
netCents: z.ZodCatch<z.ZodNumber>;
|
|
315
|
+
infraCostCents: z.ZodCatch<z.ZodNumber>;
|
|
316
|
+
costBasis: z.ZodCatch<z.ZodEnum<{
|
|
317
|
+
measured: "measured";
|
|
318
|
+
allocated: "allocated";
|
|
319
|
+
none: "none";
|
|
320
|
+
}>>;
|
|
321
|
+
sessions: z.ZodCatch<z.ZodNumber>;
|
|
322
|
+
}, z.core.$strip>>>;
|
|
323
|
+
mixedBasis: z.ZodCatch<z.ZodBoolean>;
|
|
324
|
+
}, z.core.$strip>;
|
|
325
|
+
/** `GET /api/diagnostics/roi` → {@link import("../contracts.js").RoiView}. */
|
|
326
|
+
export declare const RoiViewSchema: z.ZodObject<{
|
|
327
|
+
savings: z.ZodCatch<z.ZodObject<{
|
|
328
|
+
status: z.ZodCatch<z.ZodEnum<{
|
|
329
|
+
ok: "ok";
|
|
330
|
+
unreachable: "unreachable";
|
|
331
|
+
partial: "partial";
|
|
332
|
+
absent: "absent";
|
|
333
|
+
unauthenticated: "unauthenticated";
|
|
334
|
+
}>>;
|
|
335
|
+
measuredCents: z.ZodCatch<z.ZodNumber>;
|
|
336
|
+
modeledCents: z.ZodCatch<z.ZodNumber>;
|
|
337
|
+
assumption: z.ZodCatch<z.ZodObject<{
|
|
338
|
+
kind: z.ZodCatch<z.ZodString>;
|
|
339
|
+
assumptionText: z.ZodCatch<z.ZodString>;
|
|
340
|
+
signedOff: z.ZodCatch<z.ZodBoolean>;
|
|
341
|
+
}, z.core.$strip>>;
|
|
342
|
+
blendedCentsPerMtok: z.ZodCatch<z.ZodNullable<z.ZodNumber>>;
|
|
343
|
+
}, z.core.$strip>>;
|
|
344
|
+
infra: z.ZodCatch<z.ZodObject<{
|
|
345
|
+
status: z.ZodCatch<z.ZodEnum<{
|
|
346
|
+
ok: "ok";
|
|
347
|
+
unreachable: "unreachable";
|
|
348
|
+
partial: "partial";
|
|
349
|
+
absent: "absent";
|
|
350
|
+
unauthenticated: "unauthenticated";
|
|
351
|
+
}>>;
|
|
352
|
+
cents: z.ZodCatch<z.ZodNumber>;
|
|
353
|
+
costBasis: z.ZodCatch<z.ZodEnum<{
|
|
354
|
+
measured: "measured";
|
|
355
|
+
allocated: "allocated";
|
|
356
|
+
none: "none";
|
|
357
|
+
}>>;
|
|
358
|
+
}, z.core.$strip>>;
|
|
359
|
+
pollination: z.ZodCatch<z.ZodObject<{
|
|
360
|
+
status: z.ZodCatch<z.ZodEnum<{
|
|
361
|
+
ok: "ok";
|
|
362
|
+
unreachable: "unreachable";
|
|
363
|
+
partial: "partial";
|
|
364
|
+
absent: "absent";
|
|
365
|
+
unauthenticated: "unauthenticated";
|
|
366
|
+
}>>;
|
|
367
|
+
cents: z.ZodCatch<z.ZodNumber>;
|
|
368
|
+
lines: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
369
|
+
label: z.ZodCatch<z.ZodString>;
|
|
370
|
+
cents: z.ZodCatch<z.ZodNumber>;
|
|
371
|
+
}, z.core.$strip>>>;
|
|
372
|
+
}, z.core.$strip>>;
|
|
373
|
+
net: z.ZodCatch<z.ZodObject<{
|
|
374
|
+
status: z.ZodCatch<z.ZodEnum<{
|
|
375
|
+
ok: "ok";
|
|
376
|
+
unreachable: "unreachable";
|
|
377
|
+
partial: "partial";
|
|
378
|
+
absent: "absent";
|
|
379
|
+
unauthenticated: "unauthenticated";
|
|
380
|
+
}>>;
|
|
381
|
+
computed: z.ZodCatch<z.ZodBoolean>;
|
|
382
|
+
netCents: z.ZodCatch<z.ZodNumber>;
|
|
383
|
+
modeled: z.ZodCatch<z.ZodBoolean>;
|
|
384
|
+
costBasis: z.ZodCatch<z.ZodEnum<{
|
|
385
|
+
measured: "measured";
|
|
386
|
+
allocated: "allocated";
|
|
387
|
+
none: "none";
|
|
388
|
+
}>>;
|
|
389
|
+
}, z.core.$strip>>;
|
|
390
|
+
rollups: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
391
|
+
dimension: z.ZodCatch<z.ZodEnum<{
|
|
392
|
+
org: "org";
|
|
393
|
+
team: "team";
|
|
394
|
+
agent: "agent";
|
|
395
|
+
project: "project";
|
|
396
|
+
}>>;
|
|
397
|
+
rows: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
398
|
+
key: z.ZodCatch<z.ZodString>;
|
|
399
|
+
label: z.ZodCatch<z.ZodString>;
|
|
400
|
+
measuredSavingsCents: z.ZodCatch<z.ZodNumber>;
|
|
401
|
+
netCents: z.ZodCatch<z.ZodNumber>;
|
|
402
|
+
infraCostCents: z.ZodCatch<z.ZodNumber>;
|
|
403
|
+
costBasis: z.ZodCatch<z.ZodEnum<{
|
|
404
|
+
measured: "measured";
|
|
405
|
+
allocated: "allocated";
|
|
406
|
+
none: "none";
|
|
407
|
+
}>>;
|
|
408
|
+
sessions: z.ZodCatch<z.ZodNumber>;
|
|
409
|
+
}, z.core.$strip>>>;
|
|
410
|
+
mixedBasis: z.ZodCatch<z.ZodBoolean>;
|
|
411
|
+
}, z.core.$strip>>>;
|
|
412
|
+
perUserAvailable: z.ZodCatch<z.ZodBoolean>;
|
|
413
|
+
scopedAcrossDevices: z.ZodCatch<z.ZodBoolean>;
|
|
414
|
+
ratesAsOf: z.ZodCatch<z.ZodString>;
|
|
415
|
+
}, z.core.$strip>;
|
|
416
|
+
export type RoiViewWire = z.infer<typeof RoiViewSchema>;
|
|
417
|
+
/** One trend point (e-AC-10) → {@link import("../contracts.js").RoiTrendPoint}. */
|
|
418
|
+
export declare const RoiTrendPointSchema: z.ZodObject<{
|
|
419
|
+
period: z.ZodCatch<z.ZodString>;
|
|
420
|
+
cents: z.ZodCatch<z.ZodNumber>;
|
|
421
|
+
}, z.core.$strip>;
|
|
422
|
+
/** One trend series (e-AC-10, dashed=modeled / solid=measured) → {@link import("../contracts.js").RoiTrendSeries}. */
|
|
423
|
+
export declare const RoiTrendSeriesSchema: z.ZodObject<{
|
|
424
|
+
label: z.ZodCatch<z.ZodString>;
|
|
425
|
+
modeled: z.ZodCatch<z.ZodBoolean>;
|
|
426
|
+
points: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
427
|
+
period: z.ZodCatch<z.ZodString>;
|
|
428
|
+
cents: z.ZodCatch<z.ZodNumber>;
|
|
429
|
+
}, z.core.$strip>>>;
|
|
430
|
+
}, z.core.$strip>;
|
|
431
|
+
/** `GET /api/diagnostics/roi/trend` → {@link import("../contracts.js").RoiTrendView}. */
|
|
432
|
+
export declare const RoiTrendViewSchema: z.ZodObject<{
|
|
433
|
+
status: z.ZodCatch<z.ZodEnum<{
|
|
434
|
+
ok: "ok";
|
|
435
|
+
unreachable: "unreachable";
|
|
436
|
+
partial: "partial";
|
|
437
|
+
absent: "absent";
|
|
438
|
+
unauthenticated: "unauthenticated";
|
|
439
|
+
}>>;
|
|
440
|
+
series: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
441
|
+
label: z.ZodCatch<z.ZodString>;
|
|
442
|
+
modeled: z.ZodCatch<z.ZodBoolean>;
|
|
443
|
+
points: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
444
|
+
period: z.ZodCatch<z.ZodString>;
|
|
445
|
+
cents: z.ZodCatch<z.ZodNumber>;
|
|
446
|
+
}, z.core.$strip>>>;
|
|
447
|
+
}, z.core.$strip>>>;
|
|
448
|
+
startedAt: z.ZodCatch<z.ZodString>;
|
|
449
|
+
}, z.core.$strip>;
|
|
450
|
+
export type RoiTrendViewWire = z.infer<typeof RoiTrendViewSchema>;
|
|
451
|
+
/** One union row on the wire (mirrors the daemon `AssetSyncRow`). State badges drive off `state`. */
|
|
452
|
+
export declare const AssetSyncRowSchema: z.ZodObject<{
|
|
453
|
+
assetType: z.ZodCatch<z.ZodEnum<{
|
|
454
|
+
agent: "agent";
|
|
455
|
+
skill: "skill";
|
|
456
|
+
}>>;
|
|
457
|
+
name: z.ZodCatch<z.ZodString>;
|
|
458
|
+
description: z.ZodCatch<z.ZodString>;
|
|
459
|
+
state: z.ZodCatch<z.ZodEnum<{
|
|
460
|
+
local: "local";
|
|
461
|
+
pulled: "pulled";
|
|
462
|
+
shared: "shared";
|
|
463
|
+
}>>;
|
|
464
|
+
scope: z.ZodCatch<z.ZodString>;
|
|
465
|
+
sourceHarness: z.ZodCatch<z.ZodString>;
|
|
466
|
+
tier: z.ZodCatch<z.ZodString>;
|
|
467
|
+
style: z.ZodCatch<z.ZodString>;
|
|
468
|
+
version: z.ZodCatch<z.ZodNumber>;
|
|
469
|
+
honeycombId: z.ZodCatch<z.ZodString>;
|
|
470
|
+
authoredByMe: z.ZodCatch<z.ZodBoolean>;
|
|
471
|
+
}, z.core.$strip>;
|
|
472
|
+
export type AssetSyncRowWire = z.infer<typeof AssetSyncRowSchema>;
|
|
473
|
+
/** `GET /api/diagnostics/assets` → `{ skills, agents }`. A bad shape degrades to empty lists. */
|
|
474
|
+
export declare const AssetSyncViewSchema: z.ZodObject<{
|
|
475
|
+
skills: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
476
|
+
assetType: z.ZodCatch<z.ZodEnum<{
|
|
477
|
+
agent: "agent";
|
|
478
|
+
skill: "skill";
|
|
479
|
+
}>>;
|
|
480
|
+
name: z.ZodCatch<z.ZodString>;
|
|
481
|
+
description: z.ZodCatch<z.ZodString>;
|
|
482
|
+
state: z.ZodCatch<z.ZodEnum<{
|
|
483
|
+
local: "local";
|
|
484
|
+
pulled: "pulled";
|
|
485
|
+
shared: "shared";
|
|
486
|
+
}>>;
|
|
487
|
+
scope: z.ZodCatch<z.ZodString>;
|
|
488
|
+
sourceHarness: z.ZodCatch<z.ZodString>;
|
|
489
|
+
tier: z.ZodCatch<z.ZodString>;
|
|
490
|
+
style: z.ZodCatch<z.ZodString>;
|
|
491
|
+
version: z.ZodCatch<z.ZodNumber>;
|
|
492
|
+
honeycombId: z.ZodCatch<z.ZodString>;
|
|
493
|
+
authoredByMe: z.ZodCatch<z.ZodBoolean>;
|
|
494
|
+
}, z.core.$strip>>>;
|
|
495
|
+
agents: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
496
|
+
assetType: z.ZodCatch<z.ZodEnum<{
|
|
497
|
+
agent: "agent";
|
|
498
|
+
skill: "skill";
|
|
499
|
+
}>>;
|
|
500
|
+
name: z.ZodCatch<z.ZodString>;
|
|
501
|
+
description: z.ZodCatch<z.ZodString>;
|
|
502
|
+
state: z.ZodCatch<z.ZodEnum<{
|
|
503
|
+
local: "local";
|
|
504
|
+
pulled: "pulled";
|
|
505
|
+
shared: "shared";
|
|
506
|
+
}>>;
|
|
507
|
+
scope: z.ZodCatch<z.ZodString>;
|
|
508
|
+
sourceHarness: z.ZodCatch<z.ZodString>;
|
|
509
|
+
tier: z.ZodCatch<z.ZodString>;
|
|
510
|
+
style: z.ZodCatch<z.ZodString>;
|
|
511
|
+
version: z.ZodCatch<z.ZodNumber>;
|
|
512
|
+
honeycombId: z.ZodCatch<z.ZodString>;
|
|
513
|
+
authoredByMe: z.ZodCatch<z.ZodBoolean>;
|
|
514
|
+
}, z.core.$strip>>>;
|
|
515
|
+
}, z.core.$strip>;
|
|
516
|
+
export type AssetSyncViewWire = z.infer<typeof AssetSyncViewSchema>;
|
|
517
|
+
/** A sync-action ack (mirrors the daemon `SyncActionResult`). Carries NO blob/secret — id/state/version. */
|
|
518
|
+
export declare const SyncActionResultSchema: z.ZodObject<{
|
|
519
|
+
ok: z.ZodCatch<z.ZodBoolean>;
|
|
520
|
+
action: z.ZodCatch<z.ZodEnum<{
|
|
521
|
+
enable: "enable";
|
|
522
|
+
disable: "disable";
|
|
523
|
+
promote: "promote";
|
|
524
|
+
pull: "pull";
|
|
525
|
+
demote: "demote";
|
|
526
|
+
}>>;
|
|
527
|
+
assetType: z.ZodCatch<z.ZodEnum<{
|
|
528
|
+
agent: "agent";
|
|
529
|
+
skill: "skill";
|
|
530
|
+
}>>;
|
|
531
|
+
honeycombId: z.ZodCatch<z.ZodString>;
|
|
532
|
+
state: z.ZodCatch<z.ZodEnum<{
|
|
533
|
+
"": "";
|
|
534
|
+
local: "local";
|
|
535
|
+
pulled: "pulled";
|
|
536
|
+
shared: "shared";
|
|
537
|
+
}>>;
|
|
538
|
+
version: z.ZodCatch<z.ZodNumber>;
|
|
539
|
+
}, z.core.$strip>;
|
|
540
|
+
export type SyncActionResultWire = z.infer<typeof SyncActionResultSchema>;
|
|
541
|
+
/** The empty union view the page shows before the first load resolves (or on failure). */
|
|
542
|
+
export declare const EMPTY_ASSET_SYNC_VIEW: AssetSyncViewWire;
|
|
543
|
+
/**
|
|
544
|
+
* One recall hit on the wire — the `/api/memories/recall` response shape from
|
|
545
|
+
* `src/daemon/runtime/memories/recall.ts`. PRD-027 Wave 1 made the hit carry a REAL
|
|
546
|
+
* `{ source, id, text, score, kind, secondary }`: `score` is the fused RRF relevance
|
|
547
|
+
* (the engine already emits hits ranked DESC by it), `kind` is the provenance class
|
|
548
|
+
* (`"memory"` distilled vs `"session"` raw dump), and `secondary` is `true` iff the hit
|
|
549
|
+
* is a drill-down raw session row. The client renders the ENGINE score + ENGINE order —
|
|
550
|
+
* it NEVER fabricates a score (D-4 / AC-4 removed the old `1 - i*0.06` synthesis).
|
|
551
|
+
*
|
|
552
|
+
* The score/kind/secondary fields `.catch()` to safe defaults so an OLDER daemon that
|
|
553
|
+
* predates Wave 1 (no score on the wire) still renders (degrade gracefully). The LIVE
|
|
554
|
+
* daemon now always sends them. The kit's `MemoryCard` wants
|
|
555
|
+
* `{ memoryKey, snippet, source, score, scope, verified }`; we MAP the wire hit to those
|
|
556
|
+
* props in {@link recall} (id→memoryKey, text→snippet, ENGINE `score`→score, the arm name→
|
|
557
|
+
* scope hint, `kind`/`secondary`→the distilled-vs-drill-down demotion).
|
|
558
|
+
*/
|
|
559
|
+
export declare const RecallHitSchema: z.ZodObject<{
|
|
560
|
+
source: z.ZodCatch<z.ZodString>;
|
|
561
|
+
id: z.ZodCatch<z.ZodString>;
|
|
562
|
+
text: z.ZodCatch<z.ZodString>;
|
|
563
|
+
score: z.ZodCatch<z.ZodNumber>;
|
|
564
|
+
kind: z.ZodCatch<z.ZodEnum<{
|
|
565
|
+
memory: "memory";
|
|
566
|
+
session: "session";
|
|
567
|
+
}>>;
|
|
568
|
+
secondary: z.ZodCatch<z.ZodBoolean>;
|
|
569
|
+
}, z.core.$strip>;
|
|
570
|
+
export declare const RecallResponseSchema: z.ZodObject<{
|
|
571
|
+
hits: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
572
|
+
source: z.ZodCatch<z.ZodString>;
|
|
573
|
+
id: z.ZodCatch<z.ZodString>;
|
|
574
|
+
text: z.ZodCatch<z.ZodString>;
|
|
575
|
+
score: z.ZodCatch<z.ZodNumber>;
|
|
576
|
+
kind: z.ZodCatch<z.ZodEnum<{
|
|
577
|
+
memory: "memory";
|
|
578
|
+
session: "session";
|
|
579
|
+
}>>;
|
|
580
|
+
secondary: z.ZodCatch<z.ZodBoolean>;
|
|
581
|
+
}, z.core.$strip>>>;
|
|
582
|
+
sources: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
583
|
+
degraded: z.ZodCatch<z.ZodBoolean>;
|
|
584
|
+
}, z.core.$strip>;
|
|
585
|
+
/** A rendered recalled memory (the shape the `MemoryCard` consumes). */
|
|
586
|
+
export interface RecalledMemory {
|
|
587
|
+
readonly memoryKey: string;
|
|
588
|
+
readonly snippet: string;
|
|
589
|
+
readonly source: string;
|
|
590
|
+
/** The ENGINE's fused RRF relevance score (NOT a client fabrication — PRD-027 AC-4). */
|
|
591
|
+
readonly score: number;
|
|
592
|
+
readonly scope: string;
|
|
593
|
+
readonly verified: boolean;
|
|
594
|
+
/** Provenance class from the engine: distilled `"memory"` vs raw-dump `"session"`. */
|
|
595
|
+
readonly kind: "memory" | "session";
|
|
596
|
+
/** `true` iff a drill-down raw session row (the card visually demotes these). */
|
|
597
|
+
readonly secondary: boolean;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* PRD-040 — one memory row on the wire. MIRRORS the daemon read-model
|
|
601
|
+
* `src/daemon/runtime/memories/reads.ts` `MemoryRecord` (the original thin shape PLUS the
|
|
602
|
+
* OQ-1 additive detail metadata). Every field `.catch()`-defaults so a partial/older payload —
|
|
603
|
+
* a daemon serving only the thin `{ id, type, content, confidence, agentId, createdAt,
|
|
604
|
+
* updatedAt }`, or a malformed body — degrades to a safe value rather than throwing into React.
|
|
605
|
+
* The five OQ-1 fields (`visibility`/`sourceType`/`sourceId`/`version`/`hasEmbedding`) are
|
|
606
|
+
* `.catch()`-defaulted EXACTLY so an older/thin daemon still renders the detail view (with those
|
|
607
|
+
* fields blank/false). No secret rides this shape — scope tag, provenance, a version, a boolean.
|
|
608
|
+
*/
|
|
609
|
+
export declare const MemoryRecordSchema: z.ZodObject<{
|
|
610
|
+
id: z.ZodCatch<z.ZodString>;
|
|
611
|
+
type: z.ZodCatch<z.ZodString>;
|
|
612
|
+
content: z.ZodCatch<z.ZodString>;
|
|
613
|
+
confidence: z.ZodCatch<z.ZodNumber>;
|
|
614
|
+
agentId: z.ZodCatch<z.ZodString>;
|
|
615
|
+
createdAt: z.ZodCatch<z.ZodString>;
|
|
616
|
+
updatedAt: z.ZodCatch<z.ZodString>;
|
|
617
|
+
visibility: z.ZodCatch<z.ZodString>;
|
|
618
|
+
sourceType: z.ZodCatch<z.ZodString>;
|
|
619
|
+
sourceId: z.ZodCatch<z.ZodString>;
|
|
620
|
+
version: z.ZodCatch<z.ZodNumber>;
|
|
621
|
+
hasEmbedding: z.ZodCatch<z.ZodBoolean>;
|
|
622
|
+
}, z.core.$strip>;
|
|
623
|
+
export type MemoryRecordWire = z.infer<typeof MemoryRecordSchema>;
|
|
624
|
+
/** `GET /api/memories` body: `{ memories: MemoryRecord[] }`. A bad shape degrades to `[]`. */
|
|
625
|
+
export declare const MemoryListResponseSchema: z.ZodObject<{
|
|
626
|
+
memories: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
627
|
+
id: z.ZodCatch<z.ZodString>;
|
|
628
|
+
type: z.ZodCatch<z.ZodString>;
|
|
629
|
+
content: z.ZodCatch<z.ZodString>;
|
|
630
|
+
confidence: z.ZodCatch<z.ZodNumber>;
|
|
631
|
+
agentId: z.ZodCatch<z.ZodString>;
|
|
632
|
+
createdAt: z.ZodCatch<z.ZodString>;
|
|
633
|
+
updatedAt: z.ZodCatch<z.ZodString>;
|
|
634
|
+
visibility: z.ZodCatch<z.ZodString>;
|
|
635
|
+
sourceType: z.ZodCatch<z.ZodString>;
|
|
636
|
+
sourceId: z.ZodCatch<z.ZodString>;
|
|
637
|
+
version: z.ZodCatch<z.ZodNumber>;
|
|
638
|
+
hasEmbedding: z.ZodCatch<z.ZodBoolean>;
|
|
639
|
+
}, z.core.$strip>>>;
|
|
640
|
+
}, z.core.$strip>;
|
|
641
|
+
/** `GET /api/memories/:id` body: `{ memory: MemoryRecord }`. A 404 is handled at the call site (→ null). */
|
|
642
|
+
export declare const MemoryGetResponseSchema: z.ZodObject<{
|
|
643
|
+
memory: z.ZodObject<{
|
|
644
|
+
id: z.ZodCatch<z.ZodString>;
|
|
645
|
+
type: z.ZodCatch<z.ZodString>;
|
|
646
|
+
content: z.ZodCatch<z.ZodString>;
|
|
647
|
+
confidence: z.ZodCatch<z.ZodNumber>;
|
|
648
|
+
agentId: z.ZodCatch<z.ZodString>;
|
|
649
|
+
createdAt: z.ZodCatch<z.ZodString>;
|
|
650
|
+
updatedAt: z.ZodCatch<z.ZodString>;
|
|
651
|
+
visibility: z.ZodCatch<z.ZodString>;
|
|
652
|
+
sourceType: z.ZodCatch<z.ZodString>;
|
|
653
|
+
sourceId: z.ZodCatch<z.ZodString>;
|
|
654
|
+
version: z.ZodCatch<z.ZodNumber>;
|
|
655
|
+
hasEmbedding: z.ZodCatch<z.ZodBoolean>;
|
|
656
|
+
}, z.core.$strip>;
|
|
657
|
+
}, z.core.$strip>;
|
|
658
|
+
/** `POST /api/memories` (store) ack: `{ id, action }` (201). `id` is null when the daemon dedup-skips. */
|
|
659
|
+
export declare const StoreAckSchema: z.ZodObject<{
|
|
660
|
+
id: z.ZodCatch<z.ZodNullable<z.ZodString>>;
|
|
661
|
+
action: z.ZodCatch<z.ZodString>;
|
|
662
|
+
}, z.core.$strip>;
|
|
663
|
+
export type StoreAckWire = z.infer<typeof StoreAckSchema>;
|
|
664
|
+
/** `POST /api/memories/:id/modify` + `/forget` ack: `{ id, action, audited }`. */
|
|
665
|
+
export declare const WriteAckSchema: z.ZodObject<{
|
|
666
|
+
id: z.ZodCatch<z.ZodNullable<z.ZodString>>;
|
|
667
|
+
action: z.ZodCatch<z.ZodString>;
|
|
668
|
+
audited: z.ZodCatch<z.ZodBoolean>;
|
|
669
|
+
}, z.core.$strip>;
|
|
670
|
+
export type WriteAckWire = z.infer<typeof WriteAckSchema>;
|
|
671
|
+
/**
|
|
672
|
+
* PRD-040c — one per-table compaction summary on the wire, MIRRORING the daemon
|
|
673
|
+
* `CompactTableResult` (`src/daemon/runtime/maintenance/compact-api.ts`): the table name + the
|
|
674
|
+
* reap counts + an `errored` count (>0 ⇒ "attempted, not completed"). Every field `.catch()`es
|
|
675
|
+
* so a partial body still renders. No secret — table names + integer counts only.
|
|
676
|
+
*/
|
|
677
|
+
export declare const CompactTableResultSchema: z.ZodObject<{
|
|
678
|
+
table: z.ZodCatch<z.ZodString>;
|
|
679
|
+
keysScanned: z.ZodCatch<z.ZodNumber>;
|
|
680
|
+
keysCompacted: z.ZodCatch<z.ZodNumber>;
|
|
681
|
+
rowsReaped: z.ZodCatch<z.ZodNumber>;
|
|
682
|
+
keysSkipped: z.ZodCatch<z.ZodNumber>;
|
|
683
|
+
errored: z.ZodCatch<z.ZodNumber>;
|
|
684
|
+
}, z.core.$strip>;
|
|
685
|
+
export type CompactTableResultWire = z.infer<typeof CompactTableResultSchema>;
|
|
686
|
+
/** `POST /api/diagnostics/compact` body: `{ ok, summaries, skippedTables }`. Degrades to an empty summary. */
|
|
687
|
+
export declare const CompactSummarySchema: z.ZodObject<{
|
|
688
|
+
ok: z.ZodCatch<z.ZodBoolean>;
|
|
689
|
+
summaries: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
690
|
+
table: z.ZodCatch<z.ZodString>;
|
|
691
|
+
keysScanned: z.ZodCatch<z.ZodNumber>;
|
|
692
|
+
keysCompacted: z.ZodCatch<z.ZodNumber>;
|
|
693
|
+
rowsReaped: z.ZodCatch<z.ZodNumber>;
|
|
694
|
+
keysSkipped: z.ZodCatch<z.ZodNumber>;
|
|
695
|
+
errored: z.ZodCatch<z.ZodNumber>;
|
|
696
|
+
}, z.core.$strip>>>;
|
|
697
|
+
skippedTables: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
698
|
+
}, z.core.$strip>;
|
|
699
|
+
export type CompactSummaryWire = z.infer<typeof CompactSummarySchema>;
|
|
700
|
+
/** One conflict row from `GET /api/memories/conflicts` (the pair + verdict + status). */
|
|
701
|
+
export declare const LifecycleConflictSchema: z.ZodObject<{
|
|
702
|
+
id: z.ZodCatch<z.ZodString>;
|
|
703
|
+
memoryAId: z.ZodCatch<z.ZodString>;
|
|
704
|
+
memoryBId: z.ZodCatch<z.ZodString>;
|
|
705
|
+
verdict: z.ZodCatch<z.ZodString>;
|
|
706
|
+
winnerId: z.ZodCatch<z.ZodNullable<z.ZodString>>;
|
|
707
|
+
status: z.ZodCatch<z.ZodString>;
|
|
708
|
+
contraScore: z.ZodCatch<z.ZodNumber>;
|
|
709
|
+
}, z.core.$strip>;
|
|
710
|
+
export type LifecycleConflictWire = z.infer<typeof LifecycleConflictSchema>;
|
|
711
|
+
export declare const LifecycleConflictsResponseSchema: z.ZodObject<{
|
|
712
|
+
conflicts: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
713
|
+
id: z.ZodCatch<z.ZodString>;
|
|
714
|
+
memoryAId: z.ZodCatch<z.ZodString>;
|
|
715
|
+
memoryBId: z.ZodCatch<z.ZodString>;
|
|
716
|
+
verdict: z.ZodCatch<z.ZodString>;
|
|
717
|
+
winnerId: z.ZodCatch<z.ZodNullable<z.ZodString>>;
|
|
718
|
+
status: z.ZodCatch<z.ZodString>;
|
|
719
|
+
contraScore: z.ZodCatch<z.ZodNumber>;
|
|
720
|
+
}, z.core.$strip>>>;
|
|
721
|
+
status: z.ZodCatch<z.ZodString>;
|
|
722
|
+
}, z.core.$strip>;
|
|
723
|
+
/** One stale-ref row from `GET /api/memories/stale-refs` (the memory id + its unresolved refs). */
|
|
724
|
+
export declare const LifecycleStaleRefSchema: z.ZodObject<{
|
|
725
|
+
memoryId: z.ZodCatch<z.ZodString>;
|
|
726
|
+
refStatus: z.ZodCatch<z.ZodString>;
|
|
727
|
+
staleRefs: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
728
|
+
verifiedAt: z.ZodCatch<z.ZodNullable<z.ZodString>>;
|
|
729
|
+
}, z.core.$strip>;
|
|
730
|
+
export type LifecycleStaleRefWire = z.infer<typeof LifecycleStaleRefSchema>;
|
|
731
|
+
export declare const LifecycleStaleRefsResponseSchema: z.ZodObject<{
|
|
732
|
+
staleRefs: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
733
|
+
memoryId: z.ZodCatch<z.ZodString>;
|
|
734
|
+
refStatus: z.ZodCatch<z.ZodString>;
|
|
735
|
+
staleRefs: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
736
|
+
verifiedAt: z.ZodCatch<z.ZodNullable<z.ZodString>>;
|
|
737
|
+
}, z.core.$strip>>>;
|
|
738
|
+
}, z.core.$strip>;
|
|
739
|
+
/** One lifecycle audit row from `GET /api/memories/history?type=lifecycle`. */
|
|
740
|
+
export declare const LifecycleHistorySchema: z.ZodObject<{
|
|
741
|
+
id: z.ZodCatch<z.ZodString>;
|
|
742
|
+
memoryId: z.ZodCatch<z.ZodString>;
|
|
743
|
+
actor: z.ZodCatch<z.ZodString>;
|
|
744
|
+
operation: z.ZodCatch<z.ZodString>;
|
|
745
|
+
reason: z.ZodCatch<z.ZodString>;
|
|
746
|
+
confidence: z.ZodCatch<z.ZodNumber>;
|
|
747
|
+
timestamp: z.ZodCatch<z.ZodString>;
|
|
748
|
+
}, z.core.$strip>;
|
|
749
|
+
export type LifecycleHistoryWire = z.infer<typeof LifecycleHistorySchema>;
|
|
750
|
+
export declare const LifecycleHistoryResponseSchema: z.ZodObject<{
|
|
751
|
+
history: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
752
|
+
id: z.ZodCatch<z.ZodString>;
|
|
753
|
+
memoryId: z.ZodCatch<z.ZodString>;
|
|
754
|
+
actor: z.ZodCatch<z.ZodString>;
|
|
755
|
+
operation: z.ZodCatch<z.ZodString>;
|
|
756
|
+
reason: z.ZodCatch<z.ZodString>;
|
|
757
|
+
confidence: z.ZodCatch<z.ZodNumber>;
|
|
758
|
+
timestamp: z.ZodCatch<z.ZodString>;
|
|
759
|
+
}, z.core.$strip>>>;
|
|
760
|
+
type: z.ZodCatch<z.ZodString>;
|
|
761
|
+
}, z.core.$strip>;
|
|
762
|
+
/** One reliability-diagram bin from `GET /api/memories/calibration` (the 058e introspection payload). */
|
|
763
|
+
export declare const ReliabilityBinSchema: z.ZodObject<{
|
|
764
|
+
lower: z.ZodCatch<z.ZodNumber>;
|
|
765
|
+
upper: z.ZodCatch<z.ZodNumber>;
|
|
766
|
+
meanConfidence: z.ZodCatch<z.ZodNumber>;
|
|
767
|
+
accuracy: z.ZodCatch<z.ZodNumber>;
|
|
768
|
+
count: z.ZodCatch<z.ZodNumber>;
|
|
769
|
+
}, z.core.$strip>;
|
|
770
|
+
export type ReliabilityBinWire = z.infer<typeof ReliabilityBinSchema>;
|
|
771
|
+
/** The `GET /api/memories/calibration` body (ece/brier/n_samples + reliability diagram, 058e). */
|
|
772
|
+
export declare const CalibrationSchema: z.ZodObject<{
|
|
773
|
+
ece: z.ZodCatch<z.ZodNumber>;
|
|
774
|
+
brier: z.ZodCatch<z.ZodNumber>;
|
|
775
|
+
nSamples: z.ZodCatch<z.ZodNumber>;
|
|
776
|
+
fitAt: z.ZodCatch<z.ZodNullable<z.ZodString>>;
|
|
777
|
+
identity: z.ZodCatch<z.ZodBoolean>;
|
|
778
|
+
reliabilityDiagram: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
779
|
+
lower: z.ZodCatch<z.ZodNumber>;
|
|
780
|
+
upper: z.ZodCatch<z.ZodNumber>;
|
|
781
|
+
meanConfidence: z.ZodCatch<z.ZodNumber>;
|
|
782
|
+
accuracy: z.ZodCatch<z.ZodNumber>;
|
|
783
|
+
count: z.ZodCatch<z.ZodNumber>;
|
|
784
|
+
}, z.core.$strip>>>;
|
|
785
|
+
}, z.core.$strip>;
|
|
786
|
+
export type CalibrationWire = z.infer<typeof CalibrationSchema>;
|
|
787
|
+
/** The cold-start calibration view the panel shows before the first load (or on failure). */
|
|
788
|
+
export declare const EMPTY_CALIBRATION: CalibrationWire;
|
|
789
|
+
/** One `/api/logs` record (the `RequestLogRecord` the ring buffer serves; no secret in it). */
|
|
790
|
+
export declare const LogRecordSchema: z.ZodObject<{
|
|
791
|
+
time: z.ZodCatch<z.ZodString>;
|
|
792
|
+
method: z.ZodCatch<z.ZodString>;
|
|
793
|
+
path: z.ZodCatch<z.ZodString>;
|
|
794
|
+
status: z.ZodCatch<z.ZodNumber>;
|
|
795
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
796
|
+
mode: z.ZodOptional<z.ZodString>;
|
|
797
|
+
org: z.ZodOptional<z.ZodString>;
|
|
798
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
799
|
+
}, z.core.$strip>;
|
|
800
|
+
export declare const LogsResponseSchema: z.ZodObject<{
|
|
801
|
+
records: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
802
|
+
time: z.ZodCatch<z.ZodString>;
|
|
803
|
+
method: z.ZodCatch<z.ZodString>;
|
|
804
|
+
path: z.ZodCatch<z.ZodString>;
|
|
805
|
+
status: z.ZodCatch<z.ZodNumber>;
|
|
806
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
807
|
+
mode: z.ZodOptional<z.ZodString>;
|
|
808
|
+
org: z.ZodOptional<z.ZodString>;
|
|
809
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
810
|
+
}, z.core.$strip>>>;
|
|
811
|
+
count: z.ZodCatch<z.ZodNumber>;
|
|
812
|
+
}, z.core.$strip>;
|
|
813
|
+
export type LogRecordWire = z.infer<typeof LogRecordSchema>;
|
|
814
|
+
/**
|
|
815
|
+
* PRD-043a/043b — `GET /api/logs/history` body: the durable, filterable, paginated request-log
|
|
816
|
+
* history (newest first) + the next-page cursor. MIRRORS the daemon `LogsHistoryResponse`
|
|
817
|
+
* (`src/daemon/runtime/logs/api.ts`). Reuses the SAME secret-free {@link LogRecordSchema} as the
|
|
818
|
+
* live snapshot, so the history table and the live tail share ONE row shape and never drift. Every
|
|
819
|
+
* field `.catch()`-defaults so a partial/older payload degrades to a safe empty page (never a throw
|
|
820
|
+
* into React). `nextCursor` is null on the last page; `persistent:false` means history is
|
|
821
|
+
* unavailable (the store could not open — the page shows its honest empty/unavailable state).
|
|
822
|
+
*/
|
|
823
|
+
export declare const LogsHistoryResponseSchema: z.ZodObject<{
|
|
824
|
+
records: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
825
|
+
time: z.ZodCatch<z.ZodString>;
|
|
826
|
+
method: z.ZodCatch<z.ZodString>;
|
|
827
|
+
path: z.ZodCatch<z.ZodString>;
|
|
828
|
+
status: z.ZodCatch<z.ZodNumber>;
|
|
829
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
830
|
+
mode: z.ZodOptional<z.ZodString>;
|
|
831
|
+
org: z.ZodOptional<z.ZodString>;
|
|
832
|
+
workspace: z.ZodOptional<z.ZodString>;
|
|
833
|
+
}, z.core.$strip>>>;
|
|
834
|
+
count: z.ZodCatch<z.ZodNumber>;
|
|
835
|
+
nextCursor: z.ZodCatch<z.ZodNullable<z.ZodString>>;
|
|
836
|
+
persistent: z.ZodCatch<z.ZodBoolean>;
|
|
837
|
+
}, z.core.$strip>;
|
|
838
|
+
export type LogsHistoryWire = z.infer<typeof LogsHistoryResponseSchema>;
|
|
839
|
+
/** The fixed, validated filter set the Logs history table drives the `/api/logs/history` query with. */
|
|
840
|
+
export interface LogsHistoryFilters {
|
|
841
|
+
/** Lower time bound (inclusive), ISO-8601. */
|
|
842
|
+
readonly since?: string;
|
|
843
|
+
/** Upper time bound (inclusive), ISO-8601. */
|
|
844
|
+
readonly until?: string;
|
|
845
|
+
/** Exact status (`404`) or a class (`5xx`/`4xx`/`2xx`). */
|
|
846
|
+
readonly status?: string;
|
|
847
|
+
/** Path exact-or-prefix filter. */
|
|
848
|
+
readonly path?: string;
|
|
849
|
+
/** Org/harness filter (exact). */
|
|
850
|
+
readonly org?: string;
|
|
851
|
+
/** Page size (clamped daemon-side to `MAX_HISTORY_LIMIT`). */
|
|
852
|
+
readonly limit?: number;
|
|
853
|
+
/** The opaque pagination cursor (page strictly before this — older window). */
|
|
854
|
+
readonly cursor?: string;
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* PRD-043c — `GET /api/diagnostics/sessions` (paged) body: the browsable captured-TURNS history +
|
|
858
|
+
* the next-page cursor. Reuses the SAME {@link SessionRowSchema} as the legacy sessions view (so the
|
|
859
|
+
* Turns list and the dashboard panel share one row shape). Every field `.catch()`-defaults so a
|
|
860
|
+
* partial/older daemon payload (one WITHOUT `nextCursor`) degrades to a safe page with no further
|
|
861
|
+
* cursor, never a throw. The page LABELS these "Turns" (PRD-035a); the storage table stays `sessions`.
|
|
862
|
+
*/
|
|
863
|
+
export declare const TurnsHistoryResponseSchema: z.ZodObject<{
|
|
864
|
+
sessions: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
865
|
+
sessionId: z.ZodCatch<z.ZodString>;
|
|
866
|
+
project: z.ZodCatch<z.ZodString>;
|
|
867
|
+
startedAt: z.ZodCatch<z.ZodString>;
|
|
868
|
+
eventCount: z.ZodCatch<z.ZodNumber>;
|
|
869
|
+
status: z.ZodCatch<z.ZodString>;
|
|
870
|
+
}, z.core.$strip>>>;
|
|
871
|
+
nextCursor: z.ZodCatch<z.ZodNullable<z.ZodString>>;
|
|
872
|
+
}, z.core.$strip>;
|
|
873
|
+
export type TurnsHistoryWire = z.infer<typeof TurnsHistoryResponseSchema>;
|
|
874
|
+
/** Cursor's `cursor-agent` agents descriptor (039c) — present for Cursor, absent for Claude Code. */
|
|
875
|
+
export declare const HarnessAgentsSchema: z.ZodObject<{
|
|
876
|
+
kind: z.ZodCatch<z.ZodString>;
|
|
877
|
+
binary: z.ZodCatch<z.ZodString>;
|
|
878
|
+
fallbackBin: z.ZodOptional<z.ZodString>;
|
|
879
|
+
}, z.core.$strip>;
|
|
880
|
+
/** One harness's host-CLI descriptor (mirrors the shim `HostCli`). */
|
|
881
|
+
export declare const HarnessHostCliSchema: z.ZodObject<{
|
|
882
|
+
bin: z.ZodCatch<z.ZodString>;
|
|
883
|
+
args: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
884
|
+
fallbackBin: z.ZodOptional<z.ZodString>;
|
|
885
|
+
}, z.core.$strip>;
|
|
886
|
+
/**
|
|
887
|
+
* The data-driven capability descriptor folded into each `HarnessStatus` server-side (039c / c-OQ-2).
|
|
888
|
+
* The OPTIONAL fields are the genuine shim divergences — a missing field omits that harness's panel
|
|
889
|
+
* on the detail page (c-AC-3), never a blank. Each field `.catch()`es so a partial body still renders.
|
|
890
|
+
*/
|
|
891
|
+
export declare const HarnessCapabilitiesSchema: z.ZodObject<{
|
|
892
|
+
name: z.ZodCatch<z.ZodString>;
|
|
893
|
+
runtimePath: z.ZodCatch<z.ZodString>;
|
|
894
|
+
contextChannel: z.ZodCatch<z.ZodString>;
|
|
895
|
+
hostCli: z.ZodCatch<z.ZodObject<{
|
|
896
|
+
bin: z.ZodCatch<z.ZodString>;
|
|
897
|
+
args: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
898
|
+
fallbackBin: z.ZodOptional<z.ZodString>;
|
|
899
|
+
}, z.core.$strip>>;
|
|
900
|
+
lifecycleEvents: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
901
|
+
agents: z.ZodOptional<z.ZodObject<{
|
|
902
|
+
kind: z.ZodCatch<z.ZodString>;
|
|
903
|
+
binary: z.ZodCatch<z.ZodString>;
|
|
904
|
+
fallbackBin: z.ZodOptional<z.ZodString>;
|
|
905
|
+
}, z.core.$strip>>;
|
|
906
|
+
workspaceRoots: z.ZodOptional<z.ZodBoolean>;
|
|
907
|
+
mcpRegistration: z.ZodOptional<z.ZodBoolean>;
|
|
908
|
+
contractedTools: z.ZodOptional<z.ZodBoolean>;
|
|
909
|
+
agentsMdContext: z.ZodOptional<z.ZodBoolean>;
|
|
910
|
+
userVisibleLogin: z.ZodOptional<z.ZodBoolean>;
|
|
911
|
+
}, z.core.$strip>;
|
|
912
|
+
export type HarnessCapabilitiesWire = z.infer<typeof HarnessCapabilitiesSchema>;
|
|
913
|
+
/** One harness's status row (mirrors the daemon `HarnessStatus`). `lastSeen` is null when never seen. */
|
|
914
|
+
export declare const HarnessStatusSchema: z.ZodObject<{
|
|
915
|
+
name: z.ZodCatch<z.ZodString>;
|
|
916
|
+
installed: z.ZodCatch<z.ZodBoolean>;
|
|
917
|
+
active: z.ZodCatch<z.ZodBoolean>;
|
|
918
|
+
lastSeen: z.ZodCatch<z.ZodNullable<z.ZodString>>;
|
|
919
|
+
turnsCaptured: z.ZodCatch<z.ZodNumber>;
|
|
920
|
+
runtimePath: z.ZodCatch<z.ZodString>;
|
|
921
|
+
capabilities: z.ZodCatch<z.ZodObject<{
|
|
922
|
+
name: z.ZodCatch<z.ZodString>;
|
|
923
|
+
runtimePath: z.ZodCatch<z.ZodString>;
|
|
924
|
+
contextChannel: z.ZodCatch<z.ZodString>;
|
|
925
|
+
hostCli: z.ZodCatch<z.ZodObject<{
|
|
926
|
+
bin: z.ZodCatch<z.ZodString>;
|
|
927
|
+
args: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
928
|
+
fallbackBin: z.ZodOptional<z.ZodString>;
|
|
929
|
+
}, z.core.$strip>>;
|
|
930
|
+
lifecycleEvents: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
931
|
+
agents: z.ZodOptional<z.ZodObject<{
|
|
932
|
+
kind: z.ZodCatch<z.ZodString>;
|
|
933
|
+
binary: z.ZodCatch<z.ZodString>;
|
|
934
|
+
fallbackBin: z.ZodOptional<z.ZodString>;
|
|
935
|
+
}, z.core.$strip>>;
|
|
936
|
+
workspaceRoots: z.ZodOptional<z.ZodBoolean>;
|
|
937
|
+
mcpRegistration: z.ZodOptional<z.ZodBoolean>;
|
|
938
|
+
contractedTools: z.ZodOptional<z.ZodBoolean>;
|
|
939
|
+
agentsMdContext: z.ZodOptional<z.ZodBoolean>;
|
|
940
|
+
userVisibleLogin: z.ZodOptional<z.ZodBoolean>;
|
|
941
|
+
}, z.core.$strip>>;
|
|
942
|
+
}, z.core.$strip>;
|
|
943
|
+
export declare const HarnessStatusResponseSchema: z.ZodObject<{
|
|
944
|
+
harnesses: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
945
|
+
name: z.ZodCatch<z.ZodString>;
|
|
946
|
+
installed: z.ZodCatch<z.ZodBoolean>;
|
|
947
|
+
active: z.ZodCatch<z.ZodBoolean>;
|
|
948
|
+
lastSeen: z.ZodCatch<z.ZodNullable<z.ZodString>>;
|
|
949
|
+
turnsCaptured: z.ZodCatch<z.ZodNumber>;
|
|
950
|
+
runtimePath: z.ZodCatch<z.ZodString>;
|
|
951
|
+
capabilities: z.ZodCatch<z.ZodObject<{
|
|
952
|
+
name: z.ZodCatch<z.ZodString>;
|
|
953
|
+
runtimePath: z.ZodCatch<z.ZodString>;
|
|
954
|
+
contextChannel: z.ZodCatch<z.ZodString>;
|
|
955
|
+
hostCli: z.ZodCatch<z.ZodObject<{
|
|
956
|
+
bin: z.ZodCatch<z.ZodString>;
|
|
957
|
+
args: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
958
|
+
fallbackBin: z.ZodOptional<z.ZodString>;
|
|
959
|
+
}, z.core.$strip>>;
|
|
960
|
+
lifecycleEvents: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
961
|
+
agents: z.ZodOptional<z.ZodObject<{
|
|
962
|
+
kind: z.ZodCatch<z.ZodString>;
|
|
963
|
+
binary: z.ZodCatch<z.ZodString>;
|
|
964
|
+
fallbackBin: z.ZodOptional<z.ZodString>;
|
|
965
|
+
}, z.core.$strip>>;
|
|
966
|
+
workspaceRoots: z.ZodOptional<z.ZodBoolean>;
|
|
967
|
+
mcpRegistration: z.ZodOptional<z.ZodBoolean>;
|
|
968
|
+
contractedTools: z.ZodOptional<z.ZodBoolean>;
|
|
969
|
+
agentsMdContext: z.ZodOptional<z.ZodBoolean>;
|
|
970
|
+
userVisibleLogin: z.ZodOptional<z.ZodBoolean>;
|
|
971
|
+
}, z.core.$strip>>;
|
|
972
|
+
}, z.core.$strip>>>;
|
|
973
|
+
}, z.core.$strip>;
|
|
974
|
+
export type HarnessStatusWire = z.infer<typeof HarnessStatusSchema>;
|
|
975
|
+
/** The Wave-1 Pollinate ack (`POST /api/diagnostics/pollinate` → 202 + this body). */
|
|
976
|
+
export declare const PollinateAckSchema: z.ZodObject<{
|
|
977
|
+
triggered: z.ZodCatch<z.ZodBoolean>;
|
|
978
|
+
status: z.ZodCatch<z.ZodString>;
|
|
979
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
980
|
+
}, z.core.$strip>;
|
|
981
|
+
export type PollinateAck = z.infer<typeof PollinateAckSchema>;
|
|
982
|
+
/**
|
|
983
|
+
* The `POST /api/graph/build` ack (the codebase-graph build worker's data body). The daemon runs the
|
|
984
|
+
* REAL worker end-to-end — discover → tree-sitter extract → aggregate → finalize → write the LOCAL
|
|
985
|
+
* snapshot — and returns `{ built, snapshotSha256, nodeCount, edgeCount, fileCount, parseErrorCount,
|
|
986
|
+
* cacheStats, localPath, push }`. We only validate the four fields the UI needs (`built` + the counts);
|
|
987
|
+
* the rest of the body is ignored (zod drops extra keys). Every field `.catch()`-defaults so the 500
|
|
988
|
+
* error body (`{ error, reason }`) — or any malformed/partial payload — degrades to a safe
|
|
989
|
+
* `{ built: false, … }` ack rather than throwing into React (the page surfaces an honest inline error).
|
|
990
|
+
*/
|
|
991
|
+
export declare const BuildGraphAckSchema: z.ZodObject<{
|
|
992
|
+
built: z.ZodCatch<z.ZodBoolean>;
|
|
993
|
+
nodeCount: z.ZodCatch<z.ZodNumber>;
|
|
994
|
+
edgeCount: z.ZodCatch<z.ZodNumber>;
|
|
995
|
+
fileCount: z.ZodCatch<z.ZodNumber>;
|
|
996
|
+
}, z.core.$strip>;
|
|
997
|
+
export type BuildGraphAck = z.infer<typeof BuildGraphAckSchema>;
|
|
998
|
+
/**
|
|
999
|
+
* The honest failure ack the wire returns when the build POST is rejected, times out, or the body is
|
|
1000
|
+
* malformed (never a throw into React). The page keeps its empty state + shows the inline error line.
|
|
1001
|
+
*/
|
|
1002
|
+
export declare const FAILED_BUILD_GRAPH_ACK: BuildGraphAck;
|
|
1003
|
+
/**
|
|
1004
|
+
* The generous client-side timeout (ms) for `buildGraph()`. The build parses the WHOLE repo with
|
|
1005
|
+
* tree-sitter and can take many seconds to tens of seconds; a short default fetch timeout would abort
|
|
1006
|
+
* a legitimate in-progress build. 120s gives the worker ample headroom — well past the realistic build
|
|
1007
|
+
* time — while still bounding a truly hung request so the button never spins forever.
|
|
1008
|
+
*/
|
|
1009
|
+
export declare const BUILD_GRAPH_TIMEOUT_MS: 120000;
|
|
1010
|
+
/** The `POST /api/actions/logout` ack (`{ ok }`). */
|
|
1011
|
+
export declare const ActionOkSchema: z.ZodObject<{
|
|
1012
|
+
ok: z.ZodCatch<z.ZodBoolean>;
|
|
1013
|
+
}, z.core.$strip>;
|
|
1014
|
+
/**
|
|
1015
|
+
* The `POST /api/actions/embeddings` ack: `{ ok, enabled }` (the new persisted on/off state). Both
|
|
1016
|
+
* fields are STRICT (no `.catch` default): a malformed/partial body must FAIL the parse → `postJson`
|
|
1017
|
+
* returns null → `setEmbeddings` reports failure. Defaulting `enabled` to `false` would let a
|
|
1018
|
+
* `setEmbeddings(false)` call falsely "succeed" against a response that never echoed the real state.
|
|
1019
|
+
*/
|
|
1020
|
+
export declare const EmbeddingsActionSchema: z.ZodObject<{
|
|
1021
|
+
ok: z.ZodBoolean;
|
|
1022
|
+
enabled: z.ZodBoolean;
|
|
1023
|
+
}, z.core.$strip>;
|
|
1024
|
+
/** The `POST /api/actions/restart` ack: `{ ok, restarting }`. */
|
|
1025
|
+
export declare const RestartActionSchema: z.ZodObject<{
|
|
1026
|
+
ok: z.ZodCatch<z.ZodBoolean>;
|
|
1027
|
+
restarting: z.ZodCatch<z.ZodBoolean>;
|
|
1028
|
+
}, z.core.$strip>;
|
|
1029
|
+
/** The `POST /api/actions/uninstall` result: detected harnesses + the exact CLI command + a note. */
|
|
1030
|
+
export declare const UninstallResultSchema: z.ZodObject<{
|
|
1031
|
+
ok: z.ZodCatch<z.ZodBoolean>;
|
|
1032
|
+
harnesses: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
1033
|
+
removed: z.ZodCatch<z.ZodBoolean>;
|
|
1034
|
+
command: z.ZodCatch<z.ZodString>;
|
|
1035
|
+
note: z.ZodCatch<z.ZodString>;
|
|
1036
|
+
}, z.core.$strip>;
|
|
1037
|
+
/** The validated uninstall result the page renders honestly (paths/ids/command only — no secret). */
|
|
1038
|
+
export type UninstallResultWire = z.infer<typeof UninstallResultSchema>;
|
|
1039
|
+
/**
|
|
1040
|
+
* The PRD-029 per-subsystem `/health` `reasons` block (D-2 render). This MIRRORS the
|
|
1041
|
+
* Wave-1 daemon contract `HealthReasons` in `src/daemon/runtime/health.ts` verbatim — a
|
|
1042
|
+
* closed enum per subsystem, NO secret (D-5: no token/org/endpoint/header rides these,
|
|
1043
|
+
* only subsystem names + coarse states). The dashboard is LOCAL-mode so the daemon's
|
|
1044
|
+
* `/health` body carries this block; on a non-local public body it is absent (the strip
|
|
1045
|
+
* renders nothing — handled at the call site by a `null` reasons).
|
|
1046
|
+
*
|
|
1047
|
+
* Each field `.catch()`es to its HEALTHY value so a malformed/partial `reasons` degrades
|
|
1048
|
+
* to "looks ok" rather than throwing into React — the body crosses the untyped IO boundary
|
|
1049
|
+
* exactly like every other endpoint here. An UNKNOWN enum value (a future daemon adds a
|
|
1050
|
+
* state) also `.catch()`es to the healthy default, never a throw.
|
|
1051
|
+
*/
|
|
1052
|
+
export declare const HealthReasonsSchema: z.ZodObject<{
|
|
1053
|
+
storage: z.ZodCatch<z.ZodEnum<{
|
|
1054
|
+
unreachable: "unreachable";
|
|
1055
|
+
reachable: "reachable";
|
|
1056
|
+
}>>;
|
|
1057
|
+
embeddings: z.ZodCatch<z.ZodEnum<{
|
|
1058
|
+
on: "on";
|
|
1059
|
+
off: "off";
|
|
1060
|
+
}>>;
|
|
1061
|
+
schema: z.ZodCatch<z.ZodEnum<{
|
|
1062
|
+
ok: "ok";
|
|
1063
|
+
missing_table: "missing_table";
|
|
1064
|
+
}>>;
|
|
1065
|
+
portkey: z.ZodCatch<z.ZodEnum<{
|
|
1066
|
+
ok: "ok";
|
|
1067
|
+
unreachable: "unreachable";
|
|
1068
|
+
off: "off";
|
|
1069
|
+
unconfigured: "unconfigured";
|
|
1070
|
+
}>>;
|
|
1071
|
+
}, z.core.$strip>;
|
|
1072
|
+
export type HealthReasonsWire = z.infer<typeof HealthReasonsSchema>;
|
|
1073
|
+
/**
|
|
1074
|
+
* The `/health` body the daemon serves (the coarse bit + the additive PRD-029 `reasons`).
|
|
1075
|
+
* `reasons` is OPTIONAL — absent on the mode-gated public team/hybrid body, present in
|
|
1076
|
+
* local (which the dashboard always is). The whole body `.catch()`es a bad shape so a
|
|
1077
|
+
* malformed `/health` degrades to "no reasons" (coarse pill only), never a throw.
|
|
1078
|
+
*
|
|
1079
|
+
* NOTE the coarse liveness the app's view-swap keys off (`daemonUp`) comes from the HTTP
|
|
1080
|
+
* `res.ok` (a 503-on-degraded still parses a body), NOT from this `status` field — so the
|
|
1081
|
+
* reasons are purely ADDITIVE render data and never change the existing up/down behaviour.
|
|
1082
|
+
*/
|
|
1083
|
+
export declare const HealthBodySchema: z.ZodObject<{
|
|
1084
|
+
status: z.ZodCatch<z.ZodString>;
|
|
1085
|
+
reasons: z.ZodOptional<z.ZodObject<{
|
|
1086
|
+
storage: z.ZodCatch<z.ZodEnum<{
|
|
1087
|
+
unreachable: "unreachable";
|
|
1088
|
+
reachable: "reachable";
|
|
1089
|
+
}>>;
|
|
1090
|
+
embeddings: z.ZodCatch<z.ZodEnum<{
|
|
1091
|
+
on: "on";
|
|
1092
|
+
off: "off";
|
|
1093
|
+
}>>;
|
|
1094
|
+
schema: z.ZodCatch<z.ZodEnum<{
|
|
1095
|
+
ok: "ok";
|
|
1096
|
+
missing_table: "missing_table";
|
|
1097
|
+
}>>;
|
|
1098
|
+
portkey: z.ZodCatch<z.ZodEnum<{
|
|
1099
|
+
ok: "ok";
|
|
1100
|
+
unreachable: "unreachable";
|
|
1101
|
+
off: "off";
|
|
1102
|
+
unconfigured: "unconfigured";
|
|
1103
|
+
}>>;
|
|
1104
|
+
}, z.core.$strip>>;
|
|
1105
|
+
}, z.core.$strip>;
|
|
1106
|
+
/** The result of a `/health` probe: coarse liveness + the parsed per-subsystem reasons (or null). */
|
|
1107
|
+
export interface HealthProbe {
|
|
1108
|
+
/** Daemon liveness — `true` iff the HTTP response was ok (drives the view-swap, unchanged). */
|
|
1109
|
+
readonly up: boolean;
|
|
1110
|
+
/** The per-subsystem reasons (PRD-029), or `null` when the body omits/malforms them. */
|
|
1111
|
+
readonly reasons: HealthReasonsWire | null;
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* One provider entry in the catalog `GET /api/settings` returns — MIRRORS the Wave-1
|
|
1115
|
+
* `ProviderEntry` in `src/daemon/runtime/vault/catalog.ts` (D-6). `models` is the curated,
|
|
1116
|
+
* ordered model list (`models[0]` is the selector default); `openEnded` marks OpenRouter,
|
|
1117
|
+
* whose model id is a free-form passthrough (the panel renders a text input for it).
|
|
1118
|
+
*/
|
|
1119
|
+
export declare const ProviderEntrySchema: z.ZodObject<{
|
|
1120
|
+
id: z.ZodCatch<z.ZodString>;
|
|
1121
|
+
label: z.ZodCatch<z.ZodString>;
|
|
1122
|
+
models: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
1123
|
+
openEnded: z.ZodCatch<z.ZodBoolean>;
|
|
1124
|
+
}, z.core.$strip>;
|
|
1125
|
+
export type ProviderEntryWire = z.infer<typeof ProviderEntrySchema>;
|
|
1126
|
+
/**
|
|
1127
|
+
* A single `setting` value on the wire — the vault `setting` class stores a JSON SCALAR
|
|
1128
|
+
* (string | number | boolean), so the panel renders exactly those. A non-scalar (a future
|
|
1129
|
+
* structured setting) would register its own class; here a bad value `.catch()`es to a
|
|
1130
|
+
* harmless empty string so the panel never throws.
|
|
1131
|
+
*/
|
|
1132
|
+
export declare const SettingValueWireSchema: z.ZodCatch<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
1133
|
+
export type SettingValueWire = z.infer<typeof SettingValueWireSchema>;
|
|
1134
|
+
/**
|
|
1135
|
+
* The `GET /api/settings` body the Wave-1 daemon serves: `{ settings, catalog }`. `settings`
|
|
1136
|
+
* is the current key→value map of the `setting` class (the active provider/model + the
|
|
1137
|
+
* pollinating toggle + dashboard prefs); `catalog` is the static provider→model list. NO secret
|
|
1138
|
+
* is in this body by construction (the surface reads only the `setting` class). Each field
|
|
1139
|
+
* `.catch()`es to an empty default so a partial body degrades to "nothing selected".
|
|
1140
|
+
*/
|
|
1141
|
+
export declare const VaultSettingsSchema: z.ZodObject<{
|
|
1142
|
+
settings: z.ZodCatch<z.ZodRecord<z.ZodString, z.ZodCatch<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>>;
|
|
1143
|
+
catalog: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
1144
|
+
id: z.ZodCatch<z.ZodString>;
|
|
1145
|
+
label: z.ZodCatch<z.ZodString>;
|
|
1146
|
+
models: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
1147
|
+
openEnded: z.ZodCatch<z.ZodBoolean>;
|
|
1148
|
+
}, z.core.$strip>>>;
|
|
1149
|
+
}, z.core.$strip>;
|
|
1150
|
+
export type VaultSettingsWire = z.infer<typeof VaultSettingsSchema>;
|
|
1151
|
+
/**
|
|
1152
|
+
* The `GET /api/secrets` body (PRD-012a, names-only) — `{ names: string[] }`. The panel reads
|
|
1153
|
+
* this ONLY to show a provider key's PRESENCE ("set ✓" / "not set") by name; there is NO
|
|
1154
|
+
* value-returning route and the panel never asks for one (AC-5 / D-4). A malformed body
|
|
1155
|
+
* `.catch()`es to an empty name list (every provider reads as "not set", never a throw).
|
|
1156
|
+
*/
|
|
1157
|
+
export declare const SecretNamesSchema: z.ZodObject<{
|
|
1158
|
+
names: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
1159
|
+
}, z.core.$strip>;
|
|
1160
|
+
export type SecretNamesWire = z.infer<typeof SecretNamesSchema>;
|
|
1161
|
+
/** The empty vault-settings view the panel shows before the first load (or on failure). */
|
|
1162
|
+
export declare const EMPTY_VAULT_SETTINGS: VaultSettingsWire;
|
|
1163
|
+
/**
|
|
1164
|
+
* The `GET /api/auth/status` body the auth section reads (PRD-044a). Metadata ONLY: org id +
|
|
1165
|
+
* name, workspace, agent, the credentials `source` (`env` | `file` | `none`), `savedAt`, and an
|
|
1166
|
+
* optional `expiresAt`. There is deliberately NO `token` field — zod drops any extra `token` key
|
|
1167
|
+
* in the body, so a token can never reach React even if a buggy daemon sent one. Every field
|
|
1168
|
+
* `.catch()`-defaults to a disconnected-safe value (AC-4: degrade, never throw).
|
|
1169
|
+
*/
|
|
1170
|
+
export declare const AuthStatusSchema: z.ZodObject<{
|
|
1171
|
+
connected: z.ZodCatch<z.ZodBoolean>;
|
|
1172
|
+
orgId: z.ZodCatch<z.ZodString>;
|
|
1173
|
+
orgName: z.ZodCatch<z.ZodString>;
|
|
1174
|
+
workspace: z.ZodCatch<z.ZodString>;
|
|
1175
|
+
agentId: z.ZodCatch<z.ZodString>;
|
|
1176
|
+
source: z.ZodCatch<z.ZodEnum<{
|
|
1177
|
+
file: "file";
|
|
1178
|
+
none: "none";
|
|
1179
|
+
env: "env";
|
|
1180
|
+
}>>;
|
|
1181
|
+
savedAt: z.ZodCatch<z.ZodString>;
|
|
1182
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
1183
|
+
}, z.core.$strip>;
|
|
1184
|
+
export type AuthStatusWire = z.infer<typeof AuthStatusSchema>;
|
|
1185
|
+
/**
|
|
1186
|
+
* The honest disconnected status the auth section shows before the first load, on any failure,
|
|
1187
|
+
* or when no credentials resolve (AC-4). Never a blank panel, never a fabricated org.
|
|
1188
|
+
*/
|
|
1189
|
+
export declare const DISCONNECTED_AUTH_STATUS: AuthStatusWire;
|
|
1190
|
+
/** Per-tool credential/state directory presence (mirrors the daemon `SetupCredentialsPresence`). */
|
|
1191
|
+
export declare const SetupCredentialsSchema: z.ZodObject<{
|
|
1192
|
+
deeplake: z.ZodCatch<z.ZodBoolean>;
|
|
1193
|
+
honeycomb: z.ZodCatch<z.ZodBoolean>;
|
|
1194
|
+
hivemind: z.ZodCatch<z.ZodBoolean>;
|
|
1195
|
+
}, z.core.$strip>;
|
|
1196
|
+
/** The embeddings warmup signal (b-AC-5) — observable, never blocking. */
|
|
1197
|
+
export declare const SetupWarmupSchema: z.ZodObject<{
|
|
1198
|
+
enabled: z.ZodCatch<z.ZodBoolean>;
|
|
1199
|
+
live: z.ZodCatch<z.ZodBoolean>;
|
|
1200
|
+
warm: z.ZodCatch<z.ZodBoolean>;
|
|
1201
|
+
}, z.core.$strip>;
|
|
1202
|
+
/**
|
|
1203
|
+
* The `GET /setup/state` body the guided-setup shell reads (PRD-050b). `authenticated` is the
|
|
1204
|
+
* DERIVED auth source of truth (a valid credential loads), NOT the `phase` hint. Every field
|
|
1205
|
+
* `.catch()`-defaults to a fresh-install-safe value so a failed/non-local read renders the
|
|
1206
|
+
* guided-setup state (the safe default), never a throw.
|
|
1207
|
+
*/
|
|
1208
|
+
export declare const SetupStateSchema: z.ZodObject<{
|
|
1209
|
+
credentials: z.ZodCatch<z.ZodObject<{
|
|
1210
|
+
deeplake: z.ZodCatch<z.ZodBoolean>;
|
|
1211
|
+
honeycomb: z.ZodCatch<z.ZodBoolean>;
|
|
1212
|
+
hivemind: z.ZodCatch<z.ZodBoolean>;
|
|
1213
|
+
}, z.core.$strip>>;
|
|
1214
|
+
phase: z.ZodCatch<z.ZodEnum<{
|
|
1215
|
+
installed: "installed";
|
|
1216
|
+
fresh: "fresh";
|
|
1217
|
+
linking: "linking";
|
|
1218
|
+
linked: "linked";
|
|
1219
|
+
migrating: "migrating";
|
|
1220
|
+
migrated: "migrated";
|
|
1221
|
+
}>>;
|
|
1222
|
+
priorTool: z.ZodCatch<z.ZodObject<{
|
|
1223
|
+
hivemind: z.ZodCatch<z.ZodEnum<{
|
|
1224
|
+
absent: "absent";
|
|
1225
|
+
migrated: "migrated";
|
|
1226
|
+
present: "present";
|
|
1227
|
+
}>>;
|
|
1228
|
+
}, z.core.$strip>>;
|
|
1229
|
+
firstTimeSetupComplete: z.ZodCatch<z.ZodBoolean>;
|
|
1230
|
+
authenticated: z.ZodCatch<z.ZodBoolean>;
|
|
1231
|
+
warmup: z.ZodCatch<z.ZodObject<{
|
|
1232
|
+
enabled: z.ZodCatch<z.ZodBoolean>;
|
|
1233
|
+
live: z.ZodCatch<z.ZodBoolean>;
|
|
1234
|
+
warm: z.ZodCatch<z.ZodBoolean>;
|
|
1235
|
+
}, z.core.$strip>>;
|
|
1236
|
+
migration: z.ZodOptional<z.ZodObject<{
|
|
1237
|
+
phase: z.ZodCatch<z.ZodEnum<{
|
|
1238
|
+
link: "link";
|
|
1239
|
+
backup: "backup";
|
|
1240
|
+
uninstall: "uninstall";
|
|
1241
|
+
done: "done";
|
|
1242
|
+
rolled_back: "rolled_back";
|
|
1243
|
+
}>>;
|
|
1244
|
+
startedAt: z.ZodCatch<z.ZodString>;
|
|
1245
|
+
backupPath: z.ZodOptional<z.ZodString>;
|
|
1246
|
+
}, z.core.$strip>>;
|
|
1247
|
+
}, z.core.$strip>;
|
|
1248
|
+
export type SetupStateWire = z.infer<typeof SetupStateSchema>;
|
|
1249
|
+
/**
|
|
1250
|
+
* The honest fresh-install setup state the shell shows before the first load, on any failure, or in
|
|
1251
|
+
* non-local mode (the route 404s). `authenticated:false` ⇒ the guided-setup state renders (b-AC-6).
|
|
1252
|
+
*/
|
|
1253
|
+
export declare const FRESH_SETUP_STATE: SetupStateWire;
|
|
1254
|
+
/**
|
|
1255
|
+
* The `POST /setup/login` render payload (PRD-050c, consumed by 050b's "First time setup" button).
|
|
1256
|
+
* The body carries ONLY the `user_code` to display + the verification URIs — NEVER a token/device
|
|
1257
|
+
* code (the schema has no token field by construction). Every field `.catch()`-defaults so a partial
|
|
1258
|
+
* body degrades safely; `verification_uri_complete` is optional (present only when https-validated).
|
|
1259
|
+
*/
|
|
1260
|
+
export declare const SetupLoginSchema: z.ZodObject<{
|
|
1261
|
+
user_code: z.ZodCatch<z.ZodString>;
|
|
1262
|
+
verification_uri: z.ZodCatch<z.ZodString>;
|
|
1263
|
+
verification_uri_complete: z.ZodOptional<z.ZodString>;
|
|
1264
|
+
}, z.core.$strip>;
|
|
1265
|
+
export type SetupLoginWire = z.infer<typeof SetupLoginSchema>;
|
|
1266
|
+
/**
|
|
1267
|
+
* PRD-050d — the `POST /setup/migrate-from-hivemind` response (consumed by the "Proceed with Honeycomb"
|
|
1268
|
+
* button). Carries the terminal `phase` + a plain-language `message` + the `backupPath` reversibility
|
|
1269
|
+
* anchor + the `needsLogin`/`migrated` flags. NO token/secret rides this shape by construction. Every
|
|
1270
|
+
* field `.catch()`-defaults so a partial/failed body degrades to a safe "not ok" state, never a throw.
|
|
1271
|
+
* `needsLogin:true` ⇒ the page runs the 050c device flow; `migrated:true` ⇒ the silent-adopt completed.
|
|
1272
|
+
*/
|
|
1273
|
+
export declare const SetupMigrateSchema: z.ZodObject<{
|
|
1274
|
+
ok: z.ZodCatch<z.ZodBoolean>;
|
|
1275
|
+
phase: z.ZodCatch<z.ZodEnum<{
|
|
1276
|
+
link: "link";
|
|
1277
|
+
backup: "backup";
|
|
1278
|
+
uninstall: "uninstall";
|
|
1279
|
+
done: "done";
|
|
1280
|
+
rolled_back: "rolled_back";
|
|
1281
|
+
}>>;
|
|
1282
|
+
message: z.ZodCatch<z.ZodString>;
|
|
1283
|
+
backupPath: z.ZodOptional<z.ZodString>;
|
|
1284
|
+
needsLogin: z.ZodOptional<z.ZodBoolean>;
|
|
1285
|
+
migrated: z.ZodOptional<z.ZodBoolean>;
|
|
1286
|
+
}, z.core.$strip>;
|
|
1287
|
+
export type SetupMigrateWire = z.infer<typeof SetupMigrateSchema>;
|
|
1288
|
+
/** The honest "migration unavailable" ack the wizard shows on a non-2xx / network failure (never a throw). */
|
|
1289
|
+
export declare const FAILED_SETUP_MIGRATE: SetupMigrateWire;
|
|
1290
|
+
/** PRD-050d — the `POST /setup/migrate-from-hivemind/rollback` response (the d-AC-7 roll-back affordance). */
|
|
1291
|
+
export declare const SetupMigrateRollbackSchema: z.ZodObject<{
|
|
1292
|
+
ok: z.ZodCatch<z.ZodBoolean>;
|
|
1293
|
+
phase: z.ZodCatch<z.ZodLiteral<"rolled_back">>;
|
|
1294
|
+
message: z.ZodCatch<z.ZodString>;
|
|
1295
|
+
}, z.core.$strip>;
|
|
1296
|
+
export type SetupMigrateRollbackWire = z.infer<typeof SetupMigrateRollbackSchema>;
|
|
1297
|
+
/** The honest "rollback unavailable" ack the wizard shows on a non-2xx / network failure (never a throw). */
|
|
1298
|
+
export declare const FAILED_SETUP_MIGRATE_ROLLBACK: SetupMigrateRollbackWire;
|
|
1299
|
+
/** One enumerated org (id + display name) from `GET /api/diagnostics/scope/orgs`. */
|
|
1300
|
+
export declare const ScopeOrgSchema: z.ZodObject<{
|
|
1301
|
+
id: z.ZodCatch<z.ZodString>;
|
|
1302
|
+
name: z.ZodCatch<z.ZodString>;
|
|
1303
|
+
}, z.core.$strip>;
|
|
1304
|
+
export type ScopeOrgWire = z.infer<typeof ScopeOrgSchema>;
|
|
1305
|
+
/** The `GET /api/diagnostics/scope/orgs` body — `{ orgs }`. A failure degrades to an empty list. */
|
|
1306
|
+
export declare const ScopeOrgsSchema: z.ZodObject<{
|
|
1307
|
+
orgs: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
1308
|
+
id: z.ZodCatch<z.ZodString>;
|
|
1309
|
+
name: z.ZodCatch<z.ZodString>;
|
|
1310
|
+
}, z.core.$strip>>>;
|
|
1311
|
+
}, z.core.$strip>;
|
|
1312
|
+
/** One enumerated workspace (id + display name) from `GET /api/diagnostics/scope/workspaces`. */
|
|
1313
|
+
export declare const ScopeWorkspaceSchema: z.ZodObject<{
|
|
1314
|
+
id: z.ZodCatch<z.ZodString>;
|
|
1315
|
+
name: z.ZodCatch<z.ZodString>;
|
|
1316
|
+
}, z.core.$strip>;
|
|
1317
|
+
export type ScopeWorkspaceWire = z.infer<typeof ScopeWorkspaceSchema>;
|
|
1318
|
+
/**
|
|
1319
|
+
* The `GET /api/diagnostics/scope/workspaces` body — `{ workspaces, org, reminted }`. `reminted` is
|
|
1320
|
+
* true when the daemon re-minted the org-bound token before enumerating (49e-AC-3 observability).
|
|
1321
|
+
*/
|
|
1322
|
+
export declare const ScopeWorkspacesSchema: z.ZodObject<{
|
|
1323
|
+
workspaces: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
1324
|
+
id: z.ZodCatch<z.ZodString>;
|
|
1325
|
+
name: z.ZodCatch<z.ZodString>;
|
|
1326
|
+
}, z.core.$strip>>>;
|
|
1327
|
+
org: z.ZodCatch<z.ZodString>;
|
|
1328
|
+
reminted: z.ZodCatch<z.ZodBoolean>;
|
|
1329
|
+
}, z.core.$strip>;
|
|
1330
|
+
export type ScopeWorkspacesWire = z.infer<typeof ScopeWorkspacesSchema>;
|
|
1331
|
+
/**
|
|
1332
|
+
* One enumerated project (the workspace's synced 049a registry copy) — id + display name + the
|
|
1333
|
+
* PRD-059d `boundLocally` bit. `boundLocally` is true when a local folder→project binding targets
|
|
1334
|
+
* this project on THIS device (the Projects page shows those as ACTIVE); false ⇒ registry-only,
|
|
1335
|
+
* IMPORTABLE (the 059d "Import project from cloud" list shows those). `.catch(false)` so an OLDER
|
|
1336
|
+
* daemon payload that predates the field degrades to "not bound here" (safe: it would appear in the
|
|
1337
|
+
* import list, never silently as active) rather than throwing into React.
|
|
1338
|
+
*/
|
|
1339
|
+
export declare const ScopeProjectSchema: z.ZodObject<{
|
|
1340
|
+
projectId: z.ZodCatch<z.ZodString>;
|
|
1341
|
+
name: z.ZodCatch<z.ZodString>;
|
|
1342
|
+
boundLocally: z.ZodCatch<z.ZodBoolean>;
|
|
1343
|
+
boundPaths: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
1344
|
+
remote: z.ZodCatch<z.ZodString>;
|
|
1345
|
+
memoryCount: z.ZodCatch<z.ZodNumber>;
|
|
1346
|
+
sessionCount: z.ZodCatch<z.ZodNumber>;
|
|
1347
|
+
lastCapture: z.ZodCatch<z.ZodNullable<z.ZodString>>;
|
|
1348
|
+
}, z.core.$strip>;
|
|
1349
|
+
export type ScopeProjectWire = z.infer<typeof ScopeProjectSchema>;
|
|
1350
|
+
/** The `GET /api/diagnostics/scope/projects` body — `{ projects, org, workspace }`. */
|
|
1351
|
+
export declare const ScopeProjectsSchema: z.ZodObject<{
|
|
1352
|
+
projects: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
1353
|
+
projectId: z.ZodCatch<z.ZodString>;
|
|
1354
|
+
name: z.ZodCatch<z.ZodString>;
|
|
1355
|
+
boundLocally: z.ZodCatch<z.ZodBoolean>;
|
|
1356
|
+
boundPaths: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
1357
|
+
remote: z.ZodCatch<z.ZodString>;
|
|
1358
|
+
memoryCount: z.ZodCatch<z.ZodNumber>;
|
|
1359
|
+
sessionCount: z.ZodCatch<z.ZodNumber>;
|
|
1360
|
+
lastCapture: z.ZodCatch<z.ZodNullable<z.ZodString>>;
|
|
1361
|
+
}, z.core.$strip>>>;
|
|
1362
|
+
org: z.ZodCatch<z.ZodString>;
|
|
1363
|
+
workspace: z.ZodCatch<z.ZodString>;
|
|
1364
|
+
}, z.core.$strip>;
|
|
1365
|
+
export type ScopeProjectsWire = z.infer<typeof ScopeProjectsSchema>;
|
|
1366
|
+
/** One immediate child directory in a browse listing (059b) — basename + absolute path + git-repo marker. */
|
|
1367
|
+
export declare const BrowseChildSchema: z.ZodObject<{
|
|
1368
|
+
name: z.ZodCatch<z.ZodString>;
|
|
1369
|
+
path: z.ZodCatch<z.ZodString>;
|
|
1370
|
+
isGitRepo: z.ZodCatch<z.ZodBoolean>;
|
|
1371
|
+
}, z.core.$strip>;
|
|
1372
|
+
export type BrowseChildWire = z.infer<typeof BrowseChildSchema>;
|
|
1373
|
+
/**
|
|
1374
|
+
* The `GET /api/diagnostics/fs/browse` body (059b): the resolved dir + its immediate child
|
|
1375
|
+
* directories. `parent` is null at the allowed root (no traversal above it); `error` is a redacted
|
|
1376
|
+
* reason when the dir could not be read (still a clean body with empty children). A
|
|
1377
|
+
* malformed/absent/non-local body degrades to {@link EMPTY_BROWSE} so the picker shows an honest
|
|
1378
|
+
* empty/unavailable state (never a throw).
|
|
1379
|
+
*/
|
|
1380
|
+
export declare const BrowseBodySchema: z.ZodObject<{
|
|
1381
|
+
path: z.ZodCatch<z.ZodString>;
|
|
1382
|
+
root: z.ZodCatch<z.ZodString>;
|
|
1383
|
+
parent: z.ZodCatch<z.ZodNullable<z.ZodString>>;
|
|
1384
|
+
children: z.ZodCatch<z.ZodArray<z.ZodObject<{
|
|
1385
|
+
name: z.ZodCatch<z.ZodString>;
|
|
1386
|
+
path: z.ZodCatch<z.ZodString>;
|
|
1387
|
+
isGitRepo: z.ZodCatch<z.ZodBoolean>;
|
|
1388
|
+
}, z.core.$strip>>>;
|
|
1389
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1390
|
+
}, z.core.$strip>;
|
|
1391
|
+
export type BrowseBodyWire = z.infer<typeof BrowseBodySchema>;
|
|
1392
|
+
/** The honest empty browse body the picker shows when the daemon is unreachable / local-mode is off (b-AC-5). */
|
|
1393
|
+
export declare const EMPTY_BROWSE: BrowseBodyWire;
|
|
1394
|
+
/**
|
|
1395
|
+
* The `POST /api/diagnostics/projects/bind` (+ `/bind-existing`) ack (059b/059d): the recorded
|
|
1396
|
+
* absolute path + the project it bound to. `bound` is false on a rejected bind (the reserved inbox,
|
|
1397
|
+
* a degenerate name, a non-absolute path), with a redacted `error`. A malformed/failed body degrades
|
|
1398
|
+
* to a not-bound ack so the caller surfaces an honest failure (never a throw).
|
|
1399
|
+
*/
|
|
1400
|
+
export declare const BindAckSchema: z.ZodObject<{
|
|
1401
|
+
bound: z.ZodCatch<z.ZodBoolean>;
|
|
1402
|
+
path: z.ZodCatch<z.ZodString>;
|
|
1403
|
+
projectId: z.ZodCatch<z.ZodString>;
|
|
1404
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1405
|
+
}, z.core.$strip>;
|
|
1406
|
+
export type BindAckWire = z.infer<typeof BindAckSchema>;
|
|
1407
|
+
/** The honest "bind failed" ack the picker shows on a non-2xx / network failure (never a throw). */
|
|
1408
|
+
export declare const FAILED_BIND_ACK: BindAckWire;
|
|
1409
|
+
/** The `POST /api/diagnostics/projects/unbind` ack (059c): whether a LOCAL binding was removed. */
|
|
1410
|
+
export declare const UnbindAckSchema: z.ZodObject<{
|
|
1411
|
+
unbound: z.ZodCatch<z.ZodBoolean>;
|
|
1412
|
+
path: z.ZodCatch<z.ZodString>;
|
|
1413
|
+
}, z.core.$strip>;
|
|
1414
|
+
export type UnbindAckWire = z.infer<typeof UnbindAckSchema>;
|
|
1415
|
+
/** The honest "unbind failed" ack the page shows on a non-2xx / network failure (never a throw). */
|
|
1416
|
+
export declare const FAILED_UNBIND_ACK: UnbindAckWire;
|
|
1417
|
+
/**
|
|
1418
|
+
* The `POST /api/diagnostics/scope/org-switch` ack (122-AC-2): the now-active org + whether a token
|
|
1419
|
+
* re-mint ran. `switched:false` with a redacted `error` on a failed switch (no credential / unknown
|
|
1420
|
+
* org / re-mint error). `reminted` is true when a fresh org-bound token was minted (the org changed).
|
|
1421
|
+
* NO token in the body by construction.
|
|
1422
|
+
*/
|
|
1423
|
+
export declare const OrgSwitchAckSchema: z.ZodObject<{
|
|
1424
|
+
switched: z.ZodCatch<z.ZodBoolean>;
|
|
1425
|
+
org: z.ZodCatch<z.ZodString>;
|
|
1426
|
+
orgName: z.ZodOptional<z.ZodString>;
|
|
1427
|
+
reminted: z.ZodCatch<z.ZodBoolean>;
|
|
1428
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1429
|
+
}, z.core.$strip>;
|
|
1430
|
+
export type OrgSwitchAckWire = z.infer<typeof OrgSwitchAckSchema>;
|
|
1431
|
+
/** The honest "org switch failed" ack the switcher shows on a non-2xx / network failure (never a throw). */
|
|
1432
|
+
export declare const FAILED_ORG_SWITCH_ACK: OrgSwitchAckWire;
|
|
1433
|
+
/** The `POST /api/diagnostics/scope/workspace-switch` ack (IRD-122): the now-active workspace (no re-mint). */
|
|
1434
|
+
export declare const WorkspaceSwitchAckSchema: z.ZodObject<{
|
|
1435
|
+
switched: z.ZodCatch<z.ZodBoolean>;
|
|
1436
|
+
workspace: z.ZodCatch<z.ZodString>;
|
|
1437
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1438
|
+
}, z.core.$strip>;
|
|
1439
|
+
export type WorkspaceSwitchAckWire = z.infer<typeof WorkspaceSwitchAckSchema>;
|
|
1440
|
+
/** The honest "workspace switch failed" ack the switcher shows on a non-2xx / network failure (never a throw). */
|
|
1441
|
+
export declare const FAILED_WORKSPACE_SWITCH_ACK: WorkspaceSwitchAckWire;
|
|
1442
|
+
/**
|
|
1443
|
+
* The non-tenant SESSION headers every dashboard request stamps (PRD-024 Wave 3).
|
|
1444
|
+
*
|
|
1445
|
+
* The `/api/memories` group sits behind the runtime-path + session middleware
|
|
1446
|
+
* (`src/daemon/runtime/middleware/runtime-path.ts`), which REQUIRES
|
|
1447
|
+
* `x-honeycomb-runtime-path: plugin|legacy` AND a non-empty `x-honeycomb-session`. The
|
|
1448
|
+
* dashboard web app is a legitimate loopback thin client — exactly like the CLI/SDK/MCP, which
|
|
1449
|
+
* stamp these — so it must send them too. They carry NO tenant identity (no org GUID) and NO
|
|
1450
|
+
* credential (D-4), so they are safe to stamp client-side; the org comes from the daemon's
|
|
1451
|
+
* LOCAL default scope (the daemon-side Fix A). We deliberately do NOT send `x-honeycomb-org`:
|
|
1452
|
+
* sending a wrong/empty org would trip the cross-tenant guard.
|
|
1453
|
+
*
|
|
1454
|
+
* The session id is a FIXED, clearly-labeled loopback viewer id ("dashboard-web"): a single
|
|
1455
|
+
* long-lived viewer that idempotently re-claims its OWN session (the claim map is per-session),
|
|
1456
|
+
* never conflicting with a harness which uses real session ids. A fixed id keeps the bundle
|
|
1457
|
+
* deterministic and the contract testable (no `Math.random`/`Date.now`).
|
|
1458
|
+
*/
|
|
1459
|
+
export declare const DASHBOARD_SESSION_HEADERS: Readonly<{
|
|
1460
|
+
readonly "x-honeycomb-runtime-path": "plugin";
|
|
1461
|
+
readonly "x-honeycomb-session": "dashboard-web";
|
|
1462
|
+
}>;
|
|
1463
|
+
/** The injectable fetch surface (the global in prod; a mock in unit tests). */
|
|
1464
|
+
export type FetchLike = typeof fetch;
|
|
1465
|
+
/** Construction options for {@link createWireClient}. */
|
|
1466
|
+
export interface WireClientOptions {
|
|
1467
|
+
/** The daemon origin the app talks to (defaults to same-origin, i.e. empty prefix). */
|
|
1468
|
+
readonly origin?: string;
|
|
1469
|
+
/** The fetch implementation (defaults to the global `fetch`). */
|
|
1470
|
+
readonly fetchImpl?: FetchLike;
|
|
1471
|
+
}
|
|
1472
|
+
/** The max characters a recalled snippet renders before it is truncated with an ellipsis. */
|
|
1473
|
+
export declare const MAX_SNIPPET_CHARS = 280;
|
|
1474
|
+
/**
|
|
1475
|
+
* Format a recall hit's matched `text` into the snippet the {@link MemoryCard} renders. A raw
|
|
1476
|
+
* `session` dump (the JSONB capture turn) is collapsed to one readable line via
|
|
1477
|
+
* {@link humanizeSessionTurn} so the card never shows escaped JSON; a distilled `memory` fact
|
|
1478
|
+
* passes through as prose. EITHER way the result is whitespace-collapsed and capped at
|
|
1479
|
+
* {@link MAX_SNIPPET_CHARS} so a long row can never blow out the card. Exported so a test can
|
|
1480
|
+
* drive it deterministically (mirrors {@link formatLogLine}).
|
|
1481
|
+
*/
|
|
1482
|
+
export declare function formatRecallSnippet(text: string, kind: "memory" | "session"): string;
|
|
1483
|
+
/**
|
|
1484
|
+
* The dashboard web client. Each method hits one already-served endpoint, validates the
|
|
1485
|
+
* payload with zod, and returns a typed value (or a safe empty/zero state). The whole
|
|
1486
|
+
* surface is loopback `fetch` — no DeepLake, no secret, no token (D-4): the app reads only
|
|
1487
|
+
* what the daemon chooses to serve.
|
|
1488
|
+
*/
|
|
1489
|
+
export interface WireClient {
|
|
1490
|
+
/** The KPI band. PRD-049e: pass the selected project to re-scope the project-bearing counts
|
|
1491
|
+
* (Memories / Turns / Est. savings); omit it for the workspace-wide view. Team skills is always
|
|
1492
|
+
* workspace-wide (it has no project segment). */
|
|
1493
|
+
kpis(projectId?: string): Promise<KpisWire>;
|
|
1494
|
+
sessions(): Promise<SessionRowWire[]>;
|
|
1495
|
+
settings(): Promise<SettingsWire>;
|
|
1496
|
+
rules(): Promise<RuleRowWire[]>;
|
|
1497
|
+
skills(): Promise<SkillRowWire[]>;
|
|
1498
|
+
/**
|
|
1499
|
+
* PRD-049e — read the codebase-graph view (`GET /api/graph`). `projectId` (when set) stamps the
|
|
1500
|
+
* selected-project header so the read re-scopes on the dashboard's scope change (49e-AC-2); the
|
|
1501
|
+
* page passes the active `useScope().scope.project`, so a switch re-fetches the graph for the new
|
|
1502
|
+
* project rather than showing the prior scope's cached data.
|
|
1503
|
+
*/
|
|
1504
|
+
graph(projectId?: string): Promise<GraphWire>;
|
|
1505
|
+
/**
|
|
1506
|
+
* PRD-041b — read the MEMORY-GRAPH view-model (`GET /api/diagnostics/memory-graph`). Returns the
|
|
1507
|
+
* SAME `GraphWire` shape as {@link graph} (the memory graph is a `GraphView`-shaped source), so the
|
|
1508
|
+
* page feeds it to the SAME `GraphCanvas`. A malformed/absent body — or a `built:false` empty graph
|
|
1509
|
+
* while PRD-008 data is unpopulated — degrades to {@link EMPTY_GRAPH} so the page renders its honest
|
|
1510
|
+
* "no memory graph yet" empty state, never a throw. Validated through the shared `GraphSchema`.
|
|
1511
|
+
*/
|
|
1512
|
+
memoryGraph(projectId?: string): Promise<GraphWire>;
|
|
1513
|
+
/**
|
|
1514
|
+
* PRD-060e — read the composite ROI view-model (`GET /api/diagnostics/roi`). Returns the
|
|
1515
|
+
* full {@link RoiViewWire} the page renders as a PURE function (savings/infra/pollination/net
|
|
1516
|
+
* + the org/team/agent/project rollups + the per-user availability flag + `cost_basis`). All
|
|
1517
|
+
* money is INTEGER cents. A malformed/absent/failed body degrades to {@link EMPTY_ROI_VIEW}
|
|
1518
|
+
* (every section `absent`, net NOT computed) so the page renders its honest empty state — a
|
|
1519
|
+
* DASH glyph, never `$0.00` — rather than throwing (e-AC-2/e-AC-5). `projectId` (when set)
|
|
1520
|
+
* stamps the selected-project header so the read re-scopes on a dashboard scope change.
|
|
1521
|
+
*/
|
|
1522
|
+
roi(projectId?: string): Promise<RoiView>;
|
|
1523
|
+
/**
|
|
1524
|
+
* PRD-060e — read the ROI trend series (`GET /api/diagnostics/roi/trend`) backing the
|
|
1525
|
+
* inline-SVG chart (e-AC-10, dashed=modeled / solid=measured). All money is INTEGER cents. A
|
|
1526
|
+
* malformed/absent/failed body — or a genuine no-history-yet state — degrades to
|
|
1527
|
+
* {@link EMPTY_ROI_TREND} so the chart renders its honest empty state, never a throw.
|
|
1528
|
+
*/
|
|
1529
|
+
roiTrend(range: string, projectId?: string): Promise<RoiTrendView>;
|
|
1530
|
+
recall(query: string, projectId?: string): Promise<{
|
|
1531
|
+
memories: RecalledMemory[];
|
|
1532
|
+
degraded: boolean;
|
|
1533
|
+
}>;
|
|
1534
|
+
/**
|
|
1535
|
+
* PRD-040a — list the scoped tenant's memories (`GET /api/memories`, newest-first). `limit`
|
|
1536
|
+
* bumps for "load more" (the daemon clamps to `MAX_LIST_LIMIT` 500). A malformed/absent body
|
|
1537
|
+
* degrades to `[]` (the page renders its honest empty state). Stamps the session headers.
|
|
1538
|
+
*/
|
|
1539
|
+
listMemories(limit?: number, projectId?: string): Promise<MemoryRecordWire[]>;
|
|
1540
|
+
/**
|
|
1541
|
+
* PRD-040a — read one memory by id (`GET /api/memories/:id`). Returns `null` on a 404 (the id is
|
|
1542
|
+
* unknown OR forgotten → the page renders "this memory was forgotten") or any failure.
|
|
1543
|
+
*/
|
|
1544
|
+
getMemory(id: string): Promise<MemoryRecordWire | null>;
|
|
1545
|
+
/**
|
|
1546
|
+
* PRD-040b — add a memory (`POST /api/memories`, store). Returns the `{ id, action }` ack, or
|
|
1547
|
+
* `null` on a non-2xx / network failure (the caller surfaces "save failed" and re-reads). The
|
|
1548
|
+
* page never optimistically renders the input — it re-lists after the ack.
|
|
1549
|
+
*/
|
|
1550
|
+
addMemory(input: {
|
|
1551
|
+
content: string;
|
|
1552
|
+
type?: string;
|
|
1553
|
+
agentId?: string;
|
|
1554
|
+
}): Promise<StoreAckWire | null>;
|
|
1555
|
+
/**
|
|
1556
|
+
* PRD-040b — edit a memory (`POST /api/memories/:id/modify`, version-bumped + reason-gated).
|
|
1557
|
+
* The `reason` is REQUIRED (the daemon rejects an empty one). Returns the `{ id, action,
|
|
1558
|
+
* audited }` ack, or `null` on a non-2xx / network failure (the caller re-reads the unchanged
|
|
1559
|
+
* persisted value). NEVER a hard-update — the daemon appends a new version.
|
|
1560
|
+
*/
|
|
1561
|
+
modifyMemory(id: string, input: {
|
|
1562
|
+
content: string;
|
|
1563
|
+
reason: string;
|
|
1564
|
+
agentId?: string;
|
|
1565
|
+
}): Promise<WriteAckWire | null>;
|
|
1566
|
+
/**
|
|
1567
|
+
* PRD-040b — forget a memory (`POST /api/memories/:id/forget`, reason-gated soft-delete → a
|
|
1568
|
+
* tombstone version). Returns the ack, or `null` on failure. The page gates this behind a confirm.
|
|
1569
|
+
*/
|
|
1570
|
+
forgetMemory(id: string, input: {
|
|
1571
|
+
reason: string;
|
|
1572
|
+
}): Promise<WriteAckWire | null>;
|
|
1573
|
+
/**
|
|
1574
|
+
* PRD-040c — trigger version-history compaction (`POST /api/diagnostics/compact`). The optional
|
|
1575
|
+
* `table` selects ONE allow-listed table (omitted ⇒ all). Returns the per-table summary, or
|
|
1576
|
+
* `null` on failure ("compaction unavailable"). The page sends only a KNOWN table name or none —
|
|
1577
|
+
* the daemon matches it against the allow-list, so no attacker-controlled identifier rides this.
|
|
1578
|
+
*/
|
|
1579
|
+
compact(table?: string): Promise<CompactSummaryWire | null>;
|
|
1580
|
+
/**
|
|
1581
|
+
* PRD-058d — list the scoped conflict queue (`GET /api/memories/conflicts?status=open`). A
|
|
1582
|
+
* malformed/absent body degrades to `[]` (the panel renders its honest empty state). Scope is
|
|
1583
|
+
* resolved daemon-side from the session — the read is scope-filtered before any content.
|
|
1584
|
+
*/
|
|
1585
|
+
lifecycleConflicts(status?: string): Promise<LifecycleConflictWire[]>;
|
|
1586
|
+
/**
|
|
1587
|
+
* PRD-058d — resolve a conflict through the SAME 058b endpoint the CLI uses
|
|
1588
|
+
* (`POST /api/memories/conflicts/:id/resolve`). NO new write path — the daemon applies the κ
|
|
1589
|
+
* assignment, the append-only supersession, the audit append, and the poll-to-convergence
|
|
1590
|
+
* read-back. Returns `true` iff the daemon accepted (2xx); the caller re-reads + polls to
|
|
1591
|
+
* convergence, never an optimistic flip.
|
|
1592
|
+
*/
|
|
1593
|
+
resolveConflict(id: string, input: {
|
|
1594
|
+
verdict: string;
|
|
1595
|
+
winnerId?: string;
|
|
1596
|
+
reason?: string;
|
|
1597
|
+
}): Promise<boolean>;
|
|
1598
|
+
/** PRD-058d — list the scoped memories with `ref_status='stale'` + their unresolved refs. Degrades to `[]`. */
|
|
1599
|
+
lifecycleStaleRefs(): Promise<LifecycleStaleRefWire[]>;
|
|
1600
|
+
/** PRD-058d — read the lifecycle-filtered audit (`GET /api/memories/history?type=lifecycle`). Degrades to `[]`. */
|
|
1601
|
+
lifecycleHistory(): Promise<LifecycleHistoryWire[]>;
|
|
1602
|
+
/**
|
|
1603
|
+
* PRD-058d / 058e — read the calibration introspection (`GET /api/memories/calibration`): ECE,
|
|
1604
|
+
* Brier, n_samples, and the reliability-diagram payload. A malformed/absent/cold-start body
|
|
1605
|
+
* degrades to {@link EMPTY_CALIBRATION} (the panel shows "calibration dormant"), never a throw.
|
|
1606
|
+
*/
|
|
1607
|
+
calibration(): Promise<CalibrationWire>;
|
|
1608
|
+
logs(limit?: number): Promise<LogRecordWire[]>;
|
|
1609
|
+
/**
|
|
1610
|
+
* PRD-042c / PRD-021d — FOLLOW the `/api/logs/stream` SSE tail (c-AC-2). Subscribes a browser
|
|
1611
|
+
* `EventSource` to the daemon's already-mounted log stream, parsing each `event: "log"` record
|
|
1612
|
+
* through {@link LogRecordSchema} and handing the validated record to `onRecord`. Returns an
|
|
1613
|
+
* unsubscribe function the caller MUST call on unmount (it closes the EventSource). The activity
|
|
1614
|
+
* feed BACKFILLS via {@link logs} first, then follows this tail — no client poll.
|
|
1615
|
+
*
|
|
1616
|
+
* DEGRADES SAFELY: in a non-browser env (jsdom test, SSR) where `EventSource` is unavailable, this
|
|
1617
|
+
* is a no-op that returns an inert unsubscribe — the caller keeps its snapshot and never crashes
|
|
1618
|
+
* (the SSE-record handling is exercised by injecting the parser directly in tests). No record
|
|
1619
|
+
* carries a secret by construction (logger.ts); this introduces none.
|
|
1620
|
+
*/
|
|
1621
|
+
logsStream(onRecord: (record: LogRecordWire) => void): () => void;
|
|
1622
|
+
/**
|
|
1623
|
+
* PRD-043a/043b — read the DURABLE, filterable, paginated request-log history
|
|
1624
|
+
* (`GET /api/logs/history`, newest first). Reuses the SAME secret-free `LogRecordWire` shape as
|
|
1625
|
+
* {@link logs}, so the history table and the live tail share one row renderer. A malformed/absent
|
|
1626
|
+
* body degrades to an empty page (`{ records: [], nextCursor: null, persistent: false }`) so the
|
|
1627
|
+
* page renders its honest empty/unavailable state, never a throw. `filters` map 1:1 to the
|
|
1628
|
+
* daemon's validated query params; an undefined filter is simply omitted.
|
|
1629
|
+
*/
|
|
1630
|
+
logsHistory(filters?: LogsHistoryFilters): Promise<LogsHistoryWire>;
|
|
1631
|
+
/**
|
|
1632
|
+
* PRD-043c — read the browsable captured-TURNS history (`GET /api/diagnostics/sessions`, paged,
|
|
1633
|
+
* newest first). Returns the turn rows + a `nextCursor` for the next older page. Labeled "Turns"
|
|
1634
|
+
* on the page (PRD-035a); the storage table stays `sessions`. A malformed/absent body degrades to
|
|
1635
|
+
* an empty page so the page renders its honest empty state, never a throw. The daemon reads turns
|
|
1636
|
+
* from DeepLake (eventual consistency) — a freshly captured turn may appear one refresh later.
|
|
1637
|
+
*/
|
|
1638
|
+
turnsHistory(opts?: {
|
|
1639
|
+
limit?: number;
|
|
1640
|
+
cursor?: string;
|
|
1641
|
+
}): Promise<TurnsHistoryWire>;
|
|
1642
|
+
/**
|
|
1643
|
+
* PRD-039a — read the harness registry + last-seen telemetry (the data backbone). Returns the
|
|
1644
|
+
* six canonical `HarnessStatus` rows the Harnesses page (039b/039c) renders; a failure degrades
|
|
1645
|
+
* to an empty list (the page shows its honest empty/zero state, never a throw). No second source —
|
|
1646
|
+
* this is the SINGLE backbone (parent D-3).
|
|
1647
|
+
*/
|
|
1648
|
+
harnesses(): Promise<HarnessStatusWire[]>;
|
|
1649
|
+
/**
|
|
1650
|
+
* PRD-042 — read the Sync page `installed ∪ synced` union view-model (`GET /api/diagnostics/assets`):
|
|
1651
|
+
* skills + agents, each with its honest state + presentation-safe detail. A malformed/absent body
|
|
1652
|
+
* degrades to {@link EMPTY_ASSET_SYNC_VIEW} (the page renders its honest empty state, never a throw).
|
|
1653
|
+
*/
|
|
1654
|
+
assetsView(): Promise<AssetSyncViewWire>;
|
|
1655
|
+
/**
|
|
1656
|
+
* PRD-042 — run one Sync action (`POST /api/diagnostics/sync/{action}`). The daemon performs the REAL
|
|
1657
|
+
* pipeline (publish/pull/tombstone/install-toggle) and returns the CONVERGED result (poll-convergent
|
|
1658
|
+
* read-back). Returns the ack, or `null` on a non-2xx / network failure (the page re-reads the union
|
|
1659
|
+
* and reflects whatever actually persisted — never an optimistic flip). `input` carries the asset
|
|
1660
|
+
* kind + name (+ optional native/honeycombId for promote/pull/demote).
|
|
1661
|
+
*/
|
|
1662
|
+
syncAction(action: "promote" | "pull" | "demote" | "enable" | "disable", input: {
|
|
1663
|
+
assetType: "skill" | "agent";
|
|
1664
|
+
name: string;
|
|
1665
|
+
native?: string;
|
|
1666
|
+
honeycombId?: string;
|
|
1667
|
+
harness?: string;
|
|
1668
|
+
}): Promise<SyncActionResultWire | null>;
|
|
1669
|
+
health(): Promise<HealthProbe>;
|
|
1670
|
+
pollinate(): Promise<PollinateAck>;
|
|
1671
|
+
/**
|
|
1672
|
+
* PRD-041a — trigger the codebase-graph BUILD (`POST /api/graph/build`). The daemon runs the REAL
|
|
1673
|
+
* worker end-to-end (discover → tree-sitter extract → aggregate → finalize) and writes the LOCAL
|
|
1674
|
+
* snapshot, then returns the build ack `{ built, nodeCount, edgeCount, fileCount }` (the rest of the
|
|
1675
|
+
* body is ignored). After a `{ built: true }` ack the caller re-runs {@link graph} to render the
|
|
1676
|
+
* fresh snapshot immediately (it is a LOCAL file — no eventual-consistency poll needed). Stamps the
|
|
1677
|
+
* session headers exactly like {@link pollinate}. Uses a GENEROUS timeout ({@link BUILD_GRAPH_TIMEOUT_MS})
|
|
1678
|
+
* — the build is slow (whole-repo tree-sitter parse). Degrades to {@link FAILED_BUILD_GRAPH_ACK} on any
|
|
1679
|
+
* non-2xx / timeout / network / malformed-body failure — NEVER throws into React (the page shows an
|
|
1680
|
+
* honest inline error + keeps the CLI hint).
|
|
1681
|
+
*/
|
|
1682
|
+
buildGraph(): Promise<BuildGraphAck>;
|
|
1683
|
+
/** PRD-032c — read the vault `setting` class + the provider→model catalog (`GET /api/settings`). */
|
|
1684
|
+
vaultSettings(): Promise<VaultSettingsWire>;
|
|
1685
|
+
/**
|
|
1686
|
+
* PRD-032c — write one `setting`-class record through the daemon (`POST /api/settings/:key`).
|
|
1687
|
+
* Returns `true` iff the daemon accepted the write (2xx); the caller re-reads to reflect the
|
|
1688
|
+
* PERSISTED value (it never trusts a local-only toggle). The panel NEVER opens the vault
|
|
1689
|
+
* directly — every write goes through this loopback endpoint (PRD-020b posture).
|
|
1690
|
+
*/
|
|
1691
|
+
setSetting(key: string, value: SettingValueWire): Promise<boolean>;
|
|
1692
|
+
/**
|
|
1693
|
+
* PRD-032c — read the names-only secret list (`GET /api/secrets`) for provider-key PRESENCE
|
|
1694
|
+
* ("set ✓" / "not set") ONLY. There is no value-returning route; this returns NAMES, never a
|
|
1695
|
+
* value (D-4 / AC-5).
|
|
1696
|
+
*/
|
|
1697
|
+
secretNames(): Promise<string[]>;
|
|
1698
|
+
/**
|
|
1699
|
+
* PRD-044b — WRITE-ONLY store a provider key (`POST /api/secrets/:name` with a `{ value }`
|
|
1700
|
+
* body). Returns `true` iff the daemon accepted the write (2xx); any non-2xx (400 invalid
|
|
1701
|
+
* name/value, 502 store failure) reads as "not accepted". The value is sent in the body and
|
|
1702
|
+
* NEVER echoed back (the daemon's 201 carries the NAME only). The caller RE-READS
|
|
1703
|
+
* {@link secretNames} on success so the presence badge reflects the persisted truth — mirroring
|
|
1704
|
+
* the `setSetting` re-read pattern. THERE IS NO `getSecret` METHOD, and none is ever added: a
|
|
1705
|
+
* stored key cannot be read back through any wire method (the load-bearing AC-3 invariant).
|
|
1706
|
+
*/
|
|
1707
|
+
setSecret(name: string, value: string): Promise<boolean>;
|
|
1708
|
+
/**
|
|
1709
|
+
* Dashboard actions — log out of DeepLake (`POST /api/actions/logout`): remove the shared
|
|
1710
|
+
* credential so the user can re-authenticate from the dashboard. Returns `true` iff the daemon
|
|
1711
|
+
* accepted (2xx + `{ ok: true }`); a non-2xx / network failure reads as `false`. The caller
|
|
1712
|
+
* re-reads {@link authStatus} so the section flips to disconnected on success.
|
|
1713
|
+
*/
|
|
1714
|
+
logout(): Promise<boolean>;
|
|
1715
|
+
/**
|
|
1716
|
+
* Dashboard actions — turn embeddings on/off (`POST /api/actions/embeddings` with `{ enabled }`).
|
|
1717
|
+
* The daemon actuates the embed supervisor LIVE (spawn+warm / stop) AND persists the choice so it
|
|
1718
|
+
* survives a restart. Returns `true` iff accepted (2xx + echoed `enabled` matches the request);
|
|
1719
|
+
* the caller reflects the requested state on success and re-reads {@link health} for the live truth.
|
|
1720
|
+
*/
|
|
1721
|
+
setEmbeddings(enabled: boolean): Promise<boolean>;
|
|
1722
|
+
/**
|
|
1723
|
+
* Dashboard actions — restart the daemon (`POST /api/actions/restart`). The daemon spawns a
|
|
1724
|
+
* detached respawn helper, then gracefully shuts down; a fresh daemon comes back on the same port.
|
|
1725
|
+
* Returns `true` iff the restart was acknowledged (2xx + `{ restarting: true }`); the caller then
|
|
1726
|
+
* shows "restarting…" and polls {@link health} until the new daemon answers. Degrades to `false`.
|
|
1727
|
+
*/
|
|
1728
|
+
restartDaemon(): Promise<boolean>;
|
|
1729
|
+
/**
|
|
1730
|
+
* Dashboard actions — uninstall (`POST /api/actions/uninstall`). Returns the guided removal: the
|
|
1731
|
+
* detected harnesses + the exact CLI command that fully reverses Honeycomb's footprint (v1 does not
|
|
1732
|
+
* perform the destructive hook removal from the daemon serving this page — see `actions-api.ts`).
|
|
1733
|
+
* A non-2xx / network failure degrades to `null` (the page surfaces an honest error). No secret rides it.
|
|
1734
|
+
*/
|
|
1735
|
+
uninstall(): Promise<UninstallResultWire | null>;
|
|
1736
|
+
/**
|
|
1737
|
+
* PRD-044a — read the REDACTED DeepLake auth STATUS (`GET /api/auth/status`). Returns the
|
|
1738
|
+
* daemon's real connected identity (org/workspace/agent/source/savedAt + optional `expiresAt`)
|
|
1739
|
+
* or an honest disconnected status. The body carries NO token (the schema has no token field
|
|
1740
|
+
* by construction); a malformed/absent/failed read degrades to {@link DISCONNECTED_AUTH_STATUS}
|
|
1741
|
+
* (never a throw into React — AC-4). Re-callable on focus/poll so a CLI `honeycomb login`
|
|
1742
|
+
* reflects here.
|
|
1743
|
+
*/
|
|
1744
|
+
authStatus(): Promise<AuthStatusWire>;
|
|
1745
|
+
/**
|
|
1746
|
+
* PRD-050b — read the pre-auth guided-setup STATE (`GET /setup/state`). Returns credential-dir
|
|
1747
|
+
* presence + the onboarding phase/prior-tool + the DERIVED `authenticated` bit + the embeddings
|
|
1748
|
+
* warmup signal. Drives the fresh-install vs already-linked render (b-AC-6) and the live
|
|
1749
|
+
* pre-auth→authenticated transition the shell polls for (b-AC-3). A malformed/absent/failed read,
|
|
1750
|
+
* or a non-local 404, degrades to {@link FRESH_SETUP_STATE} (the guided-setup state) — never a
|
|
1751
|
+
* throw into React. The body carries NO token/secret (install metadata only).
|
|
1752
|
+
*/
|
|
1753
|
+
setupState(): Promise<SetupStateWire>;
|
|
1754
|
+
/**
|
|
1755
|
+
* PRD-050c (the 050b "First time setup" button handler) — BEGIN the on-page device-flow login
|
|
1756
|
+
* (`POST /setup/login`). Returns the `user_code` + verification URIs to display on the page (the
|
|
1757
|
+
* daemon keeps polling → mint → persist in the background); the shell then polls {@link setupState}
|
|
1758
|
+
* and flips to the authenticated view when the credential lands (b-AC-3). Returns `null` on a
|
|
1759
|
+
* non-2xx (the 502 device-flow-unavailable) / network failure so the button shows an honest error.
|
|
1760
|
+
* The response carries NO token (the schema has no token field by construction — c-AC-4).
|
|
1761
|
+
*/
|
|
1762
|
+
setupLogin(): Promise<SetupLoginWire | null>;
|
|
1763
|
+
/**
|
|
1764
|
+
* PRD-050d — "Proceed with Honeycomb": run the Hivemind→Honeycomb migration (`POST
|
|
1765
|
+
* /setup/migrate-from-hivemind`). The daemon backs up + uninstalls Hivemind idempotently, then
|
|
1766
|
+
* verify-and-adopts the shared credential (d-AC-4) or returns `needsLogin:true` (the page then runs
|
|
1767
|
+
* {@link setupLogin}). The response carries the terminal phase + a plain-language message + the
|
|
1768
|
+
* backup path (NO token). Degrades to {@link FAILED_SETUP_MIGRATE} on a non-2xx / network failure so
|
|
1769
|
+
* the wizard shows an honest, recoverable error (never a throw).
|
|
1770
|
+
*/
|
|
1771
|
+
migrateFromHivemind(): Promise<SetupMigrateWire>;
|
|
1772
|
+
/**
|
|
1773
|
+
* PRD-050d (d-AC-7) — "Roll back": restore the pre-migration Hivemind backup (`POST
|
|
1774
|
+
* /setup/migrate-from-hivemind/rollback`). Offered when `/setup/state` reports a NON-TERMINAL
|
|
1775
|
+
* `migration.phase` (an interrupted migration). Degrades to {@link FAILED_SETUP_MIGRATE_ROLLBACK} on
|
|
1776
|
+
* a non-2xx / network failure (never a throw).
|
|
1777
|
+
*/
|
|
1778
|
+
rollbackMigration(): Promise<SetupMigrateRollbackWire>;
|
|
1779
|
+
/**
|
|
1780
|
+
* PRD-049e (49e-AC-1) — list the orgs the user has access to (`GET /api/diagnostics/scope/orgs`).
|
|
1781
|
+
* Privilege-scoped by the daemon's token (`GET /organizations`); nothing the user lacks access to
|
|
1782
|
+
* appears. A failed/absent/non-local (404) read degrades to `[]` (the switcher shows an empty
|
|
1783
|
+
* state), never a throw. No token rides the body.
|
|
1784
|
+
*/
|
|
1785
|
+
scopeOrgs(): Promise<ScopeOrgWire[]>;
|
|
1786
|
+
/**
|
|
1787
|
+
* PRD-049e (49e-AC-1 / 49e-AC-3) — list a given org's workspaces
|
|
1788
|
+
* (`GET /api/diagnostics/scope/workspaces?org=<id>`). When `org` differs from the daemon's
|
|
1789
|
+
* credential org, the daemon RE-MINTS the org-bound token (PRD-011) BEFORE enumerating. Returns the
|
|
1790
|
+
* full body (`{ workspaces, org, reminted }`) so the caller can observe the re-mint. A failed/absent
|
|
1791
|
+
* read degrades to an empty workspace list, never a throw.
|
|
1792
|
+
*/
|
|
1793
|
+
scopeWorkspaces(org?: string): Promise<ScopeWorkspacesWire>;
|
|
1794
|
+
/**
|
|
1795
|
+
* PRD-049e (49e-AC-1) / PRD-059d — list the workspace's registry projects
|
|
1796
|
+
* (`GET /api/diagnostics/scope/projects`), the daemon-synced 049a `projects.json` copy (incl. the
|
|
1797
|
+
* `__unsorted__` inbox + each project's `boundLocally` bit). `opts.unbound` stamps `?unbound=1` to
|
|
1798
|
+
* filter to the IMPORTABLE set (registry-only, no local binding on this device — the 059d import
|
|
1799
|
+
* list); omitted ⇒ the full list (the Projects page splits active vs importable on `boundLocally`).
|
|
1800
|
+
* A failed/absent read degrades to `[]`, never a throw.
|
|
1801
|
+
*/
|
|
1802
|
+
scopeProjects(opts?: {
|
|
1803
|
+
unbound?: boolean;
|
|
1804
|
+
}): Promise<ScopeProjectWire[]>;
|
|
1805
|
+
/**
|
|
1806
|
+
* PRD-059b — browse a directory's immediate child DIRECTORIES (`GET /api/diagnostics/fs/browse`).
|
|
1807
|
+
* The daemon serves the dirs-only tree (a browser cannot return an absolute path), each child marked
|
|
1808
|
+
* if it is a git repo, clamped to an allowed root (home by default). `path` (when set) browses that
|
|
1809
|
+
* dir; omitted ⇒ the root. A failed/absent/non-local (404) read degrades to {@link EMPTY_BROWSE} so
|
|
1810
|
+
* the picker shows its honest empty/unavailable state (the CLI fallback — b-AC-5), never a throw.
|
|
1811
|
+
*/
|
|
1812
|
+
fsBrowse(path?: string): Promise<BrowseBodyWire>;
|
|
1813
|
+
/**
|
|
1814
|
+
* PRD-059b — bind a chosen ABSOLUTE folder to a NEW/named project (`POST /api/diagnostics/projects/bind`).
|
|
1815
|
+
* `name` (when set) is the explicit project name; omitted ⇒ the daemon's CLI-identical suggestion
|
|
1816
|
+
* (git remote repo, else basename). Returns the `{ bound, path, projectId, error? }` ack; degrades
|
|
1817
|
+
* to {@link FAILED_BIND_ACK} on a non-2xx / network failure so the caller surfaces an honest error.
|
|
1818
|
+
*/
|
|
1819
|
+
bindProject(input: {
|
|
1820
|
+
path: string;
|
|
1821
|
+
name?: string;
|
|
1822
|
+
}): Promise<BindAckWire>;
|
|
1823
|
+
/**
|
|
1824
|
+
* PRD-059d — bind a chosen ABSOLUTE folder to an EXISTING registry project_id
|
|
1825
|
+
* (`POST /api/diagnostics/projects/bind-existing`) — the cross-device import. Returns the bind ack;
|
|
1826
|
+
* degrades to {@link FAILED_BIND_ACK} on failure. The existing project keeps its registry remote.
|
|
1827
|
+
*/
|
|
1828
|
+
bindExistingProject(input: {
|
|
1829
|
+
path: string;
|
|
1830
|
+
projectId: string;
|
|
1831
|
+
}): Promise<BindAckWire>;
|
|
1832
|
+
/**
|
|
1833
|
+
* PRD-059c — remove the LOCAL folder binding for `path` (`POST /api/diagnostics/projects/unbind`).
|
|
1834
|
+
* Capture stops for that folder; the registry project + its existing data are UNTOUCHED. Returns the
|
|
1835
|
+
* `{ unbound, path }` ack; degrades to {@link FAILED_UNBIND_ACK} on a non-2xx / network failure.
|
|
1836
|
+
*/
|
|
1837
|
+
unbindProject(input: {
|
|
1838
|
+
path: string;
|
|
1839
|
+
}): Promise<UnbindAckWire>;
|
|
1840
|
+
/**
|
|
1841
|
+
* IRD-122 (122-AC-1/122-AC-2) — persist an ORG switch (`POST /api/diagnostics/scope/org-switch`).
|
|
1842
|
+
* The daemon re-mints a fresh org-bound token (PRD-011) and saves it + the org to the shared
|
|
1843
|
+
* credential — the SAME mechanic as `honeycomb org switch`, so `whoami` reflects it immediately. The
|
|
1844
|
+
* ack carries the now-active org + `reminted` (NO token). Degrades to {@link FAILED_ORG_SWITCH_ACK}
|
|
1845
|
+
* on a non-2xx / network failure so the switcher surfaces an honest "could not switch" (never a no-op).
|
|
1846
|
+
*/
|
|
1847
|
+
switchOrg(org: string): Promise<OrgSwitchAckWire>;
|
|
1848
|
+
/**
|
|
1849
|
+
* IRD-122 — persist a WORKSPACE switch (`POST /api/diagnostics/scope/workspace-switch`). Writes only
|
|
1850
|
+
* the shared credential's workspace id (NO re-mint — the workspace resolves server-side), exactly as
|
|
1851
|
+
* `honeycomb workspace switch` does. Degrades to {@link FAILED_WORKSPACE_SWITCH_ACK} on failure.
|
|
1852
|
+
*/
|
|
1853
|
+
switchWorkspace(workspace: string): Promise<WorkspaceSwitchAckWire>;
|
|
1854
|
+
}
|
|
1855
|
+
/** The empty/zero KPIs the UI shows before the first load resolves (or on failure). */
|
|
1856
|
+
export declare const EMPTY_KPIS: KpisWire;
|
|
1857
|
+
/** The empty settings the header shows before the first load resolves. */
|
|
1858
|
+
export declare const EMPTY_SETTINGS: SettingsWire;
|
|
1859
|
+
/** The empty graph (renders the kit's "no graph built" empty-state). */
|
|
1860
|
+
export declare const EMPTY_GRAPH: GraphWire;
|
|
1861
|
+
/**
|
|
1862
|
+
* The client-side render cap (the graph memory cap — memory-aware). The daemon already bounds the
|
|
1863
|
+
* codebase graph (`GET /api/graph` ships ≤ ~750 nodes), but this is the shared defense-in-depth backstop
|
|
1864
|
+
* so NO consumer mounts an unbounded number of SVG node groups, whatever the source (a large memory
|
|
1865
|
+
* graph, an older uncapped daemon, a future endpoint). Set above the daemon budget so the daemon's cap
|
|
1866
|
+
* normally governs and this only catches outliers. Single source for both the full Graph page and the
|
|
1867
|
+
* mini-widget so the policy can never drift between them.
|
|
1868
|
+
*/
|
|
1869
|
+
export declare const MAX_RENDER_NODES = 1500;
|
|
1870
|
+
/**
|
|
1871
|
+
* The companion EDGE cap. Nodes are `<g>` groups but edges are `<line>` elements — a dense graph under
|
|
1872
|
+
* the node cap can still carry hundreds of thousands of edges and lock up layout/SVG. So the helper
|
|
1873
|
+
* bounds edges too. Sized so nodes+edges together stay a few thousand SVG elements (well within budget).
|
|
1874
|
+
*/
|
|
1875
|
+
export declare const MAX_RENDER_EDGES = 5000;
|
|
1876
|
+
/**
|
|
1877
|
+
* Bound a graph to {@link MAX_RENDER_NODES}-ish nodes AND {@link MAX_RENDER_EDGES} edges for rendering
|
|
1878
|
+
* (the shared cap helper). Within BOTH limits → returned unchanged (same ref, so a memoized layout is
|
|
1879
|
+
* not invalidated). Over EITHER → the first `limit` nodes plus at most `MAX_RENDER_EDGES` of the edges
|
|
1880
|
+
* whose both endpoints survive, with `capped:true`. Capping edges as well as nodes is what makes this a
|
|
1881
|
+
* real backstop: a dense graph (or an old uncapped daemon) can no longer flood the DOM with `<line>`s
|
|
1882
|
+
* even when the node count is bounded. Pure — order is whatever the caller already settled (the daemon
|
|
1883
|
+
* ships its bounded set importance-ranked, so "first N" here is already the meaningful head).
|
|
1884
|
+
*/
|
|
1885
|
+
export declare function capGraphForRender(graph: GraphWire, limit: number): {
|
|
1886
|
+
graph: GraphWire;
|
|
1887
|
+
capped: boolean;
|
|
1888
|
+
};
|
|
1889
|
+
/** The empty log-history page the table shows before the first load (or on failure / unavailable store). */
|
|
1890
|
+
export declare const EMPTY_LOGS_HISTORY: LogsHistoryWire;
|
|
1891
|
+
/** The empty turns-history page the Turns section shows before the first load (or on failure). */
|
|
1892
|
+
export declare const EMPTY_TURNS_HISTORY: TurnsHistoryWire;
|
|
1893
|
+
/**
|
|
1894
|
+
* Build the `/api/logs/history` query string from the SET filters only (an undefined filter is
|
|
1895
|
+
* omitted so the daemon applies its default). Every value is `encodeURIComponent`-escaped so a
|
|
1896
|
+
* path/org/cursor with special characters is a safe single query value (never a query injection).
|
|
1897
|
+
*/
|
|
1898
|
+
export declare function buildHistoryQueryString(filters: LogsHistoryFilters): string;
|
|
1899
|
+
/**
|
|
1900
|
+
* Build the typed wire client (AC-2..AC-6). The `origin` is prefixed onto every path so the
|
|
1901
|
+
* same app works same-origin (served by the host) or against an explicit daemon URL; the
|
|
1902
|
+
* `fetchImpl` is injected so a unit test drives the app with a mocked fetch and no live
|
|
1903
|
+
* network (the test contract). No method ever throws — every failure degrades to an empty
|
|
1904
|
+
* value so the UI shows an honest empty state instead of crashing.
|
|
1905
|
+
*/
|
|
1906
|
+
export declare function createWireClient(options?: WireClientOptions): WireClient;
|
|
1907
|
+
/**
|
|
1908
|
+
* PRD-042c — parse one SSE `event: "log"` frame's `data` payload (a JSON-stringified
|
|
1909
|
+
* {@link RequestLogRecord}) into a validated {@link LogRecordWire}, or `null` on any malformed /
|
|
1910
|
+
* non-JSON / shape-mismatch frame. Validated through the SAME {@link LogRecordSchema} the snapshot
|
|
1911
|
+
* uses, so the SSE tail and the backfill agree on the shape and a bad frame is DROPPED (never thrown
|
|
1912
|
+
* into React). Exported so the page can drive the follow-handler deterministically in tests without a
|
|
1913
|
+
* live EventSource. No secret rides a record by construction (logger.ts).
|
|
1914
|
+
*/
|
|
1915
|
+
export declare function parseLogRecordEvent(data: unknown): LogRecordWire | null;
|
|
1916
|
+
/**
|
|
1917
|
+
* Format one `/api/logs` record into a single mono log line for the LiveLog panel. The
|
|
1918
|
+
* record carries NO token/secret/header (the logger redacts by construction); this
|
|
1919
|
+
* formatter introduces none either — it renders only time + method + path + status (AC-4).
|
|
1920
|
+
*/
|
|
1921
|
+
export declare function formatLogLine(r: LogRecordWire): string;
|
|
1922
|
+
/**
|
|
1923
|
+
* PRD-042c — the `/api/logs` path prefix the Sync activity feed filters on. The Sync action POSTs
|
|
1924
|
+
* land on `/api/diagnostics/sync/{promote,pull,demote,enable,disable}`, and the daemon's
|
|
1925
|
+
* request-logging middleware records EACH (method + path + status, no secret) into the same
|
|
1926
|
+
* `/api/logs` ring buffer the feed reads. Filtering on this prefix yields exactly the sync events
|
|
1927
|
+
* (publish/pull/tombstone), newest first, with no parallel event store (D-6).
|
|
1928
|
+
*/
|
|
1929
|
+
export declare const SYNC_ACTIVITY_PATH: "/api/diagnostics/sync/";
|
|
1930
|
+
/** True iff a `/api/logs` record is a Sync action event (its path is under {@link SYNC_ACTIVITY_PATH}). */
|
|
1931
|
+
export declare function isSyncActivityRecord(r: LogRecordWire): boolean;
|
|
1932
|
+
/**
|
|
1933
|
+
* PRD-042c — the human action label for a Sync activity record's path (`promote` → "published",
|
|
1934
|
+
* `pull` → "pulled", `demote` → "tombstoned"). The status code drives the success/failure flavor at
|
|
1935
|
+
* the render site. No secret is in a record (logger.ts), so the formatted line is safe to render.
|
|
1936
|
+
*/
|
|
1937
|
+
export declare function syncActivityVerb(r: LogRecordWire): string;
|