@alivault/pico 0.11.0 → 0.12.0
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-DPU34F0T.js → index-DQLwecED.js} +4 -4
- package/.output/public/assets/routes-DynLhCvj.js +2195 -0
- package/.output/public/assets/styles-DJ9ubgcc.css +2 -0
- package/.output/server/_libs/lucide-react.mjs +27 -1
- package/.output/server/_ssr/{router-Ccz1kegF.mjs → router-D36lUq7O.mjs} +168 -8
- package/.output/server/_ssr/{routes-D3Hu5M6D.mjs → routes-9nZumcXQ.mjs} +11 -12
- package/.output/server/_ssr/{routes-DGf2MDLT.mjs → routes-C8qT6Oju.mjs} +270 -53
- package/.output/server/_ssr/ssr.mjs +2 -2
- package/.output/server/{_tanstack-start-manifest_v-BWLjOj7J.mjs → _tanstack-start-manifest_v-Cd2ypHmK.mjs} +4 -4
- package/.output/server/index.mjs +480 -480
- package/package.json +1 -1
- package/.output/public/assets/routes-CVlcrX-A.js +0 -2195
- package/.output/public/assets/styles-Chvsnn7o.css +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as __toESM } from "../_runtime.mjs";
|
|
2
2
|
import { $ as require_react, A as TabsTab, B as Input, C as MenuPositioner, D as MenuGroupLabel, E as MenuItem, F as DialogPopup, H as useRender, I as DialogDescription$1, L as DialogClose$1, M as DialogTitle$1, N as DialogRoot, O as MenuGroup, P as DialogPortal$1, Q as require_jsx_runtime, R as DialogBackdrop, S as MenuRoot, T as MenuPopup, V as Button, Y as mergeProps, _ as AccordionItem$1, a as ContextMenuRoot, b as MenuTrigger, c as CollapsibleRoot, d as PopoverPortal, f as PopoverTrigger$1, g as AccordionHeader, h as AccordionTrigger$1, i as ContextMenuTrigger$1, j as TabsRoot, k as TabsList$1, l as PopoverPopup, m as AccordionPanel, n as ToggleGroup, o as CollapsiblePanel, p as PopoverRoot, r as Toggle, s as CollapsibleTrigger$1, t as AlertDialogRoot, u as PopoverPositioner, v as AccordionRoot, w as MenuPortal, x as MenuSubmenuRoot, y as MenuSubmenuTrigger, z as Separator } from "../_libs/@base-ui/react+[...].mjs";
|
|
3
3
|
import { t as cva } from "../_libs/class-variance-authority+clsx.mjs";
|
|
4
|
-
import { A as
|
|
5
|
-
import { $ as normalizeThemeFamily, A as Tooltip$1, C as SESSION_DONE_SOUND_ENABLED_STORAGE_KEY, Ct as themeFamilyDescription, D as THEME_FAMILIES, Dt as themeFamilySupportsColorMode, E as THEME_COLOR_MODE_STORAGE_KEY, Et as themeFamilyLabel, F as appliedThemeClass, H as createInitialSessionState, I as appliedThemeClassColorMode, K as flattenTree, N as TooltipTrigger, O as THEME_STORAGE_KEY, Ot as thinkingSummaryText, P as VIEWER_CONTEXT_STORAGE_KEY, Q as normalizeThemeColorMode, R as buildItemsFromSync, S as SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY, St as themeColorModeLabel, T as Spinner, Tt as themeFamilyKeywords, V as createContextId, X as normalizeSessionSelectionKeys, Y as normalizePromptImage, Z as normalizeStoredDirectoryList, _ as RIGHT_SIDEBAR_HISTORY_HEIGHT_STORAGE_KEY, _t as rememberStoredPromptDraft, a as COLLAPSED_DIRECTORIES_STORAGE_KEY, at as readStoredCollapsedDirectories, b as RIGHT_SIDEBAR_WIDTHS_STORAGE_KEY, bt as sameContextUsage, c as Kbd, ct as readStoredPinnedSessionKeys, d as PICO_DIFF_SHIKI_THEMES, dt as readStoredRightSidebarOpen, et as previewUrlForImage, f as PICO_SHIKI_VARIABLE_DEFAULTS, ft as readStoredSessionDoneDesktopNotificationsEnabled, g as RIGHT_SIDEBAR_FILE_TREE_WIDTH_STORAGE_KEY, gt as readStoredThemeColorMode, h as RIGHT_SIDEBAR_ACTIVE_TAB_STORAGE_KEY, ht as readStoredTheme, i as CENTER_MESSAGES_STORAGE_KEY, it as readStoredCenterMessages, j as TooltipContent, k as TitleTooltip, l as KeyboardShortcutContent, lt as readStoredPromptDraft, m as RECENT_DIRECTORIES_STORAGE_KEY, mt as readStoredSidebarDirectories, n as APPLIED_THEME_STORAGE_KEY, nt as promptDraftKeyMatchesOwner, o as DRAFT_DIRECTORY_STORAGE_KEY, ot as readStoredDraftDirectory, p as PINNED_SESSIONS_STORAGE_KEY, pt as readStoredSessionDoneSoundEnabled, q as getSessionTitle, r as AUTO_SCROLL_ENABLED_STORAGE_KEY, rt as readStoredAutoScrollEnabled, s as HIDE_TOOL_BLOCKS_STORAGE_KEY, st as readStoredHideToolBlocks, tt as promptDraftKey, ut as readStoredRecentDirectories, v as RIGHT_SIDEBAR_HISTORY_TAB_STORAGE_KEY, vt as safeLocalStorageGetItem, w as SIDEBAR_DIRECTORIES_STORAGE_KEY, wt as themeFamilyFixedMode, x as Route, xt as sessionListEntryKey, y as RIGHT_SIDEBAR_OPEN_STORAGE_KEY, yt as safeLocalStorageSetItem, z as cn } from "./routes-
|
|
4
|
+
import { A as FolderPlus, B as ChevronsDownUp, C as ListEnd, D as GitBranch, E as GitPullRequestArrow, F as Download, G as ArrowUp, H as ChevronRight, I as Copy, K as ArrowUpToLine, L as Command, M as ExternalLink, N as Ellipsis, O as GitCommitHorizontal, P as EllipsisVertical, S as ListStart, T as ImagePlus, U as ChevronDown, W as Check, X as ArrowDown, Y as ArrowLeft, a as TriangleAlert, b as Minimize2, c as Square, d as Search, f as Plus, g as PanelLeftClose, h as PanelLeftOpen, i as Undo2, j as FileDiff, k as Folder, l as SquarePen, m as PanelLeft, n as WandSparkles, o as Trash2, p as PanelRight, q as ArrowUpRight, r as Upload, s as Tag, t as X, u as Settings2, v as OctagonX, x as Maximize2, y as Minus, z as ChevronsUpDown } from "../_libs/lucide-react.mjs";
|
|
5
|
+
import { $ as normalizeThemeFamily, A as Tooltip$1, C as SESSION_DONE_SOUND_ENABLED_STORAGE_KEY, Ct as themeFamilyDescription, D as THEME_FAMILIES, Dt as themeFamilySupportsColorMode, E as THEME_COLOR_MODE_STORAGE_KEY, Et as themeFamilyLabel, F as appliedThemeClass, H as createInitialSessionState, I as appliedThemeClassColorMode, K as flattenTree, N as TooltipTrigger, O as THEME_STORAGE_KEY, Ot as thinkingSummaryText, P as VIEWER_CONTEXT_STORAGE_KEY, Q as normalizeThemeColorMode, R as buildItemsFromSync, S as SESSION_DONE_DESKTOP_NOTIFICATIONS_ENABLED_STORAGE_KEY, St as themeColorModeLabel, T as Spinner, Tt as themeFamilyKeywords, V as createContextId, X as normalizeSessionSelectionKeys, Y as normalizePromptImage, Z as normalizeStoredDirectoryList, _ as RIGHT_SIDEBAR_HISTORY_HEIGHT_STORAGE_KEY, _t as rememberStoredPromptDraft, a as COLLAPSED_DIRECTORIES_STORAGE_KEY, at as readStoredCollapsedDirectories, b as RIGHT_SIDEBAR_WIDTHS_STORAGE_KEY, bt as sameContextUsage, c as Kbd, ct as readStoredPinnedSessionKeys, d as PICO_DIFF_SHIKI_THEMES, dt as readStoredRightSidebarOpen, et as previewUrlForImage, f as PICO_SHIKI_VARIABLE_DEFAULTS, ft as readStoredSessionDoneDesktopNotificationsEnabled, g as RIGHT_SIDEBAR_FILE_TREE_WIDTH_STORAGE_KEY, gt as readStoredThemeColorMode, h as RIGHT_SIDEBAR_ACTIVE_TAB_STORAGE_KEY, ht as readStoredTheme, i as CENTER_MESSAGES_STORAGE_KEY, it as readStoredCenterMessages, j as TooltipContent, k as TitleTooltip, l as KeyboardShortcutContent, lt as readStoredPromptDraft, m as RECENT_DIRECTORIES_STORAGE_KEY, mt as readStoredSidebarDirectories, n as APPLIED_THEME_STORAGE_KEY, nt as promptDraftKeyMatchesOwner, o as DRAFT_DIRECTORY_STORAGE_KEY, ot as readStoredDraftDirectory, p as PINNED_SESSIONS_STORAGE_KEY, pt as readStoredSessionDoneSoundEnabled, q as getSessionTitle, r as AUTO_SCROLL_ENABLED_STORAGE_KEY, rt as readStoredAutoScrollEnabled, s as HIDE_TOOL_BLOCKS_STORAGE_KEY, st as readStoredHideToolBlocks, tt as promptDraftKey, ut as readStoredRecentDirectories, v as RIGHT_SIDEBAR_HISTORY_TAB_STORAGE_KEY, vt as safeLocalStorageGetItem, w as SIDEBAR_DIRECTORIES_STORAGE_KEY, wt as themeFamilyFixedMode, x as Route, xt as sessionListEntryKey, y as RIGHT_SIDEBAR_OPEN_STORAGE_KEY, yt as safeLocalStorageSetItem, z as cn } from "./routes-9nZumcXQ.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";
|
|
@@ -22,7 +22,7 @@ import { t as remarkGfm } from "../_libs/remark-gfm.mjs";
|
|
|
22
22
|
import { a as getBuiltInSpriteSheet, i as getBuiltInFileIconColor, n as FileTree, r as createFileTreeIconResolver, t as useFileTree } from "../_libs/@pierre/trees+[...].mjs";
|
|
23
23
|
import { a as closestCenter, c as useDraggable, 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";
|
|
24
24
|
import { a as verticalListSortingStrategy, i as useSortable, n as arrayMove, r as horizontalListSortingStrategy, t as SortableContext } from "../_libs/dnd-kit__sortable.mjs";
|
|
25
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/routes-
|
|
25
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/routes-C8qT6Oju.js
|
|
26
26
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
27
27
|
var import_jsx_runtime = require_jsx_runtime();
|
|
28
28
|
var MOBILE_BREAKPOINT = 768;
|
|
@@ -6150,6 +6150,17 @@ function updateDirectoryIndexLoadingState(current, directories, loading) {
|
|
|
6150
6150
|
}
|
|
6151
6151
|
return changed ? next : current;
|
|
6152
6152
|
}
|
|
6153
|
+
function normalizeOptimisticSidebarPreview(value) {
|
|
6154
|
+
const text = value.replace(/\s+/g, " ").trim();
|
|
6155
|
+
if (!text) return "";
|
|
6156
|
+
if (text.length <= 240) return text;
|
|
6157
|
+
return `${text.slice(0, 239).trimEnd()}…`;
|
|
6158
|
+
}
|
|
6159
|
+
function sidebarEntryMatchesIdentity(entry, identity) {
|
|
6160
|
+
const sessionId = identity.sessionId?.trim() || "";
|
|
6161
|
+
const sessionPath = identity.sessionPath?.trim() || "";
|
|
6162
|
+
return Boolean(sessionPath && entry.path === sessionPath || sessionId && entry.id === sessionId);
|
|
6163
|
+
}
|
|
6153
6164
|
function upsertOptimisticSidebarSessionEntry(current, entry) {
|
|
6154
6165
|
const directory = entry.cwd.trim();
|
|
6155
6166
|
const optimisticId = entry.id.trim();
|
|
@@ -6175,6 +6186,40 @@ function upsertOptimisticSidebarSessionEntry(current, entry) {
|
|
|
6175
6186
|
}
|
|
6176
6187
|
};
|
|
6177
6188
|
}
|
|
6189
|
+
function updateOptimisticSidebarSessionPreviewEntry(current, options) {
|
|
6190
|
+
const preview = normalizeOptimisticSidebarPreview(options.preview);
|
|
6191
|
+
if (!preview) return current;
|
|
6192
|
+
let changed = false;
|
|
6193
|
+
const next = { ...current };
|
|
6194
|
+
for (const [directory, snapshot] of Object.entries(current)) {
|
|
6195
|
+
const updatedEntries = [];
|
|
6196
|
+
let sessionsChanged = false;
|
|
6197
|
+
const sessions = snapshot.sessions.map((entry) => {
|
|
6198
|
+
if (!sidebarEntryMatchesIdentity(entry, options)) return entry;
|
|
6199
|
+
const nextEntry = {
|
|
6200
|
+
...entry,
|
|
6201
|
+
modified: options.modified,
|
|
6202
|
+
lastUserMessageAt: options.modified,
|
|
6203
|
+
lastMessageAt: options.modified,
|
|
6204
|
+
lastMessagePreview: preview,
|
|
6205
|
+
streaming: true,
|
|
6206
|
+
unread: false
|
|
6207
|
+
};
|
|
6208
|
+
updatedEntries.push(nextEntry);
|
|
6209
|
+
sessionsChanged ||= nextEntry !== entry;
|
|
6210
|
+
return nextEntry;
|
|
6211
|
+
});
|
|
6212
|
+
if (!sessionsChanged) continue;
|
|
6213
|
+
const updatedKeys = new Set(updatedEntries.map(sessionListEntryKey));
|
|
6214
|
+
next[directory] = {
|
|
6215
|
+
...snapshot,
|
|
6216
|
+
revision: `optimistic-preview:${options.modified}:${snapshot.revision}`,
|
|
6217
|
+
sessions: [...updatedEntries, ...sessions.filter((entry) => !updatedKeys.has(sessionListEntryKey(entry)))]
|
|
6218
|
+
};
|
|
6219
|
+
changed = true;
|
|
6220
|
+
}
|
|
6221
|
+
return changed ? next : current;
|
|
6222
|
+
}
|
|
6178
6223
|
function removeOptimisticSidebarSessionEntry(current, optimisticId) {
|
|
6179
6224
|
const targetId = optimisticId?.trim() || "";
|
|
6180
6225
|
if (!targetId) return current;
|
|
@@ -11176,18 +11221,22 @@ function assistantMessagesModelLabel(items) {
|
|
|
11176
11221
|
function assistantItemIsWorking(item) {
|
|
11177
11222
|
return Boolean(item.streaming) || item.done === false || item.blocks.some((block) => block.type === "tool" && block.running);
|
|
11178
11223
|
}
|
|
11224
|
+
function assistantItemIsStreaming(item) {
|
|
11225
|
+
return Boolean(item.streaming);
|
|
11226
|
+
}
|
|
11179
11227
|
function assistantMessagesShellSnapshotFromBlocks(snapshot, blocks) {
|
|
11180
11228
|
const anchorBlockIndex = blocks.findIndex(assistantBlockIsMessageJumpAnchor);
|
|
11181
11229
|
const anchorBlock = anchorBlockIndex >= 0 ? blocks[anchorBlockIndex] : void 0;
|
|
11182
11230
|
const copyText = assistantCopyTextFromItems(snapshot.items);
|
|
11183
11231
|
const modelLabel = assistantMessagesModelLabel(snapshot.items);
|
|
11232
|
+
const streaming = snapshot.items.some(assistantItemIsStreaming);
|
|
11184
11233
|
const working = snapshot.items.some(assistantItemIsWorking);
|
|
11185
|
-
const hasFooter = Boolean(copyText.trim() || modelLabel
|
|
11234
|
+
const hasFooter = Boolean(copyText.trim() || modelLabel);
|
|
11186
11235
|
return {
|
|
11187
11236
|
...anchorBlock ? { anchorBlockKey: assistantBlockRenderKey(anchorBlock, anchorBlockIndex) } : {},
|
|
11188
11237
|
hasBlocks: blocks.length > 0,
|
|
11189
11238
|
hasFooter,
|
|
11190
|
-
streaming
|
|
11239
|
+
streaming,
|
|
11191
11240
|
working,
|
|
11192
11241
|
copyText,
|
|
11193
11242
|
modelLabel
|
|
@@ -12070,7 +12119,7 @@ function assistantMessageHasVisibleBlocks({ item, hideThinking, hideToolBlocks }
|
|
|
12070
12119
|
}));
|
|
12071
12120
|
}
|
|
12072
12121
|
function assistantMessageHasFooterMeta(item) {
|
|
12073
|
-
return Boolean(
|
|
12122
|
+
return Boolean(item.model || assistantCopyTextFromItems([item]));
|
|
12074
12123
|
}
|
|
12075
12124
|
var AssistantBlockGroupView = import_react.memo(function AssistantBlockGroupView({ anchorBlockKey, descriptor, store, streaming }) {
|
|
12076
12125
|
if (descriptor.type === "explore") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AssistantExploreBlockGroupView, {
|
|
@@ -12191,7 +12240,7 @@ function AssistantMessageFooter({ copyText, modelLabel, streaming }) {
|
|
|
12191
12240
|
}) : null]
|
|
12192
12241
|
});
|
|
12193
12242
|
}
|
|
12194
|
-
function AssistantMessagesStoreCard({ hideFooter = false, store }) {
|
|
12243
|
+
function AssistantMessagesStoreCard({ className, hideFooter = false, store }) {
|
|
12195
12244
|
const initialSnapshot = store.getSnapshot();
|
|
12196
12245
|
const initialBlocks = visibleAssistantBlocksFromSnapshot(initialSnapshot);
|
|
12197
12246
|
const assistantBlockStoreRef = import_react.useRef(null);
|
|
@@ -12215,20 +12264,21 @@ function AssistantMessagesStoreCard({ hideFooter = false, store }) {
|
|
|
12215
12264
|
store
|
|
12216
12265
|
]);
|
|
12217
12266
|
const shellSnapshot = import_react.useSyncExternalStore(shellStore.subscribe, shellStore.getSnapshot, shellStore.getSnapshot);
|
|
12218
|
-
|
|
12267
|
+
const showFooter = Boolean(!hideFooter && !shellSnapshot.streaming && shellSnapshot.hasFooter);
|
|
12268
|
+
if (!shellSnapshot.hasBlocks && !showFooter) return null;
|
|
12219
12269
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
12220
|
-
className: "flex flex-col gap-4",
|
|
12270
|
+
className: cn("flex flex-col gap-4", className),
|
|
12221
12271
|
"data-conversation-assistant-group": "true",
|
|
12222
12272
|
"data-conversation-streaming": shellSnapshot.streaming ? "true" : void 0,
|
|
12223
12273
|
children: [shellSnapshot.hasBlocks ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AssistantBlockGroupsView, {
|
|
12224
12274
|
anchorBlockKey: shellSnapshot.anchorBlockKey,
|
|
12225
12275
|
store: assistantBlockStore,
|
|
12226
12276
|
streaming: shellSnapshot.streaming
|
|
12227
|
-
}) : null,
|
|
12277
|
+
}) : null, showFooter ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AssistantMessageFooter, {
|
|
12228
12278
|
copyText: shellSnapshot.copyText,
|
|
12229
12279
|
modelLabel: shellSnapshot.modelLabel,
|
|
12230
12280
|
streaming: shellSnapshot.streaming
|
|
12231
|
-
})]
|
|
12281
|
+
}) : null]
|
|
12232
12282
|
});
|
|
12233
12283
|
}
|
|
12234
12284
|
function createSelectionStore(initialValue = 0) {
|
|
@@ -14660,9 +14710,13 @@ function AppShellConversationFrame({ autoScrollEnabled, children, centerMessages
|
|
|
14660
14710
|
function AppShellWorkingIndicatorLabel({ fallbackLabel, hiddenThinkingPreviewStore, useHiddenThinkingPreview }) {
|
|
14661
14711
|
const hiddenThinkingPreview = useSelector(hiddenThinkingPreviewStore);
|
|
14662
14712
|
const visibleLabel = useHiddenThinkingPreview && hiddenThinkingPreview ? hiddenThinkingPreview : fallbackLabel;
|
|
14663
|
-
if (!visibleLabel.trim()) return
|
|
14713
|
+
if (!visibleLabel.trim()) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
14714
|
+
"aria-hidden": "true",
|
|
14715
|
+
className: "invisible leading-5 font-medium",
|
|
14716
|
+
children: "Working…"
|
|
14717
|
+
});
|
|
14664
14718
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
14665
|
-
className: "font-medium text-foreground",
|
|
14719
|
+
className: "leading-5 font-medium text-foreground",
|
|
14666
14720
|
children: visibleLabel
|
|
14667
14721
|
});
|
|
14668
14722
|
}
|
|
@@ -14677,7 +14731,7 @@ function AppShellMessagesWorkingIndicator({ hiddenThinkingPreviewStore, onCancel
|
|
|
14677
14731
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
14678
14732
|
className: "min-w-0 flex-1",
|
|
14679
14733
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
14680
|
-
className: "flex min-w-0 items-center justify-start gap-2",
|
|
14734
|
+
className: "flex min-h-5 min-w-0 items-center justify-start gap-2",
|
|
14681
14735
|
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
14682
14736
|
className: "min-w-0 shrink-0",
|
|
14683
14737
|
children: state.done ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -14764,12 +14818,10 @@ function ConversationAssistantGroupView({ className, groupKey, hideFooter, hideT
|
|
|
14764
14818
|
store,
|
|
14765
14819
|
syncAfterConversationContentChange
|
|
14766
14820
|
]);
|
|
14767
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
14821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AssistantMessagesStoreCard, {
|
|
14768
14822
|
className,
|
|
14769
|
-
|
|
14770
|
-
|
|
14771
|
-
store: assistantMessagesStore
|
|
14772
|
-
})
|
|
14823
|
+
hideFooter,
|
|
14824
|
+
store: assistantMessagesStore
|
|
14773
14825
|
});
|
|
14774
14826
|
}
|
|
14775
14827
|
function AppShellConversationItemGroups({ centerMessages, conversationItemsStore, hideFooter, hideThinking, hideToolBlocks }) {
|
|
@@ -14839,14 +14891,13 @@ function AppShellConversationWorkingFooter({ centerMessages, conversationItemsSt
|
|
|
14839
14891
|
}
|
|
14840
14892
|
function AppShellConversationMessageStack({ centerMessages, conversationItemsStore, hideToolBlocks, sessionStore }) {
|
|
14841
14893
|
const hideThinking = useSelector(sessionStore, (sessionState) => sessionState.hideThinkingBlock);
|
|
14842
|
-
const streaming = useSelector(sessionStore, (sessionState) => sessionState.streaming);
|
|
14843
14894
|
if (!useConversationHasMessages(conversationItemsStore)) return null;
|
|
14844
14895
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
14845
14896
|
className: "flex flex-col gap-4 pt-4",
|
|
14846
14897
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AppShellConversationItemGroups, {
|
|
14847
14898
|
centerMessages,
|
|
14848
14899
|
conversationItemsStore,
|
|
14849
|
-
hideFooter:
|
|
14900
|
+
hideFooter: false,
|
|
14850
14901
|
hideThinking,
|
|
14851
14902
|
hideToolBlocks
|
|
14852
14903
|
})
|
|
@@ -18461,6 +18512,30 @@ function GitFileDiff({ file }) {
|
|
|
18461
18512
|
}) : null]
|
|
18462
18513
|
});
|
|
18463
18514
|
}
|
|
18515
|
+
function gitFileCanStage(file) {
|
|
18516
|
+
const [indexStatus, worktreeStatus] = gitFileStatusCharacters(file.status);
|
|
18517
|
+
return worktreeStatus !== " " || indexStatus === "?";
|
|
18518
|
+
}
|
|
18519
|
+
function gitFileCanUnstage(file) {
|
|
18520
|
+
const [indexStatus] = gitFileStatusCharacters(file.status);
|
|
18521
|
+
return indexStatus !== " " && indexStatus !== "?";
|
|
18522
|
+
}
|
|
18523
|
+
function reviewBulkGitActionSuccessLabel(action) {
|
|
18524
|
+
switch (action) {
|
|
18525
|
+
case "discard-all": return "Discarded all changes";
|
|
18526
|
+
case "nuke-working-tree": return "Nuked working tree";
|
|
18527
|
+
case "unstage-all": return "Unstaged all changes";
|
|
18528
|
+
case "stage-all": return "Staged all changes";
|
|
18529
|
+
}
|
|
18530
|
+
}
|
|
18531
|
+
function reviewBulkGitActionErrorFallback(action) {
|
|
18532
|
+
switch (action) {
|
|
18533
|
+
case "discard-all": return "Failed to discard changes";
|
|
18534
|
+
case "nuke-working-tree": return "Failed to nuke working tree";
|
|
18535
|
+
case "unstage-all": return "Failed to unstage changes";
|
|
18536
|
+
case "stage-all": return "Failed to stage changes";
|
|
18537
|
+
}
|
|
18538
|
+
}
|
|
18464
18539
|
function reviewDiffCommentSideLabel(side) {
|
|
18465
18540
|
return side === "deletions" ? "old" : "new";
|
|
18466
18541
|
}
|
|
@@ -18680,6 +18755,7 @@ function FileReviewContent(props) {
|
|
|
18680
18755
|
}
|
|
18681
18756
|
function useFileReviewContentView({ viewerContextId, cwd, active, diffLineComments = [], onAddDiffLineComment, onMaximizeHistory, onOpenCommitDiff, onOpenFile, showEmbeddedHistory = true }) {
|
|
18682
18757
|
const normalizedCwd = normalizeCwd(cwd);
|
|
18758
|
+
const queryClient = useQueryClient();
|
|
18683
18759
|
const isMobile = useIsMobile();
|
|
18684
18760
|
const [state, dispatch] = import_react.useReducer(fileReviewReducer, initialFileReviewState, (initialState) => ({
|
|
18685
18761
|
...initialState,
|
|
@@ -18720,6 +18796,33 @@ function useFileReviewContentView({ viewerContextId, cwd, active, diffLineCommen
|
|
|
18720
18796
|
});
|
|
18721
18797
|
const files = filesQuery.data;
|
|
18722
18798
|
const changedFiles = Array.isArray(files) ? files : [];
|
|
18799
|
+
const canStageAll = changedFiles.some(gitFileCanStage);
|
|
18800
|
+
const canUnstageAll = changedFiles.some(gitFileCanUnstage);
|
|
18801
|
+
const canDiscardAll = changedFiles.length > 0;
|
|
18802
|
+
const [confirmNukeWorkingTreeOpen, setConfirmNukeWorkingTreeOpen] = import_react.useState(false);
|
|
18803
|
+
const bulkGitActionMutation = useMutation({
|
|
18804
|
+
mutationFn: async (action) => {
|
|
18805
|
+
return await fetchJson(buildRequestUrl(action === "discard-all" || action === "nuke-working-tree" ? "/api/git-discard" : "/api/git-stage", { contextId: viewerContextId }), {
|
|
18806
|
+
method: "POST",
|
|
18807
|
+
headers: { "content-type": "application/json" },
|
|
18808
|
+
body: JSON.stringify({
|
|
18809
|
+
action,
|
|
18810
|
+
cwd: normalizedCwd
|
|
18811
|
+
})
|
|
18812
|
+
});
|
|
18813
|
+
},
|
|
18814
|
+
onSuccess: async (_response, action) => {
|
|
18815
|
+
await invalidateGitQueries({
|
|
18816
|
+
queryClient,
|
|
18817
|
+
viewerContextId,
|
|
18818
|
+
cwd: normalizedCwd
|
|
18819
|
+
});
|
|
18820
|
+
toast.success(reviewBulkGitActionSuccessLabel(action));
|
|
18821
|
+
},
|
|
18822
|
+
onError: (error, action) => {
|
|
18823
|
+
toast.error(getErrorMessage(error, reviewBulkGitActionErrorFallback(action)));
|
|
18824
|
+
}
|
|
18825
|
+
});
|
|
18723
18826
|
import_react.useEffect(() => {
|
|
18724
18827
|
if (previousNormalizedCwdRef.current === normalizedCwd) return;
|
|
18725
18828
|
previousNormalizedCwdRef.current = normalizedCwd;
|
|
@@ -18822,12 +18925,28 @@ function useFileReviewContentView({ viewerContextId, cwd, active, diffLineCommen
|
|
|
18822
18925
|
normalizedCwd
|
|
18823
18926
|
]);
|
|
18824
18927
|
const hasOpenFile = openFiles.length > 0;
|
|
18928
|
+
const bulkActionPending = bulkGitActionMutation.isPending;
|
|
18929
|
+
const bulkActionDisabled = bulkActionPending || !viewerContextId || !normalizedCwd || typeof files === "undefined" || files === null || Boolean(filesQuery.error);
|
|
18930
|
+
const discardAllPending = bulkGitActionMutation.isPending && bulkGitActionMutation.variables === "discard-all";
|
|
18931
|
+
const nukeWorkingTreePending = bulkGitActionMutation.isPending && bulkGitActionMutation.variables === "nuke-working-tree";
|
|
18932
|
+
const stageAllPending = bulkGitActionMutation.isPending && bulkGitActionMutation.variables === "stage-all";
|
|
18933
|
+
const unstageAllPending = bulkGitActionMutation.isPending && bulkGitActionMutation.variables === "unstage-all";
|
|
18825
18934
|
const toggleAll = () => {
|
|
18826
18935
|
dispatch({
|
|
18827
18936
|
type: "openFilesChanged",
|
|
18828
18937
|
openFiles: hasOpenFile ? [] : changedFiles.map(reviewFileValue)
|
|
18829
18938
|
});
|
|
18830
18939
|
};
|
|
18940
|
+
const runBulkGitAction = (action) => {
|
|
18941
|
+
bulkGitActionMutation.mutate(action);
|
|
18942
|
+
};
|
|
18943
|
+
const requestNukeWorkingTree = () => {
|
|
18944
|
+
setConfirmNukeWorkingTreeOpen(true);
|
|
18945
|
+
};
|
|
18946
|
+
const runConfirmedNukeWorkingTree = () => {
|
|
18947
|
+
bulkGitActionMutation.mutate("nuke-working-tree");
|
|
18948
|
+
setConfirmNukeWorkingTreeOpen(false);
|
|
18949
|
+
};
|
|
18831
18950
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
18832
18951
|
ref: reviewContentRef,
|
|
18833
18952
|
className: "flex h-full min-h-0 flex-col bg-background",
|
|
@@ -18850,32 +18969,72 @@ function useFileReviewContentView({ viewerContextId, cwd, active, diffLineCommen
|
|
|
18850
18969
|
children: "Diffs"
|
|
18851
18970
|
})
|
|
18852
18971
|
}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
18853
|
-
className: "flex shrink-0 items-center gap-2",
|
|
18854
|
-
children: [
|
|
18855
|
-
|
|
18856
|
-
|
|
18972
|
+
className: "flex shrink-0 flex-wrap items-center justify-end gap-2",
|
|
18973
|
+
children: [
|
|
18974
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DropdownMenu, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuTrigger, {
|
|
18975
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
|
|
18976
|
+
variant: "outline",
|
|
18977
|
+
size: "icon",
|
|
18978
|
+
"aria-label": "Diff actions",
|
|
18979
|
+
disabled: bulkActionDisabled
|
|
18980
|
+
}),
|
|
18981
|
+
children: bulkActionPending ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, { size: "xs" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Ellipsis, { className: "size-4" })
|
|
18982
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuContent, {
|
|
18983
|
+
align: "end",
|
|
18984
|
+
className: "w-52",
|
|
18985
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DropdownMenuGroup, { children: [
|
|
18986
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DropdownMenuItem, {
|
|
18987
|
+
disabled: bulkActionDisabled || !canStageAll,
|
|
18988
|
+
onClick: () => runBulkGitAction("stage-all"),
|
|
18989
|
+
children: [stageAllPending ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, { size: "xs" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Plus, {}), "Stage all"]
|
|
18990
|
+
}),
|
|
18991
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DropdownMenuItem, {
|
|
18992
|
+
disabled: bulkActionDisabled || !canUnstageAll,
|
|
18993
|
+
onClick: () => runBulkGitAction("unstage-all"),
|
|
18994
|
+
children: [unstageAllPending ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, { size: "xs" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Minus, {}), "Unstage all"]
|
|
18995
|
+
}),
|
|
18996
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DropdownMenuItem, {
|
|
18997
|
+
variant: "destructive",
|
|
18998
|
+
disabled: bulkActionDisabled || !canDiscardAll,
|
|
18999
|
+
onClick: () => runBulkGitAction("discard-all"),
|
|
19000
|
+
children: [discardAllPending ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, { size: "xs" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Undo2, {}), "Discard all"]
|
|
19001
|
+
}),
|
|
19002
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownMenuSeparator, {}),
|
|
19003
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DropdownMenuItem, {
|
|
19004
|
+
variant: "destructive",
|
|
19005
|
+
disabled: bulkActionDisabled,
|
|
19006
|
+
onClick: requestNukeWorkingTree,
|
|
19007
|
+
children: [nukeWorkingTreePending ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spinner, { size: "xs" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Trash2, {}), "Nuke working tree"]
|
|
19008
|
+
})
|
|
19009
|
+
] })
|
|
19010
|
+
})] }),
|
|
19011
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TitleTooltip, {
|
|
19012
|
+
title: hasOpenFile ? "Collapse all" : "Expand all",
|
|
19013
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
|
|
19014
|
+
variant: "outline",
|
|
19015
|
+
size: "icon",
|
|
19016
|
+
"aria-label": hasOpenFile ? "Collapse all" : "Expand all",
|
|
19017
|
+
disabled: changedFiles.length === 0,
|
|
19018
|
+
onClick: toggleAll,
|
|
19019
|
+
children: hasOpenFile ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronsDownUp, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronsUpDown, { className: "size-4" })
|
|
19020
|
+
})
|
|
19021
|
+
}),
|
|
19022
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroup$1, {
|
|
18857
19023
|
variant: "outline",
|
|
18858
|
-
|
|
18859
|
-
|
|
18860
|
-
|
|
18861
|
-
|
|
18862
|
-
|
|
19024
|
+
value: [diffStyle],
|
|
19025
|
+
onValueChange: (values) => {
|
|
19026
|
+
const value = values[0];
|
|
19027
|
+
if (value === "unified" || value === "split") dispatch({
|
|
19028
|
+
type: "diffStyleChanged",
|
|
19029
|
+
diffStyle: value
|
|
19030
|
+
});
|
|
19031
|
+
},
|
|
19032
|
+
children: ["unified", "split"].map((value) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupItem, {
|
|
19033
|
+
value,
|
|
19034
|
+
children: value === "unified" ? "Unified" : "Split"
|
|
19035
|
+
}, value))
|
|
18863
19036
|
})
|
|
18864
|
-
|
|
18865
|
-
variant: "outline",
|
|
18866
|
-
value: [diffStyle],
|
|
18867
|
-
onValueChange: (values) => {
|
|
18868
|
-
const value = values[0];
|
|
18869
|
-
if (value === "unified" || value === "split") dispatch({
|
|
18870
|
-
type: "diffStyleChanged",
|
|
18871
|
-
diffStyle: value
|
|
18872
|
-
});
|
|
18873
|
-
},
|
|
18874
|
-
children: ["unified", "split"].map((value) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToggleGroupItem, {
|
|
18875
|
-
value,
|
|
18876
|
-
children: value === "unified" ? "Unified" : "Split"
|
|
18877
|
-
}, value))
|
|
18878
|
-
})]
|
|
19037
|
+
]
|
|
18879
19038
|
})]
|
|
18880
19039
|
}),
|
|
18881
19040
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -18984,7 +19143,21 @@ function useFileReviewContentView({ viewerContextId, cwd, active, diffLineCommen
|
|
|
18984
19143
|
})
|
|
18985
19144
|
}) : null
|
|
18986
19145
|
]
|
|
18987
|
-
}) : null
|
|
19146
|
+
}) : null,
|
|
19147
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialog$1, {
|
|
19148
|
+
open: confirmNukeWorkingTreeOpen,
|
|
19149
|
+
onOpenChange: setConfirmNukeWorkingTreeOpen,
|
|
19150
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AlertDialogContent, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AlertDialogHeader, { children: [
|
|
19151
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogMedia, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TriangleAlert, {}) }),
|
|
19152
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogTitle, { children: "Nuke working tree?" }),
|
|
19153
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogDescription, { children: "This restores tracked files to HEAD and deletes untracked and ignored files in this repository. This cannot be undone from Pico." })
|
|
19154
|
+
] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AlertDialogFooter, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogCancel, { children: "Cancel" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogAction, {
|
|
19155
|
+
variant: "destructive",
|
|
19156
|
+
disabled: bulkActionDisabled,
|
|
19157
|
+
onClick: runConfirmedNukeWorkingTree,
|
|
19158
|
+
children: "Nuke working tree"
|
|
19159
|
+
})] })] })
|
|
19160
|
+
})
|
|
18988
19161
|
]
|
|
18989
19162
|
});
|
|
18990
19163
|
}
|
|
@@ -19061,8 +19234,7 @@ function ReviewFileAccordionItem({ viewerContextId, cwd, active, diffLineComment
|
|
|
19061
19234
|
onGutterUtilityClick: startLineComment
|
|
19062
19235
|
} : {};
|
|
19063
19236
|
const themeOptions = usePicoDiffThemeOptions();
|
|
19064
|
-
const
|
|
19065
|
-
const canStage = worktreeStatus !== " " || indexStatus === "?";
|
|
19237
|
+
const canStage = gitFileCanStage(file);
|
|
19066
19238
|
const invalidateChangedFileQueries = async () => {
|
|
19067
19239
|
await invalidateGitQueries({
|
|
19068
19240
|
queryClient,
|
|
@@ -22845,6 +23017,12 @@ function usePromptMutationSessionSnapshot(store) {
|
|
|
22845
23017
|
function normalizeQueuedStreamingBehavior(streamingBehavior) {
|
|
22846
23018
|
return streamingBehavior === "followUp" ? "followUp" : "steer";
|
|
22847
23019
|
}
|
|
23020
|
+
function promptSidebarPreview(message, images) {
|
|
23021
|
+
const text = message.replace(/\s+/g, " ").trim();
|
|
23022
|
+
if (text) return text;
|
|
23023
|
+
if (images.length === 0) return "";
|
|
23024
|
+
return `${images.length.toLocaleString()} image${images.length === 1 ? "" : "s"}`;
|
|
23025
|
+
}
|
|
22848
23026
|
function createLocalPendingId() {
|
|
22849
23027
|
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") return `optimistic:${crypto.randomUUID()}`;
|
|
22850
23028
|
return `optimistic:${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
@@ -22907,7 +23085,7 @@ function movePendingComposerMessage(messages, pendingId, direction) {
|
|
|
22907
23085
|
next.splice(targetIndex, 0, movedItem);
|
|
22908
23086
|
return next;
|
|
22909
23087
|
}
|
|
22910
|
-
function useAppShellPromptMutations({ viewerContextId, activeSessionId, defaultNewSessionDirectory, sessionStore, sessionStateRef, draftSessionLoadingOwnerKey, pendingDraftPrompt, pendingDraftFollowUps, awaitingFirstTurn, pendingMessages, composerDiffLineCommentsRef, composerImagesRef, composerTextRef, composerSkillRef, replaceComposerDraft, lastSyncedEditorTextRef, rememberRecentDirectory, prefetchDirectorySessionsIndex, addOptimisticUserMessage, removeOptimisticUserMessage, addOptimisticSidebarSession, removeOptimisticSidebarSession, setSidebarDirectories, setStoredDraftDirectory, setDraftSessionLoadingOwnerKey, setPendingDraftPrompt, setPendingDraftFollowUps, setPendingMessages, setAwaitingFirstTurn, setIsSubmitting, setComposerDiffLineComments, setComposerImages }) {
|
|
23088
|
+
function useAppShellPromptMutations({ viewerContextId, activeSessionId, defaultNewSessionDirectory, sessionStore, sessionStateRef, draftSessionLoadingOwnerKey, pendingDraftPrompt, pendingDraftFollowUps, awaitingFirstTurn, pendingMessages, composerDiffLineCommentsRef, composerImagesRef, composerTextRef, composerSkillRef, replaceComposerDraft, lastSyncedEditorTextRef, rememberRecentDirectory, prefetchDirectorySessionsIndex, addOptimisticUserMessage, removeOptimisticUserMessage, addOptimisticSidebarSession, removeOptimisticSidebarSession, updateOptimisticSidebarSessionPreview, setSidebarDirectories, setStoredDraftDirectory, setDraftSessionLoadingOwnerKey, setPendingDraftPrompt, setPendingDraftFollowUps, setPendingMessages, setAwaitingFirstTurn, setIsSubmitting, setComposerDiffLineComments, setComposerImages }) {
|
|
22911
23089
|
const queryClient = useQueryClient();
|
|
22912
23090
|
const draftSessionLoadingOwnerKeyRef = import_react.useRef(draftSessionLoadingOwnerKey);
|
|
22913
23091
|
const pendingDraftPromptRef = import_react.useRef(pendingDraftPrompt);
|
|
@@ -23097,7 +23275,9 @@ function useAppShellPromptMutations({ viewerContextId, activeSessionId, defaultN
|
|
|
23097
23275
|
}).trim();
|
|
23098
23276
|
const images = composerImagesRef.current.map((image) => ({ ...image }));
|
|
23099
23277
|
if (!message && images.length === 0) return false;
|
|
23100
|
-
|
|
23278
|
+
const currentPendingPrompt = pendingDraftPromptRef.current?.ownerKey === ownerKey ? pendingDraftPromptRef.current : null;
|
|
23279
|
+
const sidebarPreview = promptSidebarPreview(message, images);
|
|
23280
|
+
if (!currentPendingPrompt) {
|
|
23101
23281
|
const nextPrompt = {
|
|
23102
23282
|
ownerKey,
|
|
23103
23283
|
message,
|
|
@@ -23107,7 +23287,7 @@ function useAppShellPromptMutations({ viewerContextId, activeSessionId, defaultN
|
|
|
23107
23287
|
images,
|
|
23108
23288
|
queued: false
|
|
23109
23289
|
}),
|
|
23110
|
-
optimisticSidebarSessionId: addOptimisticSidebarSession()
|
|
23290
|
+
optimisticSidebarSessionId: addOptimisticSidebarSession({ lastMessagePreview: sidebarPreview })
|
|
23111
23291
|
};
|
|
23112
23292
|
pendingDraftPromptRef.current = nextPrompt;
|
|
23113
23293
|
setPendingDraftPrompt(nextPrompt);
|
|
@@ -23117,6 +23297,10 @@ function useAppShellPromptMutations({ viewerContextId, activeSessionId, defaultN
|
|
|
23117
23297
|
} else {
|
|
23118
23298
|
const queuedStreamingBehavior = normalizeQueuedStreamingBehavior(streamingBehavior);
|
|
23119
23299
|
const optimisticId = createLocalPendingId();
|
|
23300
|
+
updateOptimisticSidebarSessionPreview({
|
|
23301
|
+
...currentPendingPrompt.optimisticSidebarSessionId ? { optimisticSidebarSessionId: currentPendingPrompt.optimisticSidebarSessionId } : {},
|
|
23302
|
+
preview: sidebarPreview
|
|
23303
|
+
});
|
|
23120
23304
|
const nextFollowUps = [...pendingDraftFollowUpsRef.current, {
|
|
23121
23305
|
message,
|
|
23122
23306
|
images,
|
|
@@ -23144,7 +23328,8 @@ function useAppShellPromptMutations({ viewerContextId, activeSessionId, defaultN
|
|
|
23144
23328
|
setComposerDiffLineComments,
|
|
23145
23329
|
setComposerImages,
|
|
23146
23330
|
setPendingDraftFollowUps,
|
|
23147
|
-
setPendingDraftPrompt
|
|
23331
|
+
setPendingDraftPrompt,
|
|
23332
|
+
updateOptimisticSidebarSessionPreview
|
|
23148
23333
|
]);
|
|
23149
23334
|
const promptMutation = useMutation({
|
|
23150
23335
|
mutationFn: async ({ message, images, streamingBehavior, pendingId, thinkingLevel }) => {
|
|
@@ -23185,6 +23370,7 @@ function useAppShellPromptMutations({ viewerContextId, activeSessionId, defaultN
|
|
|
23185
23370
|
const treatAsQueuedPrompt = options?.forceFirstPrompt ? false : Boolean(sessionStreamingRef.current || awaitingFirstTurnRef.current);
|
|
23186
23371
|
const normalizedStreamingBehavior = treatAsQueuedPrompt ? normalizeQueuedStreamingBehavior(streamingBehavior) : void 0;
|
|
23187
23372
|
const submittedImages = composerImagesRef.current.map((image) => ({ ...image }));
|
|
23373
|
+
const sidebarPreview = promptSidebarPreview(message, submittedImages);
|
|
23188
23374
|
const queuedPendingId = treatAsQueuedPrompt ? createLocalPendingId() : void 0;
|
|
23189
23375
|
if (!treatAsQueuedPrompt) {
|
|
23190
23376
|
awaitingFirstTurnAssistantOutputSignatureRef.current = sessionAssistantOutputSignature(sessionStateRef.current.items);
|
|
@@ -23196,7 +23382,11 @@ function useAppShellPromptMutations({ viewerContextId, activeSessionId, defaultN
|
|
|
23196
23382
|
images: submittedImages,
|
|
23197
23383
|
queued: false
|
|
23198
23384
|
}));
|
|
23199
|
-
const optimisticSidebarSessionId = options?.optimisticSidebarSessionId ?? (!treatAsQueuedPrompt && sessionStateRef.current.draft ? addOptimisticSidebarSession() : void 0);
|
|
23385
|
+
const optimisticSidebarSessionId = options?.optimisticSidebarSessionId ?? (!treatAsQueuedPrompt && sessionStateRef.current.draft ? addOptimisticSidebarSession({ lastMessagePreview: sidebarPreview }) : void 0);
|
|
23386
|
+
updateOptimisticSidebarSessionPreview({
|
|
23387
|
+
...optimisticSidebarSessionId ? { optimisticSidebarSessionId } : {},
|
|
23388
|
+
preview: sidebarPreview
|
|
23389
|
+
});
|
|
23200
23390
|
if (queuedPendingId && normalizedStreamingBehavior) addOptimisticPendingMessage({
|
|
23201
23391
|
pendingId: queuedPendingId,
|
|
23202
23392
|
text: message,
|
|
@@ -23260,6 +23450,7 @@ function useAppShellPromptMutations({ viewerContextId, activeSessionId, defaultN
|
|
|
23260
23450
|
setComposerDiffLineComments,
|
|
23261
23451
|
setComposerImages,
|
|
23262
23452
|
setIsSubmitting,
|
|
23453
|
+
updateOptimisticSidebarSessionPreview,
|
|
23263
23454
|
viewerContextId
|
|
23264
23455
|
]);
|
|
23265
23456
|
const flushPendingDraftFollowUps = import_react.useCallback(async () => {
|
|
@@ -26177,6 +26368,8 @@ function useAppShellSessionWorkspaceView({ viewerContextId, sessionId, onSelectS
|
|
|
26177
26368
|
title: "New session",
|
|
26178
26369
|
modified,
|
|
26179
26370
|
lastUserMessageAt: modified,
|
|
26371
|
+
lastMessageAt: modified,
|
|
26372
|
+
...options?.lastMessagePreview ? { lastMessagePreview: options.lastMessagePreview } : {},
|
|
26180
26373
|
streaming: true,
|
|
26181
26374
|
unread: false,
|
|
26182
26375
|
optimistic: true
|
|
@@ -26223,6 +26416,29 @@ function useAppShellSessionWorkspaceView({ viewerContextId, sessionId, onSelectS
|
|
|
26223
26416
|
sidebarStore.setSidebarSessionSelectionAnchor((current) => current === entryKey ? "" : current);
|
|
26224
26417
|
}
|
|
26225
26418
|
}, [sidebarStore]);
|
|
26419
|
+
const updateOptimisticSidebarSessionPreview = import_react.useCallback((options) => {
|
|
26420
|
+
const preview = options.preview.trim();
|
|
26421
|
+
if (!preview) return;
|
|
26422
|
+
const currentState = sessionStateRef.current;
|
|
26423
|
+
const modified = (/* @__PURE__ */ new Date()).toISOString();
|
|
26424
|
+
const sessionId = options.optimisticSidebarSessionId || currentState.sessionId || currentState.sessionKey;
|
|
26425
|
+
const sessionPath = currentState.sessionFile;
|
|
26426
|
+
const previewUpdate = {
|
|
26427
|
+
...sessionId ? { sessionId } : {},
|
|
26428
|
+
...sessionPath ? { sessionPath } : {},
|
|
26429
|
+
preview,
|
|
26430
|
+
modified
|
|
26431
|
+
};
|
|
26432
|
+
sidebarStore.setDirectoryIndexDataByPath((current) => updateOptimisticSidebarSessionPreviewEntry(current, previewUpdate));
|
|
26433
|
+
sidebarStore.setSessionsEvent((current) => {
|
|
26434
|
+
if (!current?.directoryIndexes) return current;
|
|
26435
|
+
const directoryIndexes = updateOptimisticSidebarSessionPreviewEntry(current.directoryIndexes, previewUpdate);
|
|
26436
|
+
return directoryIndexes === current.directoryIndexes ? current : {
|
|
26437
|
+
...current,
|
|
26438
|
+
directoryIndexes
|
|
26439
|
+
};
|
|
26440
|
+
});
|
|
26441
|
+
}, [sessionStateRef, sidebarStore]);
|
|
26226
26442
|
const clearSelectedSidebarSelection = import_react.useCallback(() => {
|
|
26227
26443
|
sidebarStore.setSelectedSidebarSessionKeys((current) => current.length === 0 ? current : []);
|
|
26228
26444
|
sidebarStore.setSidebarSessionSelectionAnchor((current) => current ? "" : current);
|
|
@@ -26255,6 +26471,7 @@ function useAppShellSessionWorkspaceView({ viewerContextId, sessionId, onSelectS
|
|
|
26255
26471
|
removeOptimisticUserMessage,
|
|
26256
26472
|
addOptimisticSidebarSession,
|
|
26257
26473
|
removeOptimisticSidebarSession,
|
|
26474
|
+
updateOptimisticSidebarSessionPreview,
|
|
26258
26475
|
setSidebarDirectories: sidebarStore.setSidebarDirectories,
|
|
26259
26476
|
setStoredDraftDirectory,
|
|
26260
26477
|
setDraftSessionLoadingOwnerKey,
|
|
@@ -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-Cd2ypHmK.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-D36lUq7O.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-Cd2ypHmK.js
|
|
2
2
|
var tsrStartManifest = () => ({
|
|
3
3
|
routes: {
|
|
4
4
|
__root__: {
|
|
@@ -58,16 +58,16 @@ var tsrStartManifest = () => ({
|
|
|
58
58
|
"/api/ui/$id"
|
|
59
59
|
],
|
|
60
60
|
assets: void 0,
|
|
61
|
-
preloads: ["/assets/index-
|
|
61
|
+
preloads: ["/assets/index-DQLwecED.js", "/assets/rolldown-runtime-S-ySWqyJ.js"]
|
|
62
62
|
},
|
|
63
63
|
"/": {
|
|
64
64
|
filePath: "/home/runner/work/pico/pico/src/routes/index.tsx",
|
|
65
65
|
children: void 0,
|
|
66
66
|
assets: void 0,
|
|
67
|
-
preloads: ["/assets/routes-
|
|
67
|
+
preloads: ["/assets/routes-DynLhCvj.js"]
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
-
clientEntry: "/assets/index-
|
|
70
|
+
clientEntry: "/assets/index-DQLwecED.js"
|
|
71
71
|
});
|
|
72
72
|
//#endregion
|
|
73
73
|
export { tsrStartManifest };
|