@av-pi-studio/workbench 0.0.0-stage → 0.0.118
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 +157 -2
- package/dist/chunks/BinaryFallbackViewer-BN-9Yvel.js +19 -0
- package/dist/chunks/ChatPanel-CjPUJMEs.js +2493 -0
- package/dist/chunks/CodeView-6kJms_MF.js +143 -0
- package/dist/chunks/DiffView-BqDuT3CF.js +48 -0
- package/dist/chunks/FilePanel-B8IXG2bj.js +92 -0
- package/dist/chunks/HtmlViewer-DpuVFaDo.js +490 -0
- package/dist/chunks/ImageViewer-BBfyA5QN.js +27 -0
- package/dist/chunks/MarkdownFileViewer-DPFPDS7G.js +88 -0
- package/dist/chunks/ModelProvidersPanel-Dsezq7Ss.js +95 -0
- package/dist/chunks/MoleculeViewerPanel-DEEU6Zkx.js +191 -0
- package/dist/chunks/PdfViewer-BdacmAu_.js +300 -0
- package/dist/chunks/SaveFileButton-2rOu02Xx.js +33 -0
- package/dist/chunks/SettingsDialog-DO1tDhMW.js +471 -0
- package/dist/chunks/SkillsPanel-DZDia4Pw.js +833 -0
- package/dist/chunks/TerminalPanel-bphwCSyW.js +242 -0
- package/dist/chunks/TextViewer-CVGqN6yy.js +63 -0
- package/dist/chunks/VideoViewer-BkB9BoOr.js +20 -0
- package/dist/chunks/ViewersPanel-C2E9FLf7.js +50 -0
- package/dist/chunks/href-resolution-jv3tpRcp.js +25 -0
- package/dist/chunks/index-Dlz8mEKZ.js +6258 -0
- package/dist/chunks/markdown-B2OXhZ-_.js +353 -0
- package/dist/chunks/provider-auth-store-C1GaLTlw.js +34 -0
- package/dist/chunks/use-file-download-CogCqTvU.js +31 -0
- package/dist/chunks/use-file-watch-Bb_Xzbr-.js +55 -0
- package/dist/chunks/use-provider-auth-list-DTjIZycd.js +16 -0
- package/dist/features/agent-ui/AskCard.d.ts +62 -0
- package/dist/features/agent-ui/agent-ui-store.d.ts +84 -0
- package/dist/features/agent-ui/announce.d.ts +51 -0
- package/dist/features/agent-ui/ask-list.d.ts +53 -0
- package/dist/features/agent-ui/ask-placement.d.ts +47 -0
- package/dist/features/agent-ui/deadline.d.ts +27 -0
- package/dist/features/agent-ui/keyboard.d.ts +37 -0
- package/dist/features/agent-ui/notify-effect.d.ts +41 -0
- package/dist/features/agent-ui/option-layout.d.ts +24 -0
- package/dist/features/agent-ui/outcome-line.d.ts +38 -0
- package/dist/features/agent-ui/prompt-text.d.ts +24 -0
- package/dist/features/chat/Attachments.d.ts +20 -0
- package/dist/features/chat/ChatPanel.d.ts +12 -0
- package/dist/features/chat/CommandMenu.d.ts +41 -0
- package/dist/features/chat/Composer.d.ts +58 -0
- package/dist/features/chat/ForkDialog.d.ts +24 -0
- package/dist/features/chat/ModelMenu.d.ts +54 -0
- package/dist/features/chat/ThinkingMenu.d.ts +39 -0
- package/dist/features/chat/Timeline.d.ts +30 -0
- package/dist/features/chat/TurnProgressBar.d.ts +14 -0
- package/dist/features/chat/composer-busy.d.ts +22 -0
- package/dist/features/chat/composer-gate.d.ts +37 -0
- package/dist/features/chat/composer-path-drop.d.ts +75 -0
- package/dist/features/chat/fork-correlation.d.ts +39 -0
- package/dist/features/chat/fork-gate.d.ts +27 -0
- package/dist/features/chat/fork-picker-nav.d.ts +14 -0
- package/dist/features/chat/fork-result.d.ts +43 -0
- package/dist/features/chat/model-menu-sort.d.ts +30 -0
- package/dist/features/chat/onboarding-nudge.d.ts +18 -0
- package/dist/features/chat/rows/AssistantRow.d.ts +24 -0
- package/dist/features/chat/rows/CompactionRow.d.ts +16 -0
- package/dist/features/chat/rows/ErrorRow.d.ts +13 -0
- package/dist/features/chat/rows/ReasoningRow.d.ts +16 -0
- package/dist/features/chat/rows/RowShell.d.ts +37 -0
- package/dist/features/chat/rows/SystemRow.d.ts +11 -0
- package/dist/features/chat/rows/ToolCard.d.ts +30 -0
- package/dist/features/chat/rows/UserRow.d.ts +43 -0
- package/dist/features/chat/slash-commands.d.ts +81 -0
- package/dist/features/chat/thinking-level-source.d.ts +29 -0
- package/dist/features/chat/todos/TodoPanel.d.ts +11 -0
- package/dist/features/chat/todos/agent-todos-store.d.ts +35 -0
- package/dist/features/chat/todos/todo-collapse-codec.d.ts +12 -0
- package/dist/features/chat/todos/todo-panel-model.d.ts +37 -0
- package/dist/features/chat/use-bottom-anchor.d.ts +33 -0
- package/dist/features/chat/use-fork-action.d.ts +32 -0
- package/dist/features/connection/ConnectionBar.d.ts +18 -0
- package/dist/features/connection/connection-presentation.d.ts +70 -0
- package/dist/features/files/BinaryFallbackViewer.d.ts +9 -0
- package/dist/features/files/CodeView.d.ts +15 -0
- package/dist/features/files/DiffView.d.ts +18 -0
- package/dist/features/files/FileContextMenu.d.ts +13 -0
- package/dist/features/files/FileExplorer.d.ts +24 -0
- package/dist/features/files/FilePanel.d.ts +26 -0
- package/dist/features/files/HtmlViewer.d.ts +22 -0
- package/dist/features/files/ImageViewer.d.ts +8 -0
- package/dist/features/files/MarkdownFileViewer.d.ts +14 -0
- package/dist/features/files/MoleculeViewer.d.ts +60 -0
- package/dist/features/files/MoleculeViewerPanel.d.ts +9 -0
- package/dist/features/files/PdfViewer.d.ts +14 -0
- package/dist/features/files/RightSidebar.d.ts +9 -0
- package/dist/features/files/SaveFileButton.d.ts +9 -0
- package/dist/features/files/TextViewer.d.ts +23 -0
- package/dist/features/files/TreeDraftRow.d.ts +15 -0
- package/dist/features/files/TreeNode.d.ts +42 -0
- package/dist/features/files/TreeRenameRow.d.ts +19 -0
- package/dist/features/files/VideoViewer.d.ts +8 -0
- package/dist/features/files/create-entry.d.ts +23 -0
- package/dist/features/files/delete-entry.d.ts +17 -0
- package/dist/features/files/file-tree.d.ts +92 -0
- package/dist/features/files/git-status-index.d.ts +37 -0
- package/dist/features/files/html-asset-loader.d.ts +43 -0
- package/dist/features/files/html-assets.d.ts +97 -0
- package/dist/features/files/html-sandbox.d.ts +62 -0
- package/dist/features/files/molecule-reload.d.ts +20 -0
- package/dist/features/files/molecule-source.d.ts +10 -0
- package/dist/features/files/molecule-theme.d.ts +31 -0
- package/dist/features/files/move-entry.d.ts +10 -0
- package/dist/features/files/move-status.d.ts +10 -0
- package/dist/features/files/move-target.d.ts +31 -0
- package/dist/features/files/open-file-tab.d.ts +32 -0
- package/dist/features/files/pdf-layout.d.ts +28 -0
- package/dist/features/files/pdfjs-runtime.d.ts +30 -0
- package/dist/features/files/polymer-file.d.ts +33 -0
- package/dist/features/files/text-viewer-state.d.ts +53 -0
- package/dist/features/files/upload-sources.d.ts +20 -0
- package/dist/features/files/viewer-registry.d.ts +81 -0
- package/dist/features/files/write-file.d.ts +12 -0
- package/dist/features/git/ChangesPanel.d.ts +13 -0
- package/dist/features/provider-auth/LoginDialog.d.ts +21 -0
- package/dist/features/provider-auth/ModelProvidersPanel.d.ts +12 -0
- package/dist/features/provider-auth/QrCode.d.ts +26 -0
- package/dist/features/provider-auth/login-flow.d.ts +55 -0
- package/dist/features/provider-auth/provider-auth-presentation.d.ts +31 -0
- package/dist/features/provider-auth/provider-auth-store.d.ts +42 -0
- package/dist/features/sessions/SessionContextMenu.d.ts +11 -0
- package/dist/features/sessions/SessionItem.d.ts +22 -0
- package/dist/features/sessions/SessionList.d.ts +9 -0
- package/dist/features/sessions/WorkspaceContextMenu.d.ts +9 -0
- package/dist/features/sessions/WorkspaceGroupHeader.d.ts +26 -0
- package/dist/features/sessions/apply-agent-deep-link.d.ts +7 -0
- package/dist/features/sessions/open-chat-tab.d.ts +14 -0
- package/dist/features/sessions/open-workspace.d.ts +20 -0
- package/dist/features/sessions/session-actions.d.ts +18 -0
- package/dist/features/sessions/session-presentation.d.ts +47 -0
- package/dist/features/sessions/status-map.d.ts +10 -0
- package/dist/features/sessions/workspace-grouping.d.ts +30 -0
- package/dist/features/settings/SettingsDialog.d.ts +22 -0
- package/dist/features/settings/ViewersPanel.d.ts +18 -0
- package/dist/features/settings/settings-categories.d.ts +32 -0
- package/dist/features/skills/InstallSkillDialog.d.ts +21 -0
- package/dist/features/skills/SkillsPanel.d.ts +32 -0
- package/dist/features/skills/skills-presentation.d.ts +159 -0
- package/dist/features/skills/use-skills.d.ts +215 -0
- package/dist/features/terminal/TerminalPanel.d.ts +37 -0
- package/dist/features/terminal/terminal-font.d.ts +44 -0
- package/dist/features/terminal/terminal-size.d.ts +52 -0
- package/dist/features/workspace/ContextMeter.d.ts +15 -0
- package/dist/features/workspace/ContextMeterPopover.d.ts +16 -0
- package/dist/features/workspace/DropPreview.d.ts +23 -0
- package/dist/features/workspace/PaneDividers.d.ts +30 -0
- package/dist/features/workspace/StatusBar.d.ts +16 -0
- package/dist/features/workspace/TabContextMenu.d.ts +15 -0
- package/dist/features/workspace/TabPanelHost.d.ts +30 -0
- package/dist/features/workspace/TabStrip.d.ts +36 -0
- package/dist/features/workspace/compact-action.d.ts +21 -0
- package/dist/features/workspace/context-meter.d.ts +26 -0
- package/dist/features/workspace/external-drag.d.ts +99 -0
- package/dist/features/workspace/pane-dnd.d.ts +70 -0
- package/dist/features/workspace/pane-layout-view.d.ts +73 -0
- package/dist/features/workspace/pane-tree.d.ts +141 -0
- package/dist/features/workspace/panel-registry.d.ts +13 -0
- package/dist/features/workspace/reopen-client-tabs.d.ts +44 -0
- package/dist/features/workspace/restore-active-workspace.d.ts +30 -0
- package/dist/features/workspace/status-bar-format.d.ts +20 -0
- package/dist/features/workspace/tab-attention.d.ts +35 -0
- package/dist/features/workspace-picker/OpenWorkspaceDialog.d.ts +11 -0
- package/dist/fonts/CascadiaMono.woff2 +0 -0
- package/dist/fonts/CascadiaMonoNF.woff2 +0 -0
- package/dist/fonts/LICENSE-Cascadia.txt +97 -0
- package/dist/fonts.css +60 -0
- package/dist/hooks/agent-stream-events.d.ts +20 -0
- package/dist/hooks/file-text-state.d.ts +31 -0
- package/dist/hooks/file-transfer-instance.d.ts +10 -0
- package/dist/hooks/use-agent-commands.d.ts +18 -0
- package/dist/hooks/use-agent-deep-link-boot.d.ts +9 -0
- package/dist/hooks/use-agent-stream.d.ts +15 -0
- package/dist/hooks/use-agent-todos.d.ts +10 -0
- package/dist/hooks/use-checkout-status.d.ts +13 -0
- package/dist/hooks/use-connection.d.ts +27 -0
- package/dist/hooks/use-explorer-tree.d.ts +20 -0
- package/dist/hooks/use-explorer-watch.d.ts +39 -0
- package/dist/hooks/use-explorer.d.ts +21 -0
- package/dist/hooks/use-external-pane-drop.d.ts +47 -0
- package/dist/hooks/use-file-diff.d.ts +9 -0
- package/dist/hooks/use-file-download.d.ts +18 -0
- package/dist/hooks/use-file-live-refresh.d.ts +31 -0
- package/dist/hooks/use-file-read.d.ts +31 -0
- package/dist/hooks/use-file-source.d.ts +16 -0
- package/dist/hooks/use-file-text.d.ts +21 -0
- package/dist/hooks/use-file-transfer.d.ts +18 -0
- package/dist/hooks/use-file-watch.d.ts +36 -0
- package/dist/hooks/use-home-dir.d.ts +14 -0
- package/dist/hooks/use-inline-image.d.ts +37 -0
- package/dist/hooks/use-is-compacting.d.ts +9 -0
- package/dist/hooks/use-pane-drag.d.ts +40 -0
- package/dist/hooks/use-pane-layout.d.ts +40 -0
- package/dist/hooks/use-provider-auth-list.d.ts +19 -0
- package/dist/hooks/use-provider-models.d.ts +14 -0
- package/dist/hooks/use-session-restore.d.ts +44 -0
- package/dist/hooks/use-session-stats.d.ts +40 -0
- package/dist/hooks/use-shortcuts.d.ts +6 -0
- package/dist/hooks/use-terminal-exit-watch.d.ts +47 -0
- package/dist/hooks/use-terminal-restore.d.ts +38 -0
- package/dist/hooks/use-thinking-levels.d.ts +13 -0
- package/dist/hooks/use-timeline-reset-watch.d.ts +43 -0
- package/dist/hooks/use-viewer-settings.d.ts +17 -0
- package/dist/host/browser-clipboard.d.ts +9 -0
- package/dist/host/browser-connection.d.ts +13 -0
- package/dist/host/browser-files.d.ts +9 -0
- package/dist/host/browser-host.d.ts +14 -0
- package/dist/host/browser-launch.d.ts +19 -0
- package/dist/host/browser-worker-timers.d.ts +29 -0
- package/dist/host/external-link.d.ts +14 -0
- package/dist/host/index.d.ts +4 -0
- package/dist/host/install.d.ts +21 -0
- package/dist/host/types.d.ts +168 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +18 -0
- package/dist/lib/agent-deep-link.d.ts +29 -0
- package/dist/lib/connection/connection-store.d.ts +49 -0
- package/dist/lib/connection/files-changed.d.ts +41 -0
- package/dist/lib/connection/live-file-transfer.d.ts +8 -0
- package/dist/lib/connection/normalize-url.d.ts +16 -0
- package/dist/lib/connection/query-client.d.ts +3 -0
- package/dist/lib/connection/resolve-connect-target.d.ts +10 -0
- package/dist/lib/connection/resume-action.d.ts +33 -0
- package/dist/lib/connection/resume-handler.d.ts +6 -0
- package/dist/lib/connection/rpc-keys.d.ts +39 -0
- package/dist/lib/drag-guard.d.ts +39 -0
- package/dist/lib/inline-image-cache.d.ts +34 -0
- package/dist/lib/pane-layout-persistence.d.ts +74 -0
- package/dist/lib/paths.d.ts +33 -0
- package/dist/lib/protocol/events.d.ts +19 -0
- package/dist/lib/protocol/timeline-paging.d.ts +29 -0
- package/dist/lib/random-id.d.ts +16 -0
- package/dist/shell/Workbench.d.ts +6 -0
- package/dist/shell/WorkbenchBoot.d.ts +4 -0
- package/dist/shell/WorkbenchProvider.d.ts +10 -0
- package/dist/shell/WorkspaceShell.d.ts +12 -0
- package/dist/shell/context.d.ts +8 -0
- package/dist/shell/hooks.d.ts +32 -0
- package/dist/shell/regions.d.ts +17 -0
- package/dist/stores/compaction-store.d.ts +45 -0
- package/dist/stores/deep-link-store.d.ts +15 -0
- package/dist/stores/draft-store.d.ts +45 -0
- package/dist/stores/explorer-store.d.ts +63 -0
- package/dist/stores/fork-store.d.ts +69 -0
- package/dist/stores/git-store.d.ts +59 -0
- package/dist/stores/layout-store.d.ts +137 -0
- package/dist/stores/materialize.d.ts +47 -0
- package/dist/stores/session-store.d.ts +76 -0
- package/dist/stores/stats-store.d.ts +48 -0
- package/dist/stores/tab-store.d.ts +145 -0
- package/dist/stores/ui-store.d.ts +85 -0
- package/dist/styles.css +1 -0
- package/dist/timeline/FileLink.d.ts +22 -0
- package/dist/timeline/InlineImage.d.ts +16 -0
- package/dist/timeline/bottom-anchor.d.ts +77 -0
- package/dist/timeline/compaction.d.ts +12 -0
- package/dist/timeline/file-link-src.d.ts +34 -0
- package/dist/timeline/file-open-target.d.ts +19 -0
- package/dist/timeline/format-meta-time.d.ts +10 -0
- package/dist/timeline/highlight.d.ts +9 -0
- package/dist/timeline/href-resolution.d.ts +34 -0
- package/dist/timeline/image-src.d.ts +32 -0
- package/dist/timeline/inline-image-view.d.ts +34 -0
- package/dist/timeline/live-tail.d.ts +5 -0
- package/dist/timeline/markdown.d.ts +35 -0
- package/dist/timeline/mermaid-theme.d.ts +23 -0
- package/dist/timeline/reducer.d.ts +38 -0
- package/dist/timeline/row-model.d.ts +154 -0
- package/dist/timeline/streaming-split.d.ts +42 -0
- package/dist/timeline/tool-mapping.d.ts +60 -0
- package/dist/viewer-plugins/viewer-settings-store.d.ts +55 -0
- package/dist/vite/index.d.ts +36 -0
- package/dist/vite/index.js +39 -0
- package/package.json +81 -4
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one accessor the browser host uses to reach the live connection's file transfer, so the host
|
|
3
|
+
* contract never mentions the connection store.
|
|
4
|
+
*/
|
|
5
|
+
import { type FileTransferClient } from "@av-pi-studio/client";
|
|
6
|
+
/** The live connection's shared `FileTransferClient`. Throws `"not connected"` without one. */
|
|
7
|
+
export declare function currentFileTransfer(): FileTransferClient;
|
|
8
|
+
//# sourceMappingURL=live-file-transfer.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize a user-typed daemon address into the `ws://` / `wss://` URL that
|
|
3
|
+
* `DaemonClient` (via the browser `WebSocket`) actually opens.
|
|
4
|
+
*
|
|
5
|
+
* The daemon is a single HTTP server that upgrades to WebSocket on the same port, so users may
|
|
6
|
+
* type whichever scheme they're familiar with:
|
|
7
|
+
* - `http://host[:port]` → `ws://host[:port]`
|
|
8
|
+
* - `https://host[:port]` → `wss://host[:port]`
|
|
9
|
+
* - `ws://` / `wss://` → used as-is
|
|
10
|
+
* - bare `host[:port]` → `ws://host[:port]`
|
|
11
|
+
*
|
|
12
|
+
* `new WebSocket("http://…")` throws in browsers, so this MUST run before the URL reaches the
|
|
13
|
+
* transport. Trailing slashes are trimmed; the input is otherwise left intact (path, query).
|
|
14
|
+
*/
|
|
15
|
+
export declare function normalizeDaemonUrl(input: string): string;
|
|
16
|
+
//# sourceMappingURL=normalize-url.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ConnectTarget } from "../../host/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Resolve what to connect to and how. `input` may be a plain daemon address (`ws://`, `http://`,
|
|
4
|
+
* bare `host:port`) or a full pairing link. A pairing link with a `relay` offer routes to
|
|
5
|
+
* `{ mode: "relay", ... }` (the relay's own dial URL, not the daemon's); a pairing link with a
|
|
6
|
+
* `host` hint routes to `{ mode: "direct", url: <that host> }`; anything else is treated as a
|
|
7
|
+
* plain daemon address, normalized via {@link normalizeDaemonUrl}.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveConnectTarget(input: string): ConnectTarget;
|
|
10
|
+
//# sourceMappingURL=resolve-connect-target.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure, DOM-free decision core for the resume triggers (swe/features/
|
|
3
|
+
* connection-resilience.md § Public Contract, § Decision table). Extracted per this repo's
|
|
4
|
+
* no-jsdom testing convention (see `timeline/text-viewer-state.ts` / `hooks/molecule-reload.ts`).
|
|
5
|
+
*/
|
|
6
|
+
import type { ConnectionState } from "@av-pi-studio/client";
|
|
7
|
+
export type ResumeAction = "none" | "reconnect-now" | "probe";
|
|
8
|
+
export interface ResolveResumeActionInput {
|
|
9
|
+
/** Current daemon connection state. */
|
|
10
|
+
status: ConnectionState;
|
|
11
|
+
/** `connection-store`'s `reconnection !== null` — false means the user explicitly
|
|
12
|
+
* disconnected (or never connected); no resume signal may resurrect that. */
|
|
13
|
+
managerActive: boolean;
|
|
14
|
+
/** Whether a resume probe is already in flight (single-probe guard). */
|
|
15
|
+
probeInFlight: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Decision table (implement exactly — see the spec for the rationale column):
|
|
19
|
+
*
|
|
20
|
+
* | status | managerActive | probeInFlight | -> action |
|
|
21
|
+
* |------------------------|----------------|----------------|-------------------|
|
|
22
|
+
* | closed | true | – | reconnect-now |
|
|
23
|
+
* | open | true | false | probe |
|
|
24
|
+
* | open | true | true | none |
|
|
25
|
+
* | connecting / closing | – | – | none |
|
|
26
|
+
* | any | false | – | none |
|
|
27
|
+
* | idle | – | – | none |
|
|
28
|
+
*
|
|
29
|
+
* The resume *signal* (`"visible"` / `"online"`) is deliberately not a parameter: no row branches
|
|
30
|
+
* on it, so it stays at the wiring layer (the host's `connection.onResume`) where it is useful for logging.
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveResumeAction(input: ResolveResumeActionInput): ResumeAction;
|
|
33
|
+
//# sourceMappingURL=resume-action.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Deliberately shorter than `DaemonClient.ping()`'s 10s default: the daemon answers pings from
|
|
2
|
+
* its socket read loop, so this much silence on a working link is already pathological. */
|
|
3
|
+
export declare const PROBE_TIMEOUT_MS = 5000;
|
|
4
|
+
/** A resume listener with its own probe-in-flight latch. Subscribe it to `host.connection.onResume`. */
|
|
5
|
+
export declare function createResumeHandler(): () => void;
|
|
6
|
+
//# sourceMappingURL=resume-handler.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TanStack Query key factory — one namespaced key builder per RPC domain so cache
|
|
3
|
+
* invalidation (e.g. the `filesChanged` signal, POC_TO_APP_PLAN_UI.md §4.5) targets exactly
|
|
4
|
+
* the affected queries.
|
|
5
|
+
*/
|
|
6
|
+
export declare const rpcKeys: {
|
|
7
|
+
fileRead: (path: string) => readonly ["file", "read", string];
|
|
8
|
+
fileDownload: (path: string) => readonly ["file", "download", string];
|
|
9
|
+
fileText: (path: string, objectUrl: string | null) => readonly ["file", "text", string, string | null];
|
|
10
|
+
fileDiff: (path: string, cwd: string, staged: boolean) => readonly ["file", "diff", string, string, boolean];
|
|
11
|
+
/** Invalidation prefix covering every (cwd, staged) variant of `fileDiff` for one path. */
|
|
12
|
+
fileDiffByPath: (path: string) => readonly ["file", "diff", string];
|
|
13
|
+
/** HTML preview's inlined-asset bundle (sprint-064), keyed on the document's own content hash
|
|
14
|
+
* so it refetches when the file changes and not on an unrelated re-render; Preview/Source and
|
|
15
|
+
* the network-policy toggle deliberately don't appear in the key. */
|
|
16
|
+
htmlAssetBundle: (path: string, contentHash: string) => readonly ["file", "htmlAssets", string, string];
|
|
17
|
+
/** Invalidation prefix covering every content-hash variant of `htmlAssetBundle` for one path —
|
|
18
|
+
* Reload uses this so it forces a refetch even when the document's own hash is unchanged (an
|
|
19
|
+
* edited *asset*, not the document itself, per the spec's documented limitation). */
|
|
20
|
+
htmlAssetBundleByPath: (path: string) => readonly ["file", "htmlAssets", string];
|
|
21
|
+
explorer: (path: string) => readonly ["explorer", string];
|
|
22
|
+
agentList: () => readonly ["agents", "list"];
|
|
23
|
+
/** Per agent as well as provider: an agent's live process answers with its own list. */
|
|
24
|
+
providerModels: (provider: string, agentId: string | null | undefined) => readonly ["providers", "models", string, string | null];
|
|
25
|
+
/** Prefix over every `providerModels` entry — invalidated when credentials change (login/logout),
|
|
26
|
+
* which changes which models every provider offers. */
|
|
27
|
+
providerModelsAll: () => readonly ["providers", "models"];
|
|
28
|
+
agentTimeline: (agentId: string) => readonly ["agents", "timeline", string];
|
|
29
|
+
/** sprint-070: live session's thinking levels (`agent_thinking_levels_request`), keyed on the
|
|
30
|
+
* model so a model change refetches automatically on the next open. */
|
|
31
|
+
thinkingLevels: (agentId: string, model: string | undefined) => readonly ["agents", "thinkingLevels", string, string];
|
|
32
|
+
agentCommands: (sessionId: string) => readonly ["agents", "commands", string];
|
|
33
|
+
/** sprint-065: `listProviderAuth()` result — invalidated after a login (task-004) or logout. */
|
|
34
|
+
providerAuthList: () => readonly ["providers", "auth", "list"];
|
|
35
|
+
/** sprint-075: `listSkills()` result — invalidated by `onSkillsChanged` and by a successful
|
|
36
|
+
* toggle's post-mutation response. */
|
|
37
|
+
skillsList: () => readonly ["skills", "list"];
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=rpc-keys.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `drag-guard` — takes cross-document children out of hit-testing for the duration of a drag.
|
|
3
|
+
*
|
|
4
|
+
* An `<iframe>` is a separate document that hit-tests on its own. While the cursor is over one, the
|
|
5
|
+
* *parent* document receives neither `pointermove` (dnd-kit's sensor listens on the owner document
|
|
6
|
+
* — its bundle contains no `setPointerCapture` at all) nor `dragover`/`drop` (native HTML5 DnD
|
|
7
|
+
* dispatches into the frame's own document). So a tab or a sidebar file dragged over `HtmlViewer`'s
|
|
8
|
+
* preview loses its drop preview and cannot be dropped: the pane beneath the iframe is unreachable
|
|
9
|
+
* even though it is the obvious target.
|
|
10
|
+
*
|
|
11
|
+
* `PaneDividers`/`ResizeHandle` fix their version of this with `setPointerCapture`, which redirects
|
|
12
|
+
* a single pointer's events to the handle that owns the gesture. That mechanism is unavailable
|
|
13
|
+
* here — dnd-kit owns the pointer gesture for a tab drag, and native drag-and-drop has no
|
|
14
|
+
* pointer-capture concept whatsoever. Removing the frame from hit-testing is the one mechanism that
|
|
15
|
+
* covers both systems.
|
|
16
|
+
*
|
|
17
|
+
* Implemented as an attribute on `<body>` plus a CSS rule, deliberately *not* as React state:
|
|
18
|
+
* arming it costs no re-render mid-gesture, and it never touches the iframe's `srcDoc` — a re-set
|
|
19
|
+
* `srcDoc` reloads the previewed document and re-runs its scripts (`HtmlViewer`'s single-load
|
|
20
|
+
* rule). It is also viewer-agnostic: any future embedded frame is covered without new wiring.
|
|
21
|
+
*
|
|
22
|
+
* The paired rule lives in `global.css`. `drag-guard.test.ts` fails the build if the attribute here
|
|
23
|
+
* and the selector there ever drift apart.
|
|
24
|
+
*/
|
|
25
|
+
/** Set on `<body>` while any drag gesture is in flight. Mirrored by `global.css`'s guard rule. */
|
|
26
|
+
export declare const DRAG_GUARD_ATTR = "data-pi-dragging";
|
|
27
|
+
/** The slice of `Element` this module touches — keeps it drivable without a DOM in tests. */
|
|
28
|
+
export interface DragGuardTarget {
|
|
29
|
+
setAttribute(name: string, value: string): void;
|
|
30
|
+
removeAttribute(name: string): void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Arm the guard. Idempotent: the two drag systems are mutually exclusive (`TabPanelHost`), but a
|
|
34
|
+
* gesture that ends in `dragend` *and* `drop` must not leave the guard half-released.
|
|
35
|
+
*/
|
|
36
|
+
export declare function armDragGuard(target?: DragGuardTarget): void;
|
|
37
|
+
/** Disarm the guard. Idempotent, for the same reason. */
|
|
38
|
+
export declare function disarmDragGuard(target?: DragGuardTarget): void;
|
|
39
|
+
//# sourceMappingURL=drag-guard.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ref-counted, LRU-bounded view-URL cache for inline chat images (features/inline-image-
|
|
3
|
+
* rendering.md § Inline image fetch + cache). Framework-free and module-scoped so it survives
|
|
4
|
+
* virtualized row unmount/remount: `useInlineImage` (`hooks/use-inline-image.ts`) is the only
|
|
5
|
+
* consumer, but this file has no React import so it is testable without one.
|
|
6
|
+
*
|
|
7
|
+
* Deliberately NOT `useFileDownload`'s retention policy (`staleTime: Infinity, gcTime: 0`,
|
|
8
|
+
* release-on-unmount) — that model is correct for a file tab (one exclusive viewer at a time) and
|
|
9
|
+
* wrong here: the timeline virtualizes rows, so an image scrolled out of view and back would
|
|
10
|
+
* release its URL and re-download on every scroll past. This cache instead releases a view URL
|
|
11
|
+
* only on LRU eviction (bounded at `MAX_INLINE_IMAGE_ENTRIES`) or on `clearInlineImageCache()`
|
|
12
|
+
* (connection teardown) — never on a mount's own unmount. Do not "fix" this into a `useQuery`;
|
|
13
|
+
* TanStack Query's cache has no way to express "release only on LRU eviction, not on unmount".
|
|
14
|
+
*
|
|
15
|
+
* URLs come from the host's `files.openForView` (injected; browser: `Blob` object URLs).
|
|
16
|
+
*/
|
|
17
|
+
import { type ViewableFile } from "../host/types.js";
|
|
18
|
+
export interface InlineImageEntry {
|
|
19
|
+
objectUrl: string;
|
|
20
|
+
mimeType?: string;
|
|
21
|
+
}
|
|
22
|
+
/** Bounded LRU size, exported so tests can assert against it directly. */
|
|
23
|
+
export declare const MAX_INLINE_IMAGE_ENTRIES = 32;
|
|
24
|
+
/**
|
|
25
|
+
* Acquire (opening if needed) and increment the ref count. Concurrent callers of the same path
|
|
26
|
+
* share one in-flight open and both resolve to the same URL. `open` is injected (never imported)
|
|
27
|
+
* so this module is testable with no host or daemon.
|
|
28
|
+
*/
|
|
29
|
+
export declare function acquireInlineImage(path: string, open: (path: string) => Promise<ViewableFile>): Promise<InlineImageEntry>;
|
|
30
|
+
/** Decrement the ref count. Never releases — retention past zero refs is the LRU's job. */
|
|
31
|
+
export declare function releaseInlineImage(path: string): void;
|
|
32
|
+
/** Release every URL and clear the map (connection teardown / tests). */
|
|
33
|
+
export declare function clearInlineImageCache(): void;
|
|
34
|
+
//# sourceMappingURL=inline-image-cache.d.ts.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pane layout persistence — one versioned, client-local record holding every workspace's pane
|
|
3
|
+
* arrangement, keyed against **stable tab identities** rather than tab ids.
|
|
4
|
+
*
|
|
5
|
+
* Why identities: terminal tab ids are not stable across a reconnect (see `tab-store.tabIdentity`,
|
|
6
|
+
* which computes them — it lives there because `tab-store` calls it on every open).
|
|
7
|
+
*
|
|
8
|
+
* Why the write is debounced and *also* triggered by tab-store changes: a divider drag mutates the
|
|
9
|
+
* layout per pointer frame, so writes are trailing-debounced; and acquiring an identity counts as a
|
|
10
|
+
* mutation, because a terminal placed by drag and never touched again would otherwise lose its pane
|
|
11
|
+
* when its daemon slot finally arrives.
|
|
12
|
+
*
|
|
13
|
+
* swe/features/workspace-split-panes.md § Persisted layout record, § Tab identity,
|
|
14
|
+
* § Data & Persistence
|
|
15
|
+
*/
|
|
16
|
+
import { PANE_LAYOUT_VERSION, type PaneNode } from "../features/workspace/pane-tree.js";
|
|
17
|
+
/** Short enough to survive a reload, long enough that a divider drag writes once. */
|
|
18
|
+
export declare const PANE_LAYOUT_WRITE_DEBOUNCE_MS = 250;
|
|
19
|
+
export interface PersistedWorkspaceLayout {
|
|
20
|
+
/** Untrusted on load — validated by `parsePaneTree`. */
|
|
21
|
+
tree: unknown;
|
|
22
|
+
/** identity → pane id */
|
|
23
|
+
placement: Record<string, string>;
|
|
24
|
+
/** pane id → identity */
|
|
25
|
+
activeByPane: Record<string, string>;
|
|
26
|
+
activePaneId: string;
|
|
27
|
+
}
|
|
28
|
+
export interface PersistedPaneLayout {
|
|
29
|
+
version: typeof PANE_LAYOUT_VERSION;
|
|
30
|
+
/** Keyed by normalized workspace cwd. */
|
|
31
|
+
workspaces: Record<string, PersistedWorkspaceLayout>;
|
|
32
|
+
/** The workspace that was in view. Optional — records written before this existed simply lack it. */
|
|
33
|
+
activeWorkspaceCwd?: string;
|
|
34
|
+
}
|
|
35
|
+
/** A validated record: geometry per workspace, plus which one was in view. */
|
|
36
|
+
export interface LoadedPaneLayout {
|
|
37
|
+
workspaces: Map<string, ValidatedWorkspaceLayout>;
|
|
38
|
+
/** `null` when absent, or naming a workspace whose entry did not survive validation. */
|
|
39
|
+
activeWorkspaceCwd: string | null;
|
|
40
|
+
}
|
|
41
|
+
/** A loaded workspace entry whose tree parsed and whose pane references are known to exist. */
|
|
42
|
+
export interface ValidatedWorkspaceLayout {
|
|
43
|
+
tree: PaneNode;
|
|
44
|
+
/** identity → pane id; every pane id is a leaf of `tree`. */
|
|
45
|
+
placement: Record<string, string>;
|
|
46
|
+
/** pane id → identity; every pane id is a leaf of `tree`. */
|
|
47
|
+
activeByPane: Record<string, string>;
|
|
48
|
+
/** `null` when absent or naming a pane that is not in `tree` — the caller picks a fallback. */
|
|
49
|
+
activePaneId: string | null;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Read the record, discarding what cannot be trusted: a `version` mismatch drops the **whole**
|
|
53
|
+
* record, a structurally damaged tree drops only **that workspace's** entry, and pane references
|
|
54
|
+
* that do not exist in the parsed tree are dropped individually. Never throws.
|
|
55
|
+
*/
|
|
56
|
+
export declare function loadPaneLayout(): LoadedPaneLayout;
|
|
57
|
+
/** Queue a write on a trailing debounce, so a pointer-frame burst collapses into one. */
|
|
58
|
+
export declare function schedulePaneLayoutWrite(): void;
|
|
59
|
+
/** Write immediately, cancelling any pending debounce (tests, `pagehide`). */
|
|
60
|
+
export declare function flushPaneLayoutWrite(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Wire the write triggers; returns the teardown. Called once at app bootstrap.
|
|
63
|
+
*
|
|
64
|
+
* Layout mutations are the obvious trigger. The other two exist purely for **identity acquisition**,
|
|
65
|
+
* where a tab becomes restorable without any layout state changing:
|
|
66
|
+
* - `tab-store` — a terminal's daemon slot arrives via `updateData`.
|
|
67
|
+
* - `session-store` — a draft chat's `createAgent` returns and `bindAgent` supplies the agent id the
|
|
68
|
+
* chat's identity is keyed on (`materialize.ts`). Nothing in `tab-store` changes, so without this
|
|
69
|
+
* the pane holding a brand-new conversation would stay unclaimed until some later layout mutation
|
|
70
|
+
* happened to flush it. The subscription fires on every stream event too; re-deriving the
|
|
71
|
+
* signature is a short string join over the open tabs, and a no-change result schedules nothing.
|
|
72
|
+
*/
|
|
73
|
+
export declare function installPaneLayoutPersistence(): () => void;
|
|
74
|
+
//# sourceMappingURL=pane-layout-persistence.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared workspace-path resolution — join a possibly-relative path against a workspace `base`
|
|
3
|
+
* (a cwd, an explorer root, …). Lifted out of the file tab live-refresh hook's own resolver
|
|
4
|
+
* (task-007/step 1 there) because a second consumer (inline chat images, task-002) needs the exact
|
|
5
|
+
* same join/trailing-slash contract, and a second copy would reintroduce the tilde/absolute
|
|
6
|
+
* duplicate-path bug this function exists to prevent.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Absolute target for a possibly-relative `path` joined against `base`. A leading `/` or `~` is
|
|
10
|
+
* returned as-is — for `~`, deliberately unexpanded: the daemon expands `~` server-side
|
|
11
|
+
* (root `AGENTS.md` invariant 7), and callers that need `~` expanded for their OWN purposes (e.g.
|
|
12
|
+
* a client-side cache key) go through `normalizeCwd` instead, which is a different concern from
|
|
13
|
+
* what the daemon receives.
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolveWorkspacePath(path: string, base: string): string | null;
|
|
16
|
+
/** Parent directory of an absolute path — `"/foo/bar"` → `"/foo"`, `"/foo"` → `"/"`. */
|
|
17
|
+
export declare function dirOf(path: string): string;
|
|
18
|
+
/** `path` relative to `root` (both absolute) — strips the root prefix and any leading slash.
|
|
19
|
+
* Returns `path` unchanged if it isn't nested under `root`. */
|
|
20
|
+
export declare function relativeToRoot(path: string, root: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Lexically collapses `.` and `..` segments in an absolute path without filesystem access.
|
|
23
|
+
* Handles each segment in order, appending to a stack and popping for `..` (unless already at root).
|
|
24
|
+
* Returns the normalized path. Input must be absolute (starts with `/`).
|
|
25
|
+
*
|
|
26
|
+
* Examples:
|
|
27
|
+
* - `/repo/./notes.md` → `/repo/notes.md`
|
|
28
|
+
* - `/repo/a/../notes.md` → `/repo/notes.md`
|
|
29
|
+
* - `/repo/a/../../notes.md` → `/notes.md`
|
|
30
|
+
* - `/../notes.md` → `/notes.md` (leading `..` clamped to root)
|
|
31
|
+
*/
|
|
32
|
+
export declare function collapseDotSegments(path: string): string;
|
|
33
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `fetch_agent_timeline_request` returns `items: unknown[]` (not yet in the strict protocol
|
|
3
|
+
* union). The POC's `restoreSessions()` observed a stable shape at runtime: each item is
|
|
4
|
+
* `{kind:'other'|'assistant'|'tool_call', event?, events?, timestamp?}` carrying nested
|
|
5
|
+
* `AgentStreamEvent`s. This flattens that shape into a plain event list the timeline reducer can
|
|
6
|
+
* replay, pairing each event with the timestamp of the *row that started it* - an `assistant`/
|
|
7
|
+
* `tool_call` item's `timestamp` is the group's first source row, so only the first flattened
|
|
8
|
+
* event of such a group carries it; later chunks in the same group carry `undefined` (the row
|
|
9
|
+
* they append to already has one).
|
|
10
|
+
*/
|
|
11
|
+
import type { AgentStreamEvent } from "@av-pi-studio/protocol";
|
|
12
|
+
/** One replayable event paired with the timestamp of the row that introduced it, if known. */
|
|
13
|
+
export interface TimestampedEvent {
|
|
14
|
+
event: AgentStreamEvent;
|
|
15
|
+
timestamp?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Flatten authoritative timeline `items` into an ordered, timestamp-paired event list for replay. */
|
|
18
|
+
export declare function flattenTimelineItems(items: readonly unknown[]): TimestampedEvent[];
|
|
19
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drain an agent's authoritative timeline across every page.
|
|
3
|
+
*
|
|
4
|
+
* `fetch_agent_timeline_request` is BOUNDED: the daemon returns at most `limit` projected items
|
|
5
|
+
* (default 200, `timeline-store.ts` `DEFAULT_PAGE_SIZE`) and reports `hasNewer:true` when more rows
|
|
6
|
+
* exist past the page — the contract is "clients page to completion" (`timeline-rpc.ts`). A single
|
|
7
|
+
* `direction:"after"` fetch therefore returns the OLDEST page only, silently dropping the newest
|
|
8
|
+
* messages of any conversation longer than the cap. That's what made restored history stop partway
|
|
9
|
+
* through: the daemon's rehydrated timeline (rebuilt from Pi's session file) was complete, the UI
|
|
10
|
+
* just never asked for the rest.
|
|
11
|
+
*/
|
|
12
|
+
import { type TimestampedEvent } from "./events.js";
|
|
13
|
+
/** The subset of `FetchAgentTimelineResponse` paging needs (structural, so tests need no wire types). */
|
|
14
|
+
export interface TimelinePageLike {
|
|
15
|
+
items: readonly unknown[];
|
|
16
|
+
hasNewer: boolean;
|
|
17
|
+
endCursor?: string | null;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Fetch forward from the start of the timeline until the daemon reports no newer rows, flattening
|
|
21
|
+
* every page into one ordered `TimestampedEvent[]` ready for `applyStreamEvent` replay.
|
|
22
|
+
*
|
|
23
|
+
* `fetchPage` receives the cursor to resume from (`null` for the first page). Paging stops on
|
|
24
|
+
* `hasNewer:false`, an empty page, or a cursor that fails to advance — the daemon's `endCursor` is
|
|
25
|
+
* the page's max source seq and strictly increases while `hasNewer` holds, so a repeated or absent
|
|
26
|
+
* cursor means a non-conforming response, not more history.
|
|
27
|
+
*/
|
|
28
|
+
export declare function fetchTimelineEvents(fetchPage: (cursor: string | null) => Promise<TimelinePageLike>): Promise<TimestampedEvent[]>;
|
|
29
|
+
//# sourceMappingURL=timeline-paging.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Portable random-id generator (pane ids, optimistic-echo `clientMessageId`s, Mermaid DOM ids).
|
|
3
|
+
* `crypto.randomUUID` requires a secure context, which plain-http access to a self-hosted daemon
|
|
4
|
+
* over a LAN — the deployment `pi-studio ui` documents and defaults to (127.0.0.1, but users
|
|
5
|
+
* routinely reach it via a LAN IP or hostname to view it from another device) — does not satisfy;
|
|
6
|
+
* there `crypto.randomUUID` is `undefined` and calling it throws
|
|
7
|
+
* `TypeError: crypto.randomUUID is not a function` (real regression, not hypothetical — mirrors
|
|
8
|
+
* `host/browser-clipboard.ts`'s `navigator.clipboard` fallback and `@av-pi-studio/client`'s `randomId()`).
|
|
9
|
+
*
|
|
10
|
+
* `crypto.getRandomValues` has no such restriction (available in every context WebCrypto ships
|
|
11
|
+
* in at all), so it is preferred over `randomUUID` here rather than falling straight to
|
|
12
|
+
* `Math.random`. Falls back to a timestamp+`Math.random` id only when `crypto` itself is
|
|
13
|
+
* unavailable.
|
|
14
|
+
*/
|
|
15
|
+
export declare function randomId(): string;
|
|
16
|
+
//# sourceMappingURL=random-id.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type WorkbenchHost } from "../host/types.js";
|
|
2
|
+
/** The whole application: providers, the boot sequence and the default three-column shell. */
|
|
3
|
+
export declare function Workbench({ host }: {
|
|
4
|
+
host?: WorkbenchHost;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=Workbench.d.ts.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Runs the application's boot sequence. Renders nothing; mount exactly once inside
|
|
2
|
+
* `WorkbenchProvider`. A second instance does nothing and warns once in development. */
|
|
3
|
+
export declare function WorkbenchBoot(): import("react").JSX.Element | null;
|
|
4
|
+
//# sourceMappingURL=WorkbenchBoot.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type WorkbenchHost } from "../host/types.js";
|
|
3
|
+
import "../global.css";
|
|
4
|
+
export interface WorkbenchProviderProps {
|
|
5
|
+
/** The embedding shell's host. Omitted: the browser host. Installed once; later changes are ignored. */
|
|
6
|
+
host?: WorkbenchHost;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function WorkbenchProvider({ host, children }: WorkbenchProviderProps): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=WorkbenchProvider.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkspaceShell — the 3-column shell (POC `.main`: sidebar-left / center / sidebar-right,
|
|
3
|
+
* POC_TO_APP_PLAN_UI.md §3). Feature panels are mounted here once each lands. Either sidebar can
|
|
4
|
+
* be hidden via the ConnectionBar's panel toggles (`ui-store.ts` `leftSidebarCollapsed`/
|
|
5
|
+
* `rightSidebarCollapsed`) — collapsed just means the `aside` isn't rendered, so `TabPanelHost`'s
|
|
6
|
+
* `.center` column simply grows to fill the freed width. Each visible sidebar is resizable via a
|
|
7
|
+
* `ResizeHandle` on its inner edge, dragging `ui-store.ts`'s `leftSidebarWidth`/
|
|
8
|
+
* `rightSidebarWidth` (clamped to `[MIN_SIDEBAR_WIDTH, MAX_SIDEBAR_WIDTH]`) through the
|
|
9
|
+
* delta-based `resizeLeftSidebar`/`resizeRightSidebar` actions.
|
|
10
|
+
*/
|
|
11
|
+
export declare function WorkspaceShell(): import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=WorkspaceShell.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type WorkbenchHost } from "../host/types.js";
|
|
2
|
+
/** Present (the installed host) inside `WorkbenchProvider`, `null` outside it. */
|
|
3
|
+
export declare const WorkbenchContext: import("react").Context<WorkbenchHost | null>;
|
|
4
|
+
/** Every public region and hook calls this first, so misuse fails with a message that says what
|
|
5
|
+
* is missing instead of an obscure store or theme error further down. */
|
|
6
|
+
export declare function useRequireWorkbench(name: string): WorkbenchHost;
|
|
7
|
+
export declare function warnOnce(key: string, message: string): void;
|
|
8
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-mostly views over the private stores for a custom shell
|
|
3
|
+
* (`swe/architecture/workbench-package.md` § Root entry: hooks). The stores themselves stay private.
|
|
4
|
+
*/
|
|
5
|
+
import { type ConnectionState } from "@av-pi-studio/client";
|
|
6
|
+
import { type ServerInfoPayload } from "@av-pi-studio/protocol";
|
|
7
|
+
import { type ConnectOptions } from "../lib/connection/connection-store.js";
|
|
8
|
+
export interface WorkbenchConnection {
|
|
9
|
+
status: ConnectionState;
|
|
10
|
+
serverInfo: ServerInfoPayload | null;
|
|
11
|
+
error: string | null;
|
|
12
|
+
connect(options: ConnectOptions): Promise<void>;
|
|
13
|
+
disconnect(): void;
|
|
14
|
+
}
|
|
15
|
+
export declare function useConnection(): WorkbenchConnection;
|
|
16
|
+
export interface SidebarLayout {
|
|
17
|
+
collapsed: boolean;
|
|
18
|
+
width: number;
|
|
19
|
+
toggle(): void;
|
|
20
|
+
/** Grow (positive) or shrink by `delta` pixels, clamped. */
|
|
21
|
+
resize(delta: number): void;
|
|
22
|
+
}
|
|
23
|
+
export declare function useShellLayout(): {
|
|
24
|
+
left: SidebarLayout;
|
|
25
|
+
right: SidebarLayout;
|
|
26
|
+
};
|
|
27
|
+
export declare function useSettingsDialog(): {
|
|
28
|
+
open: boolean;
|
|
29
|
+
openSettings(): void;
|
|
30
|
+
closeSettings(): void;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The public shell regions (`swe/architecture/workbench-package.md` § Root entry: components). Each
|
|
3
|
+
* wraps the internal component and first checks it is inside `WorkbenchProvider`, so a custom
|
|
4
|
+
* layout that forgets the provider gets a message naming it rather than a store or theme error.
|
|
5
|
+
*/
|
|
6
|
+
import { type SettingsDialogProps } from "../features/settings/SettingsDialog.js";
|
|
7
|
+
export declare function ConnectionBar(): import("react").JSX.Element;
|
|
8
|
+
export declare function SessionList(): import("react").JSX.Element;
|
|
9
|
+
/** The split-pane and tab area. */
|
|
10
|
+
export declare function PaneArea(): import("react").JSX.Element;
|
|
11
|
+
export declare function RightSidebar(): import("react").JSX.Element;
|
|
12
|
+
export declare function StatusBar(): import("react").JSX.Element;
|
|
13
|
+
/** The workspace picker. Opens itself from the UI store (`ui-store`'s workspace-picker state). */
|
|
14
|
+
export declare function OpenWorkspaceDialog(): import("react").JSX.Element;
|
|
15
|
+
export declare function SettingsDialog(props: SettingsDialogProps): import("react").JSX.Element;
|
|
16
|
+
export type { SettingsDialogProps };
|
|
17
|
+
//# sourceMappingURL=regions.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compaction action state (sprint-074) — the one code path that sends `agent_compact_request`,
|
|
3
|
+
* shared by the context-meter popover and the composer's `/compact` built-in so the two can never
|
|
4
|
+
* differ on preconditions, in-progress tracking, or how the estimate lands.
|
|
5
|
+
*
|
|
6
|
+
* `pendingBySession` is the **local** in-progress flag: it covers the RPC round trip and is the
|
|
7
|
+
* only in-progress signal against a daemon without the `compactionEvents` flag (no `compaction`
|
|
8
|
+
* stream events, so no timeline row). Against newer daemons the timeline's `started` row says the
|
|
9
|
+
* same thing (and also for automatic compactions this client didn't start) —
|
|
10
|
+
* `use-is-compacting.ts` ORs the two.
|
|
11
|
+
*
|
|
12
|
+
* The estimate is written from the RPC response only when the daemon does NOT advertise
|
|
13
|
+
* `compactionEvents`: with it, the live `completed` event already seeded the stats
|
|
14
|
+
* (`agent-stream-events.ts`), and applying it twice would be the same write twice.
|
|
15
|
+
*/
|
|
16
|
+
/** Why `compactSession` sent nothing. `failed` is not a refusal — the RPC ran and rejected. */
|
|
17
|
+
export type CompactRefusal = "disconnected" | "no-agent" | "running" | "compacting";
|
|
18
|
+
export type CompactResult = {
|
|
19
|
+
ok: true;
|
|
20
|
+
} | {
|
|
21
|
+
ok: false;
|
|
22
|
+
reason: CompactRefusal;
|
|
23
|
+
}
|
|
24
|
+
/** The user cancelled mid-flight (`cancelCompaction`): Pi rejects the RPC after an abort, but
|
|
25
|
+
* that is the requested outcome, not an error - the timeline's `canceled` divider says it. */
|
|
26
|
+
| {
|
|
27
|
+
ok: false;
|
|
28
|
+
reason: "canceled";
|
|
29
|
+
} | {
|
|
30
|
+
ok: false;
|
|
31
|
+
reason: "failed";
|
|
32
|
+
message: string;
|
|
33
|
+
};
|
|
34
|
+
interface CompactionStoreState {
|
|
35
|
+
pendingBySession: Record<string, true>;
|
|
36
|
+
lastErrorBySession: Record<string, string>;
|
|
37
|
+
/** Compact the session's agent. Resolves (never rejects) with a typed result. */
|
|
38
|
+
compactSession(sessionId: string, instructions?: string): Promise<CompactResult>;
|
|
39
|
+
/** Abort an in-progress compaction — Pi's `abort` cancels it, so this is the ordinary interrupt. */
|
|
40
|
+
cancelCompaction(sessionId: string): Promise<void>;
|
|
41
|
+
clearError(sessionId: string): void;
|
|
42
|
+
}
|
|
43
|
+
export declare const useCompactionStore: import("zustand").UseBoundStore<import("zustand").StoreApi<CompactionStoreState>>;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=compaction-store.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pending agent deep-link target (swe/features/web-ui-agent-deep-link.md). In memory only, never
|
|
3
|
+
* persisted. `restored` flips once the initial session restore has settled, which is when a pending
|
|
4
|
+
* target may first be applied.
|
|
5
|
+
*/
|
|
6
|
+
interface DeepLinkState {
|
|
7
|
+
pendingAgentId: string | undefined;
|
|
8
|
+
restored: boolean;
|
|
9
|
+
set(agentId: string): void;
|
|
10
|
+
consume(): string | undefined;
|
|
11
|
+
markRestored(): void;
|
|
12
|
+
}
|
|
13
|
+
export declare const useDeepLinkStore: import("zustand").UseBoundStore<import("zustand").StoreApi<DeepLinkState>>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=deep-link-store.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Draft store — per-session composer text, lifted out of `Composer.tsx`'s local `useState`
|
|
3
|
+
* (sprint-069/task-007) so a `set_editor_text` extension effect can write a session's draft even
|
|
4
|
+
* when no composer for that session is currently mounted (no chat tab ever opened for it): the
|
|
5
|
+
* text lands here and is picked up as the initial value the moment a composer for that session
|
|
6
|
+
* first mounts. `TabPanelHost.tsx` keeps every *opened* tab's composer mounted-but-hidden for
|
|
7
|
+
* life, so in practice this also just naturally survives ordinary tab switches — the same "one
|
|
8
|
+
* source of truth outside the component" shape as `toast-store.ts`, not a new pattern.
|
|
9
|
+
*
|
|
10
|
+
* `pendingFeedback` is the visible/deferred-note handoff for § 11's `set_editor_text` treatment:
|
|
11
|
+
* `replaceDraft`'s caller decides `flash` (true only when applied while that session's composer
|
|
12
|
+
* was on screen at that exact moment — never replayed later), and the border flash/note UI those
|
|
13
|
+
* are rendered as is owned entirely by `Composer.tsx`, not this store. One-shot by design: § 11's
|
|
14
|
+
* background-pane note "appears the first time the pane is shown, then expires" — `consumeFeedback`
|
|
15
|
+
* pops the entry so a second mount/visibility-flip of the same composer sees nothing.
|
|
16
|
+
*/
|
|
17
|
+
export interface DraftFeedback {
|
|
18
|
+
/** "filled" when the prior draft was empty, "replaced" otherwise — § 11's two copy variants
|
|
19
|
+
* ("Your message was filled in" / "Your draft was replaced"), decided from the draft's PRIOR
|
|
20
|
+
* state, never from whether the incoming text itself happens to be empty. */
|
|
21
|
+
copy: "replaced" | "filled";
|
|
22
|
+
/** Whether to play the border flash. `false` means note-only — either because the composer was
|
|
23
|
+
* not visible at the moment of replacement (§ 11's background-pane rule), or because there is
|
|
24
|
+
* no composer mounted anywhere for this session yet. */
|
|
25
|
+
flash: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface DraftStoreState {
|
|
28
|
+
/** Per-session draft text. A session with no entry has an empty draft — same default as the
|
|
29
|
+
* old per-composer `useState("")`. */
|
|
30
|
+
drafts: Record<string, string>;
|
|
31
|
+
/** At most one queued `set_editor_text` feedback per session, consumed exactly once. */
|
|
32
|
+
pendingFeedback: Record<string, DraftFeedback>;
|
|
33
|
+
/** Ordinary user-driven draft edits (typing, slash-command completion, clearing on submit) —
|
|
34
|
+
* never produces feedback. */
|
|
35
|
+
setDraft(sessionId: string, text: string): void;
|
|
36
|
+
/** `set_editor_text` effect application. `visible` is the target session's composer's on-screen
|
|
37
|
+
* state at the exact moment this is called — the caller (`agent-ui-store.ts`) must compute it
|
|
38
|
+
* fresh per effect, never cache it. */
|
|
39
|
+
replaceDraft(sessionId: string, text: string, visible: boolean): void;
|
|
40
|
+
/** Pops and returns `sessionId`'s queued feedback, or `undefined` if none is pending. */
|
|
41
|
+
consumeFeedback(sessionId: string): DraftFeedback | undefined;
|
|
42
|
+
}
|
|
43
|
+
export declare const useDraftStore: import("zustand").UseBoundStore<import("zustand").StoreApi<DraftStoreState>>;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=draft-store.d.ts.map
|