@hollis-labs/surface-page 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +24 -2
  2. package/dist/chunks/chunk-ZT6LTRMY.js +220 -0
  3. package/dist/gallery.js +1730 -0
  4. package/dist/index.js +2706 -0
  5. package/dist/registry-items.json +37 -0
  6. package/dist/sdk.js +24 -0
  7. package/dist/types/ade/Overlay.d.ts +4 -0
  8. package/dist/types/ade/hub.d.ts +5 -0
  9. package/dist/types/agent/AgentPanel.d.ts +24 -0
  10. package/dist/types/agent/api.d.ts +61 -0
  11. package/dist/types/agent/index.d.ts +2 -0
  12. package/dist/types/agent/items.d.ts +25 -0
  13. package/dist/types/agent/session.d.ts +34 -0
  14. package/dist/types/boot.d.ts +12 -0
  15. package/dist/types/cards/renderers.d.ts +22 -0
  16. package/dist/types/cards/store.d.ts +41 -0
  17. package/dist/types/cards/views.d.ts +9 -0
  18. package/dist/types/desk/AttentionBadge.d.ts +4 -0
  19. package/dist/types/desk/Confirm.d.ts +2 -0
  20. package/dist/types/desk/ContextInspector.d.ts +2 -0
  21. package/dist/types/desk/Desktop.d.ts +6 -0
  22. package/dist/types/desk/GhostCursor.d.ts +1 -0
  23. package/dist/types/desk/Palette.d.ts +9 -0
  24. package/dist/types/desk/ThemePicker.d.ts +3 -0
  25. package/dist/types/desk/attention.d.ts +17 -0
  26. package/dist/types/desk/commands.d.ts +13 -0
  27. package/dist/types/desk/composing.d.ts +10 -0
  28. package/dist/types/desk/coreViews.d.ts +2 -0
  29. package/dist/types/desk/keys.d.ts +12 -0
  30. package/dist/types/desk/moduleApi.d.ts +3 -0
  31. package/dist/types/desk/store.d.ts +123 -0
  32. package/dist/types/gallery/Gallery.d.ts +64 -0
  33. package/dist/types/gallery/Specimen.d.ts +22 -0
  34. package/dist/types/gallery/ade.d.ts +1 -0
  35. package/dist/types/gallery/approval.d.ts +1 -0
  36. package/dist/types/gallery/cards.d.ts +1 -0
  37. package/dist/types/gallery/chat.d.ts +1 -0
  38. package/dist/types/gallery/composer.d.ts +1 -0
  39. package/dist/types/gallery/controls.d.ts +1 -0
  40. package/dist/types/gallery/display.d.ts +1 -0
  41. package/dist/types/gallery/genui.d.ts +1 -0
  42. package/dist/types/gallery/index.d.ts +9 -0
  43. package/dist/types/gallery/overlays.d.ts +1 -0
  44. package/dist/types/gallery/theme.d.ts +19 -0
  45. package/dist/types/gallery/windows.d.ts +1 -0
  46. package/dist/types/genui/card.d.ts +2 -0
  47. package/dist/types/index.d.ts +15 -0
  48. package/dist/types/sdk/anchors.d.ts +8 -0
  49. package/dist/types/sdk/hooks.d.ts +11 -0
  50. package/dist/types/sdk/icon.d.ts +5 -0
  51. package/dist/types/sdk/index.d.ts +9 -0
  52. package/dist/types/sdk/marks.d.ts +10 -0
  53. package/dist/types/sdk/runtime.d.ts +40 -0
  54. package/dist/types/sdk/types.d.ts +99 -0
  55. package/package.json +71 -4
  56. package/vite.d.ts +3 -0
  57. package/vite.js +42 -0
@@ -0,0 +1,37 @@
1
+ [
2
+ "alert-dialog",
3
+ "app-frame",
4
+ "attention-layer",
5
+ "badge",
6
+ "button",
7
+ "card",
8
+ "card-approval",
9
+ "card-choice",
10
+ "card-confirm",
11
+ "card-form",
12
+ "card-miss",
13
+ "card-notice",
14
+ "card-plan",
15
+ "card-progress",
16
+ "card-prompt",
17
+ "command",
18
+ "conversation",
19
+ "dialog",
20
+ "dropdown-menu",
21
+ "empty",
22
+ "genui-surface",
23
+ "guide-bar",
24
+ "input",
25
+ "item",
26
+ "kbd",
27
+ "label",
28
+ "markdown",
29
+ "message",
30
+ "prompt-input",
31
+ "select",
32
+ "spinner",
33
+ "switch",
34
+ "toggle-group",
35
+ "tool",
36
+ "window-manager"
37
+ ]
package/dist/sdk.js ADDED
@@ -0,0 +1,24 @@
1
+ import {
2
+ ApiError,
3
+ Icon,
4
+ addMark,
5
+ replyMark,
6
+ resolveMark,
7
+ setSetting,
8
+ useAnchor,
9
+ useEvent,
10
+ useMarks,
11
+ useSetting
12
+ } from "./chunks/chunk-ZT6LTRMY.js";
13
+ export {
14
+ ApiError,
15
+ Icon,
16
+ addMark,
17
+ replyMark,
18
+ resolveMark,
19
+ setSetting,
20
+ useAnchor,
21
+ useEvent,
22
+ useMarks,
23
+ useSetting
24
+ };
@@ -0,0 +1,4 @@
1
+ /** The attention layer, over everything. Mount once. */
2
+ export declare function AdeAttention(): import("react").JSX.Element;
3
+ /** The guide bar, at the foot of whatever it is placed in. */
4
+ export declare function AdeGuide(): import("react").JSX.Element | null;
@@ -0,0 +1,5 @@
1
+ export declare const hub: import("@hollis-labs/ade-core").Hub;
2
+ /** Put the desk in front of the hub and follow the server. Once per page. */
3
+ export declare function startAde(): void;
4
+ /** The owner dismissed what the agent pointed at. */
5
+ export declare const dismissAttention: () => void;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The agent panel: the context strip (the slot in play, the tools top of mind there, and the
3
+ * <context> block the next message will carry) above the conversation with the embedded
4
+ * agent.
5
+ *
6
+ * The conversation is @hollis-labs/surface-chat's store, drawn with the registry's chat components. Each
7
+ * part subscribes to its own slice, so typing redraws only the composer and a streamed token
8
+ * redraws only the message it belongs to. In development the list, each row and the composer
9
+ * count their own commits in window.__chatRenders, which is how that is checked.
10
+ *
11
+ * The context is the server's: it is assembled from the desk on every message and pushed
12
+ * here as an "agent.context" event whenever the window in front changes. The page sends no
13
+ * context and no tools of its own.
14
+ */
15
+ import { type Desk } from "../sdk";
16
+ import { type AgentSession } from "./session";
17
+ /** The one conversation of the page: a run goes on while the panel is closed. */
18
+ export declare function agentSession(): AgentSession;
19
+ export interface AgentPanelProps {
20
+ /** The desk, for opening what the agent names. Optional. */
21
+ desk?: Desk;
22
+ title?: string;
23
+ }
24
+ export declare function AgentPanel({ title }: AgentPanelProps): import("react").JSX.Element;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * The agent's own routes beside the agent-host/1 wire (core/internal/agent/http.go).
3
+ */
4
+ /** One active slot (slots.SlotView). */
5
+ export interface SlotView {
6
+ name: string;
7
+ module?: string;
8
+ about: string;
9
+ instructions?: string;
10
+ where?: string;
11
+ note?: string;
12
+ note_updated?: string;
13
+ knowledge?: string;
14
+ }
15
+ /** What the next message carries (slots.Assembly). */
16
+ export interface Assembly {
17
+ slot: string;
18
+ slots: SlotView[];
19
+ why: string;
20
+ top_of_mind: string[] | null;
21
+ focused?: {
22
+ window: string;
23
+ view: string;
24
+ module: string;
25
+ title: string;
26
+ kind?: string;
27
+ ref?: string;
28
+ };
29
+ mode?: string;
30
+ layout?: string;
31
+ reminders?: string[];
32
+ block: string;
33
+ }
34
+ /** One slot in the app (agent.SlotInfo). */
35
+ export interface SlotInfo {
36
+ name: string;
37
+ module?: string;
38
+ about: string;
39
+ views?: string[];
40
+ tools?: string[];
41
+ note?: string;
42
+ active: boolean;
43
+ }
44
+ export interface Setup {
45
+ ready: boolean;
46
+ model: string;
47
+ config_path: string;
48
+ /** Why the agent cannot answer, in a sentence, when it cannot. */
49
+ reason?: string;
50
+ /** "conversation" when the agent is on the conversation wire; absent on the run-at-a-time one. */
51
+ wire?: string;
52
+ /** The agent's name on the conversation wire. */
53
+ agent?: string;
54
+ }
55
+ export declare const agentApi: {
56
+ context: () => Promise<Assembly>;
57
+ setup: () => Promise<Setup>;
58
+ slots: () => Promise<SlotInfo[]>;
59
+ /** Pin a slot; "" lets the window in front choose again. */
60
+ pin: (slot: string) => Promise<Assembly>;
61
+ };
@@ -0,0 +1,2 @@
1
+ export { AgentPanel, type AgentPanelProps, agentSession } from "./AgentPanel";
2
+ export { type Assembly, agentApi, type SlotInfo, type SlotView } from "./api";
@@ -0,0 +1,25 @@
1
+ /**
2
+ * How each item of the conversation is drawn. The table is the seam for cards: a tool with a
3
+ * card of its own (an approval, a plan, progress) is drawn by the component `toolCards` names
4
+ * for it, and every other tool by the plain row.
5
+ */
6
+ import type { ChatItem } from "@hollis-labs/surface-chat";
7
+ import type { ComponentType } from "react";
8
+ type Of<K extends ChatItem["kind"]> = Extract<ChatItem, {
9
+ kind: K;
10
+ }>;
11
+ export type ToolItem = Of<"tool">;
12
+ /** Tool name → the card that draws its calls. */
13
+ export declare const toolCards: Record<string, ComponentType<{
14
+ item: ToolItem;
15
+ }>>;
16
+ /** One kind → how it is drawn. */
17
+ export declare const renderers: {
18
+ [K in ChatItem["kind"]]: ComponentType<{
19
+ item: Of<K>;
20
+ }>;
21
+ };
22
+ export declare function ItemView({ item }: {
23
+ item: ChatItem;
24
+ }): import("react").JSX.Element;
25
+ export {};
@@ -0,0 +1,34 @@
1
+ /**
2
+ * The page's one conversation with the agent, whichever wire the server speaks. The server
3
+ * says which in /api/agent/setup: the conversation wire (a durable conversation the page
4
+ * attaches to, shared with other tabs) or the run-at-a-time one. Both stores offer the same
5
+ * surface, so the panel draws either; this wrapper exists because the answer arrives after
6
+ * the page has started, and callers want the session at once.
7
+ *
8
+ * Two address-bar switches, for looking at the conversation wire's other modes:
9
+ * `?chat=viewer` attaches this page as a viewer (it watches and can take over), and
10
+ * `?chat=committed` takes each part whole instead of as it is written.
11
+ */
12
+ import { type ChatState, type Decision, type RunEnd } from "@hollis-labs/surface-chat";
13
+ export interface AgentSession {
14
+ get(): ChatState;
15
+ subscribe(fn: () => void): () => void;
16
+ start(): Promise<void>;
17
+ send(text: string, how?: {
18
+ auto?: string;
19
+ }): Promise<boolean>;
20
+ stop(): void;
21
+ answer(decision: Decision): Promise<void>;
22
+ newThread(): Promise<void>;
23
+ turnElsewhere(run: string): void;
24
+ onRunEnd(fn: (run: string, how: RunEnd) => void): () => void;
25
+ /** True on the conversation wire. False until the server has said. */
26
+ durable(): boolean;
27
+ /** This page's attachment on the conversation wire, to compare with the holder of the input. */
28
+ attachment(): string;
29
+ /** "viewer" when this page only watches. */
30
+ role(): "controller" | "viewer";
31
+ /** Take the input from whoever holds it. */
32
+ takeover(): Promise<boolean>;
33
+ }
34
+ export declare function createAgentSession(): AgentSession;
@@ -0,0 +1,12 @@
1
+ import { type Root } from "react-dom/client";
2
+ import type { ModuleWeb } from "./sdk/types";
3
+ export interface PageProps {
4
+ /** The views compiled into this app's page, by module id. */
5
+ modules: Record<string, ModuleWeb>;
6
+ /** Views of the core's own (`surface/*`) to add, such as the Components window from ./gallery. */
7
+ core?: ModuleWeb["views"];
8
+ }
9
+ /** The whole page: a loading state until the server answers, then the desktop and the cards. */
10
+ export declare function Page({ modules, core }: PageProps): import("react").JSX.Element;
11
+ /** Draw the page into an element (by default `#root`). */
12
+ export declare function mountPage(props: PageProps, element?: Element | null): Root;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Which component draws each kind of card. The table is the app's: a module with a card
3
+ * kind of its own registers its renderer here (`registerCard`), and a card nothing is
4
+ * registered for is drawn as a plain "no renderer" card, never as nothing.
5
+ */
6
+ import { type CardOutcome } from "@hollis-labs/surface-cards";
7
+ import { type ComponentType } from "react";
8
+ import { type ServerCard } from "./store";
9
+ /** What a renderer is handed: the card, and how to answer it. */
10
+ export interface CardRendererProps {
11
+ card: ServerCard;
12
+ respond: (outcome: CardOutcome) => Promise<void>;
13
+ }
14
+ export type CardRenderer = ComponentType<CardRendererProps>;
15
+ /** Registers the component that draws a kind of card at a version. */
16
+ export declare const registerCard: (kind: string, version: string, component: CardRenderer) => void;
17
+ /** A closed card's answer in a few words, for its receipt. */
18
+ export declare function describeOutcome(card: ServerCard): string | undefined;
19
+ /** Draws one card with the renderer registered for its kind. */
20
+ export declare function CardView({ card }: {
21
+ card: ServerCard;
22
+ }): import("react").JSX.Element;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The cards as the page knows them. The server holds each card and its state and streams
3
+ * changes; the page keeps the latest of each, and the engine from @hollis-labs/surface-cards decides
4
+ * where each one shows, from rules that are data.
5
+ */
6
+ import { type CardOutcome, type CardViewModel, type Surface } from "@hollis-labs/surface-cards";
7
+ /** A card as the server sends it. */
8
+ export interface ServerCard {
9
+ id: string;
10
+ kind: string;
11
+ version?: string;
12
+ title?: string;
13
+ source?: string;
14
+ subject?: string;
15
+ risk?: string;
16
+ blocking?: boolean;
17
+ payload?: Record<string, unknown>;
18
+ status?: string;
19
+ outcome?: CardOutcome;
20
+ revision?: number;
21
+ superseded_by?: string;
22
+ created?: string;
23
+ responded?: string;
24
+ expires_at?: string;
25
+ }
26
+ export declare const ANSWERABLE: string[];
27
+ /** Reads the open cards once and follows changes from then on. */
28
+ export declare function startCards(): void;
29
+ /** Sends the person's answer. A card that closed meanwhile comes back as it stands. */
30
+ export declare function respond(id: string, outcome: CardOutcome): Promise<void>;
31
+ export declare const dismissToast: (id: string) => void;
32
+ export declare const isStale: (id: string) => boolean;
33
+ export declare const cardById: (id: string) => ServerCard | undefined;
34
+ export interface Shown {
35
+ card: ServerCard;
36
+ view: CardViewModel;
37
+ }
38
+ /** The cards on one surface, in the order they arrived. */
39
+ export declare function useCards(surface: Surface): Shown[];
40
+ /** One card by id, following its changes. */
41
+ export declare function useCard(id: string): ServerCard | undefined;
@@ -0,0 +1,9 @@
1
+ import { type ViewProps } from "../sdk";
2
+ /** The agent's open cards, above its composer. A closed one leaves the dock: the
3
+ * conversation carries what was answered. */
4
+ export declare function CardDock(): import("react").JSX.Element | null;
5
+ /** Cards from anything but the agent: pop-ups in the corner, and the one its sender is
6
+ * waiting on in the middle. Mounted once, over the whole page. */
7
+ export declare function CardHost(): import("react").JSX.Element;
8
+ /** The Cards window: every open card, and the recent ones that are closed. */
9
+ export declare function CardsWindow(_: ViewProps): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { type UI } from "./commands";
2
+ export declare function AttentionBadge({ ui }: {
3
+ ui: UI;
4
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ /** The desk's yes/no dialog. Views reach it through desk.confirm. */
2
+ export declare function ConfirmHost(): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { type ViewProps } from "../sdk";
2
+ export declare function ContextInspector(_: ViewProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { type ModuleWeb } from "../sdk";
2
+ export interface DesktopProps {
3
+ /** The views compiled into this app's page, by module id. */
4
+ modules: Record<string, ModuleWeb>;
5
+ }
6
+ export declare function Desktop({ modules }: DesktopProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function GhostCursor(): import("react").JSX.Element | null;
@@ -0,0 +1,9 @@
1
+ import { type CommandDef } from "./store";
2
+ interface PaletteProps {
3
+ open: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ commands: CommandDef[];
6
+ }
7
+ /** The command palette: every command, every view and every saved layout, by what you type. */
8
+ export declare function Palette({ open, onOpenChange, commands }: PaletteProps): import("react").JSX.Element;
9
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare function ThemePicker(): import("react").JSX.Element;
2
+ /** The time, to the minute, like a status bar's clock. */
3
+ export declare function Clock(): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ export interface AttendItem {
2
+ subject: string;
3
+ state: "needs_you" | "failed" | "unseen";
4
+ title?: string;
5
+ reason?: string;
6
+ window?: string;
7
+ card?: string;
8
+ by?: string;
9
+ since: string;
10
+ }
11
+ export interface Attention {
12
+ items: AttendItem[];
13
+ counts: Record<string, number>;
14
+ }
15
+ export declare function useAttention(): Attention;
16
+ /** The first thing that waits: what needs an answer first, then failures, then unseen windows. */
17
+ export declare const firstItem: (a: Attention) => AttendItem;
@@ -0,0 +1,13 @@
1
+ import { type AttendItem } from "./attention";
2
+ import { type CommandDef } from "./store";
3
+ export interface UI {
4
+ togglePalette(open?: boolean): void;
5
+ toggleAgent(open?: boolean): void;
6
+ toggleMenu(): void;
7
+ }
8
+ export declare const clientCommands: CommandDef[];
9
+ /** Brings an item in front: its window, or the Cards window for a card (the agent's own cards sit
10
+ * in its panel). */
11
+ export declare function jumpTo(item: AttendItem | undefined, ui: UI): Promise<boolean>;
12
+ /** Runs a page command. Returns undefined when the id is not one of the page's. */
13
+ export declare function runClient(id: string, ui: UI, args?: Record<string, unknown>): Promise<unknown> | undefined;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Unsent input (desk rule 7): the page tells the server when the owner has typed something not yet
3
+ * sent, in a window or in the agent panel, so a delegate's change to that window is held instead of
4
+ * replacing it, and an agent's open does not take the focus from the panel. Any text field holding
5
+ * text counts. The report is sent only when it changes, and cleared when the field empties or the
6
+ * window goes.
7
+ */
8
+ import { type RefObject } from "react";
9
+ /** Reports whether the element's fields hold unsent text: for window id, or the panel when id is "". */
10
+ export declare function useComposing(ref: RefObject<HTMLElement | null>, id: string): void;
@@ -0,0 +1,2 @@
1
+ import { type ModuleWeb } from "../sdk";
2
+ export declare const coreWeb: ModuleWeb;
@@ -0,0 +1,12 @@
1
+ /** Shortcuts written like "ctrl+alt+t" or "cmd+k", matched against keyboard events. */
2
+ export interface Chord {
3
+ key: string;
4
+ ctrl: boolean;
5
+ alt: boolean;
6
+ shift: boolean;
7
+ meta: boolean;
8
+ }
9
+ export declare function parseKeys(keys: string): Chord | null;
10
+ export declare function matches(c: Chord, e: KeyboardEvent): boolean;
11
+ /** A shortcut as a person reads it: "⌃⌥T". */
12
+ export declare function showKeys(keys?: string): string;
@@ -0,0 +1,3 @@
1
+ import type { ModuleAPI } from "../sdk";
2
+ /** Calls to one module's own routes (/api/m/<id>/...). */
3
+ export declare function moduleApi(id: string): ModuleAPI;
@@ -0,0 +1,123 @@
1
+ import type { WindowTree } from "@/components/ui/window-manager";
2
+ import type { Desk, Win } from "../sdk";
3
+ export interface DeskWin {
4
+ id: string;
5
+ view: string;
6
+ module: string;
7
+ title: string;
8
+ key?: string;
9
+ args: Record<string, unknown>;
10
+ state?: Record<string, unknown>;
11
+ dirty?: boolean;
12
+ /** Who opened it (owner, agent, reflex, outside), why, and whether the owner has made it theirs. */
13
+ opened_by?: string;
14
+ reason?: string;
15
+ retention?: string;
16
+ kept?: boolean;
17
+ /** The owner has unsent input in it (the page reports it). */
18
+ composing?: boolean;
19
+ /** A delegate's change to what it shows, waiting until the owner is done (rule 7). */
20
+ held?: {
21
+ args: Record<string, unknown>;
22
+ title?: string;
23
+ by: string;
24
+ at: string;
25
+ };
26
+ }
27
+ /** A window a delegate opened that the owner has not made theirs (docs/desk-rules.md, rule 4). */
28
+ export declare const notYetKept: (w: DeskWin) => boolean;
29
+ export interface DeskState {
30
+ wins: DeskWin[];
31
+ focus: string;
32
+ /** How the windows are arranged: the server's, drawn by the window manager. */
33
+ tree: WindowTree;
34
+ layout: "tile" | "float";
35
+ ratio: number;
36
+ active?: string;
37
+ mode?: string;
38
+ rev: number;
39
+ }
40
+ export interface ViewDef {
41
+ id: string;
42
+ title: string;
43
+ icon?: string;
44
+ width?: number;
45
+ height?: number;
46
+ menu?: boolean;
47
+ multi?: boolean;
48
+ bare?: boolean;
49
+ render: {
50
+ kind: "component" | "frame";
51
+ entry: string;
52
+ };
53
+ opens?: string[];
54
+ module: string;
55
+ }
56
+ export interface CommandDef {
57
+ id: string;
58
+ title: string;
59
+ section?: string;
60
+ keywords?: string;
61
+ keys?: string;
62
+ hidden?: boolean;
63
+ module: string;
64
+ /** True when the server runs it; false for a command of the page's own. */
65
+ server: boolean;
66
+ }
67
+ export interface AppManifest {
68
+ name: string;
69
+ title: string;
70
+ modules: {
71
+ id: string;
72
+ title: string;
73
+ about?: string;
74
+ version?: string;
75
+ }[];
76
+ views: ViewDef[];
77
+ commands: CommandDef[];
78
+ }
79
+ export interface LayoutDef {
80
+ name: string;
81
+ about?: string;
82
+ mode: string;
83
+ ratio?: number;
84
+ windows: {
85
+ view: string;
86
+ key?: string;
87
+ title?: string;
88
+ floating?: boolean;
89
+ focus?: boolean;
90
+ }[];
91
+ setup?: Record<string, unknown>;
92
+ }
93
+ export declare function loadManifest(): Promise<AppManifest>;
94
+ export declare const app: () => AppManifest;
95
+ export declare const viewById: (id: string) => ViewDef | undefined;
96
+ /** The view that opens a file of this name: the first whose Opens patterns match it. */
97
+ export declare function viewForFile(name: string): ViewDef | undefined;
98
+ export declare const deskState: () => DeskState;
99
+ export declare function useDeskState(): DeskState;
100
+ /** Post one action to the server's window manager. */
101
+ export declare function act(action: Record<string, unknown>): Promise<DeskWin | undefined>;
102
+ export declare const toWin: (w: DeskWin, focus: string) => Win;
103
+ type Confirm = (q: {
104
+ title: string;
105
+ message?: string;
106
+ confirmLabel?: string;
107
+ danger?: boolean;
108
+ }) => Promise<boolean>;
109
+ /** The desktop installs its dialog here. */
110
+ export declare const setConfirm: (fn: Confirm) => void;
111
+ /** Runs a command: the server's by id, or one of the page's own. */
112
+ type ClientRunner = (id: string, args?: Record<string, unknown>) => Promise<unknown> | undefined;
113
+ export declare const setClientRunner: (fn: ClientRunner) => void;
114
+ export declare function runCommand<T = unknown>(id: string, args?: Record<string, unknown>): Promise<T>;
115
+ /** Close a window, asking first when it holds unsaved work. */
116
+ export declare function closeWindow(id: string): Promise<void>;
117
+ /** The Desk a view is handed. */
118
+ export declare const desk: Desk;
119
+ export declare const listLayouts: () => Promise<LayoutDef[]>;
120
+ export declare const saveLayout: (name: string, about?: string) => Promise<LayoutDef>;
121
+ export declare const loadLayout: (name: string) => Promise<unknown>;
122
+ export declare const deleteLayout: (name: string) => Promise<unknown>;
123
+ export {};
@@ -0,0 +1,64 @@
1
+ /**
2
+ * The component gallery: every component installed from the @surface registry, in its
3
+ * variants and states, drawn from fixtures. Design work happens against it, and
4
+ * `make ui-shots` photographs each section in dark and light. Nothing here calls the server.
5
+ */
6
+ import type { ViewProps } from "@hollis-labs/surface-page/sdk";
7
+ import { Ade } from "./ade";
8
+ import { Cards } from "./cards";
9
+ import { Chat } from "./chat";
10
+ import { Controls } from "./controls";
11
+ import { Display } from "./display";
12
+ import { Genui } from "./genui";
13
+ import { Overlays } from "./overlays";
14
+ import { Theme } from "./theme";
15
+ import { Windows } from "./windows";
16
+ /** The sections, in order. Their ids name the screenshots. */
17
+ export declare const SECTIONS: readonly [{
18
+ readonly id: "theme";
19
+ readonly title: "Theme";
20
+ readonly draw: typeof Theme;
21
+ }, {
22
+ readonly id: "controls";
23
+ readonly title: "Controls";
24
+ readonly draw: typeof Controls;
25
+ }, {
26
+ readonly id: "display";
27
+ readonly title: "Display";
28
+ readonly draw: typeof Display;
29
+ }, {
30
+ readonly id: "overlays";
31
+ readonly title: "Overlays";
32
+ readonly draw: typeof Overlays;
33
+ }, {
34
+ readonly id: "chat";
35
+ readonly title: "Chat";
36
+ readonly draw: typeof Chat;
37
+ }, {
38
+ readonly id: "cards";
39
+ readonly title: "Cards";
40
+ readonly draw: typeof Cards;
41
+ }, {
42
+ readonly id: "genui";
43
+ readonly title: "GenUI";
44
+ readonly draw: typeof Genui;
45
+ }, {
46
+ readonly id: "ade";
47
+ readonly title: "ADE";
48
+ readonly draw: typeof Ade;
49
+ }, {
50
+ readonly id: "windows";
51
+ readonly title: "Windows";
52
+ readonly draw: typeof Windows;
53
+ }];
54
+ export declare function Gallery({ win }: ViewProps): import("react").JSX.Element;
55
+ /**
56
+ * The gallery's tabs, outside any window: the standalone page (standalone.tsx) draws this,
57
+ * opening on `first` and telling `onSection` which section is shown.
58
+ */
59
+ export declare function GalleryTabs({ first, onSection, draft, }: {
60
+ first?: string;
61
+ onSection?: (id: string) => void;
62
+ /** Show the Draft tab first, for this design job (`true`: any job's marked draft). */
63
+ draft?: string | true;
64
+ }): import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ /** The gallery's two layout pieces: a section with a title, and one labelled specimen. */
2
+ import { type ReactNode } from "react";
3
+ /**
4
+ * Which sections draw. In the Draft tab only the sections marked as a design job's draft
5
+ * draw: those whose `draft` is the job given (or any marked one when no job is given).
6
+ */
7
+ export declare const DraftFilter: import("react").Context<{
8
+ only: boolean;
9
+ job?: string;
10
+ }>;
11
+ export declare function Section({ title, about, draft, children, }: {
12
+ title: string;
13
+ about?: string;
14
+ /** The design job this section is the draft of (its id, e.g. "d_d065599e"): it shows in the Draft tab. */
15
+ draft?: string;
16
+ children: ReactNode;
17
+ }): import("react").JSX.Element | null;
18
+ export declare function Specimen({ label, wide, children }: {
19
+ label: string;
20
+ wide?: boolean;
21
+ children: ReactNode;
22
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function Ade(): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function Approval(): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function Cards(): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function Chat(): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ComposerSpecimens(): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function Controls(): import("react").JSX.Element;