@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,833 @@
|
|
|
1
|
+
import { jsxs as h, jsx as s, Fragment as le } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as K, useState as w, useRef as te } from "react";
|
|
3
|
+
import { AlertTriangle as U, ChevronRight as ne, Trash2 as se } from "lucide-react";
|
|
4
|
+
import { TextInput as Y, Icon as z, Dialog as re, Checkbox as j, StatusBadge as T, Button as D, Spinner as $, EmptyState as H, Switch as ae, IconButton as ie } from "@av-pi-studio/ui-library";
|
|
5
|
+
import { u as I, r as N, g as O } from "./index-Dlz8mEKZ.js";
|
|
6
|
+
import { detectSkillSource as oe } from "@av-pi-studio/client";
|
|
7
|
+
import { useQueryClient as F, useQuery as ce } from "@tanstack/react-query";
|
|
8
|
+
const G = {
|
|
9
|
+
agent_dir: "Pi skills",
|
|
10
|
+
agents_dir: "Agent Skills",
|
|
11
|
+
settings_path: "Skill paths"
|
|
12
|
+
}, W = /* @__PURE__ */ new Set(["agent_dir", "agents_dir"]);
|
|
13
|
+
function ue(e, t) {
|
|
14
|
+
return W.has(e.origin) && t.some(
|
|
15
|
+
(n) => n !== e && n.name === e.name && W.has(n.origin)
|
|
16
|
+
) ? `Pi applies this setting to every '${e.name}' skill folder.` : null;
|
|
17
|
+
}
|
|
18
|
+
function de(e, t, r) {
|
|
19
|
+
const n = !!e.shadowedBy, a = [];
|
|
20
|
+
if (n) {
|
|
21
|
+
const i = e.shadowedBy ? r.get(e.shadowedBy) : void 0;
|
|
22
|
+
a.push({
|
|
23
|
+
label: `shadowed by ${i?.originLabel ?? e.shadowedBy}`,
|
|
24
|
+
variant: "warning"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return e.symlinkTarget && a.push({ label: `→ ${e.symlinkTarget}`, variant: "muted" }), e.disableModelInvocation && a.push({ label: "manual only", variant: "muted" }), e.provenance?.source && a.push({ label: e.provenance.source, variant: "muted" }), {
|
|
28
|
+
skill: e,
|
|
29
|
+
muted: n,
|
|
30
|
+
toggleDisabled: n,
|
|
31
|
+
badges: a,
|
|
32
|
+
warnings: e.warnings ?? [],
|
|
33
|
+
sharedPatternTooltip: ue(e, t)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function pe(e) {
|
|
37
|
+
const t = [{ label: e.kind, variant: "muted" }];
|
|
38
|
+
return e.curated && t.push({ label: "curated", variant: "success" }), e.pinned && t.push({ label: "pinned", variant: "muted" }), t;
|
|
39
|
+
}
|
|
40
|
+
function ge(e, t) {
|
|
41
|
+
const r = new Map(e.map((c) => [c.path, c])), n = (c) => de(c, e, r), a = [], i = e.filter((c) => c.origin === "agent_dir").map(n);
|
|
42
|
+
i.length > 0 && a.push({ id: "agent_dir", label: G.agent_dir, rows: i });
|
|
43
|
+
const u = e.filter((c) => c.origin === "agents_dir").map(n);
|
|
44
|
+
u.length > 0 && a.push({ id: "agents_dir", label: G.agents_dir, rows: u });
|
|
45
|
+
const g = e.filter((c) => c.origin === "package"), d = /* @__PURE__ */ new Set();
|
|
46
|
+
for (const c of t) {
|
|
47
|
+
d.add(c.source);
|
|
48
|
+
const v = g.filter((_) => _.packageSource === c.source).map(n);
|
|
49
|
+
v.length > 0 && a.push({ id: `package:${c.source}`, label: c.source, rows: v, packageInfo: c });
|
|
50
|
+
}
|
|
51
|
+
const l = Array.from(
|
|
52
|
+
new Set(
|
|
53
|
+
g.filter((c) => c.packageSource && !d.has(c.packageSource)).map((c) => c.packageSource)
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
for (const c of l) {
|
|
57
|
+
const v = g.filter((_) => _.packageSource === c).map(n);
|
|
58
|
+
v.length > 0 && a.push({ id: `package:${c}`, label: c, rows: v });
|
|
59
|
+
}
|
|
60
|
+
const o = e.filter((c) => c.origin === "settings_path").map(n);
|
|
61
|
+
o.length > 0 && a.push({
|
|
62
|
+
id: "settings_path",
|
|
63
|
+
label: G.settings_path,
|
|
64
|
+
rows: o
|
|
65
|
+
});
|
|
66
|
+
const f = /* @__PURE__ */ new Set(["agent_dir", "agents_dir", "package", "settings_path"]), S = Array.from(
|
|
67
|
+
new Set(e.filter((c) => !f.has(c.origin)).map((c) => c.origin))
|
|
68
|
+
);
|
|
69
|
+
for (const c of S) {
|
|
70
|
+
const v = e.filter((_) => _.origin === c).map(n);
|
|
71
|
+
v.length > 0 && a.push({ id: c, label: c, rows: v });
|
|
72
|
+
}
|
|
73
|
+
return a;
|
|
74
|
+
}
|
|
75
|
+
function ke(e, t) {
|
|
76
|
+
const r = t.trim().toLowerCase();
|
|
77
|
+
return r ? e.map((n) => ({
|
|
78
|
+
...n,
|
|
79
|
+
rows: n.rows.filter(
|
|
80
|
+
(a) => a.skill.name.toLowerCase().includes(r) || (a.skill.description ?? "").toLowerCase().includes(r)
|
|
81
|
+
)
|
|
82
|
+
})).filter((n) => n.rows.length > 0) : e;
|
|
83
|
+
}
|
|
84
|
+
function he(e, t) {
|
|
85
|
+
return e.origin !== "package" || !e.packageSource ? !1 : !!t.find((n) => n.source === e.packageSource)?.curated;
|
|
86
|
+
}
|
|
87
|
+
function me(e) {
|
|
88
|
+
return e.symlinkTarget ? `Removes the link only; ${e.symlinkTarget} is kept.` : e.origin === "agents_dir" && e.provenance ? `Removes '${e.name}' for every agent on this machine.` : e.origin === "settings_path" ? `Removes the Pi settings entry that provides ${e.path} (other skills from the same folder stop loading too); files are kept.` : `Deletes ${e.path}.`;
|
|
89
|
+
}
|
|
90
|
+
function fe(e) {
|
|
91
|
+
const t = e.skillCount;
|
|
92
|
+
return `Remove ${e.source}? This removes ${t} skill${t === 1 ? "" : "s"}.`;
|
|
93
|
+
}
|
|
94
|
+
const we = "Updates every Agent Skills skill and every unpinned Pi package; may take several minutes", Se = {
|
|
95
|
+
"agent-skills": "Agent Skills",
|
|
96
|
+
"pi-packages": "Pi packages"
|
|
97
|
+
};
|
|
98
|
+
function be(e) {
|
|
99
|
+
return Se[e] ?? e;
|
|
100
|
+
}
|
|
101
|
+
const _e = {
|
|
102
|
+
settings_unreadable: "Can't read settings.json — skills can't be loaded or changed until this is fixed.",
|
|
103
|
+
invalid_source: "That source isn't recognized.",
|
|
104
|
+
not_found: "That skill could not be found.",
|
|
105
|
+
not_removable: "That skill can't be removed from here.",
|
|
106
|
+
spawn_failed: "Could not run the skills command.",
|
|
107
|
+
timeout: "Timed out."
|
|
108
|
+
};
|
|
109
|
+
function X(e) {
|
|
110
|
+
return { ...e, ok: !0, error: void 0, message: void 0 };
|
|
111
|
+
}
|
|
112
|
+
function Z(e) {
|
|
113
|
+
return e.results.length > 0;
|
|
114
|
+
}
|
|
115
|
+
function L(e, t) {
|
|
116
|
+
return e ? t || (_e[e] ?? e) : null;
|
|
117
|
+
}
|
|
118
|
+
const ve = {
|
|
119
|
+
pi_npm: "npm package",
|
|
120
|
+
pi_git: "git package",
|
|
121
|
+
skills_repo: "Agent Skills repo",
|
|
122
|
+
local_path: "Folder on daemon host"
|
|
123
|
+
};
|
|
124
|
+
function Re(e) {
|
|
125
|
+
return e ? ve[e.kind] : "Unrecognized";
|
|
126
|
+
}
|
|
127
|
+
function J(e) {
|
|
128
|
+
return e === "pi_npm" || e === "pi_git";
|
|
129
|
+
}
|
|
130
|
+
function ye(e) {
|
|
131
|
+
return e !== null;
|
|
132
|
+
}
|
|
133
|
+
const Ne = "Installs the package's skills only; its extensions stay disabled. Pi packages run with full system access — review the source before installing.";
|
|
134
|
+
function Pe(e) {
|
|
135
|
+
return e.installResult ? "results" : e.installPending ? "running" : e.previewPending ? "previewing" : e.previewResult ? "pick" : "source";
|
|
136
|
+
}
|
|
137
|
+
function Ee(e) {
|
|
138
|
+
return e.map((t) => ({ skill: t, checked: t.valid, replace: !1 }));
|
|
139
|
+
}
|
|
140
|
+
function V(e) {
|
|
141
|
+
return e.filter((t) => t.skill.valid && t.checked && (!t.skill.exists || t.replace)).map((t) => t.skill.name);
|
|
142
|
+
}
|
|
143
|
+
function Ae(e) {
|
|
144
|
+
return e.some((t) => t.skill.valid && t.checked && t.skill.exists && t.replace);
|
|
145
|
+
}
|
|
146
|
+
function Ce(e, t, r) {
|
|
147
|
+
return {
|
|
148
|
+
...e,
|
|
149
|
+
skills: e.skills.map((n) => n.path === t ? { ...n, enabled: r } : n)
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function De() {
|
|
153
|
+
const e = I((r) => r.client), t = F();
|
|
154
|
+
return K(() => {
|
|
155
|
+
if (e)
|
|
156
|
+
return e.onSkillsChanged(() => {
|
|
157
|
+
t.invalidateQueries({ queryKey: N.skillsList() });
|
|
158
|
+
});
|
|
159
|
+
}, [e, t]), ce({
|
|
160
|
+
queryKey: N.skillsList(),
|
|
161
|
+
queryFn: () => {
|
|
162
|
+
if (!e) throw new Error("not connected");
|
|
163
|
+
return e.listSkills();
|
|
164
|
+
},
|
|
165
|
+
enabled: !!e
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function Te() {
|
|
169
|
+
const e = I((d) => d.client), t = F(), [r, n] = w({}), [a, i] = w({});
|
|
170
|
+
function u(d) {
|
|
171
|
+
n((l) => {
|
|
172
|
+
if (!(d in l)) return l;
|
|
173
|
+
const o = { ...l };
|
|
174
|
+
return delete o[d], o;
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
async function g(d, l) {
|
|
178
|
+
if (!e) return;
|
|
179
|
+
const o = d.path;
|
|
180
|
+
u(o), i((S) => ({ ...S, [o]: !0 }));
|
|
181
|
+
const f = t.getQueryData(N.skillsList());
|
|
182
|
+
f && t.setQueryData(
|
|
183
|
+
N.skillsList(),
|
|
184
|
+
Ce(f, o, l)
|
|
185
|
+
);
|
|
186
|
+
try {
|
|
187
|
+
const S = await e.setSkillEnabled(o, l);
|
|
188
|
+
if (!S.ok) {
|
|
189
|
+
f && t.setQueryData(N.skillsList(), f), n((c) => ({
|
|
190
|
+
...c,
|
|
191
|
+
[o]: L(S.error, S.message) ?? "Failed to update skill."
|
|
192
|
+
}));
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
t.setQueryData(N.skillsList(), S);
|
|
196
|
+
} catch (S) {
|
|
197
|
+
f && t.setQueryData(N.skillsList(), f), n((c) => ({
|
|
198
|
+
...c,
|
|
199
|
+
[o]: S instanceof Error ? S.message : "Failed to update skill."
|
|
200
|
+
}));
|
|
201
|
+
} finally {
|
|
202
|
+
i((S) => {
|
|
203
|
+
const c = { ...S };
|
|
204
|
+
return delete c[o], c;
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return { rowErrors: r, pending: a, toggle: g, clearRowError: u };
|
|
209
|
+
}
|
|
210
|
+
function Ie(e) {
|
|
211
|
+
return e.path ?? `package:${e.packageSource}`;
|
|
212
|
+
}
|
|
213
|
+
function Le() {
|
|
214
|
+
const e = I((d) => d.client), t = F(), [r, n] = w({}), [a, i] = w({});
|
|
215
|
+
function u(d) {
|
|
216
|
+
i((l) => {
|
|
217
|
+
if (!(d in l)) return l;
|
|
218
|
+
const o = { ...l };
|
|
219
|
+
return delete o[d], o;
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
async function g(d) {
|
|
223
|
+
if (!e) return;
|
|
224
|
+
const l = Ie(d);
|
|
225
|
+
u(l), n((o) => ({ ...o, [l]: !0 }));
|
|
226
|
+
try {
|
|
227
|
+
const o = await e.removeSkill(d);
|
|
228
|
+
if (!o.ok) {
|
|
229
|
+
i((f) => ({
|
|
230
|
+
...f,
|
|
231
|
+
[l]: L(o.error, o.message) ?? "Failed to remove."
|
|
232
|
+
}));
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
t.setQueryData(N.skillsList(), o);
|
|
236
|
+
} catch (o) {
|
|
237
|
+
i((f) => ({
|
|
238
|
+
...f,
|
|
239
|
+
[l]: o instanceof Error ? o.message : "Failed to remove."
|
|
240
|
+
}));
|
|
241
|
+
} finally {
|
|
242
|
+
n((o) => {
|
|
243
|
+
const f = { ...o };
|
|
244
|
+
return delete f[l], f;
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
pending: r,
|
|
250
|
+
errors: a,
|
|
251
|
+
clearError: u,
|
|
252
|
+
removeSkill: (d) => g({ path: d.path }),
|
|
253
|
+
removePackage: (d) => g({ packageSource: d.source })
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
function xe() {
|
|
257
|
+
const e = I((l) => l.client), t = F(), [r, n] = w(!1), [a, i] = w(null), [u, g] = w(null);
|
|
258
|
+
async function d() {
|
|
259
|
+
if (e) {
|
|
260
|
+
n(!0), g(null);
|
|
261
|
+
try {
|
|
262
|
+
const l = await e.updateAllSkills();
|
|
263
|
+
if (!l.ok && !Z(l)) {
|
|
264
|
+
g(L(l.error, l.message) ?? "Failed to update skills.");
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
i(l), t.setQueryData(N.skillsList(), X(l));
|
|
268
|
+
} catch (l) {
|
|
269
|
+
g(l instanceof Error ? l.message : "Failed to update skills.");
|
|
270
|
+
} finally {
|
|
271
|
+
n(!1);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return { pending: r, result: a, error: u, updateAll: d, clearResult: () => i(null) };
|
|
276
|
+
}
|
|
277
|
+
function Be() {
|
|
278
|
+
const e = I((d) => d.client), [t, r] = w(!1), [n, a] = w(null), [i, u] = w(null);
|
|
279
|
+
async function g(d) {
|
|
280
|
+
if (e) {
|
|
281
|
+
r(!0), u(null);
|
|
282
|
+
try {
|
|
283
|
+
const l = await e.previewSkillSource(d);
|
|
284
|
+
if (!l.ok) {
|
|
285
|
+
u(L(l.error, l.message) ?? "Failed to preview.");
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
a(l);
|
|
289
|
+
} catch (l) {
|
|
290
|
+
u(l instanceof Error ? l.message : "Failed to preview.");
|
|
291
|
+
} finally {
|
|
292
|
+
r(!1);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return {
|
|
297
|
+
pending: t,
|
|
298
|
+
result: n,
|
|
299
|
+
error: i,
|
|
300
|
+
preview: g,
|
|
301
|
+
reset: () => {
|
|
302
|
+
a(null), u(null);
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
function ze() {
|
|
307
|
+
const e = I((l) => l.client), t = F(), [r, n] = w(!1), [a, i] = w(null), [u, g] = w(null);
|
|
308
|
+
async function d(l) {
|
|
309
|
+
if (e) {
|
|
310
|
+
n(!0), g(null);
|
|
311
|
+
try {
|
|
312
|
+
const o = await e.installSkills(l);
|
|
313
|
+
if (!o.ok && !Z(o)) {
|
|
314
|
+
g(L(o.error, o.message) ?? "Failed to install.");
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
i(o), t.setQueryData(N.skillsList(), X(o));
|
|
318
|
+
} catch (o) {
|
|
319
|
+
g(o instanceof Error ? o.message : "Failed to install.");
|
|
320
|
+
} finally {
|
|
321
|
+
n(!1);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return {
|
|
326
|
+
pending: r,
|
|
327
|
+
result: a,
|
|
328
|
+
error: u,
|
|
329
|
+
install: d,
|
|
330
|
+
reset: () => {
|
|
331
|
+
i(null), g(null);
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
const Fe = "piwb-InstallSkillDialog_sourceStep_Gw_qc", Me = "piwb-InstallSkillDialog_sourceLabel_c6duJ", He = "piwb-InstallSkillDialog_notice_wlQW7", Oe = "piwb-InstallSkillDialog_error_s5Snl", $e = "piwb-InstallSkillDialog_statusStep_-ppMO", Qe = "piwb-InstallSkillDialog_pickStep_IUs8G", qe = "piwb-InstallSkillDialog_pickRows_xB4y_", Ge = "piwb-InstallSkillDialog_pickRow_-8RwD", Ke = "piwb-InstallSkillDialog_pickRowMain_R2QnI", Ue = "piwb-InstallSkillDialog_pickRowTop_Hh8K4", je = "piwb-InstallSkillDialog_pickRowName_b-RWh", We = "piwb-InstallSkillDialog_pickRowDescription_K8hdn", Je = "piwb-InstallSkillDialog_backButton_uAUNS", Ve = "piwb-InstallSkillDialog_results_7zS46", Ye = "piwb-InstallSkillDialog_resultRow_9tp1e", Xe = "piwb-InstallSkillDialog_resultHeader_dkbr2", Ze = "piwb-InstallSkillDialog_resultTarget_Cvc1t", el = "piwb-InstallSkillDialog_resultError_Q5kFR", ll = "piwb-InstallSkillDialog_resultToggle_Hftac", tl = "piwb-InstallSkillDialog_resultStderr_nHkuc", m = {
|
|
336
|
+
sourceStep: Fe,
|
|
337
|
+
sourceLabel: Me,
|
|
338
|
+
notice: He,
|
|
339
|
+
error: Oe,
|
|
340
|
+
statusStep: $e,
|
|
341
|
+
pickStep: Qe,
|
|
342
|
+
pickRows: qe,
|
|
343
|
+
pickRow: Ge,
|
|
344
|
+
pickRowMain: Ke,
|
|
345
|
+
pickRowTop: Ue,
|
|
346
|
+
pickRowName: je,
|
|
347
|
+
pickRowDescription: We,
|
|
348
|
+
backButton: Je,
|
|
349
|
+
results: Ve,
|
|
350
|
+
resultRow: Ye,
|
|
351
|
+
resultHeader: Xe,
|
|
352
|
+
resultTarget: Ze,
|
|
353
|
+
resultError: el,
|
|
354
|
+
resultToggle: ll,
|
|
355
|
+
resultStderr: tl
|
|
356
|
+
};
|
|
357
|
+
function nl({ open: e, onOpenChange: t }) {
|
|
358
|
+
const r = Be(), n = ze(), [a, i] = w(""), [u, g] = w([]), d = te(!1), l = oe(a), o = Pe({
|
|
359
|
+
previewPending: r.pending,
|
|
360
|
+
previewResult: r.result,
|
|
361
|
+
installPending: n.pending,
|
|
362
|
+
installResult: n.result
|
|
363
|
+
});
|
|
364
|
+
K(() => {
|
|
365
|
+
e && !d.current && !n.pending && !n.result && (i(""), g([]), r.reset()), d.current = e;
|
|
366
|
+
}, [e]), K(() => {
|
|
367
|
+
r.result && g(Ee(r.result.skills));
|
|
368
|
+
}, [r.result]);
|
|
369
|
+
async function f() {
|
|
370
|
+
if (l) {
|
|
371
|
+
if (J(l.kind)) {
|
|
372
|
+
await n.install({ source: l.normalized });
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
await r.preview(l.normalized);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
function S(R, x) {
|
|
379
|
+
g((B) => B.map((M, k) => k === R ? { ...M, ...x } : M));
|
|
380
|
+
}
|
|
381
|
+
async function c() {
|
|
382
|
+
const R = V(u);
|
|
383
|
+
R.length !== 0 && await n.install({
|
|
384
|
+
source: r.result?.source ?? l?.normalized ?? a,
|
|
385
|
+
skills: R,
|
|
386
|
+
replace: Ae(u)
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
function v() {
|
|
390
|
+
r.reset(), g([]);
|
|
391
|
+
}
|
|
392
|
+
function _() {
|
|
393
|
+
n.reset(), t(!1);
|
|
394
|
+
}
|
|
395
|
+
const Q = r.result?.source ?? l?.normalized ?? a, q = V(u).length;
|
|
396
|
+
let E, P;
|
|
397
|
+
return o === "source" ? (E = /* @__PURE__ */ h("div", { className: m.sourceStep, children: [
|
|
398
|
+
/* @__PURE__ */ s(
|
|
399
|
+
Y,
|
|
400
|
+
{
|
|
401
|
+
autoFocus: !0,
|
|
402
|
+
placeholder: "npm:<name>, git:<url>, owner/repo, or a daemon-host path",
|
|
403
|
+
value: a,
|
|
404
|
+
onChange: (R) => i(R.target.value),
|
|
405
|
+
"aria-label": "Install source"
|
|
406
|
+
}
|
|
407
|
+
),
|
|
408
|
+
/* @__PURE__ */ s("div", { className: m.sourceLabel, children: Re(l) }),
|
|
409
|
+
l && J(l.kind) && /* @__PURE__ */ h("div", { className: m.notice, children: [
|
|
410
|
+
/* @__PURE__ */ s(z, { icon: U, size: "xs" }),
|
|
411
|
+
/* @__PURE__ */ s("span", { children: Ne })
|
|
412
|
+
] }),
|
|
413
|
+
r.error && /* @__PURE__ */ s("div", { className: m.error, children: r.error })
|
|
414
|
+
] }), P = /* @__PURE__ */ s(
|
|
415
|
+
D,
|
|
416
|
+
{
|
|
417
|
+
size: "sm",
|
|
418
|
+
disabled: !ye(l),
|
|
419
|
+
loading: n.pending,
|
|
420
|
+
onClick: () => void f(),
|
|
421
|
+
children: "Next"
|
|
422
|
+
}
|
|
423
|
+
)) : o === "previewing" ? (E = /* @__PURE__ */ h("div", { className: m.statusStep, children: [
|
|
424
|
+
/* @__PURE__ */ s($, { size: "sm" }),
|
|
425
|
+
" Looking up the source…"
|
|
426
|
+
] }), P = null) : o === "pick" ? (E = /* @__PURE__ */ h("div", { className: m.pickStep, children: [
|
|
427
|
+
u.length === 0 ? /* @__PURE__ */ s("div", { className: m.statusStep, children: "No installable skills found." }) : /* @__PURE__ */ s("div", { className: m.pickRows, children: u.map((R, x) => /* @__PURE__ */ s(
|
|
428
|
+
sl,
|
|
429
|
+
{
|
|
430
|
+
row: R,
|
|
431
|
+
onChange: (B) => S(x, B)
|
|
432
|
+
},
|
|
433
|
+
R.skill.relPath
|
|
434
|
+
)) }),
|
|
435
|
+
n.error && /* @__PURE__ */ s("div", { className: m.error, children: n.error })
|
|
436
|
+
] }), P = /* @__PURE__ */ h(le, { children: [
|
|
437
|
+
/* @__PURE__ */ s(
|
|
438
|
+
D,
|
|
439
|
+
{
|
|
440
|
+
size: "sm",
|
|
441
|
+
variant: "ghost",
|
|
442
|
+
className: m.backButton,
|
|
443
|
+
onClick: v,
|
|
444
|
+
children: "‹ Back"
|
|
445
|
+
}
|
|
446
|
+
),
|
|
447
|
+
/* @__PURE__ */ h(
|
|
448
|
+
D,
|
|
449
|
+
{
|
|
450
|
+
size: "sm",
|
|
451
|
+
disabled: q === 0,
|
|
452
|
+
loading: n.pending,
|
|
453
|
+
onClick: () => void c(),
|
|
454
|
+
children: [
|
|
455
|
+
"Install from ",
|
|
456
|
+
Q
|
|
457
|
+
]
|
|
458
|
+
}
|
|
459
|
+
)
|
|
460
|
+
] })) : o === "running" ? (E = /* @__PURE__ */ h("div", { className: m.statusStep, children: [
|
|
461
|
+
/* @__PURE__ */ s($, { size: "sm" }),
|
|
462
|
+
" Installing… this may take several minutes"
|
|
463
|
+
] }), P = null) : (E = n.result ? /* @__PURE__ */ s(rl, { result: n.result }) : null, P = /* @__PURE__ */ s(D, { size: "sm", onClick: _, children: "Done" })), /* @__PURE__ */ s(
|
|
464
|
+
re,
|
|
465
|
+
{
|
|
466
|
+
open: e,
|
|
467
|
+
onOpenChange: (R) => {
|
|
468
|
+
if (!R && o === "results") {
|
|
469
|
+
_();
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
t(R);
|
|
473
|
+
},
|
|
474
|
+
title: "Install skill…",
|
|
475
|
+
width: 480,
|
|
476
|
+
footer: P,
|
|
477
|
+
children: E
|
|
478
|
+
}
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
function sl({
|
|
482
|
+
row: e,
|
|
483
|
+
onChange: t
|
|
484
|
+
}) {
|
|
485
|
+
const { skill: r, checked: n, replace: a } = e, i = !r.valid;
|
|
486
|
+
return /* @__PURE__ */ h("div", { className: m.pickRow, "data-disabled": i || void 0, children: [
|
|
487
|
+
/* @__PURE__ */ s(
|
|
488
|
+
j,
|
|
489
|
+
{
|
|
490
|
+
checked: n && r.valid,
|
|
491
|
+
disabled: i,
|
|
492
|
+
onChange: (u) => t({ checked: u.target.checked }),
|
|
493
|
+
"aria-label": r.name
|
|
494
|
+
}
|
|
495
|
+
),
|
|
496
|
+
/* @__PURE__ */ h("div", { className: m.pickRowMain, children: [
|
|
497
|
+
/* @__PURE__ */ h("div", { className: m.pickRowTop, children: [
|
|
498
|
+
/* @__PURE__ */ s("span", { className: m.pickRowName, children: r.name }),
|
|
499
|
+
!r.valid && /* @__PURE__ */ s(T, { label: "Invalid", variant: "error" }),
|
|
500
|
+
r.exists && /* @__PURE__ */ s(T, { label: "Already installed", variant: "warning" }),
|
|
501
|
+
r.warnings && r.warnings.length > 0 && /* @__PURE__ */ s(
|
|
502
|
+
z,
|
|
503
|
+
{
|
|
504
|
+
icon: U,
|
|
505
|
+
size: "xs",
|
|
506
|
+
color: "var(--pi-color-statusWarning)",
|
|
507
|
+
"aria-label": r.warnings.join("; ")
|
|
508
|
+
}
|
|
509
|
+
)
|
|
510
|
+
] }),
|
|
511
|
+
r.description && /* @__PURE__ */ s("span", { className: m.pickRowDescription, children: r.description }),
|
|
512
|
+
r.exists && r.valid && /* @__PURE__ */ s(
|
|
513
|
+
j,
|
|
514
|
+
{
|
|
515
|
+
label: "Already installed — replace",
|
|
516
|
+
checked: a,
|
|
517
|
+
onChange: (u) => t({ replace: u.target.checked })
|
|
518
|
+
}
|
|
519
|
+
)
|
|
520
|
+
] })
|
|
521
|
+
] });
|
|
522
|
+
}
|
|
523
|
+
function rl({ result: e }) {
|
|
524
|
+
const [t, r] = w(() => /* @__PURE__ */ new Set());
|
|
525
|
+
function n(a) {
|
|
526
|
+
r((i) => {
|
|
527
|
+
const u = new Set(i);
|
|
528
|
+
return u.has(a) ? u.delete(a) : u.add(a), u;
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
return /* @__PURE__ */ s("div", { className: m.results, children: e.results.map((a, i) => {
|
|
532
|
+
const u = t.has(i);
|
|
533
|
+
return /* @__PURE__ */ h("div", { className: m.resultRow, children: [
|
|
534
|
+
/* @__PURE__ */ h("div", { className: m.resultHeader, children: [
|
|
535
|
+
/* @__PURE__ */ s(
|
|
536
|
+
T,
|
|
537
|
+
{
|
|
538
|
+
label: a.ok ? "Installed" : "Failed",
|
|
539
|
+
variant: a.ok ? "success" : "error"
|
|
540
|
+
}
|
|
541
|
+
),
|
|
542
|
+
/* @__PURE__ */ s("span", { className: m.resultTarget, children: a.target }),
|
|
543
|
+
a.error && /* @__PURE__ */ s("span", { className: m.resultError, children: a.error }),
|
|
544
|
+
a.stderr && /* @__PURE__ */ s(
|
|
545
|
+
"button",
|
|
546
|
+
{
|
|
547
|
+
type: "button",
|
|
548
|
+
className: m.resultToggle,
|
|
549
|
+
onClick: () => n(i),
|
|
550
|
+
children: u ? "Hide details" : "Show details"
|
|
551
|
+
}
|
|
552
|
+
)
|
|
553
|
+
] }),
|
|
554
|
+
u && a.stderr && /* @__PURE__ */ s("pre", { className: m.resultStderr, children: a.stderr })
|
|
555
|
+
] }, `${a.target}-${i}`);
|
|
556
|
+
}) });
|
|
557
|
+
}
|
|
558
|
+
const al = "piwb-SkillsPanel_panel_kd7Dd", il = "piwb-SkillsPanel_toolbar_Op55s", ol = "piwb-SkillsPanel_search_8TWBz", cl = "piwb-SkillsPanel_groups_lqc-I", ul = "piwb-SkillsPanel_group_BGFm8", dl = "piwb-SkillsPanel_groupHeader_8vssS", pl = "piwb-SkillsPanel_chevronExpanded_iVp_I", gl = "piwb-SkillsPanel_groupLabel_cATX2", kl = "piwb-SkillsPanel_groupBadges_BwEHO", hl = "piwb-SkillsPanel_groupCount_AgrrZ", ml = "piwb-SkillsPanel_rows_1VJ1x", fl = "piwb-SkillsPanel_row_o_byo", wl = "piwb-SkillsPanel_rowMain_Ygjq8", Sl = "piwb-SkillsPanel_rowTop_RYLVf", bl = "piwb-SkillsPanel_name_Kd_jW", _l = "piwb-SkillsPanel_nameMuted_awuid piwb-SkillsPanel_name_Kd_jW", vl = "piwb-SkillsPanel_badge_2BN6o", Rl = "piwb-SkillsPanel_description_1fSuc", yl = "piwb-SkillsPanel_descriptionMuted_U6Gr6 piwb-SkillsPanel_description_1fSuc", Nl = "piwb-SkillsPanel_rowError_bPJS6", Pl = "piwb-SkillsPanel_footnote_pRoEm", El = "piwb-SkillsPanel_errorState_dkmpZ", Al = "piwb-SkillsPanel_removePackageBtn_LkuF2", Cl = "piwb-SkillsPanel_rowActions_C5Kt-", Dl = "piwb-SkillsPanel_updateAllResults_YJ1cS", Tl = "piwb-SkillsPanel_updateAllResultRow_b6vwt", Il = "piwb-SkillsPanel_updateAllResultHeader_9QMHd", Ll = "piwb-SkillsPanel_updateAllResultLabel_APi34", xl = "piwb-SkillsPanel_updateAllResultError_Fny2i", Bl = "piwb-SkillsPanel_updateAllResultToggle_0b9Jx", zl = "piwb-SkillsPanel_updateAllResultStderr_DOxNh", p = {
|
|
559
|
+
panel: al,
|
|
560
|
+
toolbar: il,
|
|
561
|
+
search: ol,
|
|
562
|
+
groups: cl,
|
|
563
|
+
group: ul,
|
|
564
|
+
groupHeader: dl,
|
|
565
|
+
chevronExpanded: pl,
|
|
566
|
+
groupLabel: gl,
|
|
567
|
+
groupBadges: kl,
|
|
568
|
+
groupCount: hl,
|
|
569
|
+
rows: ml,
|
|
570
|
+
row: fl,
|
|
571
|
+
rowMain: wl,
|
|
572
|
+
rowTop: Sl,
|
|
573
|
+
name: bl,
|
|
574
|
+
nameMuted: _l,
|
|
575
|
+
badge: vl,
|
|
576
|
+
description: Rl,
|
|
577
|
+
descriptionMuted: yl,
|
|
578
|
+
rowError: Nl,
|
|
579
|
+
footnote: Pl,
|
|
580
|
+
errorState: El,
|
|
581
|
+
removePackageBtn: Al,
|
|
582
|
+
rowActions: Cl,
|
|
583
|
+
updateAllResults: Dl,
|
|
584
|
+
updateAllResultRow: Tl,
|
|
585
|
+
updateAllResultHeader: Il,
|
|
586
|
+
updateAllResultLabel: Ll,
|
|
587
|
+
updateAllResultError: xl,
|
|
588
|
+
updateAllResultToggle: Bl,
|
|
589
|
+
updateAllResultStderr: zl
|
|
590
|
+
};
|
|
591
|
+
function Ul() {
|
|
592
|
+
const { data: e, isLoading: t, isError: r, error: n } = De(), { rowErrors: a, pending: i, toggle: u, clearRowError: g } = Te(), d = Le(), l = xe(), [o, f] = w(""), [S, c] = w(() => /* @__PURE__ */ new Set()), [v, _] = w(!1), [Q, q] = w(() => /* @__PURE__ */ new Set());
|
|
593
|
+
function E(k) {
|
|
594
|
+
c((A) => {
|
|
595
|
+
const y = new Set(A);
|
|
596
|
+
return y.has(k) ? y.delete(k) : y.add(k), y;
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
if (t)
|
|
600
|
+
return /* @__PURE__ */ h(H, { children: [
|
|
601
|
+
/* @__PURE__ */ s($, { size: "sm" }),
|
|
602
|
+
" Loading skills…"
|
|
603
|
+
] });
|
|
604
|
+
if (r)
|
|
605
|
+
return /* @__PURE__ */ s(H, { className: p.errorState, children: n instanceof Error ? n.message : "Failed to load skills." });
|
|
606
|
+
if (!e) return null;
|
|
607
|
+
if (!e.ok)
|
|
608
|
+
return /* @__PURE__ */ s(H, { className: p.errorState, children: L(e.error, e.message) ?? "Could not load skills." });
|
|
609
|
+
const P = ke(ge(e.skills, e.packages), o);
|
|
610
|
+
async function R(k, A) {
|
|
611
|
+
if (A && k.packageSource && he(k, e.packages) && !Q.has(k.packageSource)) {
|
|
612
|
+
if (!await O().dialogs.confirm(
|
|
613
|
+
"Pi-Studio will stop managing this package's updates."
|
|
614
|
+
)) return;
|
|
615
|
+
q((C) => new Set(C).add(k.packageSource));
|
|
616
|
+
}
|
|
617
|
+
u(k, A);
|
|
618
|
+
}
|
|
619
|
+
async function x(k) {
|
|
620
|
+
await O().dialogs.confirm(me(k)) && d.removeSkill(k);
|
|
621
|
+
}
|
|
622
|
+
async function B(k) {
|
|
623
|
+
await O().dialogs.confirm(fe(k)) && d.removePackage(k);
|
|
624
|
+
}
|
|
625
|
+
async function M() {
|
|
626
|
+
await O().dialogs.confirm(we) && l.updateAll();
|
|
627
|
+
}
|
|
628
|
+
return /* @__PURE__ */ h("div", { className: p.panel, children: [
|
|
629
|
+
/* @__PURE__ */ h("div", { className: p.toolbar, children: [
|
|
630
|
+
/* @__PURE__ */ s(
|
|
631
|
+
Y,
|
|
632
|
+
{
|
|
633
|
+
className: p.search,
|
|
634
|
+
placeholder: "Search skills…",
|
|
635
|
+
value: o,
|
|
636
|
+
onChange: (k) => f(k.target.value),
|
|
637
|
+
"aria-label": "Search skills"
|
|
638
|
+
}
|
|
639
|
+
),
|
|
640
|
+
/* @__PURE__ */ s(D, { size: "sm", variant: "outline", loading: l.pending, onClick: M, children: "Update all" }),
|
|
641
|
+
/* @__PURE__ */ s(D, { size: "sm", onClick: () => _(!0), children: "Install skill…" })
|
|
642
|
+
] }),
|
|
643
|
+
l.error && /* @__PURE__ */ s(
|
|
644
|
+
"button",
|
|
645
|
+
{
|
|
646
|
+
type: "button",
|
|
647
|
+
className: p.rowError,
|
|
648
|
+
onClick: () => l.updateAll().catch(() => {
|
|
649
|
+
}),
|
|
650
|
+
children: l.error
|
|
651
|
+
}
|
|
652
|
+
),
|
|
653
|
+
l.result && /* @__PURE__ */ s(Fl, { result: l.result, onDismiss: l.clearResult }),
|
|
654
|
+
P.length === 0 ? /* @__PURE__ */ s(H, { children: o ? "No skills match your search." : "No skills found." }) : /* @__PURE__ */ s("div", { className: p.groups, children: P.map((k) => {
|
|
655
|
+
const A = S.has(k.id), y = k.packageInfo, C = y ? `package:${y.source}` : void 0;
|
|
656
|
+
return /* @__PURE__ */ h("div", { className: p.group, children: [
|
|
657
|
+
/* @__PURE__ */ h(
|
|
658
|
+
"button",
|
|
659
|
+
{
|
|
660
|
+
type: "button",
|
|
661
|
+
className: p.groupHeader,
|
|
662
|
+
onClick: () => E(k.id),
|
|
663
|
+
"aria-expanded": !A,
|
|
664
|
+
children: [
|
|
665
|
+
/* @__PURE__ */ s(
|
|
666
|
+
z,
|
|
667
|
+
{
|
|
668
|
+
icon: ne,
|
|
669
|
+
size: "xs",
|
|
670
|
+
className: A ? void 0 : p.chevronExpanded
|
|
671
|
+
}
|
|
672
|
+
),
|
|
673
|
+
/* @__PURE__ */ s("span", { className: p.groupLabel, children: k.label }),
|
|
674
|
+
y && /* @__PURE__ */ s("span", { className: p.groupBadges, children: pe(y).map((b) => /* @__PURE__ */ s(
|
|
675
|
+
T,
|
|
676
|
+
{
|
|
677
|
+
label: b.label,
|
|
678
|
+
variant: b.variant
|
|
679
|
+
},
|
|
680
|
+
b.label
|
|
681
|
+
)) }),
|
|
682
|
+
/* @__PURE__ */ s("span", { className: p.groupCount, children: k.rows.length }),
|
|
683
|
+
y && /* @__PURE__ */ s(
|
|
684
|
+
D,
|
|
685
|
+
{
|
|
686
|
+
size: "xs",
|
|
687
|
+
variant: "ghost",
|
|
688
|
+
className: p.removePackageBtn,
|
|
689
|
+
loading: C ? !!d.pending[C] : !1,
|
|
690
|
+
onClick: (b) => {
|
|
691
|
+
b.stopPropagation(), B(y);
|
|
692
|
+
},
|
|
693
|
+
children: "Remove package"
|
|
694
|
+
}
|
|
695
|
+
)
|
|
696
|
+
]
|
|
697
|
+
}
|
|
698
|
+
),
|
|
699
|
+
C && d.errors[C] && /* @__PURE__ */ s(
|
|
700
|
+
"button",
|
|
701
|
+
{
|
|
702
|
+
type: "button",
|
|
703
|
+
className: p.rowError,
|
|
704
|
+
onClick: () => d.clearError(C),
|
|
705
|
+
children: d.errors[C]
|
|
706
|
+
}
|
|
707
|
+
),
|
|
708
|
+
!A && /* @__PURE__ */ s("div", { className: p.rows, children: k.rows.map((b) => /* @__PURE__ */ s(
|
|
709
|
+
Ml,
|
|
710
|
+
{
|
|
711
|
+
row: b,
|
|
712
|
+
error: a[b.skill.path],
|
|
713
|
+
pending: !!i[b.skill.path],
|
|
714
|
+
removeError: d.errors[b.skill.path],
|
|
715
|
+
removePending: !!d.pending[b.skill.path],
|
|
716
|
+
onToggle: (ee) => R(b.skill, ee),
|
|
717
|
+
onDismissError: () => g(b.skill.path),
|
|
718
|
+
onRemove: () => x(b.skill),
|
|
719
|
+
onDismissRemoveError: () => d.clearError(b.skill.path)
|
|
720
|
+
},
|
|
721
|
+
b.skill.path
|
|
722
|
+
)) })
|
|
723
|
+
] }, k.id);
|
|
724
|
+
}) }),
|
|
725
|
+
/* @__PURE__ */ s("p", { className: p.footnote, children: "Changes apply to newly started agent sessions." }),
|
|
726
|
+
/* @__PURE__ */ s(nl, { open: v, onOpenChange: _ })
|
|
727
|
+
] });
|
|
728
|
+
}
|
|
729
|
+
function Fl({
|
|
730
|
+
result: e,
|
|
731
|
+
onDismiss: t
|
|
732
|
+
}) {
|
|
733
|
+
const [r, n] = w(() => /* @__PURE__ */ new Set());
|
|
734
|
+
function a(i) {
|
|
735
|
+
n((u) => {
|
|
736
|
+
const g = new Set(u);
|
|
737
|
+
return g.has(i) ? g.delete(i) : g.add(i), g;
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
return /* @__PURE__ */ h("div", { className: p.updateAllResults, children: [
|
|
741
|
+
e.results.map((i) => {
|
|
742
|
+
const u = r.has(i.target);
|
|
743
|
+
return /* @__PURE__ */ h("div", { className: p.updateAllResultRow, children: [
|
|
744
|
+
/* @__PURE__ */ h("div", { className: p.updateAllResultHeader, children: [
|
|
745
|
+
/* @__PURE__ */ s(
|
|
746
|
+
T,
|
|
747
|
+
{
|
|
748
|
+
label: i.ok ? "Succeeded" : "Failed",
|
|
749
|
+
variant: i.ok ? "success" : "error"
|
|
750
|
+
}
|
|
751
|
+
),
|
|
752
|
+
/* @__PURE__ */ s("span", { className: p.updateAllResultLabel, children: be(i.target) }),
|
|
753
|
+
i.error && /* @__PURE__ */ s("span", { className: p.updateAllResultError, children: i.error }),
|
|
754
|
+
i.stderr && /* @__PURE__ */ s(
|
|
755
|
+
"button",
|
|
756
|
+
{
|
|
757
|
+
type: "button",
|
|
758
|
+
className: p.updateAllResultToggle,
|
|
759
|
+
onClick: () => a(i.target),
|
|
760
|
+
children: u ? "Hide details" : "Show details"
|
|
761
|
+
}
|
|
762
|
+
)
|
|
763
|
+
] }),
|
|
764
|
+
u && i.stderr && /* @__PURE__ */ s("pre", { className: p.updateAllResultStderr, children: i.stderr })
|
|
765
|
+
] }, i.target);
|
|
766
|
+
}),
|
|
767
|
+
/* @__PURE__ */ s("button", { type: "button", className: p.rowError, onClick: t, children: "Dismiss" })
|
|
768
|
+
] });
|
|
769
|
+
}
|
|
770
|
+
function Ml({
|
|
771
|
+
row: e,
|
|
772
|
+
error: t,
|
|
773
|
+
pending: r,
|
|
774
|
+
removeError: n,
|
|
775
|
+
removePending: a,
|
|
776
|
+
onToggle: i,
|
|
777
|
+
onDismissError: u,
|
|
778
|
+
onRemove: g,
|
|
779
|
+
onDismissRemoveError: d
|
|
780
|
+
}) {
|
|
781
|
+
const { skill: l, muted: o, toggleDisabled: f, badges: S, warnings: c, sharedPatternTooltip: v } = e;
|
|
782
|
+
return /* @__PURE__ */ h("div", { className: p.row, title: v ?? void 0, children: [
|
|
783
|
+
/* @__PURE__ */ h("div", { className: p.rowMain, children: [
|
|
784
|
+
/* @__PURE__ */ h("div", { className: p.rowTop, children: [
|
|
785
|
+
/* @__PURE__ */ s("span", { className: o ? p.nameMuted : p.name, children: l.name }),
|
|
786
|
+
c.length > 0 && /* @__PURE__ */ s(
|
|
787
|
+
z,
|
|
788
|
+
{
|
|
789
|
+
icon: U,
|
|
790
|
+
size: "xs",
|
|
791
|
+
color: "var(--pi-color-statusWarning)",
|
|
792
|
+
"aria-label": c.join("; ")
|
|
793
|
+
}
|
|
794
|
+
),
|
|
795
|
+
S.map((_) => /* @__PURE__ */ s(
|
|
796
|
+
T,
|
|
797
|
+
{
|
|
798
|
+
label: _.label,
|
|
799
|
+
variant: _.variant,
|
|
800
|
+
className: p.badge
|
|
801
|
+
},
|
|
802
|
+
_.label
|
|
803
|
+
))
|
|
804
|
+
] }),
|
|
805
|
+
l.description && /* @__PURE__ */ s("span", { className: o ? p.descriptionMuted : p.description, children: l.description }),
|
|
806
|
+
t && /* @__PURE__ */ s("button", { type: "button", className: p.rowError, onClick: u, children: t }),
|
|
807
|
+
n && /* @__PURE__ */ s("button", { type: "button", className: p.rowError, onClick: d, children: n })
|
|
808
|
+
] }),
|
|
809
|
+
/* @__PURE__ */ h("div", { className: p.rowActions, children: [
|
|
810
|
+
/* @__PURE__ */ s(
|
|
811
|
+
ae,
|
|
812
|
+
{
|
|
813
|
+
checked: l.enabled,
|
|
814
|
+
disabled: f || r,
|
|
815
|
+
onCheckedChange: i,
|
|
816
|
+
"aria-label": l.name
|
|
817
|
+
}
|
|
818
|
+
),
|
|
819
|
+
l.removable && /* @__PURE__ */ s(
|
|
820
|
+
ie,
|
|
821
|
+
{
|
|
822
|
+
"aria-label": `Remove ${l.name}`,
|
|
823
|
+
disabled: a,
|
|
824
|
+
onClick: g,
|
|
825
|
+
children: a ? /* @__PURE__ */ s($, { size: "xs" }) : /* @__PURE__ */ s(z, { icon: se, size: "xs" })
|
|
826
|
+
}
|
|
827
|
+
)
|
|
828
|
+
] })
|
|
829
|
+
] });
|
|
830
|
+
}
|
|
831
|
+
export {
|
|
832
|
+
Ul as SkillsPanel
|
|
833
|
+
};
|