bunnyquery 1.11.1 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/engine.d.mts CHANGED
@@ -896,6 +896,16 @@ declare function isCsrStatusEnvelope(res: any): boolean;
896
896
  */
897
897
  declare function csrEnvelopeError(input: any): any;
898
898
  declare function getErrorMessage(input: any): string;
899
+ /**
900
+ * True when the worker has already sent this pass's window again. Its stored
901
+ * error then carries `retried` (the worker's _mark_pass_retried writes it only
902
+ * AFTER the replacement pass was queued, so the flag never promises a retry that
903
+ * does not exist). The failure is real but it is not the file's outcome: the
904
+ * replacement pass is. The file's row must not go red over it, and the bubble is
905
+ * drawn muted rather than as a dead end. Same one-level unwrap as every reader
906
+ * here, so a streamed turn's failure answers the same way as a buffered one.
907
+ */
908
+ declare function isRetriedFailure(input: any): boolean;
899
909
  declare function isErrorResponseBody(response: any): boolean;
900
910
  declare function isNonRetryableRequestError(input: any): boolean;
901
911
  declare function isAuthExpiredError(input: any): boolean;
@@ -2325,6 +2335,10 @@ interface ChatMessage {
2325
2335
  _dimSending?: boolean;
2326
2336
  isCancelled?: boolean;
2327
2337
  isError?: boolean;
2338
+ /** With isError: the worker has already sent this pass's window again, so the
2339
+ * failure is not the file's outcome. Set from the row's error payload
2340
+ * (`retried`, see errors.ts isRetriedFailure); never set locally. */
2341
+ isRetried?: boolean;
2328
2342
  isBackgroundTask?: boolean;
2329
2343
  /** Set on background-indexing REQUEST bubbles only (see IndexingFileRef). */
2330
2344
  _indexFile?: IndexingFileRef;
@@ -3845,6 +3859,20 @@ declare class ChatSession {
3845
3859
  private _countBgPolls;
3846
3860
  /** Live streams by server item id. One per in-flight streamed turn. */
3847
3861
  private liveStreams;
3862
+ /** When skapi recorded a turn's response as having finished arriving, by server
3863
+ * item id. Read off the terminal envelope of a STREAMED turn (the only settle
3864
+ * that carries it, see _settleLiveStream) and used as the answer bubble's time
3865
+ * in place of this browser's clock. Entries are never removed: a settle reaches
3866
+ * here twice (the poll's onResponse, then the promise), and the value for an id
3867
+ * cannot change. */
3868
+ private _respondedAt;
3869
+ private _noteRespondedAt;
3870
+ /** The time a live answer bubble is stamped with: when skapi received the
3871
+ * response, if the settle told us, else now. "Now" is what every bubble got
3872
+ * before, and it is still right for a buffered turn, whose settle hands back the
3873
+ * destination's body and nothing of skapi's; a history load then replaces it
3874
+ * with the server's value. */
3875
+ private _replyStampFor;
3848
3876
  /**
3849
3877
  * Open (or re-open) the live stream for `itemId`, or null when this poll must
3850
3878
  * not carry one.
@@ -4372,6 +4400,70 @@ declare class ChatSession {
4372
4400
  onQueuedSendResponse(_composed: string, response: any, platform: string, serverId?: string, ownerKey?: string): void;
4373
4401
  onQueuedSendError(_composed: string, err: any, serverId?: string, ownerKey?: string): void;
4374
4402
  cancelQueuedMessage(msg: ChatMessage, idx: number): void;
4403
+ /**
4404
+ * Stop waiting for the reply to the chat turn that is running now, and move on.
4405
+ *
4406
+ * `msg` is the turn's pending ASSISTANT bubble (the dot-trail "Thinking"
4407
+ * placeholder), which is where both views draw the control. A turn's two bubbles
4408
+ * carry the same _serverItemId, so it is also how the request is found.
4409
+ * cancelQueuedMessage is the sibling for a turn still waiting in the queue and
4410
+ * takes the USER bubble; the two differ in what they are handed and in what has
4411
+ * to be unwound afterwards, not in what the server is asked.
4412
+ *
4413
+ * What ends the wait:
4414
+ * 1. csr-cancel marks the running row cancelled. The worker stops relaying and
4415
+ * never stores an answer for it, so the reply cannot turn up later on this
4416
+ * device or another, and history replays the turn as cancelled;
4417
+ * 2. the poll on it is stopped, which settles whichever chain was awaiting it
4418
+ * with a stopped result: dispatchAgentRequest's for an immediate send, the
4419
+ * queued chain for a promoted turn, the history poll after a reload. Each
4420
+ * reads a stopped or cancelled result as "no reply" and releases what it
4421
+ * holds (state.sending, pendingAgentRequests, historyItemPolls), which is
4422
+ * what lets the next send go out immediately instead of queueing;
4423
+ * 3. the bubbles settle at once, without waiting for that chain: the user
4424
+ * bubble takes its cancelled form, the placeholder goes, and the next queued
4425
+ * turn, if there is one, is promoted so its own "Thinking" appears.
4426
+ *
4427
+ * What it does NOT do: the provider call already in flight on the worker runs
4428
+ * to its end (a streamed one stops within about a second). A message sent
4429
+ * behind it on the same queue starts once the worker acks the cancelled row.
4430
+ *
4431
+ * Refused without a server id (the ack has not come back yet; the views disable
4432
+ * the control until it has) and while a cancel is already out. Indexing passes
4433
+ * are not this method's business: their Stop is cancelIndexingGroup, which ends
4434
+ * the file's whole chain.
4435
+ */
4436
+ cancelPendingReply(msg: ChatMessage, idx: number): void;
4437
+ /** The cancelled form of a request bubble, with everything that keeps it in
4438
+ * place carried over: the file markers that hold an indexing pass in its
4439
+ * collapsed row, the chat it belongs to, its send time and its render key. */
4440
+ private _cancelledCopyOf;
4441
+ /**
4442
+ * Settle a turn as cancelled wherever it lives, and let the queue move on.
4443
+ *
4444
+ * On the chat on screen: every pending placeholder carrying the id goes (a
4445
+ * history refetch can have re-mapped the running turn into a second one), the
4446
+ * request bubble takes its cancelled form, and the next queued turn is promoted
4447
+ * so the conversation does not sit on an "(In queue)" bubble with nothing
4448
+ * running. For a chat that is NOT on screen (the user moved on while the turn
4449
+ * ran, and it was cancelled from elsewhere) the same edit is made in that chat's
4450
+ * history cache, which is what the next visit renders.
4451
+ *
4452
+ * Idempotent on purpose: a cancel this client made settles the bubbles at once,
4453
+ * and the chain that was awaiting the poll settles again a moment later when the
4454
+ * stop resolves it. The second pass finds nothing to do. Deliberately NOT
4455
+ * _removeStrayPendingAssistants: by then the placeholder on screen is the freshly
4456
+ * promoted turn's, whose user bubble is pending, and the sweep would take it.
4457
+ */
4458
+ private _settleCancelledTurn;
4459
+ /**
4460
+ * _settleCancelledTurn for a chat that is not on screen: the same edit, made in
4461
+ * its history cache. Matched by id where the cached bubbles carry one; an
4462
+ * off-chat send caches its pair before the ack (see dispatchComposedMessage), so
4463
+ * the fallback is positional, exactly as _applyReplyToCache's is: the trailing
4464
+ * pending placeholder, and the last request bubble still marked in flight.
4465
+ */
4466
+ private _applyCancelToCache;
4375
4467
  /**
4376
4468
  * Stop indexing a file, from its collapsed row — every pass at once, not just
4377
4469
  * the bubble the user happens to see.
@@ -4783,4 +4875,4 @@ declare function patchProjectSettings(service: string, patch: ProjectSettingsDat
4783
4875
  */
4784
4876
  declare function clearProjectSettings(service?: string): void;
4785
4877
 
4786
- export { type AiAgentPlatform, type AnchorBoxEl, type AnchorRowEl, type AttachmentFailureGroup, type AttachmentParser, type AttachmentSaveInfo, BG_INDEXING_QUEUE_SUFFIX, BOM, BOM_EXTS, type BgTaskEntry, type BoundedChatOptions, type BuildDisplayListOptions, type BuildIndexingUserMessageOptions, CHAT_GREETING_MAX_LENGTH, CLAUDE_INPUT_CAP_RATIO, CLAUDE_PER_REQUEST_INPUT_CAP, CONTEXT_WINDOW_BY_MODEL, CONTEXT_WINDOW_DEFAULT, type CallClaudeWithMcpParams, type ChatEngineConfig, type ChatGreetingParams, type ChatGreetingParts, type ChatHost, type ChatIdentity, type ChatMessage, ChatSession, type ChatState, type ChatStreamWiring, type ChatSystemPromptParams, type ClaudeMcpServerRequest, type ClaudeMcpToolConfig, type ClaudeMessage, type ClaudeRole, type ComposedUserMessage, DEFAULT_CLAUDE_MODEL, DEFAULT_CONTEXT_WINDOW, DEFAULT_OPENAI_MODEL, DEFAULT_UPLOAD_ACCESS_GROUP, type DisplayEntry, EMPTY_INDEXING_REPLY, EXPIRED_ATTACHMENT_URL_HOST, EXPIRED_ATTACHMENT_URL_ORIGIN, EXPIRED_LINK_REFRESH_EXPIRES_SECONDS, EXT_CONTENT_TYPES, type EncodingClass, type ExtractDirective, type FillHistoryViewportOptions, HISTORY_BUDGET_RATIO, HISTORY_FILL_SLACK_PX, HISTORY_TOKEN_BUDGET, HTML_EXTS, HTML_HEAD_WINDOW, IMAGE_PREVIEWS_PER_MESSAGE, INDEXING_COMPLETE_MARKER, INDEXING_MAX_OUTPUT_TOKENS, INLINE_LINK_GLYPH, INLINE_LINK_UNAVAILABLE_GLYPH, INLINE_LINK_UNAVAILABLE_SUFFIX, INPUT_CAP_RATIO, type ImagePreviewContext, type IndexRunPatch, type IndexRunStatus, type IndexingAttachmentInfo, type IndexingFileRef, type IndexingGroup, type IndexingGroupStatus, type IndexingRequestRef, type IndexingSystemPromptParams, type InlineLinkContext, type InlineLinkMarkupOptions, type InlineLinkPart, LINK_LABEL_MAX_DISPLAY_CHARS, LINK_REFRESH_WINDOW_MS, type LiveStreamUpdate, MAX_CONCURRENT_BG_POLLS, MAX_HISTORY_FILL_PAGES, MAX_HISTORY_MESSAGES, MAX_OUTPUT_BY_MODEL, MAX_OUTPUT_TOKENS, MAX_PARSED_CONTENT_CHARS, MCP_NAME, MINT_CACHE_GENERATION, MIN_INPUT_TOKEN_BUDGET, MIN_PER_REQUEST_INPUT_CAP, type MapHistoryOptions, OUTPUT_TOKEN_RESERVE, type OpenAIMessage, POLL_INTERVAL, PRESIGN_SAFETY_MARGIN_MS, PREVIEWABLE_IMAGE_CONTENT_TYPES, PREVIEW_BROWSER_CACHE_SECONDS, PREVIEW_LAYOUT_BOX_SELECTOR, PREVIEW_URL_EXPIRES_SECONDS, PROJECT_SETTINGS_ACCESS_GROUP, PROJECT_SETTINGS_TABLE, PROJECT_SETTINGS_UNIQUE_ID, type ParsedAiAgent, type PinnedDispatchContext, type PreviewImageEl, type ProjectAccessSetting, type ProjectSettingsData, type ProjectSettingsReader, RENDER_FROM_TOKEN, RTF_EXTS, RUN_RECORD_WORKING_STALE_MS, type RenderableInlineLink, type RescueDecisionContext, type RowAnchor, type RunStubInfo, STREAM_POLL_INTERVAL, type ScrollAnchor, type ScrollAnchorOptions, type SseChunk, type SseParser, type SseProvider, type SseSnapshot, type SseToolCall, type StreamDispatchContext, TOOL_AND_RESPONSE_BUFFER, UPLOAD_ACCESS_GROUPS, UPLOAD_ACCESS_HINTS, UPLOAD_ACCESS_LABELS, UPLOAD_ACCESS_OPTIONS, type UploadAccessGroup, type VisionProfile, XML_EXTS, __resetSplitHistoryState, accessSettingFrom, adoptLocalAnswerIntoPage, applyEncodingDeclaration, asksUploadAccessFrom, bgIndexingQueueName, buildAiAgentValue, buildBoundedChatMessages, buildChatDisplayList, buildChatGreeting, buildChatSystemPrompt, buildDisplayExpiredAttachmentHref, buildHistoryItemFullId, buildIndexingContinueMessage, buildIndexingRenderContinueTemplate, buildIndexingRenderMessage, buildIndexingSystemPrompt, buildIndexingUserMessage, buildIndexingWindowMessage, cachedProjectSettings, callClaudeWithMcp, callClaudeWithPublicMcp, callOpenAIWithPublicMcp, canonicalizePathForm, chatCacheKey, chatEngineConfig, chatGreetingFrom, chatStreamWiring, classifyInlineLink, clearAttachmentParsers, clearImagePreviewCache, clearProjectSettings, composeUserMessage, configureChatEngine, configureProjectSettings, contentTypeForExt, createHistoryFiller, createInlineLinkRegex, createScrollAnchor, createSseParser, csrEnvelopeError, encodePathSegments, encodingClassForExt, ensureHtmlCharset, ensureXmlEncoding, escapeInlineHtml, escapeRtfNonAscii, estimateMessageTokens, estimateTextTokens, extOf, extractClaudeText, extractLastUserTextFromRequest, extractOpenAIText, extractRemotePathFromAttachmentHref, fetchLiveIndexingKeys, fillHistoryViewport, filterListByClearHorizon, findAttachmentParser, formatChatTimestamp, formatDuration, getAttachmentParsers, getChatHistory, getContextWindow, getErrorMessage, getExpiredAttachmentVisiblePath, getInputTokenBudget, getMaxOutputTokens, getModelContextWindow, getProjectContextWindow, getSplitChatHistory, getVisionProfile, groupAttachmentFailures, hasBom, hydrateImagePreviews, indexDoneUniqueId, indexScopeKey, indexingAccessGroup, isAuthExpiredError, isBgIndexingQueue, isCsrStatusEnvelope, isErrorResponseBody, isHttpUrlLike, isImageVisionFile, isIndexingRequestText, isLinkUnavailable, isNonRetryableRequestError, isOfficeFile, isPagedReadFile, isPreviewableImagePath, isProviderApiKeyError, isServerExtractable, isServiceDbAttachmentHref, isWindowedReadFile, linkUnavailableKeyForHref, linkUnavailableKeyForPath, linkUnavailableKeysForPath, listClaudeModels, listOpenAIModels, liveSafePrefix, loadProjectSettings, looksLikeRtf, makeExtractPlaceholder, mapHistoryListToMessages, markImagePreviewStale, mayKeepStreamedAnswer, mintCacheBustStamp, needsBomForExt, normalizeAttachmentPathCandidate, normalizeChatGreeting, normalizeExt, normalizeProjectAccessSetting, normalizeTextContent, normalizeTrailingInlineToken, normalizeUploadAccessGroup, notifyAgentSaveAttachment, parseAiAgentValue, parseAttachmentContent, parseIndexingLabel, parseIndexingRequestText, patchProjectSettings, peekImagePreviewUrl, prepareDownloadText, presignExpiryEpochMs, previewImageContentType, previewLayoutBox, previewMintCacheToken, previewableExtOf, primeProjectSettings, projectAccessSetting, projectAsksUploadAccess, projectChatGreeting, projectSettingsSettled, projectUploadAccessGroup, readExpiredAttachmentHref, readyProjectSettings, registerAttachmentParser, registerModelContextWindows, renderInlineLinkHtml, repairUrlEntities, repairUrlWhitespace, resolveImagePreviewUrl, runIndexUniqueId, safeDecodeURIComponent, sanitizeAttachmentLinksForHistory, setProjectContextWindow, setProjectSettings, shouldRescueInFlightMessage, skapiSupportsStreaming, streamRecoveryEnabled, streamRecoveryLabels, streamRecoveryPhase, stripFileBlocksFromHistory, transformContentWithImages, transformContentWithOpenAIImages, truncateLabelForDisplay, typewriterResumeIndex, uploadAccessGroupFrom, upsertIndexRunRecordSafe, wallClockNow };
4878
+ export { type AiAgentPlatform, type AnchorBoxEl, type AnchorRowEl, type AttachmentFailureGroup, type AttachmentParser, type AttachmentSaveInfo, BG_INDEXING_QUEUE_SUFFIX, BOM, BOM_EXTS, type BgTaskEntry, type BoundedChatOptions, type BuildDisplayListOptions, type BuildIndexingUserMessageOptions, CHAT_GREETING_MAX_LENGTH, CLAUDE_INPUT_CAP_RATIO, CLAUDE_PER_REQUEST_INPUT_CAP, CONTEXT_WINDOW_BY_MODEL, CONTEXT_WINDOW_DEFAULT, type CallClaudeWithMcpParams, type ChatEngineConfig, type ChatGreetingParams, type ChatGreetingParts, type ChatHost, type ChatIdentity, type ChatMessage, ChatSession, type ChatState, type ChatStreamWiring, type ChatSystemPromptParams, type ClaudeMcpServerRequest, type ClaudeMcpToolConfig, type ClaudeMessage, type ClaudeRole, type ComposedUserMessage, DEFAULT_CLAUDE_MODEL, DEFAULT_CONTEXT_WINDOW, DEFAULT_OPENAI_MODEL, DEFAULT_UPLOAD_ACCESS_GROUP, type DisplayEntry, EMPTY_INDEXING_REPLY, EXPIRED_ATTACHMENT_URL_HOST, EXPIRED_ATTACHMENT_URL_ORIGIN, EXPIRED_LINK_REFRESH_EXPIRES_SECONDS, EXT_CONTENT_TYPES, type EncodingClass, type ExtractDirective, type FillHistoryViewportOptions, HISTORY_BUDGET_RATIO, HISTORY_FILL_SLACK_PX, HISTORY_TOKEN_BUDGET, HTML_EXTS, HTML_HEAD_WINDOW, IMAGE_PREVIEWS_PER_MESSAGE, INDEXING_COMPLETE_MARKER, INDEXING_MAX_OUTPUT_TOKENS, INLINE_LINK_GLYPH, INLINE_LINK_UNAVAILABLE_GLYPH, INLINE_LINK_UNAVAILABLE_SUFFIX, INPUT_CAP_RATIO, type ImagePreviewContext, type IndexRunPatch, type IndexRunStatus, type IndexingAttachmentInfo, type IndexingFileRef, type IndexingGroup, type IndexingGroupStatus, type IndexingRequestRef, type IndexingSystemPromptParams, type InlineLinkContext, type InlineLinkMarkupOptions, type InlineLinkPart, LINK_LABEL_MAX_DISPLAY_CHARS, LINK_REFRESH_WINDOW_MS, type LiveStreamUpdate, MAX_CONCURRENT_BG_POLLS, MAX_HISTORY_FILL_PAGES, MAX_HISTORY_MESSAGES, MAX_OUTPUT_BY_MODEL, MAX_OUTPUT_TOKENS, MAX_PARSED_CONTENT_CHARS, MCP_NAME, MINT_CACHE_GENERATION, MIN_INPUT_TOKEN_BUDGET, MIN_PER_REQUEST_INPUT_CAP, type MapHistoryOptions, OUTPUT_TOKEN_RESERVE, type OpenAIMessage, POLL_INTERVAL, PRESIGN_SAFETY_MARGIN_MS, PREVIEWABLE_IMAGE_CONTENT_TYPES, PREVIEW_BROWSER_CACHE_SECONDS, PREVIEW_LAYOUT_BOX_SELECTOR, PREVIEW_URL_EXPIRES_SECONDS, PROJECT_SETTINGS_ACCESS_GROUP, PROJECT_SETTINGS_TABLE, PROJECT_SETTINGS_UNIQUE_ID, type ParsedAiAgent, type PinnedDispatchContext, type PreviewImageEl, type ProjectAccessSetting, type ProjectSettingsData, type ProjectSettingsReader, RENDER_FROM_TOKEN, RTF_EXTS, RUN_RECORD_WORKING_STALE_MS, type RenderableInlineLink, type RescueDecisionContext, type RowAnchor, type RunStubInfo, STREAM_POLL_INTERVAL, type ScrollAnchor, type ScrollAnchorOptions, type SseChunk, type SseParser, type SseProvider, type SseSnapshot, type SseToolCall, type StreamDispatchContext, TOOL_AND_RESPONSE_BUFFER, UPLOAD_ACCESS_GROUPS, UPLOAD_ACCESS_HINTS, UPLOAD_ACCESS_LABELS, UPLOAD_ACCESS_OPTIONS, type UploadAccessGroup, type VisionProfile, XML_EXTS, __resetSplitHistoryState, accessSettingFrom, adoptLocalAnswerIntoPage, applyEncodingDeclaration, asksUploadAccessFrom, bgIndexingQueueName, buildAiAgentValue, buildBoundedChatMessages, buildChatDisplayList, buildChatGreeting, buildChatSystemPrompt, buildDisplayExpiredAttachmentHref, buildHistoryItemFullId, buildIndexingContinueMessage, buildIndexingRenderContinueTemplate, buildIndexingRenderMessage, buildIndexingSystemPrompt, buildIndexingUserMessage, buildIndexingWindowMessage, cachedProjectSettings, callClaudeWithMcp, callClaudeWithPublicMcp, callOpenAIWithPublicMcp, canonicalizePathForm, chatCacheKey, chatEngineConfig, chatGreetingFrom, chatStreamWiring, classifyInlineLink, clearAttachmentParsers, clearImagePreviewCache, clearProjectSettings, composeUserMessage, configureChatEngine, configureProjectSettings, contentTypeForExt, createHistoryFiller, createInlineLinkRegex, createScrollAnchor, createSseParser, csrEnvelopeError, encodePathSegments, encodingClassForExt, ensureHtmlCharset, ensureXmlEncoding, escapeInlineHtml, escapeRtfNonAscii, estimateMessageTokens, estimateTextTokens, extOf, extractClaudeText, extractLastUserTextFromRequest, extractOpenAIText, extractRemotePathFromAttachmentHref, fetchLiveIndexingKeys, fillHistoryViewport, filterListByClearHorizon, findAttachmentParser, formatChatTimestamp, formatDuration, getAttachmentParsers, getChatHistory, getContextWindow, getErrorMessage, getExpiredAttachmentVisiblePath, getInputTokenBudget, getMaxOutputTokens, getModelContextWindow, getProjectContextWindow, getSplitChatHistory, getVisionProfile, groupAttachmentFailures, hasBom, hydrateImagePreviews, indexDoneUniqueId, indexScopeKey, indexingAccessGroup, isAuthExpiredError, isBgIndexingQueue, isCsrStatusEnvelope, isErrorResponseBody, isHttpUrlLike, isImageVisionFile, isIndexingRequestText, isLinkUnavailable, isNonRetryableRequestError, isOfficeFile, isPagedReadFile, isPreviewableImagePath, isProviderApiKeyError, isRetriedFailure, isServerExtractable, isServiceDbAttachmentHref, isWindowedReadFile, linkUnavailableKeyForHref, linkUnavailableKeyForPath, linkUnavailableKeysForPath, listClaudeModels, listOpenAIModels, liveSafePrefix, loadProjectSettings, looksLikeRtf, makeExtractPlaceholder, mapHistoryListToMessages, markImagePreviewStale, mayKeepStreamedAnswer, mintCacheBustStamp, needsBomForExt, normalizeAttachmentPathCandidate, normalizeChatGreeting, normalizeExt, normalizeProjectAccessSetting, normalizeTextContent, normalizeTrailingInlineToken, normalizeUploadAccessGroup, notifyAgentSaveAttachment, parseAiAgentValue, parseAttachmentContent, parseIndexingLabel, parseIndexingRequestText, patchProjectSettings, peekImagePreviewUrl, prepareDownloadText, presignExpiryEpochMs, previewImageContentType, previewLayoutBox, previewMintCacheToken, previewableExtOf, primeProjectSettings, projectAccessSetting, projectAsksUploadAccess, projectChatGreeting, projectSettingsSettled, projectUploadAccessGroup, readExpiredAttachmentHref, readyProjectSettings, registerAttachmentParser, registerModelContextWindows, renderInlineLinkHtml, repairUrlEntities, repairUrlWhitespace, resolveImagePreviewUrl, runIndexUniqueId, safeDecodeURIComponent, sanitizeAttachmentLinksForHistory, setProjectContextWindow, setProjectSettings, shouldRescueInFlightMessage, skapiSupportsStreaming, streamRecoveryEnabled, streamRecoveryLabels, streamRecoveryPhase, stripFileBlocksFromHistory, transformContentWithImages, transformContentWithOpenAIImages, truncateLabelForDisplay, typewriterResumeIndex, uploadAccessGroupFrom, upsertIndexRunRecordSafe, wallClockNow };
package/dist/engine.d.ts CHANGED
@@ -896,6 +896,16 @@ declare function isCsrStatusEnvelope(res: any): boolean;
896
896
  */
897
897
  declare function csrEnvelopeError(input: any): any;
898
898
  declare function getErrorMessage(input: any): string;
899
+ /**
900
+ * True when the worker has already sent this pass's window again. Its stored
901
+ * error then carries `retried` (the worker's _mark_pass_retried writes it only
902
+ * AFTER the replacement pass was queued, so the flag never promises a retry that
903
+ * does not exist). The failure is real but it is not the file's outcome: the
904
+ * replacement pass is. The file's row must not go red over it, and the bubble is
905
+ * drawn muted rather than as a dead end. Same one-level unwrap as every reader
906
+ * here, so a streamed turn's failure answers the same way as a buffered one.
907
+ */
908
+ declare function isRetriedFailure(input: any): boolean;
899
909
  declare function isErrorResponseBody(response: any): boolean;
900
910
  declare function isNonRetryableRequestError(input: any): boolean;
901
911
  declare function isAuthExpiredError(input: any): boolean;
@@ -2325,6 +2335,10 @@ interface ChatMessage {
2325
2335
  _dimSending?: boolean;
2326
2336
  isCancelled?: boolean;
2327
2337
  isError?: boolean;
2338
+ /** With isError: the worker has already sent this pass's window again, so the
2339
+ * failure is not the file's outcome. Set from the row's error payload
2340
+ * (`retried`, see errors.ts isRetriedFailure); never set locally. */
2341
+ isRetried?: boolean;
2328
2342
  isBackgroundTask?: boolean;
2329
2343
  /** Set on background-indexing REQUEST bubbles only (see IndexingFileRef). */
2330
2344
  _indexFile?: IndexingFileRef;
@@ -3845,6 +3859,20 @@ declare class ChatSession {
3845
3859
  private _countBgPolls;
3846
3860
  /** Live streams by server item id. One per in-flight streamed turn. */
3847
3861
  private liveStreams;
3862
+ /** When skapi recorded a turn's response as having finished arriving, by server
3863
+ * item id. Read off the terminal envelope of a STREAMED turn (the only settle
3864
+ * that carries it, see _settleLiveStream) and used as the answer bubble's time
3865
+ * in place of this browser's clock. Entries are never removed: a settle reaches
3866
+ * here twice (the poll's onResponse, then the promise), and the value for an id
3867
+ * cannot change. */
3868
+ private _respondedAt;
3869
+ private _noteRespondedAt;
3870
+ /** The time a live answer bubble is stamped with: when skapi received the
3871
+ * response, if the settle told us, else now. "Now" is what every bubble got
3872
+ * before, and it is still right for a buffered turn, whose settle hands back the
3873
+ * destination's body and nothing of skapi's; a history load then replaces it
3874
+ * with the server's value. */
3875
+ private _replyStampFor;
3848
3876
  /**
3849
3877
  * Open (or re-open) the live stream for `itemId`, or null when this poll must
3850
3878
  * not carry one.
@@ -4372,6 +4400,70 @@ declare class ChatSession {
4372
4400
  onQueuedSendResponse(_composed: string, response: any, platform: string, serverId?: string, ownerKey?: string): void;
4373
4401
  onQueuedSendError(_composed: string, err: any, serverId?: string, ownerKey?: string): void;
4374
4402
  cancelQueuedMessage(msg: ChatMessage, idx: number): void;
4403
+ /**
4404
+ * Stop waiting for the reply to the chat turn that is running now, and move on.
4405
+ *
4406
+ * `msg` is the turn's pending ASSISTANT bubble (the dot-trail "Thinking"
4407
+ * placeholder), which is where both views draw the control. A turn's two bubbles
4408
+ * carry the same _serverItemId, so it is also how the request is found.
4409
+ * cancelQueuedMessage is the sibling for a turn still waiting in the queue and
4410
+ * takes the USER bubble; the two differ in what they are handed and in what has
4411
+ * to be unwound afterwards, not in what the server is asked.
4412
+ *
4413
+ * What ends the wait:
4414
+ * 1. csr-cancel marks the running row cancelled. The worker stops relaying and
4415
+ * never stores an answer for it, so the reply cannot turn up later on this
4416
+ * device or another, and history replays the turn as cancelled;
4417
+ * 2. the poll on it is stopped, which settles whichever chain was awaiting it
4418
+ * with a stopped result: dispatchAgentRequest's for an immediate send, the
4419
+ * queued chain for a promoted turn, the history poll after a reload. Each
4420
+ * reads a stopped or cancelled result as "no reply" and releases what it
4421
+ * holds (state.sending, pendingAgentRequests, historyItemPolls), which is
4422
+ * what lets the next send go out immediately instead of queueing;
4423
+ * 3. the bubbles settle at once, without waiting for that chain: the user
4424
+ * bubble takes its cancelled form, the placeholder goes, and the next queued
4425
+ * turn, if there is one, is promoted so its own "Thinking" appears.
4426
+ *
4427
+ * What it does NOT do: the provider call already in flight on the worker runs
4428
+ * to its end (a streamed one stops within about a second). A message sent
4429
+ * behind it on the same queue starts once the worker acks the cancelled row.
4430
+ *
4431
+ * Refused without a server id (the ack has not come back yet; the views disable
4432
+ * the control until it has) and while a cancel is already out. Indexing passes
4433
+ * are not this method's business: their Stop is cancelIndexingGroup, which ends
4434
+ * the file's whole chain.
4435
+ */
4436
+ cancelPendingReply(msg: ChatMessage, idx: number): void;
4437
+ /** The cancelled form of a request bubble, with everything that keeps it in
4438
+ * place carried over: the file markers that hold an indexing pass in its
4439
+ * collapsed row, the chat it belongs to, its send time and its render key. */
4440
+ private _cancelledCopyOf;
4441
+ /**
4442
+ * Settle a turn as cancelled wherever it lives, and let the queue move on.
4443
+ *
4444
+ * On the chat on screen: every pending placeholder carrying the id goes (a
4445
+ * history refetch can have re-mapped the running turn into a second one), the
4446
+ * request bubble takes its cancelled form, and the next queued turn is promoted
4447
+ * so the conversation does not sit on an "(In queue)" bubble with nothing
4448
+ * running. For a chat that is NOT on screen (the user moved on while the turn
4449
+ * ran, and it was cancelled from elsewhere) the same edit is made in that chat's
4450
+ * history cache, which is what the next visit renders.
4451
+ *
4452
+ * Idempotent on purpose: a cancel this client made settles the bubbles at once,
4453
+ * and the chain that was awaiting the poll settles again a moment later when the
4454
+ * stop resolves it. The second pass finds nothing to do. Deliberately NOT
4455
+ * _removeStrayPendingAssistants: by then the placeholder on screen is the freshly
4456
+ * promoted turn's, whose user bubble is pending, and the sweep would take it.
4457
+ */
4458
+ private _settleCancelledTurn;
4459
+ /**
4460
+ * _settleCancelledTurn for a chat that is not on screen: the same edit, made in
4461
+ * its history cache. Matched by id where the cached bubbles carry one; an
4462
+ * off-chat send caches its pair before the ack (see dispatchComposedMessage), so
4463
+ * the fallback is positional, exactly as _applyReplyToCache's is: the trailing
4464
+ * pending placeholder, and the last request bubble still marked in flight.
4465
+ */
4466
+ private _applyCancelToCache;
4375
4467
  /**
4376
4468
  * Stop indexing a file, from its collapsed row — every pass at once, not just
4377
4469
  * the bubble the user happens to see.
@@ -4783,4 +4875,4 @@ declare function patchProjectSettings(service: string, patch: ProjectSettingsDat
4783
4875
  */
4784
4876
  declare function clearProjectSettings(service?: string): void;
4785
4877
 
4786
- export { type AiAgentPlatform, type AnchorBoxEl, type AnchorRowEl, type AttachmentFailureGroup, type AttachmentParser, type AttachmentSaveInfo, BG_INDEXING_QUEUE_SUFFIX, BOM, BOM_EXTS, type BgTaskEntry, type BoundedChatOptions, type BuildDisplayListOptions, type BuildIndexingUserMessageOptions, CHAT_GREETING_MAX_LENGTH, CLAUDE_INPUT_CAP_RATIO, CLAUDE_PER_REQUEST_INPUT_CAP, CONTEXT_WINDOW_BY_MODEL, CONTEXT_WINDOW_DEFAULT, type CallClaudeWithMcpParams, type ChatEngineConfig, type ChatGreetingParams, type ChatGreetingParts, type ChatHost, type ChatIdentity, type ChatMessage, ChatSession, type ChatState, type ChatStreamWiring, type ChatSystemPromptParams, type ClaudeMcpServerRequest, type ClaudeMcpToolConfig, type ClaudeMessage, type ClaudeRole, type ComposedUserMessage, DEFAULT_CLAUDE_MODEL, DEFAULT_CONTEXT_WINDOW, DEFAULT_OPENAI_MODEL, DEFAULT_UPLOAD_ACCESS_GROUP, type DisplayEntry, EMPTY_INDEXING_REPLY, EXPIRED_ATTACHMENT_URL_HOST, EXPIRED_ATTACHMENT_URL_ORIGIN, EXPIRED_LINK_REFRESH_EXPIRES_SECONDS, EXT_CONTENT_TYPES, type EncodingClass, type ExtractDirective, type FillHistoryViewportOptions, HISTORY_BUDGET_RATIO, HISTORY_FILL_SLACK_PX, HISTORY_TOKEN_BUDGET, HTML_EXTS, HTML_HEAD_WINDOW, IMAGE_PREVIEWS_PER_MESSAGE, INDEXING_COMPLETE_MARKER, INDEXING_MAX_OUTPUT_TOKENS, INLINE_LINK_GLYPH, INLINE_LINK_UNAVAILABLE_GLYPH, INLINE_LINK_UNAVAILABLE_SUFFIX, INPUT_CAP_RATIO, type ImagePreviewContext, type IndexRunPatch, type IndexRunStatus, type IndexingAttachmentInfo, type IndexingFileRef, type IndexingGroup, type IndexingGroupStatus, type IndexingRequestRef, type IndexingSystemPromptParams, type InlineLinkContext, type InlineLinkMarkupOptions, type InlineLinkPart, LINK_LABEL_MAX_DISPLAY_CHARS, LINK_REFRESH_WINDOW_MS, type LiveStreamUpdate, MAX_CONCURRENT_BG_POLLS, MAX_HISTORY_FILL_PAGES, MAX_HISTORY_MESSAGES, MAX_OUTPUT_BY_MODEL, MAX_OUTPUT_TOKENS, MAX_PARSED_CONTENT_CHARS, MCP_NAME, MINT_CACHE_GENERATION, MIN_INPUT_TOKEN_BUDGET, MIN_PER_REQUEST_INPUT_CAP, type MapHistoryOptions, OUTPUT_TOKEN_RESERVE, type OpenAIMessage, POLL_INTERVAL, PRESIGN_SAFETY_MARGIN_MS, PREVIEWABLE_IMAGE_CONTENT_TYPES, PREVIEW_BROWSER_CACHE_SECONDS, PREVIEW_LAYOUT_BOX_SELECTOR, PREVIEW_URL_EXPIRES_SECONDS, PROJECT_SETTINGS_ACCESS_GROUP, PROJECT_SETTINGS_TABLE, PROJECT_SETTINGS_UNIQUE_ID, type ParsedAiAgent, type PinnedDispatchContext, type PreviewImageEl, type ProjectAccessSetting, type ProjectSettingsData, type ProjectSettingsReader, RENDER_FROM_TOKEN, RTF_EXTS, RUN_RECORD_WORKING_STALE_MS, type RenderableInlineLink, type RescueDecisionContext, type RowAnchor, type RunStubInfo, STREAM_POLL_INTERVAL, type ScrollAnchor, type ScrollAnchorOptions, type SseChunk, type SseParser, type SseProvider, type SseSnapshot, type SseToolCall, type StreamDispatchContext, TOOL_AND_RESPONSE_BUFFER, UPLOAD_ACCESS_GROUPS, UPLOAD_ACCESS_HINTS, UPLOAD_ACCESS_LABELS, UPLOAD_ACCESS_OPTIONS, type UploadAccessGroup, type VisionProfile, XML_EXTS, __resetSplitHistoryState, accessSettingFrom, adoptLocalAnswerIntoPage, applyEncodingDeclaration, asksUploadAccessFrom, bgIndexingQueueName, buildAiAgentValue, buildBoundedChatMessages, buildChatDisplayList, buildChatGreeting, buildChatSystemPrompt, buildDisplayExpiredAttachmentHref, buildHistoryItemFullId, buildIndexingContinueMessage, buildIndexingRenderContinueTemplate, buildIndexingRenderMessage, buildIndexingSystemPrompt, buildIndexingUserMessage, buildIndexingWindowMessage, cachedProjectSettings, callClaudeWithMcp, callClaudeWithPublicMcp, callOpenAIWithPublicMcp, canonicalizePathForm, chatCacheKey, chatEngineConfig, chatGreetingFrom, chatStreamWiring, classifyInlineLink, clearAttachmentParsers, clearImagePreviewCache, clearProjectSettings, composeUserMessage, configureChatEngine, configureProjectSettings, contentTypeForExt, createHistoryFiller, createInlineLinkRegex, createScrollAnchor, createSseParser, csrEnvelopeError, encodePathSegments, encodingClassForExt, ensureHtmlCharset, ensureXmlEncoding, escapeInlineHtml, escapeRtfNonAscii, estimateMessageTokens, estimateTextTokens, extOf, extractClaudeText, extractLastUserTextFromRequest, extractOpenAIText, extractRemotePathFromAttachmentHref, fetchLiveIndexingKeys, fillHistoryViewport, filterListByClearHorizon, findAttachmentParser, formatChatTimestamp, formatDuration, getAttachmentParsers, getChatHistory, getContextWindow, getErrorMessage, getExpiredAttachmentVisiblePath, getInputTokenBudget, getMaxOutputTokens, getModelContextWindow, getProjectContextWindow, getSplitChatHistory, getVisionProfile, groupAttachmentFailures, hasBom, hydrateImagePreviews, indexDoneUniqueId, indexScopeKey, indexingAccessGroup, isAuthExpiredError, isBgIndexingQueue, isCsrStatusEnvelope, isErrorResponseBody, isHttpUrlLike, isImageVisionFile, isIndexingRequestText, isLinkUnavailable, isNonRetryableRequestError, isOfficeFile, isPagedReadFile, isPreviewableImagePath, isProviderApiKeyError, isServerExtractable, isServiceDbAttachmentHref, isWindowedReadFile, linkUnavailableKeyForHref, linkUnavailableKeyForPath, linkUnavailableKeysForPath, listClaudeModels, listOpenAIModels, liveSafePrefix, loadProjectSettings, looksLikeRtf, makeExtractPlaceholder, mapHistoryListToMessages, markImagePreviewStale, mayKeepStreamedAnswer, mintCacheBustStamp, needsBomForExt, normalizeAttachmentPathCandidate, normalizeChatGreeting, normalizeExt, normalizeProjectAccessSetting, normalizeTextContent, normalizeTrailingInlineToken, normalizeUploadAccessGroup, notifyAgentSaveAttachment, parseAiAgentValue, parseAttachmentContent, parseIndexingLabel, parseIndexingRequestText, patchProjectSettings, peekImagePreviewUrl, prepareDownloadText, presignExpiryEpochMs, previewImageContentType, previewLayoutBox, previewMintCacheToken, previewableExtOf, primeProjectSettings, projectAccessSetting, projectAsksUploadAccess, projectChatGreeting, projectSettingsSettled, projectUploadAccessGroup, readExpiredAttachmentHref, readyProjectSettings, registerAttachmentParser, registerModelContextWindows, renderInlineLinkHtml, repairUrlEntities, repairUrlWhitespace, resolveImagePreviewUrl, runIndexUniqueId, safeDecodeURIComponent, sanitizeAttachmentLinksForHistory, setProjectContextWindow, setProjectSettings, shouldRescueInFlightMessage, skapiSupportsStreaming, streamRecoveryEnabled, streamRecoveryLabels, streamRecoveryPhase, stripFileBlocksFromHistory, transformContentWithImages, transformContentWithOpenAIImages, truncateLabelForDisplay, typewriterResumeIndex, uploadAccessGroupFrom, upsertIndexRunRecordSafe, wallClockNow };
4878
+ export { type AiAgentPlatform, type AnchorBoxEl, type AnchorRowEl, type AttachmentFailureGroup, type AttachmentParser, type AttachmentSaveInfo, BG_INDEXING_QUEUE_SUFFIX, BOM, BOM_EXTS, type BgTaskEntry, type BoundedChatOptions, type BuildDisplayListOptions, type BuildIndexingUserMessageOptions, CHAT_GREETING_MAX_LENGTH, CLAUDE_INPUT_CAP_RATIO, CLAUDE_PER_REQUEST_INPUT_CAP, CONTEXT_WINDOW_BY_MODEL, CONTEXT_WINDOW_DEFAULT, type CallClaudeWithMcpParams, type ChatEngineConfig, type ChatGreetingParams, type ChatGreetingParts, type ChatHost, type ChatIdentity, type ChatMessage, ChatSession, type ChatState, type ChatStreamWiring, type ChatSystemPromptParams, type ClaudeMcpServerRequest, type ClaudeMcpToolConfig, type ClaudeMessage, type ClaudeRole, type ComposedUserMessage, DEFAULT_CLAUDE_MODEL, DEFAULT_CONTEXT_WINDOW, DEFAULT_OPENAI_MODEL, DEFAULT_UPLOAD_ACCESS_GROUP, type DisplayEntry, EMPTY_INDEXING_REPLY, EXPIRED_ATTACHMENT_URL_HOST, EXPIRED_ATTACHMENT_URL_ORIGIN, EXPIRED_LINK_REFRESH_EXPIRES_SECONDS, EXT_CONTENT_TYPES, type EncodingClass, type ExtractDirective, type FillHistoryViewportOptions, HISTORY_BUDGET_RATIO, HISTORY_FILL_SLACK_PX, HISTORY_TOKEN_BUDGET, HTML_EXTS, HTML_HEAD_WINDOW, IMAGE_PREVIEWS_PER_MESSAGE, INDEXING_COMPLETE_MARKER, INDEXING_MAX_OUTPUT_TOKENS, INLINE_LINK_GLYPH, INLINE_LINK_UNAVAILABLE_GLYPH, INLINE_LINK_UNAVAILABLE_SUFFIX, INPUT_CAP_RATIO, type ImagePreviewContext, type IndexRunPatch, type IndexRunStatus, type IndexingAttachmentInfo, type IndexingFileRef, type IndexingGroup, type IndexingGroupStatus, type IndexingRequestRef, type IndexingSystemPromptParams, type InlineLinkContext, type InlineLinkMarkupOptions, type InlineLinkPart, LINK_LABEL_MAX_DISPLAY_CHARS, LINK_REFRESH_WINDOW_MS, type LiveStreamUpdate, MAX_CONCURRENT_BG_POLLS, MAX_HISTORY_FILL_PAGES, MAX_HISTORY_MESSAGES, MAX_OUTPUT_BY_MODEL, MAX_OUTPUT_TOKENS, MAX_PARSED_CONTENT_CHARS, MCP_NAME, MINT_CACHE_GENERATION, MIN_INPUT_TOKEN_BUDGET, MIN_PER_REQUEST_INPUT_CAP, type MapHistoryOptions, OUTPUT_TOKEN_RESERVE, type OpenAIMessage, POLL_INTERVAL, PRESIGN_SAFETY_MARGIN_MS, PREVIEWABLE_IMAGE_CONTENT_TYPES, PREVIEW_BROWSER_CACHE_SECONDS, PREVIEW_LAYOUT_BOX_SELECTOR, PREVIEW_URL_EXPIRES_SECONDS, PROJECT_SETTINGS_ACCESS_GROUP, PROJECT_SETTINGS_TABLE, PROJECT_SETTINGS_UNIQUE_ID, type ParsedAiAgent, type PinnedDispatchContext, type PreviewImageEl, type ProjectAccessSetting, type ProjectSettingsData, type ProjectSettingsReader, RENDER_FROM_TOKEN, RTF_EXTS, RUN_RECORD_WORKING_STALE_MS, type RenderableInlineLink, type RescueDecisionContext, type RowAnchor, type RunStubInfo, STREAM_POLL_INTERVAL, type ScrollAnchor, type ScrollAnchorOptions, type SseChunk, type SseParser, type SseProvider, type SseSnapshot, type SseToolCall, type StreamDispatchContext, TOOL_AND_RESPONSE_BUFFER, UPLOAD_ACCESS_GROUPS, UPLOAD_ACCESS_HINTS, UPLOAD_ACCESS_LABELS, UPLOAD_ACCESS_OPTIONS, type UploadAccessGroup, type VisionProfile, XML_EXTS, __resetSplitHistoryState, accessSettingFrom, adoptLocalAnswerIntoPage, applyEncodingDeclaration, asksUploadAccessFrom, bgIndexingQueueName, buildAiAgentValue, buildBoundedChatMessages, buildChatDisplayList, buildChatGreeting, buildChatSystemPrompt, buildDisplayExpiredAttachmentHref, buildHistoryItemFullId, buildIndexingContinueMessage, buildIndexingRenderContinueTemplate, buildIndexingRenderMessage, buildIndexingSystemPrompt, buildIndexingUserMessage, buildIndexingWindowMessage, cachedProjectSettings, callClaudeWithMcp, callClaudeWithPublicMcp, callOpenAIWithPublicMcp, canonicalizePathForm, chatCacheKey, chatEngineConfig, chatGreetingFrom, chatStreamWiring, classifyInlineLink, clearAttachmentParsers, clearImagePreviewCache, clearProjectSettings, composeUserMessage, configureChatEngine, configureProjectSettings, contentTypeForExt, createHistoryFiller, createInlineLinkRegex, createScrollAnchor, createSseParser, csrEnvelopeError, encodePathSegments, encodingClassForExt, ensureHtmlCharset, ensureXmlEncoding, escapeInlineHtml, escapeRtfNonAscii, estimateMessageTokens, estimateTextTokens, extOf, extractClaudeText, extractLastUserTextFromRequest, extractOpenAIText, extractRemotePathFromAttachmentHref, fetchLiveIndexingKeys, fillHistoryViewport, filterListByClearHorizon, findAttachmentParser, formatChatTimestamp, formatDuration, getAttachmentParsers, getChatHistory, getContextWindow, getErrorMessage, getExpiredAttachmentVisiblePath, getInputTokenBudget, getMaxOutputTokens, getModelContextWindow, getProjectContextWindow, getSplitChatHistory, getVisionProfile, groupAttachmentFailures, hasBom, hydrateImagePreviews, indexDoneUniqueId, indexScopeKey, indexingAccessGroup, isAuthExpiredError, isBgIndexingQueue, isCsrStatusEnvelope, isErrorResponseBody, isHttpUrlLike, isImageVisionFile, isIndexingRequestText, isLinkUnavailable, isNonRetryableRequestError, isOfficeFile, isPagedReadFile, isPreviewableImagePath, isProviderApiKeyError, isRetriedFailure, isServerExtractable, isServiceDbAttachmentHref, isWindowedReadFile, linkUnavailableKeyForHref, linkUnavailableKeyForPath, linkUnavailableKeysForPath, listClaudeModels, listOpenAIModels, liveSafePrefix, loadProjectSettings, looksLikeRtf, makeExtractPlaceholder, mapHistoryListToMessages, markImagePreviewStale, mayKeepStreamedAnswer, mintCacheBustStamp, needsBomForExt, normalizeAttachmentPathCandidate, normalizeChatGreeting, normalizeExt, normalizeProjectAccessSetting, normalizeTextContent, normalizeTrailingInlineToken, normalizeUploadAccessGroup, notifyAgentSaveAttachment, parseAiAgentValue, parseAttachmentContent, parseIndexingLabel, parseIndexingRequestText, patchProjectSettings, peekImagePreviewUrl, prepareDownloadText, presignExpiryEpochMs, previewImageContentType, previewLayoutBox, previewMintCacheToken, previewableExtOf, primeProjectSettings, projectAccessSetting, projectAsksUploadAccess, projectChatGreeting, projectSettingsSettled, projectUploadAccessGroup, readExpiredAttachmentHref, readyProjectSettings, registerAttachmentParser, registerModelContextWindows, renderInlineLinkHtml, repairUrlEntities, repairUrlWhitespace, resolveImagePreviewUrl, runIndexUniqueId, safeDecodeURIComponent, sanitizeAttachmentLinksForHistory, setProjectContextWindow, setProjectSettings, shouldRescueInFlightMessage, skapiSupportsStreaming, streamRecoveryEnabled, streamRecoveryLabels, streamRecoveryPhase, stripFileBlocksFromHistory, transformContentWithImages, transformContentWithOpenAIImages, truncateLabelForDisplay, typewriterResumeIndex, uploadAccessGroupFrom, upsertIndexRunRecordSafe, wallClockNow };