@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,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared "open a path as a tab" dispatch — used by the Files tree's row click (`FileExplorer.tsx`),
|
|
3
|
+
* the file context menu's "Open" action (`FileContextMenu.tsx`), and a Files-tree-to-pane drag
|
|
4
|
+
* (`use-external-pane-drop.ts`) so they all mint identical tab ids/labels and agree on the
|
|
5
|
+
* molecule-vs-plain-file kind (`viewer-registry.ts#isMoleculeFile`). Either side of that dispatch
|
|
6
|
+
* can also be forced directly — `openMoleculeTab`/`openTextTab` below — for the file context
|
|
7
|
+
* menu's "Open in MolViewer" / "Open as Text" actions.
|
|
8
|
+
*
|
|
9
|
+
* `targetPaneId` places the tab in a named pane — the pane a drop landed on, or the one a split just
|
|
10
|
+
* created; omitted, it lands in the focused pane. Same contract as `openNewTerminal`/`openNewChat`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function openFileTab(path: string, workspaceCwd: string, targetPaneId?: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Open a path as a plain `kind: "file"` tab (`FilePanel` + the viewer registry), skipping the
|
|
15
|
+
* molecule dispatch above. Used by `openFileTab` for every non-molecule path, and directly by the
|
|
16
|
+
* context menu's "Open as Text" action so a molecule file can be read as source instead of
|
|
17
|
+
* rendered — the mirror image of `openMoleculeTab`. Both tabs can be open on one path at once:
|
|
18
|
+
* `tabIds.file` and `tabIds.molecule` are separate id namespaces.
|
|
19
|
+
*
|
|
20
|
+
* This forces the tab *kind* only. Which viewer mounts inside `FilePanel` remains
|
|
21
|
+
* `detectViewerKind`'s call — every molecule extension (and POSCAR/CONTCAR) falls through to
|
|
22
|
+
* `TextViewer`, which is what makes this action meaningful for exactly those files.
|
|
23
|
+
*/
|
|
24
|
+
export declare function openTextTab(path: string, workspaceCwd: string, targetPaneId?: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Force-open a file as a molecule tab, regardless of whether `isMoleculeFile` recognizes it.
|
|
27
|
+
* Used by the file context menu's "Open in MolViewer" action so the user can hand any file to
|
|
28
|
+
* molviewer (e.g. a LAMMPS `data` file that moleviewer's readers can still parse, but whose
|
|
29
|
+
* extension isn't in `MOLECULE_EXTENSIONS`).
|
|
30
|
+
*/
|
|
31
|
+
export declare function openMoleculeTab(path: string, workspaceCwd: string, targetPaneId?: string): void;
|
|
32
|
+
//# sourceMappingURL=open-file-tab.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure layout maths for `PdfViewer` (zoom ladder, fit-width, canvas resolution, page positions).
|
|
3
|
+
* Framework-free so the boundaries are unit-testable without a DOM or pdf.js.
|
|
4
|
+
*/
|
|
5
|
+
/** Zoom ladder the +/- buttons walk, as scale factors (1 = 100%, a PDF point = 1 CSS px). */
|
|
6
|
+
export declare const ZOOM_STEPS: readonly number[];
|
|
7
|
+
export declare const MIN_SCALE: number;
|
|
8
|
+
export declare const MAX_SCALE: number;
|
|
9
|
+
/** Hard cap on one page canvas's backing store (4096 × 4096). Past it the page renders softer
|
|
10
|
+
* rather than allocating without bound at high zoom on a large page. */
|
|
11
|
+
export declare const MAX_CANVAS_PIXELS = 16777216;
|
|
12
|
+
/** The first rung above `scale`, or the top rung. */
|
|
13
|
+
export declare function nextZoom(scale: number): number;
|
|
14
|
+
/** The last rung below `scale`, or the bottom rung. */
|
|
15
|
+
export declare function prevZoom(scale: number): number;
|
|
16
|
+
/** Scale at which the widest page exactly fills `containerWidth - padding`, clamped to the ladder
|
|
17
|
+
* range. A degenerate container or page (zero/negative width) yields 1, never NaN/Infinity. */
|
|
18
|
+
export declare function fitWidthScale(containerWidth: number, padding: number, widestPageWidth: number): number;
|
|
19
|
+
/** Backing-store pixels per CSS pixel: `dpr`, reduced just enough to keep the page's canvas
|
|
20
|
+
* within `maxPixels`. */
|
|
21
|
+
export declare function canvasPixelRatio(pageWidth: number, pageHeight: number, scale: number, dpr: number, maxPixels?: number): number;
|
|
22
|
+
/** Top offset of each page block in the scroll content, for pages stacked with `gap` between them
|
|
23
|
+
* and `padding` above the first. Page heights are at scale 1. */
|
|
24
|
+
export declare function pageTops(pageHeights: readonly number[], scale: number, gap: number, padding: number): number[];
|
|
25
|
+
/** 0-based index of the page occupying the vertical midpoint of the viewport: the last page that
|
|
26
|
+
* starts at or above it. 0 for an empty document. */
|
|
27
|
+
export declare function pageAtMidpoint(tops: readonly number[], scrollTop: number, viewportHeight: number): number;
|
|
28
|
+
//# sourceMappingURL=pdf-layout.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pdf.js's only import site. The PDF viewer is lazy, so this module (and its `pdfjs-dist`
|
|
3
|
+
* dependency) is not fetched until a PDF tab opens. A shared worker parses every open document;
|
|
4
|
+
* each document owns its own lifetime on that worker. Both the worker and the data-directory URL
|
|
5
|
+
* come from the host's `pdf` member: only the application bundle can build a worker, and only it
|
|
6
|
+
* knows where `@av-pi-studio/workbench/vite`'s `pdfjsAssetsPlugin` serves the data.
|
|
7
|
+
*/
|
|
8
|
+
import * as pdfjs from "pdfjs-dist";
|
|
9
|
+
/** The host has no `pdf` member: this application does not provide a PDF runtime. */
|
|
10
|
+
export declare class PdfUnavailableError extends Error {
|
|
11
|
+
name: string;
|
|
12
|
+
constructor();
|
|
13
|
+
}
|
|
14
|
+
export interface PdfjsAssetUrls {
|
|
15
|
+
cMapUrl: string;
|
|
16
|
+
cMapPacked: true;
|
|
17
|
+
standardFontDataUrl: string;
|
|
18
|
+
wasmUrl: string;
|
|
19
|
+
iccUrl: string;
|
|
20
|
+
}
|
|
21
|
+
/** pdf.js's data-directory options, resolved from the host's base (a missing trailing slash would
|
|
22
|
+
* make `new URL()` drop the last path segment). */
|
|
23
|
+
export declare function pdfjsAssetUrls(assetBaseUrl: string, documentBase: string): PdfjsAssetUrls;
|
|
24
|
+
/** pdf.js with its worker attached, plus the asset options every `getDocument` call needs.
|
|
25
|
+
* Throws `PdfUnavailableError` when the host has no `pdf` member. */
|
|
26
|
+
export declare function loadPdfjs(): {
|
|
27
|
+
pdfjs: typeof pdfjs;
|
|
28
|
+
assetUrls: PdfjsAssetUrls;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=pdfjs-runtime.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Name derivation for a polymer built inside the molecule viewer (`@molviewer/core`'s
|
|
3
|
+
* `onPolymerBuild`, 0.4.4+).
|
|
4
|
+
*
|
|
5
|
+
* Naming the file is deliberately the HOST's job. `PolymerBuildEvent` reports the monomer's name
|
|
6
|
+
* and the build settings but never a target, because only the host can see the directory and so
|
|
7
|
+
* only the host knows which names are already taken.
|
|
8
|
+
*
|
|
9
|
+
* Kept pure and separate from `MoleculeViewer.tsx` so it is testable under the root vitest runner,
|
|
10
|
+
* which discovers `.test.ts` under a node environment only — same split as its siblings
|
|
11
|
+
* `molecule-source.ts` and `molecule-reload.ts`.
|
|
12
|
+
*
|
|
13
|
+
* Building does not change what is on screen, so pressing Build repeatedly is normal and every
|
|
14
|
+
* press must produce its own file. `polymerFileName` is therefore an ATTEMPT-indexed sequence,
|
|
15
|
+
* walked by the caller against the create-exclusive `file_create_request` until one lands — the
|
|
16
|
+
* filesystem arbitrates the collision, not a directory listing that could be stale.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Candidate file name for attempt `attempt` (0-based) of a build off the monomer at `sourcePath`.
|
|
20
|
+
*
|
|
21
|
+
* Attempt 0 is `<monomer-stem>_polymer_<monomers>.mol2`; every later attempt appends its own
|
|
22
|
+
* ordinal — `_2`, `_3`, … — so the trailing number reads as "the Nth file with these settings"
|
|
23
|
+
* and the first one needs no suffix at all.
|
|
24
|
+
*
|
|
25
|
+
* `monomers` is the chain length in monomer units (`PolymerBuildEvent.monomers`), not the physical
|
|
26
|
+
* length in Å that `report` carries.
|
|
27
|
+
*/
|
|
28
|
+
export declare function polymerFileName(args: {
|
|
29
|
+
sourcePath: string;
|
|
30
|
+
monomers: number;
|
|
31
|
+
attempt: number;
|
|
32
|
+
}): string;
|
|
33
|
+
//# sourceMappingURL=polymer-file.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure tier-selection logic for `TextViewer` (task-009), kept in its own DOM-free module so the
|
|
3
|
+
* three-state branch (inline / streamed / too large to display) is unit-testable without mounting
|
|
4
|
+
* CodeMirror or React — mirrors `molecule-reload.ts`'s `shouldApplyRefresh` extraction for the
|
|
5
|
+
* same reason: this repo has no jsdom test environment configured anywhere.
|
|
6
|
+
*/
|
|
7
|
+
export type TextViewerState = {
|
|
8
|
+
kind: "loading";
|
|
9
|
+
} | {
|
|
10
|
+
kind: "inline";
|
|
11
|
+
content: string;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "streaming";
|
|
14
|
+
size: number;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "streamed";
|
|
17
|
+
size: number;
|
|
18
|
+
content: string;
|
|
19
|
+
} | {
|
|
20
|
+
kind: "stream-error";
|
|
21
|
+
size: number;
|
|
22
|
+
message: string;
|
|
23
|
+
} | {
|
|
24
|
+
kind: "too-large";
|
|
25
|
+
size: number;
|
|
26
|
+
maxDisplayBytes: number;
|
|
27
|
+
} | {
|
|
28
|
+
kind: "error";
|
|
29
|
+
message: string;
|
|
30
|
+
};
|
|
31
|
+
export interface TextViewerInputs {
|
|
32
|
+
maxDisplayBytes: number;
|
|
33
|
+
inline: {
|
|
34
|
+
isLoading: boolean;
|
|
35
|
+
isError: boolean;
|
|
36
|
+
/** `{ size }` when the failure was specifically `FileTooLargeError`; `null` for a generic
|
|
37
|
+
* read failure (network/permission/etc). */
|
|
38
|
+
tooLarge: {
|
|
39
|
+
size: number;
|
|
40
|
+
} | null;
|
|
41
|
+
errorMessage: string | null;
|
|
42
|
+
content: string | null;
|
|
43
|
+
};
|
|
44
|
+
streamed: {
|
|
45
|
+
isLoading: boolean;
|
|
46
|
+
isError: boolean;
|
|
47
|
+
errorMessage: string | null;
|
|
48
|
+
content: string | null;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/** Selects exactly one `TextViewerState` from the current query states. Pure — no hooks, no I/O. */
|
|
52
|
+
export declare function selectTextViewerState(input: TextViewerInputs): TextViewerState;
|
|
53
|
+
//# sourceMappingURL=text-viewer-state.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Files sidebar's upload flow, outside React: confirm overwrites, upload one source at a time,
|
|
3
|
+
* and report progress and the outcome on the explorer's status line.
|
|
4
|
+
*/
|
|
5
|
+
import { type UploadOptions, type UploadSource } from "../../host/types.js";
|
|
6
|
+
export interface UploadStatus {
|
|
7
|
+
text: string;
|
|
8
|
+
error: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface UploadSourcesDeps {
|
|
11
|
+
/** Names already present in the target directory. */
|
|
12
|
+
existing: ReadonlySet<string>;
|
|
13
|
+
confirm(message: string): Promise<boolean>;
|
|
14
|
+
upload(dir: string, source: UploadSource, options?: UploadOptions): Promise<void>;
|
|
15
|
+
setStatus(status: UploadStatus): void;
|
|
16
|
+
}
|
|
17
|
+
/** The whole batch's progress in whole percent, or `null` when any source's size is unknown. */
|
|
18
|
+
export declare function batchPercent(sources: readonly UploadSource[], index: number, sentInCurrent: number): number | null;
|
|
19
|
+
export declare function uploadSources(dir: string, sources: readonly UploadSource[], deps: UploadSourcesDeps): Promise<void>;
|
|
20
|
+
//# sourceMappingURL=upload-sources.d.ts.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File-viewer registry — maps a detected file kind to the viewer component that renders it
|
|
3
|
+
* (POC_TO_APP_PLAN_UI.md §4.5 follow-up: modular file preview). `FilePanel` detects the kind from
|
|
4
|
+
* `path` (extension) and the explorer's binary `mimeHint` (for extension-less/ambiguous files),
|
|
5
|
+
* then looks up the viewer here — adding a new file type is one entry in `VIEWER_REGISTRY`. A
|
|
6
|
+
* descriptor with a `toggle` can be switched off in Settings → Viewers (`resolveViewerKind`).
|
|
7
|
+
*
|
|
8
|
+
* Second dispatch path: the file explorer calls `isMoleculeFile` (below) to pick a tab's *kind*
|
|
9
|
+
* (`"molecule"` vs `"file"`) before any panel mounts — molecule files never go through
|
|
10
|
+
* `detectViewerKind`/`VIEWER_BY_KIND`/`FilePanel` at all (they get their own dedicated panel).
|
|
11
|
+
*/
|
|
12
|
+
import { type ComponentType } from "react";
|
|
13
|
+
export type ViewerKind = "text" | "markdown" | "image" | "video" | "binary" | "html" | "pdf";
|
|
14
|
+
export interface ViewerProps {
|
|
15
|
+
/** Explorer-relative or absolute path, as opened from the file tree/diff panel. */
|
|
16
|
+
path: string;
|
|
17
|
+
/** The owning tab's workspace root ("~" expanded by the consumer). */
|
|
18
|
+
workspaceCwd: string;
|
|
19
|
+
}
|
|
20
|
+
/** Describes a registered file viewer — the single source of truth for file-type dispatch. */
|
|
21
|
+
export interface ViewerDescriptor {
|
|
22
|
+
kind: ViewerKind;
|
|
23
|
+
component: ComponentType<ViewerProps>;
|
|
24
|
+
extensions: readonly string[];
|
|
25
|
+
mimePrefixes?: readonly string[];
|
|
26
|
+
/** Whether files of this kind are watched for live refresh — required (no implicit default). */
|
|
27
|
+
liveRefresh: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Makes the viewer switchable in Settings → Viewers: `id` is its viewer-settings row, `fallback`
|
|
30
|
+
* the kind a file renders as while that row is disabled. Absent = always on.
|
|
31
|
+
*/
|
|
32
|
+
toggle?: {
|
|
33
|
+
id: string;
|
|
34
|
+
fallback: ViewerKind;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The single registry of file viewers — adding a new file type is one entry here. All lookup
|
|
39
|
+
* structures are derived from this table at module load and frozen: VIEWER_BY_KIND, the
|
|
40
|
+
* live-refresh set, extension and MIME lookups, and isMoleculeFile remain unchanged.
|
|
41
|
+
*/
|
|
42
|
+
export declare const VIEWER_REGISTRY: readonly ViewerDescriptor[];
|
|
43
|
+
/** Derived: maps ViewerKind to its component. */
|
|
44
|
+
export declare const VIEWER_BY_KIND: Record<ViewerKind, ComponentType<ViewerProps>>;
|
|
45
|
+
/**
|
|
46
|
+
* Derived: the set of viewer kinds that should watch for live file changes. Used by
|
|
47
|
+
* `useFileLiveRefresh` to gate file watches — watching video would restart playback from zero
|
|
48
|
+
* on every refresh, and binary never fetches eagerly so there is nothing to refresh.
|
|
49
|
+
*/
|
|
50
|
+
export declare const LIVE_REFRESH_KINDS: ReadonlySet<ViewerKind>;
|
|
51
|
+
/** Extensions molviewer's built-in readers handle (its `readers/index.ts` registration list). */
|
|
52
|
+
export declare const MOLECULE_EXTENSIONS: Readonly<Record<string, true>>;
|
|
53
|
+
/** Extension-less VASP structure files, matched by exact (case-insensitive) basename. */
|
|
54
|
+
export declare const MOLECULE_FILENAMES: Readonly<Record<string, true>>;
|
|
55
|
+
/**
|
|
56
|
+
* True when `path` is a molecular structure file molviewer can render. Pure and synchronous — no
|
|
57
|
+
* file reads. LAMMPS `data` files are deliberately excluded (no fixed extension; content-sniffing
|
|
58
|
+
* would make this async) and keep opening as plain text.
|
|
59
|
+
*/
|
|
60
|
+
export declare function isMoleculeFile(path: string): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Detects the viewer kind for a file, preferring the extension (fast, always available) and
|
|
63
|
+
* falling back to a server-supplied MIME hint (extension-less files, e.g. binary blobs the
|
|
64
|
+
* explorer sniffed) — `isBinary` further distinguishes an unrecognized binary from unrecognized
|
|
65
|
+
* text, so unknown-but-textual files (`.env`, `.gitignore`) still fall through to `TextViewer`.
|
|
66
|
+
*/
|
|
67
|
+
export declare function detectViewerKind(path: string, opts?: {
|
|
68
|
+
mimeHint?: string;
|
|
69
|
+
isBinary?: boolean;
|
|
70
|
+
}): ViewerKind;
|
|
71
|
+
/**
|
|
72
|
+
* `detectViewerKind`, then the viewer-settings gate: a kind whose `toggle` row is disabled
|
|
73
|
+
* resolves to its fallback (disabling a viewer degrades a file to the plain path, never refuses
|
|
74
|
+
* it). `isEnabled` is injected so this stays pure — `FilePanel` passes the store's
|
|
75
|
+
* `isViewerEnabled`, and the registry never imports the store.
|
|
76
|
+
*/
|
|
77
|
+
export declare function resolveViewerKind(path: string, isEnabled: (viewerId: string) => boolean, opts?: {
|
|
78
|
+
mimeHint?: string;
|
|
79
|
+
isBinary?: boolean;
|
|
80
|
+
}): ViewerKind;
|
|
81
|
+
//# sourceMappingURL=viewer-registry.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared `file_write_request` caller for save flows (currently the molecule viewer's `onSave`,
|
|
3
|
+
* `MoleculeViewer.tsx`) — one place for the wire call and the server error-code → user-facing
|
|
4
|
+
* message mapping, structured the same way as the sibling `move-entry.ts`. Overwrite-only: the
|
|
5
|
+
* daemon 404s `not_found` for a missing target (`FileExplorerService.writeFile`); there is no
|
|
6
|
+
* create-on-write.
|
|
7
|
+
*/
|
|
8
|
+
import type { PiStudioClient } from "@av-pi-studio/client";
|
|
9
|
+
/** Overwrite `path`'s content on disk. Throws an Error carrying a user-facing message on
|
|
10
|
+
* failure. */
|
|
11
|
+
export declare function writeFile(client: PiStudioClient, path: string, content: string): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=write-file.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChangesPanel — right-sidebar Changes tab (POC `renderRightPanel` changes branch, chat.html
|
|
3
|
+
* ~line 1028-1039, POC_TO_APP_PLAN_UI.md §4.7). A/M/D badges + file path; click opens a diff tab.
|
|
4
|
+
* A pure `git-store` consumer — the live checkout-status subscription for the active workspace is
|
|
5
|
+
* owned solely by `StatusBar` (sprint-042; it is always mounted, unlike this panel, which only
|
|
6
|
+
* exists while the Changes tab is selected). Two independent `useCheckoutStatus(cwd)` callers on
|
|
7
|
+
* the same cwd would collide: the daemon's `checkout_status_subscribe`/`_unsubscribe` handlers key
|
|
8
|
+
* on a flat `session:cwd` map (`packages/server/src/projects/git-checkout-rpc.ts`), not
|
|
9
|
+
* reference-counted, so whichever hook instance unmounts first (e.g. switching away from this
|
|
10
|
+
* tab) would silently kill the *other* instance's live feed too.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ChangesPanel(): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=ChangesPanel.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LoginDialog — drives one provider-auth login flow end to end (sprint-065/task-004): renders
|
|
3
|
+
* every prompt kind the flow can ask, a rolling status region, and the terminal success/error
|
|
4
|
+
* states. Mounted once, always, from `SettingsDialog.tsx`; it renders nothing until
|
|
5
|
+
* `useProviderAuthUiStore`'s `pendingLogin` is set by `ModelProvidersPanel`'s `Log in`/`Re-login`.
|
|
6
|
+
*
|
|
7
|
+
* The component is thin by contract: `login-flow.ts` (task-002) owns every step/ordering
|
|
8
|
+
* decision, `@av-pi-studio/client`'s `loginProvider` (task-001) owns the wire plumbing. What lives
|
|
9
|
+
* here is rendering, focus, and wiring the user's answer to the pending prompt's resolver — which
|
|
10
|
+
* lives in a ref, not reducer state, so the reducer stays pure and the resolver can be rejected
|
|
11
|
+
* on unmount without threading a promise through dispatched actions.
|
|
12
|
+
*
|
|
13
|
+
* `LoginDialogFlow` is remounted (via the outer `LoginDialog`'s `key`) once per attempt — see
|
|
14
|
+
* `provider-auth-store.ts`'s `attempt` field — so a `Try again` after a failure starts genuinely
|
|
15
|
+
* fresh: new reducer state, new resolver ref, new `loginProvider()` call, new `AbortController`.
|
|
16
|
+
*
|
|
17
|
+
* swe/features/provider-auth-ui.md § Web UI surface (login-dialog step rendering table),
|
|
18
|
+
* § Behavior & Algorithms, § Error Handling & Edge Cases.
|
|
19
|
+
*/
|
|
20
|
+
export declare function LoginDialog(): import("react").JSX.Element | null;
|
|
21
|
+
//# sourceMappingURL=LoginDialog.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModelProvidersPanel — the Settings dialog's Model Providers category (sprint-065/task-003).
|
|
3
|
+
* Lists `listProviderAuth()` results with an auth-state badge and per-row `Log in`/`Re-login`/
|
|
4
|
+
* `Log out` actions. The actual login flow (the SDK call, the prompt/QR/status rendering) is
|
|
5
|
+
* task-004/005's job — this panel's `Log in` action only hands the chosen provider + auth method
|
|
6
|
+
* off through `provider-auth-store.ts`'s `requestLogin`.
|
|
7
|
+
*
|
|
8
|
+
* All server access goes through the task-001 SDK methods (`listProviderAuth`/`logoutProvider`) —
|
|
9
|
+
* never `client.connection.request` for this family.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ModelProvidersPanel(): import("react").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=ModelProvidersPanel.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QrCode — renders a string as a scannable QR image (sprint-065/task-005).
|
|
3
|
+
*
|
|
4
|
+
* Why this exists at all: the browser showing a login dialog is frequently **not** the machine that
|
|
5
|
+
* can complete an OAuth redirect. A relay user drives a headless daemon; the callback server a Pi
|
|
6
|
+
* OAuth flow opens binds on the *daemon* host (Anthropic's, for instance, is a fixed
|
|
7
|
+
* `127.0.0.1:53692/callback`), so the redirect can only ever be completed from a browser that can
|
|
8
|
+
* reach that host. Scanning the auth URL onto a phone or onto the daemon's own desktop is the
|
|
9
|
+
* shortest path, exactly as relay pairing already works.
|
|
10
|
+
*
|
|
11
|
+
* `qrcode` is used daemon/CLI-side for *terminal* rendering (`packages/cli/src/qr.ts`); nothing
|
|
12
|
+
* browser-side existed. This wraps its `toDataURL` and nothing else.
|
|
13
|
+
*
|
|
14
|
+
* Colours are deliberately left at the library default (black modules on a white background, baked
|
|
15
|
+
* into the PNG together with its quiet-zone margin) rather than themed: scanners expect dark-on-light
|
|
16
|
+
* and a themed QR trades real scan reliability for looks. That is also why no CSS background is
|
|
17
|
+
* needed here — the image carries its own.
|
|
18
|
+
*/
|
|
19
|
+
interface QrCodeProps {
|
|
20
|
+
value: string;
|
|
21
|
+
/** Accessible description — the QR is an aid, so this says what scanning it does. */
|
|
22
|
+
label: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function QrCode({ value, label }: QrCodeProps): import("react").JSX.Element | null;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=QrCode.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure `(LoginFlowState, ProviderAuthFlowUiEvent) → LoginFlowState` reducer for the provider-auth
|
|
3
|
+
* login dialog. Every step/ordering decision the dialog needs lives here, so the component
|
|
4
|
+
* (task-004) stays a renderer — the established split in this codebase (`timeline/reducer.ts`
|
|
5
|
+
* beside `Timeline.tsx`, `ui/combobox.ts` beside `Select.tsx`).
|
|
6
|
+
*
|
|
7
|
+
* swe/features/provider-auth-ui.md § Behavior & Algorithms, § Web UI surface.
|
|
8
|
+
*/
|
|
9
|
+
import type { ProviderAuthType } from "@av-pi-studio/protocol";
|
|
10
|
+
import type { ProviderAuthFlowUiEvent, ProviderAuthPromptUi } from "@av-pi-studio/client";
|
|
11
|
+
/** One line of the flow's presentation log. `progress` lines are a single rolling "current status"
|
|
12
|
+
* entry — see `applyLoginFlowEvent`'s `progress` case; `info` lines accumulate permanently. */
|
|
13
|
+
export interface StatusLine {
|
|
14
|
+
kind: "info" | "progress";
|
|
15
|
+
message: string;
|
|
16
|
+
links?: readonly {
|
|
17
|
+
url: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
21
|
+
export interface AuthUrlPresentation {
|
|
22
|
+
url: string;
|
|
23
|
+
instructions?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface DeviceCodePresentation {
|
|
26
|
+
userCode: string;
|
|
27
|
+
verificationUri: string;
|
|
28
|
+
intervalSeconds?: number;
|
|
29
|
+
expiresInSeconds?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface LoginFlowResult {
|
|
32
|
+
ok: boolean;
|
|
33
|
+
error?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface LoginFlowState {
|
|
36
|
+
provider: string;
|
|
37
|
+
authType: ProviderAuthType;
|
|
38
|
+
/** `"starting"` until the first presentation event; `"prompt"` while a question is live;
|
|
39
|
+
* `"done"` is terminal — no later event ever mutates state again. */
|
|
40
|
+
phase: "starting" | "waiting" | "prompt" | "done";
|
|
41
|
+
statusLines: StatusLine[];
|
|
42
|
+
authUrl?: AuthUrlPresentation;
|
|
43
|
+
deviceCode?: DeviceCodePresentation;
|
|
44
|
+
prompt?: ProviderAuthPromptUi;
|
|
45
|
+
result?: LoginFlowResult;
|
|
46
|
+
}
|
|
47
|
+
/** Build the state a fresh login dialog opens with, before any flow event has arrived. */
|
|
48
|
+
export declare function initialLoginFlowState(provider: string, authType: ProviderAuthType): LoginFlowState;
|
|
49
|
+
/**
|
|
50
|
+
* Apply one flow event to login-dialog state. Pure — no mutation of the input, no timers, no DOM,
|
|
51
|
+
* no `Date.now()` (a device-code countdown is a view concern; only the daemon-sent expiry is
|
|
52
|
+
* stored). `done` is terminal: once `phase === "done"`, every later event is a no-op.
|
|
53
|
+
*/
|
|
54
|
+
export declare function applyLoginFlowEvent(state: LoginFlowState, event: ProviderAuthFlowUiEvent): LoginFlowState;
|
|
55
|
+
//# sourceMappingURL=login-flow.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turns a `ProviderAuthInfo` row into what `ModelProvidersPanel` renders — badge label/variant,
|
|
3
|
+
* the auth-type choices to offer, and the login action's label. Pure — the component only binds
|
|
4
|
+
* this to the DOM, matching `connection-presentation.ts`'s split beside `ConnectionBar.tsx`.
|
|
5
|
+
*
|
|
6
|
+
* swe/features/provider-auth-ui.md § Web UI surface.
|
|
7
|
+
*/
|
|
8
|
+
import type { ProviderAuthInfo, ProviderAuthType } from "@av-pi-studio/protocol";
|
|
9
|
+
import type { StatusBadgeVariant } from "@av-pi-studio/ui-library";
|
|
10
|
+
export interface ProviderAuthBadge {
|
|
11
|
+
label: string;
|
|
12
|
+
variant: StatusBadgeVariant;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* `configured` is `boolean | "unknown"` on the wire because the daemon bounds a hanging
|
|
16
|
+
* `checkAuth()` at 3s (sprint-054). `"unknown"` renders as its own muted-but-distinct `warning`
|
|
17
|
+
* badge — never folded into "not configured", which would invite a re-login over a credential
|
|
18
|
+
* that may well still work.
|
|
19
|
+
*/
|
|
20
|
+
export declare function providerAuthBadge(provider: ProviderAuthInfo): ProviderAuthBadge;
|
|
21
|
+
export interface LoginChoice {
|
|
22
|
+
authType: ProviderAuthType;
|
|
23
|
+
label: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The login action(s) a row offers: one method available goes straight through under a single
|
|
27
|
+
* `Log in`/`Re-login` label; both available offers a choice per method, the OAuth one labeled
|
|
28
|
+
* with the provider's own `oauthLoginLabel` when it supplies one.
|
|
29
|
+
*/
|
|
30
|
+
export declare function providerAuthLoginChoices(provider: ProviderAuthInfo): LoginChoice[];
|
|
31
|
+
//# sourceMappingURL=provider-auth-presentation.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The hand-off between `ModelProvidersPanel`'s `Log in`/`Re-login` action and `LoginDialog.tsx`
|
|
3
|
+
* (task-004): this task's job stops at "the user picked a provider + auth method" — the SDK call
|
|
4
|
+
* (`client.loginProvider`) and the flow-event rendering are task-004's job.
|
|
5
|
+
*
|
|
6
|
+
* `AbortController` lives here (not inside the login dialog) so *anything* can cancel a flow
|
|
7
|
+
* already underway without needing a reference to whatever component is currently rendering it —
|
|
8
|
+
* in particular `SettingsDialog`'s close handler, which must cancel a live flow rather than
|
|
9
|
+
* abandon it silently.
|
|
10
|
+
*/
|
|
11
|
+
import type { ProviderAuthType } from "@av-pi-studio/protocol";
|
|
12
|
+
export interface PendingProviderLogin {
|
|
13
|
+
provider: string;
|
|
14
|
+
/** Display name, for the login dialog's title only — never used for the RPC call (`provider`,
|
|
15
|
+
* the id, is). */
|
|
16
|
+
providerName: string;
|
|
17
|
+
authType: ProviderAuthType;
|
|
18
|
+
controller: AbortController;
|
|
19
|
+
/** Bumped by `retryLogin`. `LoginDialog` keys its inner flow component on
|
|
20
|
+
* `${provider}:${authType}:${attempt}` — a fresh mount is the reset mechanism for "a new login
|
|
21
|
+
* attempt starts with a different provider, auth type, or retry": no stale reducer state,
|
|
22
|
+
* resolver ref, or effect subscription ever survives into the new attempt. */
|
|
23
|
+
attempt: number;
|
|
24
|
+
}
|
|
25
|
+
interface ProviderAuthUiState {
|
|
26
|
+
/** Non-null while a login is requested/in flight. Exactly one at a time — mirrors the SDK's own
|
|
27
|
+
* one-flow-per-client rule at the UI level, so a second row can be disabled rather than let a
|
|
28
|
+
* click reach `loginProvider()` only to be rejected locally. */
|
|
29
|
+
pendingLogin: PendingProviderLogin | null;
|
|
30
|
+
requestLogin(provider: string, providerName: string, authType: ProviderAuthType): void;
|
|
31
|
+
/** Aborts the in-flight flow (if any) and clears the pending request. */
|
|
32
|
+
cancelLogin(): void;
|
|
33
|
+
/** Clears the pending request without aborting — the flow already reached a terminal state. */
|
|
34
|
+
clearLogin(): void;
|
|
35
|
+
/** Starts a fresh attempt for the same provider/auth type: a new `AbortController`, `attempt`
|
|
36
|
+
* bumped so `LoginDialog` remounts its flow component from scratch. No-op if no login is
|
|
37
|
+
* pending (e.g. the dialog was already dismissed). */
|
|
38
|
+
retryLogin(): void;
|
|
39
|
+
}
|
|
40
|
+
export declare const useProviderAuthUiStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ProviderAuthUiState>>;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=provider-auth-store.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session context menu — Radix DropdownMenu anchored at cursor coordinates, replacing the POC's
|
|
3
|
+
* manually-positioned `#session-menu` (POC_TO_APP_PLAN_UI.md §4.7). Actions: rename
|
|
4
|
+
* (`update_agent` labels), stop (`interrupt_agent`), archive (`archive_agent` — soft delete, keeps
|
|
5
|
+
* the record for resume), delete (`delete_agent` — hard delete, no trace). Both archive and delete
|
|
6
|
+
* are real remote RPCs: local session/tab state is only removed after the daemon confirms, so a
|
|
7
|
+
* failure (disconnected, agent already gone, etc.) surfaces instead of silently leaving the record
|
|
8
|
+
* on disk while the UI pretends it's gone.
|
|
9
|
+
*/
|
|
10
|
+
export declare function SessionContextMenu(): import("react").JSX.Element | null;
|
|
11
|
+
//# sourceMappingURL=SessionContextMenu.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One row in the session list (POC `renderSessions` per-item markup, POC_TO_APP_PLAN_UI.md §4.2).
|
|
3
|
+
* Presentational: `SessionList.tsx` owns selection, the context menu, and the drag payload; row
|
|
4
|
+
* state (title/meta/reason/dot/italic) comes entirely from `sidebarSessionView` (task-001), so
|
|
5
|
+
* this component never reaches into `session.status`/`.timeline` itself (design spec § 03). The
|
|
6
|
+
* one exception is the needs-input source itself (sprint-068's `useAgentUiPending`) — a store read
|
|
7
|
+
* `sidebarSessionView` deliberately does not perform, staying pure (sprint-069/task-001).
|
|
8
|
+
*/
|
|
9
|
+
import type { DragEvent } from "react";
|
|
10
|
+
import type { SessionEntry } from "../../stores/session-store.js";
|
|
11
|
+
export interface SessionItemProps {
|
|
12
|
+
session: SessionEntry;
|
|
13
|
+
active: boolean;
|
|
14
|
+
/** False for a row outside the workspace currently in view — see `SessionList`'s
|
|
15
|
+
* `handleDragStart` for why those rows must not be draggable into a pane at all. */
|
|
16
|
+
draggable: boolean;
|
|
17
|
+
onSelect: () => void;
|
|
18
|
+
onOpenMenu: (x: number, y: number) => void;
|
|
19
|
+
onDragStartRow: (e: DragEvent) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function SessionItem({ session, active, draggable, onSelect, onOpenMenu, onDragStartRow, }: SessionItemProps): import("react").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=SessionItem.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Left sidebar session list (POC `#session-list`/`renderSessions`, POC_TO_APP_PLAN_UI.md §4.3).
|
|
3
|
+
* Sessions are grouped into a collapsible tree by workspace (project `cwd`): clicking a workspace
|
|
4
|
+
* header toggles that workspace's collapsed state; clicking a nested session opens that session.
|
|
5
|
+
* New session / Delete workspace live behind the header's "⋮" button
|
|
6
|
+
* (`WorkspaceContextMenu.tsx`) rather than always-visible icon buttons.
|
|
7
|
+
*/
|
|
8
|
+
export declare function SessionList(): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=SessionList.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace context menu — Radix DropdownMenu anchored at cursor/button coordinates, mirroring
|
|
3
|
+
* `SessionContextMenu.tsx`'s pattern. Opened via `WorkspaceGroupHeader`'s "⋮" button (a single
|
|
4
|
+
* consolidated menu, replacing two always-visible icon buttons — file-explorer quick-wins-1).
|
|
5
|
+
* Actions: New session, Delete workspace (all conversations — a real remote RPC per session,
|
|
6
|
+
* `client.agent(id).delete()`; local state only drops after each one confirms).
|
|
7
|
+
*/
|
|
8
|
+
export declare function WorkspaceContextMenu(): import("react").JSX.Element | null;
|
|
9
|
+
//# sourceMappingURL=WorkspaceContextMenu.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collapsible workspace header in the sidebar tree — one per distinct session `cwd`
|
|
3
|
+
* (POC_TO_APP_PLAN_UI.md §4.3 workspace grouping). Rendered as a full-bleed band (design spec
|
|
4
|
+
* § 03): `surface2` fill, no card frame, same look expanded or collapsed — expansion is expressed
|
|
5
|
+
* only by the chevron rotation and the presence of session rows below it. Clicking anywhere on
|
|
6
|
+
* the header (or its chevron) toggles collapse/expand; opening a session is a separate, explicit
|
|
7
|
+
* action (click a session row). New session / Delete workspace live behind the "⋮" button's
|
|
8
|
+
* `WorkspaceContextMenu` — a single consolidated menu instead of two always-visible icon buttons
|
|
9
|
+
* (file-explorer quick-wins-1).
|
|
10
|
+
*/
|
|
11
|
+
import type { WorkspaceAttentionInfo } from "./session-presentation.js";
|
|
12
|
+
export interface WorkspaceGroupHeaderProps {
|
|
13
|
+
label: string;
|
|
14
|
+
cwd: string;
|
|
15
|
+
sessionCount: number;
|
|
16
|
+
collapsed: boolean;
|
|
17
|
+
/** Precomputed attention info (`workspaceAttentionDot`), already gated to collapsed-only by the
|
|
18
|
+
* caller. Presentational: builds the § 08 accessible name from its own `label` prop plus the
|
|
19
|
+
* info's reason/count, and opts the dot into the pulse modifier only for the "question" reason
|
|
20
|
+
* (sprint-069/task-003). */
|
|
21
|
+
attentionDot: WorkspaceAttentionInfo | null;
|
|
22
|
+
onToggleCollapsed: () => void;
|
|
23
|
+
onOpenMenu: (x: number, y: number) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function WorkspaceGroupHeader({ label, cwd, sessionCount, collapsed, attentionDot, onToggleCollapsed, onOpenMenu, }: WorkspaceGroupHeaderProps): import("react").JSX.Element;
|
|
26
|
+
//# sourceMappingURL=WorkspaceGroupHeader.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Applies the pending agent deep link against the real stores. Selection is exactly a sidebar
|
|
3
|
+
* click (`SessionList.handleSelect`): activate + setCwd + open the chat tab in the focused pane.
|
|
4
|
+
* Afterwards the host's deep-link source is consumed (the browser strips `agent=` from the URL).
|
|
5
|
+
*/
|
|
6
|
+
export declare function applyPendingAgentDeepLink(): void;
|
|
7
|
+
//# sourceMappingURL=apply-agent-deep-link.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared "open a session as a chat tab" dispatch — the sibling of `features/files/open-file-tab.ts`,
|
|
3
|
+
* and for the same reason: the tab id, label and normalized `workspaceCwd` must be identical no
|
|
4
|
+
* matter which entry point opens the conversation, because `tabIdentity` keys the persisted pane
|
|
5
|
+
* layout off them. Three call sites had grown their own copy of this object literal (the sidebar row
|
|
6
|
+
* click, the connect-time restore, and now a sidebar-to-pane drag); a fourth would have been a fourth
|
|
7
|
+
* chance to drift.
|
|
8
|
+
*
|
|
9
|
+
* `targetPaneId` places the tab in a named pane, exactly as `openNewChat`/`openFileTab` accept it;
|
|
10
|
+
* omitted, the tab lands in the focused pane.
|
|
11
|
+
*/
|
|
12
|
+
import type { SessionEntry } from "../../stores/session-store.js";
|
|
13
|
+
export declare function openChatTab(session: SessionEntry, homeDir: string | null, targetPaneId?: string): void;
|
|
14
|
+
//# sourceMappingURL=open-chat-tab.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared "open a workspace" resolver for the folder-picker dialog: given a target cwd, either
|
|
3
|
+
* activates the workspace's most recently active existing session, or creates a fresh one —
|
|
4
|
+
* avoids piling up duplicate sessions when the user re-opens a folder they already have a chat
|
|
5
|
+
* in. Distinct from `SessionList`'s "+ New session" affordances, which always start a
|
|
6
|
+
* brand-new session by design (POC_TO_APP_PLAN_UI.md §4.3 workspace grouping, §4.7 follow-up:
|
|
7
|
+
* open-workspace dialog).
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Resolve `cwd` (already tilde/absolute-normalized by the caller, e.g. via `resolveTildePath`) to
|
|
11
|
+
* a session: reuses the workspace's most recent session if one already exists at that cwd,
|
|
12
|
+
* otherwise creates a new one. Activates the session and opens/focuses its chat tab. Also seeds
|
|
13
|
+
* `useUiStore().cwd` so a subsequent bare "+ New session" defaults to this workspace.
|
|
14
|
+
*
|
|
15
|
+
* `homeDir` MUST be the same value the sidebar's grouping uses (`useHomeDir()`), so this matches
|
|
16
|
+
* the exact workspace bucket a tilde-form and absolute-form cwd would collapse into — reusing a
|
|
17
|
+
* different normalization here would resurrect the tilde/absolute duplicate-workspace bug.
|
|
18
|
+
*/
|
|
19
|
+
export declare function openWorkspace(cwd: string, homeDir: string | null): void;
|
|
20
|
+
//# sourceMappingURL=open-workspace.d.ts.map
|