@oxy-hq/sdk 2.3.0 → 2.4.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/README.md +40 -0
- package/dist/index.cjs +21 -2148
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -621
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -621
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2102
- package/dist/index.mjs.map +1 -1
- package/dist/react-B7Blpmt7.cjs +2385 -0
- package/dist/react-B7Blpmt7.cjs.map +1 -0
- package/dist/react-BLsczFL4.d.cts +646 -0
- package/dist/react-BLsczFL4.d.cts.map +1 -0
- package/dist/react-BLsczFL4.d.mts +646 -0
- package/dist/react-BLsczFL4.d.mts.map +1 -0
- package/dist/react-DArzs6_l.mjs +2238 -0
- package/dist/react-DArzs6_l.mjs.map +1 -0
- package/dist/shell.cjs +2091 -0
- package/dist/shell.cjs.map +1 -0
- package/dist/shell.css +1187 -0
- package/dist/shell.d.cts +337 -0
- package/dist/shell.d.cts.map +1 -0
- package/dist/shell.d.mts +337 -0
- package/dist/shell.d.mts.map +1 -0
- package/dist/shell.mjs +2071 -0
- package/dist/shell.mjs.map +1 -0
- package/package.json +26 -3
package/dist/shell.d.cts
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
|
|
2
|
+
import { a as AppFetcher, n as AgentRunEvent } from "./react-BLsczFL4.cjs";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
//#region src/shell/AnswerChart.d.ts
|
|
6
|
+
interface ChartBlockConfig {
|
|
7
|
+
chart_type: "line_chart" | "bar_chart" | "pie_chart" | "table";
|
|
8
|
+
x?: string;
|
|
9
|
+
y?: string;
|
|
10
|
+
series?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
value?: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
x_axis_label?: string;
|
|
15
|
+
y_axis_label?: string;
|
|
16
|
+
}
|
|
17
|
+
interface ChartBlock {
|
|
18
|
+
config: ChartBlockConfig;
|
|
19
|
+
columns: string[];
|
|
20
|
+
rows: unknown[][];
|
|
21
|
+
}
|
|
22
|
+
interface AnswerChartProps {
|
|
23
|
+
block: ChartBlock;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Renders one `chart_rendered` block. Uses ECharts (interactive, matching
|
|
27
|
+
* the main web-app) when the host app has it installed; otherwise falls
|
|
28
|
+
* back to a dependency-free SVG render. Table type always uses SVG. */
|
|
29
|
+
declare function AnswerChart({ block, className }: AnswerChartProps): React.JSX.Element;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/shell/AskDock.d.ts
|
|
32
|
+
interface AskDockProps {
|
|
33
|
+
/** Agent the panel asks (the app manifest's `ask.agent`). */
|
|
34
|
+
agentId: string;
|
|
35
|
+
/** Workspace display name for the composer placeholder. */
|
|
36
|
+
workspaceName?: string;
|
|
37
|
+
/** Suggested-question chips shown before the first ask. */
|
|
38
|
+
suggestions?: string[];
|
|
39
|
+
/** "Open chat in Oxygen" header link target (product Chat surface). */
|
|
40
|
+
threadsHref?: string;
|
|
41
|
+
open: boolean;
|
|
42
|
+
onClose: () => void;
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The Ask Oxygen drawer. Keep it mounted and toggle `open` — the
|
|
47
|
+
* transcript survives close/reopen, matching the web-app dock.
|
|
48
|
+
*/
|
|
49
|
+
declare function AskDock({ agentId, workspaceName, suggestions, threadsHref, open, onClose, className }: AskDockProps): React.JSX.Element;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/shell/logoUrl.d.ts
|
|
52
|
+
/** URL of the workspace logo endpoint (org-uploaded logo, falling back to
|
|
53
|
+
* the code-first file). Consumers render an `<img>` and fall back on error.
|
|
54
|
+
* `apiBaseUrl` is the API root (e.g. `"/api"` same-origin, or an absolute
|
|
55
|
+
* base in dev); pass `version` (the org's `updated_at`) to bust the cache
|
|
56
|
+
* after an upload/remove. */
|
|
57
|
+
declare const workspaceLogoUrl: (apiBaseUrl: string, workspaceId: string, version?: string) => string;
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/shell/marks.d.ts
|
|
60
|
+
/** The Oxygen "O" glyph path, in a 0 0 44 44 viewBox, used by `OxyMark`. */
|
|
61
|
+
declare const OXY_MARK_PATH = "M38.4 22C39.2837 22 40.0074 22.7178 39.9289 23.5979C39.6619 26.5942 38.6471 29.485 36.9665 32.0003C34.9886 34.9603 32.1774 37.2674 28.8883 38.6298C25.5992 39.9922 21.98 40.3487 18.4884 39.6541C14.9967 38.9596 11.7894 37.2453 9.27209 34.7279C6.75474 32.2106 5.04041 29.0033 4.34587 25.5116C3.65134 22.02 4.0078 18.4008 5.37018 15.1117C6.73255 11.8226 9.03966 9.0114 11.9997 7.03353C14.515 5.35287 17.4058 4.33807 20.4021 4.07104C21.2822 3.9926 22 4.71633 22 5.59998L22 11.2C22 12.0837 22.7163 12.8 23.6 12.8H29.2C30.0837 12.8 30.8 12.0837 30.8 11.2V5.6C30.8 4.71634 31.5163 4 32.4 4H38.4C39.2836 4 40 4.71634 40 5.6V11.6C40 12.4837 39.2836 13.2 38.4 13.2H32.8C31.9163 13.2 31.2 13.9163 31.2 14.8V20.4C31.2 21.2837 31.9163 22 32.8 22L38.4 22ZM23.6 22C22.7163 22 22 21.2837 22 20.4L22 14.8371C22 13.9534 21.2778 13.2223 20.4089 13.3827C19.2427 13.5981 18.1268 14.0489 17.1316 14.7139C15.6905 15.6768 14.5674 17.0454 13.9041 18.6466C13.2409 20.2478 13.0674 22.0097 13.4055 23.7095C13.7436 25.4094 14.5782 26.9708 15.8037 28.1963C17.0292 29.4218 18.5906 30.2564 20.2904 30.5945C21.9903 30.9326 23.7522 30.7591 25.3534 30.0959C26.9546 29.4326 28.3232 28.3095 29.2861 26.8684C29.9511 25.8732 30.4019 24.7573 30.6172 23.5911C30.7777 22.7222 30.0466 22 29.1629 22L23.6 22Z";
|
|
62
|
+
/** The Oxygen "O" mark as an inline SVG that inherits `currentColor`, so it
|
|
63
|
+
* reads correctly on any surface in light or dark mode. */
|
|
64
|
+
declare function OxyMark({ className }: {
|
|
65
|
+
className?: string;
|
|
66
|
+
}): import("react").JSX.Element;
|
|
67
|
+
/** The Oxygen Factory mark (three-shard glyph) as an inline SVG in
|
|
68
|
+
* `currentColor`, so it follows the shell foreground in either theme.
|
|
69
|
+
* (The web-app's asset files are fixed-color; this inline variant frees
|
|
70
|
+
* external bundles from carrying those assets.) Decorative — the rail
|
|
71
|
+
* button supplies the "Oxygen Factory" aria-label. */
|
|
72
|
+
declare function OxygenFactoryMark({ className }: {
|
|
73
|
+
className?: string;
|
|
74
|
+
}): import("react").JSX.Element;
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/shell/OxyShell.d.ts
|
|
77
|
+
interface OxyShellProps {
|
|
78
|
+
children: ReactNode;
|
|
79
|
+
/** Breadcrumb page label; defaults to this app's registered name. */
|
|
80
|
+
pageLabel?: string;
|
|
81
|
+
/** Replace the top bar's left side (the default workspace/page
|
|
82
|
+
* breadcrumb) with the app's own brand/header content. Host-provided
|
|
83
|
+
* slots keep rendering even when the shell bootstrap is unavailable,
|
|
84
|
+
* so the app never loses its header by adopting the shell. */
|
|
85
|
+
topBarLeft?: ReactNode;
|
|
86
|
+
/** Extra right-side top bar content, rendered after the status cluster
|
|
87
|
+
* (Sys · clock) and before the Ask Oxygen button. */
|
|
88
|
+
topBarExtra?: ReactNode;
|
|
89
|
+
/** Rail bottom slot content, rendered above the built-in Settings
|
|
90
|
+
* entry (the account cluster in the main web-app). */
|
|
91
|
+
railBottom?: ReactNode;
|
|
92
|
+
/** Drop the top bar and keep only the rail. */
|
|
93
|
+
hideTopBar?: boolean;
|
|
94
|
+
/** Bind ⌘K / Ctrl+K to toggle the Ask dock (default true). Set false
|
|
95
|
+
* when the host app owns that shortcut; the top-bar button still works. */
|
|
96
|
+
askHotkey?: boolean;
|
|
97
|
+
/** Origin of the Oxygen product (e.g. `https://app.oxygen-hq.com`).
|
|
98
|
+
* shell-context returns product links as relative paths, which resolve
|
|
99
|
+
* correctly when oxy serves the bundle (production, org subdomain). In
|
|
100
|
+
* local dev the bundle runs on its own Vite origin, so those paths would
|
|
101
|
+
* resolve to the app's origin, not oxy's — set this to the oxy origin
|
|
102
|
+
* and the shell rewrites Home / Chat / Settings / app links to absolute
|
|
103
|
+
* URLs. Leave unset in production. */
|
|
104
|
+
productBaseUrl?: string;
|
|
105
|
+
className?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The workspace chrome around a customer app: icon rail + universal top bar
|
|
109
|
+
* + content column — visually identical to the main web-app shell.
|
|
110
|
+
*/
|
|
111
|
+
declare function OxyShell({ children, pageLabel, topBarLeft, topBarExtra, railBottom, hideTopBar, askHotkey, productBaseUrl, className }: OxyShellProps): import("react").JSX.Element;
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/shell/trace.d.ts
|
|
114
|
+
type TraceStepStatus = "running" | "done" | "failed" | "suspended";
|
|
115
|
+
interface TraceItem {
|
|
116
|
+
id: string;
|
|
117
|
+
kind: "tool" | "sql" | "note" | "thinking";
|
|
118
|
+
label: string;
|
|
119
|
+
/** Muted inline preview of the tool input / query intent. */
|
|
120
|
+
preview?: string;
|
|
121
|
+
/** Right-aligned detail, e.g. "22 rows · 1.4s". */
|
|
122
|
+
detail?: string;
|
|
123
|
+
/** Body text (thinking items) — rendered as a wrapped paragraph. */
|
|
124
|
+
text?: string;
|
|
125
|
+
/** Full tool input / SQL, pretty-printed — the expandable detail body. */
|
|
126
|
+
input?: string;
|
|
127
|
+
/** Full tool output / result summary, pretty-printed. */
|
|
128
|
+
output?: string;
|
|
129
|
+
error?: boolean;
|
|
130
|
+
running?: boolean;
|
|
131
|
+
}
|
|
132
|
+
interface TraceStep {
|
|
133
|
+
id: string;
|
|
134
|
+
label: string;
|
|
135
|
+
summary?: string;
|
|
136
|
+
status: TraceStepStatus;
|
|
137
|
+
items: TraceItem[];
|
|
138
|
+
}
|
|
139
|
+
/** Fold raw SSE events into display steps. Pure — safe to re-run on every
|
|
140
|
+
* render over the accumulated event array. */
|
|
141
|
+
declare function buildTraceSteps(events: AgentRunEvent[]): TraceStep[];
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region src/shell/ReasoningTrace.d.ts
|
|
144
|
+
interface ReasoningTraceProps {
|
|
145
|
+
steps: TraceStep[];
|
|
146
|
+
/** True while the run is still streaming — keeps the trace expanded. */
|
|
147
|
+
streaming?: boolean;
|
|
148
|
+
/** Header meta from `aggregateLlmStats` (LLM call count + total time). */
|
|
149
|
+
llm?: {
|
|
150
|
+
calls: number;
|
|
151
|
+
totalMs: number;
|
|
152
|
+
};
|
|
153
|
+
className?: string;
|
|
154
|
+
}
|
|
155
|
+
/** Renders nothing when there are no steps (runs whose stream carries no
|
|
156
|
+
* step events degrade to the plain answer, same as before). */
|
|
157
|
+
declare function ReasoningTrace({ steps, streaming, llm, className }: ReasoningTraceProps): import("react").JSX.Element | null;
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/shell/ShellRail.d.ts
|
|
160
|
+
/** One rail entry. Provide `imageUrl` (custom app mark, falls back to
|
|
161
|
+
* `letter` on load error), `icon` (any SVG node), or `letter`.
|
|
162
|
+
* `href` renders a real anchor (full-page nav — custom apps live outside
|
|
163
|
+
* the SPA); `onSelect` renders a button (SPA nav, wired by the caller). */
|
|
164
|
+
type RailItem = {
|
|
165
|
+
key: string;
|
|
166
|
+
label: string;
|
|
167
|
+
/** Hover-tooltip text; defaults to `label`. Use for a richer description
|
|
168
|
+
* while keeping `label` short for the aria-label. */
|
|
169
|
+
tooltip?: string;
|
|
170
|
+
testId?: string;
|
|
171
|
+
active?: boolean;
|
|
172
|
+
icon?: ReactNode;
|
|
173
|
+
letter?: string;
|
|
174
|
+
imageUrl?: string;
|
|
175
|
+
href?: string;
|
|
176
|
+
onSelect?: () => void;
|
|
177
|
+
};
|
|
178
|
+
/** The icon rail. `groups` are the conceptual sections (HQ · Apps ·
|
|
179
|
+
* Intelligence), rendered top-down with a hairline divider between them.
|
|
180
|
+
* `footerItems` pin to the bottom of the scroll area as a distinct
|
|
181
|
+
* "system" zone (Oxygen Factory), above the `bottom` account slot
|
|
182
|
+
* (workspace switch · user menu — injected by the host app). */
|
|
183
|
+
declare function ShellRail({ top, groups, footerItems, bottom, className }: {
|
|
184
|
+
top?: ReactNode;
|
|
185
|
+
groups: RailItem[][];
|
|
186
|
+
footerItems?: RailItem[];
|
|
187
|
+
bottom?: ReactNode;
|
|
188
|
+
className?: string;
|
|
189
|
+
}): import("react").JSX.Element;
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/shell/shellContext.d.ts
|
|
192
|
+
interface ShellContextApp {
|
|
193
|
+
id: string;
|
|
194
|
+
name: string;
|
|
195
|
+
slug: string;
|
|
196
|
+
/** Ready-to-navigate URL (relative on the same host, absolute across hosts). */
|
|
197
|
+
url: string;
|
|
198
|
+
icon_url?: string | null;
|
|
199
|
+
/** Agent ref the app's Ask Oxygen panel binds to (manifest `ask.agent`).
|
|
200
|
+
* Absent → the shell hides the Ask surface for this app. */
|
|
201
|
+
default_agent?: string | null;
|
|
202
|
+
/** Composer chips for the Ask panel (manifest `ask.suggestedQuestions`). */
|
|
203
|
+
suggested_questions?: string[];
|
|
204
|
+
}
|
|
205
|
+
interface ShellContextData {
|
|
206
|
+
workspace: {
|
|
207
|
+
id: string;
|
|
208
|
+
name: string;
|
|
209
|
+
};
|
|
210
|
+
org: {
|
|
211
|
+
id: string;
|
|
212
|
+
slug: string;
|
|
213
|
+
name: string;
|
|
214
|
+
};
|
|
215
|
+
/** Workspace logo endpoint URL, or null when no logo is configured. */
|
|
216
|
+
logo_url: string | null;
|
|
217
|
+
/** Published custom apps in this workspace, including the current one. */
|
|
218
|
+
apps: ShellContextApp[];
|
|
219
|
+
/** Product-surface navigation targets, host-aware. `settings` opens the
|
|
220
|
+
* Unified Settings Dialog via the SPA's `?settings=<section>` deep link
|
|
221
|
+
* (optional: absent on servers older than the link). */
|
|
222
|
+
links: {
|
|
223
|
+
home: string;
|
|
224
|
+
threads: string;
|
|
225
|
+
settings?: string;
|
|
226
|
+
};
|
|
227
|
+
/** Viewer display identity; null on unauthenticated/local modes. */
|
|
228
|
+
user: {
|
|
229
|
+
name: string;
|
|
230
|
+
email: string;
|
|
231
|
+
picture?: string | null;
|
|
232
|
+
} | null;
|
|
233
|
+
}
|
|
234
|
+
interface UseShellContextResult {
|
|
235
|
+
data: ShellContextData | null;
|
|
236
|
+
loading: boolean;
|
|
237
|
+
error: Error | null;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Fetch the shell bootstrap payload for the current customer app. Must be
|
|
241
|
+
* called inside `<OxyAppProvider>`. Failure is non-fatal by design: the
|
|
242
|
+
* shell degrades to chrome-less rendering (older servers don't have the
|
|
243
|
+
* endpoint), so errors are surfaced on the result, never thrown.
|
|
244
|
+
*/
|
|
245
|
+
declare function useShellContext(): UseShellContextResult;
|
|
246
|
+
//#endregion
|
|
247
|
+
//#region src/shell/Tooltip.d.ts
|
|
248
|
+
/**
|
|
249
|
+
* Hover tooltip for shell controls. Mirrors the web-app's Radix tooltip
|
|
250
|
+
* (zero delay, side arrow, `--zinc-200`/muted surface) but portals into the
|
|
251
|
+
* shell scope so the namespaced tokens and dark-mode class reach it.
|
|
252
|
+
*/
|
|
253
|
+
declare function ShellTooltip({ content, side, children }: {
|
|
254
|
+
content: React.ReactNode;
|
|
255
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
256
|
+
children: React.ReactNode;
|
|
257
|
+
}): React.JSX.Element;
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region src/shell/TopBar.d.ts
|
|
260
|
+
/** Frame only: left content + right cluster. Mirrors the rail's
|
|
261
|
+
* `--sidebar-background` so the two read as one 48px-tall frame. */
|
|
262
|
+
declare function TopBar({ left, right, className }: {
|
|
263
|
+
left?: ReactNode;
|
|
264
|
+
right?: ReactNode;
|
|
265
|
+
className?: string;
|
|
266
|
+
}): import("react").JSX.Element;
|
|
267
|
+
/**
|
|
268
|
+
* "<Workspace> / <Page>" — e.g. "Poke House / HQ". The workspace name links
|
|
269
|
+
* back to the HQ home; pass `onHomeNavigate` to intercept for SPA routing
|
|
270
|
+
* (the anchor still carries `homeHref` for middle-click/new-tab).
|
|
271
|
+
*/
|
|
272
|
+
declare function Breadcrumb({ workspaceLabel, pageLabel, homeHref, onHomeNavigate }: {
|
|
273
|
+
workspaceLabel: string;
|
|
274
|
+
pageLabel: string;
|
|
275
|
+
homeHref: string;
|
|
276
|
+
onHomeNavigate?: () => void;
|
|
277
|
+
}): import("react").JSX.Element;
|
|
278
|
+
/**
|
|
279
|
+
* Universal "Sys: Connected" indicator — a pulsing green dot when the browser
|
|
280
|
+
* is online, red when offline. Presentational connectivity signal; a real
|
|
281
|
+
* backend health ping can replace `useOnlineStatus` later without touching
|
|
282
|
+
* consumers.
|
|
283
|
+
*/
|
|
284
|
+
declare function SystemIndicator(): import("react").JSX.Element;
|
|
285
|
+
/**
|
|
286
|
+
* Live clock in the given IANA timezone (viewer-local when omitted or
|
|
287
|
+
* invalid). Updates each half-minute (minute precision), pausing while the
|
|
288
|
+
* tab is hidden.
|
|
289
|
+
*/
|
|
290
|
+
declare function WorkspaceClock({ timezone }: {
|
|
291
|
+
timezone?: string;
|
|
292
|
+
}): import("react").JSX.Element;
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region src/shell/threadHistory.d.ts
|
|
295
|
+
interface ThreadSummary {
|
|
296
|
+
id: string;
|
|
297
|
+
title: string;
|
|
298
|
+
created_at: string;
|
|
299
|
+
}
|
|
300
|
+
interface TranscriptTurn {
|
|
301
|
+
question: string;
|
|
302
|
+
events: AgentRunEvent[];
|
|
303
|
+
}
|
|
304
|
+
interface ThreadTranscript {
|
|
305
|
+
title: string;
|
|
306
|
+
turns: TranscriptTurn[];
|
|
307
|
+
}
|
|
308
|
+
interface UseThreadHistoryResult {
|
|
309
|
+
threads: ThreadSummary[];
|
|
310
|
+
loading: boolean;
|
|
311
|
+
error: Error | null;
|
|
312
|
+
/** Re-fetch the list (call after a new chat is archived server-side). */
|
|
313
|
+
refetch: () => void;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* List the viewer's persistent chat threads for the current project.
|
|
317
|
+
* Non-fatal on failure (older server / no session): returns an empty
|
|
318
|
+
* list so the dock falls back to session-only history.
|
|
319
|
+
*/
|
|
320
|
+
declare function useThreadHistory(): UseThreadHistoryResult;
|
|
321
|
+
/**
|
|
322
|
+
* Fetch a thread's transcript for restore. Throws on failure so the
|
|
323
|
+
* caller can surface a toast / fall back.
|
|
324
|
+
*/
|
|
325
|
+
declare function fetchThreadTranscript(fetcher: AppFetcher, projectId: string, threadId: string): Promise<ThreadTranscript>;
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/shell/WorkspaceTile.d.ts
|
|
328
|
+
/** Rail-top workspace identity: the org/code-first logo when present, the
|
|
329
|
+
* name initial otherwise. Pure branding — switching workspaces is the host
|
|
330
|
+
* app's concern (the rail `bottom` slot). */
|
|
331
|
+
declare function WorkspaceTile({ name, logoUrl }: {
|
|
332
|
+
name: string;
|
|
333
|
+
logoUrl?: string;
|
|
334
|
+
}): import("react").JSX.Element;
|
|
335
|
+
//#endregion
|
|
336
|
+
export { AnswerChart, type AnswerChartProps, AskDock, type AskDockProps, Breadcrumb, type ChartBlock, type ChartBlockConfig, OXY_MARK_PATH, OxyMark, OxyShell, type OxyShellProps, OxygenFactoryMark, type RailItem, ReasoningTrace, type ReasoningTraceProps, type ShellContextApp, type ShellContextData, ShellRail, ShellTooltip, SystemIndicator, type ThreadSummary, type ThreadTranscript, TopBar, type TraceItem, type TraceStep, type TraceStepStatus, type TranscriptTurn, type UseShellContextResult, type UseThreadHistoryResult, WorkspaceClock, WorkspaceTile, buildTraceSteps, fetchThreadTranscript, useShellContext, useThreadHistory, workspaceLogoUrl };
|
|
337
|
+
//# sourceMappingURL=shell.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.d.cts","names":[],"sources":["../src/shell/AnswerChart.tsx","../src/shell/AskDock.tsx","../src/shell/logoUrl.ts","../src/shell/marks.tsx","../src/shell/OxyShell.tsx","../src/shell/trace.ts","../src/shell/ReasoningTrace.tsx","../src/shell/ShellRail.tsx","../src/shell/shellContext.ts","../src/shell/Tooltip.tsx","../src/shell/TopBar.tsx","../src/shell/threadHistory.ts","../src/shell/WorkspaceTile.tsx"],"mappings":";;;;;UAYiB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,QAAQ;EACR;EACA;;UA8ce;EACf,OAAO;EACP;;;;;iBAMc,cAAc,OAAO,aAAa,mBAAgB,MAAA,IAAA;;;UC/WjD;;EAEf;;EAEA;;EAEA;;EAEA;EACA;EACA;EACA;;;;;;iBA6Cc,UACd,SACA,eACA,aACA,aACA,MACA,SACA,aACC,eAAY,MAAA,IAAA;;;;;;;;cC7LF,mBAAgB,oBAAsB,qBAAqB;;;;cCA3D;;;iBAKG,UAAU;EAAe;oBAAoB,IAAA;;;;;;iBAyB7C,oBAAoB;EAAe;oBAAoB,IAAA;;;UCoDtD;EACf,UAAU;;EAEV;;;;;EAKA,aAAa;;;EAGb,cAAc;;;EAGd,aAAa;;EAEb;;;EAGA;;;;;;;;EAQA;EACA;;;;;;iBAsDc,WACd,UACA,WACA,YACA,aACA,YACA,YACA,WACA,gBACA,aACC,gCAAa,IAAA;;;KCxKJ;UAEK;EACf;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA,QAAQ;EACR,OAAO;;;;iBA8IO,gBAAgB,QAAQ,kBAAkB;;;UCvDzC;EACf,OAAO;;EAEP;;EAEA;IAAQ;IAAe;;EACvB;;;;iBAKc,iBAAiB,OAAO,WAAmB,KAAK,aAAa,sCAAmB,IAAA;;;;;;;KCxHpF;EACV;EACA;;;EAGA;EACA;EACA;EACA,OAAO;EACP;EACA;EACA;EACA;;;;;;;iBAuDc,YACd,KACA,QACA,aACA,QACA;EAEA,MAAM;EACN,QAAQ;EACR,cAAc;EACd,SAAS;EACT;oBACD,IAAA;;;UC9EgB;EACf;EACA;EACA;;EAEA;EACA;;;EAGA;;EAEA;;UAGe;EACf;IAAa;IAAY;;EACzB;IAAO;IAAY;IAAc;;;EAEjC;;EAEA,MAAM;;;;EAIN;IAAS;IAAc;IAAiB;;;EAExC;IAAQ;IAAc;IAAe;;;UAGtB;EACf,MAAM;EACN;EACA,OAAO;;;;;;;;iBASO,mBAAmB;;;;;;;;iBC/CnB,eACd,SACA,MACA;EAEA,SAAS,MAAM;EACf;EACA,UAAU,MAAM;IACjB,MAAA,IAAA;;;;;iBCNe,SACd,MACA,OACA;EAEA,OAAO;EACP,QAAQ;EACR;oBACD,IAAA;;;;;;iBAqBe,aACd,gBACA,WACA,UACA;EAEA;EACA;EACA;EACA;oBACD,IAAA;;;;;;;iBAmDe,mCAAe,IAAA;;;;;;iBA+Bf,iBAAiB;EAAc;oBAAmB,IAAA;;;UCrHjD;EACf;EACA;EACA;;UAGe;EACf;EACA,QAAQ;;UAGO;EACf;EACA,OAAO;;UAGQ;EACf,SAAS;EACT;EACA,OAAO;;EAEP;;;;;;;iBAQc,oBAAoB;;;;;iBAyCd,sBACpB,SAAS,YACT,mBACA,mBACC,QAAQ;;;;;;iBCpFK,gBAAgB,MAAM;EAAa;EAAc;oBAAkB,IAAA"}
|
package/dist/shell.d.mts
ADDED
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
|
|
2
|
+
import { a as AppFetcher, n as AgentRunEvent } from "./react-BLsczFL4.mjs";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
//#region src/shell/AnswerChart.d.ts
|
|
6
|
+
interface ChartBlockConfig {
|
|
7
|
+
chart_type: "line_chart" | "bar_chart" | "pie_chart" | "table";
|
|
8
|
+
x?: string;
|
|
9
|
+
y?: string;
|
|
10
|
+
series?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
value?: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
x_axis_label?: string;
|
|
15
|
+
y_axis_label?: string;
|
|
16
|
+
}
|
|
17
|
+
interface ChartBlock {
|
|
18
|
+
config: ChartBlockConfig;
|
|
19
|
+
columns: string[];
|
|
20
|
+
rows: unknown[][];
|
|
21
|
+
}
|
|
22
|
+
interface AnswerChartProps {
|
|
23
|
+
block: ChartBlock;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Renders one `chart_rendered` block. Uses ECharts (interactive, matching
|
|
27
|
+
* the main web-app) when the host app has it installed; otherwise falls
|
|
28
|
+
* back to a dependency-free SVG render. Table type always uses SVG. */
|
|
29
|
+
declare function AnswerChart({ block, className }: AnswerChartProps): React.JSX.Element;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/shell/AskDock.d.ts
|
|
32
|
+
interface AskDockProps {
|
|
33
|
+
/** Agent the panel asks (the app manifest's `ask.agent`). */
|
|
34
|
+
agentId: string;
|
|
35
|
+
/** Workspace display name for the composer placeholder. */
|
|
36
|
+
workspaceName?: string;
|
|
37
|
+
/** Suggested-question chips shown before the first ask. */
|
|
38
|
+
suggestions?: string[];
|
|
39
|
+
/** "Open chat in Oxygen" header link target (product Chat surface). */
|
|
40
|
+
threadsHref?: string;
|
|
41
|
+
open: boolean;
|
|
42
|
+
onClose: () => void;
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The Ask Oxygen drawer. Keep it mounted and toggle `open` — the
|
|
47
|
+
* transcript survives close/reopen, matching the web-app dock.
|
|
48
|
+
*/
|
|
49
|
+
declare function AskDock({ agentId, workspaceName, suggestions, threadsHref, open, onClose, className }: AskDockProps): React.JSX.Element;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/shell/logoUrl.d.ts
|
|
52
|
+
/** URL of the workspace logo endpoint (org-uploaded logo, falling back to
|
|
53
|
+
* the code-first file). Consumers render an `<img>` and fall back on error.
|
|
54
|
+
* `apiBaseUrl` is the API root (e.g. `"/api"` same-origin, or an absolute
|
|
55
|
+
* base in dev); pass `version` (the org's `updated_at`) to bust the cache
|
|
56
|
+
* after an upload/remove. */
|
|
57
|
+
declare const workspaceLogoUrl: (apiBaseUrl: string, workspaceId: string, version?: string) => string;
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/shell/marks.d.ts
|
|
60
|
+
/** The Oxygen "O" glyph path, in a 0 0 44 44 viewBox, used by `OxyMark`. */
|
|
61
|
+
declare const OXY_MARK_PATH = "M38.4 22C39.2837 22 40.0074 22.7178 39.9289 23.5979C39.6619 26.5942 38.6471 29.485 36.9665 32.0003C34.9886 34.9603 32.1774 37.2674 28.8883 38.6298C25.5992 39.9922 21.98 40.3487 18.4884 39.6541C14.9967 38.9596 11.7894 37.2453 9.27209 34.7279C6.75474 32.2106 5.04041 29.0033 4.34587 25.5116C3.65134 22.02 4.0078 18.4008 5.37018 15.1117C6.73255 11.8226 9.03966 9.0114 11.9997 7.03353C14.515 5.35287 17.4058 4.33807 20.4021 4.07104C21.2822 3.9926 22 4.71633 22 5.59998L22 11.2C22 12.0837 22.7163 12.8 23.6 12.8H29.2C30.0837 12.8 30.8 12.0837 30.8 11.2V5.6C30.8 4.71634 31.5163 4 32.4 4H38.4C39.2836 4 40 4.71634 40 5.6V11.6C40 12.4837 39.2836 13.2 38.4 13.2H32.8C31.9163 13.2 31.2 13.9163 31.2 14.8V20.4C31.2 21.2837 31.9163 22 32.8 22L38.4 22ZM23.6 22C22.7163 22 22 21.2837 22 20.4L22 14.8371C22 13.9534 21.2778 13.2223 20.4089 13.3827C19.2427 13.5981 18.1268 14.0489 17.1316 14.7139C15.6905 15.6768 14.5674 17.0454 13.9041 18.6466C13.2409 20.2478 13.0674 22.0097 13.4055 23.7095C13.7436 25.4094 14.5782 26.9708 15.8037 28.1963C17.0292 29.4218 18.5906 30.2564 20.2904 30.5945C21.9903 30.9326 23.7522 30.7591 25.3534 30.0959C26.9546 29.4326 28.3232 28.3095 29.2861 26.8684C29.9511 25.8732 30.4019 24.7573 30.6172 23.5911C30.7777 22.7222 30.0466 22 29.1629 22L23.6 22Z";
|
|
62
|
+
/** The Oxygen "O" mark as an inline SVG that inherits `currentColor`, so it
|
|
63
|
+
* reads correctly on any surface in light or dark mode. */
|
|
64
|
+
declare function OxyMark({ className }: {
|
|
65
|
+
className?: string;
|
|
66
|
+
}): import("react").JSX.Element;
|
|
67
|
+
/** The Oxygen Factory mark (three-shard glyph) as an inline SVG in
|
|
68
|
+
* `currentColor`, so it follows the shell foreground in either theme.
|
|
69
|
+
* (The web-app's asset files are fixed-color; this inline variant frees
|
|
70
|
+
* external bundles from carrying those assets.) Decorative — the rail
|
|
71
|
+
* button supplies the "Oxygen Factory" aria-label. */
|
|
72
|
+
declare function OxygenFactoryMark({ className }: {
|
|
73
|
+
className?: string;
|
|
74
|
+
}): import("react").JSX.Element;
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/shell/OxyShell.d.ts
|
|
77
|
+
interface OxyShellProps {
|
|
78
|
+
children: ReactNode;
|
|
79
|
+
/** Breadcrumb page label; defaults to this app's registered name. */
|
|
80
|
+
pageLabel?: string;
|
|
81
|
+
/** Replace the top bar's left side (the default workspace/page
|
|
82
|
+
* breadcrumb) with the app's own brand/header content. Host-provided
|
|
83
|
+
* slots keep rendering even when the shell bootstrap is unavailable,
|
|
84
|
+
* so the app never loses its header by adopting the shell. */
|
|
85
|
+
topBarLeft?: ReactNode;
|
|
86
|
+
/** Extra right-side top bar content, rendered after the status cluster
|
|
87
|
+
* (Sys · clock) and before the Ask Oxygen button. */
|
|
88
|
+
topBarExtra?: ReactNode;
|
|
89
|
+
/** Rail bottom slot content, rendered above the built-in Settings
|
|
90
|
+
* entry (the account cluster in the main web-app). */
|
|
91
|
+
railBottom?: ReactNode;
|
|
92
|
+
/** Drop the top bar and keep only the rail. */
|
|
93
|
+
hideTopBar?: boolean;
|
|
94
|
+
/** Bind ⌘K / Ctrl+K to toggle the Ask dock (default true). Set false
|
|
95
|
+
* when the host app owns that shortcut; the top-bar button still works. */
|
|
96
|
+
askHotkey?: boolean;
|
|
97
|
+
/** Origin of the Oxygen product (e.g. `https://app.oxygen-hq.com`).
|
|
98
|
+
* shell-context returns product links as relative paths, which resolve
|
|
99
|
+
* correctly when oxy serves the bundle (production, org subdomain). In
|
|
100
|
+
* local dev the bundle runs on its own Vite origin, so those paths would
|
|
101
|
+
* resolve to the app's origin, not oxy's — set this to the oxy origin
|
|
102
|
+
* and the shell rewrites Home / Chat / Settings / app links to absolute
|
|
103
|
+
* URLs. Leave unset in production. */
|
|
104
|
+
productBaseUrl?: string;
|
|
105
|
+
className?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The workspace chrome around a customer app: icon rail + universal top bar
|
|
109
|
+
* + content column — visually identical to the main web-app shell.
|
|
110
|
+
*/
|
|
111
|
+
declare function OxyShell({ children, pageLabel, topBarLeft, topBarExtra, railBottom, hideTopBar, askHotkey, productBaseUrl, className }: OxyShellProps): import("react").JSX.Element;
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/shell/trace.d.ts
|
|
114
|
+
type TraceStepStatus = "running" | "done" | "failed" | "suspended";
|
|
115
|
+
interface TraceItem {
|
|
116
|
+
id: string;
|
|
117
|
+
kind: "tool" | "sql" | "note" | "thinking";
|
|
118
|
+
label: string;
|
|
119
|
+
/** Muted inline preview of the tool input / query intent. */
|
|
120
|
+
preview?: string;
|
|
121
|
+
/** Right-aligned detail, e.g. "22 rows · 1.4s". */
|
|
122
|
+
detail?: string;
|
|
123
|
+
/** Body text (thinking items) — rendered as a wrapped paragraph. */
|
|
124
|
+
text?: string;
|
|
125
|
+
/** Full tool input / SQL, pretty-printed — the expandable detail body. */
|
|
126
|
+
input?: string;
|
|
127
|
+
/** Full tool output / result summary, pretty-printed. */
|
|
128
|
+
output?: string;
|
|
129
|
+
error?: boolean;
|
|
130
|
+
running?: boolean;
|
|
131
|
+
}
|
|
132
|
+
interface TraceStep {
|
|
133
|
+
id: string;
|
|
134
|
+
label: string;
|
|
135
|
+
summary?: string;
|
|
136
|
+
status: TraceStepStatus;
|
|
137
|
+
items: TraceItem[];
|
|
138
|
+
}
|
|
139
|
+
/** Fold raw SSE events into display steps. Pure — safe to re-run on every
|
|
140
|
+
* render over the accumulated event array. */
|
|
141
|
+
declare function buildTraceSteps(events: AgentRunEvent[]): TraceStep[];
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region src/shell/ReasoningTrace.d.ts
|
|
144
|
+
interface ReasoningTraceProps {
|
|
145
|
+
steps: TraceStep[];
|
|
146
|
+
/** True while the run is still streaming — keeps the trace expanded. */
|
|
147
|
+
streaming?: boolean;
|
|
148
|
+
/** Header meta from `aggregateLlmStats` (LLM call count + total time). */
|
|
149
|
+
llm?: {
|
|
150
|
+
calls: number;
|
|
151
|
+
totalMs: number;
|
|
152
|
+
};
|
|
153
|
+
className?: string;
|
|
154
|
+
}
|
|
155
|
+
/** Renders nothing when there are no steps (runs whose stream carries no
|
|
156
|
+
* step events degrade to the plain answer, same as before). */
|
|
157
|
+
declare function ReasoningTrace({ steps, streaming, llm, className }: ReasoningTraceProps): import("react").JSX.Element | null;
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/shell/ShellRail.d.ts
|
|
160
|
+
/** One rail entry. Provide `imageUrl` (custom app mark, falls back to
|
|
161
|
+
* `letter` on load error), `icon` (any SVG node), or `letter`.
|
|
162
|
+
* `href` renders a real anchor (full-page nav — custom apps live outside
|
|
163
|
+
* the SPA); `onSelect` renders a button (SPA nav, wired by the caller). */
|
|
164
|
+
type RailItem = {
|
|
165
|
+
key: string;
|
|
166
|
+
label: string;
|
|
167
|
+
/** Hover-tooltip text; defaults to `label`. Use for a richer description
|
|
168
|
+
* while keeping `label` short for the aria-label. */
|
|
169
|
+
tooltip?: string;
|
|
170
|
+
testId?: string;
|
|
171
|
+
active?: boolean;
|
|
172
|
+
icon?: ReactNode;
|
|
173
|
+
letter?: string;
|
|
174
|
+
imageUrl?: string;
|
|
175
|
+
href?: string;
|
|
176
|
+
onSelect?: () => void;
|
|
177
|
+
};
|
|
178
|
+
/** The icon rail. `groups` are the conceptual sections (HQ · Apps ·
|
|
179
|
+
* Intelligence), rendered top-down with a hairline divider between them.
|
|
180
|
+
* `footerItems` pin to the bottom of the scroll area as a distinct
|
|
181
|
+
* "system" zone (Oxygen Factory), above the `bottom` account slot
|
|
182
|
+
* (workspace switch · user menu — injected by the host app). */
|
|
183
|
+
declare function ShellRail({ top, groups, footerItems, bottom, className }: {
|
|
184
|
+
top?: ReactNode;
|
|
185
|
+
groups: RailItem[][];
|
|
186
|
+
footerItems?: RailItem[];
|
|
187
|
+
bottom?: ReactNode;
|
|
188
|
+
className?: string;
|
|
189
|
+
}): import("react").JSX.Element;
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/shell/shellContext.d.ts
|
|
192
|
+
interface ShellContextApp {
|
|
193
|
+
id: string;
|
|
194
|
+
name: string;
|
|
195
|
+
slug: string;
|
|
196
|
+
/** Ready-to-navigate URL (relative on the same host, absolute across hosts). */
|
|
197
|
+
url: string;
|
|
198
|
+
icon_url?: string | null;
|
|
199
|
+
/** Agent ref the app's Ask Oxygen panel binds to (manifest `ask.agent`).
|
|
200
|
+
* Absent → the shell hides the Ask surface for this app. */
|
|
201
|
+
default_agent?: string | null;
|
|
202
|
+
/** Composer chips for the Ask panel (manifest `ask.suggestedQuestions`). */
|
|
203
|
+
suggested_questions?: string[];
|
|
204
|
+
}
|
|
205
|
+
interface ShellContextData {
|
|
206
|
+
workspace: {
|
|
207
|
+
id: string;
|
|
208
|
+
name: string;
|
|
209
|
+
};
|
|
210
|
+
org: {
|
|
211
|
+
id: string;
|
|
212
|
+
slug: string;
|
|
213
|
+
name: string;
|
|
214
|
+
};
|
|
215
|
+
/** Workspace logo endpoint URL, or null when no logo is configured. */
|
|
216
|
+
logo_url: string | null;
|
|
217
|
+
/** Published custom apps in this workspace, including the current one. */
|
|
218
|
+
apps: ShellContextApp[];
|
|
219
|
+
/** Product-surface navigation targets, host-aware. `settings` opens the
|
|
220
|
+
* Unified Settings Dialog via the SPA's `?settings=<section>` deep link
|
|
221
|
+
* (optional: absent on servers older than the link). */
|
|
222
|
+
links: {
|
|
223
|
+
home: string;
|
|
224
|
+
threads: string;
|
|
225
|
+
settings?: string;
|
|
226
|
+
};
|
|
227
|
+
/** Viewer display identity; null on unauthenticated/local modes. */
|
|
228
|
+
user: {
|
|
229
|
+
name: string;
|
|
230
|
+
email: string;
|
|
231
|
+
picture?: string | null;
|
|
232
|
+
} | null;
|
|
233
|
+
}
|
|
234
|
+
interface UseShellContextResult {
|
|
235
|
+
data: ShellContextData | null;
|
|
236
|
+
loading: boolean;
|
|
237
|
+
error: Error | null;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Fetch the shell bootstrap payload for the current customer app. Must be
|
|
241
|
+
* called inside `<OxyAppProvider>`. Failure is non-fatal by design: the
|
|
242
|
+
* shell degrades to chrome-less rendering (older servers don't have the
|
|
243
|
+
* endpoint), so errors are surfaced on the result, never thrown.
|
|
244
|
+
*/
|
|
245
|
+
declare function useShellContext(): UseShellContextResult;
|
|
246
|
+
//#endregion
|
|
247
|
+
//#region src/shell/Tooltip.d.ts
|
|
248
|
+
/**
|
|
249
|
+
* Hover tooltip for shell controls. Mirrors the web-app's Radix tooltip
|
|
250
|
+
* (zero delay, side arrow, `--zinc-200`/muted surface) but portals into the
|
|
251
|
+
* shell scope so the namespaced tokens and dark-mode class reach it.
|
|
252
|
+
*/
|
|
253
|
+
declare function ShellTooltip({ content, side, children }: {
|
|
254
|
+
content: React.ReactNode;
|
|
255
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
256
|
+
children: React.ReactNode;
|
|
257
|
+
}): React.JSX.Element;
|
|
258
|
+
//#endregion
|
|
259
|
+
//#region src/shell/TopBar.d.ts
|
|
260
|
+
/** Frame only: left content + right cluster. Mirrors the rail's
|
|
261
|
+
* `--sidebar-background` so the two read as one 48px-tall frame. */
|
|
262
|
+
declare function TopBar({ left, right, className }: {
|
|
263
|
+
left?: ReactNode;
|
|
264
|
+
right?: ReactNode;
|
|
265
|
+
className?: string;
|
|
266
|
+
}): import("react").JSX.Element;
|
|
267
|
+
/**
|
|
268
|
+
* "<Workspace> / <Page>" — e.g. "Poke House / HQ". The workspace name links
|
|
269
|
+
* back to the HQ home; pass `onHomeNavigate` to intercept for SPA routing
|
|
270
|
+
* (the anchor still carries `homeHref` for middle-click/new-tab).
|
|
271
|
+
*/
|
|
272
|
+
declare function Breadcrumb({ workspaceLabel, pageLabel, homeHref, onHomeNavigate }: {
|
|
273
|
+
workspaceLabel: string;
|
|
274
|
+
pageLabel: string;
|
|
275
|
+
homeHref: string;
|
|
276
|
+
onHomeNavigate?: () => void;
|
|
277
|
+
}): import("react").JSX.Element;
|
|
278
|
+
/**
|
|
279
|
+
* Universal "Sys: Connected" indicator — a pulsing green dot when the browser
|
|
280
|
+
* is online, red when offline. Presentational connectivity signal; a real
|
|
281
|
+
* backend health ping can replace `useOnlineStatus` later without touching
|
|
282
|
+
* consumers.
|
|
283
|
+
*/
|
|
284
|
+
declare function SystemIndicator(): import("react").JSX.Element;
|
|
285
|
+
/**
|
|
286
|
+
* Live clock in the given IANA timezone (viewer-local when omitted or
|
|
287
|
+
* invalid). Updates each half-minute (minute precision), pausing while the
|
|
288
|
+
* tab is hidden.
|
|
289
|
+
*/
|
|
290
|
+
declare function WorkspaceClock({ timezone }: {
|
|
291
|
+
timezone?: string;
|
|
292
|
+
}): import("react").JSX.Element;
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region src/shell/threadHistory.d.ts
|
|
295
|
+
interface ThreadSummary {
|
|
296
|
+
id: string;
|
|
297
|
+
title: string;
|
|
298
|
+
created_at: string;
|
|
299
|
+
}
|
|
300
|
+
interface TranscriptTurn {
|
|
301
|
+
question: string;
|
|
302
|
+
events: AgentRunEvent[];
|
|
303
|
+
}
|
|
304
|
+
interface ThreadTranscript {
|
|
305
|
+
title: string;
|
|
306
|
+
turns: TranscriptTurn[];
|
|
307
|
+
}
|
|
308
|
+
interface UseThreadHistoryResult {
|
|
309
|
+
threads: ThreadSummary[];
|
|
310
|
+
loading: boolean;
|
|
311
|
+
error: Error | null;
|
|
312
|
+
/** Re-fetch the list (call after a new chat is archived server-side). */
|
|
313
|
+
refetch: () => void;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* List the viewer's persistent chat threads for the current project.
|
|
317
|
+
* Non-fatal on failure (older server / no session): returns an empty
|
|
318
|
+
* list so the dock falls back to session-only history.
|
|
319
|
+
*/
|
|
320
|
+
declare function useThreadHistory(): UseThreadHistoryResult;
|
|
321
|
+
/**
|
|
322
|
+
* Fetch a thread's transcript for restore. Throws on failure so the
|
|
323
|
+
* caller can surface a toast / fall back.
|
|
324
|
+
*/
|
|
325
|
+
declare function fetchThreadTranscript(fetcher: AppFetcher, projectId: string, threadId: string): Promise<ThreadTranscript>;
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/shell/WorkspaceTile.d.ts
|
|
328
|
+
/** Rail-top workspace identity: the org/code-first logo when present, the
|
|
329
|
+
* name initial otherwise. Pure branding — switching workspaces is the host
|
|
330
|
+
* app's concern (the rail `bottom` slot). */
|
|
331
|
+
declare function WorkspaceTile({ name, logoUrl }: {
|
|
332
|
+
name: string;
|
|
333
|
+
logoUrl?: string;
|
|
334
|
+
}): import("react").JSX.Element;
|
|
335
|
+
//#endregion
|
|
336
|
+
export { AnswerChart, type AnswerChartProps, AskDock, type AskDockProps, Breadcrumb, type ChartBlock, type ChartBlockConfig, OXY_MARK_PATH, OxyMark, OxyShell, type OxyShellProps, OxygenFactoryMark, type RailItem, ReasoningTrace, type ReasoningTraceProps, type ShellContextApp, type ShellContextData, ShellRail, ShellTooltip, SystemIndicator, type ThreadSummary, type ThreadTranscript, TopBar, type TraceItem, type TraceStep, type TraceStepStatus, type TranscriptTurn, type UseShellContextResult, type UseThreadHistoryResult, WorkspaceClock, WorkspaceTile, buildTraceSteps, fetchThreadTranscript, useShellContext, useThreadHistory, workspaceLogoUrl };
|
|
337
|
+
//# sourceMappingURL=shell.d.mts.map
|