zidane-ui 9.1.13 → 9.1.16
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/index.d.ts +2 -2
- package/dist/adapters/index.js +2 -2
- package/dist/adapters/live.d.ts +29 -3
- package/dist/adapters/live.js +9 -1
- package/dist/adapters/server-composer-host.js +17 -2
- package/dist/adapters/server-extensions-host.d.ts +0 -1
- package/dist/adapters/server-extensions-host.js +4 -15
- package/dist/adapters/server-git-host.js +7 -16
- package/dist/adapters/server-host.js +181 -43
- package/dist/adapters/server-machines-host.d.ts +2 -0
- package/dist/adapters/server-machines-host.js +22 -23
- package/dist/adapters/server-onboarding-host.d.ts +1 -1
- package/dist/adapters/server-onboarding-host.js +3 -4
- package/dist/adapters/server-session-host.js +22 -3
- package/dist/adapters/server-settings-accounts.js +2 -2
- package/dist/adapters/server-settings-host.js +2 -2
- package/dist/adapters/server-settings-performance.js +7 -9
- package/dist/adapters/server-settings-sections.js +13 -14
- package/dist/adapters/server-sidebar-host.js +2 -2
- package/dist/adapters/sse-host.js +68 -3
- package/dist/adapters/sse-protocol.d.ts +12 -2
- package/dist/adapters/sse-protocol.js +4 -2
- package/dist/app/AppHostProvider.js +4 -3
- package/dist/app/ModalProvider.d.ts +13 -3
- package/dist/app/ModalProvider.js +103 -24
- package/dist/app/NoticeStack.d.ts +33 -0
- package/dist/app/NoticeStack.js +90 -0
- package/dist/app/index.d.ts +3 -2
- package/dist/app/index.js +3 -2
- package/dist/chat/SessionFilterMenu.d.ts +1 -1
- package/dist/chat/SessionFilterMenu.js +2 -1
- package/dist/chat/composer/Composer.js +10 -8
- package/dist/chat/composer/ModelChainList.js +17 -8
- package/dist/chat/composer/ModelChainTooltip.js +5 -2
- package/dist/chat/composer/use-draft-target.d.ts +20 -1
- package/dist/chat/composer/use-draft-target.js +121 -5
- package/dist/chat/composer/use-new-session-defaults.d.ts +5 -1
- package/dist/chat/composer/use-new-session-defaults.js +17 -4
- package/dist/chat/headless/chip-labels.d.ts +1 -0
- package/dist/chat/headless/chip-labels.js +1 -0
- package/dist/chat/headless/composer/labels-editor.d.ts +0 -2
- package/dist/chat/headless/composer/labels-editor.js +0 -2
- package/dist/chat/headless/draft-target.d.ts +21 -1
- package/dist/chat/headless/fixture-host.js +17 -2
- package/dist/chat/headless/host.d.ts +3 -3
- package/dist/chat/headless/index.d.ts +9 -9
- package/dist/chat/headless/index.js +2 -2
- package/dist/chat/headless/labels.d.ts +13 -6
- package/dist/chat/headless/labels.js +10 -9
- package/dist/chat/headless/session-list.d.ts +20 -8
- package/dist/chat/headless/session-list.js +1 -0
- package/dist/chat/headless/sidebar/directory.d.ts +56 -14
- package/dist/chat/headless/sidebar/directory.js +149 -70
- package/dist/chat/headless/sidebar/index.d.ts +3 -3
- package/dist/chat/headless/sidebar/index.js +2 -2
- package/dist/chat/headless/sidebar/labels.d.ts +15 -8
- package/dist/chat/headless/sidebar/types.d.ts +3 -1
- package/dist/chat/headless/sidebar/view.d.ts +13 -5
- package/dist/chat/headless/sidebar/view.js +31 -11
- package/dist/chat/headless/streams/actions.d.ts +5 -3
- package/dist/chat/headless/streams/actions.js +3 -2
- package/dist/chat/headless/streams/index.d.ts +3 -3
- package/dist/chat/headless/streams/merge.d.ts +6 -10
- package/dist/chat/headless/streams/merge.js +7 -21
- package/dist/chat/headless/streams/session-streams.d.ts +29 -4
- package/dist/chat/headless/streams/session-streams.js +86 -0
- package/dist/chat/headless/streams/store.d.ts +162 -16
- package/dist/chat/headless/streams/store.js +334 -38
- package/dist/chat/headless/streams/types.d.ts +10 -7
- package/dist/chat/headless/transcript-labels.d.ts +1 -0
- package/dist/chat/interactions/PlanCard.js +10 -3
- package/dist/chat/interactions/QuestionForm.js +7 -3
- package/dist/chat/interactions/card-ui.d.ts +5 -3
- package/dist/chat/interactions/card-ui.js +9 -7
- package/dist/chat/rich-composer/RichComposer.js +1 -7
- package/dist/chat/rich-composer/composer-extensions.d.ts +0 -2
- package/dist/chat/rich-composer/composer-extensions.js +2 -2
- package/dist/chat/rich-composer/use-composer-editor.d.ts +0 -2
- package/dist/chat/rich-composer/use-composer-editor.js +1 -2
- package/dist/chat/sidebar/SessionSidebar.js +5 -5
- package/dist/chat/sidebar/SidebarFilterMenu.js +3 -1
- package/dist/chat/sidebar/SidebarFrame.d.ts +4 -0
- package/dist/chat/sidebar/SidebarFrame.js +27 -9
- package/dist/chat/sidebar/SidebarGroupHeader.js +1 -1
- package/dist/chat/sidebar/SidebarHostProvider.d.ts +8 -5
- package/dist/chat/sidebar/SidebarHostProvider.js +13 -9
- package/dist/chat/sidebar/SidebarToggleButton.js +7 -3
- package/dist/chat/sidebar/index.d.ts +2 -2
- package/dist/chat/sidebar/session-menu.js +4 -4
- package/dist/chat/sidebar/useSaveViewAsSpace.js +2 -2
- package/dist/chat/testing/contract.js +2 -2
- package/dist/chat/transcript/AuthFailureCard.js +11 -8
- package/dist/chat/transcript/BadgeMenu.js +13 -2
- package/dist/chat/transcript/MermaidDiagram.js +7 -3
- package/dist/chat/transcript/fold.d.ts +4 -0
- package/dist/chat/transcript/fold.js +53 -22
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/shell-block.js +7 -3
- package/dist/chat/transcript/useStickToBottom.js +12 -0
- package/dist/components/BrowserSignIn.js +23 -21
- package/dist/components/Form.d.ts +6 -4
- package/dist/components/Form.js +16 -8
- package/dist/components/LoadError.d.ts +4 -2
- package/dist/components/LoadError.js +13 -9
- package/dist/components/Notice.d.ts +29 -0
- package/dist/components/Notice.js +63 -0
- package/dist/components/PanelEmpty.d.ts +1 -1
- package/dist/components/PanelEmpty.js +4 -2
- package/dist/components/Restricted.d.ts +1 -1
- package/dist/components/palette/PaletteList.js +8 -1
- package/dist/components/palette/PalettePanel.js +14 -6
- package/dist/core.css +24 -5
- package/dist/dist/{index-Bq87OcGy.d.ts → index-BZM8tu4L.d.ts} +28 -3
- package/dist/dist/index.d.ts +2 -2
- package/dist/dist/{timeout-B5pO5I5a.d.ts → timeout-Cyx3VGPz.d.ts} +1 -1
- package/dist/extensions/ExtensionSettingsPage.js +1 -4
- package/dist/extensions/ExtensionSettingsSection.js +4 -3
- package/dist/extensions/ExtensionSettingsSidebar.js +2 -6
- package/dist/extensions/SettingsWireForm.d.ts +1 -7
- package/dist/extensions/SettingsWireForm.js +7 -5
- package/dist/extensions/headless/fixture-host.d.ts +1 -5
- package/dist/extensions/headless/fixture-host.js +1 -4
- package/dist/extensions/headless/host.d.ts +1 -11
- package/dist/extensions/headless/index.d.ts +3 -3
- package/dist/extensions/headless/index.js +2 -2
- package/dist/extensions/headless/select.d.ts +1 -11
- package/dist/extensions/headless/select.js +1 -18
- package/dist/files/EditorColumn.js +12 -1
- package/dist/files/TreeColumn.js +13 -20
- package/dist/files/useOpenFiles.js +2 -0
- package/dist/git/BranchMenu.js +5 -3
- package/dist/git/ImportRepoDialog.js +18 -9
- package/dist/git/MoveSessionDialog.js +15 -7
- package/dist/git/RemoteFolderPicker.js +34 -16
- package/dist/git/SyncChip.js +17 -17
- package/dist/git/WherePicker.d.ts +16 -1
- package/dist/git/WherePicker.js +80 -36
- package/dist/git/headless/environment.d.ts +33 -3
- package/dist/git/headless/environment.js +33 -5
- package/dist/git/headless/index.d.ts +2 -2
- package/dist/git/headless/index.js +2 -2
- package/dist/git/headless/labels.d.ts +15 -2
- package/dist/git/headless/labels.js +17 -4
- package/dist/git/useEnvironmentChoices.d.ts +3 -1
- package/dist/git/useEnvironmentChoices.js +6 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/labels.d.ts +5 -0
- package/dist/labels.js +5 -0
- package/dist/machines/AddMachineDialog.d.ts +34 -0
- package/dist/machines/AddMachineDialog.js +464 -0
- package/dist/machines/Banners.d.ts +33 -4
- package/dist/machines/Banners.js +64 -3
- package/dist/machines/DaemonMenu.js +27 -4
- package/dist/machines/HostCapabilities.d.ts +1 -3
- package/dist/machines/HostCapabilities.js +24 -45
- package/dist/machines/HostSyncPanel.js +123 -129
- package/dist/machines/HostsSection.d.ts +4 -1
- package/dist/machines/HostsSection.js +30 -7
- package/dist/machines/MachinesExplainer.d.ts +17 -0
- package/dist/machines/MachinesExplainer.js +71 -0
- package/dist/machines/MachinesProvider.d.ts +14 -2
- package/dist/machines/MachinesProvider.js +35 -1
- package/dist/machines/ServerAddedCard.d.ts +31 -0
- package/dist/machines/ServerAddedCard.js +72 -0
- package/dist/machines/ServerCard.js +91 -215
- package/dist/machines/ServerMachinesPanel.d.ts +2 -2
- package/dist/machines/ServerMachinesPanel.js +184 -323
- package/dist/machines/ServerUpdatePanel.js +51 -40
- package/dist/machines/ShareThisComputerForm.d.ts +19 -0
- package/dist/machines/ShareThisComputerForm.js +133 -0
- package/dist/machines/TokensPanel.d.ts +5 -3
- package/dist/machines/TokensPanel.js +98 -78
- package/dist/machines/headless/fixture-host.d.ts +19 -3
- package/dist/machines/headless/fixture-host.js +42 -5
- package/dist/machines/headless/fixtures.js +4 -6
- package/dist/machines/headless/host.d.ts +40 -19
- package/dist/machines/headless/index.d.ts +3 -3
- package/dist/machines/headless/index.js +2 -2
- package/dist/machines/headless/labels.d.ts +63 -20
- package/dist/machines/headless/labels.js +88 -25
- package/dist/machines/headless/messages.js +8 -0
- package/dist/machines/headless/stores.d.ts +9 -2
- package/dist/machines/headless/stores.js +28 -1
- package/dist/machines/index.d.ts +7 -3
- package/dist/machines/index.js +8 -4
- package/dist/machines/testing/contract.d.ts +15 -3
- package/dist/machines/testing/contract.js +68 -14
- package/dist/motion/grow.d.ts +8 -1
- package/dist/motion/grow.js +10 -4
- package/dist/onboarding/demos/index.js +1 -1
- package/dist/onboarding/headless/labels.d.ts +13 -0
- package/dist/onboarding/headless/labels.js +8 -0
- package/dist/onboarding/index.js +3 -3
- package/dist/onboarding/sources/SourceBrowser.js +11 -7
- package/dist/onboarding/steps/ConnectorsStep.js +1 -1
- package/dist/onboarding/steps/ImportStep.js +4 -1
- package/dist/onboarding/steps/ReadyStep.js +9 -2
- package/dist/onboarding/steps/SkillsStep.js +1 -1
- package/dist/onboarding/steps/connect/KeyForm.js +6 -2
- package/dist/onboarding/steps/connect/ProviderPanel.js +6 -2
- package/dist/onboarding/steps/connect/ProviderReady.js +25 -20
- package/dist/onboarding/steps/tasks.js +17 -14
- package/dist/server/sse-handler.js +141 -19
- package/dist/session/ArtifactsPanel.js +39 -17
- package/dist/session/PlanTracker.js +12 -7
- package/dist/session/ProjectHome.js +13 -11
- package/dist/session/RemindersPanel.js +34 -16
- package/dist/session/RunningWorkDialog.js +6 -2
- package/dist/session/SecretsPanel.js +29 -10
- package/dist/session/SessionDetailsDialog.d.ts +1 -1
- package/dist/session/SessionDetailsDialog.js +18 -10
- package/dist/session/SideChat.js +10 -7
- package/dist/session/TurnDetailsDialog.js +19 -5
- package/dist/session/UsagePanel.js +10 -4
- package/dist/session/headless/host.d.ts +2 -0
- package/dist/session/headless/labels.d.ts +19 -1
- package/dist/session/headless/labels.js +15 -1
- package/dist/session/headless/queue.js +2 -1
- package/dist/session/headless/reminder-labels.d.ts +4 -0
- package/dist/session/headless/reminder-labels.js +4 -0
- package/dist/settings/SettingsRestricted.d.ts +1 -1
- package/dist/settings/SettingsRestricted.js +4 -4
- package/dist/settings/SettingsShell.d.ts +7 -0
- package/dist/settings/SettingsShell.js +6 -1
- package/dist/settings/headless/fixture-performance.d.ts +1 -1
- package/dist/settings/headless/host.d.ts +2 -2
- package/dist/settings/headless/labels.d.ts +3 -3
- package/dist/settings/headless/labels.js +3 -3
- package/dist/settings/headless/performance.d.ts +3 -4
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/index.d.ts +2 -1
- package/dist/settings/index.js +2 -1
- package/dist/settings/sections/editor/EditorSection.js +7 -4
- package/dist/settings/sections/editor/labels.d.ts +1 -0
- package/dist/settings/sections/editor/labels.js +1 -0
- package/dist/settings/sections/environments/EnvironmentsSection.js +19 -12
- package/dist/settings/sections/environments/labels.d.ts +1 -0
- package/dist/settings/sections/environments/labels.js +2 -1
- package/dist/settings/sections/extensions/ExtensionConfigRows.d.ts +1 -3
- package/dist/settings/sections/extensions/ExtensionConfigRows.js +20 -19
- package/dist/settings/sections/extensions/ExtensionOptionsSection.js +2 -1
- package/dist/settings/sections/extensions/options-labels.d.ts +2 -1
- package/dist/settings/sections/extensions/options-labels.js +2 -1
- package/dist/settings/sections/index.d.ts +2 -1
- package/dist/settings/sections/index.js +2 -1
- package/dist/settings/sections/logs/LogsSection.d.ts +2 -2
- package/dist/settings/sections/logs/LogsSection.js +2 -2
- package/dist/settings/sections/mcp/McpSection.d.ts +1 -1
- package/dist/settings/sections/mcp/McpSection.js +12 -6
- package/dist/settings/sections/mcp/McpServerRow.js +20 -13
- package/dist/settings/sections/mcp/labels.d.ts +8 -2
- package/dist/settings/sections/mcp/labels.js +8 -2
- package/dist/settings/sections/models/ModelRows.js +1 -1
- package/dist/settings/sections/models/NewChatPlaceRow.d.ts +26 -0
- package/dist/settings/sections/models/NewChatPlaceRow.js +78 -0
- package/dist/settings/sections/models/SpacesDefaultsSection.js +15 -3
- package/dist/settings/sections/models/labels.d.ts +7 -0
- package/dist/settings/sections/models/labels.js +7 -0
- package/dist/settings/sections/models/model-test.js +7 -4
- package/dist/settings/sections/performance/PerformanceSection.js +16 -6
- package/dist/settings/sections/performance/labels.d.ts +1 -1
- package/dist/settings/sections/performance/labels.js +1 -1
- package/dist/settings/sections/providers/ProvidersSection.d.ts +1 -1
- package/dist/settings/sections/providers/ProvidersSection.js +14 -7
- package/dist/settings/sections/providers/ServerProvidersSection.d.ts +1 -1
- package/dist/settings/sections/providers/ServerProvidersSection.js +11 -5
- package/dist/settings/sections/providers/labels.d.ts +2 -2
- package/dist/settings/sections/providers/labels.js +2 -2
- package/dist/settings/sections/skills/SkillList.js +1 -1
- package/dist/settings/sections/skills/SkillsSection.js +1 -1
- package/dist/settings/testing/performance.contract.js +8 -12
- package/dist/styles.css +32 -3
- package/dist/terminal/HostTerminalSurface.js +15 -5
- package/dist/terminal/TerminalPanel.js +30 -17
- package/dist/terminal/TerminalSurface.js +11 -4
- package/dist/terminal/headless/labels.d.ts +5 -0
- package/dist/terminal/headless/labels.js +5 -0
- package/dist/terminal/headless/store.d.ts +1 -1
- package/dist/terminal/headless/store.js +6 -3
- package/dist/workspace/LayoutBudget.d.ts +5 -1
- package/dist/workspace/LayoutBudget.js +14 -1
- package/dist/workspace/PanelContentView.d.ts +1 -1
- package/dist/workspace/PanelContentView.js +17 -6
- package/dist/workspace/WorkspaceProvider.js +3 -2
- package/dist/workspace/headless/labels.d.ts +1 -0
- package/dist/workspace/headless/labels.js +1 -0
- package/package.json +3 -3
- package/src/styles/motion.css +8 -0
- package/src/styles/primitives.css +7 -0
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { ChatAttachment, ChatEvent } from "../host.js";
|
|
2
|
-
import { FrameScheduler } from "./scheduler.js";
|
|
3
2
|
import { OtherStreamSignal, SessionFallbackModel, SessionPageState, SessionRetryState, SessionStreamPage, SessionStreamSignal } from "./types.js";
|
|
4
3
|
import { DrainPlan } from "./pacer.js";
|
|
5
|
-
import {
|
|
4
|
+
import { FrameScheduler } from "./scheduler.js";
|
|
5
|
+
import { HistoryChange, HistorySince, MarkdownDeltaOptions, PromptSegmentRef } from "zidane/chat/pure";
|
|
6
6
|
import { SystemMdFile } from "zidane/chat";
|
|
7
7
|
//#region src/chat/headless/streams/store.d.ts
|
|
8
|
+
/** A prompt this client appended optimistically, awaiting its host echo (`SessionStreamStore.pendingEchoes`). */
|
|
9
|
+
interface PendingEcho {
|
|
10
|
+
/** The prompt text. */
|
|
11
|
+
text: string;
|
|
12
|
+
/** The id the send gave the message, when it gave one. */
|
|
13
|
+
clientMessageId?: string;
|
|
14
|
+
/** The row the client appended. The echo gives it its turn id. */
|
|
15
|
+
event: ChatEvent;
|
|
16
|
+
}
|
|
8
17
|
/** Options for {@link SessionStreamStore}. */
|
|
9
18
|
interface SessionStreamStoreOptions {
|
|
10
19
|
/** Frames and timers for batched notifications. Default: {@link defaultFrameScheduler}. */
|
|
@@ -86,15 +95,17 @@ declare class SessionStreamStore<K extends string = string> {
|
|
|
86
95
|
private _runSeq;
|
|
87
96
|
private _pages;
|
|
88
97
|
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
98
|
+
* User prompts THIS window appended optimistically that still await their
|
|
99
|
+
* host echo. The host stamps `echo: true` on the broadcast of the sender's
|
|
100
|
+
* own prompt (send / steer paths) for EVERY peer. It cannot know which
|
|
101
|
+
* window sent the prompt, so the dedupe lives here. One pending entry
|
|
102
|
+
* consumes one echo and keeps the local copy, which carries refs and
|
|
103
|
+
* attachments that the canonical event does not.
|
|
95
104
|
* Echo-tagged prompts with NO pending match are genuine remote sends
|
|
96
105
|
* (another window, a daemon-drained queued prompt) and must render.
|
|
97
|
-
*
|
|
106
|
+
* The echo matches by the sender's message id when both carry one, else
|
|
107
|
+
* by text, and gives the local row its turn id. Leftovers (failed sends)
|
|
108
|
+
* are cleared at `run:end`.
|
|
98
109
|
*/
|
|
99
110
|
private _pendingEcho;
|
|
100
111
|
/**
|
|
@@ -102,6 +113,39 @@ declare class SessionStreamStore<K extends string = string> {
|
|
|
102
113
|
* the prompt shows up in the transcript (see `prompt-previews.ts`).
|
|
103
114
|
*/
|
|
104
115
|
private _promptPreviews;
|
|
116
|
+
/** The history position each window applied last (`applyHistory`). It is the window's bookmark in the session's history. */
|
|
117
|
+
private _historyPos;
|
|
118
|
+
/** The numbering of each window's `_historyPos` (`HistoryPosition.historyId`), when known. */
|
|
119
|
+
private _historyId;
|
|
120
|
+
/** Windows to fetch again when their run ends (`takeRefetchDue`, `markRefetchDue`). */
|
|
121
|
+
private _refetchDue;
|
|
122
|
+
/**
|
|
123
|
+
* Windows whose rows are behind their history position. A write asked for a
|
|
124
|
+
* tail read that has not landed yet (in flight, failed, or waiting for the
|
|
125
|
+
* run's end). The position stays the newest write seen, so a read older than
|
|
126
|
+
* it is stale. But it is not a bookmark. The reconnect ladder reads the tail,
|
|
127
|
+
* and a later write also reads the tail instead of applying in place.
|
|
128
|
+
*/
|
|
129
|
+
private _tailDue;
|
|
130
|
+
/** Per window, the numberings it left for another numbering. A read in one of them is older than the window. */
|
|
131
|
+
private _retiredHistoryIds;
|
|
132
|
+
/**
|
|
133
|
+
* Windows that saw their current run start (`run:start`, live or replayed).
|
|
134
|
+
* If a run ends in a hydrated window that never saw it start, the window
|
|
135
|
+
* missed the run's first rows. This happens after a drop that main could not
|
|
136
|
+
* replay, or when the window opened mid-run. The rows it read meanwhile also
|
|
137
|
+
* sit below the rows it streamed since. So it reads its tail at the run's
|
|
138
|
+
* end (`takeRefetchDue`).
|
|
139
|
+
*/
|
|
140
|
+
private _runStarted;
|
|
141
|
+
/**
|
|
142
|
+
* Windows that streamed rows since their last run boundary (a run's start or
|
|
143
|
+
* end, a page read). With `_running`, it tells a run whose start went by
|
|
144
|
+
* apart from a send that the host refused before it started. A refused send
|
|
145
|
+
* streams nothing, and its error row lives only in this store. Reading the
|
|
146
|
+
* tail drops that row.
|
|
147
|
+
*/
|
|
148
|
+
private _runActivity;
|
|
105
149
|
private _listenersBySession;
|
|
106
150
|
private _listenersForHas;
|
|
107
151
|
/**
|
|
@@ -194,14 +238,98 @@ declare class SessionStreamStore<K extends string = string> {
|
|
|
194
238
|
*/
|
|
195
239
|
getPageSnapshot(sessionId: K | null): SessionPageState;
|
|
196
240
|
/**
|
|
197
|
-
* Hydrate one replay page as the session's full window
|
|
198
|
-
* `loadEvents`
|
|
199
|
-
* swap and the page-state swap.
|
|
241
|
+
* Hydrate one replay page as the session's full window (the
|
|
242
|
+
* `loadEvents` tail page path). One notify covers both the events
|
|
243
|
+
* swap and the page-state swap. Returns `false` and changes nothing
|
|
244
|
+
* when the page is older than a write the window applied since.
|
|
200
245
|
*
|
|
201
246
|
* @param sessionId - The session.
|
|
202
247
|
* @param page - The persisted page.
|
|
203
248
|
*/
|
|
204
|
-
setEventsPage(sessionId: K, page: SessionStreamPage):
|
|
249
|
+
setEventsPage(sessionId: K, page: SessionStreamPage): boolean;
|
|
250
|
+
/**
|
|
251
|
+
* Applies one history write (`history:changed`) to the session's window.
|
|
252
|
+
* It uses the shared rule (`applyHistoryOp`, `zidane/chat/pure`). A
|
|
253
|
+
* streamed append changes nothing. An append that never streamed adds the
|
|
254
|
+
* rows it carries. A rewrite or a missed write asks for a fetch.
|
|
255
|
+
*
|
|
256
|
+
* Returns `true` when the caller must fetch the session's tail now and
|
|
257
|
+
* replace the window with it (`setEventsPage`). A window whose run streams
|
|
258
|
+
* fetches at the run's end instead (`takeRefetchDue`), and a window never
|
|
259
|
+
* hydrated is left to its first read.
|
|
260
|
+
*
|
|
261
|
+
* @param sessionId - The session.
|
|
262
|
+
* @param change - The write, as the signal carries it.
|
|
263
|
+
*/
|
|
264
|
+
applyHistory(sessionId: K, change: HistoryChange): boolean;
|
|
265
|
+
/**
|
|
266
|
+
* Applies a shared history rule's answer to the window. Its position moves
|
|
267
|
+
* first. Then its rows change, or it asks for a tail read. It returns `true`
|
|
268
|
+
* for a read now. While the run streams, the read waits for the run's end.
|
|
269
|
+
* A window whose rows are behind (`_tailDue`) reads its tail on any write
|
|
270
|
+
* that moves it. It does not apply the write to rows that miss the earlier one.
|
|
271
|
+
*/
|
|
272
|
+
private _applyHistoryResult;
|
|
273
|
+
/**
|
|
274
|
+
* Applies the reconnect ladder's second step to the session's window. That
|
|
275
|
+
* step brings the rows of the turns appended after its position
|
|
276
|
+
* (`sessions.historySince`, the shared `applyHistorySince`). Returns `true`
|
|
277
|
+
* when the caller must fetch the tail now (as {@link applyHistory} does).
|
|
278
|
+
*
|
|
279
|
+
* @param sessionId - The session.
|
|
280
|
+
* @param since - The rows and the position they bring the window to.
|
|
281
|
+
*/
|
|
282
|
+
applyHistorySince(sessionId: K, since: HistorySince<ChatEvent>): boolean;
|
|
283
|
+
/**
|
|
284
|
+
* Moves the window to `pos` after an adapter's own hydrate replaced it with
|
|
285
|
+
* a tail read at `pos`. Returns `stale` if the read is older than a write
|
|
286
|
+
* the window applied since. The adapter then reads it again.
|
|
287
|
+
*
|
|
288
|
+
* @param sessionId - The session.
|
|
289
|
+
* @param pos - The read's position, when the host named one.
|
|
290
|
+
* @param historyId - The numbering `pos` counts in, when the host named one.
|
|
291
|
+
*/
|
|
292
|
+
adoptHistoryPos(sessionId: K, pos: number | undefined, historyId?: string): 'fresh' | 'stale';
|
|
293
|
+
/** `readFreshness` against what the window applied, and the numberings it left. */
|
|
294
|
+
private _freshness;
|
|
295
|
+
/** What the window applied last, for the shared history rules. */
|
|
296
|
+
private _historyContext;
|
|
297
|
+
/** Sets the window at `pos` of numbering `historyId`. If the numbering is unknown, none is kept. */
|
|
298
|
+
private _setHistoryPos;
|
|
299
|
+
/**
|
|
300
|
+
* Whether the session's window must be fetched again now that its run ended
|
|
301
|
+
* (see `applyHistory`, `markRefetchDue`). Clears the flag.
|
|
302
|
+
*
|
|
303
|
+
* @param sessionId - The session.
|
|
304
|
+
*/
|
|
305
|
+
takeRefetchDue(sessionId: K): boolean;
|
|
306
|
+
/**
|
|
307
|
+
* Asks for the session's window to be read again at its run's end (`takeRefetchDue`). It is for a read dropped
|
|
308
|
+
* because a run streamed when it came back, or for a read that kept coming back older than the window.
|
|
309
|
+
*
|
|
310
|
+
* @param sessionId - The session.
|
|
311
|
+
*/
|
|
312
|
+
markRefetchDue(sessionId: K): void;
|
|
313
|
+
/**
|
|
314
|
+
* Whether the session's rows are behind its history position. This is so
|
|
315
|
+
* when a write asked for a tail read that has not landed (in flight, failed,
|
|
316
|
+
* or waiting for the run's end). The reconnect ladder then reads the tail.
|
|
317
|
+
*
|
|
318
|
+
* @param sessionId - The session.
|
|
319
|
+
*/
|
|
320
|
+
isTailDue(sessionId: K): boolean;
|
|
321
|
+
/**
|
|
322
|
+
* The history position the session's window applied last. It is `undefined` before its first `history:changed` or positioned page.
|
|
323
|
+
*
|
|
324
|
+
* @param sessionId - The session.
|
|
325
|
+
*/
|
|
326
|
+
getHistoryPosSnapshot(sessionId: K): number | undefined;
|
|
327
|
+
/**
|
|
328
|
+
* The numbering of {@link getHistoryPosSnapshot}'s position, when known.
|
|
329
|
+
*
|
|
330
|
+
* @param sessionId - The session.
|
|
331
|
+
*/
|
|
332
|
+
getHistoryIdSnapshot(sessionId: K): string | undefined;
|
|
205
333
|
/**
|
|
206
334
|
* Splice an OLDER page in front of the hydrated window (lazy scrollback).
|
|
207
335
|
*
|
|
@@ -306,8 +434,9 @@ declare class SessionStreamStore<K extends string = string> {
|
|
|
306
434
|
* @param text - The prompt text.
|
|
307
435
|
* @param refs - The completions the prompt used (skills, files), for its chips.
|
|
308
436
|
* @param rawAttachments - The prompt's attachments. Omitted for a pushed queued prompt, which takes the previews this client remembered for it.
|
|
437
|
+
* @param clientMessageId - The id the send gave the message (`SendOptions.clientMessageId`). The store matches the echo by it.
|
|
309
438
|
*/
|
|
310
|
-
appendUserPrompt(sessionId: K, text: string, refs?: readonly PromptSegmentRef[], rawAttachments?: readonly ChatAttachment[]): void;
|
|
439
|
+
appendUserPrompt(sessionId: K, text: string, refs?: readonly PromptSegmentRef[], rawAttachments?: readonly ChatAttachment[], clientMessageId?: string): void;
|
|
311
440
|
/**
|
|
312
441
|
* Unwind ONE pending echo after a FAILED send — a refused/errored send
|
|
313
442
|
* produces no run, so the `run:end` sweep never fires and the stale
|
|
@@ -324,7 +453,7 @@ declare class SessionStreamStore<K extends string = string> {
|
|
|
324
453
|
*
|
|
325
454
|
* @param sessionId - The session.
|
|
326
455
|
*/
|
|
327
|
-
pendingEchoes(sessionId: K):
|
|
456
|
+
pendingEchoes(sessionId: K): PendingEcho[];
|
|
328
457
|
/**
|
|
329
458
|
* Low-level write: sets any of a session's events, run flag and page state
|
|
330
459
|
* in one notification, with none of the signal rules (no finalize, no
|
|
@@ -366,6 +495,23 @@ declare class SessionStreamStore<K extends string = string> {
|
|
|
366
495
|
private _notifySoon;
|
|
367
496
|
/** Deliver notifications `_notifySoon` held back (also called before anything that must be immediate). */
|
|
368
497
|
flushNotifications(): void;
|
|
498
|
+
/**
|
|
499
|
+
* Returns `live` without the prompts that this client appended and that the
|
|
500
|
+
* page already holds. These prompts still await their echo. They match by the
|
|
501
|
+
* send's message id, which the saved prompt carries (`origin.messageId`).
|
|
502
|
+
* Their pending entries stay, so the echo is still consumed. It binds
|
|
503
|
+
* nothing, because the row is gone.
|
|
504
|
+
*/
|
|
505
|
+
private _withoutSavedLocalPrompts;
|
|
506
|
+
/**
|
|
507
|
+
* Puts the host's exchange separator before the oldest prompt that this
|
|
508
|
+
* client appended and whose echo has not come yet (`appendUserPrompt`).
|
|
509
|
+
* Returns false when no such prompt is on show. The separator then appends
|
|
510
|
+
* like any event.
|
|
511
|
+
*/
|
|
512
|
+
private _separateLocalPrompt;
|
|
513
|
+
/** Gives this client's optimistic prompt row the turn id its echo carries. A row that a reload replaced is left alone. */
|
|
514
|
+
private _bindLocalPrompt;
|
|
369
515
|
/** Drop a stalled attempt's reasoning lane: the retry (or next model) streams its own, and the saved turn never holds it. */
|
|
370
516
|
private _discardThinking;
|
|
371
517
|
/**
|
|
@@ -382,4 +528,4 @@ declare class SessionStreamStore<K extends string = string> {
|
|
|
382
528
|
private _notifyHas;
|
|
383
529
|
}
|
|
384
530
|
//#endregion
|
|
385
|
-
export { SessionStreamStore, SessionStreamStoreOptions, SessionStreamWrite };
|
|
531
|
+
export { PendingEcho, SessionStreamStore, SessionStreamStoreOptions, SessionStreamWrite };
|