@av-pi-studio/workbench 0.0.0-stage → 0.0.117
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,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TerminalPanel — @xterm/xterm mount + binary-frame streaming via `TerminalStreamRouter`
|
|
3
|
+
* (POC `initTerminalPanel`, POC_TO_APP_PLAN_UI.md §4.6). Strict upgrade over the POC's 800ms
|
|
4
|
+
* `capture_terminal_request` poll: the daemon pushes `Output`/`Snapshot`/`Restore` binary frames
|
|
5
|
+
* directly over the one shared `DaemonClient` connection, demuxed by slot.
|
|
6
|
+
*
|
|
7
|
+
* Slot lifecycle: created once via `create_terminal_request`, then persisted onto the tab's
|
|
8
|
+
* `TerminalTabData.slot` via `useTabStore.getState().updateData` so switching away and back to
|
|
9
|
+
* this tab (kept mounted-but-hidden by `TabPanelHost`) never recreates the terminal. `TabPanelHost`
|
|
10
|
+
* only unmounts a tab's panel when the tab leaves the store's `tabs[]` (i.e. real tab close, never
|
|
11
|
+
* a tab switch) — this component's true-unmount effect below relies on exactly that invariant to
|
|
12
|
+
* send `kill_terminal_request`, terminating the PTY server-side instead of leaking it forever.
|
|
13
|
+
*
|
|
14
|
+
* Mount vs. subscribe are two separate effects (sprint-052/task-001): the emulator (xterm + fit +
|
|
15
|
+
* `onData`/`onResize`) mounts as soon as the container exists, independent of the slot, so
|
|
16
|
+
* `onResize` is attached before the first `fitAddon.fit()` ever runs — closing the window where
|
|
17
|
+
* xterm's one size-changing fit of the panel's life used to fire with no listener. The stream
|
|
18
|
+
* subscription is keyed on `[client, slot]` instead, so a reconnect (new `client`) re-subscribes
|
|
19
|
+
* without tearing down and rebuilding the emulator, preserving scrollback across it.
|
|
20
|
+
*
|
|
21
|
+
* PTY sizing (`terminals.md` § PTY size ownership) is a single seam, `claimSize`, behind two
|
|
22
|
+
* independent gates: `isSizeAuthority` (permission — is this panel the visible renderer, in the
|
|
23
|
+
* active workspace, as its pane's active tab?) and `shouldClaimSize` (validity + dedupe against
|
|
24
|
+
* `believedSizeRef`, what we think the PTY currently is). Keeping knowledge and permission separate
|
|
25
|
+
* is load-bearing: a *restored* terminal's PTY predates this client, so it believes nothing, and an
|
|
26
|
+
* earlier revision that treated "never sent a size" as "not allowed to send one" left every
|
|
27
|
+
* restored terminal ignoring resizes for its entire life. Every claim funnels through `onResize`
|
|
28
|
+
* (real grid changes) or a `performRefit` reconcile (covers a panel that measured 0×0 while hidden
|
|
29
|
+
* and would otherwise fit to an unchanged grid and stay silent).
|
|
30
|
+
*/
|
|
31
|
+
import "@xterm/xterm/css/xterm.css";
|
|
32
|
+
import type { Tab } from "../../stores/tab-store.js";
|
|
33
|
+
export interface TerminalPanelProps {
|
|
34
|
+
tab: Tab;
|
|
35
|
+
}
|
|
36
|
+
export declare function TerminalPanel({ tab }: TerminalPanelProps): import("react").JSX.Element;
|
|
37
|
+
//# sourceMappingURL=TerminalPanel.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal webfont readiness (`src/fonts.css`, `theme/tokens.ts`'s `TERMINAL_FONT_STACK`).
|
|
3
|
+
*
|
|
4
|
+
* xterm.js measures one character to derive its cell size, once, inside `terminal.open()`, and the
|
|
5
|
+
* DOM renderer positions every row against that number. Measuring before the bundled face has
|
|
6
|
+
* loaded therefore measures a *fallback* font and pins the grid to the wrong width for the life of
|
|
7
|
+
* the emulator — visibly a shell that wraps early and paints backgrounds short of the last column.
|
|
8
|
+
* Re-measuring afterwards is not available to an embedder: `CharSizeService.measure()` is internal,
|
|
9
|
+
* and xterm's options setter drops an assignment equal to the current value
|
|
10
|
+
* (`OptionsService._setupOptions`), so the usual "re-assign `options.fontFamily` to force a
|
|
11
|
+
* re-measure" trick is a no-op for the font we already set. Waiting is the honest fix.
|
|
12
|
+
*
|
|
13
|
+
* The wait is one shared promise, resolved at most once per page: N terminal tabs must not each
|
|
14
|
+
* issue their own `FontFaceSet.load`, and a tab opened later must not wait again for a face that
|
|
15
|
+
* is already in memory — `isTerminalFontReady()` is the synchronous fast path for exactly that,
|
|
16
|
+
* and is true for every terminal after the first.
|
|
17
|
+
*
|
|
18
|
+
* Only the TEXT face is awaited. The icon face is deliberately not: it is range-restricted to the
|
|
19
|
+
* private-use planes (`src/fonts.css`), so probing it here would pull 976 KB into a session that
|
|
20
|
+
* may never paint a single icon — and it cannot affect the measurement anyway, since both files
|
|
21
|
+
* share one advance width by construction.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Whether the terminal's text face can be painted right now, so the caller may measure a cell
|
|
25
|
+
* synchronously. `FontFaceSet.check` reports on the document's own `@font-face` rules only, and
|
|
26
|
+
* answers `true` when none of them match — which is the correct answer for a browser that will
|
|
27
|
+
* render the stack from an installed font.
|
|
28
|
+
*
|
|
29
|
+
* `document.fonts` is absent in a non-DOM environment and in a few embedded webviews; both mean
|
|
30
|
+
* "nothing to wait for", never "wait forever". A throw is only reachable if the shorthand fails to
|
|
31
|
+
* parse, which would be a bug in the stack constant rather than a runtime condition — mounting
|
|
32
|
+
* against a fallback still beats hanging.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isTerminalFontReady(): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Resolves when the terminal's text face is painted-ready, or when waiting stops being worth it.
|
|
37
|
+
* Never rejects — a font failure must not take a terminal tab down with it.
|
|
38
|
+
*
|
|
39
|
+
* Started at module import (i.e. when the first terminal panel is code-loaded) rather than lazily
|
|
40
|
+
* per mount, so the fetch overlaps the `create_terminal_request` round-trip instead of following
|
|
41
|
+
* it.
|
|
42
|
+
*/
|
|
43
|
+
export declare const terminalFontReady: Promise<void>;
|
|
44
|
+
//# sourceMappingURL=terminal-font.d.ts.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal PTY size-claim decisions (`swe/features/terminals.md` § PTY size
|
|
3
|
+
* ownership). Pure and DOM-free so the ownership gate is unit-testable under the repo's Node-only
|
|
4
|
+
* vitest environment — `TerminalPanel.tsx` is the only caller.
|
|
5
|
+
*
|
|
6
|
+
* The model separates two things an earlier revision conflated into one `lastClaimed` ref, which is
|
|
7
|
+
* what made restored terminals unfixable-by-resize:
|
|
8
|
+
*
|
|
9
|
+
* - **Knowledge** — `believed`: the grid this client thinks the PTY currently has (from a
|
|
10
|
+
* create-time echo, or from the last size it successfully sent). Only ever used to dedupe.
|
|
11
|
+
* - **Permission** — `isSizeAuthority` in `TerminalPanel.tsx`: whether this panel is the one
|
|
12
|
+
* rendering the terminal in the foreground right now.
|
|
13
|
+
*
|
|
14
|
+
* Conflating them meant "I have never sent a size" (`believed === null`, always true for a
|
|
15
|
+
* *restored* terminal, whose PTY predates this client) was read as "I am not allowed to send one",
|
|
16
|
+
* so a restored terminal ignored every divider drag and window resize forever.
|
|
17
|
+
*/
|
|
18
|
+
export interface Grid {
|
|
19
|
+
cols: number;
|
|
20
|
+
rows: number;
|
|
21
|
+
}
|
|
22
|
+
/** A proposal is usable only if both dimensions are finite integers ≥ the emulator minimum. */
|
|
23
|
+
export declare function isMeasurable(proposed: Partial<Grid> | undefined | null): proposed is Grid;
|
|
24
|
+
export declare function sameGrid(a: Grid | null, b: Grid | null): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Whether a measured grid is worth sending as a Resize frame, given what this client believes the
|
|
27
|
+
* PTY's grid already is. Pure dedupe + validity: it answers "would this frame change anything?",
|
|
28
|
+
* never "am I allowed to send it?" — permission is the caller's `isSizeAuthority` gate.
|
|
29
|
+
*
|
|
30
|
+
* `believed === null` (a restored terminal, whose PTY this client never sized) counts as differing:
|
|
31
|
+
* an unknown remote size is exactly the case that most needs reconciling, since the PTY is
|
|
32
|
+
* typically still at the 80×24 spawn default while the panel renders far wider.
|
|
33
|
+
*/
|
|
34
|
+
export declare function shouldClaimSize(next: Grid | null, believed: Grid | null): next is Grid;
|
|
35
|
+
/**
|
|
36
|
+
* The grid to re-seed `believedSizeRef` with, given a `terminals_update` broadcast's `terminals`
|
|
37
|
+
* list and the slot this panel is subscribed to (sprint-053/task-007). Returns `undefined` — not
|
|
38
|
+
* `null`, which means "known to be unmeasurable" elsewhere in this module — when the broadcast says
|
|
39
|
+
* nothing usable: no matching slot, or a matching entry with a missing/unmeasurable size (an old
|
|
40
|
+
* daemon omitting `cols`/`rows`, or a slot not yet subscribed).
|
|
41
|
+
*
|
|
42
|
+
* Pure by design: re-seeding a belief is not a claim. The caller (`TerminalPanel.tsx`) must apply
|
|
43
|
+
* the result directly to the ref and must never route it through `claimSize`/send a `Resize` frame
|
|
44
|
+
* — that would turn every OTHER client's resize into a redundant echo storm, and would let a
|
|
45
|
+
* background/non-authority tab claim size it has no permission to touch.
|
|
46
|
+
*/
|
|
47
|
+
export declare function believedSizeFromBroadcast(terminals: ReadonlyArray<{
|
|
48
|
+
slot: number;
|
|
49
|
+
cols?: number;
|
|
50
|
+
rows?: number;
|
|
51
|
+
}>, slot: number | null): Grid | undefined;
|
|
52
|
+
//# sourceMappingURL=terminal-size.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ContextMeter — the status bar's context segment body (sprint-074): an 80 × 6 px loading-bar
|
|
3
|
+
* track instead of the old `42% (84k/200k)` text. All decisions (fraction, tone, text, tooltip)
|
|
4
|
+
* come from `context-meter.ts`; this component only maps them to markup. Non-interactive here —
|
|
5
|
+
* the popover trigger wrapper is task-007's.
|
|
6
|
+
*/
|
|
7
|
+
import type { SessionStats } from "../../stores/stats-store.js";
|
|
8
|
+
export interface ContextMeterProps {
|
|
9
|
+
stats: SessionStats | undefined;
|
|
10
|
+
compacting: boolean;
|
|
11
|
+
/** Stretch the track to the container's width (the popover's copy) instead of the 80 px bar. */
|
|
12
|
+
wide?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function ContextMeter({ stats, compacting, wide }: ContextMeterProps): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=ContextMeter.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ContextMeterPopover — the status bar's context segment as an interactive control (sprint-074):
|
|
3
|
+
* the meter is the trigger of a popover showing exact usage, an optional instructions field, and
|
|
4
|
+
* one button — **Cancel** while compacting, otherwise **Compact now** (disabled with a reason
|
|
5
|
+
* while the agent is running / not yet created / the daemon is unreachable). All sending goes
|
|
6
|
+
* through `compaction-store`'s `compactSession`, the same action the composer's `/compact` uses.
|
|
7
|
+
* The popover deliberately stays open while a compaction runs so Cancel is reachable; Radix
|
|
8
|
+
* returns focus to the trigger on Escape/outside press.
|
|
9
|
+
*/
|
|
10
|
+
import type { SessionStats } from "../../stores/stats-store.js";
|
|
11
|
+
export interface ContextMeterPopoverProps {
|
|
12
|
+
sessionId: string;
|
|
13
|
+
stats: SessionStats | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare function ContextMeterPopover({ sessionId, stats }: ContextMeterPopoverProps): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=ContextMeterPopover.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drag chrome for pane drops: the outcome preview and the floating drag chip.
|
|
3
|
+
*
|
|
4
|
+
* The preview is chrome, never a panel — it renders in `TabPanelHost`'s overlay layer beside the
|
|
5
|
+
* dividers, never inside a panel, so it cannot affect panel mounting. Its box comes from
|
|
6
|
+
* `pane-layout-view.dropPreviewStyle` and its region has already been degraded by
|
|
7
|
+
* `pane-dnd.effectiveDropRegion`, which is what makes "the preview is always the outcome" true by
|
|
8
|
+
* construction rather than by two agreeing checks.
|
|
9
|
+
*
|
|
10
|
+
* swe/features/workspace-split-panes.md § UI Behavior, § Drop regions
|
|
11
|
+
*/
|
|
12
|
+
import type { Tab } from "../../stores/tab-store.js";
|
|
13
|
+
import type { DropRegion } from "./pane-dnd.js";
|
|
14
|
+
import type { Rect } from "./pane-tree.js";
|
|
15
|
+
export declare function DropPreview({ rect, region }: {
|
|
16
|
+
rect: Rect;
|
|
17
|
+
region: DropRegion;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
/** Follows the pointer inside dnd-kit's `DragOverlay` — the dragged tab, detached from its strip. */
|
|
20
|
+
export declare function DragChip({ tab }: {
|
|
21
|
+
tab: Tab;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=DropPreview.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PaneDividers — the draggable boundaries between panes, rendered as an absolutely-positioned
|
|
3
|
+
* overlay inside `TabPanelHost`'s area.
|
|
4
|
+
*
|
|
5
|
+
* An overlay, not a layout participant: a divider that consumed layout space would shift the panes
|
|
6
|
+
* away from the rects `paneRects` computed for them, and panels (positioned from the same rects)
|
|
7
|
+
* would drift out of alignment with their strips. So each handle is centred *on* the boundary with a
|
|
8
|
+
* few px of hit area either side, and takes no space.
|
|
9
|
+
*
|
|
10
|
+
* Dragging is delta-based, exactly like `ResizeHandle` (sidebar widths): each `pointermove` reports
|
|
11
|
+
* the movement since the previous one and converts it with the split's own extent — `sizes` are
|
|
12
|
+
* fractions of the split, not of the host, so a nested divider's px→fraction denominator is
|
|
13
|
+
* `splitRect`'s extent × the host's (`pane-tree.ts`'s `Divider.splitRect`). Absolute
|
|
14
|
+
* pointer-to-fraction math would need the sizes captured at drag start and drift against the store's
|
|
15
|
+
* clamping; deltas simply cannot.
|
|
16
|
+
*
|
|
17
|
+
* Each drag explicitly captures its pointer to the handle (`setPointerCapture`) so it keeps
|
|
18
|
+
* receiving moves across a pane whose content is a *separate document* — see `startDrag`.
|
|
19
|
+
*
|
|
20
|
+
* swe/features/workspace-split-panes.md § Resizing
|
|
21
|
+
*/
|
|
22
|
+
import type { Divider } from "./pane-tree.js";
|
|
23
|
+
export interface PaneDividersProps {
|
|
24
|
+
cwd: string;
|
|
25
|
+
dividers: readonly Divider[];
|
|
26
|
+
/** The host content box, measured at drag start — the px→fraction denominator. */
|
|
27
|
+
hostRef: React.RefObject<HTMLDivElement | null>;
|
|
28
|
+
}
|
|
29
|
+
export declare function PaneDividers({ cwd, dividers, hostRef }: PaneDividersProps): import("react").JSX.Element[];
|
|
30
|
+
//# sourceMappingURL=PaneDividers.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StatusBar — full-width, 35px, y-centered powerline bar at the bottom of the workspace shell
|
|
3
|
+
* (sprint-042). Renders icon-prefixed segments for the **active session**: cwd, git branch
|
|
4
|
+
* (+ ahead/behind/dirty/conflict), context usage, token total, and cost. Fully swaps when
|
|
5
|
+
* `activeSessionId` changes — every value is read from the active session's entry or from
|
|
6
|
+
* per-session `stats-store`; nothing here is scoped to a specific tab. Mounting this component is
|
|
7
|
+
* also what drives the active session's stats poll (`useSessionStats`, sprint-042/task-004) — no
|
|
8
|
+
* other consumer of `stats-store` exists yet, so the poll runs exactly while the bar is on screen.
|
|
9
|
+
*
|
|
10
|
+
* Every segment here is read-only except the context segment, whose loading-bar meter
|
|
11
|
+
* (`ContextMeter`, driven by `context-meter.ts`) is the trigger of `ContextMeterPopover`. The interactive model picker this bar used to host now lives
|
|
12
|
+
* in the composer's bottom toolbar (`features/chat/Composer.tsx`), next to the actions it belongs
|
|
13
|
+
* with; this bar owns no `ModelMenu`, no `setModel`, and no `ensureMaterialized` call.
|
|
14
|
+
*/
|
|
15
|
+
export declare function StatusBar(): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=StatusBar.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-tab context menu — Radix DropdownMenu anchored at cursor coordinates, following
|
|
3
|
+
* `SessionContextMenu.tsx`'s established right-click pattern. Minimal by design (sprint-069/
|
|
4
|
+
* task-004): a single "Close" action, existing so a tab still has a way to close once the
|
|
5
|
+
* tight-strip rule has replaced its `×` with the needs-input dot (`TabStrip.module.css`'s
|
|
6
|
+
* `@container` concession) — closing must never become unreachable just because a tab is narrow.
|
|
7
|
+
*
|
|
8
|
+
* `features/workspace-ui.md`'s § Desktop tab strip previously marked a per-tab context menu
|
|
9
|
+
* "not implemented"; this is that menu, deliberately scoped to Close only rather than the fuller
|
|
10
|
+
* reference-app set (Copy resume command, Rename, Close to the left/right, …) — those remain
|
|
11
|
+
* unimplemented and undocumented as such, this task builds only the one action its own scope
|
|
12
|
+
* requires.
|
|
13
|
+
*/
|
|
14
|
+
export declare function TabContextMenu(): import("react").JSX.Element | null;
|
|
15
|
+
//# sourceMappingURL=TabContextMenu.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TabPanelHost — mounts one panel per open tab via `panel-registry`, keeps inactive panels
|
|
3
|
+
* mounted but hidden (`display:none`), preserving scroll/terminal state across tab switches
|
|
4
|
+
* exactly like the POC's DOM-persisted panels (POC_TO_APP_PLAN_UI.md §4.2), but through React
|
|
5
|
+
* reconciliation instead of `data-tab-panel` querying. This now spans workspace switches too
|
|
6
|
+
* (§4.7 follow-up: workspace-scoped tabs) — ALL tabs across every workspace stay mounted; only
|
|
7
|
+
* the strip/empty-state visibility is workspace-scoped, so switching workspaces never tears down
|
|
8
|
+
* a live terminal or loses scroll position in another workspace's tabs.
|
|
9
|
+
*
|
|
10
|
+
* **Flat host, computed rectangles** (workspace-split-panes.md § Panel continuity invariant). With
|
|
11
|
+
* splits, panels are NOT nested into pane subtrees: every panel stays a direct child of this one
|
|
12
|
+
* container for its tab's whole life, and a rearrangement changes only its `left/top/width/height`.
|
|
13
|
+
* Re-parenting would remount it, and `TerminalPanel` kills its PTY on unmount — a dragged terminal
|
|
14
|
+
* would lose its process. Panels are keyed by `tab.id` in one flat `tabs.map`, so React reconciles
|
|
15
|
+
* them in place no matter how the tree changes.
|
|
16
|
+
* Rects come from `paneRects(effectiveTree(...))` (via `pane-layout-view.ts`, where all of this
|
|
17
|
+
* file's render decisions live so they are testable without jsdom) and stay **fractional**: they are
|
|
18
|
+
* emitted as percentages, so the browser's own layout resolves them against the host box. No
|
|
19
|
+
* `ResizeObserver` and no measured state here — a window resize or a divider drag re-lays-out
|
|
20
|
+
* without React re-rendering, and size-sensitive panels (xterm's `FitAddon`) still see their own box
|
|
21
|
+
* change through the observer they already own.
|
|
22
|
+
*
|
|
23
|
+
* Visibility is **per pane**: a pane's active tab is on screen even when another pane is focused, so
|
|
24
|
+
* it cannot be `tab.id === activeTabId` any more.
|
|
25
|
+
*
|
|
26
|
+
* Two distinct empty states: no workspace open at all (`activeWorkspaceCwd === null`, with an
|
|
27
|
+
* "Open Workspace" CTA) vs. a workspace in view with no tabs opened in it yet.
|
|
28
|
+
*/
|
|
29
|
+
export declare function TabPanelHost(): import("react").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=TabPanelHost.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TabStrip — dnd-kit sortable tab strip (POC `renderTabs`, POC_TO_APP_PLAN_UI.md §4.2).
|
|
3
|
+
* Adds drag reorder (the POC couldn't reorder) + Radix Tooltip on truncated labels.
|
|
4
|
+
*
|
|
5
|
+
* **Pane-scoped since sprint-049.** One strip per rendered pane, absolutely positioned across the
|
|
6
|
+
* top of its pane's rect by `TabPanelHost` (a pane's rect = strip row + panel body). It shows the
|
|
7
|
+
* global tab order filtered to its own pane, highlights *its* pane's active tab — not the
|
|
8
|
+
* workspace-active one — and its "+" opens into itself. With a single pane this is pixel-identical
|
|
9
|
+
* to the one global strip it replaced: same height, same position, no focus indicator.
|
|
10
|
+
*
|
|
11
|
+
* The `DndContext` lives in `TabPanelHost` (one context spanning every strip and body — a single
|
|
12
|
+
* gesture cannot start in one drag system and finish in another), so this file owns only its own
|
|
13
|
+
* `SortableContext` plus a strip-level droppable for "dropped on the strip, not on a tab".
|
|
14
|
+
*
|
|
15
|
+
* `paneId`/`cwd` are nullable for exactly one case: no workspace open at all, where the strip still
|
|
16
|
+
* renders as an empty row with a disabled "+" exactly as before.
|
|
17
|
+
*/
|
|
18
|
+
import type { CSSProperties } from "react";
|
|
19
|
+
import { MessageSquare } from "lucide-react";
|
|
20
|
+
import { type TabKind } from "../../stores/tab-store.js";
|
|
21
|
+
/** Leading glyph per pane kind (redesign spec § 07). `molecule` keeps `Atom` rather than the
|
|
22
|
+
* spec's generic "viewer (`Box`)" — this app's kind is `molecule`, not a generic viewer, and
|
|
23
|
+
* `Atom` reads correctly for it. Also consumed by `DropPreview.tsx`'s drag chip. */
|
|
24
|
+
export declare const ICON_BY_KIND: Record<TabKind, typeof MessageSquare>;
|
|
25
|
+
export interface TabStripProps {
|
|
26
|
+
/** `null` only when no workspace is open. */
|
|
27
|
+
cwd: string | null;
|
|
28
|
+
/** `null` only when no workspace is open. */
|
|
29
|
+
paneId: string | null;
|
|
30
|
+
/** Absolute position across the top of the pane's rect, from `pane-layout-view.paneChrome`. */
|
|
31
|
+
style?: CSSProperties;
|
|
32
|
+
/** Show the focused-pane indicator (never with a single pane). */
|
|
33
|
+
focused?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare function TabStrip({ cwd, paneId, style, focused }: TabStripProps): import("react").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=TabStrip.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The popover button's state, as a pure priority table (sprint-074): compacting beats everything
|
|
3
|
+
* (the button becomes Cancel), then the reasons Compact now is unavailable, then available.
|
|
4
|
+
*/
|
|
5
|
+
export type CompactAction = {
|
|
6
|
+
kind: "cancel";
|
|
7
|
+
note?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
kind: "disabled";
|
|
10
|
+
note: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: "compact";
|
|
13
|
+
note?: undefined;
|
|
14
|
+
};
|
|
15
|
+
export declare function compactAction(input: {
|
|
16
|
+
compacting: boolean;
|
|
17
|
+
running: boolean;
|
|
18
|
+
hasAgent: boolean;
|
|
19
|
+
connected: boolean;
|
|
20
|
+
}): CompactAction;
|
|
21
|
+
//# sourceMappingURL=compact-action.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure state for the status bar's context meter (sprint-074). No store/DOM access: every function
|
|
3
|
+
* takes plain values, so the whole decision table is unit-testable.
|
|
4
|
+
*/
|
|
5
|
+
import type { SessionStats } from "../../stores/stats-store.js";
|
|
6
|
+
export type MeterState = {
|
|
7
|
+
kind: "compacting";
|
|
8
|
+
} | {
|
|
9
|
+
kind: "unknown";
|
|
10
|
+
} | {
|
|
11
|
+
kind: "value";
|
|
12
|
+
fraction: number;
|
|
13
|
+
estimated: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type MeterTone = "normal" | "warning" | "danger";
|
|
16
|
+
/** Compacting wins over everything; otherwise tokens/window beats the reported percent. */
|
|
17
|
+
export declare function meterState(stats: SessionStats | undefined, compacting: boolean): MeterState;
|
|
18
|
+
export declare function meterTone(fraction: number): MeterTone;
|
|
19
|
+
/** The bar's fill width as a 0–1 fraction. */
|
|
20
|
+
export declare function meterFill(state: MeterState): number;
|
|
21
|
+
export declare function meterText(state: MeterState): string;
|
|
22
|
+
/** Tooltip: the absolute token numbers, flagged when they are Pi's post-compaction estimate. */
|
|
23
|
+
export declare function meterTitle(stats: SessionStats | undefined, state: MeterState): string;
|
|
24
|
+
/** `aria-valuenow` (0–100), omitted when there is no value to report. */
|
|
25
|
+
export declare function meterValueNow(state: MeterState): number | undefined;
|
|
26
|
+
//# sourceMappingURL=context-meter.d.ts.map
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sidebar-to-pane half of drag-to-split: dragging a chat out of the session list, or a file out
|
|
3
|
+
* of the Files tree, onto a pane body — opening it there, splitting the pane when dropped on an edge.
|
|
4
|
+
*
|
|
5
|
+
* **Why this is native HTML5 drag-and-drop and not dnd-kit** (`use-pane-drag.ts`, which carries drags
|
|
6
|
+
* that *start* on a tab already in a strip): the Files tree's rows are already native draggables for
|
|
7
|
+
* row-to-row move, and its container is a native drop target for OS files — whose payload
|
|
8
|
+
* (`dataTransfer.files`) exists ONLY in native DnD, so the tree must keep native DnD no matter what.
|
|
9
|
+
* Arming dnd-kit on the same rows would start two drag systems on one gesture. Native costs neither
|
|
10
|
+
* that nor hoisting `DndContext` above the sidebars, and the two systems cannot collide: a native
|
|
11
|
+
* `dragstart` suppresses the pointer events dnd-kit's `PointerSensor` activates on.
|
|
12
|
+
*
|
|
13
|
+
* The transport reuses the discrimination pattern the tree already documents: mid-drag a browser in
|
|
14
|
+
* protected mode exposes `dataTransfer.types` but NOT the values, so the *type name* carries the
|
|
15
|
+
* drag's kind and the payload is only readable at `drop`. One MIME per kind, so `types` alone tells a
|
|
16
|
+
* pane whether to preview — before it can know *what* is being dragged.
|
|
17
|
+
*
|
|
18
|
+
* A file row carries its move MIME **and** its open MIME at once: one gesture, and *where* it lands
|
|
19
|
+
* decides the meaning — another row is a move, a pane body is an open.
|
|
20
|
+
*
|
|
21
|
+
* swe/features/workspace-split-panes.md § Drop regions, § Splitting
|
|
22
|
+
*/
|
|
23
|
+
import { type DropBounds, type DropPoint, type DropRegion } from "./pane-dnd.js";
|
|
24
|
+
import type { PaneNode } from "./pane-tree.js";
|
|
25
|
+
/** What an external drag carries: a session id (`chat`) or a file's absolute path (`path`). */
|
|
26
|
+
export type ExternalDragKind = "chat" | "path";
|
|
27
|
+
/**
|
|
28
|
+
* One MIME per kind, because `types` is all a drop target can read mid-drag.
|
|
29
|
+
*
|
|
30
|
+
* The Files tree's row-move MIME (`application/x-pi-studio-path`) is deliberately NOT reused: a move
|
|
31
|
+
* and an open are different outcomes and a row carries both, so they need distinguishable names.
|
|
32
|
+
*/
|
|
33
|
+
export declare const EXTERNAL_DRAG_MIME: Readonly<Record<ExternalDragKind, string>>;
|
|
34
|
+
/**
|
|
35
|
+
* Which of our drags a `DataTransfer` carries, from `types` alone — `null` for anything else (an OS
|
|
36
|
+
* file drag, a text selection, another app's payload), none of which a pane accepts. We never emit a
|
|
37
|
+
* transfer carrying two kinds; the fixed `KINDS` order makes it deterministic anyway.
|
|
38
|
+
*/
|
|
39
|
+
export declare function externalDragKind(types: readonly string[]): ExternalDragKind | null;
|
|
40
|
+
/**
|
|
41
|
+
* Drag-start handler for a file-path drag source (a `FileLink`/resolved `InlineImage` in the chat
|
|
42
|
+
* timeline; mirrors the Files tree's own inline `dataTransfer.setData(EXTERNAL_DRAG_MIME.path, …)`
|
|
43
|
+
* in `FileExplorer.tsx`'s `handleDragStartRow`) — writes the identical `path`-kind payload so a drop
|
|
44
|
+
* on a pane needs no new drop-side handling. Returned as a closure so the caller supplies `path`
|
|
45
|
+
* once and the result is a plain `onDragStart` prop; the closure itself has no state, so it is
|
|
46
|
+
* exercised directly in tests with a minimal fake `DataTransfer` rather than a rendered drag.
|
|
47
|
+
*/
|
|
48
|
+
export declare function pathDragStartHandler(path: string): (event: {
|
|
49
|
+
dataTransfer: Pick<DataTransfer, "setData" | "effectAllowed">;
|
|
50
|
+
}) => void;
|
|
51
|
+
export interface ExternalDragPayload {
|
|
52
|
+
kind: ExternalDragKind;
|
|
53
|
+
/** A chat's session id, or a file's absolute path. */
|
|
54
|
+
value: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Decode the payload at drop time. `read` is `dataTransfer.getData` — injected so this is unit-tested
|
|
58
|
+
* without a `DataTransfer`, and because that method answers `""` for a missing type rather than
|
|
59
|
+
* throwing. A blank value counts as no payload: a drag we recognise but cannot act on.
|
|
60
|
+
*/
|
|
61
|
+
export declare function readExternalDrag(types: readonly string[], read: (mime: string) => string): ExternalDragPayload | null;
|
|
62
|
+
/**
|
|
63
|
+
* The composer-only path-ref drag (swe/features/composer-path-drop.md § Public contract 1): every
|
|
64
|
+
* Files-tree row, file **or folder**, carries its absolute path under this MIME so the composer can
|
|
65
|
+
* insert a relative path. A directory's value carries a trailing `/`, the only directory signal that
|
|
66
|
+
* survives `getData` (the `types` list is the sole mid-drag signal).
|
|
67
|
+
*
|
|
68
|
+
* Deliberately NOT an `ExternalDragKind`: a folder row carries only `MOVE_MIME` plus this, and a
|
|
69
|
+
* pane host gating on `externalDragKind(...) !== null` would start previewing a split for a folder
|
|
70
|
+
* drop — exactly what a pane must never do, since there is no directory tab. Keeping it out of
|
|
71
|
+
* `KINDS`/`readExternalDrag` leaves those as the pane-host vocabulary.
|
|
72
|
+
*/
|
|
73
|
+
export declare const PATH_REF_MIME = "application/x-pi-studio-path-ref";
|
|
74
|
+
/** Whether a drag's `types` advertises a path-ref payload. */
|
|
75
|
+
export declare function hasPathRef(types: readonly string[]): boolean;
|
|
76
|
+
/** The path-ref value for a row: a directory gets exactly one trailing `/`. */
|
|
77
|
+
export declare function encodePathRef(absPath: string, isDirectory: boolean): string;
|
|
78
|
+
/**
|
|
79
|
+
* Decode the path-ref at drop time (`read` is `dataTransfer.getData`). Trimmed; blank or absent is
|
|
80
|
+
* `null`, a drag we recognise but cannot act on.
|
|
81
|
+
*/
|
|
82
|
+
export declare function readPathRef(types: readonly string[], read: (mime: string) => string): string | null;
|
|
83
|
+
export declare function composerDropProps(): Record<string, string>;
|
|
84
|
+
/** Whether a drag event's target sits inside a marked composer drop zone. */
|
|
85
|
+
export declare function isInComposerDrop(target: EventTarget | null): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Whether the pane host must treat the pointer as over **no pane**: a path-ref drag over a composer
|
|
88
|
+
* drop zone belongs to the composer alone, whether or not the composer accepts it (it refuses while
|
|
89
|
+
* compacting), so the release can never fall through to an open or split. A drag without a path-ref
|
|
90
|
+
* (a chat row, a timeline file link) is unaffected and stays a pane drop even over the composer.
|
|
91
|
+
*/
|
|
92
|
+
export declare function yieldsToComposer(types: readonly string[], targetInsideComposer: boolean): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* The region a drop at `pointer` would actually apply — already degraded by `effectiveDropRegion`, so
|
|
95
|
+
* the preview and the drop read one value and cannot disagree. Same contract `use-pane-drag` holds
|
|
96
|
+
* for internal drags, and the reason both go through `pane-dnd` rather than checking `canSplit` again.
|
|
97
|
+
*/
|
|
98
|
+
export declare function resolveExternalDropRegion(tree: PaneNode, paneId: string, pointer: DropPoint, bounds: DropBounds): DropRegion;
|
|
99
|
+
//# sourceMappingURL=external-drag.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drop-region resolution for dragging a tab over a pane body — pure, so the geometry is unit-tested
|
|
3
|
+
* without jsdom (this package's framework-free testing convention).
|
|
4
|
+
*
|
|
5
|
+
* The gesture layer's contract is that **the preview is always the outcome**: a region that cannot be
|
|
6
|
+
* split degrades to `center` (a move into the pane) here, once, and both the preview and the drop
|
|
7
|
+
* dispatch read the degraded value. That is why `effectiveDropRegion` exists instead of each caller
|
|
8
|
+
* consulting `canSplit` on its own — two independent checks are two chances to disagree, and the user
|
|
9
|
+
* would see a split preview and get a move.
|
|
10
|
+
*
|
|
11
|
+
* swe/features/workspace-split-panes.md § Drop regions, § Resolving a drop region
|
|
12
|
+
*/
|
|
13
|
+
import { type PaneNode, type SplitRegion } from "./pane-tree.js";
|
|
14
|
+
/**
|
|
15
|
+
* Half-extent of the central move-into-pane target, as a fraction of the body. `0.25` makes the
|
|
16
|
+
* central 50% of each axis a move target and the outer band a split target.
|
|
17
|
+
*/
|
|
18
|
+
export declare const CENTER_BAND = 0.25;
|
|
19
|
+
export type DropRegion = SplitRegion | "center";
|
|
20
|
+
export interface DropPoint {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
}
|
|
24
|
+
export interface DropBounds {
|
|
25
|
+
left: number;
|
|
26
|
+
top: number;
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A resolved drop: the pane that receives it, and the region *after* degradation.
|
|
32
|
+
*
|
|
33
|
+
* Shared by both drag systems — dnd-kit tab drags (`use-pane-drag.ts`) and native sidebar drags
|
|
34
|
+
* (`use-external-pane-drop.ts`) — because `TabPanelHost` renders one preview from whichever is live.
|
|
35
|
+
* Two identically-shaped types would typecheck at that union and drift apart later.
|
|
36
|
+
*/
|
|
37
|
+
export interface DropOutcome {
|
|
38
|
+
paneId: string;
|
|
39
|
+
region: DropRegion;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Which region of `body` the pointer is in. Offsets are normalized to ±0.5 from the centre, so the
|
|
43
|
+
* decision is independent of the pane's size; an exact axis tie resolves to the horizontal axis.
|
|
44
|
+
*
|
|
45
|
+
* A degenerate body (zero width or height — a pane mid-layout) has no meaningful edges, so it reads
|
|
46
|
+
* as `center`: a move, never a split into nothing.
|
|
47
|
+
*/
|
|
48
|
+
export declare function resolveDropRegion(pointer: DropPoint, body: DropBounds): DropRegion;
|
|
49
|
+
/**
|
|
50
|
+
* Whether `pointer` falls inside `bounds`, edges included.
|
|
51
|
+
*
|
|
52
|
+
* dnd-kit hit-tests its own measured rects, so internal drags never need this; a native drag has to
|
|
53
|
+
* find its pane itself, from the drop zones' real client rects (`use-external-pane-drop.ts`) — the
|
|
54
|
+
* strip offset lives in CSS as `var(--pane-strip-height)`, so measuring beats recomputing it here.
|
|
55
|
+
*/
|
|
56
|
+
export declare function containsPoint(bounds: DropBounds, pointer: DropPoint): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The region as it will actually be applied: an edge whose split is illegal (depth cap) degrades to
|
|
59
|
+
* `center`. `center` and an unknown pane pass through unchanged.
|
|
60
|
+
*/
|
|
61
|
+
export declare function effectiveDropRegion(tree: PaneNode, paneId: string, region: DropRegion): DropRegion;
|
|
62
|
+
/**
|
|
63
|
+
* Whether dropping `tabId` on `region` of `paneId` would change anything.
|
|
64
|
+
*
|
|
65
|
+
* Two no-ops, and neither may flash a preview: a `center` drop into the pane the tab already sits in,
|
|
66
|
+
* and a split whose source is the dragged tab's only tab — the new pane would take it and the old one
|
|
67
|
+
* would collapse straight back.
|
|
68
|
+
*/
|
|
69
|
+
export declare function isNoOpDrop(region: DropRegion, paneId: string, tabId: string, placement: Readonly<Record<string, string>>): boolean;
|
|
70
|
+
//# sourceMappingURL=pane-dnd.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure render decisions for the panel host: where each tab's panel paints and whether it is on
|
|
3
|
+
* screen. No React, no store subscriptions — extracted so the geometry is unit-testable without
|
|
4
|
+
* jsdom (this package's framework-free testing convention, same shape as `status-bar-format.ts` and
|
|
5
|
+
* `timeline/inline-image-view.ts`).
|
|
6
|
+
*
|
|
7
|
+
* The list `panelBoxes` returns is derived from `tabs` alone in `tabs` order, which is the machinery
|
|
8
|
+
* behind the continuity invariant: a layout mutation changes each entry's `style`/`visible`, never
|
|
9
|
+
* the set or the order of entries, so React reconciles the same DOM nodes in place and no panel is
|
|
10
|
+
* ever remounted or re-parented (`TerminalPanel` kills its PTY on unmount).
|
|
11
|
+
*
|
|
12
|
+
* swe/features/workspace-split-panes.md § Panel continuity invariant, § Geometry
|
|
13
|
+
*/
|
|
14
|
+
import type { CSSProperties } from "react";
|
|
15
|
+
import type { WorkspacePaneLayout } from "../../stores/layout-store.js";
|
|
16
|
+
import type { Tab } from "../../stores/tab-store.js";
|
|
17
|
+
import { type Divider, type Rect } from "./pane-tree.js";
|
|
18
|
+
import type { DropRegion } from "./pane-dnd.js";
|
|
19
|
+
export interface PanelBox {
|
|
20
|
+
tabId: string;
|
|
21
|
+
/** Percentage rect of the tab's pane body; `undefined` means "keep the CSS full box". */
|
|
22
|
+
style: CSSProperties | undefined;
|
|
23
|
+
/** Its workspace is in view **and** it is its own pane's active tab — per pane, not per workspace. */
|
|
24
|
+
visible: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface PaneChrome {
|
|
27
|
+
paneId: string;
|
|
28
|
+
/** The strip row across the top of the pane's rect. */
|
|
29
|
+
stripStyle: CSSProperties;
|
|
30
|
+
/** Whether to show the focused-pane indicator — never with a single pane, where it is noise. */
|
|
31
|
+
focused: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Fractional rects of the panes that actually hold tabs. A pane still waiting for a restored tab to
|
|
35
|
+
* claim it renders as absent — `effectiveTree` redistributes its fraction without touching the
|
|
36
|
+
* stored tree, so no blank gap shows while the daemon's inventories are still arriving.
|
|
37
|
+
*/
|
|
38
|
+
export declare function occupiedPaneRects(layout: WorkspacePaneLayout | undefined): Map<string, Rect>;
|
|
39
|
+
/** `0.333333` → `"33.3333%"`; trailing zeros trimmed, because this string lands in the DOM. */
|
|
40
|
+
export declare function percent(fraction: number): string;
|
|
41
|
+
/**
|
|
42
|
+
* A pane's **body** as absolute-position percentages: its rect minus the strip row at its top.
|
|
43
|
+
* `undefined` when the tab has no pane in the workspace in view (another workspace's tab — always
|
|
44
|
+
* hidden, and it keeps the stylesheet's full box rather than collapsing to 0×0, which
|
|
45
|
+
* `Timeline.tsx`'s virtualizer measurement guard relies on).
|
|
46
|
+
*/
|
|
47
|
+
export declare function paneStyle(rect: Rect | undefined): CSSProperties | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Where a drop would land, as an absolute-position box over the target pane's **body**: the half the
|
|
50
|
+
* new pane would occupy for an edge region, the whole body for `center`. Whatever this returns is
|
|
51
|
+
* what the drop does — `pane-dnd.ts` has already degraded an illegal edge to `center`.
|
|
52
|
+
*/
|
|
53
|
+
export declare function dropPreviewStyle(rect: Rect, region: DropRegion): CSSProperties;
|
|
54
|
+
/**
|
|
55
|
+
* One entry per **rendered** pane (see `occupiedPaneRects`), in tree order. Panes are chrome, not
|
|
56
|
+
* panels: they may come and go freely, since nothing stateful is mounted inside a strip.
|
|
57
|
+
*/
|
|
58
|
+
export declare function paneChrome(layout: WorkspacePaneLayout | undefined): PaneChrome[];
|
|
59
|
+
/**
|
|
60
|
+
* The draggable boundaries of the layout **as rendered** — and none at all while some pane is still
|
|
61
|
+
* unoccupied. `resizeDivider` addresses a split by its path in the *stored* tree, so offering a
|
|
62
|
+
* divider whose path came from a pruned effective tree would resize the wrong split. `effectiveTree`
|
|
63
|
+
* returns the stored tree by identity when nothing is vacant, which makes the guard exact and free.
|
|
64
|
+
*/
|
|
65
|
+
export declare function paneDividers(layout: WorkspacePaneLayout | undefined): Divider[];
|
|
66
|
+
/**
|
|
67
|
+
* The pane that owns a tab, from the layout's tab→pane placement — `null` for a tab not yet placed
|
|
68
|
+
* (a transient state during restore; render call sites fall back to the pre-existing "no target
|
|
69
|
+
* given" default of whichever pane is globally focused).
|
|
70
|
+
*/
|
|
71
|
+
export declare function resolveOwningPaneId(tabId: string, layout: WorkspacePaneLayout | undefined): string | null;
|
|
72
|
+
export declare function panelBoxes(tabs: readonly Tab[], activeWorkspaceCwd: string | null, layout: WorkspacePaneLayout | undefined): PanelBox[];
|
|
73
|
+
//# sourceMappingURL=pane-layout-view.d.ts.map
|