@av-pi-studio/workbench 0.0.0-stage → 0.0.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +157 -2
- package/dist/chunks/BinaryFallbackViewer-BN-9Yvel.js +19 -0
- package/dist/chunks/ChatPanel-CjPUJMEs.js +2493 -0
- package/dist/chunks/CodeView-6kJms_MF.js +143 -0
- package/dist/chunks/DiffView-BqDuT3CF.js +48 -0
- package/dist/chunks/FilePanel-B8IXG2bj.js +92 -0
- package/dist/chunks/HtmlViewer-DpuVFaDo.js +490 -0
- package/dist/chunks/ImageViewer-BBfyA5QN.js +27 -0
- package/dist/chunks/MarkdownFileViewer-DPFPDS7G.js +88 -0
- package/dist/chunks/ModelProvidersPanel-Dsezq7Ss.js +95 -0
- package/dist/chunks/MoleculeViewerPanel-DEEU6Zkx.js +191 -0
- package/dist/chunks/PdfViewer-BdacmAu_.js +300 -0
- package/dist/chunks/SaveFileButton-2rOu02Xx.js +33 -0
- package/dist/chunks/SettingsDialog-DO1tDhMW.js +471 -0
- package/dist/chunks/SkillsPanel-DZDia4Pw.js +833 -0
- package/dist/chunks/TerminalPanel-bphwCSyW.js +242 -0
- package/dist/chunks/TextViewer-CVGqN6yy.js +63 -0
- package/dist/chunks/VideoViewer-BkB9BoOr.js +20 -0
- package/dist/chunks/ViewersPanel-C2E9FLf7.js +50 -0
- package/dist/chunks/href-resolution-jv3tpRcp.js +25 -0
- package/dist/chunks/index-Dlz8mEKZ.js +6258 -0
- package/dist/chunks/markdown-B2OXhZ-_.js +353 -0
- package/dist/chunks/provider-auth-store-C1GaLTlw.js +34 -0
- package/dist/chunks/use-file-download-CogCqTvU.js +31 -0
- package/dist/chunks/use-file-watch-Bb_Xzbr-.js +55 -0
- package/dist/chunks/use-provider-auth-list-DTjIZycd.js +16 -0
- package/dist/features/agent-ui/AskCard.d.ts +62 -0
- package/dist/features/agent-ui/agent-ui-store.d.ts +84 -0
- package/dist/features/agent-ui/announce.d.ts +51 -0
- package/dist/features/agent-ui/ask-list.d.ts +53 -0
- package/dist/features/agent-ui/ask-placement.d.ts +47 -0
- package/dist/features/agent-ui/deadline.d.ts +27 -0
- package/dist/features/agent-ui/keyboard.d.ts +37 -0
- package/dist/features/agent-ui/notify-effect.d.ts +41 -0
- package/dist/features/agent-ui/option-layout.d.ts +24 -0
- package/dist/features/agent-ui/outcome-line.d.ts +38 -0
- package/dist/features/agent-ui/prompt-text.d.ts +24 -0
- package/dist/features/chat/Attachments.d.ts +20 -0
- package/dist/features/chat/ChatPanel.d.ts +12 -0
- package/dist/features/chat/CommandMenu.d.ts +41 -0
- package/dist/features/chat/Composer.d.ts +58 -0
- package/dist/features/chat/ForkDialog.d.ts +24 -0
- package/dist/features/chat/ModelMenu.d.ts +54 -0
- package/dist/features/chat/ThinkingMenu.d.ts +39 -0
- package/dist/features/chat/Timeline.d.ts +30 -0
- package/dist/features/chat/TurnProgressBar.d.ts +14 -0
- package/dist/features/chat/composer-busy.d.ts +22 -0
- package/dist/features/chat/composer-gate.d.ts +37 -0
- package/dist/features/chat/composer-path-drop.d.ts +75 -0
- package/dist/features/chat/fork-correlation.d.ts +39 -0
- package/dist/features/chat/fork-gate.d.ts +27 -0
- package/dist/features/chat/fork-picker-nav.d.ts +14 -0
- package/dist/features/chat/fork-result.d.ts +43 -0
- package/dist/features/chat/model-menu-sort.d.ts +30 -0
- package/dist/features/chat/onboarding-nudge.d.ts +18 -0
- package/dist/features/chat/rows/AssistantRow.d.ts +24 -0
- package/dist/features/chat/rows/CompactionRow.d.ts +16 -0
- package/dist/features/chat/rows/ErrorRow.d.ts +13 -0
- package/dist/features/chat/rows/ReasoningRow.d.ts +16 -0
- package/dist/features/chat/rows/RowShell.d.ts +37 -0
- package/dist/features/chat/rows/SystemRow.d.ts +11 -0
- package/dist/features/chat/rows/ToolCard.d.ts +30 -0
- package/dist/features/chat/rows/UserRow.d.ts +43 -0
- package/dist/features/chat/slash-commands.d.ts +81 -0
- package/dist/features/chat/thinking-level-source.d.ts +29 -0
- package/dist/features/chat/todos/TodoPanel.d.ts +11 -0
- package/dist/features/chat/todos/agent-todos-store.d.ts +35 -0
- package/dist/features/chat/todos/todo-collapse-codec.d.ts +12 -0
- package/dist/features/chat/todos/todo-panel-model.d.ts +37 -0
- package/dist/features/chat/use-bottom-anchor.d.ts +33 -0
- package/dist/features/chat/use-fork-action.d.ts +32 -0
- package/dist/features/connection/ConnectionBar.d.ts +18 -0
- package/dist/features/connection/connection-presentation.d.ts +70 -0
- package/dist/features/files/BinaryFallbackViewer.d.ts +9 -0
- package/dist/features/files/CodeView.d.ts +15 -0
- package/dist/features/files/DiffView.d.ts +18 -0
- package/dist/features/files/FileContextMenu.d.ts +13 -0
- package/dist/features/files/FileExplorer.d.ts +24 -0
- package/dist/features/files/FilePanel.d.ts +26 -0
- package/dist/features/files/HtmlViewer.d.ts +22 -0
- package/dist/features/files/ImageViewer.d.ts +8 -0
- package/dist/features/files/MarkdownFileViewer.d.ts +14 -0
- package/dist/features/files/MoleculeViewer.d.ts +60 -0
- package/dist/features/files/MoleculeViewerPanel.d.ts +9 -0
- package/dist/features/files/PdfViewer.d.ts +14 -0
- package/dist/features/files/RightSidebar.d.ts +9 -0
- package/dist/features/files/SaveFileButton.d.ts +9 -0
- package/dist/features/files/TextViewer.d.ts +23 -0
- package/dist/features/files/TreeDraftRow.d.ts +15 -0
- package/dist/features/files/TreeNode.d.ts +42 -0
- package/dist/features/files/TreeRenameRow.d.ts +19 -0
- package/dist/features/files/VideoViewer.d.ts +8 -0
- package/dist/features/files/create-entry.d.ts +23 -0
- package/dist/features/files/delete-entry.d.ts +17 -0
- package/dist/features/files/file-tree.d.ts +92 -0
- package/dist/features/files/git-status-index.d.ts +37 -0
- package/dist/features/files/html-asset-loader.d.ts +43 -0
- package/dist/features/files/html-assets.d.ts +97 -0
- package/dist/features/files/html-sandbox.d.ts +62 -0
- package/dist/features/files/molecule-reload.d.ts +20 -0
- package/dist/features/files/molecule-source.d.ts +10 -0
- package/dist/features/files/molecule-theme.d.ts +31 -0
- package/dist/features/files/move-entry.d.ts +10 -0
- package/dist/features/files/move-status.d.ts +10 -0
- package/dist/features/files/move-target.d.ts +31 -0
- package/dist/features/files/open-file-tab.d.ts +32 -0
- package/dist/features/files/pdf-layout.d.ts +28 -0
- package/dist/features/files/pdfjs-runtime.d.ts +30 -0
- package/dist/features/files/polymer-file.d.ts +33 -0
- package/dist/features/files/text-viewer-state.d.ts +53 -0
- package/dist/features/files/upload-sources.d.ts +20 -0
- package/dist/features/files/viewer-registry.d.ts +81 -0
- package/dist/features/files/write-file.d.ts +12 -0
- package/dist/features/git/ChangesPanel.d.ts +13 -0
- package/dist/features/provider-auth/LoginDialog.d.ts +21 -0
- package/dist/features/provider-auth/ModelProvidersPanel.d.ts +12 -0
- package/dist/features/provider-auth/QrCode.d.ts +26 -0
- package/dist/features/provider-auth/login-flow.d.ts +55 -0
- package/dist/features/provider-auth/provider-auth-presentation.d.ts +31 -0
- package/dist/features/provider-auth/provider-auth-store.d.ts +42 -0
- package/dist/features/sessions/SessionContextMenu.d.ts +11 -0
- package/dist/features/sessions/SessionItem.d.ts +22 -0
- package/dist/features/sessions/SessionList.d.ts +9 -0
- package/dist/features/sessions/WorkspaceContextMenu.d.ts +9 -0
- package/dist/features/sessions/WorkspaceGroupHeader.d.ts +26 -0
- package/dist/features/sessions/apply-agent-deep-link.d.ts +7 -0
- package/dist/features/sessions/open-chat-tab.d.ts +14 -0
- package/dist/features/sessions/open-workspace.d.ts +20 -0
- package/dist/features/sessions/session-actions.d.ts +18 -0
- package/dist/features/sessions/session-presentation.d.ts +47 -0
- package/dist/features/sessions/status-map.d.ts +10 -0
- package/dist/features/sessions/workspace-grouping.d.ts +30 -0
- package/dist/features/settings/SettingsDialog.d.ts +22 -0
- package/dist/features/settings/ViewersPanel.d.ts +18 -0
- package/dist/features/settings/settings-categories.d.ts +32 -0
- package/dist/features/skills/InstallSkillDialog.d.ts +21 -0
- package/dist/features/skills/SkillsPanel.d.ts +32 -0
- package/dist/features/skills/skills-presentation.d.ts +159 -0
- package/dist/features/skills/use-skills.d.ts +215 -0
- package/dist/features/terminal/TerminalPanel.d.ts +37 -0
- package/dist/features/terminal/terminal-font.d.ts +44 -0
- package/dist/features/terminal/terminal-size.d.ts +52 -0
- package/dist/features/workspace/ContextMeter.d.ts +15 -0
- package/dist/features/workspace/ContextMeterPopover.d.ts +16 -0
- package/dist/features/workspace/DropPreview.d.ts +23 -0
- package/dist/features/workspace/PaneDividers.d.ts +30 -0
- package/dist/features/workspace/StatusBar.d.ts +16 -0
- package/dist/features/workspace/TabContextMenu.d.ts +15 -0
- package/dist/features/workspace/TabPanelHost.d.ts +30 -0
- package/dist/features/workspace/TabStrip.d.ts +36 -0
- package/dist/features/workspace/compact-action.d.ts +21 -0
- package/dist/features/workspace/context-meter.d.ts +26 -0
- package/dist/features/workspace/external-drag.d.ts +99 -0
- package/dist/features/workspace/pane-dnd.d.ts +70 -0
- package/dist/features/workspace/pane-layout-view.d.ts +73 -0
- package/dist/features/workspace/pane-tree.d.ts +141 -0
- package/dist/features/workspace/panel-registry.d.ts +13 -0
- package/dist/features/workspace/reopen-client-tabs.d.ts +44 -0
- package/dist/features/workspace/restore-active-workspace.d.ts +30 -0
- package/dist/features/workspace/status-bar-format.d.ts +20 -0
- package/dist/features/workspace/tab-attention.d.ts +35 -0
- package/dist/features/workspace-picker/OpenWorkspaceDialog.d.ts +11 -0
- package/dist/fonts/CascadiaMono.woff2 +0 -0
- package/dist/fonts/CascadiaMonoNF.woff2 +0 -0
- package/dist/fonts/LICENSE-Cascadia.txt +97 -0
- package/dist/fonts.css +60 -0
- package/dist/hooks/agent-stream-events.d.ts +20 -0
- package/dist/hooks/file-text-state.d.ts +31 -0
- package/dist/hooks/file-transfer-instance.d.ts +10 -0
- package/dist/hooks/use-agent-commands.d.ts +18 -0
- package/dist/hooks/use-agent-deep-link-boot.d.ts +9 -0
- package/dist/hooks/use-agent-stream.d.ts +15 -0
- package/dist/hooks/use-agent-todos.d.ts +10 -0
- package/dist/hooks/use-checkout-status.d.ts +13 -0
- package/dist/hooks/use-connection.d.ts +27 -0
- package/dist/hooks/use-explorer-tree.d.ts +20 -0
- package/dist/hooks/use-explorer-watch.d.ts +39 -0
- package/dist/hooks/use-explorer.d.ts +21 -0
- package/dist/hooks/use-external-pane-drop.d.ts +47 -0
- package/dist/hooks/use-file-diff.d.ts +9 -0
- package/dist/hooks/use-file-download.d.ts +18 -0
- package/dist/hooks/use-file-live-refresh.d.ts +31 -0
- package/dist/hooks/use-file-read.d.ts +31 -0
- package/dist/hooks/use-file-source.d.ts +16 -0
- package/dist/hooks/use-file-text.d.ts +21 -0
- package/dist/hooks/use-file-transfer.d.ts +18 -0
- package/dist/hooks/use-file-watch.d.ts +36 -0
- package/dist/hooks/use-home-dir.d.ts +14 -0
- package/dist/hooks/use-inline-image.d.ts +37 -0
- package/dist/hooks/use-is-compacting.d.ts +9 -0
- package/dist/hooks/use-pane-drag.d.ts +40 -0
- package/dist/hooks/use-pane-layout.d.ts +40 -0
- package/dist/hooks/use-provider-auth-list.d.ts +19 -0
- package/dist/hooks/use-provider-models.d.ts +14 -0
- package/dist/hooks/use-session-restore.d.ts +44 -0
- package/dist/hooks/use-session-stats.d.ts +40 -0
- package/dist/hooks/use-shortcuts.d.ts +6 -0
- package/dist/hooks/use-terminal-exit-watch.d.ts +47 -0
- package/dist/hooks/use-terminal-restore.d.ts +38 -0
- package/dist/hooks/use-thinking-levels.d.ts +13 -0
- package/dist/hooks/use-timeline-reset-watch.d.ts +43 -0
- package/dist/hooks/use-viewer-settings.d.ts +17 -0
- package/dist/host/browser-clipboard.d.ts +9 -0
- package/dist/host/browser-connection.d.ts +13 -0
- package/dist/host/browser-files.d.ts +9 -0
- package/dist/host/browser-host.d.ts +14 -0
- package/dist/host/browser-launch.d.ts +19 -0
- package/dist/host/browser-worker-timers.d.ts +29 -0
- package/dist/host/external-link.d.ts +14 -0
- package/dist/host/index.d.ts +4 -0
- package/dist/host/install.d.ts +21 -0
- package/dist/host/types.d.ts +168 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +18 -0
- package/dist/lib/agent-deep-link.d.ts +29 -0
- package/dist/lib/connection/connection-store.d.ts +49 -0
- package/dist/lib/connection/files-changed.d.ts +41 -0
- package/dist/lib/connection/live-file-transfer.d.ts +8 -0
- package/dist/lib/connection/normalize-url.d.ts +16 -0
- package/dist/lib/connection/query-client.d.ts +3 -0
- package/dist/lib/connection/resolve-connect-target.d.ts +10 -0
- package/dist/lib/connection/resume-action.d.ts +33 -0
- package/dist/lib/connection/resume-handler.d.ts +6 -0
- package/dist/lib/connection/rpc-keys.d.ts +39 -0
- package/dist/lib/drag-guard.d.ts +39 -0
- package/dist/lib/inline-image-cache.d.ts +34 -0
- package/dist/lib/pane-layout-persistence.d.ts +74 -0
- package/dist/lib/paths.d.ts +33 -0
- package/dist/lib/protocol/events.d.ts +19 -0
- package/dist/lib/protocol/timeline-paging.d.ts +29 -0
- package/dist/lib/random-id.d.ts +16 -0
- package/dist/shell/Workbench.d.ts +6 -0
- package/dist/shell/WorkbenchBoot.d.ts +4 -0
- package/dist/shell/WorkbenchProvider.d.ts +10 -0
- package/dist/shell/WorkspaceShell.d.ts +12 -0
- package/dist/shell/context.d.ts +8 -0
- package/dist/shell/hooks.d.ts +32 -0
- package/dist/shell/regions.d.ts +17 -0
- package/dist/stores/compaction-store.d.ts +45 -0
- package/dist/stores/deep-link-store.d.ts +15 -0
- package/dist/stores/draft-store.d.ts +45 -0
- package/dist/stores/explorer-store.d.ts +63 -0
- package/dist/stores/fork-store.d.ts +69 -0
- package/dist/stores/git-store.d.ts +59 -0
- package/dist/stores/layout-store.d.ts +137 -0
- package/dist/stores/materialize.d.ts +47 -0
- package/dist/stores/session-store.d.ts +76 -0
- package/dist/stores/stats-store.d.ts +48 -0
- package/dist/stores/tab-store.d.ts +145 -0
- package/dist/stores/ui-store.d.ts +85 -0
- package/dist/styles.css +1 -0
- package/dist/timeline/FileLink.d.ts +22 -0
- package/dist/timeline/InlineImage.d.ts +16 -0
- package/dist/timeline/bottom-anchor.d.ts +77 -0
- package/dist/timeline/compaction.d.ts +12 -0
- package/dist/timeline/file-link-src.d.ts +34 -0
- package/dist/timeline/file-open-target.d.ts +19 -0
- package/dist/timeline/format-meta-time.d.ts +10 -0
- package/dist/timeline/highlight.d.ts +9 -0
- package/dist/timeline/href-resolution.d.ts +34 -0
- package/dist/timeline/image-src.d.ts +32 -0
- package/dist/timeline/inline-image-view.d.ts +34 -0
- package/dist/timeline/live-tail.d.ts +5 -0
- package/dist/timeline/markdown.d.ts +35 -0
- package/dist/timeline/mermaid-theme.d.ts +23 -0
- package/dist/timeline/reducer.d.ts +38 -0
- package/dist/timeline/row-model.d.ts +154 -0
- package/dist/timeline/streaming-split.d.ts +42 -0
- package/dist/timeline/tool-mapping.d.ts +60 -0
- package/dist/viewer-plugins/viewer-settings-store.d.ts +55 -0
- package/dist/vite/index.d.ts +36 -0
- package/dist/vite/index.js +39 -0
- package/package.json +81 -4
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sidebar context menus' dialog-gated actions, outside React so they run (and are tested)
|
|
3
|
+
* against whatever host is installed. Each asks through `getHost().dialogs` and only mutates after
|
|
4
|
+
* the user agreed.
|
|
5
|
+
*/
|
|
6
|
+
import type { PiStudioClient } from "@av-pi-studio/client";
|
|
7
|
+
import { type SessionEntry } from "../../stores/session-store.js";
|
|
8
|
+
type SessionRef = Pick<SessionEntry, "id" | "title" | "agentId">;
|
|
9
|
+
type AgentClient = Pick<PiStudioClient, "agent">;
|
|
10
|
+
/** Prompt for a new title; a dismissed or blank answer changes nothing. */
|
|
11
|
+
export declare function renameSession(session: SessionRef, client: AgentClient | null): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Ask, then delete every conversation of a workspace (files on disk are untouched). Returns whether
|
|
14
|
+
* the user confirmed. A failed delete is reported and skipped; the rest continue.
|
|
15
|
+
*/
|
|
16
|
+
export declare function deleteWorkspaceConversations(cwd: string, sessions: readonly SessionRef[], client: AgentClient | null, onConfirmed: () => void): Promise<boolean>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=session-actions.d.ts.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turns a `SessionEntry` into the sidebar's row presentation (state kind, meta text, optional
|
|
3
|
+
* short failure reason, `StatusDot` input, italic-title flag) and a workspace's sessions into the
|
|
4
|
+
* collapsed band's attention dot. Pure — no React, no store access — so it is unit-testable in
|
|
5
|
+
* isolation (design spec § 03, § 02, § 07).
|
|
6
|
+
*/
|
|
7
|
+
import type { SessionEntry } from "../../stores/session-store.js";
|
|
8
|
+
import type { StatusDotInput } from "@av-pi-studio/ui-library";
|
|
9
|
+
export type SidebarSessionState = "running" | "failed" | "empty" | "idle" | "needsInput";
|
|
10
|
+
export interface SidebarSessionView {
|
|
11
|
+
state: SidebarSessionState;
|
|
12
|
+
/** Meta-line label: "running" | "turn failed" | "no messages" | "idle". */
|
|
13
|
+
meta: string;
|
|
14
|
+
/** Second meta segment — the failure reason. Non-null only when state === "failed". */
|
|
15
|
+
reason: string | null;
|
|
16
|
+
/** `StatusDot` props for the meta row — every state gets one (a muted flat dot for idle/empty,
|
|
17
|
+
* a spinner for running, a danger dot for failed) so the row always carries a colored status
|
|
18
|
+
* signal, not only running/failed. */
|
|
19
|
+
dot: StatusDotInput | null;
|
|
20
|
+
/** True for a never-used session — § 03 renders its title italic. */
|
|
21
|
+
titleItalic: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @param hasPendingQuestion Whether at least one extension question is pending on this session
|
|
25
|
+
* (sprint-068's store — sourced by the caller; this module stays store-free). One or many
|
|
26
|
+
* pending questions render the same single signal (§ 08: "one signal per row").
|
|
27
|
+
*/
|
|
28
|
+
export declare function sidebarSessionView(session: SessionEntry, hasPendingQuestion: boolean): SidebarSessionView;
|
|
29
|
+
export interface WorkspaceAttentionInfo {
|
|
30
|
+
dot: StatusDotInput;
|
|
31
|
+
/** Precedence decision (sprint-069/task-003): a pending question wins over a failed session —
|
|
32
|
+
* a failed turn is already over and can be reviewed whenever, while a pending question means an
|
|
33
|
+
* agent is actively blocked on the user right now, the more urgent state to surface in a
|
|
34
|
+
* collapsed group's single dot. */
|
|
35
|
+
reason: "question" | "failed";
|
|
36
|
+
/** Number of *sessions* (not questions) with a pending question — only meaningful when
|
|
37
|
+
* `reason === "question"`; § 08's accessible-name count is per-session, and one session with
|
|
38
|
+
* two pending questions still counts once (task-001's "one signal per row" extended to the
|
|
39
|
+
* group level). */
|
|
40
|
+
pendingSessionCount: number;
|
|
41
|
+
}
|
|
42
|
+
/** Collapsed workspace band: a dot only when a child needs attention, else null. Running is
|
|
43
|
+
* deliberately not attention (§ 03: dot shows "when collapsed and a child needs attention").
|
|
44
|
+
* `pendingAgentIds` is sprint-068's store, aggregated by the caller (`useAgentUiPendingAgentIds`)
|
|
45
|
+
* — this module stays store-free, matching `sidebarSessionView`'s contract. */
|
|
46
|
+
export declare function workspaceAttentionDot(sessions: SessionEntry[], pendingAgentIds: ReadonlySet<string>): WorkspaceAttentionInfo | null;
|
|
47
|
+
//# sourceMappingURL=session-presentation.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Protocol `AgentStatus` (initializing/idle/running/error/closed) → design-system
|
|
3
|
+
* `StatusDotInput.status` (idle/running/waiting/finished/error/queued/archived). The two enums
|
|
4
|
+
* differ because the design system's dot vocabulary predates this protocol; this is the single
|
|
5
|
+
* translation point.
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentStatus as ProtocolAgentStatus } from "@av-pi-studio/protocol";
|
|
8
|
+
import type { AgentStatus as DotAgentStatus } from "@av-pi-studio/ui-library";
|
|
9
|
+
export declare function toDotStatus(status: ProtocolAgentStatus | "idle"): DotAgentStatus;
|
|
10
|
+
//# sourceMappingURL=status-map.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Groups sidebar sessions by workspace (cwd) — each workspace is a project folder that can host
|
|
3
|
+
* several chat sessions, nested under a collapsible header (POC_TO_APP_PLAN_UI.md §4.3 follow-up:
|
|
4
|
+
* workspace-tree sidebar).
|
|
5
|
+
*/
|
|
6
|
+
import type { SessionEntry } from "../../stores/session-store.js";
|
|
7
|
+
export interface WorkspaceGroup {
|
|
8
|
+
/** Normalized (tilde-expanded when known) cwd — the group identity and RPC-ready path. */
|
|
9
|
+
cwd: string;
|
|
10
|
+
sessions: SessionEntry[];
|
|
11
|
+
}
|
|
12
|
+
/** Expand a leading `~` against `homeDir` when known; otherwise return `path` unchanged. Single
|
|
13
|
+
* source of truth for workspace identity — every consumer that needs to compare/derive a
|
|
14
|
+
* workspace cwd (grouping, tab scoping, the open-workspace resolver) MUST go through this, or a
|
|
15
|
+
* second normalization drifting from this one reintroduces tilde/absolute duplicate workspaces. */
|
|
16
|
+
export declare function normalizeCwd(path: string, homeDir: string | null): string;
|
|
17
|
+
/**
|
|
18
|
+
* Buckets sessions by `cwd` (tilde-normalized against `homeDir` so `~/proj` and
|
|
19
|
+
* `/home/user/proj` merge into one workspace once the home dir is known), preserving `order`'s
|
|
20
|
+
* recency: a workspace's position is its first appearance in `order`, and sessions within it keep
|
|
21
|
+
* their relative `order` position too — so the most recently created/active session in each
|
|
22
|
+
* workspace sorts first.
|
|
23
|
+
*/
|
|
24
|
+
export declare function groupSessionsByWorkspace(order: string[], sessions: Record<string, SessionEntry>, homeDir: string | null): WorkspaceGroup[];
|
|
25
|
+
/** Short display label for a workspace path — the last path segment, or `~` for the home dir. */
|
|
26
|
+
export declare function workspaceLabel(cwd: string): string;
|
|
27
|
+
/** Every workspace's cwd except `activeCwd` — used to seed the sidebar's collapsed set on a
|
|
28
|
+
* fresh connect (`use-session-restore.ts`) so only the just-restored workspace starts expanded. */
|
|
29
|
+
export declare function collapseInactiveWorkspaces(groups: WorkspaceGroup[], activeCwd: string): Set<string>;
|
|
30
|
+
//# sourceMappingURL=workspace-grouping.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SettingsDialog — the app's settings shell (sprint-065/task-003): a large `Dialog`-primitive
|
|
3
|
+
* modal with a category sidebar and a content pane. There is no settings screen or router in
|
|
4
|
+
* web-client today (`routes/WorkspacePage.tsx` is a single shell) — this modal *is* the settings
|
|
5
|
+
* IA rather than a one-off provider modal that would need migrating later: future categories
|
|
6
|
+
* (Appearance is the obvious next) add a registry entry in `settings-categories.ts`, not a new
|
|
7
|
+
* surface, and `app-navigation-screens.md`'s `/settings/hosts/[serverId]/providers` route renders
|
|
8
|
+
* these same category panels when that scope lands.
|
|
9
|
+
*
|
|
10
|
+
* The category registry itself (`SETTINGS_CATEGORIES`, `buildSettingsCategoryCapabilities`) lives
|
|
11
|
+
* in `settings-categories.ts`, not here — `ConnectionBar.tsx` needs it eagerly (to gate the
|
|
12
|
+
* settings gear) without pulling this file's own eager imports (`Dialog`, `LoginDialog`,
|
|
13
|
+
* `provider-auth-store`) into the main bundle ahead of the gear ever being clicked.
|
|
14
|
+
*
|
|
15
|
+
* The sidebar renders even with one entry: it is the IA, not decoration.
|
|
16
|
+
*/
|
|
17
|
+
export interface SettingsDialogProps {
|
|
18
|
+
open: boolean;
|
|
19
|
+
onOpenChange: (open: boolean) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function SettingsDialog({ open, onOpenChange }: SettingsDialogProps): import("react").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=SettingsDialog.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ViewersPanel — the Settings dialog's Viewers category (sprint-073/task-006, extended by
|
|
3
|
+
* sprint-078 with the PDF Viewer). Lists the fixed, hardcoded set of switchable viewers — a small
|
|
4
|
+
* constant table, not a registry: phase 4 of the decoupling plan (docs/MOLVIEWER_DECOUPLING.md)
|
|
5
|
+
* makes it registry-driven once a real plugin registry exists, and building that now would be
|
|
6
|
+
* speculative. Each `id` is the viewer-settings row its dispatch point reads through
|
|
7
|
+
* `isViewerEnabled` (molviewer: `open-file-tab.ts`; pdfviewer: the registry descriptor `toggle`).
|
|
8
|
+
*
|
|
9
|
+
* Capability-independent category — `SETTINGS_CATEGORIES`'s entry for this panel is
|
|
10
|
+
* `available: () => true`, so it always renders regardless of what the daemon advertises. Against
|
|
11
|
+
* a daemon that does NOT advertise `viewerSettings`, the rows still render, just disabled and
|
|
12
|
+
* reading on, with a note — the same degrade shape the capability-gated Model Providers category
|
|
13
|
+
* uses, never a hidden row. `isViewerEnabled` already defaults an unhydrated/capability-free
|
|
14
|
+
* document to "on" (viewer-settings-store.ts), so no separate "force checked" branch is needed
|
|
15
|
+
* here — `enabled` already reads `true` whenever `capable` is `false`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function ViewersPanel(): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=ViewersPanel.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The settings category registry — split out of `SettingsDialog.tsx` (sprint-073/task-006) so it
|
|
3
|
+
* can be imported eagerly from `ConnectionBar.tsx` (to gate the settings gear) without pulling
|
|
4
|
+
* `SettingsDialog.tsx`'s own eager imports (`Dialog`, `LoginDialog`, `provider-auth-store`) into
|
|
5
|
+
* the main bundle chunk ahead of the gear ever being clicked. The `lazy()` panel components below
|
|
6
|
+
* stay code-split regardless of who imports this module — only the actual `import()` call inside
|
|
7
|
+
* each `lazy()` thunk defers, never the registry array itself.
|
|
8
|
+
*/
|
|
9
|
+
import { type LucideIcon } from "lucide-react";
|
|
10
|
+
import type { ComponentType } from "react";
|
|
11
|
+
/** Server capabilities a settings category may gate its availability on. Grows as new
|
|
12
|
+
* capability-gated categories are added; a capability-independent category (e.g. Viewers)
|
|
13
|
+
* simply ignores this and always returns true. */
|
|
14
|
+
export interface SettingsCategoryCapabilities {
|
|
15
|
+
providerAuth: boolean;
|
|
16
|
+
/** sprint-075: `server_info.features.skills` — gates the Skills category. */
|
|
17
|
+
skills: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface SettingsCategory {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
icon: LucideIcon;
|
|
23
|
+
component: ComponentType;
|
|
24
|
+
available: (caps: SettingsCategoryCapabilities) => boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const SETTINGS_CATEGORIES: SettingsCategory[];
|
|
27
|
+
/** Builds the capability object every category's `available` predicate is evaluated against,
|
|
28
|
+
* from the connection store's `serverInfo.features` map. Shared by `SettingsDialog` (to filter
|
|
29
|
+
* the sidebar) and `ConnectionBar` (to gate the settings gear itself — "reachable whenever any
|
|
30
|
+
* category is available") so neither duplicates the `serverInfo?.features?.[…]` reads. */
|
|
31
|
+
export declare function buildSettingsCategoryCapabilities(features: Record<string, unknown> | undefined): SettingsCategoryCapabilities;
|
|
32
|
+
//# sourceMappingURL=settings-categories.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InstallSkillDialog — the Settings → Skills toolbar's "Install skill…" flow (sprint-077/
|
|
3
|
+
* task-007, last slice): source → (preview & pick for `skills_repo`/`local_path`) → running →
|
|
4
|
+
* results, swe/features/skills-manager.md § Install dialog. `SkillsPanel.tsx` mounts this
|
|
5
|
+
* component unconditionally (only the inner `<Dialog open>` toggles) so an in-flight
|
|
6
|
+
* `useSkillInstall()` keeps running when the dialog is closed — see use-skills.ts's module
|
|
7
|
+
* doc comment and § Install dialog: "closing does not cancel (queue continues; result arrives
|
|
8
|
+
* via skills_changed)". The step itself is never stored — `installDialogStep` (skills-
|
|
9
|
+
* presentation.ts) derives it purely from the two RPC hooks' in-flight/settled state.
|
|
10
|
+
*
|
|
11
|
+
* All server access goes through `useSkillPreview`/`useSkillInstall` (`previewSkillSource`/
|
|
12
|
+
* `installSkills`) — never `client.connection.request` for this family. The live kind label next
|
|
13
|
+
* to the source field uses the SDK's re-exported `detectSkillSource` (client-side convenience
|
|
14
|
+
* only; the daemon always re-runs detection authoritatively on both RPCs).
|
|
15
|
+
*/
|
|
16
|
+
export interface InstallSkillDialogProps {
|
|
17
|
+
open: boolean;
|
|
18
|
+
onOpenChange: (open: boolean) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function InstallSkillDialog({ open, onOpenChange }: InstallSkillDialogProps): import("react").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=InstallSkillDialog.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SkillsPanel — the Settings dialog's Skills category (sprint-075/task-006 slice 1: list +
|
|
3
|
+
* toggle; sprint-076/task-007 slice 2: remove, remove package, update all; sprint-077/task-007
|
|
4
|
+
* slice 3: the toolbar Install skill… button, `InstallSkillDialog.tsx`). Lists every global
|
|
5
|
+
* skill `useSkillsQuery()` resolves, grouped/ordered by `skills-presentation.ts#buildSkillGroups`,
|
|
6
|
+
* with a client-side search box, a per-row toggle (`use-skills.ts#useSkillToggle`), a per-row
|
|
7
|
+
* Remove shown only when `removable` and a package header Remove package
|
|
8
|
+
* (`use-skills.ts#useSkillRemove`), a toolbar Update all (`use-skills.ts#useSkillUpdateAll`)
|
|
9
|
+
* rendering two per-engine result rows, and a toolbar Install skill… opening
|
|
10
|
+
* `InstallSkillDialog.tsx` — mounted unconditionally here (only its own `open` prop toggles) so
|
|
11
|
+
* an in-flight install outlives the dialog being closed, see that file's own doc comment.
|
|
12
|
+
*
|
|
13
|
+
* All server access goes through the task-005/006/007 SDK methods (`listSkills`/
|
|
14
|
+
* `setSkillEnabled`/`removeSkill`/`updateAllSkills`/`previewSkillSource`/`installSkills`/
|
|
15
|
+
* `onSkillsChanged`) — never `client.connection.request` for this family. Remove/update-all/
|
|
16
|
+
* install responses **replace** the cached list wholesale (never optimistic, unlike toggle) —
|
|
17
|
+
* swe/features/skills-manager.md § Data flow.
|
|
18
|
+
*
|
|
19
|
+
* "Queued…" simplification: the spec names a "Queued…" state for a second mutation observed
|
|
20
|
+
* while one is already in flight (cross-window `skills_changed`-driven), but leaves its exact
|
|
21
|
+
* trigger ambiguous outside the install dialog's own two-installs-at-once case (which the
|
|
22
|
+
* daemon's FIFO queue already covers without any client-side state — a second client simply
|
|
23
|
+
* waits for its response, see § Acceptance). Each control here only disables and busies itself
|
|
24
|
+
* while its own request is in flight ("Working…"/spinner) — simple and honest per the task
|
|
25
|
+
* brief, and the daemon's own FIFO queueing means a second click from this same window while one
|
|
26
|
+
* request is pending is simply not possible (the control is disabled).
|
|
27
|
+
*
|
|
28
|
+
* swe/features/skills-manager.md § Panel, § Toggle, § Remove, § Update all, § Install dialog, §
|
|
29
|
+
* Error handling.
|
|
30
|
+
*/
|
|
31
|
+
export declare function SkillsPanel(): import("react").JSX.Element | null;
|
|
32
|
+
//# sourceMappingURL=SkillsPanel.d.ts.map
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turns `skills_list`/`skills_set_enabled`'s `{skills, packages}` document into what
|
|
3
|
+
* `SkillsPanel.tsx` renders — grouped/ordered rows, row badges/mute/disable state, package header
|
|
4
|
+
* badges, the search filter, and error-string → message mapping. Pure — no React, no store
|
|
5
|
+
* access — per this package's no-jsdom testing convention (AGENTS.md § "Framework-free testing
|
|
6
|
+
* convention: no jsdom"): `SkillsPanel.tsx` only binds this to the DOM, every branch here is
|
|
7
|
+
* covered by `skills-presentation.test.ts`.
|
|
8
|
+
*
|
|
9
|
+
* swe/features/skills-manager.md § Panel, § Data flow.
|
|
10
|
+
*/
|
|
11
|
+
import type { DetectedSkillSource, PiPackageInfo, PreviewSkill, SkillInfo, SkillsInstallResponse, SkillSourceKind } from "@av-pi-studio/protocol";
|
|
12
|
+
import type { StatusBadgeVariant } from "@av-pi-studio/ui-library";
|
|
13
|
+
export interface SkillRowBadge {
|
|
14
|
+
label: string;
|
|
15
|
+
variant: StatusBadgeVariant;
|
|
16
|
+
}
|
|
17
|
+
export interface SkillRowState {
|
|
18
|
+
skill: SkillInfo;
|
|
19
|
+
/** Shadowed by another skill of the same name — rendered muted, toggle disabled. */
|
|
20
|
+
muted: boolean;
|
|
21
|
+
toggleDisabled: boolean;
|
|
22
|
+
badges: SkillRowBadge[];
|
|
23
|
+
warnings: string[];
|
|
24
|
+
/** Tooltip text when this row shares a filter pattern with a sibling row (same name, both
|
|
25
|
+
* under Pi skills/Agent Skills) — toggling one changes both on the daemon. `null` otherwise. */
|
|
26
|
+
sharedPatternTooltip: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface PackageHeaderBadge {
|
|
29
|
+
label: string;
|
|
30
|
+
variant: StatusBadgeVariant;
|
|
31
|
+
}
|
|
32
|
+
export interface SkillGroup {
|
|
33
|
+
/** Stable group id: the origin string, or `package:<source>` for a package group. */
|
|
34
|
+
id: string;
|
|
35
|
+
label: string;
|
|
36
|
+
rows: SkillRowState[];
|
|
37
|
+
/** Present for `origin === "package"` groups — the resolved package row for the header. */
|
|
38
|
+
packageInfo?: PiPackageInfo;
|
|
39
|
+
}
|
|
40
|
+
/** Package header badges: kind, then `curated`/`pinned` when set. */
|
|
41
|
+
export declare function packageHeaderBadges(pkg: PiPackageInfo): PackageHeaderBadge[];
|
|
42
|
+
/**
|
|
43
|
+
* Groups + orders skills exactly as swe/features/skills-manager.md § Panel specifies: Pi skills
|
|
44
|
+
* (`agent_dir`), Agent Skills (`agents_dir`), one group per package (`packages[]` order, header
|
|
45
|
+
* from the matching `PiPackageInfo`), then Skill paths (`settings_path`). Empty groups are
|
|
46
|
+
* omitted. A `package`-origin skill whose `packageSource` doesn't match any entry in `packages`
|
|
47
|
+
* (a daemon/client version skew) still gets a group, keyed on the raw source string, appended
|
|
48
|
+
* after the known packages. An unrecognized `origin` string (the wire's open-string append-only
|
|
49
|
+
* rule) gets its own group, keyed and labeled on the raw string, appended at the end — skills are
|
|
50
|
+
* never silently dropped.
|
|
51
|
+
*/
|
|
52
|
+
export declare function buildSkillGroups(skills: SkillInfo[], packages: PiPackageInfo[]): SkillGroup[];
|
|
53
|
+
/** Client-side name/description substring filter (case-insensitive); groups left with no
|
|
54
|
+
* matching rows are dropped, matching the empty-group-hidden rule above. */
|
|
55
|
+
export declare function filterSkillGroups(groups: SkillGroup[], query: string): SkillGroup[];
|
|
56
|
+
/** True iff toggling this skill is the curated-package case that needs a confirm — the skill
|
|
57
|
+
* belongs to a `package`-origin group whose resolved `PiPackageInfo.curated` is true. */
|
|
58
|
+
export declare function requiresCuratedConfirm(skill: SkillInfo, packages: PiPackageInfo[]): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Confirm text for a single removable row's Remove button, by origin — swe/features/
|
|
61
|
+
* skills-manager.md § Remove. A symlinked entry takes priority over origin since any origin can
|
|
62
|
+
* in principle be a symlink on disk; `agents_dir` only gets the "every agent on this machine"
|
|
63
|
+
* wording when it also carries install provenance (a lock-tracked skill), matching the spec's
|
|
64
|
+
* "Agent Skills with provenance" case — a hand-placed `agents_dir` folder with no provenance
|
|
65
|
+
* falls through to the generic "plain dir" wording.
|
|
66
|
+
*/
|
|
67
|
+
export declare function skillRemoveConfirmText(skill: SkillInfo): string;
|
|
68
|
+
/** Confirm text for a package header's "Remove package" button — names the skill count before
|
|
69
|
+
* `removeSkill({packageSource})` drops the whole `settings.json` entry (swe/features/
|
|
70
|
+
* skills-manager.md § Remove: "Remove package lists the package's skill count"). */
|
|
71
|
+
export declare function removePackageConfirmText(pkg: PiPackageInfo): string;
|
|
72
|
+
/** Toolbar "Update all" confirm text, shipped verbatim from swe/features/skills-manager.md §
|
|
73
|
+
* Update all. */
|
|
74
|
+
export declare const UPDATE_ALL_CONFIRM_TEXT = "Updates every Agent Skills skill and every unpinned Pi package; may take several minutes";
|
|
75
|
+
/** Maps an `ItemResult.target` string to its result-row label; an unrecognized target (the
|
|
76
|
+
* wire's open-string append-only convention) renders verbatim. */
|
|
77
|
+
export declare function updateAllTargetLabel(target: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* Install and Update-all answer `ok: false` whenever ANY item failed, yet still carry the per-item
|
|
80
|
+
* `results` (and the re-listed `skills`/`packages`) — the UI must show those rows, not collapse
|
|
81
|
+
* them into one generic error. Only an answer with no item results at all (a request-level
|
|
82
|
+
* failure such as an unreadable settings file) is an error banner. Found live in sprint-077: a
|
|
83
|
+
* failed install silently stayed on the source step.
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* The query cache holds the LIST document the panel renders; `skills_install` / `skills_update_all`
|
|
87
|
+
* answers carry the same `skills`/`packages` but `ok: false` when any item failed. Written into
|
|
88
|
+
* the cache verbatim, that `ok: false` made the panel swap itself for its "could not load" error
|
|
89
|
+
* state and remount the install dialog mid-flow (found live, sprint-077) — so the cache copy is
|
|
90
|
+
* always marked `ok: true`: the re-listed rows are valid regardless of the item outcomes.
|
|
91
|
+
*/
|
|
92
|
+
export declare function asListDocument<T extends {
|
|
93
|
+
ok: boolean;
|
|
94
|
+
error?: string;
|
|
95
|
+
message?: string;
|
|
96
|
+
}>(response: T): T;
|
|
97
|
+
export declare function hasItemResults(response: {
|
|
98
|
+
results: readonly unknown[];
|
|
99
|
+
}): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Maps a domain `error` code to a human message: the response's own `message` wins when present
|
|
102
|
+
* (the daemon's elaboration, e.g. naming the unreadable settings path), else a known code gets a
|
|
103
|
+
* friendlier label, else the raw string renders verbatim (unknown strings, per the wire's
|
|
104
|
+
* append-only convention — swe/features/skills-manager.md § Error handling).
|
|
105
|
+
*/
|
|
106
|
+
export declare function skillErrorMessage(error: string | undefined, message?: string): string | null;
|
|
107
|
+
/** Live label next to the source field, keyed on `detectSkillSource`'s own `kind` — never a
|
|
108
|
+
* second classifier. `null` (nothing recognized) renders "Unrecognized" and disables Next. */
|
|
109
|
+
export type DetectedSourceLabel = "npm package" | "git package" | "Agent Skills repo" | "Folder on daemon host" | "Unrecognized";
|
|
110
|
+
export declare function detectedSourceLabel(detected: DetectedSkillSource | null): DetectedSourceLabel;
|
|
111
|
+
/** `pi_npm`/`pi_git` install as a unit (daemon spawns `pi install <source>`) — the dialog skips
|
|
112
|
+
* the pick step and the skills-only/full-system-access notice applies. */
|
|
113
|
+
export declare function isPackageSourceKind(kind: SkillSourceKind): boolean;
|
|
114
|
+
/** Next is enabled only for a recognized source — swe/features/skills-manager.md § Install
|
|
115
|
+
* dialog's "Unrecognized" row has no Next action; unit of the "Unrecognised input disables
|
|
116
|
+
* Next" acceptance criterion. */
|
|
117
|
+
export declare function canAdvanceFromSource(detected: DetectedSkillSource | null): boolean;
|
|
118
|
+
/** Package-kind notice, shipped verbatim from swe/features/skills-manager.md § Install dialog. */
|
|
119
|
+
export declare const PACKAGE_SOURCE_NOTICE: string;
|
|
120
|
+
export type InstallDialogStep = "source" | "previewing" | "pick" | "running" | "results";
|
|
121
|
+
export interface InstallDialogPhase {
|
|
122
|
+
previewPending: boolean;
|
|
123
|
+
previewResult: {
|
|
124
|
+
skills: PreviewSkill[];
|
|
125
|
+
} | null;
|
|
126
|
+
installPending: boolean;
|
|
127
|
+
installResult: SkillsInstallResponse | null;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The dialog's one step machine, derived purely from in-flight/settled RPC state — never stored
|
|
131
|
+
* as its own piece of state, so it can't drift from what actually happened. `source` is also the
|
|
132
|
+
* machine's reset/idle state. Terminal states win over earlier ones (a settled install always
|
|
133
|
+
* shows `results` even if, implausibly, `previewPending` were still true from a stale call).
|
|
134
|
+
*/
|
|
135
|
+
export declare function installDialogStep(phase: InstallDialogPhase): InstallDialogStep;
|
|
136
|
+
export interface PickRowState {
|
|
137
|
+
skill: PreviewSkill;
|
|
138
|
+
/** Default checked iff valid (swe/features/skills-manager.md § Install dialog: "checkbox
|
|
139
|
+
* (default checked iff valid)") — an invalid row starts and stays unchecked/disabled. */
|
|
140
|
+
checked: boolean;
|
|
141
|
+
/** Only meaningful when `skill.exists`; unchecked rows aren't sent even if `checked`. */
|
|
142
|
+
replace: boolean;
|
|
143
|
+
}
|
|
144
|
+
/** Seeds one row per previewed skill with the spec's default-checked rule. */
|
|
145
|
+
export declare function buildPickRows(skills: PreviewSkill[]): PickRowState[];
|
|
146
|
+
/**
|
|
147
|
+
* The names Install actually sends: checked, valid rows, excluding an `exists` row whose own
|
|
148
|
+
* Replace checkbox isn't checked — swe/features/skills-manager.md § Install dialog: "rows
|
|
149
|
+
* `exists` need a Replace checkbox before Install sends them." Filtered client-side rather than
|
|
150
|
+
* round-tripped through the daemon's `name_exists` rejection, since the UI already knows.
|
|
151
|
+
*/
|
|
152
|
+
export declare function resolvePickedSkillNames(rows: PickRowState[]): string[];
|
|
153
|
+
/** `skills_install_request`'s single `replace` flag is request-wide, not per-name; true iff at
|
|
154
|
+
* least one sent name is an `exists` row with its own Replace checkbox checked — it has no
|
|
155
|
+
* effect on the other sent names, which don't already exist. */
|
|
156
|
+
export declare function pickedSkillsNeedReplace(rows: PickRowState[]): boolean;
|
|
157
|
+
/** True iff no picked row will actually be sent — Install should stay disabled. */
|
|
158
|
+
export declare function hasNoPickedSkills(rows: PickRowState[]): boolean;
|
|
159
|
+
//# sourceMappingURL=skills-presentation.d.ts.map
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `useSkillsQuery`/`useSkillToggle`/`useSkillRemove`/`useSkillUpdateAll`/`useSkillPreview`/
|
|
3
|
+
* `useSkillInstall` — `skills_list_request` as a TanStack Query (mirrors
|
|
4
|
+
* `use-provider-auth-list.ts`'s convention), invalidated by the daemon's `skills_changed` push,
|
|
5
|
+
* plus the mutations: an optimistic `skills_set_enabled_request` with exact-prior-value rollback
|
|
6
|
+
* and a per-row inline error, `skills_remove_request` (single skill or whole package),
|
|
7
|
+
* `skills_update_all_request`, `skills_preview_request`, and `skills_install_request` — all four
|
|
8
|
+
* of the latter **replace** the cached `{skills, packages}` document with the response wholesale
|
|
9
|
+
* on success — never optimistic, per swe/features/skills-manager.md § Data flow: "install/
|
|
10
|
+
* remove/update replace query data with the response (never optimistic)". This is the
|
|
11
|
+
* `use-skills.ts` half of § Data flow, § Toggle, § Remove, § Update all, § Install dialog.
|
|
12
|
+
*
|
|
13
|
+
* The optimistic row patch (`applyOptimisticSkillToggle`) is exported and tested standalone per
|
|
14
|
+
* this package's no-jsdom convention (AGENTS.md § "Framework-free testing convention: no
|
|
15
|
+
* jsdom") — the hooks themselves only wire it to `queryClient`/`client`, untested directly.
|
|
16
|
+
*
|
|
17
|
+
* `useSkillInstall` deliberately holds no "cancel" affordance — `InstallSkillDialog.tsx` is
|
|
18
|
+
* mounted unconditionally by `SkillsPanel.tsx` (only its inner `<Dialog open>` toggles), so
|
|
19
|
+
* closing it doesn't unmount this hook: an in-flight `install()` keeps running and its state
|
|
20
|
+
* still lands here even while the dialog is visually closed, matching swe/features/
|
|
21
|
+
* skills-manager.md § Install dialog: "closing does not cancel (queue continues; result arrives
|
|
22
|
+
* via skills_changed)".
|
|
23
|
+
*/
|
|
24
|
+
import type { PiPackageInfo, SkillInfo, SkillsInstallResponse, SkillsListResponse, SkillsPreviewResponse, SkillsUpdateAllResponse } from "@av-pi-studio/protocol";
|
|
25
|
+
/** Patches one skill's `enabled` field in an already-fetched list response — the optimistic half
|
|
26
|
+
* of a toggle, applied to `queryClient`'s cached data before the RPC resolves. */
|
|
27
|
+
export declare function applyOptimisticSkillToggle(data: SkillsListResponse, path: string, enabled: boolean): SkillsListResponse;
|
|
28
|
+
/** `skills_list_request`, subscribed to `skills_changed` for the connection's lifetime so any
|
|
29
|
+
* window's mutation or an external `settings.json`/filesystem edit re-lists here too. */
|
|
30
|
+
export declare function useSkillsQuery(): import("@tanstack/react-query").UseQueryResult<NoInfer<import("zod").objectOutputType<{
|
|
31
|
+
type: import("zod").ZodLiteral<"skills_list_response">;
|
|
32
|
+
requestId: import("zod").ZodString;
|
|
33
|
+
ok: import("zod").ZodBoolean;
|
|
34
|
+
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
35
|
+
message: import("zod").ZodOptional<import("zod").ZodString>;
|
|
36
|
+
skills: import("zod").ZodArray<import("zod").ZodObject<{
|
|
37
|
+
name: import("zod").ZodString;
|
|
38
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
39
|
+
path: import("zod").ZodString;
|
|
40
|
+
enabled: import("zod").ZodBoolean;
|
|
41
|
+
origin: import("zod").ZodString;
|
|
42
|
+
originLabel: import("zod").ZodString;
|
|
43
|
+
packageSource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
44
|
+
shadowedBy: import("zod").ZodOptional<import("zod").ZodString>;
|
|
45
|
+
symlinkTarget: import("zod").ZodOptional<import("zod").ZodString>;
|
|
46
|
+
provenance: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
47
|
+
source: import("zod").ZodString;
|
|
48
|
+
sourceUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
49
|
+
installedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
50
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
51
|
+
source: import("zod").ZodString;
|
|
52
|
+
sourceUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
53
|
+
installedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
54
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
55
|
+
source: import("zod").ZodString;
|
|
56
|
+
sourceUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
57
|
+
installedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
58
|
+
}, import("zod").ZodTypeAny, "passthrough">>>;
|
|
59
|
+
disableModelInvocation: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
60
|
+
warnings: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
61
|
+
removable: import("zod").ZodBoolean;
|
|
62
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
63
|
+
name: import("zod").ZodString;
|
|
64
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
65
|
+
path: import("zod").ZodString;
|
|
66
|
+
enabled: import("zod").ZodBoolean;
|
|
67
|
+
origin: import("zod").ZodString;
|
|
68
|
+
originLabel: import("zod").ZodString;
|
|
69
|
+
packageSource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
70
|
+
shadowedBy: import("zod").ZodOptional<import("zod").ZodString>;
|
|
71
|
+
symlinkTarget: import("zod").ZodOptional<import("zod").ZodString>;
|
|
72
|
+
provenance: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
73
|
+
source: import("zod").ZodString;
|
|
74
|
+
sourceUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
75
|
+
installedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
76
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
77
|
+
source: import("zod").ZodString;
|
|
78
|
+
sourceUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
79
|
+
installedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
80
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
81
|
+
source: import("zod").ZodString;
|
|
82
|
+
sourceUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
83
|
+
installedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
84
|
+
}, import("zod").ZodTypeAny, "passthrough">>>;
|
|
85
|
+
disableModelInvocation: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
86
|
+
warnings: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
87
|
+
removable: import("zod").ZodBoolean;
|
|
88
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
89
|
+
name: import("zod").ZodString;
|
|
90
|
+
description: import("zod").ZodOptional<import("zod").ZodString>;
|
|
91
|
+
path: import("zod").ZodString;
|
|
92
|
+
enabled: import("zod").ZodBoolean;
|
|
93
|
+
origin: import("zod").ZodString;
|
|
94
|
+
originLabel: import("zod").ZodString;
|
|
95
|
+
packageSource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
96
|
+
shadowedBy: import("zod").ZodOptional<import("zod").ZodString>;
|
|
97
|
+
symlinkTarget: import("zod").ZodOptional<import("zod").ZodString>;
|
|
98
|
+
provenance: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
99
|
+
source: import("zod").ZodString;
|
|
100
|
+
sourceUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
101
|
+
installedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
102
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
103
|
+
source: import("zod").ZodString;
|
|
104
|
+
sourceUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
105
|
+
installedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
106
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
107
|
+
source: import("zod").ZodString;
|
|
108
|
+
sourceUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
109
|
+
installedAt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
110
|
+
}, import("zod").ZodTypeAny, "passthrough">>>;
|
|
111
|
+
disableModelInvocation: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
112
|
+
warnings: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
|
|
113
|
+
removable: import("zod").ZodBoolean;
|
|
114
|
+
}, import("zod").ZodTypeAny, "passthrough">>, "many">;
|
|
115
|
+
packages: import("zod").ZodArray<import("zod").ZodObject<{
|
|
116
|
+
source: import("zod").ZodString;
|
|
117
|
+
kind: import("zod").ZodEnum<["npm", "git", "local"]>;
|
|
118
|
+
identity: import("zod").ZodString;
|
|
119
|
+
pinned: import("zod").ZodBoolean;
|
|
120
|
+
curated: import("zod").ZodBoolean;
|
|
121
|
+
filtered: import("zod").ZodBoolean;
|
|
122
|
+
skillCount: import("zod").ZodNumber;
|
|
123
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
124
|
+
source: import("zod").ZodString;
|
|
125
|
+
kind: import("zod").ZodEnum<["npm", "git", "local"]>;
|
|
126
|
+
identity: import("zod").ZodString;
|
|
127
|
+
pinned: import("zod").ZodBoolean;
|
|
128
|
+
curated: import("zod").ZodBoolean;
|
|
129
|
+
filtered: import("zod").ZodBoolean;
|
|
130
|
+
skillCount: import("zod").ZodNumber;
|
|
131
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
132
|
+
source: import("zod").ZodString;
|
|
133
|
+
kind: import("zod").ZodEnum<["npm", "git", "local"]>;
|
|
134
|
+
identity: import("zod").ZodString;
|
|
135
|
+
pinned: import("zod").ZodBoolean;
|
|
136
|
+
curated: import("zod").ZodBoolean;
|
|
137
|
+
filtered: import("zod").ZodBoolean;
|
|
138
|
+
skillCount: import("zod").ZodNumber;
|
|
139
|
+
}, import("zod").ZodTypeAny, "passthrough">>, "many">;
|
|
140
|
+
}, import("zod").ZodTypeAny, "passthrough">>, Error>;
|
|
141
|
+
export interface UseSkillToggle {
|
|
142
|
+
/** Per-skill-path inline error from the row's most recent failed toggle. */
|
|
143
|
+
rowErrors: Record<string, string>;
|
|
144
|
+
/** Per-skill-path in-flight flag — disables the row's switch while its own toggle is pending. */
|
|
145
|
+
pending: Record<string, boolean>;
|
|
146
|
+
toggle: (skill: SkillInfo, enabled: boolean) => Promise<void>;
|
|
147
|
+
clearRowError: (path: string) => void;
|
|
148
|
+
}
|
|
149
|
+
/** `skills_set_enabled_request`: optimistic cache patch, replaced with the daemon's real
|
|
150
|
+
* post-mutation `{skills, packages}` document on success, rolled back to the exact prior cached
|
|
151
|
+
* value on a domain `{ok:false}` or a thrown transport error — with the failure surfaced as this
|
|
152
|
+
* row's `rowErrors[path]` rather than a toast (swe/features/skills-manager.md § Toggle, §
|
|
153
|
+
* Error handling: "Toggle fails | Row rolls back; inline error"). */
|
|
154
|
+
export declare function useSkillToggle(): UseSkillToggle;
|
|
155
|
+
/** The wire's `{path}|{packageSource}` xor target — a single skill or a whole package. */
|
|
156
|
+
export type SkillRemoveTarget = {
|
|
157
|
+
path: string;
|
|
158
|
+
packageSource?: undefined;
|
|
159
|
+
} | {
|
|
160
|
+
path?: undefined;
|
|
161
|
+
packageSource: string;
|
|
162
|
+
};
|
|
163
|
+
export interface UseSkillRemove {
|
|
164
|
+
/** Per-target in-flight flag, keyed by skill path or `package:<source>`. */
|
|
165
|
+
pending: Record<string, boolean>;
|
|
166
|
+
/** Per-target inline error from the most recent failed remove. */
|
|
167
|
+
errors: Record<string, string>;
|
|
168
|
+
removeSkill: (skill: SkillInfo) => Promise<void>;
|
|
169
|
+
removePackage: (pkg: PiPackageInfo) => Promise<void>;
|
|
170
|
+
clearError: (key: string) => void;
|
|
171
|
+
}
|
|
172
|
+
/** `skills_remove_request` for a single skill (`{path}`) or a whole package (`{packageSource}`):
|
|
173
|
+
* no optimistic row removal — the response's `{skills, packages}` document replaces the cached
|
|
174
|
+
* list wholesale on success (swe/features/skills-manager.md § Data flow), with a domain
|
|
175
|
+
* `{ok:false}` or thrown transport error surfaced as `errors[key]` so the row/header stays in
|
|
176
|
+
* place with an inline message rather than vanishing speculatively. */
|
|
177
|
+
export declare function useSkillRemove(): UseSkillRemove;
|
|
178
|
+
export interface UseSkillUpdateAll {
|
|
179
|
+
pending: boolean;
|
|
180
|
+
result: SkillsUpdateAllResponse | null;
|
|
181
|
+
error: string | null;
|
|
182
|
+
updateAll: () => Promise<void>;
|
|
183
|
+
clearResult: () => void;
|
|
184
|
+
}
|
|
185
|
+
/** `skills_update_all_request`: no per-row targeting, no optimistic patch — the response's
|
|
186
|
+
* `{skills, packages}` replaces the cached list wholesale on success, and the full response
|
|
187
|
+
* (including its per-engine `results[]`) is kept so the panel can render the two result rows
|
|
188
|
+
* (swe/features/skills-manager.md § Update all) until the next attempt or an explicit dismiss. */
|
|
189
|
+
export declare function useSkillUpdateAll(): UseSkillUpdateAll;
|
|
190
|
+
export interface UseSkillPreview {
|
|
191
|
+
pending: boolean;
|
|
192
|
+
result: SkillsPreviewResponse | null;
|
|
193
|
+
error: string | null;
|
|
194
|
+
preview: (source: string) => Promise<void>;
|
|
195
|
+
reset: () => void;
|
|
196
|
+
}
|
|
197
|
+
/** `skills_preview_request`: `InstallSkillDialog.tsx`'s pick step. Never touches
|
|
198
|
+
* `rpcKeys.skillsList()` — a preview mutates nothing, so there is no list to patch. */
|
|
199
|
+
export declare function useSkillPreview(): UseSkillPreview;
|
|
200
|
+
export interface UseSkillInstall {
|
|
201
|
+
pending: boolean;
|
|
202
|
+
result: SkillsInstallResponse | null;
|
|
203
|
+
error: string | null;
|
|
204
|
+
install: (opts: {
|
|
205
|
+
source: string;
|
|
206
|
+
skills?: string[];
|
|
207
|
+
replace?: boolean;
|
|
208
|
+
}) => Promise<void>;
|
|
209
|
+
reset: () => void;
|
|
210
|
+
}
|
|
211
|
+
/** `skills_install_request`: no optimistic patch — on success the response's `{skills,
|
|
212
|
+
* packages}` replaces the cached list wholesale, and the full response (including its per-item
|
|
213
|
+
* `results[]`) is kept so the dialog can render the results step until dismissed/reset. */
|
|
214
|
+
export declare function useSkillInstall(): UseSkillInstall;
|
|
215
|
+
//# sourceMappingURL=use-skills.d.ts.map
|