zidane-gui 9.1.1 → 9.1.3
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/out/main/index.js +77 -3
- package/out/preload/index.mjs +7 -0
- package/out/renderer/assets/{43YPWK3Q-C1KxyhBe.js → 43YPWK3Q-BLwohgFu.js} +6 -6
- package/out/renderer/assets/{45MVAN6X-uedsCyvs.js → 45MVAN6X-DCPmrh2y.js} +5 -5
- package/out/renderer/assets/{46GJKBLZ-DqRDtmyU.js → 46GJKBLZ-n_NiMQEY.js} +10 -10
- package/out/renderer/assets/{63WH7YNF-E23uJkxY.js → 63WH7YNF-B0-gnOSz.js} +8 -8
- package/out/renderer/assets/{6DDU7VKX-BnYMT-fZ.js → 6DDU7VKX-BKAF5gyQ.js} +6 -6
- package/out/renderer/assets/{CLQLV5VT-BsAy1F0L.js → CLQLV5VT-BIZsXon4.js} +6 -6
- package/out/renderer/assets/{CUSPXG5M-BndthcFo.js → CUSPXG5M-Donlp74Y.js} +6 -6
- package/out/renderer/assets/{CodeEditor-Bc2yVqNr.js → CodeEditor-80QT2Pyq.js} +3 -3
- package/out/renderer/assets/{ComposerEditor-B4wmjkXE.js → ComposerEditor-CXpNHoo1.js} +3 -3
- package/out/renderer/assets/{D3L7O4X2-LfFKkl0g.js → D3L7O4X2-BCbmkNpB.js} +4 -4
- package/out/renderer/assets/{D5TW5CPZ-BUXfpU2q.js → D5TW5CPZ-Bp-wetYa.js} +1 -1
- package/out/renderer/assets/{DiffsTab-BHaJc7Ve.js → DiffsTab-Dy8a_hwG.js} +6 -6
- package/out/renderer/assets/{EGADTWYV-giCCF2cw.js → EGADTWYV-CqSrkc7g.js} +5 -5
- package/out/renderer/assets/{EOJSJZXM-B9xc3U2A.js → EOJSJZXM-BTI84tys.js} +8 -8
- package/out/renderer/assets/{EditorWorkers-DABG5YG9.js → EditorWorkers-Durn1REy.js} +5 -5
- package/out/renderer/assets/{FilesTab-CyWw9vW2.js → FilesTab-h32FFVsw.js} +7 -7
- package/out/renderer/assets/{G2OEIG6X-hZmo0wrY.js → G2OEIG6X-CS8YUqSL.js} +5 -5
- package/out/renderer/assets/{GXJ2T77W-Dx1MA_On.js → GXJ2T77W-BHaQFzB4.js} +6 -6
- package/out/renderer/assets/{HX3UMAK7-DcJt6NaE.js → HX3UMAK7-DOOY2pSg.js} +5 -5
- package/out/renderer/assets/{IU7WZTP6-BZMu2vL3.js → IU7WZTP6-D7pwhQLH.js} +1 -1
- package/out/renderer/assets/{J5J2NR2G-CbQLnnZq.js → J5J2NR2G-SPjkbJgo.js} +4 -4
- package/out/renderer/assets/{JRCWTJEL-xEOyWDIN.js → JRCWTJEL-DT7JLR7k.js} +3 -3
- package/out/renderer/assets/{KHUP5TOH-032p46g-.js → KHUP5TOH-BX0A2YHC.js} +1 -1
- package/out/renderer/assets/{L74FQTH5-CQ_54hNm.js → L74FQTH5-MbDLfIZo.js} +4 -4
- package/out/renderer/assets/{LAV4ZXOS-DvhVMhLR.js → LAV4ZXOS-ClHlsIHg.js} +6 -6
- package/out/renderer/assets/{LBIZYCRR-CMaDdulz.js → LBIZYCRR-DmofT7Vk.js} +7 -7
- package/out/renderer/assets/{LFFXNLRS-BjbqzBYN.js → LFFXNLRS-yLLLefJM.js} +3 -3
- package/out/renderer/assets/{LLLWOAQD-B2zZRpRf.js → LLLWOAQD-DNhT1-qV.js} +1 -1
- package/out/renderer/assets/{LTYQZ5U5-DzI-7yJW.js → LTYQZ5U5-BxUtiilS.js} +8 -8
- package/out/renderer/assets/{NDSCUZ25-C9oT6c6G.js → NDSCUZ25-DltJ5xGa.js} +2 -2
- package/out/renderer/assets/{NMN3IKWL-9IsXehWp.js → NMN3IKWL-BXUYzi9o.js} +9 -9
- package/out/renderer/assets/{NMUA3R2D-B2ZuyfXA.js → NMUA3R2D-CAVxt8OJ.js} +7 -7
- package/out/renderer/assets/{NY5A6PPW-BzmvsXmE.js → NY5A6PPW-B3P5KUoQ.js} +3 -3
- package/out/renderer/assets/{OHJ2EJXK-BEkFEoxu.js → OHJ2EJXK-CKyEtj37.js} +1 -1
- package/out/renderer/assets/{OU2GIT2H-DZQl_5qv.js → OU2GIT2H-i9HfUuBk.js} +4 -4
- package/out/renderer/assets/{PDMLSE6I-C3FMl6Ej.js → PDMLSE6I-BnbSSXbG.js} +2 -2
- package/out/renderer/assets/{PJ7X32S5-BQ3aTkUy.js → PJ7X32S5-Do_rplzd.js} +5 -5
- package/out/renderer/assets/{RLLQ44NJ-Dq15CCQ6.js → RLLQ44NJ-SEvjKAya.js} +7 -7
- package/out/renderer/assets/{S6DWMCK5-KeQNStMI.js → S6DWMCK5-CK9P5x9H.js} +8 -8
- package/out/renderer/assets/{STIOTUT7-ZnewWXB7.js → STIOTUT7-KYZS5tvF.js} +6 -6
- package/out/renderer/assets/{SXSLPWUD-VIPmiOfk.js → SXSLPWUD-ylCpsia5.js} +2 -2
- package/out/renderer/assets/{TR4WJQGX-CQ3dPMLJ.js → TR4WJQGX-DXlqK6NQ.js} +1 -1
- package/out/renderer/assets/{UWRPUF3N-CtgKKvKe.js → UWRPUF3N-7_KSfEv0.js} +1 -1
- package/out/renderer/assets/{VSWIZJ7B-BN-hZ_G_.js → VSWIZJ7B-qmPn48eQ.js} +1 -1
- package/out/renderer/assets/{WM7NR6YK-CghasXna.js → WM7NR6YK-D4oWq6L3.js} +4 -4
- package/out/renderer/assets/{WXKV2YEK-C8qjO_OQ.js → WXKV2YEK-DsK-bqP8.js} +3 -3
- package/out/renderer/assets/{XLHPVVFU-CoRVO17g.js → XLHPVVFU-4_9lhZe2.js} +1 -1
- package/out/renderer/assets/{YNX532HU-DhZCm9iK.js → YNX532HU-C1DPijVc.js} +5 -5
- package/out/renderer/assets/{YUPSMAUO-Brx2G_oh.js → YUPSMAUO-0pM5w-ie.js} +1 -1
- package/out/renderer/assets/{ZFRCZTLK-Cs8fJIgy.js → ZFRCZTLK-4EIJek0V.js} +6 -6
- package/out/renderer/assets/{ZZDR4CN3-DcTVOpcO.js → ZZDR4CN3-B_T2R-Zh.js} +4 -4
- package/out/renderer/assets/{core-Z_paRVMb.js → core-2jWUG3m-.js} +1002 -335
- package/out/renderer/assets/{file-tabs-BCf1cAWp.js → file-tabs-DwqRIh1X.js} +6 -6
- package/out/renderer/assets/{ghostty-web-CdNv377h.js → ghostty-web-DnI2p8KS.js} +1 -1
- package/out/renderer/assets/{highlights-Cjdp9LIq.js → highlights-6LT5DvBO.js} +2 -2
- package/out/renderer/assets/{highlights-DaYW35iB.js → highlights-DmxOEap0.js} +3 -3
- package/out/renderer/assets/icons-D67TrEZV.js +23 -0
- package/out/renderer/assets/{index-_dhRO6Oc.js → index-BnnCv70H.js} +37 -18
- package/out/renderer/assets/{index-fNK5AY6Q.css → index-C-Dal-Bp.css} +307 -3
- package/out/renderer/assets/{kit-E8-H6M0V.js → kit-CdRTRA2T.js} +1398 -527
- package/out/renderer/assets/{langs-BDUDFyts.js → langs-D9nZatrh.js} +1 -1
- package/out/renderer/assets/{lazy-DQmrNfMK.js → lazy-C1DShJVi.js} +3 -3
- package/out/renderer/assets/{loader-byWkNl6P.js → loader-BlmA-DDi.js} +1 -1
- package/out/renderer/assets/{pierre-theme-CsyO3esE.js → pierre-theme-DpuLJ_93.js} +7 -7
- package/out/renderer/assets/{shiki-DxXti3Bm.js → shiki-RupN-xqP.js} +3 -3
- package/out/renderer/assets/{stream-tokenizer-sqhinrU5.js → stream-tokenizer-DLDzyMrK.js} +1 -1
- package/out/renderer/assets/{themes-DGY5d--g.js → themes-B1aebwax.js} +2 -2
- package/out/renderer/assets/{useDetachCleanup-DYbCqwX-.js → useDetachCleanup-BXvhEVk-.js} +2 -2
- package/out/renderer/assets/{useFolderChanges-Y0OqX_nG.js → useFolderChanges-BHQktE6l.js} +3 -3
- package/out/renderer/assets/{vendor-motion-CD5Og8pC.js → vendor-motion-BgQeucLF.js} +3 -3
- package/out/renderer/index.html +5 -5
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./highlights-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./highlights-6LT5DvBO.js","./default-CzLFidVE.js","./loader-BlmA-DDi.js","./core-2jWUG3m-.js","./vendor-BpwX-s_O.js","./vendor-react-bPTwWURR.js","./vendor-D_E2rLzO.css","./CodeEditor-80QT2Pyq.js","./useDetachCleanup-BXvhEVk-.js","./pierre-theme-DpuLJ_93.js","./hastToHtml-AUrFnNH_.js","./index-DhpOdP7M.js","./utils-BcG7Lqcy.js","./ComposerEditor-CXpNHoo1.js","./vendor-editor-Cx3SvGyZ.js","./vendor-motion-BgQeucLF.js","./lazy-C1DShJVi.js","./ghostty-web-DnI2p8KS.js","./FileIcon-acads6Ac.js","./FilesTab-h32FFVsw.js","./useFolderChanges-BHQktE6l.js","./DiffsTab-Dy8a_hwG.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import { r as reactExports, j as jsxRuntimeExports, a as reactDomExports } from "./vendor-react-bPTwWURR.js";
|
|
3
|
-
import { s as spring, M as MotionConfig, L as LazyMotion, d as domAnimation, A as AnimatePresence, u as useIsPresent, m, a as
|
|
4
|
-
import { m as modelConcern, p as parseBindingSpec, a as parseBindingSpecs, c as canonicalKeyName, R as RUN_WAITING_LABEL, r as runRetryingLabel, S as SYNC_CATEGORY_INFO, b as SYNC_MODE_LABEL, l as lentServerMachines, d as createOnboardingRun, O as ONBOARDING_WORDS, j as joinNames, e as ONBOARDING_STEPS, f as canSkipOnboardingStep, g as currentOnboardingStep, h as pushPaletteRecent, A as APPROVAL_MODE_OPTIONS, D as DURABILITY_OPTIONS, i as SETTINGS_TOGGLES$1, k as DEFAULT_SETTINGS, n as pickTab$1, o as openForAttention, q as openProactive, s as cycleTab, t as closePanel, u as togglePanel, v as mergeBadgeMenu, w as builtinBadgeActions, x as builtinBadgeEffect, y as isBadgeColor, z as ageStep, B as fmtTokens, C as parseCommandInvocation, E as findReferences, G as GITHUB_PULL_PROVIDER_ID, F as GITHUB_ISSUE_PROVIDER_ID, H as githubRefKey, _ as __vitePreload, I as isFenceClose, J as parseFenceOpen, K as
|
|
3
|
+
import { s as spring, M as MotionConfig, L as LazyMotion, d as domAnimation, A as AnimatePresence, u as useIsPresent, m, a as usePresence$1, b as animate, c as motion, R as ReorderGroup, e as ReorderItem } from "./vendor-motion-BgQeucLF.js";
|
|
4
|
+
import { m as modelConcern, p as parseBindingSpec, a as parseBindingSpecs, c as canonicalKeyName, R as RUN_WAITING_LABEL, r as runRetryingLabel, S as SYNC_CATEGORY_INFO, b as SYNC_MODE_LABEL, l as lentServerMachines, d as createOnboardingRun, O as ONBOARDING_WORDS, j as joinNames, e as ONBOARDING_STEPS, f as canSkipOnboardingStep, g as currentOnboardingStep, h as pushPaletteRecent, A as APPROVAL_MODE_OPTIONS, D as DURABILITY_OPTIONS, i as SETTINGS_TOGGLES$1, k as DEFAULT_SETTINGS, n as pickTab$1, o as openForAttention, q as openProactive, s as cycleTab, t as closePanel, u as togglePanel, v as mergeBadgeMenu, w as builtinBadgeActions, x as builtinBadgeEffect, y as isBadgeColor, z as ageStep, B as fmtTokens, C as parseCommandInvocation, E as findReferences, G as GITHUB_PULL_PROVIDER_ID, F as GITHUB_ISSUE_PROVIDER_ID, H as githubRefKey, _ as __vitePreload, I as isFenceClose, J as parseFenceOpen, K as isShellFence, L as nameFromModelId, M as hasAnsi, N as parseAnsi, P as scriptProgressView, Q as SCRIPT_OUTPUT_TAIL_LINES, T as formatRunDuration, U as toolInputCode, V as summarizeOutcomes, W as computeLineDiff, X as heatmapThresholds, Y as daysEndingAt, Z as heatmapLevel, $ as DIFFS_PANEL_ID, a0 as FILES_PANEL_ID, a1 as blockRunKey, a2 as createOutputTail, a3 as smoothCharsForTick, a4 as takeChars, a5 as scriptProgressByCall, a6 as isUserBashEvent, a7 as scriptProgressKey, a8 as formatToolCall, a9 as displayNameFor, aa as spawnParents, ab as summarizeTools, ac as planFold, ad as noteLabel, ae as thoughtLabel, af as toolOverview, ag as foldSummary, ah as foldsInCompactShape, ai as createRunStopMarker, aj as mergeTargetIndex, ak as finalizeStreamingMarkdown, al as upsertToolProgress, am as ownerOf, an as appendThinkingLines, ao as appendMarkdownDelta, ap as reconcileEvents, aq as retagUserPromptEventsFromRefs, ar as finalizeStreamingMarkdownForOwner, as as discardThinking, at as parseMachineKind, au as orderByMachine, av as machineBlockedReason, aw as inferPromptRefs, ax as titleFromText, ay as groupRows, az as DEFAULT_SPACE_ID, aA as resolveSessionSpace, aB as isExtensionSpaceId, aC as compileQuery, aD as renderTemplate, aE as readField, aF as validateQuery, aG as validateGroupBy, aH as validateSort, aI as viewQuery, aJ as SessionQueryError, aK as normalizeSpaces, aL as activeSpaceOf, aM as sessionDirLabel, aN as projectNameOf, aO as formatCostLabel, aP as rememberableChain$1, aQ as QUEUE_PANEL_ID, aR as INBOX_PANEL_ID, aS as TODOS_PANEL_ID, aT as modelDisplayName, aU as settingKeywords, aV as toggleApplies, aW as requirementMet, aX as toggleHeldOn, aY as bindingAlternatives, aZ as nativeExtensionByName, a_ as extensionMark, a$ as NATIVE_EXTENSIONS, b0 as DEFAULT_EXTENSION_SOURCE_UNREACHABLE, b1 as skillCategory, b2 as skillPickOf, b3 as RECOMMENDED_SKILL_SOURCES, b4 as githubPreviewImageUrl, b5 as githubAvatarUrl, b6 as DEFAULT_EXTENSION_SOURCE, b7 as skillTokenWeights, b8 as formatTokens, b9 as instructionPreviewLines, ba as instructionOriginBadge, bb as filterLogRecords, bc as formatLogLine, bd as LOG_LEVEL_CYCLE, be as groupSkillPicks, bf as enabledMcpsWith, bg as MCP_KEY_REFUSED_HINT, bh as MCP_STATUS_LABEL, bi as MCP_TRANSPORTS, bj as CONNECTORS, bk as connectorInstalled, bl as ageString, bm as validateMcpForm, bn as DEFAULT_OAUTH_ACCOUNT_LABEL, bo as providerBrand, bp as currentModelKeys, bq as customModelTargets, br as modelPickKey, bs as pickPrimaryKeyed, bt as chainAccountConflict, bu as positionKeyed, bv as toggleKeyed, bw as reorderKeyed, bx as cacheHintText, by as CACHE_HINT_MIN_TOKENS, bz as formatModelSetting, bA as parseModelSetting, bB as DEFAULT_MODEL_PICK, bC as estimateReadout, bD as formatEstimate, bE as previewLine, bF as spawnStartParts, bG as runStatusKey, bH as runFoldStatus, bI as RUN_STATUS_TIME_MS, bJ as formatElapsed, bK as CONTINUE_PROMPT, bL as SESSION_EVENT_STATUS_STYLE, bM as sessionEventMeta, bN as sessionEventExcerpt, bO as shortSessionId, bP as describeSpawnEnd, bQ as ATTACHMENT_SNIFF_BYTES, bR as planAttachment, bS as formatBytes, bT as MAX_IMAGE_ATTACHMENT_BYTES, bU as formatCostUsd, bV as formatTokenCount, bW as formatRunReceiptCells, bX as RUN_RECEIPT_SWITCH_GLYPH, bY as RUN_RECEIPT_TURN_GLYPH, bZ as shellBlockPlan, b_ as blockTerminalInput, b$ as stripAnsi, c0 as isCacheNotice, c1 as gatherCommandNotes, c2 as turnSelectionOwnership, c3 as runTailActivity, c4 as transcriptPresetOf, c5 as transcriptPreset, c6 as TRANSCRIPT_PRESETS, c7 as ONBOARDING_PREVIEW_EVENTS, c8 as autoTextModelId, c9 as newSpaceId, ca as sessionBadgeTarget, cb as highlightSegments, cc as searchHighlightRanges, cd as sortRows, ce as blendHsl, cf as activeSnapshotFor, cg as mostConstrainedWindow, ch as usageTone, ci as formatUsagePercent, cj as resetLabel, ck as compactingParts, cl as chainsEqualKeyed, cm as accentColor, cn as parseSessionKey, co as EMPTY_RATE, cp as stepStreamRate, cq as streamRateValue, cr as retryLabel, cs as parseRepoInput, ct as LOCAL_HOST_KEY, cu as defaultSessionModel, cv as defaultSessionKnobs, cw as defaultSessionAgent, cx as MACHINE_LINK_STATE_TEXT, cy as DAEMON_HEALTH_STYLE, cz as isValidMachineName, cA as machineSetupCommand, cB as clockText, cC as machineVersionDiffers, cD as clockOrDateText, cE as lastSeenText, cF as HOST_TOOLS, cG as capabilityTags, cH as hasTool, cI as syncAgo, cJ as SYNC_MODES, cK as SYNC_CATEGORIES, cL as syncMarkerOf, cM as settingField, cN as panelBadgeText, cO as TERMINAL_PANEL_ID, cP as tidyPromptText, cQ as splitPromptSegments, cR as TODO_STATUS_GLYPHS, cS as turnAsText, cT as modePrefixLength, cU as sliceEnd, cV as OutputHistory, cW as TERMINAL_HISTORY_MAX_CHARS, cX as TERMINAL_VIEW_MAX_LINES, cY as TERMINAL_VIEW_SCROLLBACK, cZ as moveTab$1, c_ as cycleTodoStatus, c$ as removeTodo, d0 as clearTodos, d1 as editTodo, d2 as buildTodoRetryMessage, d3 as addTodo, d4 as formatCount, d5 as editableTurnText, d6 as updatedLabel, d7 as showsAccount, d8 as formatBalance, d9 as usageBlockView, da as usageBlockContent, db as settingsSidebar, dc as settingsSearchIndex, dd as isolationLabel, de as LOCAL_SERVER_BRANDS, df as connectorById, dg as onboardingFeatureCopy, dh as SETTINGS_CHOICES$1, di as APPROVAL_MODE_TRADEOFFS, dj as SETTING_TRADEOFFS, dk as connectorsFromImport, dl as connectorInputError, dm as CONNECTOR_CATEGORIES, dn as connectorAuthText, dp as NATIVE_EXTENSION_GROUPS, dq as nativeExtensionNeedText, dr as onboardingFeatures, ds as ONBOARDING_FEATURE_GROUPS, dt as defaultImportSelection, du as ONBOARDING_AGENT_BRANDS, dv as onboardingSwitchedFeatures, dw as onboardingImportParts, dx as mergeSuggestions, dy as createCommandsCompletionProvider, dz as createFilesCompletionProvider, dA as createChatsCompletionProvider, dB as patchInlineGhost, dC as createSkillsCompletionProvider, dD as uniqueSkillNamesFromReferences, dE as buildUnifiedDiff, dF as rankPaletteItems, dG as groupPaletteRows, dH as TRANSCRIPT_PRESET_PALETTE_ID, dI as transcriptPresetPalettePicker, dJ as transcriptPresetOfPaletteItem, dK as transcriptPresetNotice, dL as transcriptPresetPaletteItem, dM as spaceOfSwitchItem, dN as spaceSwitchItems, dO as SETUP_PALETTE_ITEM } from "./core-2jWUG3m-.js";
|
|
5
5
|
import { M as Markdown$1, r as remarkGfm, d as defaultUrlTransform, D as DropdownMenuItem, a as DropdownMenu, b as DropdownMenuTrigger, c as DropdownMenuPortal, e as DropdownMenuContent, f as DropdownMenuSeparator, g as DropdownMenuSub, h as DropdownMenuSubTrigger, i as DropdownMenuSubContent, j as DropdownMenuRadioGroup, k as DropdownMenuRadioItem, l as DropdownMenuItemIndicator, m as DropdownMenuCheckboxItem } from "./vendor-BpwX-s_O.js";
|
|
6
6
|
import { S as Selection, s as src_default, P as PluginKey, a as Plugin, D as Decoration, b as DecorationSet, R as ReactRenderer, t as tippy, c as src_default$1, d as src_default$2, u as useEditor, e as useEditorState, E as EditorContent } from "./vendor-editor-Cx3SvGyZ.js";
|
|
7
7
|
function writable(initial) {
|
|
@@ -2806,10 +2806,10 @@ function useExtensionEffectRouter() {
|
|
|
2806
2806
|
function useExtensionsHost() {
|
|
2807
2807
|
return reactExports.useContext(HostContext$5);
|
|
2808
2808
|
}
|
|
2809
|
-
const NONE$
|
|
2809
|
+
const NONE$d = constant([]);
|
|
2810
2810
|
function useExtensionItems(token) {
|
|
2811
2811
|
const host = useExtensionsHost();
|
|
2812
|
-
return useReadable(host?.items[token] ?? NONE$
|
|
2812
|
+
return useReadable(host?.items[token] ?? NONE$d);
|
|
2813
2813
|
}
|
|
2814
2814
|
function useCarryExtensionsContext() {
|
|
2815
2815
|
const host = useExtensionsHost();
|
|
@@ -2986,8 +2986,6 @@ const DEFAULT_GIT_LABELS = {
|
|
|
2986
2986
|
gitRateLimited: (clock) => `GitHub rate limit, back at ${clock}.`,
|
|
2987
2987
|
gitLoadingBranches: "Loading branches…",
|
|
2988
2988
|
gitNoMatches: "No matches",
|
|
2989
|
-
gitCheckedOutElsewhere: (branch, worktree) => `${branch} is checked out in ${worktree}`,
|
|
2990
|
-
gitOpenWorktreeChat: "Open its chat",
|
|
2991
2989
|
gitRowSwitching: "switching",
|
|
2992
2990
|
gitRowCurrent: "current",
|
|
2993
2991
|
gitChecksText: (checks) => CHECKS$1[checks],
|
|
@@ -4182,6 +4180,24 @@ const DEFAULT_CHAT_LABELS = {
|
|
|
4182
4180
|
showOutput: "Show output",
|
|
4183
4181
|
inputCaption: "Input",
|
|
4184
4182
|
outputCaption: "Output",
|
|
4183
|
+
// Codemode scripts with live progress (`CodemodeScript`, the row's progress chips)
|
|
4184
|
+
/** Title of the chip that shows a script's `// @options` line. */
|
|
4185
|
+
scriptOptions: "Script options",
|
|
4186
|
+
/** The script's `timeout_ms`, in its options tooltip. */
|
|
4187
|
+
scriptOptionTimeout: "Time limit",
|
|
4188
|
+
/** The script's `max_output_tokens`, in its options tooltip. */
|
|
4189
|
+
scriptOptionOutput: "Output budget",
|
|
4190
|
+
scriptOptionTokens: (tokens) => `${tokens.toLocaleString("en-US")} tokens`,
|
|
4191
|
+
/** Accessible name of the panel with the last lines a running script printed. */
|
|
4192
|
+
scriptLiveOutput: "Live output",
|
|
4193
|
+
/** Calls finished out of all the script makes, when each runs once at most. */
|
|
4194
|
+
scriptCallsOf: (done, total) => `${done} of ${total}`,
|
|
4195
|
+
scriptPercent: (percent) => `${percent}%`,
|
|
4196
|
+
scriptCallsDone: (done) => `${done} done`,
|
|
4197
|
+
scriptCallsRunning: (running2) => `${running2} running`,
|
|
4198
|
+
scriptCallsFailed: (failed) => `${failed} failed`,
|
|
4199
|
+
/** Accessible name of the script's progress bar. */
|
|
4200
|
+
scriptProgress: "Script progress",
|
|
4185
4201
|
openNamedSession: (title) => `Open ${title}`,
|
|
4186
4202
|
/** A Mermaid diagram's accessible name, and its type when Pele detected one (`flowchart`). */
|
|
4187
4203
|
diagram: (type) => type ? `${type} diagram` : "Diagram",
|
|
@@ -4205,6 +4221,32 @@ const DEFAULT_CHAT_LABELS = {
|
|
|
4205
4221
|
shellKilled: "killed",
|
|
4206
4222
|
shellExit: (code) => `exit ${code}`,
|
|
4207
4223
|
earlierLines: (count2) => `… (+${count2} earlier lines)`,
|
|
4224
|
+
// A reply's shell blocks, run by the user (Run here, Run in a terminal)
|
|
4225
|
+
/** The block's run button, and the menu row that runs it under the block. */
|
|
4226
|
+
blockRunHere: "Run here",
|
|
4227
|
+
blockRunInTerminal: "Run in a terminal",
|
|
4228
|
+
/** The caret beside the run button: the menu of ways to run. */
|
|
4229
|
+
blockRunMenu: "Ways to run",
|
|
4230
|
+
blockRunStop: "Stop",
|
|
4231
|
+
/** A run in progress, in the panel under the block. */
|
|
4232
|
+
blockRunning: "Running",
|
|
4233
|
+
/** Accessible name of a run's output panel. */
|
|
4234
|
+
blockRunOutput: "Run output",
|
|
4235
|
+
blockRunAgain: "Run again",
|
|
4236
|
+
blockRunCopy: "Copy output",
|
|
4237
|
+
/** Stages the run's output as a text file on the message being written. */
|
|
4238
|
+
blockRunAttach: "Add to message",
|
|
4239
|
+
blockRunRemove: "Remove output",
|
|
4240
|
+
/** The attachment's file name when the output is added to a message. */
|
|
4241
|
+
blockRunAttachmentName: "run-output.md",
|
|
4242
|
+
blockRunStopped: "stopped",
|
|
4243
|
+
blockRunTimedOut: "timed out",
|
|
4244
|
+
/** The output kept only its end. */
|
|
4245
|
+
blockRunTruncated: "Earlier output was cut.",
|
|
4246
|
+
/** The panel when the block could not run. */
|
|
4247
|
+
blockRunFailed: (reason) => `Could not run: ${reason}`,
|
|
4248
|
+
/** After a failed run: it may have wanted input, which a terminal gives. */
|
|
4249
|
+
blockRunNeedsTerminal: "Needs input? Run it in a terminal.",
|
|
4208
4250
|
// Folds
|
|
4209
4251
|
working: "Working",
|
|
4210
4252
|
foldSteps: (count2) => `${count2} steps`,
|
|
@@ -5581,6 +5623,11 @@ const SETTINGS_TOGGLES = withCanonicalGates([
|
|
|
5581
5623
|
label: "Show codemode tool calls",
|
|
5582
5624
|
description: "List the calls each script makes under its row. Calls that start a subagent always show."
|
|
5583
5625
|
},
|
|
5626
|
+
{
|
|
5627
|
+
key: "codemodeStreamProgress",
|
|
5628
|
+
label: "Stream progress",
|
|
5629
|
+
description: "Show which line of a script runs, how many of its calls are done, and what it prints, while it runs."
|
|
5630
|
+
},
|
|
5584
5631
|
{
|
|
5585
5632
|
key: "decisions",
|
|
5586
5633
|
label: "Decisions",
|
|
@@ -6572,6 +6619,22 @@ class TerminalStore {
|
|
|
6572
6619
|
this.layouts.update(scope, { terminalOpen: true });
|
|
6573
6620
|
void this.open(scope);
|
|
6574
6621
|
}
|
|
6622
|
+
/**
|
|
6623
|
+
* Opens a new terminal in the scope, shows it, and types `input` into it (a
|
|
6624
|
+
* reply's shell block, Run in a terminal). The shell reads what was typed
|
|
6625
|
+
* once it starts. Resolves with the terminal, or `null` when none opened
|
|
6626
|
+
* (the scope's error says why).
|
|
6627
|
+
*
|
|
6628
|
+
* @param scope - The scope.
|
|
6629
|
+
* @param input - What to type, newline included to run it.
|
|
6630
|
+
*/
|
|
6631
|
+
async runIn(scope, input) {
|
|
6632
|
+
const info = await this.open(scope);
|
|
6633
|
+
if (!info) return null;
|
|
6634
|
+
this.revealTerminal(scope, info.id);
|
|
6635
|
+
await this.act(scope, () => this.host.write(info.id, input));
|
|
6636
|
+
return info;
|
|
6637
|
+
}
|
|
6575
6638
|
/**
|
|
6576
6639
|
* Shows one of the scope's terminals, focused: in the side panel's Terminal
|
|
6577
6640
|
* tab when it is on screen, else in the drawer, opened for it. Opening the
|
|
@@ -8235,7 +8298,7 @@ function ariaShortcut(spec) {
|
|
|
8235
8298
|
const { key, modifiers } = parseShortcut(spec);
|
|
8236
8299
|
return [...[...modifiers].map((m2) => ARIA_MODIFIERS[m2]), key.length === 1 ? key.toUpperCase() : key].join("+");
|
|
8237
8300
|
}
|
|
8238
|
-
function RowActionsMenu$
|
|
8301
|
+
function RowActionsMenu$2(props) {
|
|
8239
8302
|
const [armed, setArmed] = reactExports.useState(props.open);
|
|
8240
8303
|
if (props.open && !armed) setArmed(true);
|
|
8241
8304
|
return armed ? /* @__PURE__ */ jsxRuntimeExports.jsx(ArmedRowActionsMenu, { ...props }) : null;
|
|
@@ -8430,9 +8493,9 @@ function ActionRow$1({
|
|
|
8430
8493
|
)
|
|
8431
8494
|
] });
|
|
8432
8495
|
}
|
|
8433
|
-
const RowActionsMenu$
|
|
8496
|
+
const RowActionsMenu$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8434
8497
|
__proto__: null,
|
|
8435
|
-
RowActionsMenu: RowActionsMenu$
|
|
8498
|
+
RowActionsMenu: RowActionsMenu$2
|
|
8436
8499
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
8437
8500
|
const references = /* @__PURE__ */ new WeakMap();
|
|
8438
8501
|
const badges = /* @__PURE__ */ new WeakMap();
|
|
@@ -8565,7 +8628,7 @@ function BadgeMenuProvider({ composer, system, children }) {
|
|
|
8565
8628
|
}, [open, focused, badges2, composer, system, labels, links]);
|
|
8566
8629
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(BadgeMenuContext.Provider, { value: show, children: [
|
|
8567
8630
|
children,
|
|
8568
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$
|
|
8631
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$2, { open: open !== null, position: open?.at ?? null, onClose: close2, items }),
|
|
8569
8632
|
notice && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8570
8633
|
"div",
|
|
8571
8634
|
{
|
|
@@ -10743,7 +10806,7 @@ function useNearViewport(ref, margin = "600px 0px") {
|
|
|
10743
10806
|
}
|
|
10744
10807
|
function highlightHere(code, lang, theme) {
|
|
10745
10808
|
return __vitePreload(async () => {
|
|
10746
|
-
const { highlightToHtml } = await import("./highlights-
|
|
10809
|
+
const { highlightToHtml } = await import("./highlights-6LT5DvBO.js");
|
|
10747
10810
|
return { highlightToHtml };
|
|
10748
10811
|
}, true ? __vite__mapDeps([0,1,2,3,4,5,6]) : void 0, import.meta.url).then(({ highlightToHtml }) => highlightToHtml(code, lang, theme)).catch(() => null);
|
|
10749
10812
|
}
|
|
@@ -10871,35 +10934,6 @@ function useCodeHighlight() {
|
|
|
10871
10934
|
const appearance = useDocumentAppearance(!theme);
|
|
10872
10935
|
return { highlighter, theme: theme ?? defaultShikiTheme(appearance) };
|
|
10873
10936
|
}
|
|
10874
|
-
function HighlightedCode({ code, language, className, style, copyLabel, actions }) {
|
|
10875
|
-
const hostRef = reactExports.useRef(null);
|
|
10876
|
-
const near2 = useNearViewport(hostRef);
|
|
10877
|
-
const html = useShikiHtml(code, language, near2);
|
|
10878
|
-
const pending2 = near2 && html === void 0;
|
|
10879
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10880
|
-
CodeFrame,
|
|
10881
|
-
{
|
|
10882
|
-
ref: hostRef,
|
|
10883
|
-
code,
|
|
10884
|
-
className: ["zg-shiki my-2 text-xs", className].filter(Boolean).join(" "),
|
|
10885
|
-
style,
|
|
10886
|
-
...copyLabel ? { copyLabel } : {},
|
|
10887
|
-
...actions ? { actions } : {},
|
|
10888
|
-
children: html ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { dangerouslySetInnerHTML: { __html: html } }) : (
|
|
10889
|
-
// The highlighted block's metrics, on the frame's tone as it is (no background of its own,
|
|
10890
|
-
// which would cover the frame's hairline): highlighting lands without a flash.
|
|
10891
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10892
|
-
"pre",
|
|
10893
|
-
{
|
|
10894
|
-
"data-zg-highlight": pending2 ? "pending" : void 0,
|
|
10895
|
-
className: "px-3 py-2 m-0 whitespace-pre font-mono text-[length:var(--zg-font-size-code)] leading-[1.5] text-[var(--zg-code-fg)]",
|
|
10896
|
-
children: code
|
|
10897
|
-
}
|
|
10898
|
-
)
|
|
10899
|
-
)
|
|
10900
|
-
}
|
|
10901
|
-
);
|
|
10902
|
-
}
|
|
10903
10937
|
const noSubscription$4 = () => () => {
|
|
10904
10938
|
};
|
|
10905
10939
|
function useHydrated$1() {
|
|
@@ -10910,7 +10944,7 @@ function useHydrated$1() {
|
|
|
10910
10944
|
);
|
|
10911
10945
|
}
|
|
10912
10946
|
const REHIGHLIGHT_DEBOUNCE_MS = 150;
|
|
10913
|
-
function
|
|
10947
|
+
function useHighlightedHtml$1(code, language, enabled) {
|
|
10914
10948
|
const { highlighter, theme } = useCodeHighlight();
|
|
10915
10949
|
const hydrated = useHydrated$1();
|
|
10916
10950
|
const [painted, setPainted] = reactExports.useState(null);
|
|
@@ -10949,6 +10983,35 @@ function useShikiHtml(code, language, enabled) {
|
|
|
10949
10983
|
if (painted && painted.code === code && painted.language === language) return painted.html;
|
|
10950
10984
|
return hydrated ? highlighter.cached(code, language, theme) : void 0;
|
|
10951
10985
|
}
|
|
10986
|
+
function HighlightedCode({ code, language, className, style, copyLabel, actions }) {
|
|
10987
|
+
const hostRef = reactExports.useRef(null);
|
|
10988
|
+
const near2 = useNearViewport(hostRef);
|
|
10989
|
+
const html = useHighlightedHtml$1(code, language, near2);
|
|
10990
|
+
const pending2 = near2 && html === void 0;
|
|
10991
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
10992
|
+
CodeFrame,
|
|
10993
|
+
{
|
|
10994
|
+
ref: hostRef,
|
|
10995
|
+
code,
|
|
10996
|
+
className: ["zg-shiki my-2 text-xs", className].filter(Boolean).join(" "),
|
|
10997
|
+
style,
|
|
10998
|
+
...copyLabel ? { copyLabel } : {},
|
|
10999
|
+
...actions ? { actions } : {},
|
|
11000
|
+
children: html ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { dangerouslySetInnerHTML: { __html: html } }) : (
|
|
11001
|
+
// The highlighted block's metrics, on the frame's tone as it is (no background of its own,
|
|
11002
|
+
// which would cover the frame's hairline): highlighting lands without a flash.
|
|
11003
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11004
|
+
"pre",
|
|
11005
|
+
{
|
|
11006
|
+
"data-zg-highlight": pending2 ? "pending" : void 0,
|
|
11007
|
+
className: "px-3 py-2 m-0 whitespace-pre font-mono text-[length:var(--zg-font-size-code)] leading-[1.5] text-[var(--zg-code-fg)]",
|
|
11008
|
+
children: code
|
|
11009
|
+
}
|
|
11010
|
+
)
|
|
11011
|
+
)
|
|
11012
|
+
}
|
|
11013
|
+
);
|
|
11014
|
+
}
|
|
10952
11015
|
const CHUNK_THRESHOLD = 6e3;
|
|
10953
11016
|
const CHUNK_TARGET = 3e3;
|
|
10954
11017
|
function stepFence(fence, line) {
|
|
@@ -11290,6 +11353,10 @@ function isSettingLocked(settings, extension, key) {
|
|
|
11290
11353
|
function slotIsActionable(item) {
|
|
11291
11354
|
return item.panel !== void 0 || item.command !== void 0;
|
|
11292
11355
|
}
|
|
11356
|
+
const ShellBlockContext = reactExports.createContext(null);
|
|
11357
|
+
function useShellBlockRunner() {
|
|
11358
|
+
return reactExports.useContext(ShellBlockContext);
|
|
11359
|
+
}
|
|
11293
11360
|
const INLINE_CODE_CLASS = "px-1 py-0.5 rounded-zg-xs bg-[var(--zg-code-bg)] text-[var(--zg-code-fg)] font-mono text-[0.85em] [overflow-wrap:anywhere]";
|
|
11294
11361
|
function PlainLink$1({ href, title, children }) {
|
|
11295
11362
|
const onClick = useLinkRouter().anchorClick(href, { source: "transcript" });
|
|
@@ -11339,12 +11406,15 @@ function Code({ className, children }) {
|
|
|
11339
11406
|
function Pre({ children }) {
|
|
11340
11407
|
const { CodeBlock } = reactExports.useContext(PartsContext);
|
|
11341
11408
|
const diagrams = useDiagrams();
|
|
11409
|
+
const shells = useShellBlockRunner();
|
|
11342
11410
|
const child = Array.isArray(children) ? children[0] : children;
|
|
11343
11411
|
if (child && typeof child === "object" && "props" in child) {
|
|
11344
11412
|
const { className, children: code } = child.props;
|
|
11345
11413
|
const language = /language-(\w+)/.exec(className ?? "")?.[1] ?? "plaintext";
|
|
11346
11414
|
const text = typeof code === "string" ? code.replace(/\n$/, "") : "";
|
|
11347
11415
|
if (diagrams && language === "mermaid" && text.trim()) return /* @__PURE__ */ jsxRuntimeExports.jsx(DiagramFence, { code: text });
|
|
11416
|
+
if (shells && isShellFence(language))
|
|
11417
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(shells.Block, { code: text, language, scope: shells.scope, CodeBlock });
|
|
11348
11418
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(CodeBlock, { code: text, language });
|
|
11349
11419
|
}
|
|
11350
11420
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { children });
|
|
@@ -11461,15 +11531,15 @@ const Markdown = reactExports.memo(
|
|
|
11461
11531
|
}
|
|
11462
11532
|
);
|
|
11463
11533
|
const SKIP = /* @__PURE__ */ new Set(["link", "linkReference", "inlineCode", "code", "heading", "html"]);
|
|
11464
|
-
const PREFIX$
|
|
11534
|
+
const PREFIX$2 = "zg-ref:ext:";
|
|
11465
11535
|
function referenceUrl(providerId, key, href, placeholder, placeholderIcon) {
|
|
11466
11536
|
const parts = [providerId, key, href ?? "", placeholder ?? "", placeholderIcon ?? ""].map(encodeURIComponent);
|
|
11467
11537
|
while (parts.length > 2 && parts[parts.length - 1] === "") parts.pop();
|
|
11468
|
-
return `${PREFIX$
|
|
11538
|
+
return `${PREFIX$2}${parts.join(":")}`;
|
|
11469
11539
|
}
|
|
11470
11540
|
function parseReferenceUrl(url) {
|
|
11471
|
-
if (!url?.startsWith(PREFIX$
|
|
11472
|
-
const [providerId, key, href, placeholder, placeholderIcon] = url.slice(PREFIX$
|
|
11541
|
+
if (!url?.startsWith(PREFIX$2)) return null;
|
|
11542
|
+
const [providerId, key, href, placeholder, placeholderIcon] = url.slice(PREFIX$2.length).split(":");
|
|
11473
11543
|
if (!providerId || !key) return null;
|
|
11474
11544
|
try {
|
|
11475
11545
|
return {
|
|
@@ -11923,10 +11993,465 @@ const Dot$2 = reactExports.memo(function Dot2({ variant, line, className, style
|
|
|
11923
11993
|
}
|
|
11924
11994
|
);
|
|
11925
11995
|
});
|
|
11926
|
-
const
|
|
11927
|
-
|
|
11996
|
+
const BUBBLE = (
|
|
11997
|
+
// The floating tone and shadow, at tooltip scale.
|
|
11998
|
+
"zg-tooltip pointer-events-none px-2 py-1 rounded-zg-sm text-zg-meta leading-4 text-[var(--zg-text)] bg-[var(--zg-overlay)] shadow-[var(--zg-shadow-float)]"
|
|
11999
|
+
);
|
|
12000
|
+
const SHOW_DELAY = 400;
|
|
12001
|
+
const WARM_WINDOW = 600;
|
|
12002
|
+
let openCount = 0;
|
|
12003
|
+
let lastClosedAt = -Infinity;
|
|
12004
|
+
const isWarm = () => openCount > 0 || performance.now() - lastClosedAt < WARM_WINDOW;
|
|
12005
|
+
let fadingOut = null;
|
|
12006
|
+
const FOCUSABLE = 'button, a[href], input, select, textarea, [contenteditable], [tabindex]:not([tabindex="-1"])';
|
|
12007
|
+
function isFocusVisible(el) {
|
|
12008
|
+
try {
|
|
12009
|
+
return el.matches(":focus-visible");
|
|
12010
|
+
} catch {
|
|
12011
|
+
return true;
|
|
12012
|
+
}
|
|
12013
|
+
}
|
|
12014
|
+
function Tooltip({
|
|
12015
|
+
label,
|
|
12016
|
+
side = "bottom",
|
|
12017
|
+
align = "center",
|
|
12018
|
+
children,
|
|
12019
|
+
className = "",
|
|
12020
|
+
style,
|
|
12021
|
+
portal = false,
|
|
12022
|
+
maxWidth,
|
|
12023
|
+
disabled = false
|
|
12024
|
+
}) {
|
|
12025
|
+
const y = side === "bottom" ? "top-full mt-1.5" : "bottom-full mb-1.5";
|
|
12026
|
+
const x = align === "end" ? "right-0" : "left-1/2 -translate-x-1/2";
|
|
12027
|
+
const id = reactExports.useId();
|
|
12028
|
+
const [suppressed, setSuppressed] = reactExports.useState(false);
|
|
12029
|
+
const [dismissed, setDismissed] = reactExports.useState(false);
|
|
12030
|
+
const [hovered, setHovered] = reactExports.useState(false);
|
|
12031
|
+
const [focused, setFocused] = reactExports.useState(false);
|
|
12032
|
+
const [vanished, setVanished] = reactExports.useState(false);
|
|
12033
|
+
const hostRef = reactExports.useRef(null);
|
|
12034
|
+
const bubbleRef = reactExports.useRef(null);
|
|
12035
|
+
const timer2 = reactExports.useRef(void 0);
|
|
12036
|
+
const pointerInside = reactExports.useRef(false);
|
|
12037
|
+
const [pos, setPos] = reactExports.useState(null);
|
|
12038
|
+
const open = !disabled && (hovered || focused) && !suppressed && !dismissed;
|
|
12039
|
+
const presence = usePresence(open, { enter: portal, exitMs: readMenuExitMs });
|
|
12040
|
+
const moves = useMotionLevel() === "full";
|
|
12041
|
+
reactExports.useEffect(() => () => clearTimeout(timer2.current), []);
|
|
12042
|
+
reactExports.useEffect(() => {
|
|
12043
|
+
if (!open) return;
|
|
12044
|
+
openCount += 1;
|
|
12045
|
+
fadingOut?.();
|
|
12046
|
+
fadingOut = null;
|
|
12047
|
+
setVanished(false);
|
|
12048
|
+
return () => {
|
|
12049
|
+
openCount -= 1;
|
|
12050
|
+
lastClosedAt = performance.now();
|
|
12051
|
+
fadingOut = () => setVanished(true);
|
|
12052
|
+
};
|
|
12053
|
+
}, [open]);
|
|
12054
|
+
const gone = vanished && !open;
|
|
12055
|
+
reactExports.useEffect(() => {
|
|
12056
|
+
const host = hostRef.current;
|
|
12057
|
+
if (!open || !host) return;
|
|
12058
|
+
const target = host.querySelector(FOCUSABLE) ?? host.firstElementChild;
|
|
12059
|
+
if (!target) return;
|
|
12060
|
+
const prev = target.getAttribute("aria-describedby");
|
|
12061
|
+
target.setAttribute("aria-describedby", prev ? `${prev} ${id}` : id);
|
|
12062
|
+
return () => {
|
|
12063
|
+
if (prev === null) target.removeAttribute("aria-describedby");
|
|
12064
|
+
else target.setAttribute("aria-describedby", prev);
|
|
12065
|
+
};
|
|
12066
|
+
}, [open, id]);
|
|
12067
|
+
reactExports.useEffect(() => {
|
|
12068
|
+
if (!open) return;
|
|
12069
|
+
const onKey2 = (e) => {
|
|
12070
|
+
if (e.key !== "Escape") return;
|
|
12071
|
+
e.stopPropagation();
|
|
12072
|
+
setDismissed(true);
|
|
12073
|
+
};
|
|
12074
|
+
window.addEventListener("keydown", onKey2, true);
|
|
12075
|
+
return () => window.removeEventListener("keydown", onKey2, true);
|
|
12076
|
+
}, [open]);
|
|
12077
|
+
reactExports.useLayoutEffect(() => {
|
|
12078
|
+
if (!portal || !open) return;
|
|
12079
|
+
const host = hostRef.current?.getBoundingClientRect();
|
|
12080
|
+
const bubble2 = bubbleRef.current?.getBoundingClientRect();
|
|
12081
|
+
if (!host || !bubble2) return;
|
|
12082
|
+
let placed = side;
|
|
12083
|
+
const gap = 6;
|
|
12084
|
+
const margin = 8;
|
|
12085
|
+
let left = align === "end" ? host.right - bubble2.width : host.left + host.width / 2 - bubble2.width / 2;
|
|
12086
|
+
left = Math.max(margin, Math.min(left, window.innerWidth - bubble2.width - margin));
|
|
12087
|
+
let top = side === "bottom" ? host.bottom + gap : host.top - gap - bubble2.height;
|
|
12088
|
+
if (top < margin) {
|
|
12089
|
+
top = host.bottom + gap;
|
|
12090
|
+
placed = "bottom";
|
|
12091
|
+
}
|
|
12092
|
+
if (top + bubble2.height > window.innerHeight - margin) {
|
|
12093
|
+
top = host.top - gap - bubble2.height;
|
|
12094
|
+
placed = "top";
|
|
12095
|
+
}
|
|
12096
|
+
setPos({ left, top, side: placed });
|
|
12097
|
+
}, [portal, open, align, side, label]);
|
|
12098
|
+
const reset = () => {
|
|
12099
|
+
setSuppressed(false);
|
|
12100
|
+
setDismissed(false);
|
|
12101
|
+
};
|
|
12102
|
+
const shown2 = portal ? presence.state === "open" && pos !== null : open;
|
|
12103
|
+
const placedSide = portal && pos?.side || side;
|
|
12104
|
+
const rise = shown2 || !moves || presence.state === "closing" ? "0" : placedSide === "bottom" ? "-2px" : "2px";
|
|
12105
|
+
const motion2 = {
|
|
12106
|
+
opacity: shown2 ? 1 : 0,
|
|
12107
|
+
transform: !portal && align === "center" ? `translate(-50%, ${rise})` : `translateY(${rise})`,
|
|
12108
|
+
transition: shown2 ? "opacity calc(var(--zg-motion-menu-duration) * 0.7) var(--zg-motion-menu-ease), transform var(--zg-motion-menu)" : gone ? "none" : "opacity var(--zg-motion-menu-exit), transform var(--zg-motion-menu-exit)"
|
|
12109
|
+
// The shorthand also resets transition-delay, dropping the CSS hover delay.
|
|
12110
|
+
};
|
|
12111
|
+
const bubble = portal ? presence.mounted && !gone && reactDomExports.createPortal(
|
|
12112
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12113
|
+
"span",
|
|
12114
|
+
{
|
|
12115
|
+
ref: bubbleRef,
|
|
12116
|
+
role: "tooltip",
|
|
12117
|
+
id,
|
|
12118
|
+
className: `${BUBBLE} fixed z-zg-tooltip`,
|
|
12119
|
+
"data-portal": true,
|
|
12120
|
+
style: { ...motion2, left: pos?.left ?? -9999, top: pos?.top ?? -9999, maxWidth },
|
|
12121
|
+
children: label
|
|
12122
|
+
}
|
|
12123
|
+
),
|
|
12124
|
+
document.body
|
|
12125
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12126
|
+
"span",
|
|
12127
|
+
{
|
|
12128
|
+
role: "tooltip",
|
|
12129
|
+
id,
|
|
12130
|
+
"aria-hidden": true,
|
|
12131
|
+
className: `${BUBBLE} absolute z-30 ${maxWidth === void 0 ? "whitespace-nowrap" : "w-max"} ${y} ${x}`,
|
|
12132
|
+
style: { ...motion2, maxWidth },
|
|
12133
|
+
children: label
|
|
12134
|
+
}
|
|
12135
|
+
);
|
|
12136
|
+
return (
|
|
12137
|
+
// A passive wrapper: the keyboard handling belongs to the focusable child,
|
|
12138
|
+
// these listeners only observe its focus and the pointer around it.
|
|
12139
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
12140
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
12141
|
+
"span",
|
|
12142
|
+
{
|
|
12143
|
+
ref: hostRef,
|
|
12144
|
+
className: `relative inline-flex ${className}`,
|
|
12145
|
+
style,
|
|
12146
|
+
onPointerDown: () => setSuppressed(true),
|
|
12147
|
+
onKeyDown: (e) => {
|
|
12148
|
+
if (e.key === "Enter" || e.key === " ") setSuppressed(true);
|
|
12149
|
+
},
|
|
12150
|
+
onMouseEnter: () => {
|
|
12151
|
+
pointerInside.current = true;
|
|
12152
|
+
clearTimeout(timer2.current);
|
|
12153
|
+
if (isWarm()) setHovered(true);
|
|
12154
|
+
else timer2.current = setTimeout(() => setHovered(true), SHOW_DELAY);
|
|
12155
|
+
},
|
|
12156
|
+
onMouseLeave: () => {
|
|
12157
|
+
pointerInside.current = false;
|
|
12158
|
+
clearTimeout(timer2.current);
|
|
12159
|
+
setHovered(false);
|
|
12160
|
+
if (!focused) reset();
|
|
12161
|
+
},
|
|
12162
|
+
onFocus: (e) => {
|
|
12163
|
+
if (isFocusVisible(e.target)) setFocused(true);
|
|
12164
|
+
},
|
|
12165
|
+
onBlur: (e) => {
|
|
12166
|
+
if (hostRef.current?.contains(e.relatedTarget)) return;
|
|
12167
|
+
setFocused(false);
|
|
12168
|
+
if (!pointerInside.current) reset();
|
|
12169
|
+
},
|
|
12170
|
+
...suppressed ? { "data-tooltip-suppressed": "" } : {},
|
|
12171
|
+
children: [
|
|
12172
|
+
children,
|
|
12173
|
+
bubble
|
|
12174
|
+
]
|
|
12175
|
+
}
|
|
12176
|
+
)
|
|
12177
|
+
);
|
|
12178
|
+
}
|
|
12179
|
+
function highlightedLines(html, lineCount) {
|
|
12180
|
+
if (typeof DOMParser === "undefined") return null;
|
|
12181
|
+
const doc = new DOMParser().parseFromString(html, "text/html");
|
|
12182
|
+
const root = doc.querySelector("pre code") ?? doc.querySelector("pre");
|
|
12183
|
+
if (!root) return null;
|
|
12184
|
+
const lines = [[]];
|
|
12185
|
+
const push = (text, style) => {
|
|
12186
|
+
const parts = text.split("\n");
|
|
12187
|
+
parts.forEach((part, i) => {
|
|
12188
|
+
if (i > 0) lines.push([]);
|
|
12189
|
+
if (part !== "") lines[lines.length - 1].push({ text: part, ...style });
|
|
12190
|
+
});
|
|
12191
|
+
};
|
|
12192
|
+
const walk = (node, style) => {
|
|
12193
|
+
for (const child of Array.from(node.childNodes)) {
|
|
12194
|
+
if (child.nodeType === 3) {
|
|
12195
|
+
push(child.textContent ?? "", style);
|
|
12196
|
+
} else if (child.nodeType === 1) {
|
|
12197
|
+
const css = child.style;
|
|
12198
|
+
walk(child, {
|
|
12199
|
+
...style,
|
|
12200
|
+
...css?.color ? { color: css.color } : {},
|
|
12201
|
+
...css?.fontStyle ? { fontStyle: css.fontStyle } : {},
|
|
12202
|
+
...css?.fontWeight ? { fontWeight: css.fontWeight } : {}
|
|
12203
|
+
});
|
|
12204
|
+
}
|
|
12205
|
+
}
|
|
12206
|
+
};
|
|
12207
|
+
walk(root, {});
|
|
12208
|
+
while (lines.length > lineCount && lines[lines.length - 1].length === 0) lines.pop();
|
|
12209
|
+
return lines.length === lineCount ? lines : null;
|
|
12210
|
+
}
|
|
12211
|
+
function Grow({ as: Tag = "div", axis = "y", appear, className = "", style, children, ...rest }) {
|
|
12212
|
+
const [isPresent, safeToRemove] = usePresence$1();
|
|
12213
|
+
const ref = reactExports.useRef(null);
|
|
12214
|
+
const [entered, setEntered] = reactExports.useState(!appear);
|
|
12215
|
+
reactExports.useLayoutEffect(() => {
|
|
12216
|
+
if (entered) return;
|
|
12217
|
+
ref.current?.getBoundingClientRect();
|
|
12218
|
+
setEntered(true);
|
|
12219
|
+
}, [entered]);
|
|
12220
|
+
reactExports.useLayoutEffect(() => {
|
|
12221
|
+
if (isPresent) return void 0;
|
|
12222
|
+
const id = setTimeout(() => safeToRemove?.(), readExitMs());
|
|
12223
|
+
return () => clearTimeout(id);
|
|
12224
|
+
}, [isPresent, safeToRemove]);
|
|
12225
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12226
|
+
Tag,
|
|
12227
|
+
{
|
|
12228
|
+
ref,
|
|
12229
|
+
className: `zg-grow ${className}`,
|
|
12230
|
+
"data-shown": entered && isPresent ? "" : void 0,
|
|
12231
|
+
"data-axis": axis === "x" ? "x" : void 0,
|
|
12232
|
+
style,
|
|
12233
|
+
...rest,
|
|
12234
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-grow-clip", children })
|
|
12235
|
+
}
|
|
12236
|
+
);
|
|
12237
|
+
}
|
|
12238
|
+
const CUBE = [0, 95, 135, 175, 215, 255];
|
|
12239
|
+
function paletteColor(color) {
|
|
12240
|
+
if (typeof color === "string") return color;
|
|
12241
|
+
if (color < 16) return `var(--zg-ansi-${color})`;
|
|
12242
|
+
if (color >= 232) {
|
|
12243
|
+
const v = 8 + (color - 232) * 10;
|
|
12244
|
+
return `rgb(${v} ${v} ${v})`;
|
|
12245
|
+
}
|
|
12246
|
+
const n = color - 16;
|
|
12247
|
+
return `rgb(${CUBE[Math.floor(n / 36) % 6]} ${CUBE[Math.floor(n / 6) % 6]} ${CUBE[n % 6]})`;
|
|
12248
|
+
}
|
|
12249
|
+
function Span({ span }) {
|
|
12250
|
+
const style = span.style;
|
|
12251
|
+
if (!style) return span.text;
|
|
12252
|
+
const fg = style.inverse ? style.bg ?? null : style.fg;
|
|
12253
|
+
const bg = style.inverse ? style.fg ?? null : style.bg;
|
|
12254
|
+
const classes2 = [];
|
|
12255
|
+
const css = {};
|
|
12256
|
+
if (fg === null) css.color = "var(--zg-code-bg)";
|
|
12257
|
+
else if (fg !== void 0) css.color = paletteColor(fg);
|
|
12258
|
+
if (bg === null) css.backgroundColor = "var(--zg-text)";
|
|
12259
|
+
else if (bg !== void 0) css.backgroundColor = `color-mix(in srgb, ${paletteColor(bg)} 25%, transparent)`;
|
|
12260
|
+
if (style.bold) classes2.push("font-semibold");
|
|
12261
|
+
if (style.dim) classes2.push("opacity-60");
|
|
12262
|
+
if (style.italic) classes2.push("italic");
|
|
12263
|
+
if (style.underline) classes2.push("underline");
|
|
12264
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: classes2.join(" ") || void 0, style: Object.keys(css).length > 0 ? css : void 0, children: span.text });
|
|
12265
|
+
}
|
|
12266
|
+
const AnsiSpans = reactExports.memo(function AnsiSpans2({ spans }) {
|
|
12267
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: spans.map((span, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(Span, { span }, i)) });
|
|
12268
|
+
});
|
|
12269
|
+
const AnsiText = reactExports.memo(function AnsiText2({ text }) {
|
|
12270
|
+
const lines = reactExports.useMemo(() => hasAnsi(text) ? parseAnsi(text) : null, [text]);
|
|
12271
|
+
if (!lines) return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: text });
|
|
12272
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: lines.map((spans, i) => /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
12273
|
+
i > 0 && "\n",
|
|
12274
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AnsiSpans, { spans })
|
|
12275
|
+
] }, i)) });
|
|
12276
|
+
});
|
|
12277
|
+
function LiveOutput({ lines, window: window2, label, className }) {
|
|
12278
|
+
const [firstIds] = reactExports.useState(() => new Set(lines.map((line) => line.id)));
|
|
12279
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12280
|
+
"div",
|
|
12281
|
+
{
|
|
12282
|
+
className: ["zg-code-panel zg-output zg-live-output zg-ansi", className].filter(Boolean).join(" "),
|
|
12283
|
+
role: "log",
|
|
12284
|
+
"aria-live": "polite",
|
|
12285
|
+
"aria-label": label,
|
|
12286
|
+
"data-full": lines.length >= window2 ? "" : void 0,
|
|
12287
|
+
style: { "--zg-live-tail": window2 },
|
|
12288
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(AnimatePresence, { initial: false, children: lines.map((line) => /* @__PURE__ */ jsxRuntimeExports.jsx(Grow, { appear: !firstIds.has(line.id), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-stream": line.stream, children: line.spans ? /* @__PURE__ */ jsxRuntimeExports.jsx(AnsiSpans, { spans: line.spans }) : line.text === "" ? "\n" : line.text }) }, line.id)) })
|
|
12289
|
+
}
|
|
12290
|
+
);
|
|
12291
|
+
}
|
|
12292
|
+
const SCRIPT_FOLLOW_LINES = 15;
|
|
12293
|
+
const CodemodeScript = reactExports.memo(function CodemodeScript2({
|
|
12294
|
+
code,
|
|
12295
|
+
progress,
|
|
12296
|
+
finished = false,
|
|
12297
|
+
ok = true,
|
|
12298
|
+
result,
|
|
12299
|
+
output,
|
|
12300
|
+
className,
|
|
12301
|
+
style
|
|
12302
|
+
}) {
|
|
12303
|
+
const labels = useChatLabels();
|
|
12304
|
+
const view = reactExports.useMemo(
|
|
12305
|
+
() => scriptProgressView(code, progress, finished, ok, result),
|
|
12306
|
+
[code, progress, finished, ok, result]
|
|
12307
|
+
);
|
|
12308
|
+
const source = reactExports.useMemo(() => view.lines.map((line) => line.text).join("\n"), [view.lines]);
|
|
12309
|
+
const frameRef = reactExports.useRef(null);
|
|
12310
|
+
const near2 = useNearViewport(frameRef);
|
|
12311
|
+
const html = useHighlightedHtml$1(source, "javascript", near2);
|
|
12312
|
+
const tokens = reactExports.useMemo(() => html ? highlightedLines(html, view.lines.length) : null, [html, view.lines.length]);
|
|
12313
|
+
const follow = view.tracked && !finished && view.lines.length > SCRIPT_FOLLOW_LINES;
|
|
12314
|
+
const listRef = reactExports.useRef(null);
|
|
12315
|
+
const [userScrolled, setUserScrolled] = reactExports.useState(false);
|
|
12316
|
+
const stopFollowing = () => setUserScrolled(true);
|
|
12317
|
+
reactExports.useEffect(() => {
|
|
12318
|
+
const list2 = listRef.current;
|
|
12319
|
+
if (!follow || userScrolled || !list2 || view.active === void 0) return;
|
|
12320
|
+
const line = list2.querySelector(`[data-line="${view.active}"]`);
|
|
12321
|
+
if (line) list2.scrollTop = line.offsetTop - list2.clientHeight / 2 + line.offsetHeight / 2;
|
|
12322
|
+
}, [follow, userScrolled, view.active]);
|
|
12323
|
+
const digits = String(view.lines.at(-1)?.label ?? 1).length;
|
|
12324
|
+
const showLive = view.tracked && !finished && view.output.length > 0;
|
|
12325
|
+
const showEnd = view.tracked && finished && output != null;
|
|
12326
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: ["my-2", className].filter(Boolean).join(" "), style, "data-testid": "codemode-script", children: [
|
|
12327
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12328
|
+
CodeFrame,
|
|
12329
|
+
{
|
|
12330
|
+
ref: frameRef,
|
|
12331
|
+
code: source,
|
|
12332
|
+
className: "zg-shiki zg-script-frame text-xs",
|
|
12333
|
+
...view.options ? {
|
|
12334
|
+
actions: (buttonClass2) => /* @__PURE__ */ jsxRuntimeExports.jsx(ScriptOptionsButton, { options: view.options, buttonClass: buttonClass2 })
|
|
12335
|
+
} : {},
|
|
12336
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12337
|
+
"div",
|
|
12338
|
+
{
|
|
12339
|
+
ref: listRef,
|
|
12340
|
+
className: "zg-script-lines",
|
|
12341
|
+
"data-follow": follow ? "" : void 0,
|
|
12342
|
+
style: { "--zg-script-digits": `${digits}ch` },
|
|
12343
|
+
...follow ? { onWheel: stopFollowing, onTouchMove: stopFollowing } : {},
|
|
12344
|
+
children: view.lines.map((line, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12345
|
+
ScriptLine,
|
|
12346
|
+
{
|
|
12347
|
+
number: line.number,
|
|
12348
|
+
label: line.label,
|
|
12349
|
+
text: line.text,
|
|
12350
|
+
tokens: tokens?.[i],
|
|
12351
|
+
state: line.state,
|
|
12352
|
+
tracked: view.tracked,
|
|
12353
|
+
error: view.error?.line === line.number ? view.error.message : void 0
|
|
12354
|
+
},
|
|
12355
|
+
line.number
|
|
12356
|
+
))
|
|
12357
|
+
}
|
|
12358
|
+
)
|
|
12359
|
+
}
|
|
12360
|
+
),
|
|
12361
|
+
view.tracked && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible", "data-open": showLive || showEnd, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible-inner", children: showEnd ? output : /* @__PURE__ */ jsxRuntimeExports.jsx(LiveOutput, { lines: view.output, window: SCRIPT_OUTPUT_TAIL_LINES, label: labels.scriptLiveOutput }) }) })
|
|
12362
|
+
] });
|
|
12363
|
+
});
|
|
12364
|
+
const ScriptLine = reactExports.memo(function ScriptLine2({ number, label, text, tokens, state, tracked, error }) {
|
|
12365
|
+
const labels = useChatLabels();
|
|
12366
|
+
const previous = reactExports.useRef(state);
|
|
12367
|
+
const [settling, setSettling] = reactExports.useState(false);
|
|
12368
|
+
reactExports.useEffect(() => {
|
|
12369
|
+
if (previous.current !== state && state === "done") setSettling(true);
|
|
12370
|
+
previous.current = state;
|
|
12371
|
+
}, [state]);
|
|
12372
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
12373
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
12374
|
+
"div",
|
|
12375
|
+
{
|
|
12376
|
+
className: "zg-script-line",
|
|
12377
|
+
"data-line": number,
|
|
12378
|
+
"data-state": tracked ? state : void 0,
|
|
12379
|
+
"data-settling": settling ? "" : void 0,
|
|
12380
|
+
onAnimationEnd: settling ? () => setSettling(false) : void 0,
|
|
12381
|
+
children: [
|
|
12382
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "zg-script-gutter", children: [
|
|
12383
|
+
tracked && /* @__PURE__ */ jsxRuntimeExports.jsx(LineMark, { state }),
|
|
12384
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-script-number", "aria-hidden": true, children: label })
|
|
12385
|
+
] }),
|
|
12386
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "zg-script-code", children: [
|
|
12387
|
+
tokens ? tokens.map((token, k) => /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: token.color, fontStyle: token.fontStyle, fontWeight: token.fontWeight }, children: token.text }, k)) : text,
|
|
12388
|
+
text === "" && "\n"
|
|
12389
|
+
] })
|
|
12390
|
+
]
|
|
12391
|
+
}
|
|
12392
|
+
),
|
|
12393
|
+
error !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "zg-script-line zg-script-error", role: "note", "aria-label": labels.stepFailed, children: [
|
|
12394
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-script-gutter", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-script-mark i-ph-arrow-elbow-down-right" }) }),
|
|
12395
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-script-code", children: error })
|
|
12396
|
+
] })
|
|
12397
|
+
] });
|
|
12398
|
+
});
|
|
12399
|
+
function ScriptOptionsButton({ options, buttonClass: buttonClass2 }) {
|
|
12400
|
+
const labels = useChatLabels();
|
|
12401
|
+
const rows2 = [
|
|
12402
|
+
...options.timeoutMs !== void 0 ? [[labels.scriptOptionTimeout, formatRunDuration(options.timeoutMs)]] : [],
|
|
12403
|
+
...options.maxOutputTokens !== void 0 ? [[labels.scriptOptionOutput, labels.scriptOptionTokens(options.maxOutputTokens)]] : [],
|
|
12404
|
+
...options.other.map(({ key, value }) => [key, value]),
|
|
12405
|
+
...options.raw !== void 0 ? [[labels.scriptOptions, options.raw]] : []
|
|
12406
|
+
];
|
|
12407
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12408
|
+
Tooltip,
|
|
12409
|
+
{
|
|
12410
|
+
portal: true,
|
|
12411
|
+
align: "end",
|
|
12412
|
+
maxWidth: 280,
|
|
12413
|
+
label: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "grid grid-cols-[auto_auto] gap-x-3 gap-y-0.5 py-0.5", children: rows2.map(([name, value]) => /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "contents", children: [
|
|
12414
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[var(--zg-text-muted)]", children: name }),
|
|
12415
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-right", children: value })
|
|
12416
|
+
] }, name)) }),
|
|
12417
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12418
|
+
"button",
|
|
12419
|
+
{
|
|
12420
|
+
type: "button",
|
|
12421
|
+
"aria-label": labels.scriptOptions,
|
|
12422
|
+
className: buttonClass2,
|
|
12423
|
+
onClick: (event) => event.stopPropagation(),
|
|
12424
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "i-ph-sliders-horizontal text-zg-label", "aria-hidden": true })
|
|
12425
|
+
}
|
|
12426
|
+
)
|
|
12427
|
+
}
|
|
12428
|
+
);
|
|
12429
|
+
}
|
|
12430
|
+
function LineMark({ state }) {
|
|
12431
|
+
const labels = useChatLabels();
|
|
12432
|
+
if (state === "running")
|
|
12433
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { role: "img", "aria-label": labels.stepRunning, className: "zg-script-mark i-ph-circle-notch animate-spin" });
|
|
12434
|
+
if (state === "done") return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { role: "img", "aria-label": labels.stepDone, className: "zg-script-mark i-ph-check" });
|
|
12435
|
+
if (state === "failed") return /* @__PURE__ */ jsxRuntimeExports.jsx(FailedMark, { className: "zg-script-mark" });
|
|
12436
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-script-mark", "aria-hidden": true });
|
|
12437
|
+
}
|
|
12438
|
+
const CODE_PANEL = "zg-code-panel zg-output zg-ansi";
|
|
12439
|
+
function ToolInput({ name, input, scriptProgress, finished, ok, result, output }) {
|
|
11928
12440
|
const { CodeBlock } = useTranscriptRenderers();
|
|
11929
12441
|
const script = toolInputCode(name, input);
|
|
12442
|
+
if (script && name === "codemode" && typeof input.code === "string") {
|
|
12443
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
12444
|
+
CodemodeScript,
|
|
12445
|
+
{
|
|
12446
|
+
code: input.code,
|
|
12447
|
+
...scriptProgress ? { progress: scriptProgress } : {},
|
|
12448
|
+
...finished !== void 0 ? { finished } : {},
|
|
12449
|
+
...ok !== void 0 ? { ok } : {},
|
|
12450
|
+
...result !== void 0 ? { result } : {},
|
|
12451
|
+
...output !== void 0 ? { output } : {}
|
|
12452
|
+
}
|
|
12453
|
+
);
|
|
12454
|
+
}
|
|
11930
12455
|
if (script) return /* @__PURE__ */ jsxRuntimeExports.jsx(CodeBlock, { code: script.code, language: script.language });
|
|
11931
12456
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(CodeBlock, { code: JSON.stringify(input, null, 2), language: "json" });
|
|
11932
12457
|
}
|
|
@@ -12571,7 +13096,7 @@ function toggleZoom(state, at, geometry) {
|
|
|
12571
13096
|
function panZoom(state, dx, dy, geometry) {
|
|
12572
13097
|
return clampZoom({ ...state, x: state.x + dx, y: state.y + dy }, geometry);
|
|
12573
13098
|
}
|
|
12574
|
-
const RowActionsMenu = reactExports.lazy(() => __vitePreload(() => Promise.resolve().then(() => RowActionsMenu$
|
|
13099
|
+
const RowActionsMenu$1 = reactExports.lazy(() => __vitePreload(() => Promise.resolve().then(() => RowActionsMenu$3), true ? void 0 : void 0, import.meta.url).then((m2) => ({ default: m2.RowActionsMenu })));
|
|
12575
13100
|
const DRAG_SLOP = 3;
|
|
12576
13101
|
const LINE_PX$1 = 16;
|
|
12577
13102
|
const ZoomableImage = reactExports.forwardRef(function ZoomableImage2({
|
|
@@ -12771,7 +13296,7 @@ const ZoomableImage = reactExports.forwardRef(function ZoomableImage2({
|
|
|
12771
13296
|
children: labels.zoomPercent(realPercent(view.zoom, view.geometry))
|
|
12772
13297
|
}
|
|
12773
13298
|
),
|
|
12774
|
-
menuArmed && /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu, { open: menu !== null, position: menu, onClose: () => openMenu(null), items }) })
|
|
13299
|
+
menuArmed && /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$1, { open: menu !== null, position: menu, onClose: () => openMenu(null), items }) })
|
|
12775
13300
|
]
|
|
12776
13301
|
}
|
|
12777
13302
|
);
|
|
@@ -13051,6 +13576,14 @@ function ToolMedia({ media, url, name, className, style }) {
|
|
|
13051
13576
|
}
|
|
13052
13577
|
);
|
|
13053
13578
|
}
|
|
13579
|
+
function scriptInputProps(tool) {
|
|
13580
|
+
return {
|
|
13581
|
+
...tool.scriptProgress ? { scriptProgress: tool.scriptProgress } : {},
|
|
13582
|
+
finished: tool.ok !== null,
|
|
13583
|
+
ok: tool.ok !== false,
|
|
13584
|
+
result: tool.result
|
|
13585
|
+
};
|
|
13586
|
+
}
|
|
13054
13587
|
function ToolPayload({ tool, className, style }) {
|
|
13055
13588
|
const { full, load, available, ready: ready2 } = useFullOutput(tool);
|
|
13056
13589
|
const output = typeof full === "string" ? full : tool.result;
|
|
@@ -13063,7 +13596,7 @@ function ToolPayload({ tool, className, style }) {
|
|
|
13063
13596
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: root, style, children: [
|
|
13064
13597
|
tool.name !== "read_file" && tool.rawInput && Object.keys(tool.rawInput).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(ToolInput, { name: tool.name, input: tool.rawInput }),
|
|
13065
13598
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ToolMedia, { media: media.media, url: media.url, name: readPath(tool) }),
|
|
13066
|
-
tool.name !== "read_file" && media.rest !== "" && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: pre, children: media.rest })
|
|
13599
|
+
tool.name !== "read_file" && media.rest !== "" && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: pre, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AnsiText, { text: media.rest }) })
|
|
13067
13600
|
] });
|
|
13068
13601
|
}
|
|
13069
13602
|
if (tool.name === "read_file" && output !== null) {
|
|
@@ -13073,9 +13606,9 @@ function ToolPayload({ tool, className, style }) {
|
|
|
13073
13606
|
] });
|
|
13074
13607
|
}
|
|
13075
13608
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: root, style, children: [
|
|
13076
|
-
tool.rawInput && Object.keys(tool.rawInput).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(ToolInput, { name: tool.name, input: tool.rawInput }),
|
|
13609
|
+
tool.rawInput && Object.keys(tool.rawInput).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(ToolInput, { name: tool.name, input: tool.rawInput, ...scriptInputProps(tool) }),
|
|
13077
13610
|
loadButton,
|
|
13078
|
-
output !== null && output.trim() !== "" && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: pre, children: output })
|
|
13611
|
+
output !== null && output.trim() !== "" && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: pre, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AnsiText, { text: output }) })
|
|
13079
13612
|
] });
|
|
13080
13613
|
}
|
|
13081
13614
|
function readPath(tool) {
|
|
@@ -13266,189 +13799,6 @@ function ExtensionRenderer({
|
|
|
13266
13799
|
current.key
|
|
13267
13800
|
) }) });
|
|
13268
13801
|
}
|
|
13269
|
-
const BUBBLE = (
|
|
13270
|
-
// The floating tone and shadow, at tooltip scale.
|
|
13271
|
-
"zg-tooltip pointer-events-none px-2 py-1 rounded-zg-sm text-zg-meta leading-4 text-[var(--zg-text)] bg-[var(--zg-overlay)] shadow-[var(--zg-shadow-float)]"
|
|
13272
|
-
);
|
|
13273
|
-
const SHOW_DELAY = 400;
|
|
13274
|
-
const WARM_WINDOW = 600;
|
|
13275
|
-
let openCount = 0;
|
|
13276
|
-
let lastClosedAt = -Infinity;
|
|
13277
|
-
const isWarm = () => openCount > 0 || performance.now() - lastClosedAt < WARM_WINDOW;
|
|
13278
|
-
let fadingOut = null;
|
|
13279
|
-
const FOCUSABLE = 'button, a[href], input, select, textarea, [contenteditable], [tabindex]:not([tabindex="-1"])';
|
|
13280
|
-
function isFocusVisible(el) {
|
|
13281
|
-
try {
|
|
13282
|
-
return el.matches(":focus-visible");
|
|
13283
|
-
} catch {
|
|
13284
|
-
return true;
|
|
13285
|
-
}
|
|
13286
|
-
}
|
|
13287
|
-
function Tooltip({
|
|
13288
|
-
label,
|
|
13289
|
-
side = "bottom",
|
|
13290
|
-
align = "center",
|
|
13291
|
-
children,
|
|
13292
|
-
className = "",
|
|
13293
|
-
style,
|
|
13294
|
-
portal = false,
|
|
13295
|
-
maxWidth,
|
|
13296
|
-
disabled = false
|
|
13297
|
-
}) {
|
|
13298
|
-
const y = side === "bottom" ? "top-full mt-1.5" : "bottom-full mb-1.5";
|
|
13299
|
-
const x = align === "end" ? "right-0" : "left-1/2 -translate-x-1/2";
|
|
13300
|
-
const id = reactExports.useId();
|
|
13301
|
-
const [suppressed, setSuppressed] = reactExports.useState(false);
|
|
13302
|
-
const [dismissed, setDismissed] = reactExports.useState(false);
|
|
13303
|
-
const [hovered, setHovered] = reactExports.useState(false);
|
|
13304
|
-
const [focused, setFocused] = reactExports.useState(false);
|
|
13305
|
-
const [vanished, setVanished] = reactExports.useState(false);
|
|
13306
|
-
const hostRef = reactExports.useRef(null);
|
|
13307
|
-
const bubbleRef = reactExports.useRef(null);
|
|
13308
|
-
const timer2 = reactExports.useRef(void 0);
|
|
13309
|
-
const pointerInside = reactExports.useRef(false);
|
|
13310
|
-
const [pos, setPos] = reactExports.useState(null);
|
|
13311
|
-
const open = !disabled && (hovered || focused) && !suppressed && !dismissed;
|
|
13312
|
-
const presence = usePresence(open, { enter: portal, exitMs: readMenuExitMs });
|
|
13313
|
-
const moves = useMotionLevel() === "full";
|
|
13314
|
-
reactExports.useEffect(() => () => clearTimeout(timer2.current), []);
|
|
13315
|
-
reactExports.useEffect(() => {
|
|
13316
|
-
if (!open) return;
|
|
13317
|
-
openCount += 1;
|
|
13318
|
-
fadingOut?.();
|
|
13319
|
-
fadingOut = null;
|
|
13320
|
-
setVanished(false);
|
|
13321
|
-
return () => {
|
|
13322
|
-
openCount -= 1;
|
|
13323
|
-
lastClosedAt = performance.now();
|
|
13324
|
-
fadingOut = () => setVanished(true);
|
|
13325
|
-
};
|
|
13326
|
-
}, [open]);
|
|
13327
|
-
const gone = vanished && !open;
|
|
13328
|
-
reactExports.useEffect(() => {
|
|
13329
|
-
const host = hostRef.current;
|
|
13330
|
-
if (!open || !host) return;
|
|
13331
|
-
const target = host.querySelector(FOCUSABLE) ?? host.firstElementChild;
|
|
13332
|
-
if (!target) return;
|
|
13333
|
-
const prev = target.getAttribute("aria-describedby");
|
|
13334
|
-
target.setAttribute("aria-describedby", prev ? `${prev} ${id}` : id);
|
|
13335
|
-
return () => {
|
|
13336
|
-
if (prev === null) target.removeAttribute("aria-describedby");
|
|
13337
|
-
else target.setAttribute("aria-describedby", prev);
|
|
13338
|
-
};
|
|
13339
|
-
}, [open, id]);
|
|
13340
|
-
reactExports.useEffect(() => {
|
|
13341
|
-
if (!open) return;
|
|
13342
|
-
const onKey2 = (e) => {
|
|
13343
|
-
if (e.key !== "Escape") return;
|
|
13344
|
-
e.stopPropagation();
|
|
13345
|
-
setDismissed(true);
|
|
13346
|
-
};
|
|
13347
|
-
window.addEventListener("keydown", onKey2, true);
|
|
13348
|
-
return () => window.removeEventListener("keydown", onKey2, true);
|
|
13349
|
-
}, [open]);
|
|
13350
|
-
reactExports.useLayoutEffect(() => {
|
|
13351
|
-
if (!portal || !open) return;
|
|
13352
|
-
const host = hostRef.current?.getBoundingClientRect();
|
|
13353
|
-
const bubble2 = bubbleRef.current?.getBoundingClientRect();
|
|
13354
|
-
if (!host || !bubble2) return;
|
|
13355
|
-
let placed = side;
|
|
13356
|
-
const gap = 6;
|
|
13357
|
-
const margin = 8;
|
|
13358
|
-
let left = align === "end" ? host.right - bubble2.width : host.left + host.width / 2 - bubble2.width / 2;
|
|
13359
|
-
left = Math.max(margin, Math.min(left, window.innerWidth - bubble2.width - margin));
|
|
13360
|
-
let top = side === "bottom" ? host.bottom + gap : host.top - gap - bubble2.height;
|
|
13361
|
-
if (top < margin) {
|
|
13362
|
-
top = host.bottom + gap;
|
|
13363
|
-
placed = "bottom";
|
|
13364
|
-
}
|
|
13365
|
-
if (top + bubble2.height > window.innerHeight - margin) {
|
|
13366
|
-
top = host.top - gap - bubble2.height;
|
|
13367
|
-
placed = "top";
|
|
13368
|
-
}
|
|
13369
|
-
setPos({ left, top, side: placed });
|
|
13370
|
-
}, [portal, open, align, side, label]);
|
|
13371
|
-
const reset = () => {
|
|
13372
|
-
setSuppressed(false);
|
|
13373
|
-
setDismissed(false);
|
|
13374
|
-
};
|
|
13375
|
-
const shown2 = portal ? presence.state === "open" && pos !== null : open;
|
|
13376
|
-
const placedSide = portal && pos?.side || side;
|
|
13377
|
-
const rise = shown2 || !moves || presence.state === "closing" ? "0" : placedSide === "bottom" ? "-2px" : "2px";
|
|
13378
|
-
const motion2 = {
|
|
13379
|
-
opacity: shown2 ? 1 : 0,
|
|
13380
|
-
transform: !portal && align === "center" ? `translate(-50%, ${rise})` : `translateY(${rise})`,
|
|
13381
|
-
transition: shown2 ? "opacity calc(var(--zg-motion-menu-duration) * 0.7) var(--zg-motion-menu-ease), transform var(--zg-motion-menu)" : gone ? "none" : "opacity var(--zg-motion-menu-exit), transform var(--zg-motion-menu-exit)"
|
|
13382
|
-
// The shorthand also resets transition-delay, dropping the CSS hover delay.
|
|
13383
|
-
};
|
|
13384
|
-
const bubble = portal ? presence.mounted && !gone && reactDomExports.createPortal(
|
|
13385
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
13386
|
-
"span",
|
|
13387
|
-
{
|
|
13388
|
-
ref: bubbleRef,
|
|
13389
|
-
role: "tooltip",
|
|
13390
|
-
id,
|
|
13391
|
-
className: `${BUBBLE} fixed z-zg-tooltip`,
|
|
13392
|
-
"data-portal": true,
|
|
13393
|
-
style: { ...motion2, left: pos?.left ?? -9999, top: pos?.top ?? -9999, maxWidth },
|
|
13394
|
-
children: label
|
|
13395
|
-
}
|
|
13396
|
-
),
|
|
13397
|
-
document.body
|
|
13398
|
-
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
13399
|
-
"span",
|
|
13400
|
-
{
|
|
13401
|
-
role: "tooltip",
|
|
13402
|
-
id,
|
|
13403
|
-
"aria-hidden": true,
|
|
13404
|
-
className: `${BUBBLE} absolute z-30 ${maxWidth === void 0 ? "whitespace-nowrap" : "w-max"} ${y} ${x}`,
|
|
13405
|
-
style: { ...motion2, maxWidth },
|
|
13406
|
-
children: label
|
|
13407
|
-
}
|
|
13408
|
-
);
|
|
13409
|
-
return (
|
|
13410
|
-
// A passive wrapper: the keyboard handling belongs to the focusable child,
|
|
13411
|
-
// these listeners only observe its focus and the pointer around it.
|
|
13412
|
-
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
13413
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
13414
|
-
"span",
|
|
13415
|
-
{
|
|
13416
|
-
ref: hostRef,
|
|
13417
|
-
className: `relative inline-flex ${className}`,
|
|
13418
|
-
style,
|
|
13419
|
-
onPointerDown: () => setSuppressed(true),
|
|
13420
|
-
onKeyDown: (e) => {
|
|
13421
|
-
if (e.key === "Enter" || e.key === " ") setSuppressed(true);
|
|
13422
|
-
},
|
|
13423
|
-
onMouseEnter: () => {
|
|
13424
|
-
pointerInside.current = true;
|
|
13425
|
-
clearTimeout(timer2.current);
|
|
13426
|
-
if (isWarm()) setHovered(true);
|
|
13427
|
-
else timer2.current = setTimeout(() => setHovered(true), SHOW_DELAY);
|
|
13428
|
-
},
|
|
13429
|
-
onMouseLeave: () => {
|
|
13430
|
-
pointerInside.current = false;
|
|
13431
|
-
clearTimeout(timer2.current);
|
|
13432
|
-
setHovered(false);
|
|
13433
|
-
if (!focused) reset();
|
|
13434
|
-
},
|
|
13435
|
-
onFocus: (e) => {
|
|
13436
|
-
if (isFocusVisible(e.target)) setFocused(true);
|
|
13437
|
-
},
|
|
13438
|
-
onBlur: (e) => {
|
|
13439
|
-
if (hostRef.current?.contains(e.relatedTarget)) return;
|
|
13440
|
-
setFocused(false);
|
|
13441
|
-
if (!pointerInside.current) reset();
|
|
13442
|
-
},
|
|
13443
|
-
...suppressed ? { "data-tooltip-suppressed": "" } : {},
|
|
13444
|
-
children: [
|
|
13445
|
-
children,
|
|
13446
|
-
bubble
|
|
13447
|
-
]
|
|
13448
|
-
}
|
|
13449
|
-
)
|
|
13450
|
-
);
|
|
13451
|
-
}
|
|
13452
13802
|
function Segmented({
|
|
13453
13803
|
value,
|
|
13454
13804
|
onChange,
|
|
@@ -14999,6 +15349,7 @@ function ModalShell({
|
|
|
14999
15349
|
function ScreenShell({
|
|
15000
15350
|
title,
|
|
15001
15351
|
description,
|
|
15352
|
+
lead,
|
|
15002
15353
|
screenLabel,
|
|
15003
15354
|
onClose,
|
|
15004
15355
|
aside,
|
|
@@ -15050,16 +15401,19 @@ function ScreenShell({
|
|
|
15050
15401
|
className: "zg-drag zg-screen-header shrink-0 flex items-end gap-3 px-6 pb-3 border-b border-[var(--zg-hairline)]",
|
|
15051
15402
|
style: { height: `calc(${chrome.top}px / var(--zg-zoom, 1) + 56px)` },
|
|
15052
15403
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0 flex items-end gap-3", children: [
|
|
15053
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
15054
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15055
|
-
|
|
15056
|
-
|
|
15057
|
-
|
|
15058
|
-
|
|
15059
|
-
|
|
15060
|
-
|
|
15061
|
-
|
|
15062
|
-
|
|
15404
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0 flex items-center gap-2.5", children: [
|
|
15405
|
+
lead && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "shrink-0 flex", children: lead }),
|
|
15406
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
15407
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15408
|
+
"h2",
|
|
15409
|
+
{
|
|
15410
|
+
id: MODAL_TITLE_ID,
|
|
15411
|
+
className: "text-sm font-semibold leading-tight text-[var(--zg-text)] m-0 zg-balance",
|
|
15412
|
+
children: title
|
|
15413
|
+
}
|
|
15414
|
+
),
|
|
15415
|
+
description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs leading-tight text-[var(--zg-text-muted)] mt-0.5 m-0 truncate", children: description })
|
|
15416
|
+
] })
|
|
15063
15417
|
] }),
|
|
15064
15418
|
headerActions && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-no-drag flex items-center gap-2 shrink-0 pb-0.5", children: headerActions })
|
|
15065
15419
|
] })
|
|
@@ -17319,33 +17673,6 @@ function Popover({
|
|
|
17319
17673
|
)
|
|
17320
17674
|
] });
|
|
17321
17675
|
}
|
|
17322
|
-
function Grow({ as: Tag = "div", axis = "y", appear, className = "", style, children, ...rest }) {
|
|
17323
|
-
const [isPresent, safeToRemove] = usePresence$1();
|
|
17324
|
-
const ref = reactExports.useRef(null);
|
|
17325
|
-
const [entered, setEntered] = reactExports.useState(!appear);
|
|
17326
|
-
reactExports.useLayoutEffect(() => {
|
|
17327
|
-
if (entered) return;
|
|
17328
|
-
ref.current?.getBoundingClientRect();
|
|
17329
|
-
setEntered(true);
|
|
17330
|
-
}, [entered]);
|
|
17331
|
-
reactExports.useLayoutEffect(() => {
|
|
17332
|
-
if (isPresent) return void 0;
|
|
17333
|
-
const id = setTimeout(() => safeToRemove?.(), readExitMs());
|
|
17334
|
-
return () => clearTimeout(id);
|
|
17335
|
-
}, [isPresent, safeToRemove]);
|
|
17336
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17337
|
-
Tag,
|
|
17338
|
-
{
|
|
17339
|
-
ref,
|
|
17340
|
-
className: `zg-grow ${className}`,
|
|
17341
|
-
"data-shown": entered && isPresent ? "" : void 0,
|
|
17342
|
-
"data-axis": axis === "x" ? "x" : void 0,
|
|
17343
|
-
style,
|
|
17344
|
-
...rest,
|
|
17345
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-grow-clip", children })
|
|
17346
|
-
}
|
|
17347
|
-
);
|
|
17348
|
-
}
|
|
17349
17676
|
let running$1 = 0;
|
|
17350
17677
|
const listeners$2 = /* @__PURE__ */ new Set();
|
|
17351
17678
|
function notify() {
|
|
@@ -17767,6 +18094,183 @@ function presetFor(hex) {
|
|
|
17767
18094
|
const h = hex.toLowerCase();
|
|
17768
18095
|
return ACCENT_PRESETS.find((p) => p.dark === h || p.light === h);
|
|
17769
18096
|
}
|
|
18097
|
+
const PREFIX$1 = "i-ph-";
|
|
18098
|
+
const ICON_CLASS = /^i-ph-[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
18099
|
+
const SELECTOR = `[class*="${PREFIX$1}"]`;
|
|
18100
|
+
const LAYER = "zidane-ui.utilities";
|
|
18101
|
+
function runtimeIconRule(className, collection) {
|
|
18102
|
+
if (!ICON_CLASS.test(className)) return null;
|
|
18103
|
+
const name = className.slice(PREFIX$1.length);
|
|
18104
|
+
const icon = collection.icons[name] ?? collection.icons[collection.aliases?.[name]?.parent ?? ""];
|
|
18105
|
+
if (!icon) return null;
|
|
18106
|
+
const width = icon.width ?? collection.width ?? 16;
|
|
18107
|
+
const height = icon.height ?? collection.height ?? 16;
|
|
18108
|
+
const svg = `<svg viewBox='0 0 ${width} ${height}' height='1em' width='1em' xmlns='http://www.w3.org/2000/svg' >${icon.body}</svg>`;
|
|
18109
|
+
const url = svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/\{/g, "%7B").replace(/\}/g, "%7D").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
18110
|
+
return `.${className}{--un-icon:url("data:image/svg+xml;utf8,${url}");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;height:1em;width:1em;}`;
|
|
18111
|
+
}
|
|
18112
|
+
function watchRuntimeIcons(options) {
|
|
18113
|
+
const root = options.root ?? document.documentElement;
|
|
18114
|
+
const doc = root.ownerDocument;
|
|
18115
|
+
const seen = /* @__PURE__ */ new Set();
|
|
18116
|
+
const missing = /* @__PURE__ */ new Set();
|
|
18117
|
+
let collection = null;
|
|
18118
|
+
let sheet = null;
|
|
18119
|
+
let probe = null;
|
|
18120
|
+
const styled = (className) => {
|
|
18121
|
+
if (!probe) {
|
|
18122
|
+
probe = doc.createElement("span");
|
|
18123
|
+
probe.setAttribute("aria-hidden", "true");
|
|
18124
|
+
probe.style.display = "none";
|
|
18125
|
+
doc.body.append(probe);
|
|
18126
|
+
}
|
|
18127
|
+
probe.className = className;
|
|
18128
|
+
return getComputedStyle(probe).getPropertyValue("--un-icon").trim() !== "";
|
|
18129
|
+
};
|
|
18130
|
+
const flush = () => {
|
|
18131
|
+
if (missing.size === 0) return;
|
|
18132
|
+
const names = [...missing];
|
|
18133
|
+
missing.clear();
|
|
18134
|
+
collection ??= options.loadPhosphor().catch(() => null);
|
|
18135
|
+
void collection.then((set) => {
|
|
18136
|
+
if (!set) return;
|
|
18137
|
+
const rules = names.flatMap((name) => runtimeIconRule(name, set) ?? []);
|
|
18138
|
+
if (rules.length === 0) return;
|
|
18139
|
+
if (!sheet) {
|
|
18140
|
+
sheet = doc.createElement("style");
|
|
18141
|
+
sheet.dataset.zidaneRuntimeIcons = "";
|
|
18142
|
+
doc.head.append(sheet);
|
|
18143
|
+
}
|
|
18144
|
+
sheet.append(`@layer ${LAYER}{${rules.join("")}}
|
|
18145
|
+
`);
|
|
18146
|
+
});
|
|
18147
|
+
};
|
|
18148
|
+
const look = (el) => {
|
|
18149
|
+
for (const className of el.classList) {
|
|
18150
|
+
if (!className.startsWith(PREFIX$1) || seen.has(className)) continue;
|
|
18151
|
+
seen.add(className);
|
|
18152
|
+
if (ICON_CLASS.test(className) && !styled(className)) missing.add(className);
|
|
18153
|
+
}
|
|
18154
|
+
};
|
|
18155
|
+
const scan = (el) => {
|
|
18156
|
+
look(el);
|
|
18157
|
+
for (const child of el.querySelectorAll(SELECTOR)) look(child);
|
|
18158
|
+
};
|
|
18159
|
+
const observer2 = new MutationObserver((records) => {
|
|
18160
|
+
for (const record of records) {
|
|
18161
|
+
if (record.type === "attributes") look(record.target);
|
|
18162
|
+
else for (const node of record.addedNodes) if (node.nodeType === 1) scan(node);
|
|
18163
|
+
}
|
|
18164
|
+
flush();
|
|
18165
|
+
});
|
|
18166
|
+
observer2.observe(root, { subtree: true, childList: true, attributes: true, attributeFilter: ["class"] });
|
|
18167
|
+
scan(root);
|
|
18168
|
+
flush();
|
|
18169
|
+
return () => {
|
|
18170
|
+
observer2.disconnect();
|
|
18171
|
+
probe?.remove();
|
|
18172
|
+
probe = null;
|
|
18173
|
+
};
|
|
18174
|
+
}
|
|
18175
|
+
const LIVE_BLOCK_RUN_LINES = 15;
|
|
18176
|
+
const NONE$c = Object.freeze({});
|
|
18177
|
+
const NO_LIVE$1 = Object.freeze({});
|
|
18178
|
+
const LIVE_FLUSH_MS = 50;
|
|
18179
|
+
const LINE_CHARS = 2e3;
|
|
18180
|
+
function createChatBlockRuns(transport) {
|
|
18181
|
+
const stores2 = /* @__PURE__ */ new Map();
|
|
18182
|
+
const reads = /* @__PURE__ */ new Map();
|
|
18183
|
+
const refresh = (sessionId) => {
|
|
18184
|
+
const store = stores2.get(sessionId);
|
|
18185
|
+
if (!store) return;
|
|
18186
|
+
const ticket = (reads.get(sessionId) ?? 0) + 1;
|
|
18187
|
+
reads.set(sessionId, ticket);
|
|
18188
|
+
transport.list(sessionId).then(
|
|
18189
|
+
(runs) => {
|
|
18190
|
+
if (reads.get(sessionId) === ticket) store.set(runs);
|
|
18191
|
+
},
|
|
18192
|
+
() => void 0
|
|
18193
|
+
);
|
|
18194
|
+
};
|
|
18195
|
+
transport.onChanged(refresh);
|
|
18196
|
+
const runsOf = (sessionId) => {
|
|
18197
|
+
let store = stores2.get(sessionId);
|
|
18198
|
+
if (!store) {
|
|
18199
|
+
store = writable(NONE$c);
|
|
18200
|
+
stores2.set(sessionId, store);
|
|
18201
|
+
refresh(sessionId);
|
|
18202
|
+
}
|
|
18203
|
+
return store;
|
|
18204
|
+
};
|
|
18205
|
+
const lives = /* @__PURE__ */ new Map();
|
|
18206
|
+
const stops = /* @__PURE__ */ new Map();
|
|
18207
|
+
const liveOf = (sessionId) => {
|
|
18208
|
+
let store = lives.get(sessionId);
|
|
18209
|
+
if (!store) {
|
|
18210
|
+
store = writable(NO_LIVE$1);
|
|
18211
|
+
lives.set(sessionId, store);
|
|
18212
|
+
}
|
|
18213
|
+
return store;
|
|
18214
|
+
};
|
|
18215
|
+
const setLive = (sessionId, key, run) => {
|
|
18216
|
+
liveOf(sessionId).set((all) => {
|
|
18217
|
+
const next2 = { ...all };
|
|
18218
|
+
if (run) next2[key] = run;
|
|
18219
|
+
else delete next2[key];
|
|
18220
|
+
return next2;
|
|
18221
|
+
});
|
|
18222
|
+
};
|
|
18223
|
+
return {
|
|
18224
|
+
runs: runsOf,
|
|
18225
|
+
run: (sessionId, request, options) => transport.run(sessionId, request, options),
|
|
18226
|
+
remove: (sessionId, key) => transport.remove(sessionId, key),
|
|
18227
|
+
live: liveOf,
|
|
18228
|
+
start(sessionId, request) {
|
|
18229
|
+
const key = blockRunKey(request.turnId, request.code);
|
|
18230
|
+
const id = `${sessionId}\0${key}`;
|
|
18231
|
+
if (stops.has(id)) return;
|
|
18232
|
+
const controller = new AbortController();
|
|
18233
|
+
stops.set(id, controller);
|
|
18234
|
+
const startedAt = Date.now();
|
|
18235
|
+
const tail = createOutputTail(LIVE_BLOCK_RUN_LINES, LINE_CHARS);
|
|
18236
|
+
let timer2 = null;
|
|
18237
|
+
const flush = () => {
|
|
18238
|
+
timer2 = null;
|
|
18239
|
+
setLive(sessionId, key, { key, lines: tail.lines(), startedAt });
|
|
18240
|
+
};
|
|
18241
|
+
flush();
|
|
18242
|
+
transport.run(sessionId, request, {
|
|
18243
|
+
signal: controller.signal,
|
|
18244
|
+
onOutput: (stream, text) => {
|
|
18245
|
+
tail.chunk(stream, text);
|
|
18246
|
+
timer2 ??= setTimeout(flush, LIVE_FLUSH_MS);
|
|
18247
|
+
}
|
|
18248
|
+
}).then(
|
|
18249
|
+
(run) => {
|
|
18250
|
+
reads.set(sessionId, (reads.get(sessionId) ?? 0) + 1);
|
|
18251
|
+
runsOf(sessionId).set((all) => ({ ...all, [run.key]: run }));
|
|
18252
|
+
setLive(sessionId, key, null);
|
|
18253
|
+
},
|
|
18254
|
+
(err) => {
|
|
18255
|
+
setLive(sessionId, key, {
|
|
18256
|
+
key,
|
|
18257
|
+
lines: tail.lines(),
|
|
18258
|
+
startedAt,
|
|
18259
|
+
error: err instanceof Error ? err.message : String(err)
|
|
18260
|
+
});
|
|
18261
|
+
}
|
|
18262
|
+
).finally(() => {
|
|
18263
|
+
if (timer2) clearTimeout(timer2);
|
|
18264
|
+
stops.delete(id);
|
|
18265
|
+
});
|
|
18266
|
+
},
|
|
18267
|
+
stop(sessionId, key) {
|
|
18268
|
+
const controller = stops.get(`${sessionId}\0${key}`);
|
|
18269
|
+
if (controller) controller.abort();
|
|
18270
|
+
else setLive(sessionId, key, null);
|
|
18271
|
+
}
|
|
18272
|
+
};
|
|
18273
|
+
}
|
|
17770
18274
|
function modeForTypedChar(char, mode, bufferEmpty) {
|
|
17771
18275
|
if (mode !== "normal" || !bufferEmpty) {
|
|
17772
18276
|
return null;
|
|
@@ -18133,6 +18637,16 @@ function spawnQueue(events) {
|
|
|
18133
18637
|
}
|
|
18134
18638
|
return { waiting: waiting2, startedAt };
|
|
18135
18639
|
}
|
|
18640
|
+
const progressIds = /* @__PURE__ */ new WeakMap();
|
|
18641
|
+
let nextProgressId = 0;
|
|
18642
|
+
function progressId(progress) {
|
|
18643
|
+
let id = progressIds.get(progress);
|
|
18644
|
+
if (id === void 0) {
|
|
18645
|
+
id = ++nextProgressId;
|
|
18646
|
+
progressIds.set(progress, id);
|
|
18647
|
+
}
|
|
18648
|
+
return id;
|
|
18649
|
+
}
|
|
18136
18650
|
function doneDurationMs(result, since2, workerStart, callStart) {
|
|
18137
18651
|
if (result.durationMs !== void 0) {
|
|
18138
18652
|
return workerStart !== void 0 && callStart !== void 0 ? Math.max(0, result.durationMs - (workerStart - callStart)) : result.durationMs;
|
|
@@ -18154,6 +18668,7 @@ function collapseAll(events, showEditDiffs, isStreaming) {
|
|
|
18154
18668
|
const headOf = new Int32Array(events.length);
|
|
18155
18669
|
const { pairings, consumedResultIndices } = pairToolEvents(events);
|
|
18156
18670
|
const { waiting: waiting2, startedAt: workerStartedAt } = spawnQueue(events);
|
|
18671
|
+
const progressOf = scriptProgressByCall(events);
|
|
18157
18672
|
const mdOrdinals = /* @__PURE__ */ new Map();
|
|
18158
18673
|
const thinkOrdinals = /* @__PURE__ */ new Map();
|
|
18159
18674
|
let promptScope = "@start";
|
|
@@ -18253,6 +18768,8 @@ function collapseAll(events, showEditDiffs, isStreaming) {
|
|
|
18253
18768
|
break;
|
|
18254
18769
|
case "spawn-queued":
|
|
18255
18770
|
break;
|
|
18771
|
+
case "tool-progress":
|
|
18772
|
+
break;
|
|
18256
18773
|
case "spawn-end":
|
|
18257
18774
|
rows2.push(
|
|
18258
18775
|
cachedRow(event, `se-${sid}`, () => ({
|
|
@@ -18314,7 +18831,8 @@ function collapseAll(events, showEditDiffs, isStreaming) {
|
|
|
18314
18831
|
const since2 = workerStart ?? callStart;
|
|
18315
18832
|
const doneMs = paired ? doneDurationMs(paired, since2, workerStart, callStart) : void 0;
|
|
18316
18833
|
const resuming = !paired && event.resuming === true;
|
|
18317
|
-
const
|
|
18834
|
+
const scriptProgress = event.callId ? progressOf.get(scriptProgressKey(event.callId, event.childId)) : void 0;
|
|
18835
|
+
const key = `t-${sid}|${showEditDiffs}|${okCoerced}|${paired ? rowIdFor(paired) : -1}|${paired?.text.length ?? -1}|${paired?.clipped ?? false}|${waitingFor ? "w" : ""}|${since2 ?? ""}|${doneMs ?? ""}|${resuming ? "r" : ""}|${scriptProgress ? progressId(scriptProgress) : ""}`;
|
|
18318
18836
|
rows2.push(
|
|
18319
18837
|
cachedRow(event, key, () => {
|
|
18320
18838
|
const toolName = event.tool ?? "?";
|
|
@@ -18341,6 +18859,7 @@ function collapseAll(events, showEditDiffs, isStreaming) {
|
|
|
18341
18859
|
...paired?.clipped ? { resultClipped: true } : {},
|
|
18342
18860
|
...waitingFor ? { waitingFor } : {},
|
|
18343
18861
|
...resuming ? { resuming: true } : {},
|
|
18862
|
+
...scriptProgress ? { scriptProgress } : {},
|
|
18344
18863
|
...event.approval ? { approval: event.approval } : {},
|
|
18345
18864
|
...event.parentToolCallId ? { parentId: event.parentToolCallId } : {},
|
|
18346
18865
|
...doneMs !== void 0 ? { durationMs: doneMs } : !paired && since2 !== void 0 ? { startedAt: since2 } : {}
|
|
@@ -18519,15 +19038,49 @@ function sameMembers(a, b) {
|
|
|
18519
19038
|
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;
|
|
18520
19039
|
return true;
|
|
18521
19040
|
}
|
|
18522
|
-
|
|
19041
|
+
class IdHold {
|
|
19042
|
+
ids = /* @__PURE__ */ new WeakMap();
|
|
19043
|
+
/**
|
|
19044
|
+
* The id one of `members` was given before, else `fresh`; never one `used` already holds (ids must stay unique in a pass).
|
|
19045
|
+
*
|
|
19046
|
+
* @param members - The aggregate's member rows.
|
|
19047
|
+
* @param fresh - The id read off the aggregate as it is now.
|
|
19048
|
+
* @param used - The ids this pass has given so far; the result is added.
|
|
19049
|
+
*/
|
|
19050
|
+
take(members, fresh, used) {
|
|
19051
|
+
let id;
|
|
19052
|
+
for (const member of members) {
|
|
19053
|
+
const held = this.ids.get(member);
|
|
19054
|
+
if (held !== void 0 && !used.has(held)) {
|
|
19055
|
+
id = held;
|
|
19056
|
+
break;
|
|
19057
|
+
}
|
|
19058
|
+
}
|
|
19059
|
+
if (id === void 0) {
|
|
19060
|
+
id = fresh;
|
|
19061
|
+
for (let n = 2; used.has(id); n++) id = `${fresh}~${n}`;
|
|
19062
|
+
}
|
|
19063
|
+
for (const member of members) this.ids.set(member, id);
|
|
19064
|
+
used.add(id);
|
|
19065
|
+
return id;
|
|
19066
|
+
}
|
|
19067
|
+
}
|
|
19068
|
+
const TOOL_BATCH_IDS = new IdHold();
|
|
19069
|
+
const TOOL_GROUP_IDS = new IdHold();
|
|
19070
|
+
const THINKING_BATCH_IDS = new IdHold();
|
|
19071
|
+
function stableBatch(cache, hold, used, members, membersOf, fresh, build2) {
|
|
18523
19072
|
const hit = cache.get(members[0]);
|
|
18524
|
-
if (hit && sameMembers(membersOf(hit), members)
|
|
18525
|
-
|
|
19073
|
+
if (hit && sameMembers(membersOf(hit), members) && !used.has(hit.id)) {
|
|
19074
|
+
used.add(hit.id);
|
|
19075
|
+
return hit;
|
|
19076
|
+
}
|
|
19077
|
+
const next2 = build2(hold.take(members, fresh, used));
|
|
18526
19078
|
cache.set(members[0], next2);
|
|
18527
19079
|
return next2;
|
|
18528
19080
|
}
|
|
18529
19081
|
function liftExchangeToolGroups(rows2) {
|
|
18530
19082
|
const out = [...rows2];
|
|
19083
|
+
const used = /* @__PURE__ */ new Set();
|
|
18531
19084
|
let exchange = [];
|
|
18532
19085
|
const flush = () => {
|
|
18533
19086
|
if (exchange.length >= 2) {
|
|
@@ -18535,12 +19088,15 @@ function liftExchangeToolGroups(rows2) {
|
|
|
18535
19088
|
const first = tools[0];
|
|
18536
19089
|
out[exchange[0]] = stableBatch(
|
|
18537
19090
|
TOOL_GROUP_CACHE,
|
|
19091
|
+
TOOL_GROUP_IDS,
|
|
19092
|
+
used,
|
|
18538
19093
|
tools,
|
|
18539
19094
|
(row) => row.tools,
|
|
18540
|
-
|
|
19095
|
+
`tg-${first.id}`,
|
|
19096
|
+
(id) => ({
|
|
18541
19097
|
...first.turnId !== void 0 ? { turnId: first.turnId } : {},
|
|
18542
19098
|
kind: "tool-batch",
|
|
18543
|
-
id
|
|
19099
|
+
id,
|
|
18544
19100
|
summary: summarizeToolBatch(tools),
|
|
18545
19101
|
tools
|
|
18546
19102
|
})
|
|
@@ -18567,6 +19123,7 @@ function liftExchangeToolGroups(rows2) {
|
|
|
18567
19123
|
function batchToolRuns(rows2, groupToolCalls = false) {
|
|
18568
19124
|
const pre = groupToolCalls ? liftExchangeToolGroups(rows2) : rows2;
|
|
18569
19125
|
const out = [];
|
|
19126
|
+
const used = /* @__PURE__ */ new Set();
|
|
18570
19127
|
let run = [];
|
|
18571
19128
|
const flush = () => {
|
|
18572
19129
|
if (run.length === 0) {
|
|
@@ -18576,7 +19133,7 @@ function batchToolRuns(rows2, groupToolCalls = false) {
|
|
|
18576
19133
|
out.push(run[0]);
|
|
18577
19134
|
} else {
|
|
18578
19135
|
const first = run[0];
|
|
18579
|
-
const
|
|
19136
|
+
const fresh = `tb-${first.id}`;
|
|
18580
19137
|
const owned = {};
|
|
18581
19138
|
if (first.childId !== void 0) {
|
|
18582
19139
|
owned.childId = first.childId;
|
|
@@ -18591,9 +19148,12 @@ function batchToolRuns(rows2, groupToolCalls = false) {
|
|
|
18591
19148
|
out.push(
|
|
18592
19149
|
stableBatch(
|
|
18593
19150
|
TOOL_BATCH_CACHE,
|
|
19151
|
+
TOOL_BATCH_IDS,
|
|
19152
|
+
used,
|
|
18594
19153
|
tools,
|
|
18595
19154
|
(row) => row.tools,
|
|
18596
|
-
|
|
19155
|
+
fresh,
|
|
19156
|
+
(id) => ({ ...owned, kind: "tool-batch", id, summary: summarizeToolBatch(tools), tools })
|
|
18597
19157
|
)
|
|
18598
19158
|
);
|
|
18599
19159
|
}
|
|
@@ -18618,6 +19178,7 @@ function batchToolRuns(rows2, groupToolCalls = false) {
|
|
|
18618
19178
|
const THINKING_CHAIN_TRANSPARENT = /* @__PURE__ */ new Set(["tool", "tool-batch"]);
|
|
18619
19179
|
function batchThinkingRuns(rows2) {
|
|
18620
19180
|
const out = [];
|
|
19181
|
+
const used = /* @__PURE__ */ new Set();
|
|
18621
19182
|
let chain = [];
|
|
18622
19183
|
let deferred = [];
|
|
18623
19184
|
const flush = () => {
|
|
@@ -18638,12 +19199,15 @@ function batchThinkingRuns(rows2) {
|
|
|
18638
19199
|
out.push(
|
|
18639
19200
|
stableBatch(
|
|
18640
19201
|
THINKING_BATCH_CACHE,
|
|
19202
|
+
THINKING_BATCH_IDS,
|
|
19203
|
+
used,
|
|
18641
19204
|
thoughts,
|
|
18642
19205
|
(row) => row.thoughts,
|
|
18643
|
-
|
|
19206
|
+
`kb-${first.id}`,
|
|
19207
|
+
(id) => ({
|
|
18644
19208
|
...owned,
|
|
18645
19209
|
kind: "thinking-batch",
|
|
18646
|
-
id
|
|
19210
|
+
id,
|
|
18647
19211
|
thoughts,
|
|
18648
19212
|
...totalMs > 0 ? { totalMs } : {}
|
|
18649
19213
|
})
|
|
@@ -18874,6 +19438,17 @@ function foldsInCompact(row) {
|
|
|
18874
19438
|
depth: owned.depth
|
|
18875
19439
|
});
|
|
18876
19440
|
}
|
|
19441
|
+
const FOLD_IDS = new IdHold();
|
|
19442
|
+
const MESSAGE_GROUP_IDS = new IdHold();
|
|
19443
|
+
function foldMembers(boundary, folded) {
|
|
19444
|
+
const members = boundary ? [boundary] : [];
|
|
19445
|
+
for (const row of folded) {
|
|
19446
|
+
if (row.kind === "tool-batch") members.push(...row.tools);
|
|
19447
|
+
else if (row.kind === "thinking-batch") members.push(...row.thoughts);
|
|
19448
|
+
else members.push(row);
|
|
19449
|
+
}
|
|
19450
|
+
return members;
|
|
19451
|
+
}
|
|
18877
19452
|
function foldAnchorId(row) {
|
|
18878
19453
|
switch (row.kind) {
|
|
18879
19454
|
case "tool-batch":
|
|
@@ -18895,6 +19470,7 @@ function rowStats(stats) {
|
|
|
18895
19470
|
}
|
|
18896
19471
|
function foldExchanges(rows2, isStreaming) {
|
|
18897
19472
|
const out = [];
|
|
19473
|
+
const used = /* @__PURE__ */ new Set();
|
|
18898
19474
|
let boundary = null;
|
|
18899
19475
|
let folded = [];
|
|
18900
19476
|
let visible = [];
|
|
@@ -18908,17 +19484,18 @@ function foldExchanges(rows2, isStreaming) {
|
|
|
18908
19484
|
if (turnSource && turnSource.kind !== "separator" && turnSource.kind !== "compact-summary" && turnSource.turnId) {
|
|
18909
19485
|
owned.turnId = turnSource.turnId;
|
|
18910
19486
|
}
|
|
18911
|
-
const id = `xf-${boundary ? boundary.id : foldAnchorId(anchor)}`;
|
|
18912
19487
|
const key = boundary ?? folded[0];
|
|
18913
19488
|
const hit = FOLD_CACHE.get(key);
|
|
18914
|
-
if (hit && hit.kind === "exchange-fold" && hit.
|
|
19489
|
+
if (hit && hit.kind === "exchange-fold" && hit.live === live && sameMembers(hit.rows, folded) && !used.has(hit.id)) {
|
|
19490
|
+
used.add(hit.id);
|
|
18915
19491
|
out.push(hit);
|
|
18916
19492
|
} else {
|
|
19493
|
+
const fresh = `xf-${boundary ? boundary.id : foldAnchorId(anchor)}`;
|
|
18917
19494
|
const plan = planFold(foldUnits(folded));
|
|
18918
19495
|
const row = {
|
|
18919
19496
|
...owned,
|
|
18920
19497
|
kind: "exchange-fold",
|
|
18921
|
-
id,
|
|
19498
|
+
id: FOLD_IDS.take(foldMembers(boundary, folded), fresh, used),
|
|
18922
19499
|
rows: folded,
|
|
18923
19500
|
live,
|
|
18924
19501
|
stats: rowStats(plan.stats),
|
|
@@ -18929,7 +19506,7 @@ function foldExchanges(rows2, isStreaming) {
|
|
|
18929
19506
|
out.push(row);
|
|
18930
19507
|
}
|
|
18931
19508
|
}
|
|
18932
|
-
out.push(...groupMessages(visible, boundary, live));
|
|
19509
|
+
out.push(...groupMessages(visible, boundary, live, used));
|
|
18933
19510
|
folded = [];
|
|
18934
19511
|
visible = [];
|
|
18935
19512
|
};
|
|
@@ -18968,18 +19545,20 @@ function foldWorkerRows(rows2, owner, live) {
|
|
|
18968
19545
|
}
|
|
18969
19546
|
const MESSAGE_GROUP_CACHE = /* @__PURE__ */ new WeakMap();
|
|
18970
19547
|
const isOwnMessage = (row) => row.kind === "markdown" && !("childId" in row && row.childId) && !(("depth" in row ? row.depth : 0) ?? 0);
|
|
18971
|
-
function groupMessages(visible, boundary, live) {
|
|
19548
|
+
function groupMessages(visible, boundary, live, used) {
|
|
18972
19549
|
const messages = visible.filter(isOwnMessage);
|
|
18973
19550
|
if (messages.length === 0) return [...visible];
|
|
18974
19551
|
const earlier = messages.slice(0, -1);
|
|
18975
19552
|
const current = messages[messages.length - 1];
|
|
18976
19553
|
const key = boundary ?? messages[0];
|
|
18977
|
-
const id = `mg-${boundary ? boundary.id : messages[0].id}`;
|
|
18978
19554
|
const hit = MESSAGE_GROUP_CACHE.get(key);
|
|
18979
19555
|
let group;
|
|
18980
|
-
if (hit && hit.kind === "message-group" && hit.
|
|
19556
|
+
if (hit && hit.kind === "message-group" && hit.live === live && hit.current === current && sameMembers(hit.messages, earlier) && !used.has(hit.id)) {
|
|
19557
|
+
used.add(hit.id);
|
|
18981
19558
|
group = hit;
|
|
18982
19559
|
} else {
|
|
19560
|
+
const fresh = `mg-${boundary ? boundary.id : messages[0].id}`;
|
|
19561
|
+
const id = MESSAGE_GROUP_IDS.take(boundary ? [boundary, ...messages] : messages, fresh, used);
|
|
18983
19562
|
const first = messages[0];
|
|
18984
19563
|
group = {
|
|
18985
19564
|
..."turnId" in first && first.turnId ? { turnId: first.turnId } : {},
|
|
@@ -19365,6 +19944,7 @@ function closeThinkingSegment(events, owner, now = Date.now()) {
|
|
|
19365
19944
|
return events;
|
|
19366
19945
|
}
|
|
19367
19946
|
function applyLiveEvent(events, event, now = Date.now(), markdown) {
|
|
19947
|
+
if (event.kind === "tool-progress") return upsertToolProgress(events, event);
|
|
19368
19948
|
const owner = ownerOf(event);
|
|
19369
19949
|
if (event.kind === "thinking") {
|
|
19370
19950
|
return timed(
|
|
@@ -23649,7 +24229,8 @@ const INTERFACE = {
|
|
|
23649
24229
|
{ key: "showToolAttachments" },
|
|
23650
24230
|
{ key: "groupToolCalls" },
|
|
23651
24231
|
{ key: "showFullShellOutput" },
|
|
23652
|
-
{ key: "codemodeShowCalls" }
|
|
24232
|
+
{ key: "codemodeShowCalls" },
|
|
24233
|
+
{ key: "codemodeStreamProgress" }
|
|
23653
24234
|
]
|
|
23654
24235
|
},
|
|
23655
24236
|
{ title: "Streaming", rows: [{ key: "smoothStreaming" }, { key: "showThrobber" }] },
|
|
@@ -24369,6 +24950,7 @@ function SettingsShell({
|
|
|
24369
24950
|
const frame2 = {
|
|
24370
24951
|
title: active2?.title ?? "",
|
|
24371
24952
|
...active2?.description !== void 0 ? { description: active2.description } : {},
|
|
24953
|
+
...active2?.lead !== void 0 ? { lead: active2.lead } : {},
|
|
24372
24954
|
search,
|
|
24373
24955
|
nav,
|
|
24374
24956
|
footer,
|
|
@@ -24391,6 +24973,7 @@ function SectionScope({
|
|
|
24391
24973
|
function SettingsFrame({
|
|
24392
24974
|
title,
|
|
24393
24975
|
description,
|
|
24976
|
+
lead,
|
|
24394
24977
|
search,
|
|
24395
24978
|
nav,
|
|
24396
24979
|
footer,
|
|
@@ -24421,9 +25004,12 @@ function SettingsFrame({
|
|
|
24421
25004
|
] }),
|
|
24422
25005
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0 min-h-0 flex flex-col", children: [
|
|
24423
25006
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "shrink-0 flex items-end gap-3 px-6 pt-4 pb-3 border-b border-[var(--zg-hairline)]", children: [
|
|
24424
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
24425
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("
|
|
24426
|
-
|
|
25007
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0 flex items-center gap-2.5", children: [
|
|
25008
|
+
lead && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "shrink-0 flex", children: lead }),
|
|
25009
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
25010
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-sm font-semibold leading-tight text-[var(--zg-text)] m-0 zg-balance", children: title }),
|
|
25011
|
+
description && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs leading-tight text-[var(--zg-text-muted)] mt-0.5 m-0 truncate", children: description })
|
|
25012
|
+
] })
|
|
24427
25013
|
] }),
|
|
24428
25014
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-2 shrink-0 pb-0.5", children: headerActions })
|
|
24429
25015
|
] }),
|
|
@@ -28707,7 +29293,7 @@ function ExtensionActions({
|
|
|
28707
29293
|
}
|
|
28708
29294
|
),
|
|
28709
29295
|
hasMenu && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
28710
|
-
RowActionsMenu$
|
|
29296
|
+
RowActionsMenu$2,
|
|
28711
29297
|
{
|
|
28712
29298
|
open: menu !== null,
|
|
28713
29299
|
anchorRef: arrow,
|
|
@@ -29121,7 +29707,7 @@ const DEFAULT_SKILLS_SECTION_LABELS = {
|
|
|
29121
29707
|
skillsSectionSaveFailed: (reason) => `Couldn't save: ${reason}`,
|
|
29122
29708
|
skillsSectionUnmatched: (source) => `The installer cannot match the picked skills in ${source}.`
|
|
29123
29709
|
};
|
|
29124
|
-
const CodeEditor = reactExports.lazy(() => __vitePreload(() => import("./CodeEditor-
|
|
29710
|
+
const CodeEditor = reactExports.lazy(() => __vitePreload(() => import("./CodeEditor-80QT2Pyq.js").then((n) => n.a), true ? __vite__mapDeps([7,5,8,9,3,4,6,10,11,12]) : void 0, import.meta.url).then((m2) => ({ default: m2.CodeEditor })));
|
|
29125
29711
|
function useSkillsSectionLabels() {
|
|
29126
29712
|
return useSectionLabels(DEFAULT_SKILLS_SECTION_LABELS);
|
|
29127
29713
|
}
|
|
@@ -36864,7 +37450,7 @@ function toolRowPropsEqual(prev, next2) {
|
|
|
36864
37450
|
}
|
|
36865
37451
|
const a = prev.tool;
|
|
36866
37452
|
const b = next2.tool;
|
|
36867
|
-
return a.name === b.name && a.displayName === b.displayName && a.result === b.result && a.ok === b.ok && a.edit === b.edit && a.rawInput === b.rawInput && a.resultClipped === b.resultClipped && a.callId === b.callId && a.startedAt === b.startedAt && a.durationMs === b.durationMs && a.waitingFor === b.waitingFor && a.resuming === b.resuming && a.approval === b.approval && formattedEqual(a.formatted, b.formatted);
|
|
37453
|
+
return a.name === b.name && a.displayName === b.displayName && a.result === b.result && a.ok === b.ok && a.edit === b.edit && a.rawInput === b.rawInput && a.resultClipped === b.resultClipped && a.callId === b.callId && a.startedAt === b.startedAt && a.durationMs === b.durationMs && a.waitingFor === b.waitingFor && a.resuming === b.resuming && a.scriptProgress === b.scriptProgress && a.approval === b.approval && formattedEqual(a.formatted, b.formatted);
|
|
36868
37454
|
}
|
|
36869
37455
|
function formattedEqual(a, b) {
|
|
36870
37456
|
if (a === b) {
|
|
@@ -36963,8 +37549,35 @@ const ToolRow = reactExports.memo(({ tool, mode, showResult, showDiff, lineState
|
|
|
36963
37549
|
const showInputPanel = mode === "formatted" && hasInput && !interaction;
|
|
36964
37550
|
const hasOutput = tool.result !== null && !interaction;
|
|
36965
37551
|
const showOutputPanel = hasOutput && (showResult || revealOutput);
|
|
37552
|
+
const scriptInline = showInputPanel && tool.name === "codemode" && tool.scriptProgress !== void 0;
|
|
36966
37553
|
const hasExpandable = interaction || showInputPanel || hasOutput || mode === "full" && tool.rawInput || hasDiff;
|
|
36967
37554
|
const sweep = lineState === "running" && !tool.waitingFor;
|
|
37555
|
+
const outputBody = showOutputPanel ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
37556
|
+
bodyMounted && canLoadFull && tool.resultClipped && typeof fullResult !== "string" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37557
|
+
LoadFullOutputButton,
|
|
37558
|
+
{
|
|
37559
|
+
loading: fullResult === "loading",
|
|
37560
|
+
disabled: !fullReady,
|
|
37561
|
+
onClick: loadFullResult,
|
|
37562
|
+
className: "mt-1.5"
|
|
37563
|
+
}
|
|
37564
|
+
),
|
|
37565
|
+
!bodyMounted ? null : media ? (
|
|
37566
|
+
// An image the call read, or a screenshot it took: the media itself, then any text around it.
|
|
37567
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-1.5 flex flex-col gap-1.5", children: [
|
|
37568
|
+
(!drawsImageGeneration(tool) || tool.ok === false) && /* @__PURE__ */ jsxRuntimeExports.jsx(ToolMedia, { media: media.media, url: media.url }),
|
|
37569
|
+
tool.name !== "read_file" && media.rest !== "" && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: CODE_PANEL, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AnsiText, { text: media.rest }) })
|
|
37570
|
+
] })
|
|
37571
|
+
) : tool.name === "read_file" ? (
|
|
37572
|
+
/*
|
|
37573
|
+
* Render `read_file` results as a syntax-highlighted code
|
|
37574
|
+
* block — the `CodeBlock` slot the assistant's fenced
|
|
37575
|
+
* markdown uses. Language is inferred from the file
|
|
37576
|
+
* extension; unknown extensions fall through to plaintext.
|
|
37577
|
+
*/
|
|
37578
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ReadFileBlock, { tool, output: typeof fullResult === "string" ? fullResult : tool.result ?? "" })
|
|
37579
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: `${CODE_PANEL} mt-1.5`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AnsiText, { text: (typeof fullResult === "string" ? fullResult : tool.result) ?? "" }) })
|
|
37580
|
+
] }) : null;
|
|
36968
37581
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: ["text-xs", className].filter(Boolean).join(" "), style, children: [
|
|
36969
37582
|
mode !== "hidden" && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
36970
37583
|
"button",
|
|
@@ -37013,12 +37626,14 @@ const ToolRow = reactExports.memo(({ tool, mode, showResult, showDiff, lineState
|
|
|
37013
37626
|
]
|
|
37014
37627
|
}
|
|
37015
37628
|
) : tool.ok === null && tool.startedAt !== void 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
37629
|
+
tool.scriptProgress && /* @__PURE__ */ jsxRuntimeExports.jsx(ScriptProgressChips, { tool }),
|
|
37016
37630
|
tool.resuming && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "data-testid": "tool-resuming", className: "zg-meta shrink-0", children: labels.stepResuming }),
|
|
37017
37631
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ToolTiming, { startedAt: tool.startedAt, running: true })
|
|
37018
37632
|
] }) : tool.durationMs !== void 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(ToolTiming, { durationMs: tool.durationMs }) : null,
|
|
37019
37633
|
lineState === "failed" && /* @__PURE__ */ jsxRuntimeExports.jsx(FailedMark, {}),
|
|
37020
37634
|
hasExpandable ? /* @__PURE__ */ jsxRuntimeExports.jsx(Caret$1, { open, className: "self-center" }) : null
|
|
37021
37635
|
] }),
|
|
37636
|
+
tool.ok === null && tool.scriptProgress && /* @__PURE__ */ jsxRuntimeExports.jsx(ScriptProgressBar, { tool }),
|
|
37022
37637
|
mode === "formatted" && tool.formatted?.detail && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-line-clamp-2 mt-0.5 text-[var(--zg-text-muted)]", children: tool.formatted.detail })
|
|
37023
37638
|
]
|
|
37024
37639
|
}
|
|
@@ -37027,8 +37642,16 @@ const ToolRow = reactExports.memo(({ tool, mode, showResult, showDiff, lineState
|
|
|
37027
37642
|
hasDiff && tool.edit && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible", "data-open": open, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible-inner", children: bodyMounted && /* @__PURE__ */ jsxRuntimeExports.jsx(EditDiffBlock, { edit: tool.edit }) }) }),
|
|
37028
37643
|
interaction && ToolBody && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible", "data-open": open, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible-inner", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pt-2 pb-1", children: bodyMounted && /* @__PURE__ */ jsxRuntimeExports.jsx(ToolBody, { tool }) }) }) }),
|
|
37029
37644
|
showInputPanel && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible", "data-open": open, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible-inner", children: bodyMounted && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
37030
|
-
showOutputPanel && /* @__PURE__ */ jsxRuntimeExports.jsx(PanelCaption, { children: labels.inputCaption }),
|
|
37031
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37645
|
+
showOutputPanel && !scriptInline && /* @__PURE__ */ jsxRuntimeExports.jsx(PanelCaption, { children: labels.inputCaption }),
|
|
37646
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37647
|
+
ToolInput,
|
|
37648
|
+
{
|
|
37649
|
+
name: tool.name,
|
|
37650
|
+
input: tool.rawInput,
|
|
37651
|
+
...scriptInputProps(tool),
|
|
37652
|
+
...scriptInline && outputBody ? { output: outputBody } : {}
|
|
37653
|
+
}
|
|
37654
|
+
)
|
|
37032
37655
|
] }) }) }),
|
|
37033
37656
|
hasOutput && !showOutputPanel && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible", "data-open": open, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible-inner", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37034
37657
|
"button",
|
|
@@ -37039,36 +37662,47 @@ const ToolRow = reactExports.memo(({ tool, mode, showResult, showDiff, lineState
|
|
|
37039
37662
|
children: labels.showOutput
|
|
37040
37663
|
}
|
|
37041
37664
|
) }) }),
|
|
37042
|
-
showOutputPanel && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible", "data-open": open, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "zg-collapsible-inner", children: [
|
|
37665
|
+
showOutputPanel && !scriptInline && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible", "data-open": open, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "zg-collapsible-inner", children: [
|
|
37043
37666
|
bodyMounted && showInputPanel && /* @__PURE__ */ jsxRuntimeExports.jsx(PanelCaption, { children: labels.outputCaption }),
|
|
37044
|
-
|
|
37045
|
-
LoadFullOutputButton,
|
|
37046
|
-
{
|
|
37047
|
-
loading: fullResult === "loading",
|
|
37048
|
-
disabled: !fullReady,
|
|
37049
|
-
onClick: loadFullResult,
|
|
37050
|
-
className: "mt-1.5"
|
|
37051
|
-
}
|
|
37052
|
-
),
|
|
37053
|
-
!bodyMounted ? null : media ? (
|
|
37054
|
-
// An image the call read, or a screenshot it took: the media itself, then any text around it.
|
|
37055
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-1.5 flex flex-col gap-1.5", children: [
|
|
37056
|
-
(!drawsImageGeneration(tool) || tool.ok === false) && /* @__PURE__ */ jsxRuntimeExports.jsx(ToolMedia, { media: media.media, url: media.url }),
|
|
37057
|
-
tool.name !== "read_file" && media.rest !== "" && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: CODE_PANEL, children: media.rest })
|
|
37058
|
-
] })
|
|
37059
|
-
) : tool.name === "read_file" ? (
|
|
37060
|
-
/*
|
|
37061
|
-
* Render `read_file` results as a syntax-highlighted code
|
|
37062
|
-
* block — the `CodeBlock` slot the assistant's fenced
|
|
37063
|
-
* markdown uses. Language is inferred from the file
|
|
37064
|
-
* extension; unknown extensions fall through to plaintext.
|
|
37065
|
-
*/
|
|
37066
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ReadFileBlock, { tool, output: typeof fullResult === "string" ? fullResult : tool.result ?? "" })
|
|
37067
|
-
) : /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: `${CODE_PANEL} mt-1.5`, children: typeof fullResult === "string" ? fullResult : tool.result })
|
|
37667
|
+
outputBody
|
|
37068
37668
|
] }) }),
|
|
37069
|
-
mode === "full" && tool.rawInput && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible", "data-open": open, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible-inner", children: bodyMounted && /* @__PURE__ */ jsxRuntimeExports.jsx(ToolInput, { name: tool.name, input: tool.rawInput }) }) })
|
|
37669
|
+
mode === "full" && tool.rawInput && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible", "data-open": open, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible-inner", children: bodyMounted && /* @__PURE__ */ jsxRuntimeExports.jsx(ToolInput, { name: tool.name, input: tool.rawInput, ...scriptInputProps(tool) }) }) })
|
|
37070
37670
|
] });
|
|
37071
37671
|
}, toolRowPropsEqual);
|
|
37672
|
+
function useScriptView(tool) {
|
|
37673
|
+
const code = typeof tool.rawInput?.code === "string" ? tool.rawInput.code : "";
|
|
37674
|
+
return reactExports.useMemo(() => scriptProgressView(code, tool.scriptProgress, false), [code, tool.scriptProgress]);
|
|
37675
|
+
}
|
|
37676
|
+
function ScriptProgressChips({ tool }) {
|
|
37677
|
+
const labels = useChatLabels();
|
|
37678
|
+
const view = useScriptView(tool);
|
|
37679
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "zg-meta shrink-0 self-center inline-flex items-center gap-1", "data-testid": "script-progress", children: [
|
|
37680
|
+
view.total !== void 0 && view.percent !== void 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
37681
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta-chip", children: labels.scriptCallsOf(view.done, view.total) }),
|
|
37682
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta-chip", children: labels.scriptPercent(view.percent) })
|
|
37683
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
37684
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta-chip", children: labels.scriptCallsDone(view.done) }),
|
|
37685
|
+
view.running > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta-chip", children: labels.scriptCallsRunning(view.running) })
|
|
37686
|
+
] }),
|
|
37687
|
+
view.failed > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta-chip text-zg-danger", children: labels.scriptCallsFailed(view.failed) })
|
|
37688
|
+
] });
|
|
37689
|
+
}
|
|
37690
|
+
function ScriptProgressBar({ tool }) {
|
|
37691
|
+
const labels = useChatLabels();
|
|
37692
|
+
const view = useScriptView(tool);
|
|
37693
|
+
const exact = view.percent !== void 0;
|
|
37694
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37695
|
+
"span",
|
|
37696
|
+
{
|
|
37697
|
+
role: "progressbar",
|
|
37698
|
+
"aria-label": labels.scriptProgress,
|
|
37699
|
+
...exact ? { "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": view.percent } : {},
|
|
37700
|
+
className: "zg-script-bar",
|
|
37701
|
+
"data-indeterminate": exact ? void 0 : "",
|
|
37702
|
+
style: exact ? { "--zg-script-progress": `${view.percent}%` } : void 0
|
|
37703
|
+
}
|
|
37704
|
+
);
|
|
37705
|
+
}
|
|
37072
37706
|
function PanelCaption({ children }) {
|
|
37073
37707
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-section-label mt-2", children });
|
|
37074
37708
|
}
|
|
@@ -38331,6 +38965,320 @@ function CompactSummaryRow({ text, meta, className, style }) {
|
|
|
38331
38965
|
}
|
|
38332
38966
|
);
|
|
38333
38967
|
}
|
|
38968
|
+
const composerScopes = /* @__PURE__ */ new Map();
|
|
38969
|
+
const scopeListeners = /* @__PURE__ */ new Set();
|
|
38970
|
+
function scopesChanged() {
|
|
38971
|
+
for (const l of scopeListeners) l();
|
|
38972
|
+
}
|
|
38973
|
+
const NO_SCOPE = "\0none";
|
|
38974
|
+
function registerComposerScope(scopeKey) {
|
|
38975
|
+
scopeKey ??= NO_SCOPE;
|
|
38976
|
+
composerScopes.set(scopeKey, (composerScopes.get(scopeKey) ?? 0) + 1);
|
|
38977
|
+
scopesChanged();
|
|
38978
|
+
let done = false;
|
|
38979
|
+
return () => {
|
|
38980
|
+
if (done) return;
|
|
38981
|
+
done = true;
|
|
38982
|
+
const n = (composerScopes.get(scopeKey) ?? 1) - 1;
|
|
38983
|
+
if (n > 0) composerScopes.set(scopeKey, n);
|
|
38984
|
+
else composerScopes.delete(scopeKey);
|
|
38985
|
+
scopesChanged();
|
|
38986
|
+
};
|
|
38987
|
+
}
|
|
38988
|
+
function hasComposerFor(scopeKey) {
|
|
38989
|
+
return typeof scopeKey === "string" && scopeKey !== NO_SCOPE && composerScopes.has(scopeKey);
|
|
38990
|
+
}
|
|
38991
|
+
function subscribeScopes(l) {
|
|
38992
|
+
scopeListeners.add(l);
|
|
38993
|
+
return () => scopeListeners.delete(l);
|
|
38994
|
+
}
|
|
38995
|
+
function useComposerFor(scopeKey) {
|
|
38996
|
+
const get = reactExports.useCallback(() => hasComposerFor(scopeKey), [scopeKey]);
|
|
38997
|
+
const has = reactExports.useSyncExternalStore(subscribeScopes, get, get);
|
|
38998
|
+
return reactExports.useMemo(() => has && scopeKey !== null ? { scopeKey } : null, [has, scopeKey]);
|
|
38999
|
+
}
|
|
39000
|
+
function hasFocusedComposer() {
|
|
39001
|
+
return focusedClaim !== null;
|
|
39002
|
+
}
|
|
39003
|
+
function isFocusedComposer(scopeKey) {
|
|
39004
|
+
return focusedClaim !== null && focusedClaim.scopeKey === (scopeKey ?? NO_SCOPE);
|
|
39005
|
+
}
|
|
39006
|
+
function useHasFocusedComposer() {
|
|
39007
|
+
return reactExports.useSyncExternalStore(subscribeScopes, hasFocusedComposer, hasFocusedComposer);
|
|
39008
|
+
}
|
|
39009
|
+
let focusedClaim = null;
|
|
39010
|
+
function claimComposerFocus(scopeKey) {
|
|
39011
|
+
const claim = { scopeKey: scopeKey ?? NO_SCOPE };
|
|
39012
|
+
focusedClaim = claim;
|
|
39013
|
+
scopesChanged();
|
|
39014
|
+
return () => {
|
|
39015
|
+
if (focusedClaim !== claim) return;
|
|
39016
|
+
focusedClaim = null;
|
|
39017
|
+
scopesChanged();
|
|
39018
|
+
};
|
|
39019
|
+
}
|
|
39020
|
+
function dispatch(type, payload, target) {
|
|
39021
|
+
const scopeKey = target?.scopeKey ?? focusedClaim?.scopeKey;
|
|
39022
|
+
window.dispatchEvent(new CustomEvent(type, { detail: { payload, scopeKey } }));
|
|
39023
|
+
}
|
|
39024
|
+
function listen(type, scopeKey, handler) {
|
|
39025
|
+
const own2 = scopeKey ?? NO_SCOPE;
|
|
39026
|
+
const listener = (e) => {
|
|
39027
|
+
const detail = e.detail;
|
|
39028
|
+
if (detail.scopeKey === own2) handler(detail.payload);
|
|
39029
|
+
};
|
|
39030
|
+
window.addEventListener(type, listener);
|
|
39031
|
+
return () => window.removeEventListener(type, listener);
|
|
39032
|
+
}
|
|
39033
|
+
const EVENT = "zg:composer:attach";
|
|
39034
|
+
const MENTION_EVENT = "zg:composer:mention";
|
|
39035
|
+
function pushComposerAttachment(attachment, target) {
|
|
39036
|
+
dispatch(EVENT, attachment, target);
|
|
39037
|
+
}
|
|
39038
|
+
function onComposerAttachment(scopeKey, handler) {
|
|
39039
|
+
return listen(EVENT, scopeKey, handler);
|
|
39040
|
+
}
|
|
39041
|
+
function pushComposerMention(path, target) {
|
|
39042
|
+
dispatch(MENTION_EVENT, path, target);
|
|
39043
|
+
}
|
|
39044
|
+
function onComposerMention(scopeKey, handler) {
|
|
39045
|
+
return listen(MENTION_EVENT, scopeKey, handler);
|
|
39046
|
+
}
|
|
39047
|
+
const INSERT_EVENT = "zg:composer:insert";
|
|
39048
|
+
const PROMPT_EVENT = "zg:composer:prompt";
|
|
39049
|
+
const DRAFT_EVENT = "zg:composer:draft";
|
|
39050
|
+
function pushComposerInsert(text, target) {
|
|
39051
|
+
dispatch(INSERT_EVENT, text, target);
|
|
39052
|
+
}
|
|
39053
|
+
function onComposerInsert(scopeKey, handler) {
|
|
39054
|
+
return listen(INSERT_EVENT, scopeKey, handler);
|
|
39055
|
+
}
|
|
39056
|
+
const FOCUS_EVENT = "zg:composer:focus";
|
|
39057
|
+
function focusComposer(target) {
|
|
39058
|
+
dispatch(FOCUS_EVENT, void 0, target);
|
|
39059
|
+
}
|
|
39060
|
+
function onComposerFocus(scopeKey, handler) {
|
|
39061
|
+
return listen(FOCUS_EVENT, scopeKey, () => handler());
|
|
39062
|
+
}
|
|
39063
|
+
function pushComposerPrompt(text, target) {
|
|
39064
|
+
dispatch(PROMPT_EVENT, text, target);
|
|
39065
|
+
}
|
|
39066
|
+
function onComposerPrompt(scopeKey, handler) {
|
|
39067
|
+
return listen(PROMPT_EVENT, scopeKey, handler);
|
|
39068
|
+
}
|
|
39069
|
+
function pushComposerDraft({ scopeKey, text, attachments }) {
|
|
39070
|
+
dispatch(DRAFT_EVENT, { text, attachments }, { scopeKey });
|
|
39071
|
+
}
|
|
39072
|
+
function onComposerDraft(scopeKey, handler) {
|
|
39073
|
+
return listen(DRAFT_EVENT, scopeKey, handler);
|
|
39074
|
+
}
|
|
39075
|
+
function textAttachment(name, text) {
|
|
39076
|
+
const bytes = new TextEncoder().encode(text);
|
|
39077
|
+
let binary = "";
|
|
39078
|
+
for (const b of bytes) binary += String.fromCharCode(b);
|
|
39079
|
+
return {
|
|
39080
|
+
id: `att-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`,
|
|
39081
|
+
name,
|
|
39082
|
+
mediaType: "text/markdown",
|
|
39083
|
+
size: bytes.length,
|
|
39084
|
+
dataUrl: `data:text/markdown;base64,${btoa(binary)}`
|
|
39085
|
+
};
|
|
39086
|
+
}
|
|
39087
|
+
const RowActionsMenu = reactExports.lazy(
|
|
39088
|
+
() => __vitePreload(() => Promise.resolve().then(() => RowActionsMenu$3), true ? void 0 : void 0, import.meta.url).then((m2) => ({ default: m2.RowActionsMenu }))
|
|
39089
|
+
);
|
|
39090
|
+
function ShellBlockProvider({ sessionId, turnId, children }) {
|
|
39091
|
+
const runner = reactExports.useMemo(() => ({ scope: { sessionId, turnId }, Block: RunnableCodeBlock }), [sessionId, turnId]);
|
|
39092
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ShellBlockContext.Provider, { value: runner, children });
|
|
39093
|
+
}
|
|
39094
|
+
const NO_RUNS = constant({});
|
|
39095
|
+
const NO_LIVE = constant({});
|
|
39096
|
+
function RunnableCodeBlock({ code, language, scope, CodeBlock }) {
|
|
39097
|
+
const blocks = useOptionalChatHost()?.blockRuns;
|
|
39098
|
+
const { runInTerminal } = useTranscriptActions();
|
|
39099
|
+
const labels = useChatLabels();
|
|
39100
|
+
const plan = reactExports.useMemo(() => shellBlockPlan(code, language), [code, language]);
|
|
39101
|
+
const key = reactExports.useMemo(() => blockRunKey(scope.turnId, code), [scope.turnId, code]);
|
|
39102
|
+
const saved = useReadable(blocks ? blocks.runs(scope.sessionId) : NO_RUNS)[key];
|
|
39103
|
+
const live = useReadable(blocks ? blocks.live(scope.sessionId) : NO_LIVE)[key];
|
|
39104
|
+
const caretRef = reactExports.useRef(null);
|
|
39105
|
+
const [menuOpen, setMenuOpen] = reactExports.useState(false);
|
|
39106
|
+
const [menuArmed, setMenuArmed] = reactExports.useState(false);
|
|
39107
|
+
if (!plan || !blocks && !runInTerminal) return /* @__PURE__ */ jsxRuntimeExports.jsx(CodeBlock, { code, language });
|
|
39108
|
+
const runHere = blocks ? () => blocks.start(scope.sessionId, { turnId: scope.turnId, code, language }) : void 0;
|
|
39109
|
+
const inTerminal = runInTerminal ? () => runInTerminal(blockTerminalInput(plan)) : void 0;
|
|
39110
|
+
const running2 = live !== void 0 && live.error === void 0;
|
|
39111
|
+
const stop = () => blocks?.stop(scope.sessionId, key);
|
|
39112
|
+
const menu = [
|
|
39113
|
+
...runHere ? [{ id: "here", label: labels.blockRunHere, onSelect: runHere, disabled: running2 }] : [],
|
|
39114
|
+
...inTerminal ? [{ id: "terminal", label: labels.blockRunInTerminal, onSelect: inTerminal }] : []
|
|
39115
|
+
];
|
|
39116
|
+
const actions = (buttonClass2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
39117
|
+
running2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39118
|
+
"button",
|
|
39119
|
+
{
|
|
39120
|
+
type: "button",
|
|
39121
|
+
"aria-label": labels.blockRunStop,
|
|
39122
|
+
title: labels.blockRunStop,
|
|
39123
|
+
"data-pinned": "",
|
|
39124
|
+
onClick: (e) => {
|
|
39125
|
+
e.stopPropagation();
|
|
39126
|
+
stop();
|
|
39127
|
+
},
|
|
39128
|
+
className: `${buttonClass2} hover:!text-zg-danger`,
|
|
39129
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "i-ph-stop-fill text-zg-label" })
|
|
39130
|
+
}
|
|
39131
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39132
|
+
"button",
|
|
39133
|
+
{
|
|
39134
|
+
type: "button",
|
|
39135
|
+
"aria-label": runHere ? labels.blockRunHere : labels.blockRunInTerminal,
|
|
39136
|
+
title: runHere ? labels.blockRunHere : labels.blockRunInTerminal,
|
|
39137
|
+
onClick: (e) => {
|
|
39138
|
+
e.stopPropagation();
|
|
39139
|
+
(runHere ?? inTerminal)?.();
|
|
39140
|
+
},
|
|
39141
|
+
className: buttonClass2,
|
|
39142
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: `${runHere ? "i-ph-play" : "i-ph-terminal-window"} text-zg-label` })
|
|
39143
|
+
}
|
|
39144
|
+
),
|
|
39145
|
+
menu.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39146
|
+
"button",
|
|
39147
|
+
{
|
|
39148
|
+
ref: caretRef,
|
|
39149
|
+
type: "button",
|
|
39150
|
+
"aria-label": labels.blockRunMenu,
|
|
39151
|
+
title: labels.blockRunMenu,
|
|
39152
|
+
"aria-haspopup": "menu",
|
|
39153
|
+
"aria-expanded": menuOpen,
|
|
39154
|
+
onClick: (e) => {
|
|
39155
|
+
e.stopPropagation();
|
|
39156
|
+
if (!menuOpen) setMenuArmed(true);
|
|
39157
|
+
setMenuOpen(!menuOpen);
|
|
39158
|
+
},
|
|
39159
|
+
className: `${buttonClass2} !w-4`,
|
|
39160
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "i-ph-caret-down text-zg-badge" })
|
|
39161
|
+
}
|
|
39162
|
+
)
|
|
39163
|
+
] });
|
|
39164
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "zg-run-block my-2", children: [
|
|
39165
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CodeBlock, { code, language, actions }),
|
|
39166
|
+
menuArmed && /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu, { open: menuOpen, anchorRef: caretRef, onClose: () => setMenuOpen(false), items: menu }) }),
|
|
39167
|
+
(live ?? saved) && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39168
|
+
RunPanel,
|
|
39169
|
+
{
|
|
39170
|
+
code,
|
|
39171
|
+
live,
|
|
39172
|
+
saved,
|
|
39173
|
+
onAgain: runHere,
|
|
39174
|
+
onTerminal: inTerminal,
|
|
39175
|
+
onRemove: () => {
|
|
39176
|
+
if (live?.error !== void 0) stop();
|
|
39177
|
+
else if (blocks && saved) void blocks.remove(scope.sessionId, key);
|
|
39178
|
+
}
|
|
39179
|
+
}
|
|
39180
|
+
)
|
|
39181
|
+
] });
|
|
39182
|
+
}
|
|
39183
|
+
function RunPanel({ code, live, saved, onAgain, onTerminal, onRemove }) {
|
|
39184
|
+
const labels = useChatLabels();
|
|
39185
|
+
const button = iconButtonClass({ size: "sm" });
|
|
39186
|
+
const running2 = live !== void 0 && live.error === void 0;
|
|
39187
|
+
const failed = live?.error !== void 0 || saved !== void 0 && saved.exitCode !== 0;
|
|
39188
|
+
const text = reactExports.useMemo(() => saved ? stripAnsi(saved.output) : "", [saved]);
|
|
39189
|
+
const [now] = reactExports.useState(Date.now);
|
|
39190
|
+
const status = (() => {
|
|
39191
|
+
if (running2)
|
|
39192
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "inline-flex items-baseline gap-1.5", children: [
|
|
39193
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-shimmer", children: labels.blockRunning }),
|
|
39194
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ToolTiming, { startedAt: live.startedAt, running: true })
|
|
39195
|
+
] });
|
|
39196
|
+
if (live?.error !== void 0) return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-zg-danger", children: labels.blockRunFailed(live.error) });
|
|
39197
|
+
if (!saved) return null;
|
|
39198
|
+
const label = saved.stopped === "timeout" ? labels.blockRunTimedOut : saved.stopped === "cancelled" ? labels.blockRunStopped : saved.exitCode === null ? labels.shellKilled : labels.shellExit(saved.exitCode);
|
|
39199
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "inline-flex items-baseline gap-1.5", children: [
|
|
39200
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: saved.exitCode === 0 ? "text-zg-success" : "text-zg-danger", children: label }),
|
|
39201
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ToolTiming, { durationMs: saved.durationMs }),
|
|
39202
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[var(--zg-text-subtle)]", children: relativeTime(saved.finishedAt, Math.max(now, saved.finishedAt), labels) })
|
|
39203
|
+
] });
|
|
39204
|
+
})();
|
|
39205
|
+
const attach = () => {
|
|
39206
|
+
if (!saved) return;
|
|
39207
|
+
const fence = (body) => {
|
|
39208
|
+
const ticks = "`".repeat(Math.max(3, ...[...body.matchAll(/`+/g)].map((m2) => m2[0].length + 1)));
|
|
39209
|
+
return `${ticks}
|
|
39210
|
+
${body.replace(/\n$/, "")}
|
|
39211
|
+
${ticks}`;
|
|
39212
|
+
};
|
|
39213
|
+
pushComposerAttachment(textAttachment(labels.blockRunAttachmentName, `${fence(code)}
|
|
39214
|
+
|
|
39215
|
+
${fence(text)}
|
|
39216
|
+
`));
|
|
39217
|
+
};
|
|
39218
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "zg-run-panel group", "aria-label": labels.blockRunOutput, "data-failed": failed ? "" : void 0, children: [
|
|
39219
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("header", { className: "zg-meta flex items-center gap-2 min-h-6", children: [
|
|
39220
|
+
status,
|
|
39221
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-auto flex items-center gap-0.5", children: !running2 && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
39222
|
+
saved && text !== "" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
39223
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CopyButton, { text, label: labels.blockRunCopy, reveal: true }),
|
|
39224
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39225
|
+
"button",
|
|
39226
|
+
{
|
|
39227
|
+
type: "button",
|
|
39228
|
+
"aria-label": labels.blockRunAttach,
|
|
39229
|
+
title: labels.blockRunAttach,
|
|
39230
|
+
onClick: attach,
|
|
39231
|
+
className: `zg-reveal ${button}`,
|
|
39232
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "i-ph-paperclip text-zg-label" })
|
|
39233
|
+
}
|
|
39234
|
+
)
|
|
39235
|
+
] }),
|
|
39236
|
+
onAgain && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39237
|
+
"button",
|
|
39238
|
+
{
|
|
39239
|
+
type: "button",
|
|
39240
|
+
"aria-label": labels.blockRunAgain,
|
|
39241
|
+
title: labels.blockRunAgain,
|
|
39242
|
+
onClick: onAgain,
|
|
39243
|
+
className: `zg-reveal ${button}`,
|
|
39244
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "i-ph-arrow-clockwise text-zg-label" })
|
|
39245
|
+
}
|
|
39246
|
+
),
|
|
39247
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39248
|
+
"button",
|
|
39249
|
+
{
|
|
39250
|
+
type: "button",
|
|
39251
|
+
"aria-label": labels.blockRunRemove,
|
|
39252
|
+
title: labels.blockRunRemove,
|
|
39253
|
+
onClick: onRemove,
|
|
39254
|
+
className: `zg-reveal ${button}`,
|
|
39255
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "i-ph-x text-zg-label" })
|
|
39256
|
+
}
|
|
39257
|
+
)
|
|
39258
|
+
] }) })
|
|
39259
|
+
] }),
|
|
39260
|
+
live ? live.lines.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(LiveOutput, { lines: live.lines, window: LIVE_BLOCK_RUN_LINES, label: labels.blockRunOutput }) : saved && saved.output !== "" && /* @__PURE__ */ jsxRuntimeExports.jsx(RunOutput, { run: saved }),
|
|
39261
|
+
failed && !running2 && onTerminal && /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", onClick: onTerminal, className: "zg-run-terminal zg-meta", children: [
|
|
39262
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "i-ph-terminal-window" }),
|
|
39263
|
+
labels.blockRunNeedsTerminal
|
|
39264
|
+
] })
|
|
39265
|
+
] });
|
|
39266
|
+
}
|
|
39267
|
+
function RunOutput({ run }) {
|
|
39268
|
+
const labels = useChatLabels();
|
|
39269
|
+
const ref = reactExports.useRef(null);
|
|
39270
|
+
reactExports.useLayoutEffect(() => {
|
|
39271
|
+
const el = ref.current;
|
|
39272
|
+
if (el) el.scrollTop = el.scrollHeight;
|
|
39273
|
+
}, [run.output]);
|
|
39274
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("pre", { ref, className: "zg-code-panel zg-output zg-run-output zg-ansi", children: [
|
|
39275
|
+
run.truncated && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "zg-run-note", children: [
|
|
39276
|
+
labels.blockRunTruncated,
|
|
39277
|
+
"\n"
|
|
39278
|
+
] }),
|
|
39279
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AnsiText, { text: run.output.replace(/\n$/, "") })
|
|
39280
|
+
] });
|
|
39281
|
+
}
|
|
38334
39282
|
const BATCH_OPEN_STATE = createRecentMap(500);
|
|
38335
39283
|
const ToolBatchRow = reactExports.memo(
|
|
38336
39284
|
({ id, tools, summary, mode, showResult, showDiff, lineState, className, style }) => {
|
|
@@ -38421,13 +39369,24 @@ ${lines.slice(lines.length - USER_BASH_TAIL_LINES).join("\n")}`;
|
|
|
38421
39369
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `truncate ${lineState === "running" ? "zg-shimmer" : "text-[var(--zg-text)]"}`, children: row.command }),
|
|
38422
39370
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Crossfade, { activeKey: row.running ? "running" : row.errored ? "failed" : row.exit === null ? "none" : "exit", children: badge })
|
|
38423
39371
|
] }),
|
|
38424
|
-
display !== null && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: `${CODE_PANEL} mt-1
|
|
39372
|
+
display !== null && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: `${CODE_PANEL} mt-1`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(AnsiText, { text: display }) })
|
|
38425
39373
|
] });
|
|
38426
39374
|
});
|
|
38427
39375
|
function isHiddenRow(row, showThinking) {
|
|
38428
39376
|
return (row.kind === "thinking" || row.kind === "thinking-batch") && !showThinking;
|
|
38429
39377
|
}
|
|
38430
39378
|
const NO_ROWS = () => [];
|
|
39379
|
+
function ReplyText({
|
|
39380
|
+
text,
|
|
39381
|
+
streaming,
|
|
39382
|
+
settled: settled2,
|
|
39383
|
+
sessionId,
|
|
39384
|
+
turnId
|
|
39385
|
+
}) {
|
|
39386
|
+
const reply = /* @__PURE__ */ jsxRuntimeExports.jsx(TextRow$1, { text, streaming });
|
|
39387
|
+
if (!settled2 || !sessionId || !turnId) return reply;
|
|
39388
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ShellBlockProvider, { sessionId, turnId, children: reply });
|
|
39389
|
+
}
|
|
38431
39390
|
const TranscriptRowSlot = reactExports.memo(function TranscriptRowSlot2({
|
|
38432
39391
|
eager,
|
|
38433
39392
|
estimatePx,
|
|
@@ -38536,7 +39495,16 @@ const TranscriptRow = reactExports.memo(function TranscriptRow2({
|
|
|
38536
39495
|
}
|
|
38537
39496
|
),
|
|
38538
39497
|
row.kind === "thinking-batch" && /* @__PURE__ */ jsxRuntimeExports.jsx(ThinkingBatchRow, { thoughts: row.thoughts, totalMs: row.totalMs, autoExpand: settings.thinkingAutoExpand }),
|
|
38539
|
-
row.kind === "markdown" && (row.custom ? /* @__PURE__ */ jsxRuntimeExports.jsx(CustomBlockRow, { renderer: row.custom.renderer, data: row.custom.data, text: row.text }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39498
|
+
row.kind === "markdown" && (row.custom ? /* @__PURE__ */ jsxRuntimeExports.jsx(CustomBlockRow, { renderer: row.custom.renderer, data: row.custom.data, text: row.text }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39499
|
+
ReplyText,
|
|
39500
|
+
{
|
|
39501
|
+
text: row.text,
|
|
39502
|
+
streaming: row.streaming && showCaret,
|
|
39503
|
+
settled: !row.streaming,
|
|
39504
|
+
sessionId,
|
|
39505
|
+
turnId: row.turnId
|
|
39506
|
+
}
|
|
39507
|
+
)),
|
|
38540
39508
|
row.kind === "info" && (row.notice ? /* @__PURE__ */ jsxRuntimeExports.jsx(NoticeRow, { notice: row.notice, text: row.text }) : /* @__PURE__ */ jsxRuntimeExports.jsx(InfoRow, { text: row.text })),
|
|
38541
39509
|
row.kind === "error" && (row.failure ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
38542
39510
|
FailureRow,
|
|
@@ -39765,7 +40733,7 @@ function SpaceSwitcher({
|
|
|
39765
40733
|
);
|
|
39766
40734
|
}),
|
|
39767
40735
|
(onMove || onHide) && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
39768
|
-
RowActionsMenu$
|
|
40736
|
+
RowActionsMenu$2,
|
|
39769
40737
|
{
|
|
39770
40738
|
open: menu !== null && menuItems.length > 0,
|
|
39771
40739
|
anchorRef: menuAnchor,
|
|
@@ -41574,7 +42542,7 @@ const SessionListRow = reactExports.memo(function SessionListRow2({
|
|
|
41574
42542
|
}
|
|
41575
42543
|
),
|
|
41576
42544
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
41577
|
-
RowActionsMenu$
|
|
42545
|
+
RowActionsMenu$2,
|
|
41578
42546
|
{
|
|
41579
42547
|
open: menuOpen,
|
|
41580
42548
|
anchorRef: trigger,
|
|
@@ -42132,7 +43100,7 @@ function SidebarGroupHeader({
|
|
|
42132
43100
|
)
|
|
42133
43101
|
}
|
|
42134
43102
|
),
|
|
42135
|
-
path && /* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$
|
|
43103
|
+
path && /* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$2, { open: menuAt !== null, position: menuAt, onClose: () => setMenuAt(null), items: menuItems })
|
|
42136
43104
|
] });
|
|
42137
43105
|
}
|
|
42138
43106
|
const NAV_COMMIT_MS = 20;
|
|
@@ -43859,7 +44827,7 @@ const ComposerShell = reactExports.forwardRef(function ComposerShell2(props, ref
|
|
|
43859
44827
|
let loaded = null;
|
|
43860
44828
|
let pending$1 = null;
|
|
43861
44829
|
function loadComposerEditor() {
|
|
43862
|
-
pending$1 ??= __vitePreload(() => import("./ComposerEditor-
|
|
44830
|
+
pending$1 ??= __vitePreload(() => import("./ComposerEditor-CXpNHoo1.js"), true ? __vite__mapDeps([13,5,14,4,6,15,3]) : void 0, import.meta.url).then(
|
|
43863
44831
|
(m2) => loaded = m2,
|
|
43864
44832
|
(error) => {
|
|
43865
44833
|
pending$1 = null;
|
|
@@ -44835,125 +45803,6 @@ function mergeBadgeOrder(saved, shown2) {
|
|
|
44835
45803
|
for (const id of new Set(shown2)) out.push(id, ...after2.get(id) ?? []);
|
|
44836
45804
|
return out;
|
|
44837
45805
|
}
|
|
44838
|
-
const composerScopes = /* @__PURE__ */ new Map();
|
|
44839
|
-
const scopeListeners = /* @__PURE__ */ new Set();
|
|
44840
|
-
function scopesChanged() {
|
|
44841
|
-
for (const l of scopeListeners) l();
|
|
44842
|
-
}
|
|
44843
|
-
const NO_SCOPE = "\0none";
|
|
44844
|
-
function registerComposerScope(scopeKey) {
|
|
44845
|
-
scopeKey ??= NO_SCOPE;
|
|
44846
|
-
composerScopes.set(scopeKey, (composerScopes.get(scopeKey) ?? 0) + 1);
|
|
44847
|
-
scopesChanged();
|
|
44848
|
-
let done = false;
|
|
44849
|
-
return () => {
|
|
44850
|
-
if (done) return;
|
|
44851
|
-
done = true;
|
|
44852
|
-
const n = (composerScopes.get(scopeKey) ?? 1) - 1;
|
|
44853
|
-
if (n > 0) composerScopes.set(scopeKey, n);
|
|
44854
|
-
else composerScopes.delete(scopeKey);
|
|
44855
|
-
scopesChanged();
|
|
44856
|
-
};
|
|
44857
|
-
}
|
|
44858
|
-
function hasComposerFor(scopeKey) {
|
|
44859
|
-
return typeof scopeKey === "string" && scopeKey !== NO_SCOPE && composerScopes.has(scopeKey);
|
|
44860
|
-
}
|
|
44861
|
-
function subscribeScopes(l) {
|
|
44862
|
-
scopeListeners.add(l);
|
|
44863
|
-
return () => scopeListeners.delete(l);
|
|
44864
|
-
}
|
|
44865
|
-
function useComposerFor(scopeKey) {
|
|
44866
|
-
const get = reactExports.useCallback(() => hasComposerFor(scopeKey), [scopeKey]);
|
|
44867
|
-
const has = reactExports.useSyncExternalStore(subscribeScopes, get, get);
|
|
44868
|
-
return reactExports.useMemo(() => has && scopeKey !== null ? { scopeKey } : null, [has, scopeKey]);
|
|
44869
|
-
}
|
|
44870
|
-
function hasFocusedComposer() {
|
|
44871
|
-
return focusedClaim !== null;
|
|
44872
|
-
}
|
|
44873
|
-
function isFocusedComposer(scopeKey) {
|
|
44874
|
-
return focusedClaim !== null && focusedClaim.scopeKey === (scopeKey ?? NO_SCOPE);
|
|
44875
|
-
}
|
|
44876
|
-
function useHasFocusedComposer() {
|
|
44877
|
-
return reactExports.useSyncExternalStore(subscribeScopes, hasFocusedComposer, hasFocusedComposer);
|
|
44878
|
-
}
|
|
44879
|
-
let focusedClaim = null;
|
|
44880
|
-
function claimComposerFocus(scopeKey) {
|
|
44881
|
-
const claim = { scopeKey: scopeKey ?? NO_SCOPE };
|
|
44882
|
-
focusedClaim = claim;
|
|
44883
|
-
scopesChanged();
|
|
44884
|
-
return () => {
|
|
44885
|
-
if (focusedClaim !== claim) return;
|
|
44886
|
-
focusedClaim = null;
|
|
44887
|
-
scopesChanged();
|
|
44888
|
-
};
|
|
44889
|
-
}
|
|
44890
|
-
function dispatch(type, payload, target) {
|
|
44891
|
-
const scopeKey = target?.scopeKey ?? focusedClaim?.scopeKey;
|
|
44892
|
-
window.dispatchEvent(new CustomEvent(type, { detail: { payload, scopeKey } }));
|
|
44893
|
-
}
|
|
44894
|
-
function listen(type, scopeKey, handler) {
|
|
44895
|
-
const own2 = scopeKey ?? NO_SCOPE;
|
|
44896
|
-
const listener = (e) => {
|
|
44897
|
-
const detail = e.detail;
|
|
44898
|
-
if (detail.scopeKey === own2) handler(detail.payload);
|
|
44899
|
-
};
|
|
44900
|
-
window.addEventListener(type, listener);
|
|
44901
|
-
return () => window.removeEventListener(type, listener);
|
|
44902
|
-
}
|
|
44903
|
-
const EVENT = "zg:composer:attach";
|
|
44904
|
-
const MENTION_EVENT = "zg:composer:mention";
|
|
44905
|
-
function pushComposerAttachment(attachment, target) {
|
|
44906
|
-
dispatch(EVENT, attachment, target);
|
|
44907
|
-
}
|
|
44908
|
-
function onComposerAttachment(scopeKey, handler) {
|
|
44909
|
-
return listen(EVENT, scopeKey, handler);
|
|
44910
|
-
}
|
|
44911
|
-
function pushComposerMention(path, target) {
|
|
44912
|
-
dispatch(MENTION_EVENT, path, target);
|
|
44913
|
-
}
|
|
44914
|
-
function onComposerMention(scopeKey, handler) {
|
|
44915
|
-
return listen(MENTION_EVENT, scopeKey, handler);
|
|
44916
|
-
}
|
|
44917
|
-
const INSERT_EVENT = "zg:composer:insert";
|
|
44918
|
-
const PROMPT_EVENT = "zg:composer:prompt";
|
|
44919
|
-
const DRAFT_EVENT = "zg:composer:draft";
|
|
44920
|
-
function pushComposerInsert(text, target) {
|
|
44921
|
-
dispatch(INSERT_EVENT, text, target);
|
|
44922
|
-
}
|
|
44923
|
-
function onComposerInsert(scopeKey, handler) {
|
|
44924
|
-
return listen(INSERT_EVENT, scopeKey, handler);
|
|
44925
|
-
}
|
|
44926
|
-
const FOCUS_EVENT = "zg:composer:focus";
|
|
44927
|
-
function focusComposer(target) {
|
|
44928
|
-
dispatch(FOCUS_EVENT, void 0, target);
|
|
44929
|
-
}
|
|
44930
|
-
function onComposerFocus(scopeKey, handler) {
|
|
44931
|
-
return listen(FOCUS_EVENT, scopeKey, () => handler());
|
|
44932
|
-
}
|
|
44933
|
-
function pushComposerPrompt(text, target) {
|
|
44934
|
-
dispatch(PROMPT_EVENT, text, target);
|
|
44935
|
-
}
|
|
44936
|
-
function onComposerPrompt(scopeKey, handler) {
|
|
44937
|
-
return listen(PROMPT_EVENT, scopeKey, handler);
|
|
44938
|
-
}
|
|
44939
|
-
function pushComposerDraft({ scopeKey, text, attachments }) {
|
|
44940
|
-
dispatch(DRAFT_EVENT, { text, attachments }, { scopeKey });
|
|
44941
|
-
}
|
|
44942
|
-
function onComposerDraft(scopeKey, handler) {
|
|
44943
|
-
return listen(DRAFT_EVENT, scopeKey, handler);
|
|
44944
|
-
}
|
|
44945
|
-
function textAttachment(name, text) {
|
|
44946
|
-
const bytes = new TextEncoder().encode(text);
|
|
44947
|
-
let binary = "";
|
|
44948
|
-
for (const b of bytes) binary += String.fromCharCode(b);
|
|
44949
|
-
return {
|
|
44950
|
-
id: `att-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`,
|
|
44951
|
-
name,
|
|
44952
|
-
mediaType: "text/markdown",
|
|
44953
|
-
size: bytes.length,
|
|
44954
|
-
dataUrl: `data:text/markdown;base64,${btoa(binary)}`
|
|
44955
|
-
};
|
|
44956
|
-
}
|
|
44957
45806
|
const PromptHistoryContext = reactExports.createContext(null);
|
|
44958
45807
|
const MAX_ENTRIES = 50;
|
|
44959
45808
|
function PromptHistoryProvider({ children }) {
|
|
@@ -49151,7 +50000,7 @@ function ServerCard({ host, saved = host, onChanged, badge, confirm, now, classN
|
|
|
49151
50000
|
}
|
|
49152
50001
|
),
|
|
49153
50002
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
49154
|
-
RowActionsMenu$
|
|
50003
|
+
RowActionsMenu$2,
|
|
49155
50004
|
{
|
|
49156
50005
|
open: menuOpen,
|
|
49157
50006
|
anchorRef: menuButtonRef,
|
|
@@ -51455,7 +52304,7 @@ function PanelStrip({
|
|
|
51455
52304
|
className: "zg-no-drag"
|
|
51456
52305
|
}
|
|
51457
52306
|
) }),
|
|
51458
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$
|
|
52307
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$2, { open: addOpen, anchorRef: addRef, onClose: () => setAddOpen(false), items: addItems })
|
|
51459
52308
|
] }),
|
|
51460
52309
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-auto" }),
|
|
51461
52310
|
controls?.onPopOut && /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { label: labels.panelPopOut, portal: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -53351,7 +54200,7 @@ function CardHeader({
|
|
|
53351
54200
|
}
|
|
53352
54201
|
let peleModule = null;
|
|
53353
54202
|
function loadPele() {
|
|
53354
|
-
peleModule ??= __vitePreload(() => import("./lazy-
|
|
54203
|
+
peleModule ??= __vitePreload(() => import("./lazy-C1DShJVi.js").then((n) => n.l), true ? __vite__mapDeps([16,3,4,5,6]) : void 0, import.meta.url).catch((error) => {
|
|
53355
54204
|
peleModule = null;
|
|
53356
54205
|
throw error;
|
|
53357
54206
|
});
|
|
@@ -55144,7 +55993,7 @@ function useTurnMenu(sessionId, actions) {
|
|
|
55144
55993
|
}, [target, sessionId, busy2, actions, labels]);
|
|
55145
55994
|
const at = target?.at ?? null;
|
|
55146
55995
|
const menu = reactExports.useMemo(
|
|
55147
|
-
() => /* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$
|
|
55996
|
+
() => /* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$2, { open: at !== null, position: at, onClose: close2, items }),
|
|
55148
55997
|
[at, close2, items]
|
|
55149
55998
|
);
|
|
55150
55999
|
return { onContextMenu, prefetch, menu };
|
|
@@ -55471,7 +56320,7 @@ function loadSymbolsFont(url) {
|
|
|
55471
56320
|
return symbolsFont;
|
|
55472
56321
|
}
|
|
55473
56322
|
function loadGhostty(symbolsFontUrl) {
|
|
55474
|
-
ghosttyModule ??= Promise.all([__vitePreload(() => import("./ghostty-web-
|
|
56323
|
+
ghosttyModule ??= Promise.all([__vitePreload(() => import("./ghostty-web-DnI2p8KS.js"), true ? __vite__mapDeps([17,3,4,5,6]) : void 0, import.meta.url), loadSymbolsFont(symbolsFontUrl)]).then(async ([m2]) => {
|
|
55475
56324
|
await m2.init();
|
|
55476
56325
|
drawBoxGlyphs(m2);
|
|
55477
56326
|
return m2;
|
|
@@ -56304,7 +57153,7 @@ function HostTerminalSurface({
|
|
|
56304
57153
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-terminal-mount": true, className: "absolute inset-0 pl-2 pt-1", style: { caretColor: "transparent" } }),
|
|
56305
57154
|
failed && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute inset-x-0 top-0 m-2 px-2.5 py-1.5 rounded-md bg-zg-danger/10 text-zg-label text-[var(--zg-danger)]", children: failed }),
|
|
56306
57155
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
56307
|
-
RowActionsMenu$
|
|
57156
|
+
RowActionsMenu$2,
|
|
56308
57157
|
{
|
|
56309
57158
|
open: menu !== null,
|
|
56310
57159
|
position: menu ? { x: menu.x, y: menu.y } : null,
|
|
@@ -56771,7 +57620,7 @@ function TabStrip({
|
|
|
56771
57620
|
onClick: () => setMoreOpen((o) => !o)
|
|
56772
57621
|
}
|
|
56773
57622
|
),
|
|
56774
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$
|
|
57623
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$2, { open: moreOpen, anchorRef: moreRef, onClose: () => setMoreOpen(false), items: moreItems })
|
|
56775
57624
|
] }),
|
|
56776
57625
|
trailing
|
|
56777
57626
|
] })
|
|
@@ -58114,7 +58963,7 @@ function ArtifactRow({
|
|
|
58114
58963
|
)
|
|
58115
58964
|
] }),
|
|
58116
58965
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
58117
|
-
RowActionsMenu$
|
|
58966
|
+
RowActionsMenu$2,
|
|
58118
58967
|
{
|
|
58119
58968
|
open: menu !== null,
|
|
58120
58969
|
position: menu ?? void 0,
|
|
@@ -58593,7 +59442,7 @@ function SessionHeader({
|
|
|
58593
59442
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex-1" }),
|
|
58594
59443
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionSlot, { at: "session.header", ...sessionId ? { sessionId } : {}, className: "zg-no-drag shrink" }),
|
|
58595
59444
|
toolbar,
|
|
58596
|
-
menuItems && /* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$
|
|
59445
|
+
menuItems && /* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$2, { open: menuAt !== null, position: menuAt, onClose: () => setMenu(null), items: menuItems })
|
|
58597
59446
|
]
|
|
58598
59447
|
}
|
|
58599
59448
|
);
|
|
@@ -60223,7 +61072,7 @@ function ProjectHeader({
|
|
|
60223
61072
|
}
|
|
60224
61073
|
) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: chip, title: project.path, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: shownPath }) })
|
|
60225
61074
|
] }),
|
|
60226
|
-
items.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$
|
|
61075
|
+
items.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$2, { open: menuAt !== null, position: menuAt, onClose: () => setMenuAt(null), items })
|
|
60227
61076
|
] }),
|
|
60228
61077
|
action && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ml-auto shrink-0 flex items-center h-7", children: action })
|
|
60229
61078
|
] });
|
|
@@ -60274,7 +61123,7 @@ function CustomizeControls({
|
|
|
60274
61123
|
}
|
|
60275
61124
|
),
|
|
60276
61125
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
60277
|
-
RowActionsMenu$
|
|
61126
|
+
RowActionsMenu$2,
|
|
60278
61127
|
{
|
|
60279
61128
|
open,
|
|
60280
61129
|
anchorRef: anchor,
|
|
@@ -60462,7 +61311,7 @@ const HomeBlockCard = reactExports.memo(function HomeBlockCard2({
|
|
|
60462
61311
|
onClick: () => setMenuOpen(true)
|
|
60463
61312
|
}
|
|
60464
61313
|
),
|
|
60465
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$
|
|
61314
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu$2, { open: menuOpen, anchorRef: menuAnchor, onClose: () => setMenuOpen(false), items })
|
|
60466
61315
|
] })
|
|
60467
61316
|
] }),
|
|
60468
61317
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -61107,17 +61956,21 @@ function useExtensionSettingsSections(options = {}) {
|
|
|
61107
61956
|
const order = new Map(exts.map((e, i) => [e.id, i]));
|
|
61108
61957
|
const sidebar = settingsSidebar(exts);
|
|
61109
61958
|
const iconOf = (extensionId) => wire.extensions?.[extensionId]?.icon?.gui;
|
|
61959
|
+
const descriptionOf = (extensionId) => wire.extensions?.[extensionId]?.description;
|
|
61960
|
+
const leadOf2 = (extensionId, label, icon = iconOf(extensionId)) => /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionMark, { entry: { name: extensionId, label, ...icon?.trim() ? { icon: { gui: icon } } : {} } });
|
|
61110
61961
|
const sectionOf = /* @__PURE__ */ new Map();
|
|
61111
61962
|
const entries2 = sidebar.extensionsGroup.map((entry) => {
|
|
61112
61963
|
const id = extensionSettingsEntryId(entry.extensionId);
|
|
61113
61964
|
for (const page of entry.pages) sectionOf.set(`${entry.extensionId}\0${page.id}`, id);
|
|
61114
61965
|
const only = entry.pages.length === 1 ? entry.pages[0] : void 0;
|
|
61966
|
+
const description = descriptionOf(entry.extensionId) ?? only?.description;
|
|
61115
61967
|
return {
|
|
61116
61968
|
id,
|
|
61117
61969
|
title: entry.label,
|
|
61118
61970
|
...extensionGlyph(entry.extensionId, entry.label, iconOf(entry.extensionId), only?.icon?.gui),
|
|
61119
61971
|
group,
|
|
61120
|
-
...
|
|
61972
|
+
...description ? { description } : {},
|
|
61973
|
+
lead: leadOf2(entry.extensionId, entry.label),
|
|
61121
61974
|
render: () => /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionPagePanel, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionSettingsPages, { pages: entry.pages }) })
|
|
61122
61975
|
};
|
|
61123
61976
|
});
|
|
@@ -61135,10 +61988,14 @@ function useExtensionSettingsSections(options = {}) {
|
|
|
61135
61988
|
render: () => /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionPagePanel, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionSettingsWirePage, { page }) })
|
|
61136
61989
|
};
|
|
61137
61990
|
});
|
|
61991
|
+
const ownIcon = cat.category.icon?.gui?.trim() ? cat.category.icon.gui : void 0;
|
|
61992
|
+
const description = descriptionOf(cat.extensionId);
|
|
61138
61993
|
const head = {
|
|
61139
61994
|
id: groupId,
|
|
61140
61995
|
title: cat.category.label,
|
|
61141
|
-
...
|
|
61996
|
+
...ownIcon ? { icon: ownIcon } : extensionGlyph(cat.extensionId, cat.category.label, iconOf(cat.extensionId)),
|
|
61997
|
+
...description ? { description } : {},
|
|
61998
|
+
lead: leadOf2(cat.extensionId, cat.category.label, ownIcon ?? iconOf(cat.extensionId)),
|
|
61142
61999
|
// Found through its pages and rows.
|
|
61143
62000
|
search: [],
|
|
61144
62001
|
render: () => /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionPagePanel, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExtensionSettingsGroupPages, { pages }) })
|
|
@@ -61391,19 +62248,15 @@ function BranchMenu({
|
|
|
61391
62248
|
anchorRef,
|
|
61392
62249
|
cwd,
|
|
61393
62250
|
sessionId,
|
|
61394
|
-
hostId,
|
|
61395
62251
|
current,
|
|
61396
62252
|
onClose,
|
|
61397
62253
|
onSwitched,
|
|
61398
62254
|
worktree,
|
|
61399
|
-
resolveChat,
|
|
61400
|
-
onOpenChat,
|
|
61401
62255
|
className,
|
|
61402
62256
|
style
|
|
61403
62257
|
}) {
|
|
61404
62258
|
const host = useGitHost();
|
|
61405
62259
|
const labels = useGitLabels();
|
|
61406
|
-
const display = useDisplayPath();
|
|
61407
62260
|
const [branches, setBranches] = reactExports.useState(null);
|
|
61408
62261
|
const [prs, setPrs] = reactExports.useState(void 0);
|
|
61409
62262
|
const [search, setSearch] = reactExports.useState(null);
|
|
@@ -61412,7 +62265,6 @@ function BranchMenu({
|
|
|
61412
62265
|
const [expanded, setExpanded] = reactExports.useState(/* @__PURE__ */ new Set());
|
|
61413
62266
|
const [active2, setActive2] = reactExports.useState(0);
|
|
61414
62267
|
const [error, setError] = reactExports.useState(null);
|
|
61415
|
-
const [elsewhere, setElsewhere] = reactExports.useState(null);
|
|
61416
62268
|
const [busy2, setBusy] = reactExports.useState(null);
|
|
61417
62269
|
const [pendingEnter, setPendingEnter] = reactExports.useState(false);
|
|
61418
62270
|
const surfaceRef = reactExports.useRef(null);
|
|
@@ -61438,7 +62290,6 @@ function BranchMenu({
|
|
|
61438
62290
|
setExpanded(/* @__PURE__ */ new Set());
|
|
61439
62291
|
setActive2(0);
|
|
61440
62292
|
setError(null);
|
|
61441
|
-
setElsewhere(null);
|
|
61442
62293
|
setPendingEnter(false);
|
|
61443
62294
|
setWorktreeBranch(null);
|
|
61444
62295
|
setBranches(cache.branches(cwd) ?? null);
|
|
@@ -61540,23 +62391,22 @@ function BranchMenu({
|
|
|
61540
62391
|
const target = entry.kind === "branch" ? { branch: entry.row.name } : entry.pr.local ? { branch: entry.pr.branch } : { pullRequest: entry.pr.number };
|
|
61541
62392
|
setBusy(switcherKey(entry));
|
|
61542
62393
|
setError(null);
|
|
61543
|
-
|
|
61544
|
-
|
|
61545
|
-
|
|
61546
|
-
|
|
61547
|
-
|
|
61548
|
-
|
|
61549
|
-
|
|
61550
|
-
|
|
61551
|
-
|
|
61552
|
-
|
|
61553
|
-
}
|
|
62394
|
+
try {
|
|
62395
|
+
const result = await offered.checkout(cwd, target, sessionId);
|
|
62396
|
+
if (result.ok) return onSwitched();
|
|
62397
|
+
if (result.worktree && sessionId && offered.moveSession) {
|
|
62398
|
+
const moved = await offered.moveSession(sessionId, { kind: "local", cwd: result.worktree.path });
|
|
62399
|
+
return moved.ok ? onSwitched() : setError(gitErrorText(moved.error, labels));
|
|
62400
|
+
}
|
|
62401
|
+
setError(gitErrorText(result.error, labels));
|
|
62402
|
+
} finally {
|
|
62403
|
+
setBusy(null);
|
|
62404
|
+
}
|
|
61554
62405
|
};
|
|
61555
62406
|
const createBranch = async (name) => {
|
|
61556
62407
|
if (!offered?.createBranch) return;
|
|
61557
62408
|
setBusy(switcherKey({ kind: "create", worktree: false }));
|
|
61558
62409
|
setError(null);
|
|
61559
|
-
setElsewhere(null);
|
|
61560
62410
|
const result = await offered.createBranch(cwd, name, sessionId);
|
|
61561
62411
|
setBusy(null);
|
|
61562
62412
|
if (result.ok) onSwitched();
|
|
@@ -61566,7 +62416,6 @@ function BranchMenu({
|
|
|
61566
62416
|
if (!sessionId || !offerWorktree || !host?.startWorktree || busy2) return;
|
|
61567
62417
|
const branch = typedBranch ?? (worktreeBranch?.trim() || offerWorktree.suggestedBranch);
|
|
61568
62418
|
setBusy(busyKey);
|
|
61569
|
-
setElsewhere(null);
|
|
61570
62419
|
setError(null);
|
|
61571
62420
|
try {
|
|
61572
62421
|
const result = await host.startWorktree(sessionId, branch || void 0);
|
|
@@ -61646,22 +62495,6 @@ function BranchMenu({
|
|
|
61646
62495
|
}
|
|
61647
62496
|
) }),
|
|
61648
62497
|
error && /* @__PURE__ */ jsxRuntimeExports.jsx(MenuNote, { icon: "i-ph-warning", className: "text-[var(--zg-danger)]", children: error }),
|
|
61649
|
-
elsewhere && /* @__PURE__ */ jsxRuntimeExports.jsx(MenuNote, { icon: environmentKindIcon("worktree"), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex items-center gap-2 min-w-0", children: [
|
|
61650
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", title: elsewhere.worktree, children: labels.gitCheckedOutElsewhere(elsewhere.branch, display.path(elsewhere.worktree, hostId)) }),
|
|
61651
|
-
onOpenChat && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
61652
|
-
"button",
|
|
61653
|
-
{
|
|
61654
|
-
type: "button",
|
|
61655
|
-
"data-testid": "git-open-worktree-chat",
|
|
61656
|
-
className: "shrink-0 text-[var(--zg-accent)] hover:underline",
|
|
61657
|
-
onClick: () => {
|
|
61658
|
-
onClose();
|
|
61659
|
-
onOpenChat(elsewhere.chat);
|
|
61660
|
-
},
|
|
61661
|
-
children: labels.gitOpenWorktreeChat
|
|
61662
|
-
}
|
|
61663
|
-
)
|
|
61664
|
-
] }) }),
|
|
61665
62498
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
61666
62499
|
"div",
|
|
61667
62500
|
{
|
|
@@ -68049,8 +68882,8 @@ function useFilesLabels() {
|
|
|
68049
68882
|
const overrides = useLabels();
|
|
68050
68883
|
return reactExports.useMemo(() => ({ ...DEFAULT_FILES_LABELS, ...overrides }), [overrides]);
|
|
68051
68884
|
}
|
|
68052
|
-
const LazyFilesTab = reactExports.lazy(() => __vitePreload(() => import("./FilesTab-
|
|
68053
|
-
const LazyDiffsTab = reactExports.lazy(() => __vitePreload(() => import("./DiffsTab-
|
|
68885
|
+
const LazyFilesTab = reactExports.lazy(() => __vitePreload(() => import("./FilesTab-h32FFVsw.js"), true ? __vite__mapDeps([19,5,18,9,3,4,6,7,8,10,11,12,20,15,14]) : void 0, import.meta.url).then((m2) => ({ default: m2.FilesTab })));
|
|
68886
|
+
const LazyDiffsTab = reactExports.lazy(() => __vitePreload(() => import("./DiffsTab-Dy8a_hwG.js"), true ? __vite__mapDeps([21,5,20,9,3,4,6,8,10,11,18,15,14]) : void 0, import.meta.url).then((m2) => ({ default: m2.DiffsTab })));
|
|
68054
68887
|
function FilesTab(props) {
|
|
68055
68888
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(LazyFilesTab, { ...props }) });
|
|
68056
68889
|
}
|
|
@@ -69938,6 +70771,41 @@ function WorkerWrapper(options) {
|
|
|
69938
70771
|
}
|
|
69939
70772
|
);
|
|
69940
70773
|
}
|
|
70774
|
+
const ZG_MOTIONS = ["snap", "pop", "panel", "slide", "settle", "exit", "fade", "fade-out", "hover"];
|
|
70775
|
+
const motionTheme = (part) => Object.fromEntries(ZG_MOTIONS.map((name) => [name, `var(--zg-motion-${name}-${part})`]));
|
|
70776
|
+
({
|
|
70777
|
+
/*
|
|
70778
|
+
* Motion: `transition-colors` / `transition` default to the shared hover
|
|
70779
|
+
* tween (`--zg-motion-hover-*`), so no markup carries its own
|
|
70780
|
+
* `duration-150`. Movement names the vocabulary: `duration-pop ease-pop`.
|
|
70781
|
+
* Opacity on a moving element wants its own curve (`fade`): use a CSS
|
|
70782
|
+
* class with per-property transitions for that.
|
|
70783
|
+
*/
|
|
70784
|
+
duration: { ...motionTheme("duration") },
|
|
70785
|
+
easing: { ...motionTheme("ease") },
|
|
70786
|
+
/*
|
|
70787
|
+
* The interface type scale (styles/tokens.css): `text-zg-meta`. The empty
|
|
70788
|
+
* object keeps Uno from writing `line-height: 1` with the size.
|
|
70789
|
+
*/
|
|
70790
|
+
fontSize: Object.fromEntries(
|
|
70791
|
+
["badge", "meta", "label", "ui", "body", "title"].map((step) => [
|
|
70792
|
+
`zg-${step}`,
|
|
70793
|
+
[`var(--zg-font-size-${step})`, {}]
|
|
70794
|
+
])
|
|
70795
|
+
),
|
|
70796
|
+
/* The radius scale: `rounded-zg-md`. */
|
|
70797
|
+
borderRadius: Object.fromEntries(
|
|
70798
|
+
["xs", "sm", "md", "lg", "xl"].map((step) => [`zg-${step}`, `var(--zg-radius-${step})`])
|
|
70799
|
+
)
|
|
70800
|
+
});
|
|
70801
|
+
function crispPhosphor(set) {
|
|
70802
|
+
const icons = {};
|
|
70803
|
+
for (const [name, icon] of Object.entries(set.icons)) {
|
|
70804
|
+
const bold = set.icons[`${name}-bold`];
|
|
70805
|
+
icons[name] = bold ? { ...icon, body: bold.body } : icon;
|
|
70806
|
+
}
|
|
70807
|
+
return { ...set, icons };
|
|
70808
|
+
}
|
|
69941
70809
|
export {
|
|
69942
70810
|
useCodeDocument as $,
|
|
69943
70811
|
DiffCounts as A,
|
|
@@ -69957,7 +70825,7 @@ export {
|
|
|
69957
70825
|
excerptFor as O,
|
|
69958
70826
|
PanelLoading as P,
|
|
69959
70827
|
MediaNav as Q,
|
|
69960
|
-
RowActionsMenu$
|
|
70828
|
+
RowActionsMenu$2 as R,
|
|
69961
70829
|
Segmented as S,
|
|
69962
70830
|
useEditorPrefs as T,
|
|
69963
70831
|
Tooltip as U,
|
|
@@ -70292,7 +71160,7 @@ export {
|
|
|
70292
71160
|
CompactionModelRow as ey,
|
|
70293
71161
|
DecisionModelRow as ez,
|
|
70294
71162
|
classifyInlineCode as f,
|
|
70295
|
-
|
|
71163
|
+
OpenSessionContext as f$,
|
|
70296
71164
|
usePaletteLabels as f0,
|
|
70297
71165
|
useSessionRank as f1,
|
|
70298
71166
|
sessionsSource as f2,
|
|
@@ -70326,10 +71194,10 @@ export {
|
|
|
70326
71194
|
SessionProvider as fU,
|
|
70327
71195
|
ProviderUsageProvider as fV,
|
|
70328
71196
|
FilesProvider as fW,
|
|
70329
|
-
|
|
70330
|
-
|
|
70331
|
-
|
|
70332
|
-
|
|
71197
|
+
createChatBlockRuns as fX,
|
|
71198
|
+
ChatProvider as fY,
|
|
71199
|
+
useHasFocusedComposer as fZ,
|
|
71200
|
+
hasFocusedComposer as f_,
|
|
70333
71201
|
filesSource as fa,
|
|
70334
71202
|
settingsSource as fb,
|
|
70335
71203
|
prefsSource as fc,
|
|
@@ -70357,26 +71225,29 @@ export {
|
|
|
70357
71225
|
useHelpKey as fy,
|
|
70358
71226
|
useTranscriptFind as fz,
|
|
70359
71227
|
useEditorEnvironment as g,
|
|
70360
|
-
|
|
70361
|
-
|
|
70362
|
-
|
|
70363
|
-
|
|
70364
|
-
|
|
70365
|
-
|
|
70366
|
-
|
|
70367
|
-
|
|
70368
|
-
|
|
70369
|
-
|
|
70370
|
-
|
|
70371
|
-
|
|
70372
|
-
|
|
70373
|
-
|
|
70374
|
-
|
|
70375
|
-
|
|
70376
|
-
|
|
70377
|
-
|
|
70378
|
-
|
|
70379
|
-
|
|
71228
|
+
BadgeMenuProvider as g0,
|
|
71229
|
+
createStorageRecents as g1,
|
|
71230
|
+
PaletteProvider as g2,
|
|
71231
|
+
WorkerWrapper$1 as g3,
|
|
71232
|
+
LabelsProvider as g4,
|
|
71233
|
+
PromptHistoryProvider as g5,
|
|
71234
|
+
SelectTurnProvider as g6,
|
|
71235
|
+
KeybindingsProvider as g7,
|
|
71236
|
+
GitProvider as g8,
|
|
71237
|
+
SidebarHostProvider as g9,
|
|
71238
|
+
useShikiTheme as ga,
|
|
71239
|
+
CodeHighlightProvider as gb,
|
|
71240
|
+
CodeWrapProvider as gc,
|
|
71241
|
+
createCodeHighlighter as gd,
|
|
71242
|
+
WorkerWrapper as ge,
|
|
71243
|
+
AppearanceProvider as gf,
|
|
71244
|
+
EditorEnvironmentRoot as gg,
|
|
71245
|
+
configureErrorReports as gh,
|
|
71246
|
+
installRendererErrorHandlers as gi,
|
|
71247
|
+
watchRuntimeIcons as gj,
|
|
71248
|
+
reportRendererError as gk,
|
|
71249
|
+
readMotionMs as gl,
|
|
71250
|
+
crispPhosphor as gm,
|
|
70380
71251
|
useFilesHost as h,
|
|
70381
71252
|
useFilesLabels as i,
|
|
70382
71253
|
filesRootOf as j,
|