bunnyquery 1.9.10 → 1.10.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/engine.d.mts CHANGED
@@ -379,7 +379,8 @@ declare function skapiSupportsStreaming(sk: any): boolean;
379
379
  * Office-file server-side extraction helpers.
380
380
  *
381
381
  * Office documents (Microsoft .docx/.xlsx/.pptx, Hancom .hwpx, etc.) can't be
382
- * read by web_fetch (binary/zip). The proxy worker downloads them from db
382
+ * read by web_fetch (binary/zip), and neither can an RFC822 email (.eml), whose
383
+ * body and attachments are MIME-encoded. The proxy worker downloads them from db
383
384
  * storage, extracts their text server-side, and substitutes that text for a
384
385
  * placeholder token in the request body (carried under the reserved
385
386
  * `_skapi_extract` key, which the producer strips before the upstream call).
@@ -410,7 +411,28 @@ type FileUrlDirective = {
410
411
  declare function isServerExtractable(name?: string, mime?: string): boolean;
411
412
  /** @deprecated renamed to {@link isServerExtractable} (now also covers text files). */
412
413
  declare const isOfficeFile: typeof isServerExtractable;
414
+ /**
415
+ * True when a file should be indexed by PAGING through readFileContent (spreadsheets and
416
+ * PDFs), rather than inline extraction or a web_fetch URL. This is what lets a huge sheet
417
+ * be read row-window by row-window and a scanned PDF be read page-image by page-image,
418
+ * with embedded photos delivered to the vision model.
419
+ */
420
+ declare function isPagedReadFile(name?: string, mime?: string): boolean;
421
+ /**
422
+ * True for files whose content is VISUAL and must be delivered to the model as IMAGE
423
+ * BLOCKS in the message (rendered pages), because tool-result images render on neither
424
+ * provider. The worker renders a page window to image URLs and injects them (`_skapi_render`
425
+ * directive). Currently PDFs (scanned or not); indexed page-window by page-window with
426
+ * resume advancing the window.
427
+ */
428
+ declare function isImageVisionFile(name?: string, mime?: string): boolean;
413
429
  declare function makeExtractPlaceholder(seed: string): string;
430
+ /**
431
+ * True when a file should be read server-side, one window at a time, by the worker.
432
+ * PDFs are excluded: they go through the VISION path, where pages are rendered to
433
+ * images because their text layer is often absent or unreliable.
434
+ */
435
+ declare function isWindowedReadFile(name?: string, mime?: string): boolean;
414
436
  interface ComposedUserMessage {
415
437
  /** Clean display/history copy (attachment links, NO extraction placeholders). */
416
438
  composed: string;
@@ -592,9 +614,11 @@ type IndexingAttachmentInfo = {
592
614
  };
593
615
  type BuildIndexingUserMessageOptions = {
594
616
  /**
595
- * For files with no paged reader (.epub/.hwp/.doc/.rtf, source code) the model can't read the binary via
596
- * web_fetch, so the proxy worker extracts the text server-side and replaces
597
- * this exact token with it. When provided, the message embeds the token (and
617
+ * For files the layer parses server-side (office, e-book, email) and for text
618
+ * files, the text is inlined server-side: a binary container cannot be read via
619
+ * web_fetch, and a text file is inlined so providers without a file-fetch tool
620
+ * still see it. The proxy worker extracts the text and replaces this exact
621
+ * token with it. When provided, the message embeds the token (and
598
622
  * drops the temporary-URL line - there is nothing for the model to fetch).
599
623
  */
600
624
  inlineContentPlaceholder?: string;
@@ -801,6 +825,38 @@ declare function registerModelContextWindows(models: Array<{
801
825
  declare function setProjectContextWindow(projectId: string, tokens: number | null | undefined): void;
802
826
  declare function getProjectContextWindow(projectId: string): number | null;
803
827
  declare var MAX_OUTPUT_TOKENS: number;
828
+ /**
829
+ * The same ceiling for an INDEXING pass, which is a different job with a different shape.
830
+ *
831
+ * A chat turn has a person waiting, so a long reply is a worse outcome than a truncated
832
+ * one and 25,000 is generous for it. An indexing pass has nobody waiting and one job:
833
+ * emit records for the window it was shown. When it runs out of budget mid-window the
834
+ * worker halves the window and re-sends it (`window_scale 1.0 -> 0.5`), so the file pays
835
+ * roughly twice the passes for the rest of its length.
836
+ *
837
+ * WHY 64,000, measured on a live 465-row spreadsheet (9 passes, project ap21U8y5byIbkGSv):
838
+ * - gpt-5.6-luna allows 128,000 output tokens, so 25,000 was 19.5% of what it permits.
839
+ * - Only 1 of those 9 passes hit the cap; the median used 6,370. A cap is a CEILING, not
840
+ * a target: the model stops when it is done, so raising it costs nothing on the eight
841
+ * passes that never approach it. It only changes the one that would have truncated.
842
+ * - Fitting duration against output tokens across the nine: `55.4s + output / 131 tok/s`
843
+ * (R^2 0.906). The binding constraint is TIME, not the model.
844
+ * - The worker's upstream timeout is 870s and its Lambda is 900s with a 30s settle
845
+ * reserve, which puts the theoretical ceiling near 103,000 tokens. 64,000 lands at
846
+ * about 544s and leaves roughly 300s of margin for a slow provider hour or a pass with
847
+ * more tool round trips. Spending that margin buys nothing: 64,000 is already enough
848
+ * for a full 250-row window to finish in one pass, which is the whole point.
849
+ *
850
+ * It does NOT feed OUTPUT_TOKEN_RESERVE below. That reserve exists to size the INPUT
851
+ * budget for buildBoundedChatMessages, which only the chat path calls; an indexing message
852
+ * is built from a file window, not from bounded history. Wiring this into the reserve would
853
+ * shrink a budget this number has nothing to do with.
854
+ *
855
+ * Re-derive rather than nudge: re-run the fit if the model, the Lambda timeout or
856
+ * REQUEST_TIMEOUT changes, and note that a model whose own ceiling is lower still wins
857
+ * (getMaxOutputTokens clamps, so gpt-4o stays at its 4,000).
858
+ */
859
+ declare var INDEXING_MAX_OUTPUT_TOKENS: number;
804
860
  declare var OUTPUT_TOKEN_RESERVE: number;
805
861
  declare var TOOL_AND_RESPONSE_BUFFER: number;
806
862
  declare var MIN_INPUT_TOKEN_BUDGET: number;
@@ -824,7 +880,10 @@ declare function getModelContextWindow(platform: string, model?: string): number
824
880
  * but a model whose own cap is lower rejects the request outright, so clamp to
825
881
  * whichever is smaller. Models with no known cap keep MAX_OUTPUT_TOKENS.
826
882
  */
827
- declare function getMaxOutputTokens(platform: string, model?: string): number;
883
+ declare function getMaxOutputTokens(platform: string, model?: string,
884
+ /** 'indexing' asks for INDEXING_MAX_OUTPUT_TOKENS instead. Omitted means chat, so every
885
+ * existing caller keeps the number it had. */
886
+ purpose?: 'chat' | 'indexing'): number;
828
887
  /**
829
888
  * The window a request is actually budgeted at: the per-project override when
830
889
  * one is set, otherwise DEFAULT_CONTEXT_WINDOW. Both are clamped to the model's
@@ -2911,6 +2970,17 @@ declare function createHistoryFiller(base: Omit<FillHistoryViewportOptions, 'isS
2911
2970
  * loaded (`mayHaveOlder`), and it is the same event that already re-derives
2912
2971
  * `runKey` — so the view treats it as a new row either way.
2913
2972
  *
2973
+ * One row per FILE, not per run. A file indexed and later indexed again (a
2974
+ * re-upload, an explicit Reindex, a retry after a failure) has several RUNS in
2975
+ * the transcript, each opened by its own "A new file has just been uploaded"
2976
+ * pass. They are attributed as separate groups (mixing their passes would let an
2977
+ * old failure be painted over by a new success, or a new run inherit an old
2978
+ * stop), but only the NEWEST run of a file is rendered once the older ones have
2979
+ * settled. Two green "Indexed" rows for one file read as a duplicate, not as
2980
+ * history, and a superseded run's verdict is not the file's state. An older run
2981
+ * that is still working stays visible until it settles, so a double dispatch is
2982
+ * never hidden while both chains are live and its Stop button stays reachable.
2983
+ *
2914
2984
  * The group deliberately reports no authoritative pass TOTAL. History is paged
2915
2985
  * newest-first, so any total computed from loaded messages is a lower bound that
2916
2986
  * a later scroll-up would contradict. It reports STATE (indexing / indexed /
@@ -2945,12 +3015,13 @@ type IndexingGroup = {
2945
3015
  * surprised out of. */
2946
3016
  key: string;
2947
3017
  /** Identity of this ROW: one indexing RUN of that file. A file indexed on
2948
- * Monday and re-indexed on Wednesday is two runs, and collapsing them into
2949
- * one row erased Monday's from Monday's place in the conversation, claimed
2950
- * its passes for Wednesday, and let Monday's failure be overwritten by
2951
- * Wednesday's success. Named after the run's FIRST loaded pass (see where it
2952
- * is assigned below), so passes appended to the run and other runs appearing
2953
- * on either side of it never rename a row already on screen.
3018
+ * Monday and re-indexed on Wednesday is two runs, and merging them into one
3019
+ * group claimed Monday's passes for Wednesday and let Monday's failure be
3020
+ * overwritten by Wednesday's success. They stay separate groups; what the
3021
+ * view gets is only the newest of them once the rest have settled (see the
3022
+ * file docstring). Named after the run's FIRST loaded pass (see where it is
3023
+ * assigned below), so passes appended to the run and other runs appearing on
3024
+ * either side of it never rename a row already on screen.
2954
3025
  *
2955
3026
  * This is the RENDER key, and only that. It is renamed when the run's true
2956
3027
  * first pass finally loads — routine while a worker-driven chain is running,
@@ -3186,12 +3257,6 @@ declare function parseIndexingLabel(content: string): {
3186
3257
  continued: boolean;
3187
3258
  isReindex: boolean;
3188
3259
  } | null;
3189
- /**
3190
- * Collapse background-indexing turns into per-file groups.
3191
- *
3192
- * Messages that are not background-indexing pass through untouched, at their
3193
- * original positions and with their original indices.
3194
- */
3195
3260
  declare function buildChatDisplayList(messages: ChatMessage[], opts?: BuildDisplayListOptions): DisplayEntry[];
3196
3261
 
3197
3262
  /**
@@ -4529,4 +4594,4 @@ declare function patchProjectSettings(service: string, patch: ProjectSettingsDat
4529
4594
  */
4530
4595
  declare function clearProjectSettings(service?: string): void;
4531
4596
 
4532
- 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, 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, 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, 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, getAttachmentParsers, getChatHistory, getContextWindow, getErrorMessage, getExpiredAttachmentVisiblePath, getInputTokenBudget, getMaxOutputTokens, getModelContextWindow, getProjectContextWindow, getSplitChatHistory, getVisionProfile, groupAttachmentFailures, hasBom, hydrateImagePreviews, indexDoneUniqueId, indexScopeKey, indexingAccessGroup, isAuthExpiredError, isBgIndexingQueue, isCsrStatusEnvelope, isErrorResponseBody, isHttpUrlLike, isIndexingRequestText, isLinkUnavailable, isNonRetryableRequestError, isOfficeFile, isPreviewableImagePath, isProviderApiKeyError, isServerExtractable, isServiceDbAttachmentHref, linkUnavailableKeyForHref, linkUnavailableKeyForPath, linkUnavailableKeysForPath, listClaudeModels, listOpenAIModels, liveSafePrefix, loadProjectSettings, looksLikeRtf, makeExtractPlaceholder, mapHistoryListToMessages, markImagePreviewStale, mayKeepStreamedAnswer, mintCacheBustStamp, needsBomForExt, normalizeAttachmentPathCandidate, normalizeExt, normalizeProjectAccessSetting, normalizeTextContent, normalizeTrailingInlineToken, normalizeUploadAccessGroup, notifyAgentSaveAttachment, parseAiAgentValue, parseAttachmentContent, parseIndexingLabel, parseIndexingRequestText, patchProjectSettings, peekImagePreviewUrl, prepareDownloadText, presignExpiryEpochMs, previewImageContentType, previewLayoutBox, previewMintCacheToken, previewableExtOf, primeProjectSettings, projectAccessSetting, projectAsksUploadAccess, 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 };
4597
+ 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, 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, 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, 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, normalizeExt, normalizeProjectAccessSetting, normalizeTextContent, normalizeTrailingInlineToken, normalizeUploadAccessGroup, notifyAgentSaveAttachment, parseAiAgentValue, parseAttachmentContent, parseIndexingLabel, parseIndexingRequestText, patchProjectSettings, peekImagePreviewUrl, prepareDownloadText, presignExpiryEpochMs, previewImageContentType, previewLayoutBox, previewMintCacheToken, previewableExtOf, primeProjectSettings, projectAccessSetting, projectAsksUploadAccess, 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
@@ -379,7 +379,8 @@ declare function skapiSupportsStreaming(sk: any): boolean;
379
379
  * Office-file server-side extraction helpers.
380
380
  *
381
381
  * Office documents (Microsoft .docx/.xlsx/.pptx, Hancom .hwpx, etc.) can't be
382
- * read by web_fetch (binary/zip). The proxy worker downloads them from db
382
+ * read by web_fetch (binary/zip), and neither can an RFC822 email (.eml), whose
383
+ * body and attachments are MIME-encoded. The proxy worker downloads them from db
383
384
  * storage, extracts their text server-side, and substitutes that text for a
384
385
  * placeholder token in the request body (carried under the reserved
385
386
  * `_skapi_extract` key, which the producer strips before the upstream call).
@@ -410,7 +411,28 @@ type FileUrlDirective = {
410
411
  declare function isServerExtractable(name?: string, mime?: string): boolean;
411
412
  /** @deprecated renamed to {@link isServerExtractable} (now also covers text files). */
412
413
  declare const isOfficeFile: typeof isServerExtractable;
414
+ /**
415
+ * True when a file should be indexed by PAGING through readFileContent (spreadsheets and
416
+ * PDFs), rather than inline extraction or a web_fetch URL. This is what lets a huge sheet
417
+ * be read row-window by row-window and a scanned PDF be read page-image by page-image,
418
+ * with embedded photos delivered to the vision model.
419
+ */
420
+ declare function isPagedReadFile(name?: string, mime?: string): boolean;
421
+ /**
422
+ * True for files whose content is VISUAL and must be delivered to the model as IMAGE
423
+ * BLOCKS in the message (rendered pages), because tool-result images render on neither
424
+ * provider. The worker renders a page window to image URLs and injects them (`_skapi_render`
425
+ * directive). Currently PDFs (scanned or not); indexed page-window by page-window with
426
+ * resume advancing the window.
427
+ */
428
+ declare function isImageVisionFile(name?: string, mime?: string): boolean;
413
429
  declare function makeExtractPlaceholder(seed: string): string;
430
+ /**
431
+ * True when a file should be read server-side, one window at a time, by the worker.
432
+ * PDFs are excluded: they go through the VISION path, where pages are rendered to
433
+ * images because their text layer is often absent or unreliable.
434
+ */
435
+ declare function isWindowedReadFile(name?: string, mime?: string): boolean;
414
436
  interface ComposedUserMessage {
415
437
  /** Clean display/history copy (attachment links, NO extraction placeholders). */
416
438
  composed: string;
@@ -592,9 +614,11 @@ type IndexingAttachmentInfo = {
592
614
  };
593
615
  type BuildIndexingUserMessageOptions = {
594
616
  /**
595
- * For files with no paged reader (.epub/.hwp/.doc/.rtf, source code) the model can't read the binary via
596
- * web_fetch, so the proxy worker extracts the text server-side and replaces
597
- * this exact token with it. When provided, the message embeds the token (and
617
+ * For files the layer parses server-side (office, e-book, email) and for text
618
+ * files, the text is inlined server-side: a binary container cannot be read via
619
+ * web_fetch, and a text file is inlined so providers without a file-fetch tool
620
+ * still see it. The proxy worker extracts the text and replaces this exact
621
+ * token with it. When provided, the message embeds the token (and
598
622
  * drops the temporary-URL line - there is nothing for the model to fetch).
599
623
  */
600
624
  inlineContentPlaceholder?: string;
@@ -801,6 +825,38 @@ declare function registerModelContextWindows(models: Array<{
801
825
  declare function setProjectContextWindow(projectId: string, tokens: number | null | undefined): void;
802
826
  declare function getProjectContextWindow(projectId: string): number | null;
803
827
  declare var MAX_OUTPUT_TOKENS: number;
828
+ /**
829
+ * The same ceiling for an INDEXING pass, which is a different job with a different shape.
830
+ *
831
+ * A chat turn has a person waiting, so a long reply is a worse outcome than a truncated
832
+ * one and 25,000 is generous for it. An indexing pass has nobody waiting and one job:
833
+ * emit records for the window it was shown. When it runs out of budget mid-window the
834
+ * worker halves the window and re-sends it (`window_scale 1.0 -> 0.5`), so the file pays
835
+ * roughly twice the passes for the rest of its length.
836
+ *
837
+ * WHY 64,000, measured on a live 465-row spreadsheet (9 passes, project ap21U8y5byIbkGSv):
838
+ * - gpt-5.6-luna allows 128,000 output tokens, so 25,000 was 19.5% of what it permits.
839
+ * - Only 1 of those 9 passes hit the cap; the median used 6,370. A cap is a CEILING, not
840
+ * a target: the model stops when it is done, so raising it costs nothing on the eight
841
+ * passes that never approach it. It only changes the one that would have truncated.
842
+ * - Fitting duration against output tokens across the nine: `55.4s + output / 131 tok/s`
843
+ * (R^2 0.906). The binding constraint is TIME, not the model.
844
+ * - The worker's upstream timeout is 870s and its Lambda is 900s with a 30s settle
845
+ * reserve, which puts the theoretical ceiling near 103,000 tokens. 64,000 lands at
846
+ * about 544s and leaves roughly 300s of margin for a slow provider hour or a pass with
847
+ * more tool round trips. Spending that margin buys nothing: 64,000 is already enough
848
+ * for a full 250-row window to finish in one pass, which is the whole point.
849
+ *
850
+ * It does NOT feed OUTPUT_TOKEN_RESERVE below. That reserve exists to size the INPUT
851
+ * budget for buildBoundedChatMessages, which only the chat path calls; an indexing message
852
+ * is built from a file window, not from bounded history. Wiring this into the reserve would
853
+ * shrink a budget this number has nothing to do with.
854
+ *
855
+ * Re-derive rather than nudge: re-run the fit if the model, the Lambda timeout or
856
+ * REQUEST_TIMEOUT changes, and note that a model whose own ceiling is lower still wins
857
+ * (getMaxOutputTokens clamps, so gpt-4o stays at its 4,000).
858
+ */
859
+ declare var INDEXING_MAX_OUTPUT_TOKENS: number;
804
860
  declare var OUTPUT_TOKEN_RESERVE: number;
805
861
  declare var TOOL_AND_RESPONSE_BUFFER: number;
806
862
  declare var MIN_INPUT_TOKEN_BUDGET: number;
@@ -824,7 +880,10 @@ declare function getModelContextWindow(platform: string, model?: string): number
824
880
  * but a model whose own cap is lower rejects the request outright, so clamp to
825
881
  * whichever is smaller. Models with no known cap keep MAX_OUTPUT_TOKENS.
826
882
  */
827
- declare function getMaxOutputTokens(platform: string, model?: string): number;
883
+ declare function getMaxOutputTokens(platform: string, model?: string,
884
+ /** 'indexing' asks for INDEXING_MAX_OUTPUT_TOKENS instead. Omitted means chat, so every
885
+ * existing caller keeps the number it had. */
886
+ purpose?: 'chat' | 'indexing'): number;
828
887
  /**
829
888
  * The window a request is actually budgeted at: the per-project override when
830
889
  * one is set, otherwise DEFAULT_CONTEXT_WINDOW. Both are clamped to the model's
@@ -2911,6 +2970,17 @@ declare function createHistoryFiller(base: Omit<FillHistoryViewportOptions, 'isS
2911
2970
  * loaded (`mayHaveOlder`), and it is the same event that already re-derives
2912
2971
  * `runKey` — so the view treats it as a new row either way.
2913
2972
  *
2973
+ * One row per FILE, not per run. A file indexed and later indexed again (a
2974
+ * re-upload, an explicit Reindex, a retry after a failure) has several RUNS in
2975
+ * the transcript, each opened by its own "A new file has just been uploaded"
2976
+ * pass. They are attributed as separate groups (mixing their passes would let an
2977
+ * old failure be painted over by a new success, or a new run inherit an old
2978
+ * stop), but only the NEWEST run of a file is rendered once the older ones have
2979
+ * settled. Two green "Indexed" rows for one file read as a duplicate, not as
2980
+ * history, and a superseded run's verdict is not the file's state. An older run
2981
+ * that is still working stays visible until it settles, so a double dispatch is
2982
+ * never hidden while both chains are live and its Stop button stays reachable.
2983
+ *
2914
2984
  * The group deliberately reports no authoritative pass TOTAL. History is paged
2915
2985
  * newest-first, so any total computed from loaded messages is a lower bound that
2916
2986
  * a later scroll-up would contradict. It reports STATE (indexing / indexed /
@@ -2945,12 +3015,13 @@ type IndexingGroup = {
2945
3015
  * surprised out of. */
2946
3016
  key: string;
2947
3017
  /** Identity of this ROW: one indexing RUN of that file. A file indexed on
2948
- * Monday and re-indexed on Wednesday is two runs, and collapsing them into
2949
- * one row erased Monday's from Monday's place in the conversation, claimed
2950
- * its passes for Wednesday, and let Monday's failure be overwritten by
2951
- * Wednesday's success. Named after the run's FIRST loaded pass (see where it
2952
- * is assigned below), so passes appended to the run and other runs appearing
2953
- * on either side of it never rename a row already on screen.
3018
+ * Monday and re-indexed on Wednesday is two runs, and merging them into one
3019
+ * group claimed Monday's passes for Wednesday and let Monday's failure be
3020
+ * overwritten by Wednesday's success. They stay separate groups; what the
3021
+ * view gets is only the newest of them once the rest have settled (see the
3022
+ * file docstring). Named after the run's FIRST loaded pass (see where it is
3023
+ * assigned below), so passes appended to the run and other runs appearing on
3024
+ * either side of it never rename a row already on screen.
2954
3025
  *
2955
3026
  * This is the RENDER key, and only that. It is renamed when the run's true
2956
3027
  * first pass finally loads — routine while a worker-driven chain is running,
@@ -3186,12 +3257,6 @@ declare function parseIndexingLabel(content: string): {
3186
3257
  continued: boolean;
3187
3258
  isReindex: boolean;
3188
3259
  } | null;
3189
- /**
3190
- * Collapse background-indexing turns into per-file groups.
3191
- *
3192
- * Messages that are not background-indexing pass through untouched, at their
3193
- * original positions and with their original indices.
3194
- */
3195
3260
  declare function buildChatDisplayList(messages: ChatMessage[], opts?: BuildDisplayListOptions): DisplayEntry[];
3196
3261
 
3197
3262
  /**
@@ -4529,4 +4594,4 @@ declare function patchProjectSettings(service: string, patch: ProjectSettingsDat
4529
4594
  */
4530
4595
  declare function clearProjectSettings(service?: string): void;
4531
4596
 
4532
- 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, 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, 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, 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, getAttachmentParsers, getChatHistory, getContextWindow, getErrorMessage, getExpiredAttachmentVisiblePath, getInputTokenBudget, getMaxOutputTokens, getModelContextWindow, getProjectContextWindow, getSplitChatHistory, getVisionProfile, groupAttachmentFailures, hasBom, hydrateImagePreviews, indexDoneUniqueId, indexScopeKey, indexingAccessGroup, isAuthExpiredError, isBgIndexingQueue, isCsrStatusEnvelope, isErrorResponseBody, isHttpUrlLike, isIndexingRequestText, isLinkUnavailable, isNonRetryableRequestError, isOfficeFile, isPreviewableImagePath, isProviderApiKeyError, isServerExtractable, isServiceDbAttachmentHref, linkUnavailableKeyForHref, linkUnavailableKeyForPath, linkUnavailableKeysForPath, listClaudeModels, listOpenAIModels, liveSafePrefix, loadProjectSettings, looksLikeRtf, makeExtractPlaceholder, mapHistoryListToMessages, markImagePreviewStale, mayKeepStreamedAnswer, mintCacheBustStamp, needsBomForExt, normalizeAttachmentPathCandidate, normalizeExt, normalizeProjectAccessSetting, normalizeTextContent, normalizeTrailingInlineToken, normalizeUploadAccessGroup, notifyAgentSaveAttachment, parseAiAgentValue, parseAttachmentContent, parseIndexingLabel, parseIndexingRequestText, patchProjectSettings, peekImagePreviewUrl, prepareDownloadText, presignExpiryEpochMs, previewImageContentType, previewLayoutBox, previewMintCacheToken, previewableExtOf, primeProjectSettings, projectAccessSetting, projectAsksUploadAccess, 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 };
4597
+ 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, 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, 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, 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, normalizeExt, normalizeProjectAccessSetting, normalizeTextContent, normalizeTrailingInlineToken, normalizeUploadAccessGroup, notifyAgentSaveAttachment, parseAiAgentValue, parseAttachmentContent, parseIndexingLabel, parseIndexingRequestText, patchProjectSettings, peekImagePreviewUrl, prepareDownloadText, presignExpiryEpochMs, previewImageContentType, previewLayoutBox, previewMintCacheToken, previewableExtOf, primeProjectSettings, projectAccessSetting, projectAsksUploadAccess, 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 };