@alivault/pico 0.1.5 → 0.1.7
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/.output/nitro.json +1 -1
- package/.output/public/assets/{index-D-sz4gTz.js → index-BWtOMO0B.js} +2 -2
- package/.output/public/assets/{routes-DSOVCxRf.js → routes-5c_6T6hK.js} +118 -115
- package/.output/server/_ssr/{router-ClRUX20Q.mjs → router-CvoH1TXL.mjs} +199 -161
- package/.output/server/_ssr/{routes-CNruDMyi.mjs → routes-DJqUmK-U.mjs} +196 -29
- package/.output/server/_ssr/{routes-Cvysm_fM.mjs → routes-Di-eYVLe.mjs} +2 -2
- package/.output/server/_ssr/ssr.mjs +2 -2
- package/.output/server/{_tanstack-start-manifest_v-BByO2avp.mjs → _tanstack-start-manifest_v-f3QaV5ex.mjs} +4 -4
- package/.output/server/index.mjs +496 -496
- package/README.md +6 -0
- package/bin/pico.mjs +103 -7
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { i as __toESM } from "../_runtime.mjs";
|
|
|
2
2
|
import { A as Input, C as MenuTrigger, D as MenuPortal, E as MenuPositioner, F as DialogDescription$1, I as DialogClose, K as mergeProps, L as DialogBackdrop, M as DialogRoot, N as DialogPortal$1, O as MenuPopup, P as DialogPopup, R as Button, S as Separator, T as MenuRoot, X as require_react, Y as require_jsx_runtime, _ as AccordionRoot, a as CollapsiblePanel, b as TabsRoot, c as PopoverPopup, d as PopoverTrigger$1, f as PopoverRoot, g as AccordionItem$1, h as AccordionHeader, i as ContextMenuRoot, j as DialogTitle$1, k as MenuItem, l as PopoverPositioner, m as AccordionTrigger$1, n as Toggle, o as CollapsibleTrigger$1, p as AccordionPanel, r as ContextMenuTrigger$1, s as CollapsibleRoot, t as ToggleGroup, u as PopoverPortal, v as TabsList$1, w as MenuSubmenuRoot, x as MenuSubmenuTrigger, y as TabsTab, z as useRender } from "../_libs/@base-ui/react+[...].mjs";
|
|
3
3
|
import { t as cva } from "../_libs/class-variance-authority+clsx.mjs";
|
|
4
4
|
import { A as ChevronsUpDown, B as ArrowDown, C as FolderPlus, D as Copy, E as Download, F as Check, I as ArrowUp, L as ArrowUpToLine, M as ChevronUp, N as ChevronRight, O as Command, P as ChevronDown, S as Folder, T as EllipsisVertical, _ as ListEnd, a as Square, b as GitBranch, c as Settings2, d as PanelLeft, f as PanelLeftOpen, g as ListStart, h as OctagonX, j as ChevronsDownUp, l as Search, n as WandSparkles, o as SquarePen, p as PanelLeftClose, r as Upload, s as SquareArrowOutUpRight, t as X, u as PanelRight, w as Ellipsis, x as GitCommitHorizontal, y as ImagePlus, z as ArrowLeft } from "../_libs/lucide-react.mjs";
|
|
5
|
-
import { $ as sameContextUsage, B as readStoredAutoScrollEnabled, C as buildItemsFromSync, D as createInitialSessionState, E as createContextId, F as normalizeSessionSelectionKeys, G as readStoredPromptDraft, H as readStoredCollapsedDirectories, I as normalizeStoredDirectoryList, J as readStoredSessionDoneDesktopNotificationsEnabled, K as readStoredRecentDirectories, L as normalizeThemeMode, M as getSessionTitle, P as normalizePromptImage, Q as safeLocalStorageSetItem, R as previewUrlForImage, U as readStoredDraftDirectory, V as readStoredCenterMessages, W as readStoredHideToolBlocks, X as readStoredSidebarDirectories, Y as readStoredSessionDoneSoundEnabled, Z as rememberStoredPromptDraft, _ as Tooltip$1, a as HIDE_TOOL_BLOCKS_STORAGE_KEY, b as TooltipTrigger, c as RECENT_DIRECTORIES_STORAGE_KEY, d as SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY, et as sessionListEntryKey, f as SESSION_DONE_SOUND_ENABLED_STORAGE_KEY, g as TitleTooltip, i as DRAFT_DIRECTORY_STORAGE_KEY, j as flattenTree, l as RIGHT_SIDEBAR_OPEN_STORAGE_KEY, m as Spinner, n as CENTER_MESSAGES_STORAGE_KEY, o as Kbd, p as SIDEBAR_DIRECTORIES_STORAGE_KEY, q as readStoredRightSidebarOpen, r as COLLAPSED_DIRECTORIES_STORAGE_KEY, s as KeyboardShortcutContent, t as AUTO_SCROLL_ENABLED_STORAGE_KEY, tt as thinkingSummaryText, u as Route, v as TooltipContent, w as cn, x as VIEWER_CONTEXT_STORAGE_KEY, z as promptDraftKey } from "./routes-
|
|
5
|
+
import { $ as sameContextUsage, B as readStoredAutoScrollEnabled, C as buildItemsFromSync, D as createInitialSessionState, E as createContextId, F as normalizeSessionSelectionKeys, G as readStoredPromptDraft, H as readStoredCollapsedDirectories, I as normalizeStoredDirectoryList, J as readStoredSessionDoneDesktopNotificationsEnabled, K as readStoredRecentDirectories, L as normalizeThemeMode, M as getSessionTitle, P as normalizePromptImage, Q as safeLocalStorageSetItem, R as previewUrlForImage, U as readStoredDraftDirectory, V as readStoredCenterMessages, W as readStoredHideToolBlocks, X as readStoredSidebarDirectories, Y as readStoredSessionDoneSoundEnabled, Z as rememberStoredPromptDraft, _ as Tooltip$1, a as HIDE_TOOL_BLOCKS_STORAGE_KEY, b as TooltipTrigger, c as RECENT_DIRECTORIES_STORAGE_KEY, d as SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY, et as sessionListEntryKey, f as SESSION_DONE_SOUND_ENABLED_STORAGE_KEY, g as TitleTooltip, i as DRAFT_DIRECTORY_STORAGE_KEY, j as flattenTree, l as RIGHT_SIDEBAR_OPEN_STORAGE_KEY, m as Spinner, n as CENTER_MESSAGES_STORAGE_KEY, o as Kbd, p as SIDEBAR_DIRECTORIES_STORAGE_KEY, q as readStoredRightSidebarOpen, r as COLLAPSED_DIRECTORIES_STORAGE_KEY, s as KeyboardShortcutContent, t as AUTO_SCROLL_ENABLED_STORAGE_KEY, tt as thinkingSummaryText, u as Route, v as TooltipContent, w as cn, x as VIEWER_CONTEXT_STORAGE_KEY, z as promptDraftKey } from "./routes-Di-eYVLe.mjs";
|
|
6
6
|
import { i as useQuery, n as useIsMutating, o as useQueryClient, r as useIsFetching, t as useMutation } from "../_libs/tanstack__react-query.mjs";
|
|
7
7
|
import { t as useHotkeys } from "../_libs/tanstack__react-hotkeys.mjs";
|
|
8
8
|
import { a as matchesKeyboardEvent, i as batch, o as formatForDisplay, r as createStore } from "../_libs/@tanstack/hotkeys+[...].mjs";
|
|
@@ -19,7 +19,7 @@ import { t as remarkGfm } from "../_libs/remark-gfm.mjs";
|
|
|
19
19
|
import { a as getBuiltInSpriteSheet, i as getBuiltInFileIconColor, n as FileTree, r as createFileTreeIconResolver, t as useFileTree } from "../_libs/@pierre/trees+[...].mjs";
|
|
20
20
|
import { a as closestCenter, d as useSensors, f as CSS$1, i as PointerSensor, n as DragOverlay, t as DndContext, u as useSensor } from "../_libs/@dnd-kit/core+[...].mjs";
|
|
21
21
|
import { a as verticalListSortingStrategy, i as useSortable, n as arrayMove, r as horizontalListSortingStrategy, t as SortableContext } from "../_libs/dnd-kit__sortable.mjs";
|
|
22
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/routes-
|
|
22
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/routes-DJqUmK-U.js
|
|
23
23
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
24
24
|
var import_jsx_runtime = require_jsx_runtime();
|
|
25
25
|
var SIDEBAR_RESIZE_START_THRESHOLD_PX = 4;
|
|
@@ -5053,6 +5053,55 @@ function AppShellUiRequestDialog({ pendingUiRequest, pendingUiValue, onPendingUi
|
|
|
5053
5053
|
]
|
|
5054
5054
|
}));
|
|
5055
5055
|
}
|
|
5056
|
+
if (pendingUiRequest?.method === "auth_select") {
|
|
5057
|
+
const cancelAuthAndReturn = () => {
|
|
5058
|
+
onResolveUiRequest({ cancelled: true });
|
|
5059
|
+
onAuthBack?.();
|
|
5060
|
+
};
|
|
5061
|
+
const options = pendingUiRequest.options ?? [];
|
|
5062
|
+
return renderAuthSurface(true, (open) => {
|
|
5063
|
+
if (!open) cancelAuthAndReturn();
|
|
5064
|
+
}, pendingUiRequest.title || "Log in to provider", pendingUiRequest.message || "Choose how to continue login.", /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Command$1, {
|
|
5065
|
+
loop: true,
|
|
5066
|
+
shouldFilter: true,
|
|
5067
|
+
children: [
|
|
5068
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandInput, {
|
|
5069
|
+
autoFocus: !isMobile,
|
|
5070
|
+
placeholder: "Choose login option",
|
|
5071
|
+
className: "text-base md:text-sm"
|
|
5072
|
+
}),
|
|
5073
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandList, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandGroup, {
|
|
5074
|
+
heading: pendingUiRequest.message || "Login options",
|
|
5075
|
+
children: options.map((option) => {
|
|
5076
|
+
const value = typeof option === "string" ? option : option.value;
|
|
5077
|
+
const label = typeof option === "string" ? option : option.label || option.value;
|
|
5078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandItem, {
|
|
5079
|
+
value,
|
|
5080
|
+
keywords: [label],
|
|
5081
|
+
onSelect: () => onResolveUiRequest({ value }),
|
|
5082
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
5083
|
+
className: "truncate font-medium",
|
|
5084
|
+
children: label
|
|
5085
|
+
})
|
|
5086
|
+
}, value);
|
|
5087
|
+
})
|
|
5088
|
+
}) }),
|
|
5089
|
+
isMobile ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
5090
|
+
className: "border-t border-border/70 p-3",
|
|
5091
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
|
|
5092
|
+
type: "button",
|
|
5093
|
+
variant: "outline",
|
|
5094
|
+
className: "w-full",
|
|
5095
|
+
onClick: cancelAuthAndReturn,
|
|
5096
|
+
children: "Cancel login"
|
|
5097
|
+
})
|
|
5098
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
5099
|
+
className: "hidden border-t border-border/70 px-3 py-2 text-xs text-muted-foreground md:block",
|
|
5100
|
+
children: "Use ↑/↓ to select, Enter to continue, and Esc to go back."
|
|
5101
|
+
})
|
|
5102
|
+
]
|
|
5103
|
+
}));
|
|
5104
|
+
}
|
|
5056
5105
|
if (pendingUiRequest?.method === "auth_input") {
|
|
5057
5106
|
const allowEmpty = Boolean(pendingUiRequest.allowEmpty);
|
|
5058
5107
|
const cancelAuthAndReturn = () => {
|
|
@@ -6487,17 +6536,21 @@ function getContextUsageRingGeometry(ringCount) {
|
|
|
6487
6536
|
if (ringCount === 2) return CONTEXT_USAGE_RING_GEOMETRY[2];
|
|
6488
6537
|
return CONTEXT_USAGE_RING_GEOMETRY[1];
|
|
6489
6538
|
}
|
|
6490
|
-
function ComposerContextUsageIndicator({ contextUsageStore = emptyContextUsageStore, disabled = false, modelProvider }) {
|
|
6539
|
+
function ComposerContextUsageIndicator({ activeSessionId, contextUsageStore = emptyContextUsageStore, disabled = false, modelProvider, viewerContextId }) {
|
|
6491
6540
|
const contextUsage = useComposerContextUsageSnapshot(contextUsageStore);
|
|
6492
6541
|
const useMobilePopover = useContextUsageMobilePopover();
|
|
6493
6542
|
const [providerUsageWindows, setProviderUsageWindows] = import_react.useState([]);
|
|
6494
6543
|
import_react.useEffect(() => {
|
|
6495
|
-
if (!modelProvider) {
|
|
6544
|
+
if (!modelProvider || !viewerContextId) {
|
|
6496
6545
|
setProviderUsageWindows([]);
|
|
6497
6546
|
return;
|
|
6498
6547
|
}
|
|
6499
6548
|
let cancelled = false;
|
|
6500
|
-
const url =
|
|
6549
|
+
const url = buildRequestUrl("/api/provider-usage", {
|
|
6550
|
+
contextId: viewerContextId,
|
|
6551
|
+
sessionId: activeSessionId,
|
|
6552
|
+
searchParams: { provider: modelProvider }
|
|
6553
|
+
});
|
|
6501
6554
|
fetch(url).then((response) => response.ok ? response.json() : void 0).then((data) => {
|
|
6502
6555
|
if (cancelled) return;
|
|
6503
6556
|
setProviderUsageWindows(Array.isArray(data?.usage?.windows) ? data.usage.windows : []);
|
|
@@ -6507,7 +6560,12 @@ function ComposerContextUsageIndicator({ contextUsageStore = emptyContextUsageSt
|
|
|
6507
6560
|
return () => {
|
|
6508
6561
|
cancelled = true;
|
|
6509
6562
|
};
|
|
6510
|
-
}, [
|
|
6563
|
+
}, [
|
|
6564
|
+
activeSessionId,
|
|
6565
|
+
modelProvider,
|
|
6566
|
+
viewerContextId,
|
|
6567
|
+
contextUsage?.tokens
|
|
6568
|
+
]);
|
|
6511
6569
|
if (disabled) return null;
|
|
6512
6570
|
if (!contextUsage) return null;
|
|
6513
6571
|
const { contextWindow, fiveHourUsage, percent, roundedPercent, tokens, weeklyUsage } = contextUsage;
|
|
@@ -6706,11 +6764,13 @@ var ComposerModelPicker = import_react.memo(function ComposerModelPicker({ disab
|
|
|
6706
6764
|
})]
|
|
6707
6765
|
});
|
|
6708
6766
|
});
|
|
6709
|
-
var ComposerContextUsageIndicatorHost = import_react.memo(function ComposerContextUsageIndicatorHost({ contextUsageStore, disabled, sessionStore }) {
|
|
6767
|
+
var ComposerContextUsageIndicatorHost = import_react.memo(function ComposerContextUsageIndicatorHost({ activeSessionId, contextUsageStore, disabled, sessionStore, viewerContextId }) {
|
|
6710
6768
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComposerContextUsageIndicator, {
|
|
6769
|
+
activeSessionId,
|
|
6711
6770
|
contextUsageStore,
|
|
6712
6771
|
disabled,
|
|
6713
|
-
modelProvider: useSelector(sessionStore, (sessionState) => sessionState.model?.provider)
|
|
6772
|
+
modelProvider: useSelector(sessionStore, (sessionState) => sessionState.model?.provider),
|
|
6773
|
+
viewerContextId
|
|
6714
6774
|
});
|
|
6715
6775
|
});
|
|
6716
6776
|
var ComposerThinkingPicker = import_react.memo(function ComposerThinkingPicker({ disabled, onOpenChange, onSelectThinkingLevel, open, sessionStore }) {
|
|
@@ -6755,7 +6815,7 @@ var ComposerThinkingPicker = import_react.memo(function ComposerThinkingPicker({
|
|
|
6755
6815
|
})]
|
|
6756
6816
|
});
|
|
6757
6817
|
});
|
|
6758
|
-
var ComposerPickers = import_react.memo(function ComposerPickers({ modelPickerOpen, onModelPickerOpenChange, thinkingPickerOpen, onThinkingPickerOpenChange, modelQuery, onModelQueryChange, contextUsageStore, sessionStore, disabled = false, onSelectModel, onSelectThinkingLevel }) {
|
|
6818
|
+
var ComposerPickers = import_react.memo(function ComposerPickers({ activeSessionId, modelPickerOpen, onModelPickerOpenChange, thinkingPickerOpen, onThinkingPickerOpenChange, modelQuery, onModelQueryChange, contextUsageStore, sessionStore, disabled = false, viewerContextId, onSelectModel, onSelectThinkingLevel }) {
|
|
6759
6819
|
const handleModelPickerOpenChange = (open) => {
|
|
6760
6820
|
if (disabled && open) return;
|
|
6761
6821
|
onModelPickerOpenChange(open);
|
|
@@ -6784,9 +6844,11 @@ var ComposerPickers = import_react.memo(function ComposerPickers({ modelPickerOp
|
|
|
6784
6844
|
sessionStore
|
|
6785
6845
|
})]
|
|
6786
6846
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComposerContextUsageIndicatorHost, {
|
|
6847
|
+
activeSessionId,
|
|
6787
6848
|
contextUsageStore,
|
|
6788
6849
|
disabled,
|
|
6789
|
-
sessionStore
|
|
6850
|
+
sessionStore,
|
|
6851
|
+
viewerContextId
|
|
6790
6852
|
})]
|
|
6791
6853
|
});
|
|
6792
6854
|
});
|
|
@@ -7272,7 +7334,7 @@ var CodeBlockCopyButton = import_react.memo(function CodeBlockCopyButton({ code
|
|
|
7272
7334
|
children: [copyState === "copied" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, { "data-icon": "inline-start" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Copy, { "data-icon": "inline-start" }), copyState === "copied" ? "Copied" : copyState === "error" ? "Retry" : "Copy"]
|
|
7273
7335
|
});
|
|
7274
7336
|
});
|
|
7275
|
-
var CodeBlock = import_react.memo(function CodeBlock({ code, language, streaming = false }) {
|
|
7337
|
+
var CodeBlock = import_react.memo(function CodeBlock({ className, code, language, onPreScroll, preClassName, preRef, streaming = false }) {
|
|
7276
7338
|
const [highlighted, setHighlighted] = import_react.useState(null);
|
|
7277
7339
|
import_react.useEffect(() => {
|
|
7278
7340
|
let cancelled = false;
|
|
@@ -7306,7 +7368,7 @@ var CodeBlock = import_react.memo(function CodeBlock({ code, language, streaming
|
|
|
7306
7368
|
dangerouslySetInnerHTML: highlightedMarkup
|
|
7307
7369
|
}) : null;
|
|
7308
7370
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
7309
|
-
className: "not-prose overflow-hidden rounded-xl border bg-muted/40",
|
|
7371
|
+
className: cn("not-prose overflow-hidden rounded-xl border bg-muted/40", className),
|
|
7310
7372
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
7311
7373
|
className: "flex items-center justify-between gap-3 border-b bg-background/80 px-3 py-2 text-xs text-muted-foreground",
|
|
7312
7374
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -7314,7 +7376,9 @@ var CodeBlock = import_react.memo(function CodeBlock({ code, language, streaming
|
|
|
7314
7376
|
children: displayedLanguage || "code"
|
|
7315
7377
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CodeBlockCopyButton, { code })]
|
|
7316
7378
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
|
|
7317
|
-
|
|
7379
|
+
ref: preRef,
|
|
7380
|
+
onScroll: onPreScroll,
|
|
7381
|
+
className: cn("overflow-x-auto bg-transparent px-4 py-3 text-[13px] leading-6 text-foreground", preClassName),
|
|
7318
7382
|
children: highlightedContent || /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { children: code })
|
|
7319
7383
|
})]
|
|
7320
7384
|
});
|
|
@@ -7409,12 +7473,12 @@ function toolCommandPreview(block) {
|
|
|
7409
7473
|
if (block.type !== "tool") return "";
|
|
7410
7474
|
if (typeof block.args === "string" && block.args.trim()) return block.args.trim();
|
|
7411
7475
|
const args = normalizeToolArgs(block.args);
|
|
7412
|
-
return getToolArgText(args, "description") || getToolArgText(args, "command") || getToolArgText(args, "path") || getToolArgText(args, "filePath");
|
|
7476
|
+
return getToolArgText(args, "description") || getToolArgText(args, "command") || getToolArgText(args, "path") || getToolArgText(args, "filePath") || getToolArgText(args, "file_path");
|
|
7413
7477
|
}
|
|
7414
7478
|
function toolReadLocation(block) {
|
|
7415
7479
|
if (block.type !== "tool") return "";
|
|
7416
7480
|
const args = normalizeToolArgs(block.args);
|
|
7417
|
-
const filePath = getToolArgText(args, "path") || getToolArgText(args, "filePath");
|
|
7481
|
+
const filePath = getToolArgText(args, "path") || getToolArgText(args, "filePath") || getToolArgText(args, "file_path");
|
|
7418
7482
|
const offset = args?.offset;
|
|
7419
7483
|
const limit = args?.limit;
|
|
7420
7484
|
if (typeof offset === "number" && typeof limit === "number" && limit > 0) return `${filePath}:${offset}-${offset + limit - 1}`;
|
|
@@ -7425,9 +7489,33 @@ function toolReadLocation(block) {
|
|
|
7425
7489
|
function collapseToolPreview(text) {
|
|
7426
7490
|
return text.replace(/\s+/g, " ").trim();
|
|
7427
7491
|
}
|
|
7492
|
+
function countTextDisplayLines(text) {
|
|
7493
|
+
if (!text) return 0;
|
|
7494
|
+
return text.split("\n").length;
|
|
7495
|
+
}
|
|
7496
|
+
function formatCountLabel(count, singular, plural = `${singular}s`) {
|
|
7497
|
+
return `${count} ${count === 1 ? singular : plural}`;
|
|
7498
|
+
}
|
|
7499
|
+
function getWriteToolPayload(block) {
|
|
7500
|
+
if (block.type !== "tool" || block.name !== "write") return void 0;
|
|
7501
|
+
const args = normalizeToolArgs(block.args);
|
|
7502
|
+
if (!args) return void 0;
|
|
7503
|
+
const path = getToolArgText(args, "path") || getToolArgText(args, "filePath") || getToolArgText(args, "file_path");
|
|
7504
|
+
const content = args.content;
|
|
7505
|
+
return {
|
|
7506
|
+
content: typeof content === "string" ? content : void 0,
|
|
7507
|
+
path
|
|
7508
|
+
};
|
|
7509
|
+
}
|
|
7510
|
+
function writeToolSummary(block) {
|
|
7511
|
+
const payload = getWriteToolPayload(block);
|
|
7512
|
+
if (!payload?.path) return "";
|
|
7513
|
+
if (payload.content === void 0) return payload.path;
|
|
7514
|
+
return `${payload.path} · ${formatCountLabel(countTextDisplayLines(payload.content), "line")}`;
|
|
7515
|
+
}
|
|
7428
7516
|
function toolSummary(block) {
|
|
7429
7517
|
if (block.type !== "tool") return "";
|
|
7430
|
-
const preview = block.name === "read" ? toolReadLocation(block) : toolCommandPreview(block);
|
|
7518
|
+
const preview = block.name === "read" ? toolReadLocation(block) : block.name === "write" ? writeToolSummary(block) : toolCommandPreview(block);
|
|
7431
7519
|
if (preview) return collapseToolPreview(preview);
|
|
7432
7520
|
if (block.running) return "Running";
|
|
7433
7521
|
if (block.isError) return "Failed";
|
|
@@ -8396,6 +8484,82 @@ var ToolBlockSection = import_react.memo(function ToolBlockSection({ isError = f
|
|
|
8396
8484
|
function editToolOutputWithoutSuccessMessage(output) {
|
|
8397
8485
|
return output.split("\n").filter((line) => !/^Successfully replaced \d+ block\(s\) in .+\.$/.test(line)).join("\n").trimEnd();
|
|
8398
8486
|
}
|
|
8487
|
+
function writeToolOutputWithoutSuccessMessage(output) {
|
|
8488
|
+
return output.split("\n").filter((line) => !/^Successfully wrote \d+ bytes to .+$/.test(line)).join("\n").trimEnd();
|
|
8489
|
+
}
|
|
8490
|
+
var CODE_LANGUAGE_BY_EXTENSION$1 = {
|
|
8491
|
+
bash: "bash",
|
|
8492
|
+
c: "c",
|
|
8493
|
+
cc: "c",
|
|
8494
|
+
cjs: "javascript",
|
|
8495
|
+
cpp: "c",
|
|
8496
|
+
css: "css",
|
|
8497
|
+
cxx: "c",
|
|
8498
|
+
go: "go",
|
|
8499
|
+
h: "c",
|
|
8500
|
+
htm: "html",
|
|
8501
|
+
html: "html",
|
|
8502
|
+
java: "java",
|
|
8503
|
+
js: "javascript",
|
|
8504
|
+
json: "json",
|
|
8505
|
+
jsonc: "jsonc",
|
|
8506
|
+
jsx: "jsx",
|
|
8507
|
+
mjs: "javascript",
|
|
8508
|
+
md: "markdown",
|
|
8509
|
+
mdx: "mdx",
|
|
8510
|
+
py: "python",
|
|
8511
|
+
rs: "rust",
|
|
8512
|
+
sh: "bash",
|
|
8513
|
+
ts: "typescript",
|
|
8514
|
+
tsx: "tsx",
|
|
8515
|
+
txt: "plaintext",
|
|
8516
|
+
xml: "xml",
|
|
8517
|
+
yaml: "yaml",
|
|
8518
|
+
yml: "yaml",
|
|
8519
|
+
zsh: "bash"
|
|
8520
|
+
};
|
|
8521
|
+
var CODE_LANGUAGE_BY_FILENAME = {
|
|
8522
|
+
dockerfile: "dockerfile",
|
|
8523
|
+
makefile: "makefile"
|
|
8524
|
+
};
|
|
8525
|
+
function codeLanguageFromPath$1(filePath) {
|
|
8526
|
+
const fileName = filePath.replace(/\\/g, "/").split("/").pop()?.toLowerCase();
|
|
8527
|
+
if (!fileName) return void 0;
|
|
8528
|
+
const filenameLanguage = CODE_LANGUAGE_BY_FILENAME[fileName];
|
|
8529
|
+
if (filenameLanguage) return filenameLanguage;
|
|
8530
|
+
if (fileName.endsWith(".d.ts")) return "typescript";
|
|
8531
|
+
const extension = fileName.includes(".") ? fileName.split(".").pop() : "";
|
|
8532
|
+
return extension ? CODE_LANGUAGE_BY_EXTENSION$1[extension] : void 0;
|
|
8533
|
+
}
|
|
8534
|
+
function WriteToolOutput({ block }) {
|
|
8535
|
+
const payload = getWriteToolPayload(block);
|
|
8536
|
+
const content = payload?.content;
|
|
8537
|
+
const extraOutput = writeToolOutputWithoutSuccessMessage(block.output.trimEnd());
|
|
8538
|
+
const autoScroll = useRunningToolAutoScroll({
|
|
8539
|
+
contentKey: content || "",
|
|
8540
|
+
enabled: block.running && content !== void 0
|
|
8541
|
+
});
|
|
8542
|
+
if (block.isError) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PlainToolOutput, {
|
|
8543
|
+
isError: true,
|
|
8544
|
+
text: extraOutput || block.output.trimEnd() || "Write failed."
|
|
8545
|
+
});
|
|
8546
|
+
if (!payload || content === void 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PlainToolOutput, { text: toolOutputText(block) || "No content available." });
|
|
8547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
8548
|
+
className: "space-y-3",
|
|
8549
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CodeBlock, {
|
|
8550
|
+
className: "flex max-h-96 flex-col rounded-lg",
|
|
8551
|
+
code: content,
|
|
8552
|
+
language: payload.path ? codeLanguageFromPath$1(payload.path) : void 0,
|
|
8553
|
+
onPreScroll: autoScroll.onScroll,
|
|
8554
|
+
preClassName: "min-h-0 overflow-auto",
|
|
8555
|
+
preRef: autoScroll.ref,
|
|
8556
|
+
streaming: block.running
|
|
8557
|
+
}), extraOutput ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PlainToolOutput, {
|
|
8558
|
+
isError: block.isError,
|
|
8559
|
+
text: extraOutput
|
|
8560
|
+
}) : null]
|
|
8561
|
+
});
|
|
8562
|
+
}
|
|
8399
8563
|
function EditToolOutput({ block }) {
|
|
8400
8564
|
const patch = toolPatchText(block);
|
|
8401
8565
|
const legacyDiff = toolLegacyDiffText(block);
|
|
@@ -8428,16 +8592,18 @@ function ToolBlockCardBody({ block }) {
|
|
|
8428
8592
|
enabled: block.name === "bash" && block.running
|
|
8429
8593
|
});
|
|
8430
8594
|
const isSuccessfulEditTool = block.name === "edit" && !block.running && !block.isError;
|
|
8595
|
+
const isSelfContainedWriteTool = block.name === "write" && !block.isError && getWriteToolPayload(block)?.content !== void 0;
|
|
8596
|
+
const hasSelfContainedToolOutput = isSuccessfulEditTool || isSelfContainedWriteTool;
|
|
8431
8597
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
8432
8598
|
className: "border-t pt-3",
|
|
8433
8599
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
8434
8600
|
ref: block.name === "bash" ? autoScroll.ref : void 0,
|
|
8435
8601
|
onScroll: block.name === "bash" ? autoScroll.onScroll : void 0,
|
|
8436
|
-
className: cn("max-h-96 overflow-auto rounded-lg border bg-background/80
|
|
8602
|
+
className: cn(isSelfContainedWriteTool ? "overflow-hidden rounded-lg" : "max-h-96 overflow-auto", hasSelfContainedToolOutput ? "rounded-lg" : "rounded-lg border bg-background/80 p-3"),
|
|
8437
8603
|
children: block.name === "bash" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
|
|
8438
8604
|
className: cn("overflow-x-auto font-mono text-xs leading-5 break-words whitespace-pre-wrap", block.isError && "text-destructive"),
|
|
8439
8605
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AnsiText, { text: shellBodyText })
|
|
8440
|
-
}) : block.name === "edit" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EditToolOutput, { block }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
8606
|
+
}) : block.name === "write" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WriteToolOutput, { block }) : block.name === "edit" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EditToolOutput, { block }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
8441
8607
|
className: "space-y-4",
|
|
8442
8608
|
children: [callText ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolBlockSection, {
|
|
8443
8609
|
label: "Call",
|
|
@@ -9266,7 +9432,7 @@ function getClipboardImageFiles(data) {
|
|
|
9266
9432
|
if (itemFiles.length > 0) return itemFiles;
|
|
9267
9433
|
return Array.from(data.files).filter((file) => file.type.startsWith("image/"));
|
|
9268
9434
|
}
|
|
9269
|
-
var ComposerPanel = import_react.forwardRef(function ComposerPanelImpl({ currentPendingMessages, composerImages, composerText, composerSkill, composerSyncNonce, centerMessages, contextUsageStore, displaySettingsStore, sessionStore, isSubmitting, isStreaming, awaitingFirstTurn, disabled = false, flush = false, topContent, fileInputRef, onComposerTextChange, onPickImages, onRemoveComposerImage, onSubmitPrompt, onAbort, onEditPendingMessage, onRemovePendingMessage, onReorderPending, onRunBuiltinSlashCommand, onSelectModel, onSelectThinkingLevel, requestPathCompletions, requestFileCompletions }, ref) {
|
|
9435
|
+
var ComposerPanel = import_react.forwardRef(function ComposerPanelImpl({ activeSessionId, currentPendingMessages, composerImages, composerText, composerSkill, composerSyncNonce, centerMessages, contextUsageStore, displaySettingsStore, sessionStore, isSubmitting, isStreaming, awaitingFirstTurn, disabled = false, flush = false, topContent, viewerContextId, fileInputRef, onComposerTextChange, onPickImages, onRemoveComposerImage, onSubmitPrompt, onAbort, onEditPendingMessage, onRemovePendingMessage, onReorderPending, onRunBuiltinSlashCommand, onSelectModel, onSelectThinkingLevel, requestPathCompletions, requestFileCompletions }, ref) {
|
|
9270
9436
|
const promptRef = import_react.useRef(null);
|
|
9271
9437
|
const [modelPickerOpen, setModelPickerOpen] = import_react.useState(false);
|
|
9272
9438
|
const [thinkingPickerOpen, setThinkingPickerOpen] = import_react.useState(false);
|
|
@@ -9326,6 +9492,7 @@ var ComposerPanel = import_react.forwardRef(function ComposerPanelImpl({ current
|
|
|
9326
9492
|
requestPathCompletions,
|
|
9327
9493
|
requestFileCompletions
|
|
9328
9494
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComposerPickers, {
|
|
9495
|
+
activeSessionId,
|
|
9329
9496
|
modelPickerOpen,
|
|
9330
9497
|
onModelPickerOpenChange: setModelPickerOpen,
|
|
9331
9498
|
thinkingPickerOpen,
|
|
@@ -9335,6 +9502,7 @@ var ComposerPanel = import_react.forwardRef(function ComposerPanelImpl({ current
|
|
|
9335
9502
|
contextUsageStore,
|
|
9336
9503
|
sessionStore,
|
|
9337
9504
|
disabled,
|
|
9505
|
+
viewerContextId,
|
|
9338
9506
|
onSelectModel,
|
|
9339
9507
|
onSelectThinkingLevel
|
|
9340
9508
|
})]
|
|
@@ -11454,16 +11622,13 @@ function ProjectFilesWorkspace({ viewerContextId, cwd, active, activeFilePath, o
|
|
|
11454
11622
|
},
|
|
11455
11623
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronsDownUp, { className: "size-4" })
|
|
11456
11624
|
})
|
|
11457
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
11458
|
-
|
|
11459
|
-
|
|
11460
|
-
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
|
|
11464
|
-
},
|
|
11465
|
-
children: "Open File"
|
|
11466
|
-
})
|
|
11625
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
|
|
11626
|
+
type: "button",
|
|
11627
|
+
variant: "outline",
|
|
11628
|
+
onClick: () => {
|
|
11629
|
+
setOpenFileDialogOpen(true);
|
|
11630
|
+
},
|
|
11631
|
+
children: "Open File"
|
|
11467
11632
|
})]
|
|
11468
11633
|
})]
|
|
11469
11634
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -18008,6 +18173,7 @@ var AppShellComposerController = import_react.memo(function AppShellComposerCont
|
|
|
18008
18173
|
});
|
|
18009
18174
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComposerPanel, {
|
|
18010
18175
|
ref: composerPanelRef,
|
|
18176
|
+
activeSessionId: snapshot.activeSessionId,
|
|
18011
18177
|
currentPendingMessages: snapshot.currentPendingMessages,
|
|
18012
18178
|
composerImages: snapshot.composerImages,
|
|
18013
18179
|
composerText: snapshot.composerText,
|
|
@@ -18023,6 +18189,7 @@ var AppShellComposerController = import_react.memo(function AppShellComposerCont
|
|
|
18023
18189
|
disabled: snapshot.disabled,
|
|
18024
18190
|
flush: Boolean(topContent),
|
|
18025
18191
|
topContent,
|
|
18192
|
+
viewerContextId: snapshot.viewerContextId,
|
|
18026
18193
|
fileInputRef,
|
|
18027
18194
|
onComposerTextChange,
|
|
18028
18195
|
onPickImages,
|
|
@@ -5,7 +5,7 @@ import { n as clsx } from "../_libs/class-variance-authority+clsx.mjs";
|
|
|
5
5
|
import { t as twMerge } from "../_libs/tailwind-merge.mjs";
|
|
6
6
|
import { B as ArrowDown, I as ArrowUp, M as ChevronUp, O as Command, R as ArrowRight, V as ArrowBigUp, m as Option, z as ArrowLeft } from "../_libs/lucide-react.mjs";
|
|
7
7
|
import { n as string, t as object } from "../_libs/zod.mjs";
|
|
8
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/routes-
|
|
8
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/routes-Di-eYVLe.js
|
|
9
9
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
10
10
|
var import_jsx_runtime = require_jsx_runtime();
|
|
11
11
|
function cn(...inputs) {
|
|
@@ -1265,7 +1265,7 @@ function getSessionTitle(summary) {
|
|
|
1265
1265
|
if (summary?.name?.trim()) return summary.name.trim();
|
|
1266
1266
|
return "New session";
|
|
1267
1267
|
}
|
|
1268
|
-
var $$splitComponentImporter = () => import("./routes-
|
|
1268
|
+
var $$splitComponentImporter = () => import("./routes-DJqUmK-U.mjs");
|
|
1269
1269
|
var indexSearchSchema = object({ session: string().optional() });
|
|
1270
1270
|
var Route = createFileRoute("/")({
|
|
1271
1271
|
validateSearch: indexSearchSchema,
|
|
@@ -3813,7 +3813,7 @@ var defaultSerovalPlugins = [
|
|
|
3813
3813
|
* the dev styles URL for route-scoped CSS collection.
|
|
3814
3814
|
*/
|
|
3815
3815
|
async function getStartManifest(matchedRoutes) {
|
|
3816
|
-
const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-
|
|
3816
|
+
const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-f3QaV5ex.mjs");
|
|
3817
3817
|
const startManifest = tsrStartManifest();
|
|
3818
3818
|
const rootRoute = startManifest.routes[rootRouteId] = startManifest.routes["__root__"] || {};
|
|
3819
3819
|
rootRoute.assets = rootRoute.assets || [];
|
|
@@ -4799,7 +4799,7 @@ var baseManifestPromise;
|
|
|
4799
4799
|
var cachedFinalManifestPromise;
|
|
4800
4800
|
async function loadEntries() {
|
|
4801
4801
|
const [routerEntry, startEntry, pluginAdapters] = await Promise.all([
|
|
4802
|
-
import("./router-
|
|
4802
|
+
import("./router-CvoH1TXL.mjs"),
|
|
4803
4803
|
import("./start-Captdpmb.mjs"),
|
|
4804
4804
|
import("../__23tanstack-start-plugin-adapters-y_fshQDY.mjs")
|
|
4805
4805
|
]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/_tanstack-start-manifest_v-
|
|
1
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/_tanstack-start-manifest_v-f3QaV5ex.js
|
|
2
2
|
var tsrStartManifest = () => ({
|
|
3
3
|
routes: {
|
|
4
4
|
__root__: {
|
|
@@ -50,16 +50,16 @@ var tsrStartManifest = () => ({
|
|
|
50
50
|
"/api/ui/$id"
|
|
51
51
|
],
|
|
52
52
|
assets: void 0,
|
|
53
|
-
preloads: ["/assets/index-
|
|
53
|
+
preloads: ["/assets/index-BWtOMO0B.js", "/assets/rolldown-runtime-S-ySWqyJ.js"]
|
|
54
54
|
},
|
|
55
55
|
"/": {
|
|
56
56
|
filePath: "/home/runner/work/pico/pico/src/routes/index.tsx",
|
|
57
57
|
children: void 0,
|
|
58
58
|
assets: void 0,
|
|
59
|
-
preloads: ["/assets/routes-
|
|
59
|
+
preloads: ["/assets/routes-5c_6T6hK.js"]
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
-
clientEntry: "/assets/index-
|
|
62
|
+
clientEntry: "/assets/index-BWtOMO0B.js"
|
|
63
63
|
});
|
|
64
64
|
//#endregion
|
|
65
65
|
export { tsrStartManifest };
|