zidane-ui 9.2.2 → 9.3.1
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/dist/adapters/browser-keybindings-host.js +3 -1
- package/dist/adapters/live.d.ts +6 -0
- package/dist/adapters/live.js +16 -8
- package/dist/adapters/server-composer-host.js +22 -9
- package/dist/adapters/server-host.js +143 -18
- package/dist/adapters/server-media.d.ts +9 -1
- package/dist/adapters/server-media.js +14 -1
- package/dist/adapters/server-settings-host.js +30 -3
- package/dist/adapters/server-settings-sections.js +23 -1
- package/dist/adapters/server-sidebar-host.d.ts +3 -1
- package/dist/adapters/server-sidebar-host.js +10 -1
- package/dist/app/ModalProvider.js +1 -1
- package/dist/approvals/ApprovalShell.js +1 -1
- package/dist/chat/DaemonOrb.d.ts +29 -1
- package/dist/chat/DaemonOrb.js +25 -12
- package/dist/chat/HostTranscript.d.ts +0 -12
- package/dist/chat/HostTranscript.js +6 -1
- package/dist/chat/SessionStreamsProvider.d.ts +8 -0
- package/dist/chat/SessionStreamsProvider.js +11 -2
- package/dist/chat/StatusDot.js +8 -2
- package/dist/chat/Transcript.d.ts +20 -11
- package/dist/chat/Transcript.js +335 -162
- package/dist/chat/composer/ComposerEditor.js +1 -1
- package/dist/chat/headless/host.d.ts +43 -7
- package/dist/chat/headless/index.d.ts +8 -6
- package/dist/chat/headless/index.js +11 -9
- package/dist/chat/headless/labels.d.ts +30 -0
- package/dist/chat/headless/labels.js +29 -0
- package/dist/chat/headless/markdown-chunks.d.ts +2 -1
- package/dist/chat/headless/markdown-chunks.js +12 -20
- package/dist/chat/headless/markdown-scan.d.ts +66 -0
- package/dist/chat/headless/markdown-scan.js +124 -0
- package/dist/chat/headless/markdown-stream.d.ts +64 -0
- package/dist/chat/headless/markdown-stream.js +143 -0
- package/dist/chat/headless/output-pager.d.ts +68 -0
- package/dist/chat/headless/output-pager.js +113 -0
- package/dist/chat/headless/session-list.d.ts +20 -0
- package/dist/chat/headless/sidebar/activity.d.ts +14 -0
- package/dist/chat/headless/sidebar/activity.js +32 -0
- package/dist/chat/headless/sidebar/directory.d.ts +17 -2
- package/dist/chat/headless/sidebar/directory.js +50 -54
- package/dist/chat/headless/sidebar/environment.d.ts +5 -2
- package/dist/chat/headless/sidebar/environment.js +11 -2
- package/dist/chat/headless/sidebar/host.d.ts +15 -0
- package/dist/chat/headless/sidebar/inbox.d.ts +12 -3
- package/dist/chat/headless/sidebar/inbox.js +18 -9
- package/dist/chat/headless/sidebar/index.d.ts +2 -2
- package/dist/chat/headless/sidebar/index.js +2 -2
- package/dist/chat/headless/sidebar/labels.d.ts +38 -2
- package/dist/chat/headless/sidebar/labels.js +16 -0
- package/dist/chat/headless/sidebar/prewarm.d.ts +68 -0
- package/dist/chat/headless/sidebar/prewarm.js +114 -0
- package/dist/chat/headless/streams/actions.d.ts +2 -0
- package/dist/chat/headless/streams/actions.js +1 -0
- package/dist/chat/headless/streams/event-bytes.d.ts +6 -0
- package/dist/chat/headless/streams/event-bytes.js +34 -0
- package/dist/chat/headless/streams/live-events.d.ts +25 -1
- package/dist/chat/headless/streams/live-events.js +53 -2
- package/dist/chat/headless/streams/selectors.d.ts +3 -0
- package/dist/chat/headless/streams/selectors.js +8 -1
- package/dist/chat/headless/streams/session-streams.d.ts +15 -3
- package/dist/chat/headless/streams/session-streams.js +31 -3
- package/dist/chat/headless/streams/store.d.ts +24 -1
- package/dist/chat/headless/streams/store.js +51 -26
- package/dist/chat/headless/streams/transcript-map.d.ts +57 -0
- package/dist/chat/headless/streams/transcript-map.js +88 -0
- package/dist/chat/headless/streams/transcript.d.ts +4 -2
- package/dist/chat/headless/streams/transcript.js +19 -7
- package/dist/chat/headless/transcript/batch.js +5 -1
- package/dist/chat/headless/transcript/blob-media.d.ts +15 -0
- package/dist/chat/headless/transcript/blob-media.js +23 -0
- package/dist/chat/headless/transcript/collapse.d.ts +10 -0
- package/dist/chat/headless/transcript/collapse.js +32 -6
- package/dist/chat/headless/transcript/derive.d.ts +98 -0
- package/dist/chat/headless/transcript/derive.js +89 -0
- package/dist/chat/headless/transcript/exchange-media.d.ts +3 -1
- package/dist/chat/headless/transcript/exchange-media.js +8 -5
- package/dist/chat/headless/transcript/fold-actions.d.ts +8 -3
- package/dist/chat/headless/transcript/fold-actions.js +16 -0
- package/dist/chat/headless/transcript/fold-attachments.d.ts +2 -0
- package/dist/chat/headless/transcript/fold-attachments.js +3 -2
- package/dist/chat/headless/transcript/fold.d.ts +4 -2
- package/dist/chat/headless/transcript/fold.js +37 -7
- package/dist/chat/headless/transcript/incremental.d.ts +53 -0
- package/dist/chat/headless/transcript/incremental.js +181 -0
- package/dist/chat/headless/transcript/index.d.ts +2 -1
- package/dist/chat/headless/transcript/index.js +2 -1
- package/dist/chat/headless/transcript/nesting.js +2 -1
- package/dist/chat/headless/transcript/rail.d.ts +142 -0
- package/dist/chat/headless/transcript/rail.js +290 -0
- package/dist/chat/headless/transcript/rows.d.ts +11 -1
- package/dist/chat/headless/transcript/run-failures.d.ts +4 -0
- package/dist/chat/headless/transcript/run-failures.js +31 -2
- package/dist/chat/headless/transcript/seams.d.ts +78 -0
- package/dist/chat/headless/transcript/seams.js +116 -0
- package/dist/chat/headless/transcript/tool-media.d.ts +6 -7
- package/dist/chat/headless/transcript/tool-media.js +27 -9
- package/dist/chat/headless/transcript-labels.d.ts +1 -0
- package/dist/chat/headless/turn-labels.d.ts +1 -0
- package/dist/chat/headless/turn-labels.js +2 -1
- package/dist/chat/index.d.ts +10 -8
- package/dist/chat/index.js +9 -7
- package/dist/chat/interactions/ElicitationCard.js +1 -1
- package/dist/chat/interactions/InteractionCard.js +1 -1
- package/dist/chat/interactions/PlanCard.js +3 -3
- package/dist/chat/interactions/QuestionField.js +4 -4
- package/dist/chat/interactions/QuestionForm.js +3 -3
- package/dist/chat/interactions/SecretInput.js +1 -1
- package/dist/chat/sidebar/ProjectIcon.d.ts +1 -1
- package/dist/chat/sidebar/ProjectIcon.js +1 -1
- package/dist/chat/sidebar/RowChips.d.ts +3 -2
- package/dist/chat/sidebar/RowChips.js +6 -3
- package/dist/chat/sidebar/SessionSidebar.js +13 -14
- package/dist/chat/sidebar/SidebarFooter.d.ts +8 -5
- package/dist/chat/sidebar/SidebarFooter.js +6 -6
- package/dist/chat/sidebar/SidebarFrame.d.ts +2 -0
- package/dist/chat/sidebar/SidebarFrame.js +5 -2
- package/dist/chat/sidebar/SidebarSessionRow.d.ts +3 -1
- package/dist/chat/sidebar/SidebarSessionRow.js +3 -1
- package/dist/chat/sidebar/SpacesSection.d.ts +20 -1
- package/dist/chat/sidebar/SpacesSection.js +34 -13
- package/dist/chat/sidebar/index.d.ts +2 -2
- package/dist/chat/sidebar/session-menu.d.ts +11 -2
- package/dist/chat/sidebar/session-menu.js +50 -5
- package/dist/chat/sidebar/sidebar-live.js +1 -1
- package/dist/chat/sidebar/useInboxRows.js +43 -2
- package/dist/chat/sidebar/useInboxTriage.js +19 -14
- package/dist/chat/testing/contract.d.ts +5 -3
- package/dist/chat/testing/contract.js +66 -1
- package/dist/chat/testing/fixture-sidebar-host.d.ts +7 -1
- package/dist/chat/testing/fixture-sidebar-host.js +12 -0
- package/dist/chat/testing/sidebar.contract.d.ts +6 -0
- package/dist/chat/testing/sidebar.contract.js +24 -0
- package/dist/chat/transcript/DiffLines.d.ts +6 -1
- package/dist/chat/transcript/DiffLines.js +35 -20
- package/dist/chat/transcript/EditDiffBlock.d.ts +5 -1
- package/dist/chat/transcript/EditDiffBlock.js +89 -30
- package/dist/chat/transcript/InteractionToolBody.js +1 -1
- package/dist/chat/transcript/LazyRow.d.ts +40 -40
- package/dist/chat/transcript/LazyRow.js +101 -149
- package/dist/chat/transcript/MermaidDiagram.js +2 -1
- package/dist/chat/transcript/SelectCursor.d.ts +11 -1
- package/dist/chat/transcript/SelectCursor.js +10 -5
- package/dist/chat/transcript/SubagentBlock.js +3 -2
- package/dist/chat/transcript/TranscriptRail.d.ts +109 -0
- package/dist/chat/transcript/TranscriptRail.js +579 -0
- package/dist/chat/transcript/TranscriptRow.d.ts +4 -7
- package/dist/chat/transcript/TranscriptRow.js +9 -5
- package/dist/chat/transcript/actions.d.ts +43 -3
- package/dist/chat/transcript/actions.js +27 -1
- package/dist/chat/transcript/clipped-output.d.ts +58 -0
- package/dist/chat/transcript/clipped-output.js +131 -0
- package/dist/chat/transcript/fold-attachments.js +10 -5
- package/dist/chat/transcript/fold-worker.js +3 -2
- package/dist/chat/transcript/fold.js +21 -2
- package/dist/chat/transcript/index.d.ts +11 -9
- package/dist/chat/transcript/index.js +10 -8
- package/dist/chat/transcript/markdown-cache.d.ts +7 -1
- package/dist/chat/transcript/markdown-cache.js +12 -1
- package/dist/chat/transcript/markdown.js +116 -54
- package/dist/chat/transcript/media-gallery.d.ts +3 -2
- package/dist/chat/transcript/media-gallery.js +10 -7
- package/dist/chat/transcript/notices.d.ts +23 -1
- package/dist/chat/transcript/notices.js +110 -28
- package/dist/chat/transcript/prompt.js +6 -4
- package/dist/chat/transcript/prose.js +3 -1
- package/dist/chat/transcript/receipt-parts.d.ts +22 -0
- package/dist/chat/transcript/receipt-parts.js +87 -0
- package/dist/chat/transcript/root-items.d.ts +96 -0
- package/dist/chat/transcript/root-items.js +180 -0
- package/dist/chat/transcript/row-mount.d.ts +165 -0
- package/dist/chat/transcript/row-mount.js +498 -0
- package/dist/chat/transcript/row-parking.d.ts +125 -0
- package/dist/chat/transcript/row-parking.js +135 -0
- package/dist/chat/transcript/row-ui-state.d.ts +37 -0
- package/dist/chat/transcript/row-ui-state.js +53 -0
- package/dist/chat/transcript/run-rows.js +6 -78
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/scroll-clamp.js +1 -1
- package/dist/chat/transcript/tasks.js +3 -2
- package/dist/chat/transcript/tool-media.d.ts +4 -2
- package/dist/chat/transcript/tool-media.js +15 -7
- package/dist/chat/transcript/tool-parts.d.ts +27 -4
- package/dist/chat/transcript/tool-parts.js +31 -5
- package/dist/chat/transcript/tool-payload.js +26 -11
- package/dist/chat/transcript/tool-row.d.ts +2 -1
- package/dist/chat/transcript/tool-row.js +38 -19
- package/dist/chat/transcript/use-transcript-rows.d.ts +24 -7
- package/dist/chat/transcript/use-transcript-rows.js +28 -46
- package/dist/chat/transcript/useSettledReveal.js +15 -3
- package/dist/chat/transcript/useStickToBottom.js +4 -4
- package/dist/chat/transcript/useTranscriptSearch.js +30 -14
- package/dist/chat/transcript/view-scope.d.ts +26 -6
- package/dist/chat/transcript/view-scope.js +106 -20
- package/dist/components/ChoiceCards.js +1 -1
- package/dist/components/ConfirmDialog.js +1 -1
- package/dist/components/CopyValue.d.ts +33 -0
- package/dist/components/CopyValue.js +54 -0
- package/dist/components/Form.js +1 -1
- package/dist/components/HowItWorks.js +1 -1
- package/dist/components/Menu.js +1 -1
- package/dist/components/StepFrame.js +2 -2
- package/dist/components/SwatchPicker.js +1 -1
- package/dist/components/ToggleCard.js +1 -1
- package/dist/components/floating/HoverCard.js +2 -3
- package/dist/components/floating/hover-delay.d.ts +4 -0
- package/dist/components/floating/hover-delay.js +6 -0
- package/dist/core.css +14 -12
- package/dist/dist/{index-Betz0OWq.d.ts → index-C6-t1SS9.d.ts} +21 -2
- package/dist/dist/index-De9AbmxS.d.ts +1 -0
- package/dist/dist/index.d.ts +5 -5
- package/dist/dist/sandbox-CSUihARm.d.ts +2 -0
- package/dist/dist/{timeout-CyU7HLyz.d.ts → timeout-CmTx6V9y.d.ts} +1 -0
- package/dist/extensions/ExtensionDialogHost.js +1 -1
- package/dist/files/TreeColumn.js +3 -1
- package/dist/files/headless/host.d.ts +2 -2
- package/dist/git/ImportRepoDialog.js +1 -1
- package/dist/git/MoveSessionDialog.js +2 -2
- package/dist/git/SandboxManager.d.ts +42 -0
- package/dist/git/SandboxManager.js +297 -0
- package/dist/git/SyncChip.js +1 -1
- package/dist/git/headless/index.d.ts +2 -1
- package/dist/git/headless/index.js +2 -1
- package/dist/git/headless/labels.d.ts +29 -0
- package/dist/git/headless/labels.js +34 -1
- package/dist/git/headless/sandboxes.d.ts +43 -0
- package/dist/git/headless/sandboxes.js +52 -0
- package/dist/git/index.d.ts +2 -1
- package/dist/git/index.js +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/keybindings/headless/catalog.d.ts +1 -1
- package/dist/keybindings/headless/catalog.js +12 -0
- package/dist/machines/HostsSection.d.ts +1 -1
- package/dist/machines/headless/labels.js +2 -2
- package/dist/motion/flip-list.js +3 -10
- package/dist/motion/presence.d.ts +10 -0
- package/dist/motion/presence.js +20 -1
- package/dist/motion/swap.d.ts +8 -2
- package/dist/motion/swap.js +5 -2
- package/dist/onboarding/conversation.js +27 -15
- package/dist/onboarding/demos/how-it-works.js +1 -1
- package/dist/onboarding/skills/parts.js +4 -4
- package/dist/onboarding/sources/SourceBrowser.js +1 -1
- package/dist/onboarding/steps/ReadyStep.js +1 -1
- package/dist/onboarding/steps/connect/KeyForm.js +1 -1
- package/dist/palette/headless/app-sources.js +20 -0
- package/dist/palette/headless/labels.js +2 -0
- package/dist/session/PlanTracker.js +3 -3
- package/dist/session/SecretsPanel.js +1 -1
- package/dist/session/SessionHeader.d.ts +18 -6
- package/dist/session/SessionHeader.js +68 -12
- package/dist/session/SessionPlaceMenu.d.ts +35 -0
- package/dist/session/SessionPlaceMenu.js +299 -0
- package/dist/session/SessionShell.js +1 -1
- package/dist/session/TurnDetailsDialog.js +1 -1
- package/dist/session/headless/index.d.ts +2 -1
- package/dist/session/headless/index.js +2 -1
- package/dist/session/headless/labels.d.ts +73 -0
- package/dist/session/headless/labels.js +73 -0
- package/dist/session/headless/place.d.ts +49 -0
- package/dist/session/headless/place.js +57 -0
- package/dist/session/index.d.ts +2 -1
- package/dist/session/index.js +2 -1
- package/dist/settings/ConversationPresetsCard.js +1 -1
- package/dist/settings/SettingCard.js +2 -2
- package/dist/settings/SettingsRowsPage.js +1 -1
- package/dist/settings/headless/fixture-performance.js +4 -2
- package/dist/settings/headless/fixture-sections.js +7 -0
- package/dist/settings/headless/labels.d.ts +1 -1
- package/dist/settings/headless/labels.js +1 -1
- package/dist/settings/headless/layout.d.ts +4 -4
- package/dist/settings/headless/layout.js +1 -1
- package/dist/settings/headless/performance.d.ts +4 -0
- package/dist/settings/headless/search.d.ts +2 -2
- package/dist/settings/headless/sections-host.d.ts +20 -2
- package/dist/settings/sections/claude-import/ClaudeImportDialog.js +1 -1
- package/dist/settings/sections/enabled-list/EnabledListSection.js +2 -2
- package/dist/settings/sections/environments/EnvironmentsSection.d.ts +9 -3
- package/dist/settings/sections/environments/EnvironmentsSection.js +292 -52
- package/dist/settings/sections/environments/labels.d.ts +15 -0
- package/dist/settings/sections/environments/labels.js +18 -3
- package/dist/settings/sections/extensions/ChangeOriginDialog.js +1 -1
- package/dist/settings/sections/extensions/ExtensionSourceBrowser.js +1 -1
- package/dist/settings/sections/extensions/ExtensionsSection.d.ts +3 -2
- package/dist/settings/sections/extensions/ExtensionsSection.js +9 -3
- package/dist/settings/sections/host-catalog/HostCatalogSection.js +15 -5
- package/dist/settings/sections/keybindings/labels.d.ts +2 -0
- package/dist/settings/sections/keybindings/labels.js +2 -0
- package/dist/settings/sections/keybindings/rows.js +8 -0
- package/dist/settings/sections/models/SpacesDefaultsSection.d.ts +7 -3
- package/dist/settings/sections/models/SpacesDefaultsSection.js +11 -5
- package/dist/settings/sections/performance/PerformanceSection.js +8 -1
- package/dist/settings/sections/performance/labels.d.ts +2 -0
- package/dist/settings/sections/performance/labels.js +2 -0
- package/dist/settings/sections/skills/SkillGroups.js +1 -1
- package/dist/settings/server-app.d.ts +4 -2
- package/dist/settings/server-app.js +7 -3
- package/dist/settings/testing/sections.contract.d.ts +7 -1
- package/dist/settings/testing/sections.contract.js +37 -0
- package/dist/styles.css +243 -19
- package/dist/terminal/TerminalDrawer.js +3 -1
- package/dist/views/headless/answers.d.ts +8 -2
- package/dist/views/headless/answers.js +58 -1
- package/dist/views/headless/placement.d.ts +78 -0
- package/dist/views/headless/placement.js +154 -44
- package/dist/workspace/SidePanel.js +3 -1
- package/package.json +2 -2
- package/src/styles/base.css +13 -0
- package/src/styles/chat.css +30 -0
- package/src/styles/components.css +0 -10
- package/src/styles/files.css +5 -0
- package/src/styles/sidebar.css +29 -7
- package/src/styles/terminal.css +6 -0
- package/src/styles/tokens.css +5 -0
- package/src/styles/transcript.css +138 -0
- package/src/styles/workspace.css +6 -0
- package/dist/dist/index-QcFzZlao.d.ts +0 -1
- package/dist/dist/sandbox-D0zsW8I1.d.ts +0 -2
- /package/dist/dist/{types-_Dtoq_No.d.ts → execution-failure-SREfl-EZ.d.ts} +0 -0
|
@@ -2,8 +2,8 @@ import { plainTextToDocJson } from "./prompt-history-nav.js";
|
|
|
2
2
|
import { suggestionExtension } from "./suggestion-extension.js";
|
|
3
3
|
import { useLayoutEffect } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import Placeholder from "@tiptap/extension-placeholder";
|
|
6
5
|
import { EditorContent, useEditor } from "@tiptap/react";
|
|
6
|
+
import Placeholder from "@tiptap/extension-placeholder";
|
|
7
7
|
import StarterKit from "@tiptap/starter-kit";
|
|
8
8
|
// src/chat/composer/ComposerEditor.tsx
|
|
9
9
|
/** Builds the composer's editor and renders its view. */
|
|
@@ -8,14 +8,15 @@
|
|
|
8
8
|
* an agent running in the page and a recorded fixture all implement this.
|
|
9
9
|
*/
|
|
10
10
|
import { ChatBlockRuns } from "./block-runs.js";
|
|
11
|
+
import { ToolOutputRange } from "./output-pager.js";
|
|
11
12
|
import { PromptOrigin } from "./prompt-origin.js";
|
|
12
13
|
import { SessionRemoval, SessionRowChange } from "./sidebar/directory.js";
|
|
13
14
|
import { SessionArchiveFilter, SidebarListSession } from "./sidebar/types.js";
|
|
14
15
|
import { SidebarViewsHost } from "./sidebar/view.js";
|
|
15
16
|
import { Readable } from "./store.js";
|
|
16
17
|
import { ChatBadgeActions, ChatChipDetails, ChatPaths, ChatReferences, ChatSearchSync, ChatSiteIcons } from "./transcript-host.js";
|
|
17
|
-
import { PromptSegmentRef } from "zidane/chat/pure";
|
|
18
|
-
import { InteractionRequest, InteractionResponse, MessageDelivery, SessionInboxPatch as SessionInboxPatch$1, StreamEvent } from "zidane/chat";
|
|
18
|
+
import { PromptOutline, PromptSegmentRef, TranscriptEvents } from "zidane/chat/pure";
|
|
19
|
+
import { InteractionRequest, InteractionResponse, MessageDelivery, SessionInboxPatch as SessionInboxPatch$1, StreamEvent, ToolCallDetail as ToolCallDetail$1, ToolResultSlice } from "zidane/chat";
|
|
19
20
|
/** An attachment on a prompt, as the components can show it. */
|
|
20
21
|
export interface ChatAttachment {
|
|
21
22
|
/** File name shown on the attachment chip. */
|
|
@@ -26,6 +27,8 @@ export interface ChatAttachment {
|
|
|
26
27
|
size: number;
|
|
27
28
|
/** Where a preview loads the bytes from (images and PDFs): a `data:` URL, an object URL, or any URL the page can load. */
|
|
28
29
|
dataUrl?: string;
|
|
30
|
+
/** The blob the session store holds it as (`attachment://<hash>`): without `dataUrl`, it loads by hash (`TranscriptActions.blobMediaUrl`). */
|
|
31
|
+
ref?: string;
|
|
29
32
|
/**
|
|
30
33
|
* The file as the user picked it, when the composer converted it to send
|
|
31
34
|
* (an image re-encoded to fit the cap). The host saves these bytes where
|
|
@@ -46,9 +49,10 @@ export interface ChatAttachmentOriginal {
|
|
|
46
49
|
}
|
|
47
50
|
/**
|
|
48
51
|
* zidane's canonical transcript event, plus what a live client knows and a
|
|
49
|
-
* replay does not: attachment previews, arrival times
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
+
* replay does not: attachment previews, arrival times and thinking
|
|
53
|
+
* durations. Every extra is optional; a replayed `StreamEvent` list is a
|
|
54
|
+
* valid `ChatEvent` list. What the host cut from a row for the wire is the
|
|
55
|
+
* event's own `clipped` (`host.toolOutput`, `host.toolCall` fetch the rest).
|
|
52
56
|
*/
|
|
53
57
|
export type ChatEvent = Omit<StreamEvent, 'attachments'> & {
|
|
54
58
|
attachments?: readonly ChatAttachment[];
|
|
@@ -57,8 +61,6 @@ export type ChatEvent = Omit<StreamEvent, 'attachments'> & {
|
|
|
57
61
|
* only when its host sent none (`startedAt` / `durationMs`, an older host).
|
|
58
62
|
*/
|
|
59
63
|
receivedAt?: number;
|
|
60
|
-
/** The `tool-result` text was cut for transport; `host.toolOutput` fetches the whole of it. */
|
|
61
|
-
clipped?: true;
|
|
62
64
|
/** Epoch ms a live thinking segment opened (on its first event). */
|
|
63
65
|
thinkingStartedAt?: number;
|
|
64
66
|
/** A closed live thinking segment's duration, replacing `thinkingStartedAt`. */
|
|
@@ -103,6 +105,12 @@ export interface ChatSession {
|
|
|
103
105
|
export interface TranscriptState {
|
|
104
106
|
/** The events loaded so far, oldest first. */
|
|
105
107
|
events: readonly ChatEvent[];
|
|
108
|
+
/**
|
|
109
|
+
* The same events as a transcript store (settled exchanges and the open one), when the host keeps them so
|
|
110
|
+
* (`SessionStreamStore`). A renderer that reads it walks only the open exchange per streamed delta; `events`
|
|
111
|
+
* is then made on first read.
|
|
112
|
+
*/
|
|
113
|
+
transcript?: TranscriptEvents<ChatEvent>;
|
|
106
114
|
/** A run is in flight: the last reply may still be streaming. */
|
|
107
115
|
running: boolean;
|
|
108
116
|
/** History has arrived (until then the transcript shows its loading state). */
|
|
@@ -116,6 +124,16 @@ export interface TranscriptState {
|
|
|
116
124
|
export interface Transcript extends Readable<TranscriptState> {
|
|
117
125
|
/** Fetches older events and prepends them to `events`. Absent: the Earlier messages control is hidden. */
|
|
118
126
|
loadEarlier?: () => void;
|
|
127
|
+
/**
|
|
128
|
+
* Loads the earlier pages up to turn position `index` (a prompt the rail lists, `PromptOutlineEntry.index`).
|
|
129
|
+
* Resolves `true` once that turn's rows are in. Absent: the rail jumps only to prompts already loaded.
|
|
130
|
+
*/
|
|
131
|
+
loadThrough?: (index: number) => Promise<boolean>;
|
|
132
|
+
/**
|
|
133
|
+
* The session's prompt outline: every typed prompt and its turn position, loaded or not. `null` when the host
|
|
134
|
+
* can't say (one from before it). Absent: the rail lists the loaded prompts only.
|
|
135
|
+
*/
|
|
136
|
+
outline?: () => Promise<PromptOutline | null>;
|
|
119
137
|
}
|
|
120
138
|
/** A request from the agent that waits for the user: a question, a plan, or an approval. */
|
|
121
139
|
export interface ChatInteraction {
|
|
@@ -276,12 +294,30 @@ export interface ChatHost {
|
|
|
276
294
|
models?: Readable<readonly ChatModelProvider[]>;
|
|
277
295
|
/** A tool call's full output, when the event carries a preview only. */
|
|
278
296
|
toolOutput?: (sessionId: string, callId: string) => Promise<string | null>;
|
|
297
|
+
/**
|
|
298
|
+
* One range of a tool call's full output (UTF-16 code units), when the event carries a preview only:
|
|
299
|
+
* the row then pages through it (`TOOL_OUTPUT_PAGE_SIZE` at a time) instead of reading it whole with
|
|
300
|
+
* `toolOutput`. `null` when the host holds no result for the call. `turnId`: the call's turn, a hint
|
|
301
|
+
* where to look first.
|
|
302
|
+
*/
|
|
303
|
+
toolOutputRange?: (sessionId: string, callId: string, range: ToolOutputRange, turnId?: string) => Promise<ToolResultSlice | null>;
|
|
304
|
+
/**
|
|
305
|
+
* The whole of a tool call (its input, every hunk of its edit), when the
|
|
306
|
+
* event went out lean (`clipped.input`, `edit.clipped`). `turnId`: the
|
|
307
|
+
* call's turn, a hint where to look first.
|
|
308
|
+
*/
|
|
309
|
+
toolCall?: (sessionId: string, callId: string, turnId?: string) => Promise<ToolCallDetail$1 | null>;
|
|
279
310
|
/**
|
|
280
311
|
* Where a message's media loads from (``, see
|
|
281
312
|
* `TranscriptActions.messageMediaUrl`): `src` as written, or the host's
|
|
282
313
|
* address for a local file; `undefined` when it serves none.
|
|
283
314
|
*/
|
|
284
315
|
messageMediaUrl?: (sessionId: string, src: string) => string | undefined;
|
|
316
|
+
/**
|
|
317
|
+
* The address of a medium the host's session store holds by content hash (`TranscriptActions.blobMediaUrl`): a
|
|
318
|
+
* prompt's attachment, a tool result's media block. The same bytes for good. `undefined` when it serves none now.
|
|
319
|
+
*/
|
|
320
|
+
blobMediaUrl?: (hash: string, name?: string) => string | undefined;
|
|
285
321
|
/** Stop a running tool call (a shell command). */
|
|
286
322
|
cancelTool?: (sessionId: string, callId: string) => void;
|
|
287
323
|
/** The transcript search a session's other windows share. Absent: the search stays in this window. */
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { commandRef, shortUrl, urlRefs } from "./badge-refs.js";
|
|
2
2
|
import { ChatBlockRunOptions, ChatBlockRunTransport, ChatBlockRuns, LIVE_BLOCK_RUN_LINES, LiveBlockRun, createChatBlockRuns } from "./block-runs.js";
|
|
3
3
|
import { beginChipWork, chipWorkBusy, resetChipWorkForTests, whenChipsSettle } from "./chip-settle.js";
|
|
4
|
+
import { ChipViewLabels, commandName, commandView, commitView, sessionForToken, sessionView, skillGroupView, skillName, skillView } from "./chip-views.js";
|
|
4
5
|
import { SessionNotification, SessionNotificationStore, createNotificationStore } from "./sidebar/notifications.js";
|
|
5
6
|
import { SessionActivityFilter, SessionArchiveFilter, SidebarExtensionView, SidebarGroupBy, SidebarInboxGroupBy, SidebarLayout, SidebarListSession, SidebarOrigin, SidebarSortBy, SidebarView, VIEW_CHOICE } from "./sidebar/types.js";
|
|
6
7
|
import { DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SidebarLastSessions, SidebarViewDefaults, SidebarViewMap, SidebarViewPicks, SidebarViewRecord, SidebarViews, SidebarViewsHost, SidebarViewsOptions, SidebarViewsStorage, SpaceSwitcherPrefs, createSidebarViews, defaultSidebarLayout, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, readSidebarViews, resolveSidebarView, sidebarLayoutOf, sidebarViewDefaults } from "./sidebar/view.js";
|
|
7
8
|
import { AGENT_GROUPING, MAX_ROW_CHIPS, NO_SIDEBAR_CONTRIBUTIONS, SidebarContributionStores, SidebarContributions, SidebarGrouping, SidebarItemEntry, SidebarQueryLayer, SidebarRowChip, SidebarRowDecoration, SidebarSpace, claimChildSessions, clearedViewFilters, createDecorator, extensionSpaceOf, filterQueryOf, filtersForSpace, itemsForSpace, mergeSidebarSpaces, nextSavedViewName, resolveGrouping, resolveSort, sidebarContributionsOf, spaceMembership, switcherSpaces, viewFilterOf, viewFiltersOn } from "./sidebar/query.js";
|
|
8
9
|
import { DirectoryServer, DirectorySettings, ProjectInSpace, RuntimeNow, RuntimeOrigin, SessionDirectory, SessionDirectoryOptions, SessionDirectorySource, SessionDirectoryState, SessionDirectoryStreams, SessionRef, SessionRemoval, SessionRowChange, availableProjectsOf, createSessionDirectory, filterDirectorySessions, projectKeyOf, sessionRefsOf } from "./sidebar/directory.js";
|
|
9
|
-
import { ChipViewLabels, commandName, commandView, commitView, sessionForToken, sessionView, skillGroupView, skillName, skillView } from "./chip-views.js";
|
|
10
10
|
import "./composer/index.js";
|
|
11
11
|
import { ComposerMode, caretEffectivelyAtStart, composeSubmitText, decodeHistoryEntry, encodeHistoryDraft, exitsModeOnKey, modeForTypedChar, unsentDraft } from "./composer-modes.js";
|
|
12
|
+
import { DraftScope, DraftScopeState, DraftScopeStore, DraftScopeStoreOptions, createDraftScopeStore, draftScopeOf } from "./draft-scope.js";
|
|
12
13
|
import { OtherStreamSignal, SessionFallbackModel, SessionPageState, SessionRetryState, SessionStreamPage, SessionStreamSignal } from "./streams/types.js";
|
|
13
14
|
import { DrainPlan } from "./streams/pacer.js";
|
|
14
15
|
import { FrameScheduler, defaultFrameScheduler } from "./streams/scheduler.js";
|
|
@@ -21,15 +22,15 @@ import { EMPTY_RUN_METER, RunMeter, RunMeterRow, RunMeterSignal, RunMeterState,
|
|
|
21
22
|
import { ComposerAgentProfile, ComposerAgents, ComposerCacheImpact, ComposerCacheImpactChange, ComposerContext, ComposerContextBreakdown, ComposerContextStatus, ComposerControls, ComposerCostStatus, ComposerEffort, ComposerModels, ComposerPrefs, ComposerPrefsState, ComposerRememberedModel, ComposerRunProgress, ComposerRuns, ComposerSessionView } from "./composer/host-chrome.js";
|
|
22
23
|
import { DEFAULT_MODEL_PICKER_PREFS, MODEL_PICKER_STORAGE_KEY, ModelPickerPrefs, ModelPickerPrefsStorage, ModelPickerPrefsStore, createModelPickerPrefs, parseModelPickerPrefs } from "./composer/model-picker-prefs.js";
|
|
23
24
|
import { CommandArgSuggestionSummary, CommandSummary, ComposerAttachment, ComposerAutocomplete, ComposerCommandArgs, ComposerCompletions, ComposerDraftAttachmentsListener, ComposerDrafts, ComposerExtensionItem, ComposerExtensionProvider, ComposerFolderLocation, ComposerFolders, ComposerHost, ComposerPromptSuggestion, ComposerScope, ComposerSharedGhost, ComposerSkillGroup, ComposerSuggestions, FileEntry, PromptAttachment, SharedDraft, SharedDraftAttachmentsChange, SharedDraftChange, SkillConfig } from "./composer/host.js";
|
|
24
|
-
import { DraftScope, DraftScopeState, DraftScopeStore, DraftScopeStoreOptions, createDraftScopeStore, draftScopeOf } from "./draft-scope.js";
|
|
25
25
|
import { DraftFolderSource, DraftFolderState, DraftPlaceIssue, draftFolderPath, draftLocalFolder, recentHostFolders, recentLocalFolders } from "./draft-target.js";
|
|
26
26
|
import { FileChip, FileChipKind, chipForPath, classifyInlineCode, positionSuffix, resolveChipPath } from "./file-chip.js";
|
|
27
|
+
import { ChatAttachment, ChatAttachmentOriginal, ChatEvent, ChatHost, ChatInteraction, ChatModel, ChatModelProvider, ChatSession, ChatSessionStatus, SendInput, SessionSearchHit, Transcript, TranscriptState } from "./host.js";
|
|
27
28
|
import { SessionBadgesEntry, SessionBadgesSource, SessionBadgesStore, createSessionBadges } from "./sidebar/badges.js";
|
|
28
29
|
import { SessionWindowMode, SidebarEnvironmentHost, SidebarHost } from "./sidebar/host.js";
|
|
29
30
|
import { COMMON_EMOJI, MAIN_SESSION_ICON_KEY, PROJECT_ICONS_KEY, ProjectIcon, ProjectIconMap, firstGrapheme, isProjectIcon, parseProjectIcons } from "./sidebar/project-icons.js";
|
|
30
|
-
import { ChatAttachment, ChatAttachmentOriginal, ChatEvent, ChatHost, ChatInteraction, ChatModel, ChatModelProvider, ChatSession, ChatSessionStatus, SendInput, SessionSearchHit, Transcript, TranscriptState } from "./host.js";
|
|
31
31
|
import { HostStatus, HostView, hostReachable, hostStatusLabel } from "./hosts.js";
|
|
32
32
|
import { ChatLabels, DEFAULT_CHAT_LABELS, secretExpiryWords } from "./labels.js";
|
|
33
|
+
import { CHUNK_THRESHOLD, OpenFence, openFenceOf, splitMarkdown, withoutPartialEmphasis, withoutPartialFence } from "./markdown-chunks.js";
|
|
33
34
|
import { findCommand } from "./composer/commands.js";
|
|
34
35
|
import { ComposerListScope, ComposerLists, LazyList, createComposerLists } from "./composer/composer-sources.js";
|
|
35
36
|
import { ComposerChromeLabels, DEFAULT_COMPOSER_CHROME_LABELS } from "./composer/labels-chrome.js";
|
|
@@ -40,8 +41,8 @@ import { ModelKnobs, ModelKnobsMemory, ModelKnobsStore, createModelKnobs, modelK
|
|
|
40
41
|
import { ModelNames, ModelNamesProvider, ModelNamesStore, createModelNames, modelNamesOf, namerFor } from "./composer/model-names.js";
|
|
41
42
|
import { EffortPickerTarget, defaultModelPatch, effortPickerTarget, rememberedDefaultModel } from "./composer/new-session-defaults.js";
|
|
42
43
|
import { SetDefaultModel, commitModelPick, lastModelChainOf, rememberableChain, rememberedPick, settledResource } from "./composer/remember-model-pick.js";
|
|
43
|
-
import { CHUNK_THRESHOLD, OpenFence, openFenceOf, splitMarkdown, withoutPartialEmphasis, withoutPartialFence } from "./markdown-chunks.js";
|
|
44
44
|
import { NotificationSettings, NotifyEvent, approvalNotificationDetail, notificationContent, questionNotificationDetail, shouldNotify } from "./notifications.js";
|
|
45
|
+
import { TOOL_OUTPUT_PAGE_SIZE, ToolOutputPager, ToolOutputPagerOptions, ToolOutputPagerState, ToolOutputRange, ToolOutputRangeReader, createToolOutputPager, sliceToolOutput, toolOutputPagerDone } from "./output-pager.js";
|
|
45
46
|
import { ChipResolution, PathResolver, PathResolverOptions, createPathResolver } from "./path-resolver.js";
|
|
46
47
|
import { PromptOrigin, PromptOriginWire, PromptViewOrigin, promptOriginWire } from "./prompt-origin.js";
|
|
47
48
|
import { REFERENCES_STORAGE_KEY, ReferenceStore, ReferenceStoreOptions, ReferenceViewEntry, createReferenceStore } from "./reference-store.js";
|
|
@@ -58,7 +59,7 @@ import { DotStateInput, SidebarDotState, deriveDotState } from "./sidebar/dot-st
|
|
|
58
59
|
import { deleteSessionPrompt, environmentKindLabel, environmentSummaryText, runsInRemoteSandbox } from "./sidebar/environment.js";
|
|
59
60
|
import { RunEstimatesRow, RunEstimatesSignal, RunEstimatesStore, createRunEstimates, pickRunEstimate } from "./sidebar/estimates.js";
|
|
60
61
|
import { SESSION_HISTORY_LIMIT, SessionHistory, SessionHistoryDirection, SessionHistoryOptions, SessionHistoryPage, SessionHistoryState, SessionHistoryStore, createSessionHistory, parseSessionHistory } from "./sidebar/history.js";
|
|
61
|
-
import { INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, InboxRow, InboxRowsOptions, InboxSection, InboxShelfId, InboxUrgency, buildInboxRows, compareInboxSection, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, nextInboxChangeAt } from "./sidebar/inbox.js";
|
|
62
|
+
import { INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, InboxRow, InboxRowsOptions, InboxSection, InboxShelfId, InboxUrgency, buildInboxRows, compareInboxSection, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, nextInboxChangeAt } from "./sidebar/inbox.js";
|
|
62
63
|
import { SessionInboxFields, SessionInboxPatch, applyInboxPatch, isSettled, isSnoozed, nextWakeAt } from "./sidebar/inbox-state.js";
|
|
63
64
|
import { PINNED_PROJECTS_KEY, PinsBySpace, parsePinnedProjects, withPinnedProject } from "./sidebar/pinned-projects.js";
|
|
64
65
|
import { pinSession, pinnedSessions } from "./sidebar/pinned-sessions.js";
|
|
@@ -80,8 +81,9 @@ import { dockRunReceipts, dotVariantFor, findLastStreamingRow, foldExchanges, fo
|
|
|
80
81
|
import { FoldActionItem, FoldActionState, foldActionItems, toolAction } from "./transcript/fold-actions.js";
|
|
81
82
|
import { nestToolCalls, nestedCallVisible } from "./transcript/nesting.js";
|
|
82
83
|
import { PairingResult, ToolPairing, pairToolEvents } from "./transcript/pairing.js";
|
|
84
|
+
import { EMPTY_RAIL, RailExchange, RailModel, TranscriptRailState, TranscriptRailStore, computeRailModel, computeRailModelParts, createTranscriptRailStore, dataRowSelector, plainPreview, railWithOutline, sameRail } from "./transcript/rail.js";
|
|
83
85
|
import { RunFailure, failureTooltip, markRunFailures } from "./transcript/run-failures.js";
|
|
84
86
|
import { SelectStops, computeSelectStops, rowTurnIds, stopForRow } from "./transcript/select-stops.js";
|
|
85
87
|
import { ChatBadgeActions, ChatChipDetails, ChatCommandFacts, ChatCommit, ChatContextFacts, ChatPaths, ChatReferences, ChatReferencesChange, ChatResolvedPath, ChatSearchState, ChatSearchSync, ChatSessionFacts, ChatSiteIcons, ChatSkillFacts } from "./transcript-host.js";
|
|
86
88
|
import { TurnPromptDraft, promptDraftOf } from "./turn-prompt.js";
|
|
87
|
-
export { AGENT_GROUPING, type AuthCardPlan, type AuthFixes, type AuthSettingsTarget, type BashExitMeta, BookDraft, BuildQuerySidebarRowsOptions, BuildSidebarRowsOptions, CHATS_BUCKET, CHUNK_THRESHOLD, COMMON_EMOJI, CalendarOptions, ChatAttachment, ChatAttachmentOriginal, ChatBadgeActions, ChatBlockRunOptions, ChatBlockRunTransport, ChatBlockRuns, ChatChipDetails, ChatCommandFacts, ChatCommit, ChatContextFacts, ChatEvent, ChatHost, ChatInteraction, ChatLabels, ChatModel, ChatModelProvider, ChatPaths, ChatReferences, ChatReferencesChange, ChatResolvedPath, ChatSearchState, ChatSearchSync, ChatSession, ChatSessionFacts, ChatSessionStatus, ChatSiteIcons, ChatSkillFacts, ChipResolution, ChipViewLabels, type Cluster, type CommandArgSuggestionSummary, type CommandSummary, CompactionProgress, CompactionProgressStore, CompactionSignal, ComposerAgentProfile, ComposerAgents, ComposerAttachment, ComposerAutocomplete, ComposerCacheImpact, ComposerCacheImpactChange, ComposerChromeLabels, ComposerCommandArgs, ComposerCompletions, ComposerContext, ComposerContextBreakdown, ComposerContextStatus, ComposerControls, ComposerCostStatus, ComposerDraftAttachmentsListener, ComposerDraftStorage, ComposerDrafts, ComposerEffort, ComposerExtensionItem, ComposerExtensionProvider, ComposerFolderLocation, ComposerFolders, ComposerHost, ComposerLabels, type ComposerListScope, type ComposerLists, ComposerMode, ComposerModelEntry, ComposerModelOption, ComposerModels, ComposerPrefs, ComposerPrefsState, ComposerPromptSuggestion, ComposerRememberedModel, ComposerRunProgress, ComposerRuns, ComposerScope, ComposerSessionView, ComposerSharedGhost, ComposerSkillGroup, ComposerSuggestions, ConversationBadge, ConversationBadgeData, ConversationBadgeInput, DEFAULT_CHAT_LABELS, DEFAULT_COMPOSER_CHROME_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_MODEL_PICKER_PREFS, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, DeltaBucket, DirectoryServer, DirectorySettings, DotStateInput, type DotVariant, DraftBook, DraftFolderSource, DraftFolderState, DraftPlaceIssue, DraftScope, DraftScopeState, DraftScopeStore, DraftScopeStoreOptions, type DrainPlan, EMPTY_RUN_METER, EffortPickerTarget, type ExchangeFoldStats, type ExchangeMedium, FileChip, FileChipKind, type FileEntry, type FoldActionItem, type FoldActionState, type FrameScheduler, type GroupCluster, HostStatus, HostView, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, ImageModelRow, InboxRow, InboxRowsOptions, InboxSection, InboxShelfId, InboxSummary, InboxUrgency, LIVE_BLOCK_RUN_LINES, type LazyList, ListableSession, LiveBlockRun, LiveCostStatus, LiveStreamProgress, type LoadEarlierOptions, MAIN_SESSION_ICON_KEY, MAX_EXTENSION_COMPOSER_BADGES, MAX_ROW_CHIPS, MODEL_PICKER_STORAGE_KEY, type MediaRef, ModelCatalogRow, ModelKnobs, ModelKnobsMemory, ModelKnobsStore, ModelNames, ModelNamesProvider, ModelNamesStore, ModelPickRef, ModelPickerPrefs, ModelPickerPrefsStorage, ModelPickerPrefsStore, NO_PROVIDER_ERROR, NO_SIDEBAR_CONTRIBUTIONS, NewChatPlaceKey, NewSessionDefaults, NewSessionRequest, type NotificationSettings, type NotifyEvent, OpenFence, type OtherStreamSignal, type Owned, PINNED_PROJECTS_KEY, PROJECT_GROUP_CAP, PROJECT_ICONS_KEY, type PairingResult, PathResolver, PathResolverOptions, type PendingEcho, PinsBySpace, ProjectIcon, ProjectIconMap, ProjectInSpace, type PromptAttachment, type PromptOrigin, type PromptOriginWire, type PromptViewOrigin, REFERENCES_STORAGE_KEY, RELATIVE_TIME_DATE_AFTER_DAYS, Readable, ReferenceStore, ReferenceStoreOptions, ReferenceViewEntry, type ResourceSnapshot, type Row, RunEstimatesRow, RunEstimatesSignal, RunEstimatesStore, type RunFailure, RunMeter, RunMeterRow, RunMeterSignal, RunMeterState, RuntimeNow, RuntimeOrigin, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SMOOTH_TICK_MS, SecretTimeLeft, type SelectStops, SendAttachment, SendDraft, SendFlowDeps, SendInput, SendPromptAttachment, SendRequest, SessionActivity, SessionActivityFilter, SessionActivitySignal, SessionActivityStore, SessionArchiveFilter, SessionBadgesEntry, SessionBadgesSource, SessionBadgesStore, SessionDirectory, SessionDirectoryOptions, SessionDirectorySource, SessionDirectoryState, SessionDirectoryStreams, type SessionFallbackModel, SessionGroupBy, SessionHistory, SessionHistoryDirection, SessionHistoryOptions, SessionHistoryPage, SessionHistoryState, SessionHistoryStore, type SessionInboxFields, type SessionInboxPatch, SessionListOptions, SessionListRow, SessionNotification, SessionNotificationStore, type SessionPageState, SessionRef, SessionRemoval, type SessionRetryState, SessionRowChange, SessionSearchHit, SessionSortBy, type SessionStreamActions, type SessionStreamPage, type SessionStreamSignal, SessionStreamStore, type SessionStreamStoreOptions, type SessionStreamWrite, type SessionStreams, type SessionStreamsOptions, SessionWindowMode, SetDefaultModel, SharedDraft, SharedDraftAttachmentsChange, SharedDraftChange, SidebarContributionStores, SidebarContributions, SidebarDotState, SidebarEnvironmentHost, SidebarExtensionView, SidebarGroupBy, SidebarGrouping, SidebarHost, SidebarInboxGroupBy, SidebarItemEntry, SidebarLabels, SidebarLastSessions, type SidebarLayout, SidebarListRow, SidebarListSession, SidebarNode, SidebarOrigin, SidebarQueryLayer, SidebarRowChip, SidebarRowDecoration, SidebarSortBy, SidebarSpace, SidebarView, SidebarViewDefaults, SidebarViewMap, SidebarViewPicks, SidebarViewRecord, SidebarViews, SidebarViewsHost, SidebarViewsOptions, SidebarViewsStorage, type SkillConfig, SpaceSwitcherPrefs, type SpawnMeta, StoredComposerDraft, type TaskInfo, type ToolPairing, type ToolRowModel, Transcript, TranscriptState, TurnPromptDraft, UNDECIDED_NEW_CHAT_DRAFT_KEY, VIEW_CHOICE, WebStorageDraftStorageOptions, Writable, activityLabel, applyInboxPatch, approvalNotificationDetail, authFailureDetails, availableProjectsOf, batchTaskRuns, batchThinkingRuns, batchToolRuns, beginChipWork, buildHostSidebarRows, buildInboxRows, buildQuerySidebarRows, buildSessionRows, buildSidebarRows, caretEffectivelyAtStart, chipForPath, chipWorkBusy, claimChildSessions, classifyInlineCode, clearedViewFilters, clusterByOwner, collapseEvents, commandName, commandRef, commandView, commitModelPick, commitView, compareInboxSection, compareSessions, composeLiveCost, composeSubmitText, computeSelectStops, constant, conversationBadges, createAuthFixes, createChatBlockRuns, createCompactionProgress, createComposerLists, createDecorator, createDraftBook, createDraftScopeStore, createModelKnobs, createModelNames, createModelPickerPrefs, createNotificationStore, createPathResolver, createReferenceStore, createRunEstimates, createRunMeter, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSessionStreamActions, createSessionStreams, createSidebarViews, createSiteIcons, createWebStorageDraftStorage, dateBucket, decodeHistoryEntry, defaultFrameScheduler, defaultModelPatch, defaultSidebarLayout, deleteSessionPrompt, deriveDotState, dockRunReceipts, dotVariantFor, draftBookOf, draftFolderPath, draftLocalFolder, draftScopeOf, drainBucket, effortPickerTarget, encodeHistoryDraft, environmentKindLabel, environmentSummaryText, exchangesMedia, exitsModeOnKey, extensionSpaceOf, failureTooltip, filterDirectorySessions, filterQueryOf, filterSessions, filtersForSpace, findCommand, findLastStreamingRow, firstGrapheme, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, formatElapsedShort, formatSessionCostLabel, groupsByFolder, hostReachable, hostStatusLabel, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, inheritRowIdentity, isAuthFixed, isProjectIcon, isProjectMember, isSettled, isSnoozed, itemRows, itemsForSpace, lastModelChainOf, markRunFailures, mediaRefsOf, mediumKey, mergeLiveTail, mergePromptPreviews, mergeSidebarSpaces, missingPreviewData, modeForTypedChar, modelKnobsOf, modelNamesOf, namerFor, nestSidebarRows, nestToolCalls, nestedCallVisible, newChatDraftKey, newSessionRequest, nextInboxChangeAt, nextSavedViewName, nextWakeAt, notificationContent, openFenceOf, pairToolEvents, parseBashExitMeta, parseModelPickerPrefs, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, planAuthCard, positionSuffix, projectKeyOf, projectPathOf, promptAttachments, promptDraftOf, promptOriginWire, promptRefs, questionNotificationDetail, readSidebarViews, recentHostFolders, recentLocalFolders, reduceActivity, reduceCompaction, refusedSpawn, relativeTime, rememberableChain, rememberedDefaultModel, rememberedPick, repoGroups, resetChipWorkForTests, resolveBadgePanel, resolveChipPath, resolveGrouping, resolveSidebarView, resolveSort, rowTurnIds, runsInRemoteSandbox, safeSurrogateSlice, secretExpiryWords, secretTimeLeft, secretTimeLeftIso, selectEditEvents, sendPrompt, sessionForToken, sessionRefsOf, sessionView, settledResource, shellCommandOf, shortUrl, shouldNotify, sidebarContributionsOf, sidebarLayoutOf, sidebarViewDefaults, siteOrigin, skillGroupView, skillName, skillView, spaceMembership, splitMarkdown, stableSelection, stopForRow, switcherSpaces, tickBucket, toolAction, toolFailed, unsentDraft, urlRefs, useReadable, viewFilterOf, viewFiltersOn, whenChipsSettle, wireAttachmentsToChat, wireOriginal, withPinnedProject, withoutPartialEmphasis, withoutPartialFence, writable };
|
|
89
|
+
export { AGENT_GROUPING, type AuthCardPlan, type AuthFixes, type AuthSettingsTarget, type BashExitMeta, BookDraft, BuildQuerySidebarRowsOptions, BuildSidebarRowsOptions, CHATS_BUCKET, CHUNK_THRESHOLD, COMMON_EMOJI, CalendarOptions, ChatAttachment, ChatAttachmentOriginal, ChatBadgeActions, ChatBlockRunOptions, ChatBlockRunTransport, ChatBlockRuns, ChatChipDetails, ChatCommandFacts, ChatCommit, ChatContextFacts, ChatEvent, ChatHost, ChatInteraction, ChatLabels, ChatModel, ChatModelProvider, ChatPaths, ChatReferences, ChatReferencesChange, ChatResolvedPath, ChatSearchState, ChatSearchSync, ChatSession, ChatSessionFacts, ChatSessionStatus, ChatSiteIcons, ChatSkillFacts, ChipResolution, ChipViewLabels, type Cluster, type CommandArgSuggestionSummary, type CommandSummary, CompactionProgress, CompactionProgressStore, CompactionSignal, ComposerAgentProfile, ComposerAgents, ComposerAttachment, ComposerAutocomplete, ComposerCacheImpact, ComposerCacheImpactChange, ComposerChromeLabels, ComposerCommandArgs, ComposerCompletions, ComposerContext, ComposerContextBreakdown, ComposerContextStatus, ComposerControls, ComposerCostStatus, ComposerDraftAttachmentsListener, ComposerDraftStorage, ComposerDrafts, ComposerEffort, ComposerExtensionItem, ComposerExtensionProvider, ComposerFolderLocation, ComposerFolders, ComposerHost, ComposerLabels, type ComposerListScope, type ComposerLists, ComposerMode, ComposerModelEntry, ComposerModelOption, ComposerModels, ComposerPrefs, ComposerPrefsState, ComposerPromptSuggestion, ComposerRememberedModel, ComposerRunProgress, ComposerRuns, ComposerScope, ComposerSessionView, ComposerSharedGhost, ComposerSkillGroup, ComposerSuggestions, ConversationBadge, ConversationBadgeData, ConversationBadgeInput, DEFAULT_CHAT_LABELS, DEFAULT_COMPOSER_CHROME_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_MODEL_PICKER_PREFS, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, DeltaBucket, DirectoryServer, DirectorySettings, DotStateInput, type DotVariant, DraftBook, DraftFolderSource, DraftFolderState, DraftPlaceIssue, DraftScope, DraftScopeState, DraftScopeStore, DraftScopeStoreOptions, type DrainPlan, EMPTY_RAIL, EMPTY_RUN_METER, EffortPickerTarget, type ExchangeFoldStats, type ExchangeMedium, FileChip, FileChipKind, type FileEntry, type FoldActionItem, type FoldActionState, type FrameScheduler, type GroupCluster, HostStatus, HostView, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, ImageModelRow, InboxRow, InboxRowsOptions, InboxSection, InboxShelfId, InboxSummary, InboxUrgency, LIVE_BLOCK_RUN_LINES, type LazyList, ListableSession, LiveBlockRun, LiveCostStatus, LiveStreamProgress, type LoadEarlierOptions, MAIN_SESSION_ICON_KEY, MAX_EXTENSION_COMPOSER_BADGES, MAX_ROW_CHIPS, MODEL_PICKER_STORAGE_KEY, type MediaRef, ModelCatalogRow, ModelKnobs, ModelKnobsMemory, ModelKnobsStore, ModelNames, ModelNamesProvider, ModelNamesStore, ModelPickRef, ModelPickerPrefs, ModelPickerPrefsStorage, ModelPickerPrefsStore, NO_PROVIDER_ERROR, NO_SIDEBAR_CONTRIBUTIONS, NewChatPlaceKey, NewSessionDefaults, NewSessionRequest, type NotificationSettings, type NotifyEvent, OpenFence, type OtherStreamSignal, type Owned, PINNED_PROJECTS_KEY, PROJECT_GROUP_CAP, PROJECT_ICONS_KEY, type PairingResult, PathResolver, PathResolverOptions, type PendingEcho, PinsBySpace, ProjectIcon, ProjectIconMap, ProjectInSpace, type PromptAttachment, type PromptOrigin, type PromptOriginWire, type PromptViewOrigin, REFERENCES_STORAGE_KEY, RELATIVE_TIME_DATE_AFTER_DAYS, type RailExchange, type RailModel, Readable, ReferenceStore, ReferenceStoreOptions, ReferenceViewEntry, type ResourceSnapshot, type Row, RunEstimatesRow, RunEstimatesSignal, RunEstimatesStore, type RunFailure, RunMeter, RunMeterRow, RunMeterSignal, RunMeterState, RuntimeNow, RuntimeOrigin, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SMOOTH_TICK_MS, SecretTimeLeft, type SelectStops, SendAttachment, SendDraft, SendFlowDeps, SendInput, SendPromptAttachment, SendRequest, SessionActivity, SessionActivityFilter, SessionActivitySignal, SessionActivityStore, SessionArchiveFilter, SessionBadgesEntry, SessionBadgesSource, SessionBadgesStore, SessionDirectory, SessionDirectoryOptions, SessionDirectorySource, SessionDirectoryState, SessionDirectoryStreams, type SessionFallbackModel, SessionGroupBy, SessionHistory, SessionHistoryDirection, SessionHistoryOptions, SessionHistoryPage, SessionHistoryState, SessionHistoryStore, type SessionInboxFields, type SessionInboxPatch, SessionListOptions, SessionListRow, SessionNotification, SessionNotificationStore, type SessionPageState, SessionRef, SessionRemoval, type SessionRetryState, SessionRowChange, SessionSearchHit, SessionSortBy, type SessionStreamActions, type SessionStreamPage, type SessionStreamSignal, SessionStreamStore, type SessionStreamStoreOptions, type SessionStreamWrite, type SessionStreams, type SessionStreamsOptions, SessionWindowMode, SetDefaultModel, SharedDraft, SharedDraftAttachmentsChange, SharedDraftChange, SidebarContributionStores, SidebarContributions, SidebarDotState, SidebarEnvironmentHost, SidebarExtensionView, SidebarGroupBy, SidebarGrouping, SidebarHost, SidebarInboxGroupBy, SidebarItemEntry, SidebarLabels, SidebarLastSessions, type SidebarLayout, SidebarListRow, SidebarListSession, SidebarNode, SidebarOrigin, SidebarQueryLayer, SidebarRowChip, SidebarRowDecoration, SidebarSortBy, SidebarSpace, SidebarView, SidebarViewDefaults, SidebarViewMap, SidebarViewPicks, SidebarViewRecord, SidebarViews, SidebarViewsHost, SidebarViewsOptions, SidebarViewsStorage, type SkillConfig, SpaceSwitcherPrefs, type SpawnMeta, StoredComposerDraft, TOOL_OUTPUT_PAGE_SIZE, type TaskInfo, ToolOutputPager, ToolOutputPagerOptions, ToolOutputPagerState, ToolOutputRange, ToolOutputRangeReader, type ToolPairing, type ToolRowModel, Transcript, type TranscriptRailState, type TranscriptRailStore, TranscriptState, TurnPromptDraft, UNDECIDED_NEW_CHAT_DRAFT_KEY, VIEW_CHOICE, WebStorageDraftStorageOptions, Writable, activityLabel, applyInboxPatch, approvalNotificationDetail, authFailureDetails, availableProjectsOf, batchTaskRuns, batchThinkingRuns, batchToolRuns, beginChipWork, buildHostSidebarRows, buildInboxRows, buildQuerySidebarRows, buildSessionRows, buildSidebarRows, caretEffectivelyAtStart, chipForPath, chipWorkBusy, claimChildSessions, classifyInlineCode, clearedViewFilters, clusterByOwner, collapseEvents, commandName, commandRef, commandView, commitModelPick, commitView, compareInboxSection, compareSessions, composeLiveCost, composeSubmitText, computeRailModel, computeRailModelParts, computeSelectStops, constant, conversationBadges, createAuthFixes, createChatBlockRuns, createCompactionProgress, createComposerLists, createDecorator, createDraftBook, createDraftScopeStore, createModelKnobs, createModelNames, createModelPickerPrefs, createNotificationStore, createPathResolver, createReferenceStore, createRunEstimates, createRunMeter, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSessionStreamActions, createSessionStreams, createSidebarViews, createSiteIcons, createToolOutputPager, createTranscriptRailStore, createWebStorageDraftStorage, dataRowSelector, dateBucket, decodeHistoryEntry, defaultFrameScheduler, defaultModelPatch, defaultSidebarLayout, deleteSessionPrompt, deriveDotState, dockRunReceipts, dotVariantFor, draftBookOf, draftFolderPath, draftLocalFolder, draftScopeOf, drainBucket, effortPickerTarget, encodeHistoryDraft, environmentKindLabel, environmentSummaryText, exchangesMedia, exitsModeOnKey, extensionSpaceOf, failureTooltip, filterDirectorySessions, filterQueryOf, filterSessions, filtersForSpace, findCommand, findLastStreamingRow, firstGrapheme, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, formatElapsedShort, formatSessionCostLabel, groupsByFolder, hostReachable, hostStatusLabel, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, inheritRowIdentity, isAuthFixed, isProjectIcon, isProjectMember, isSettled, isSnoozed, itemRows, itemsForSpace, lastModelChainOf, markRunFailures, mediaRefsOf, mediumKey, mergeLiveTail, mergePromptPreviews, mergeSidebarSpaces, missingPreviewData, modeForTypedChar, modelKnobsOf, modelNamesOf, namerFor, nestSidebarRows, nestToolCalls, nestedCallVisible, newChatDraftKey, newSessionRequest, nextInboxChangeAt, nextSavedViewName, nextWakeAt, notificationContent, openFenceOf, pairToolEvents, parseBashExitMeta, parseModelPickerPrefs, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, plainPreview, planAuthCard, positionSuffix, projectKeyOf, projectPathOf, promptAttachments, promptDraftOf, promptOriginWire, promptRefs, questionNotificationDetail, railWithOutline, readSidebarViews, recentHostFolders, recentLocalFolders, reduceActivity, reduceCompaction, refusedSpawn, relativeTime, rememberableChain, rememberedDefaultModel, rememberedPick, repoGroups, resetChipWorkForTests, resolveBadgePanel, resolveChipPath, resolveGrouping, resolveSidebarView, resolveSort, rowTurnIds, runsInRemoteSandbox, safeSurrogateSlice, sameRail, secretExpiryWords, secretTimeLeft, secretTimeLeftIso, selectEditEvents, sendPrompt, sessionForToken, sessionRefsOf, sessionView, settledResource, shellCommandOf, shortUrl, shouldNotify, sidebarContributionsOf, sidebarLayoutOf, sidebarViewDefaults, siteOrigin, skillGroupView, skillName, skillView, sliceToolOutput, spaceMembership, splitMarkdown, stableSelection, stopForRow, switcherSpaces, tickBucket, toolAction, toolFailed, toolOutputPagerDone, unsentDraft, urlRefs, useReadable, viewFilterOf, viewFiltersOn, whenChipsSettle, wireAttachmentsToChat, wireOriginal, withPinnedProject, withoutPartialEmphasis, withoutPartialFence, writable };
|
|
@@ -10,18 +10,20 @@ import { SessionStreamStore } from "./streams/store.js";
|
|
|
10
10
|
import { DEFAULT_MODEL_PICKER_PREFS, MODEL_PICKER_STORAGE_KEY, createModelPickerPrefs, parseModelPickerPrefs } from "./composer/model-picker-prefs.js";
|
|
11
11
|
import { EMPTY_RUN_METER, createRunMeter } from "./composer/run-meter.js";
|
|
12
12
|
import { beginChipWork, chipWorkBusy, resetChipWorkForTests, whenChipsSettle } from "./chip-settle.js";
|
|
13
|
-
import { applyInboxPatch, isSettled, isSnoozed, nextWakeAt } from "./sidebar/inbox-state.js";
|
|
14
13
|
import { commandName, commandView, commitView, sessionForToken, sessionView, skillGroupView, skillName, skillView } from "./chip-views.js";
|
|
14
|
+
import { applyInboxPatch, isSettled, isSnoozed, nextWakeAt } from "./sidebar/inbox-state.js";
|
|
15
15
|
import { caretEffectivelyAtStart, composeSubmitText, decodeHistoryEntry, encodeHistoryDraft, exitsModeOnKey, modeForTypedChar, unsentDraft } from "./composer-modes.js";
|
|
16
|
+
import { createSessionStreams } from "./streams/session-streams.js";
|
|
17
|
+
import { createDraftScopeStore, draftScopeOf } from "./draft-scope.js";
|
|
16
18
|
import { DEFAULT_COMPOSER_CHROME_LABELS } from "./composer/labels-chrome.js";
|
|
17
19
|
import { DEFAULT_COMPOSER_LABELS } from "./composer/labels.js";
|
|
18
|
-
import { createDraftScopeStore, draftScopeOf } from "./draft-scope.js";
|
|
19
20
|
import { draftFolderPath, draftLocalFolder, recentHostFolders, recentLocalFolders } from "./draft-target.js";
|
|
20
21
|
import { chipForPath, classifyInlineCode, positionSuffix, resolveChipPath } from "./file-chip.js";
|
|
21
22
|
import { hostReachable, hostStatusLabel } from "./hosts.js";
|
|
22
23
|
import { DEFAULT_CHAT_LABELS, secretExpiryWords } from "./labels.js";
|
|
23
24
|
import { CHUNK_THRESHOLD, openFenceOf, splitMarkdown, withoutPartialEmphasis, withoutPartialFence } from "./markdown-chunks.js";
|
|
24
25
|
import { approvalNotificationDetail, notificationContent, questionNotificationDetail, shouldNotify } from "./notifications.js";
|
|
26
|
+
import { TOOL_OUTPUT_PAGE_SIZE, createToolOutputPager, sliceToolOutput, toolOutputPagerDone } from "./output-pager.js";
|
|
25
27
|
import { createPathResolver } from "./path-resolver.js";
|
|
26
28
|
import { findCommand } from "./composer/commands.js";
|
|
27
29
|
import { promptOriginWire } from "./prompt-origin.js";
|
|
@@ -32,13 +34,13 @@ import { exchangesMedia, mediaRefsOf, mediumKey } from "./transcript/exchange-me
|
|
|
32
34
|
import { foldActionItems, toolAction } from "./transcript/fold-actions.js";
|
|
33
35
|
import { dockRunReceipts, dotVariantFor, findLastStreamingRow, foldExchanges, foldWorkerRows } from "./transcript/fold.js";
|
|
34
36
|
import { nestToolCalls, nestedCallVisible } from "./transcript/nesting.js";
|
|
35
|
-
import { failureTooltip, markRunFailures } from "./transcript/run-failures.js";
|
|
36
37
|
import { computeSelectStops, rowTurnIds, stopForRow } from "./transcript/select-stops.js";
|
|
38
|
+
import { EMPTY_RAIL, computeRailModel, computeRailModelParts, createTranscriptRailStore, dataRowSelector, plainPreview, railWithOutline, sameRail } from "./transcript/rail.js";
|
|
39
|
+
import { failureTooltip, markRunFailures } from "./transcript/run-failures.js";
|
|
37
40
|
import { secretTimeLeft, secretTimeLeftIso } from "./secrets.js";
|
|
38
41
|
import { createRunEstimates, pickRunEstimate } from "./sidebar/estimates.js";
|
|
39
42
|
import { createSessionStreamActions } from "./streams/actions.js";
|
|
40
43
|
import { selectEditEvents, stableSelection } from "./streams/selectors.js";
|
|
41
|
-
import { createSessionStreams } from "./streams/session-streams.js";
|
|
42
44
|
import { composeLiveCost, formatSessionCostLabel } from "./composer/live-cost.js";
|
|
43
45
|
import { createModelKnobs, modelKnobsOf } from "./composer/model-knobs.js";
|
|
44
46
|
import { createModelNames, modelNamesOf, namerFor } from "./composer/model-names.js";
|
|
@@ -49,7 +51,10 @@ import { defaultModelPatch, effortPickerTarget, rememberedDefaultModel } from ".
|
|
|
49
51
|
import { PROJECT_GROUP_CAP, RELATIVE_TIME_DATE_AFTER_DAYS, buildSessionRows, compareSessions, dateBucket, filterSessions, formatElapsedShort, relativeTime } from "./session-list.js";
|
|
50
52
|
import { wireAttachmentsToChat } from "./composer/draft-sync.js";
|
|
51
53
|
import { createSiteIcons, siteOrigin } from "./site-icons.js";
|
|
54
|
+
import { COMMON_EMOJI, MAIN_SESSION_ICON_KEY, PROJECT_ICONS_KEY, firstGrapheme, isProjectIcon, parseProjectIcons } from "./sidebar/project-icons.js";
|
|
52
55
|
import { DEFAULT_SIDEBAR_LABELS } from "./sidebar/labels.js";
|
|
56
|
+
import { deleteSessionPrompt, environmentKindLabel, environmentSummaryText, runsInRemoteSandbox } from "./sidebar/environment.js";
|
|
57
|
+
import { pinSession, pinnedSessions } from "./sidebar/pinned-sessions.js";
|
|
53
58
|
import { activityLabel, createSessionActivity, reduceActivity } from "./sidebar/activity.js";
|
|
54
59
|
import { createSessionBadges } from "./sidebar/badges.js";
|
|
55
60
|
import { createCompactionProgress, reduceCompaction } from "./sidebar/compaction.js";
|
|
@@ -60,15 +65,12 @@ import { CHATS_BUCKET, buildHostSidebarRows, buildQuerySidebarRows, buildSidebar
|
|
|
60
65
|
import { DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, createSidebarViews, defaultSidebarLayout, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, readSidebarViews, resolveSidebarView, sidebarLayoutOf, sidebarViewDefaults } from "./sidebar/view.js";
|
|
61
66
|
import { availableProjectsOf, createSessionDirectory, filterDirectorySessions, projectKeyOf, sessionRefsOf } from "./sidebar/directory.js";
|
|
62
67
|
import { deriveDotState } from "./sidebar/dot-state.js";
|
|
63
|
-
import { deleteSessionPrompt, environmentKindLabel, environmentSummaryText, runsInRemoteSandbox } from "./sidebar/environment.js";
|
|
64
68
|
import { SESSION_HISTORY_LIMIT, createSessionHistory, parseSessionHistory } from "./sidebar/history.js";
|
|
65
|
-
import { INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, buildInboxRows, compareInboxSection, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, nextInboxChangeAt } from "./sidebar/inbox.js";
|
|
69
|
+
import { INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, buildInboxRows, compareInboxSection, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, nextInboxChangeAt } from "./sidebar/inbox.js";
|
|
66
70
|
import { PINNED_PROJECTS_KEY, parsePinnedProjects, withPinnedProject } from "./sidebar/pinned-projects.js";
|
|
67
|
-
import { pinSession, pinnedSessions } from "./sidebar/pinned-sessions.js";
|
|
68
|
-
import { COMMON_EMOJI, MAIN_SESSION_ICON_KEY, PROJECT_ICONS_KEY, firstGrapheme, isProjectIcon, parseProjectIcons } from "./sidebar/project-icons.js";
|
|
69
71
|
import { SMOOTH_TICK_MS, drainBucket, safeSurrogateSlice, tickBucket } from "./smooth-stream.js";
|
|
70
72
|
import { constant, useReadable, writable } from "./store.js";
|
|
71
73
|
import { createComposerLists } from "./composer/composer-sources.js";
|
|
72
74
|
import { UNDECIDED_NEW_CHAT_DRAFT_KEY, createDraftBook, createWebStorageDraftStorage, draftBookOf, newChatDraftKey } from "./composer/draft-book.js";
|
|
73
75
|
import { promptDraftOf } from "./turn-prompt.js";
|
|
74
|
-
export { AGENT_GROUPING, CHATS_BUCKET, CHUNK_THRESHOLD, COMMON_EMOJI, DEFAULT_CHAT_LABELS, DEFAULT_COMPOSER_CHROME_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_MODEL_PICKER_PREFS, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, EMPTY_RUN_METER, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, LIVE_BLOCK_RUN_LINES, MAIN_SESSION_ICON_KEY, MAX_EXTENSION_COMPOSER_BADGES, MAX_ROW_CHIPS, MODEL_PICKER_STORAGE_KEY, NO_PROVIDER_ERROR, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_GROUP_CAP, PROJECT_ICONS_KEY, REFERENCES_STORAGE_KEY, RELATIVE_TIME_DATE_AFTER_DAYS, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SMOOTH_TICK_MS, SessionStreamStore, UNDECIDED_NEW_CHAT_DRAFT_KEY, VIEW_CHOICE, activityLabel, applyInboxPatch, approvalNotificationDetail, authFailureDetails, availableProjectsOf, batchTaskRuns, batchThinkingRuns, batchToolRuns, beginChipWork, buildHostSidebarRows, buildInboxRows, buildQuerySidebarRows, buildSessionRows, buildSidebarRows, caretEffectivelyAtStart, chipForPath, chipWorkBusy, claimChildSessions, classifyInlineCode, clearedViewFilters, clusterByOwner, collapseEvents, commandName, commandRef, commandView, commitModelPick, commitView, compareInboxSection, compareSessions, composeLiveCost, composeSubmitText, computeSelectStops, constant, conversationBadges, createAuthFixes, createChatBlockRuns, createCompactionProgress, createComposerLists, createDecorator, createDraftBook, createDraftScopeStore, createModelKnobs, createModelNames, createModelPickerPrefs, createNotificationStore, createPathResolver, createReferenceStore, createRunEstimates, createRunMeter, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSessionStreamActions, createSessionStreams, createSidebarViews, createSiteIcons, createWebStorageDraftStorage, dateBucket, decodeHistoryEntry, defaultFrameScheduler, defaultModelPatch, defaultSidebarLayout, deleteSessionPrompt, deriveDotState, dockRunReceipts, dotVariantFor, draftBookOf, draftFolderPath, draftLocalFolder, draftScopeOf, drainBucket, effortPickerTarget, encodeHistoryDraft, environmentKindLabel, environmentSummaryText, exchangesMedia, exitsModeOnKey, extensionSpaceOf, failureTooltip, filterDirectorySessions, filterQueryOf, filterSessions, filtersForSpace, findCommand, findLastStreamingRow, firstGrapheme, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, formatElapsedShort, formatSessionCostLabel, groupsByFolder, hostReachable, hostStatusLabel, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, inheritRowIdentity, isAuthFixed, isProjectIcon, isProjectMember, isSettled, isSnoozed, itemRows, itemsForSpace, lastModelChainOf, markRunFailures, mediaRefsOf, mediumKey, mergeLiveTail, mergePromptPreviews, mergeSidebarSpaces, missingPreviewData, modeForTypedChar, modelKnobsOf, modelNamesOf, namerFor, nestSidebarRows, nestToolCalls, nestedCallVisible, newChatDraftKey, newSessionRequest, nextInboxChangeAt, nextSavedViewName, nextWakeAt, notificationContent, openFenceOf, pairToolEvents, parseBashExitMeta, parseModelPickerPrefs, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, planAuthCard, positionSuffix, projectKeyOf, projectPathOf, promptAttachments, promptDraftOf, promptOriginWire, promptRefs, questionNotificationDetail, readSidebarViews, recentHostFolders, recentLocalFolders, reduceActivity, reduceCompaction, refusedSpawn, relativeTime, rememberableChain, rememberedDefaultModel, rememberedPick, repoGroups, resetChipWorkForTests, resolveBadgePanel, resolveChipPath, resolveGrouping, resolveSidebarView, resolveSort, rowTurnIds, runsInRemoteSandbox, safeSurrogateSlice, secretExpiryWords, secretTimeLeft, secretTimeLeftIso, selectEditEvents, sendPrompt, sessionForToken, sessionRefsOf, sessionView, settledResource, shellCommandOf, shortUrl, shouldNotify, sidebarContributionsOf, sidebarLayoutOf, sidebarViewDefaults, siteOrigin, skillGroupView, skillName, skillView, spaceMembership, splitMarkdown, stableSelection, stopForRow, switcherSpaces, tickBucket, toolAction, toolFailed, unsentDraft, urlRefs, useReadable, viewFilterOf, viewFiltersOn, whenChipsSettle, wireAttachmentsToChat, wireOriginal, withPinnedProject, withoutPartialEmphasis, withoutPartialFence, writable };
|
|
76
|
+
export { AGENT_GROUPING, CHATS_BUCKET, CHUNK_THRESHOLD, COMMON_EMOJI, DEFAULT_CHAT_LABELS, DEFAULT_COMPOSER_CHROME_LABELS, DEFAULT_COMPOSER_LABELS, DEFAULT_MODEL_PICKER_PREFS, DEFAULT_SIDEBAR_LABELS, DEFAULT_SIDEBAR_VIEW, DEFAULT_SIDEBAR_VIEW_DEFAULTS, DEFAULT_SWITCHER_PREFS, EMPTY_RAIL, EMPTY_RUN_METER, INBOX_EARLIER_AFTER_MS, INBOX_PAGE, INBOX_PAGE_MORE, INBOX_RUN_HOLD_MS, INBOX_SHELVES, INBOX_SHELVES_FOLDED, INBOX_SHELVES_KEY, LIVE_BLOCK_RUN_LINES, MAIN_SESSION_ICON_KEY, MAX_EXTENSION_COMPOSER_BADGES, MAX_ROW_CHIPS, MODEL_PICKER_STORAGE_KEY, NO_PROVIDER_ERROR, NO_SIDEBAR_CONTRIBUTIONS, PINNED_PROJECTS_KEY, PROJECT_GROUP_CAP, PROJECT_ICONS_KEY, REFERENCES_STORAGE_KEY, RELATIVE_TIME_DATE_AFTER_DAYS, SESSION_HISTORY_LIMIT, SIDEBAR_SPACE_KEY, SIDEBAR_SWITCHER_KEY, SIDEBAR_VIEW_KEY, SIDEBAR_VIEW_VERSION, SMOOTH_TICK_MS, SessionStreamStore, TOOL_OUTPUT_PAGE_SIZE, UNDECIDED_NEW_CHAT_DRAFT_KEY, VIEW_CHOICE, activityLabel, applyInboxPatch, approvalNotificationDetail, authFailureDetails, availableProjectsOf, batchTaskRuns, batchThinkingRuns, batchToolRuns, beginChipWork, buildHostSidebarRows, buildInboxRows, buildQuerySidebarRows, buildSessionRows, buildSidebarRows, caretEffectivelyAtStart, chipForPath, chipWorkBusy, claimChildSessions, classifyInlineCode, clearedViewFilters, clusterByOwner, collapseEvents, commandName, commandRef, commandView, commitModelPick, commitView, compareInboxSection, compareSessions, composeLiveCost, composeSubmitText, computeRailModel, computeRailModelParts, computeSelectStops, constant, conversationBadges, createAuthFixes, createChatBlockRuns, createCompactionProgress, createComposerLists, createDecorator, createDraftBook, createDraftScopeStore, createModelKnobs, createModelNames, createModelPickerPrefs, createNotificationStore, createPathResolver, createReferenceStore, createRunEstimates, createRunMeter, createSessionActivity, createSessionBadges, createSessionDirectory, createSessionHistory, createSessionStreamActions, createSessionStreams, createSidebarViews, createSiteIcons, createToolOutputPager, createTranscriptRailStore, createWebStorageDraftStorage, dataRowSelector, dateBucket, decodeHistoryEntry, defaultFrameScheduler, defaultModelPatch, defaultSidebarLayout, deleteSessionPrompt, deriveDotState, dockRunReceipts, dotVariantFor, draftBookOf, draftFolderPath, draftLocalFolder, draftScopeOf, drainBucket, effortPickerTarget, encodeHistoryDraft, environmentKindLabel, environmentSummaryText, exchangesMedia, exitsModeOnKey, extensionSpaceOf, failureTooltip, filterDirectorySessions, filterQueryOf, filterSessions, filtersForSpace, findCommand, findLastStreamingRow, firstGrapheme, firstRowId, foldActionItems, foldExchanges, foldWorkerRows, formatElapsedShort, formatSessionCostLabel, groupsByFolder, hostReachable, hostStatusLabel, inboxDockStart, inboxEarlierAfterMs, inboxFolderOf, inboxSectionOf, inboxSessionOrder, inheritRowIdentity, isAuthFixed, isProjectIcon, isProjectMember, isSettled, isSnoozed, itemRows, itemsForSpace, lastModelChainOf, markRunFailures, mediaRefsOf, mediumKey, mergeLiveTail, mergePromptPreviews, mergeSidebarSpaces, missingPreviewData, modeForTypedChar, modelKnobsOf, modelNamesOf, namerFor, nestSidebarRows, nestToolCalls, nestedCallVisible, newChatDraftKey, newSessionRequest, nextInboxChangeAt, nextSavedViewName, nextWakeAt, notificationContent, openFenceOf, pairToolEvents, parseBashExitMeta, parseModelPickerPrefs, parsePinnedProjects, parseProjectIcons, parseSessionHistory, parseSidebarView, parseSidebarViewPicks, parseSwitcherPrefs, partitionMainSession, pickRunEstimate, pinSession, pinnedSessions, plainPreview, planAuthCard, positionSuffix, projectKeyOf, projectPathOf, promptAttachments, promptDraftOf, promptOriginWire, promptRefs, questionNotificationDetail, railWithOutline, readSidebarViews, recentHostFolders, recentLocalFolders, reduceActivity, reduceCompaction, refusedSpawn, relativeTime, rememberableChain, rememberedDefaultModel, rememberedPick, repoGroups, resetChipWorkForTests, resolveBadgePanel, resolveChipPath, resolveGrouping, resolveSidebarView, resolveSort, rowTurnIds, runsInRemoteSandbox, safeSurrogateSlice, sameRail, secretExpiryWords, secretTimeLeft, secretTimeLeftIso, selectEditEvents, sendPrompt, sessionForToken, sessionRefsOf, sessionView, settledResource, shellCommandOf, shortUrl, shouldNotify, sidebarContributionsOf, sidebarLayoutOf, sidebarViewDefaults, siteOrigin, skillGroupView, skillName, skillView, sliceToolOutput, spaceMembership, splitMarkdown, stableSelection, stopForRow, switcherSpaces, tickBucket, toolAction, toolFailed, toolOutputPagerDone, unsentDraft, urlRefs, useReadable, viewFilterOf, viewFiltersOn, whenChipsSettle, wireAttachmentsToChat, wireOriginal, withPinnedProject, withoutPartialEmphasis, withoutPartialFence, writable };
|
|
@@ -84,6 +84,18 @@ export declare const DEFAULT_CHAT_LABELS: {
|
|
|
84
84
|
stoppedByYou: string;
|
|
85
85
|
retry: string;
|
|
86
86
|
retryHint: string;
|
|
87
|
+
/** Retry after the run's environment broke: it is repaired (reconnected or set up anew) first. */
|
|
88
|
+
retryEnvironmentHint: string;
|
|
89
|
+
environmentRepaired: {
|
|
90
|
+
lost: string;
|
|
91
|
+
unreachable: string;
|
|
92
|
+
};
|
|
93
|
+
/** Asked before a Retry sets a gone environment up anew. */
|
|
94
|
+
retryEnvironmentLostTitle: string;
|
|
95
|
+
retryEnvironmentLostDetail: string;
|
|
96
|
+
/** The detail for a remote sandbox, which held the only copy of the work (the header's warning). */
|
|
97
|
+
retryEnvironmentLostSandboxDetail: string;
|
|
98
|
+
retryEnvironmentLostConfirm: string;
|
|
87
99
|
continueRun: string;
|
|
88
100
|
continueHint: string;
|
|
89
101
|
resetsAt: (time: string) => string;
|
|
@@ -123,6 +135,23 @@ export declare const DEFAULT_CHAT_LABELS: {
|
|
|
123
135
|
modelVerdictTitle: (approved: boolean, model: string, confidence: string | null) => string;
|
|
124
136
|
loadFullOutput: string;
|
|
125
137
|
loadingFullOutput: string;
|
|
138
|
+
/** A paged result (`ChatHost.toolOutputRange`): read its next page. */
|
|
139
|
+
loadMoreOutput: string;
|
|
140
|
+
/** A paged result: read every page still missing. */
|
|
141
|
+
loadAllOutput: string;
|
|
142
|
+
loadingOutput: string;
|
|
143
|
+
/** How much of a paged result shows: the sizes loaded and in all. */
|
|
144
|
+
outputLoaded: (loaded: string, total: string) => string;
|
|
145
|
+
/** A page of a result failed to load (the raw error as the detail). */
|
|
146
|
+
outputLoadFailed: string;
|
|
147
|
+
/** Under an input the host clipped for the wire (`clipped.input`). */
|
|
148
|
+
loadFullInput: string;
|
|
149
|
+
loadingFullInput: string;
|
|
150
|
+
/** Under a diff the host cut to its first hunks (`EditPayload.clipped`). */
|
|
151
|
+
loadFullDiff: string;
|
|
152
|
+
loadingFullDiff: string;
|
|
153
|
+
/** What a diff the host cut leaves out: the hunks it dropped (0: one hunk cut short) and the size of the whole diff's text. */
|
|
154
|
+
diffNotShown: (hunks: number, size: string) => string;
|
|
126
155
|
showOutput: string;
|
|
127
156
|
inputCaption: string;
|
|
128
157
|
outputCaption: string;
|
|
@@ -574,6 +603,7 @@ export declare const DEFAULT_CHAT_LABELS: {
|
|
|
574
603
|
selectTurnCopied: string;
|
|
575
604
|
selectTurnNothingToCopy: string;
|
|
576
605
|
selectTurnForkFailed: string;
|
|
606
|
+
promptRail: string;
|
|
577
607
|
copy: string;
|
|
578
608
|
copied: string;
|
|
579
609
|
copyCode: string;
|
|
@@ -122,6 +122,18 @@ const DEFAULT_CHAT_LABELS = {
|
|
|
122
122
|
stoppedByYou: "Stopped by you",
|
|
123
123
|
retry: "Retry",
|
|
124
124
|
retryHint: "Send your message again",
|
|
125
|
+
/** Retry after the run's environment broke: it is repaired (reconnected or set up anew) first. */
|
|
126
|
+
retryEnvironmentHint: "Repair the environment, then send your message again",
|
|
127
|
+
environmentRepaired: {
|
|
128
|
+
lost: "Environment set up again",
|
|
129
|
+
unreachable: "Environment answered again"
|
|
130
|
+
},
|
|
131
|
+
/** Asked before a Retry sets a gone environment up anew. */
|
|
132
|
+
retryEnvironmentLostTitle: "Set the environment up again?",
|
|
133
|
+
retryEnvironmentLostDetail: "A new one replaces it.",
|
|
134
|
+
/** The detail for a remote sandbox, which held the only copy of the work (the header's warning). */
|
|
135
|
+
retryEnvironmentLostSandboxDetail: "A new one replaces it; work not pushed or saved at its last pause is lost.",
|
|
136
|
+
retryEnvironmentLostConfirm: "Set up again",
|
|
125
137
|
continueRun: "Continue",
|
|
126
138
|
continueHint: "Ask the model to continue",
|
|
127
139
|
resetsAt: (time) => `Resets at ${time}`,
|
|
@@ -161,6 +173,23 @@ const DEFAULT_CHAT_LABELS = {
|
|
|
161
173
|
modelVerdictTitle: (approved, model, confidence) => `${approved ? "Approved" : "Blocked"} by the decision model ${model}${confidence ? ` (confidence ${confidence})` : ""}`,
|
|
162
174
|
loadFullOutput: "Load full output",
|
|
163
175
|
loadingFullOutput: "Loading full output…",
|
|
176
|
+
/** A paged result (`ChatHost.toolOutputRange`): read its next page. */
|
|
177
|
+
loadMoreOutput: "Load more",
|
|
178
|
+
/** A paged result: read every page still missing. */
|
|
179
|
+
loadAllOutput: "Load all",
|
|
180
|
+
loadingOutput: "Loading…",
|
|
181
|
+
/** How much of a paged result shows: the sizes loaded and in all. */
|
|
182
|
+
outputLoaded: (loaded, total) => `${loaded} of ${total} loaded`,
|
|
183
|
+
/** A page of a result failed to load (the raw error as the detail). */
|
|
184
|
+
outputLoadFailed: "Couldn't load the output",
|
|
185
|
+
/** Under an input the host clipped for the wire (`clipped.input`). */
|
|
186
|
+
loadFullInput: "Load full input",
|
|
187
|
+
loadingFullInput: "Loading full input…",
|
|
188
|
+
/** Under a diff the host cut to its first hunks (`EditPayload.clipped`). */
|
|
189
|
+
loadFullDiff: "Load full diff",
|
|
190
|
+
loadingFullDiff: "Loading full diff…",
|
|
191
|
+
/** What a diff the host cut leaves out: the hunks it dropped (0: one hunk cut short) and the size of the whole diff's text. */
|
|
192
|
+
diffNotShown: (hunks, size) => hunks > 0 ? `${hunks} more ${hunks === 1 ? "hunk" : "hunks"} not shown, ${size} in all` : `Part of the diff not shown, ${size} in all`,
|
|
164
193
|
showOutput: "Show output",
|
|
165
194
|
inputCaption: "Input",
|
|
166
195
|
outputCaption: "Output",
|
|
@@ -43,7 +43,8 @@ export interface OpenFence {
|
|
|
43
43
|
*/
|
|
44
44
|
export declare function openFenceOf(chunk: string): OpenFence | null;
|
|
45
45
|
/**
|
|
46
|
-
* Splits markdown into chunks that parse on their own, so a long or streaming reply can re-render only its last chunk. Text shorter than the threshold comes back as one chunk.
|
|
46
|
+
* Splits markdown into chunks that parse on their own, so a long or streaming reply can re-render only its last chunk. Text shorter than the threshold, or holding a definition, comes back as one chunk.
|
|
47
|
+
* While a reply streams it re-renders on every delta, so it splits at every block boundary: everything above the open block stays a memoised chunk (`MarkdownStream` keeps that split as the text grows).
|
|
47
48
|
*
|
|
48
49
|
* @param text - The markdown to split.
|
|
49
50
|
* @param opts - Split options. `streaming: true` uses finer chunks for a reply that is still growing.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BlockScanner, STREAMING_THRESHOLD, fenceLanguage, opensChunk } from "./markdown-scan.js";
|
|
1
2
|
import { isFenceClose, parseFenceOpen } from "zidane/chat/pure";
|
|
2
3
|
// src/chat/headless/markdown-chunks.ts
|
|
3
4
|
/** Below this, one parse is cheap enough: no chunking at all. */
|
|
@@ -9,13 +10,6 @@ function stepFence(fence, line) {
|
|
|
9
10
|
if (fence) return isFenceClose(line, fence.char, fence.length) ? null : fence;
|
|
10
11
|
return parseFenceOpen(line);
|
|
11
12
|
}
|
|
12
|
-
/**
|
|
13
|
-
* While a reply streams it is re-rendered on every delta (many per second),
|
|
14
|
-
* so it splits much finer: everything above the growing paragraph stays a
|
|
15
|
-
* memoised chunk and only the tail is parsed again.
|
|
16
|
-
*/
|
|
17
|
-
const STREAMING_THRESHOLD = 1200;
|
|
18
|
-
const STREAMING_TARGET = 600;
|
|
19
13
|
/** A last line of one or two backticks or tildes: a fence still arriving. */
|
|
20
14
|
const PARTIAL_FENCE = /\n {0,3}(?:`{1,2}|~{1,2})$/;
|
|
21
15
|
/**
|
|
@@ -69,8 +63,7 @@ function openFenceOf(chunk) {
|
|
|
69
63
|
fence = next;
|
|
70
64
|
}
|
|
71
65
|
if (fence === null || fence.indent !== 0) return null;
|
|
72
|
-
const
|
|
73
|
-
const language = /^(\w+)/.exec(info.trim().split(/\s/)[0] ?? "")?.[1] ?? "plaintext";
|
|
66
|
+
const language = fenceLanguage(lines[at].slice(fence.length));
|
|
74
67
|
return {
|
|
75
68
|
before: lines.slice(0, at).join("\n"),
|
|
76
69
|
language,
|
|
@@ -78,31 +71,30 @@ function openFenceOf(chunk) {
|
|
|
78
71
|
};
|
|
79
72
|
}
|
|
80
73
|
/**
|
|
81
|
-
* Splits markdown into chunks that parse on their own, so a long or streaming reply can re-render only its last chunk. Text shorter than the threshold comes back as one chunk.
|
|
74
|
+
* Splits markdown into chunks that parse on their own, so a long or streaming reply can re-render only its last chunk. Text shorter than the threshold, or holding a definition, comes back as one chunk.
|
|
75
|
+
* While a reply streams it re-renders on every delta, so it splits at every block boundary: everything above the open block stays a memoised chunk (`MarkdownStream` keeps that split as the text grows).
|
|
82
76
|
*
|
|
83
77
|
* @param text - The markdown to split.
|
|
84
78
|
* @param opts - Split options. `streaming: true` uses finer chunks for a reply that is still growing.
|
|
85
79
|
*/
|
|
86
80
|
function splitMarkdown(text, opts = {}) {
|
|
87
81
|
const threshold = opts.streaming ? STREAMING_THRESHOLD : CHUNK_THRESHOLD;
|
|
88
|
-
const target = opts.streaming ?
|
|
82
|
+
const target = opts.streaming ? 0 : CHUNK_TARGET;
|
|
89
83
|
if (text.length < threshold) return [text];
|
|
90
84
|
const lines = text.split("\n");
|
|
85
|
+
const scanner = new BlockScanner(target);
|
|
91
86
|
const chunks = [];
|
|
92
87
|
let start = 0;
|
|
93
|
-
let size = 0;
|
|
94
|
-
let fence = null;
|
|
95
88
|
for (let i = 0; i < lines.length; i++) {
|
|
96
89
|
const line = lines[i];
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
chunks.push(lines.slice(start, i + 1).join("\n"));
|
|
102
|
-
start = i + 1;
|
|
103
|
-
size = 0;
|
|
90
|
+
if (scanner.pending && opensChunk(line, true)) {
|
|
91
|
+
chunks.push(lines.slice(start, i).join("\n"));
|
|
92
|
+
start = i;
|
|
93
|
+
scanner.startChunk();
|
|
104
94
|
}
|
|
95
|
+
scanner.feed(line, 0);
|
|
105
96
|
}
|
|
97
|
+
if (scanner.refs) return [text];
|
|
106
98
|
chunks.push(lines.slice(start).join("\n"));
|
|
107
99
|
return chunks;
|
|
108
100
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The line scanner both markdown splitters share (`splitMarkdown` and the
|
|
3
|
+
* streaming `MarkdownStream`): where a chunk may start, and the block state a
|
|
4
|
+
* line leaves behind. Internal to the chat area.
|
|
5
|
+
*
|
|
6
|
+
* A chunk starts at a line after a blank line outside every block that spans
|
|
7
|
+
* blanks: a fence (core's `parseFenceOpen` / `isFenceClose`), an HTML block that
|
|
8
|
+
* only ends on its end marker (CommonMark types 1 to 5: `<pre>`, `<!--`, …). The
|
|
9
|
+
* line must start at column 0 and must not be a list item: an indented line
|
|
10
|
+
* may continue a list item, and a list item after a blank may continue a loose
|
|
11
|
+
* list. Everything else a blank line ends, so each chunk parses on its own as
|
|
12
|
+
* it would inside the whole text.
|
|
13
|
+
*
|
|
14
|
+
* Link reference and footnote definitions are the exception: one later in the
|
|
15
|
+
* text changes how earlier blocks parse. A text that holds one (or a line that
|
|
16
|
+
* looks like one) parses whole.
|
|
17
|
+
*/
|
|
18
|
+
import { FenceOpen } from "zidane/chat/pure";
|
|
19
|
+
/** `line` without the CR of a CRLF line ending. */
|
|
20
|
+
export declare function withoutCR(line: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Whether a chunk can start at `line`, the line after a candidate blank line:
|
|
23
|
+
* it starts at column 0 and is not a list item. `undefined` while that depends
|
|
24
|
+
* on characters still to come (`-` may become `- item` or `-1`).
|
|
25
|
+
*
|
|
26
|
+
* @param line - The line, or what has arrived of it.
|
|
27
|
+
* @param complete - The line is whole (its newline arrived, or the text ended).
|
|
28
|
+
*/
|
|
29
|
+
export declare function opensChunk(line: string, complete: boolean): boolean | undefined;
|
|
30
|
+
/** Whether `line` may be a definition, read outside every block. */
|
|
31
|
+
export declare function isDefinitionLine(line: string): boolean;
|
|
32
|
+
/** The block state after each line, and whether the next line may start a chunk. */
|
|
33
|
+
export declare class BlockScanner {
|
|
34
|
+
private readonly target;
|
|
35
|
+
/** The fence open after the lines fed. */
|
|
36
|
+
fence: FenceOpen | null;
|
|
37
|
+
/** Where the open fence's line starts. */
|
|
38
|
+
fenceAt: number;
|
|
39
|
+
/** Where the open fence's line ends (its newline). */
|
|
40
|
+
fenceEnd: number;
|
|
41
|
+
/** The end marker of the open HTML block, or `null`. */
|
|
42
|
+
html: RegExp | null;
|
|
43
|
+
/** Characters since the chunk started. */
|
|
44
|
+
size: number;
|
|
45
|
+
/** The last line was blank, outside every block, past the target: the next line may start a chunk. */
|
|
46
|
+
pending: boolean;
|
|
47
|
+
/** A definition was seen. */
|
|
48
|
+
refs: boolean;
|
|
49
|
+
/** @param target - The size a chunk reaches before it may end. */
|
|
50
|
+
constructor(target: number);
|
|
51
|
+
/**
|
|
52
|
+
* Feeds one whole line.
|
|
53
|
+
*
|
|
54
|
+
* @param line - The line, without its newline.
|
|
55
|
+
* @param at - Where it starts in the text.
|
|
56
|
+
*/
|
|
57
|
+
feed(line: string, at: number): void;
|
|
58
|
+
/** A chunk starts at the next line. */
|
|
59
|
+
startChunk(): void;
|
|
60
|
+
}
|
|
61
|
+
/** Below this, a streaming reply parses whole. */
|
|
62
|
+
export declare const STREAMING_THRESHOLD = 1200;
|
|
63
|
+
/** While a reply streams, every block boundary is a chunk boundary. */
|
|
64
|
+
export declare const STREAMING_TARGET = 0;
|
|
65
|
+
/** The language a fence's info string names, as the parsed block's class does (`plaintext` for none). */
|
|
66
|
+
export declare function fenceLanguage(info: string): string;
|