cascade-ai 0.66.2 → 0.67.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/index.d.cts CHANGED
@@ -2556,6 +2556,24 @@ declare class Cascade extends EventEmitter {
2556
2556
  */
2557
2557
  setCurrentPageProvider(provider: CurrentPageProvider): void;
2558
2558
  private registerMediaTools;
2559
+ /**
2560
+ * Register `generate_document` where there is a real workspace to write into.
2561
+ *
2562
+ * A `.docx`/`.pptx`/`.xlsx` is a ZIP of OOXML parts, so `file_write` — which
2563
+ * does exactly what it says and writes the model's text verbatim — produced
2564
+ * files Word/Excel/PowerPoint correctly reported as corrupted. This tool owns
2565
+ * the conversion (see tools/generate-document.ts for why it isn't folded into
2566
+ * file_write).
2567
+ *
2568
+ * Registered OUTSIDE `enabledTools` for the same reason the media tools are:
2569
+ * that allowlist is a blast-radius control for tools that reach the machine
2570
+ * or the network, and this one only writes the artifact the user asked for,
2571
+ * into the workspace the run already owns. `disabledTools` still removes it.
2572
+ * A host with no filesystem (the cloud) has its own browser-side exporter and
2573
+ * simply never reaches this path — `buildDocumentTools` returns nothing
2574
+ * without a file reader, mirroring `transcribe_audio`.
2575
+ */
2576
+ private registerDocumentTools;
2559
2577
  /**
2560
2578
  * Supply per-model thumbs-up/down counts so Auto routing can weigh how models
2561
2579
  * have actually performed for this user, on top of public benchmarks.
@@ -4032,6 +4050,257 @@ declare class GraphRetriever {
4032
4050
  format(facts: RankedFact[]): string;
4033
4051
  }
4034
4052
 
4053
+ /** File extension (lowercased, no dot), or '' when there is none. */
4054
+ declare function fileExt(name: string): string;
4055
+ /**
4056
+ * Parse CSV/TSV into rows of cells. Handles quoted fields, escaped quotes (""),
4057
+ * and embedded newlines/commas inside quotes. Delimiter is auto-detected from the
4058
+ * extension (tsv → tab) or inferred from the first line. Bounded for safety.
4059
+ */
4060
+ declare function parseDelimited(text: string, name?: string): string[][];
4061
+ /** Chart shapes we can render. Anything else falls back to a table. */
4062
+ type ChartKind = 'bar' | 'line' | 'pie' | 'doughnut' | 'area' | 'scatter';
4063
+ /** Normalise a fence's chart type, or null when it isn't one we can draw. */
4064
+ declare function chartKind(raw: string): ChartKind | null;
4065
+ interface ChartSeries {
4066
+ name: string;
4067
+ values: number[];
4068
+ }
4069
+ /** A chart's data, format-independent. Renderers decide how to draw it. */
4070
+ interface ChartSpec {
4071
+ kind: ChartKind;
4072
+ /** Optional heading, from a leading `title:` line. */
4073
+ title?: string;
4074
+ /** Label for the category axis — the header row's first cell. */
4075
+ categoryName: string;
4076
+ categories: string[];
4077
+ series: ChartSeries[];
4078
+ }
4079
+ /**
4080
+ * Parse a `chart:<kind>` fence body into a ChartSpec.
4081
+ *
4082
+ * Returns null for anything that isn't plausibly chartable (fewer than two
4083
+ * rows, or no series column). The caller then keeps the block as CODE rather
4084
+ * than dropping it, so a malformed chart is visible in the output instead of
4085
+ * silently missing.
4086
+ */
4087
+ declare function parseChartSpec(kind: ChartKind, body: string): ChartSpec | null;
4088
+ /**
4089
+ * The chart's data as table rows — the fallback for every format that cannot
4090
+ * hold a real chart object (Word and PDF; see render.ts).
4091
+ *
4092
+ * Losing the numbers would be strictly worse than the flat table this replaces,
4093
+ * so no renderer is allowed to just skip a chart block.
4094
+ */
4095
+ declare function chartToTableRows(spec: ChartSpec): string[][];
4096
+ type Block = {
4097
+ t: 'heading';
4098
+ level: number;
4099
+ text: string;
4100
+ } | {
4101
+ t: 'para';
4102
+ text: string;
4103
+ } | {
4104
+ t: 'bullet';
4105
+ ordered: boolean;
4106
+ index: number;
4107
+ text: string;
4108
+ } | {
4109
+ t: 'code';
4110
+ lines: string[];
4111
+ } | {
4112
+ t: 'quote';
4113
+ text: string;
4114
+ } | {
4115
+ t: 'table';
4116
+ rows: string[][];
4117
+ } | {
4118
+ t: 'chart';
4119
+ spec: ChartSpec;
4120
+ } | {
4121
+ t: 'hr';
4122
+ };
4123
+ declare function parseBlocks(md: string): Block[];
4124
+ /** One `![alt](url)` reference lifted out of the Markdown. */
4125
+ interface ImageRef {
4126
+ alt: string;
4127
+ url: string;
4128
+ }
4129
+ declare function matchImageLine(s: string): ImageRef | null;
4130
+ /** Format + intrinsic size, sniffed from the bytes. */
4131
+ interface ImageInfo {
4132
+ /** Narrowed to the four raster types docx's ImageRun accepts. */
4133
+ type: 'png' | 'jpg' | 'gif' | 'bmp';
4134
+ mime: string;
4135
+ width: number;
4136
+ height: number;
4137
+ }
4138
+ type LoadedImage = ImageInfo & {
4139
+ bytes: Uint8Array;
4140
+ alt: string;
4141
+ };
4142
+ /**
4143
+ * Read an image's format and pixel dimensions out of its header.
4144
+ *
4145
+ * Both renderers need this and neither can ask a host for it: docx must state
4146
+ * the type and a transformation in pixels up front, and decoding through an
4147
+ * <img> would make the exporter depend on the browser's image pipeline (and
4148
+ * fail under jsdom, and be unavailable in Node entirely). Returns null for
4149
+ * anything we can't measure, which the caller treats as "not embeddable" rather
4150
+ * than guessing a size.
4151
+ */
4152
+ declare function sniffImage(b: Uint8Array): ImageInfo | null;
4153
+ /**
4154
+ * base64 of raw bytes.
4155
+ *
4156
+ * Node's Buffer where it exists (desktop/CLI, and jsdom tests), otherwise a
4157
+ * chunked btoa so a multi-MB image can't blow the call stack through
4158
+ * String.fromCharCode's argument list. Read off globalThis rather than
4159
+ * referenced directly so a browser bundler never tries to resolve `Buffer`.
4160
+ */
4161
+ declare function bytesToBase64(bytes: Uint8Array): string;
4162
+ /** Strip inline Markdown emphasis to plain text (for renderers with no rich runs). */
4163
+ declare function stripInline(s: string): string;
4164
+ /** One styled span of a line, from inlineRuns(). */
4165
+ interface InlineRun {
4166
+ text: string;
4167
+ bold?: boolean;
4168
+ italic?: boolean;
4169
+ code?: boolean;
4170
+ }
4171
+ /**
4172
+ * Split a line's inline emphasis into styled spans.
4173
+ *
4174
+ * Kept format-neutral (plain objects, not docx TextRuns) so the Word renderer
4175
+ * and any future rich-text renderer share one understanding of what `**bold**`
4176
+ * means. A link becomes its "label (url)" text — no renderer here emits real
4177
+ * hyperlinks yet, and dropping the URL would lose information.
4178
+ */
4179
+ declare function inlineRuns(text: string): InlineRun[];
4180
+ interface Slide {
4181
+ title: string;
4182
+ body: string[];
4183
+ images: ImageRef[];
4184
+ charts: ChartSpec[];
4185
+ }
4186
+ /** Split a Markdown deck into slides: on `---` rules, else on top-level headings. */
4187
+ declare function splitSlides(md: string): Slide[];
4188
+ declare function parseSlide(chunk: string): Slide;
4189
+ /**
4190
+ * Pull `chart:` fences out of a source, returning them plus the text with those
4191
+ * fences removed.
4192
+ *
4193
+ * The spreadsheet convention is plain CSV, so a chart block inside an `.xlsx`
4194
+ * source would otherwise be parsed as three junk rows. SheetJS's community
4195
+ * build cannot write a chart OBJECT (see render.ts), so the data instead lands
4196
+ * on its own worksheet — real rows a user can select and chart in one click,
4197
+ * rather than data that vanished.
4198
+ */
4199
+ declare function extractCharts(source: string): {
4200
+ charts: ChartSpec[];
4201
+ rest: string;
4202
+ };
4203
+
4204
+ /** Office formats we can render into a real binary. */
4205
+ type DocumentFormat = 'docx' | 'pptx' | 'xlsx';
4206
+ declare const DOCUMENT_MIME: Record<DocumentFormat, string>;
4207
+ declare function isDocumentFormat(ext: string): ext is DocumentFormat;
4208
+ /**
4209
+ * Resolve a Markdown image URL to raw bytes, or null when it can't be had.
4210
+ *
4211
+ * Returning null rather than throwing is the contract: one dead image must
4212
+ * never cost the user the whole document.
4213
+ */
4214
+ type ImageByteLoader = (url: string) => Promise<Uint8Array | null>;
4215
+ interface RenderOptions {
4216
+ loadImageBytes?: ImageByteLoader;
4217
+ /** Target file name — only used to pick the CSV vs TSV delimiter for xlsx. */
4218
+ name?: string;
4219
+ }
4220
+ /**
4221
+ * CSV → a real `.xlsx` workbook.
4222
+ *
4223
+ * SheetJS's community build can WRITE cells but not chart objects — charts are
4224
+ * not part of the open-source writer's feature set at any version we can
4225
+ * depend on. So a `chart:` block in a spreadsheet source does not become an
4226
+ * Excel chart; its data lands on its own worksheet as ordinary rows, which the
4227
+ * user can select and chart in one click. Dropping it would be the one
4228
+ * genuinely bad option.
4229
+ */
4230
+ declare function renderXlsx(source: string, opts?: RenderOptions): Promise<Uint8Array>;
4231
+ /**
4232
+ * Markdown → a real `.docx`.
4233
+ *
4234
+ * CHART GAP, stated explicitly: the `docx` library exposes no chart API (it
4235
+ * writes WordprocessingML; a Word chart needs a DrawingML chart part plus an
4236
+ * embedded workbook, which the library does not model). A `chart:` block
4237
+ * therefore renders as its title plus a real Word table of the same numbers —
4238
+ * every value preserved, nothing silently dropped. If a caller needs a drawn
4239
+ * chart in Word, the path is to render it to an image first and reference it
4240
+ * with ordinary `![alt](url)` syntax, which this renderer does embed.
4241
+ */
4242
+ declare function renderDocx(md: string, opts?: RenderOptions): Promise<Uint8Array>;
4243
+ /**
4244
+ * Markdown slides → a real `.pptx`.
4245
+ *
4246
+ * A `chart:` block becomes a genuine, editable PowerPoint chart via
4247
+ * `addChart` — the numbers live in the chart part's embedded workbook, so the
4248
+ * user can click Edit Data and see the exact values the model wrote. That is
4249
+ * the whole point of the convention: an image model cannot be trusted to draw
4250
+ * an accurate axis, and a Markdown table isn't a chart.
4251
+ */
4252
+ declare function renderPptx(md: string, opts?: RenderOptions): Promise<Uint8Array>;
4253
+ /**
4254
+ * Render a document source into the real binary for `format`.
4255
+ *
4256
+ * `source` is Markdown for docx, Markdown slides for pptx, and CSV for xlsx —
4257
+ * the same conventions the hosted `file:<name>.<ext>` blocks already use, so a
4258
+ * model that can produce one can produce the other.
4259
+ */
4260
+ declare function renderDocument(format: DocumentFormat, source: string, opts?: RenderOptions): Promise<Uint8Array>;
4261
+
4262
+ /** Reads a workspace file; supplied by the host so tests need no real disk. */
4263
+ type WorkspaceFileReader = (absPath: string) => Promise<Uint8Array>;
4264
+ declare class GenerateDocumentTool extends BaseTool {
4265
+ private readFile;
4266
+ readonly name = "generate_document";
4267
+ readonly description: string;
4268
+ readonly inputSchema: {
4269
+ type: string;
4270
+ properties: {
4271
+ path: {
4272
+ type: string;
4273
+ description: string;
4274
+ };
4275
+ content: {
4276
+ type: string;
4277
+ description: string;
4278
+ };
4279
+ format: {
4280
+ type: string;
4281
+ description: string;
4282
+ };
4283
+ };
4284
+ required: string[];
4285
+ };
4286
+ /**
4287
+ * `readFile` is injected so the image loader is testable and so a host with a
4288
+ * different workspace (not plain disk) can supply its own reader.
4289
+ */
4290
+ constructor(readFile?: WorkspaceFileReader);
4291
+ isDangerous(): boolean;
4292
+ execute(input: Record<string, unknown>, options: ToolExecuteOptions): Promise<string>;
4293
+ }
4294
+ /**
4295
+ * Register the document tool only where there is a workspace to write into.
4296
+ *
4297
+ * Mirrors how buildMediaTools() conditions `transcribe_audio` on a file reader:
4298
+ * a hosted run has no disk, and a tool that always fails is worse than an
4299
+ * absent one — the planner writes steps around it and the run ends in an
4300
+ * apology. The cloud keeps its browser-side exporter instead.
4301
+ */
4302
+ declare function buildDocumentTools(readFile?: WorkspaceFileReader): BaseTool[];
4303
+
4035
4304
  /**
4036
4305
  * Lets a worker search the indexed workspace codebase by meaning + keywords and
4037
4306
  * get back the most relevant passages with their file paths. Backed by the
@@ -4543,4 +4812,4 @@ declare function gatherSyncBundle(config: CascadeConfig): SyncBundle;
4543
4812
  /** Merge a pulled bundle into a config, returning the updated config to persist. */
4544
4813
  declare function applySyncBundle(bundle: SyncBundle, config: CascadeConfig): CascadeConfig;
4545
4814
 
4546
- export { AZURE_BASE_MODELS, AZURE_BASE_URL_TEMPLATE, type ApprovalRequest, type ApprovalResponse, type AuditEntry, AuditLogger, type BenchmarksConfig, type BudgetConfig, CASCADE_AUDIT_FILE, CASCADE_CONFIG_DIR, CASCADE_CONFIG_FILE, CASCADE_DASHBOARD_SECRET_FILE, CASCADE_DB_FILE, CASCADE_IGNORE_FILE, CASCADE_KEYSTORE_FILE, CASCADE_MD_FILE, CASCADE_VERSION, CHARS_PER_TOKEN, COMPLEXITY_T2_COUNT, Cascade, CascadeCancelledError, type CascadeConfig, type CascadeEvent, type CascadeEventType, CascadeIgnore, type CascadeMessage, CascadeRouter, type CascadeRunOptions, type CascadeRunResult, type CascadeThemeName, CascadeToolError, type Chunk, type ChunkOptions, CloudClient, type CloudConversation, type CloudMessage, type CloudSession, type CloudSessionStore, type CloudTurnInput, type CloudUser, type CodeChunkOptions, type CodeChunker, CodeSearchTool, type CompleteFn, ConfigManager, type ConversationMessage, type CurrentPageProvider, type CurrentPageSnapshot, CurrentPageTool, DEFAULT_API_PORT, DEFAULT_APPROVAL_REQUIRED, DEFAULT_AUTO_SUMMARIZE_AT, DEFAULT_CLOUD_URL, DEFAULT_CONTEXT_LIMIT, DEFAULT_DASHBOARD_PORT, DEFAULT_MAX_SESSION_MESSAGES, DEFAULT_RETENTION_DAYS, DEFAULT_THEME, type DashboardConfig, DashboardServer, type DeviceStart, type DiscoveredMcpTool, type DistilledFact, type Embedder, type EncryptedBlob, type EscalationDecision, type EscalationPayload, type ExtendedContextConfig, type FileManifest, FileMcpOAuthStore, GITHUB_MODELS_API_VERSION, GITHUB_MODELS_CATALOG_URL, GITHUB_MODELS_INFERENCE_URL, GLOBAL_CONFIG_DIR, GLOBAL_CREDENTIALS_FILE, GLOBAL_DB_FILE, GLOBAL_KEYSTORE_FILE, GLOBAL_RUNTIME_DB_FILE, type GenerateOptions, type GenerateResult, type GraphFactSource, GraphRetriever, type GraphSearchOptions, GraphSearchTool, type HookDefinition, type HooksConfig, HooksRunner, type Identity, type ImageAttachment, Keystore, LLMReranker, LM_STUDIO_BASE_URL, type LegacyThemeName, MAX_PAGE_TEXT_CHARS, MCP_TOOL_PREFIX, MODELS, type ManifestDiff, McpClient, type McpDiscoveryResult, McpOAuthProvider, type McpOAuthState, type McpOAuthStore, type McpServerConfig$1 as McpServerConfig, type McpServerRename, type MemoryConfig, MemoryStore, type Message, type MessageContent, type MessagePayload, type MessageStatus, type MessageType, type ModelInfo, type ModelOverrides, type NativeProvider, OLLAMA_BASE_URL, OpenAICompatibleEmbedder, type OpenAIEmbedderOptions, PROVIDER_DISPLAY_NAMES, type PeerMessage, type PeerMessageEvent, type PeerSyncPayload, type PeerSyncType, type PermissionDecision, type PermissionDecisionPayload, type PermissionRequest, type PermissionTrailEntry, type PlanReviewConfig, type ProviderConfig, type ProviderType, type RankedFact, type RefreshResult, type Reranker, type RetrievalContext, type RetrievalMode, type RetrievalPlan, Retriever, type RetrieverSearchOptions, type RuntimeNode, type RuntimeNodeLog, type RuntimeRefreshPayload, type RuntimeScope, type RuntimeSession, type RuntimeSnapshotPayload, type ScheduledTask, type ScoredChunk, type SearchOptions, type Session, type SessionCheckpoint, type SessionMetadata, type SessionSubscriptionPayload, SqliteVectorStore, type StatusUpdate, type StoredMessage, type StreamChunk, type SyncBundle, T1Administrator, type T1ToT2Assignment, T1_MODEL_PRIORITY, T2Manager, type T2Result, type T2ToT3Assignment, T2_MODEL_PRIORITY, type T3Result, type T3ResultPayload, type T3SubtaskSpec, T3Worker, T3_MODEL_PRIORITY, THEME_NAMES, TOOL_NAMES, type TaskComplexity, TaskScheduler, Telemetry, type TelemetryConfig, type Theme, type ThemeColors, type ThemeName, type TierConfig, type TierLimits, type TierRole, type TierStatus, type TokenUsage, type ToolCall, type ToolDefinition, type ToolExecuteOptions, ToolRegistry, type ToolResult, type ToolsConfig, VISION_MODEL_PRIORITY, type VectorStore, type WebSearchConfig, type WebhookConfig, type WorkspaceConfig, WorkspaceIndex, type WorkspaceIndexOptions, applySyncBundle, azureModelForDeployment, beginMcpOAuth, buildManifest, buildSessionTranscript, cagCharBudget, chatCompleterFromProviders, chunkCode, chunkText, completeMcpOAuth, connectMcpWithLoopbackOAuth, createCascade, decryptJSON as decryptSyncBlob, diffManifest, disambiguateMcpServerNames, discoverMcpAuthServer, discoverMcpTools, distillSessionFacts, embedderFromProviders, encryptJSON as encryptSyncBlob, fileOAuthProvider, gatherSyncBundle, hashContent, heuristicCodeChunker, inferAzureBaseModel, isMcpToolName, mcpServerPrefix, mcpToolName, nodeHttpFetch, parseRankOrder, planRetrieval, preferIpv4Host, reciprocalRankFusion, refreshMcpToken, removeMcpServerDenials, runCascade, sessionWorthRemembering, streamCascade, uniqueMcpServerName };
4815
+ export { AZURE_BASE_MODELS, AZURE_BASE_URL_TEMPLATE, type ApprovalRequest, type ApprovalResponse, type AuditEntry, AuditLogger, type BenchmarksConfig, type Block, type BudgetConfig, CASCADE_AUDIT_FILE, CASCADE_CONFIG_DIR, CASCADE_CONFIG_FILE, CASCADE_DASHBOARD_SECRET_FILE, CASCADE_DB_FILE, CASCADE_IGNORE_FILE, CASCADE_KEYSTORE_FILE, CASCADE_MD_FILE, CASCADE_VERSION, CHARS_PER_TOKEN, COMPLEXITY_T2_COUNT, Cascade, CascadeCancelledError, type CascadeConfig, type CascadeEvent, type CascadeEventType, CascadeIgnore, type CascadeMessage, CascadeRouter, type CascadeRunOptions, type CascadeRunResult, type CascadeThemeName, CascadeToolError, type ChartSeries, type ChartSpec, type Chunk, type ChunkOptions, CloudClient, type CloudConversation, type CloudMessage, type CloudSession, type CloudSessionStore, type CloudTurnInput, type CloudUser, type CodeChunkOptions, type CodeChunker, CodeSearchTool, type CompleteFn, ConfigManager, type ConversationMessage, type CurrentPageProvider, type CurrentPageSnapshot, CurrentPageTool, DEFAULT_API_PORT, DEFAULT_APPROVAL_REQUIRED, DEFAULT_AUTO_SUMMARIZE_AT, DEFAULT_CLOUD_URL, DEFAULT_CONTEXT_LIMIT, DEFAULT_DASHBOARD_PORT, DEFAULT_MAX_SESSION_MESSAGES, DEFAULT_RETENTION_DAYS, DEFAULT_THEME, DOCUMENT_MIME, type DashboardConfig, DashboardServer, type DeviceStart, type DiscoveredMcpTool, type DistilledFact, type ChartKind as DocumentChartKind, type DocumentFormat, type Embedder, type EncryptedBlob, type EscalationDecision, type EscalationPayload, type ExtendedContextConfig, type FileManifest, FileMcpOAuthStore, GITHUB_MODELS_API_VERSION, GITHUB_MODELS_CATALOG_URL, GITHUB_MODELS_INFERENCE_URL, GLOBAL_CONFIG_DIR, GLOBAL_CREDENTIALS_FILE, GLOBAL_DB_FILE, GLOBAL_KEYSTORE_FILE, GLOBAL_RUNTIME_DB_FILE, GenerateDocumentTool, type GenerateOptions, type GenerateResult, type GraphFactSource, GraphRetriever, type GraphSearchOptions, GraphSearchTool, type HookDefinition, type HooksConfig, HooksRunner, type Identity, type ImageAttachment, type ImageByteLoader, type ImageInfo, type ImageRef, type InlineRun, Keystore, LLMReranker, LM_STUDIO_BASE_URL, type LegacyThemeName, type LoadedImage, MAX_PAGE_TEXT_CHARS, MCP_TOOL_PREFIX, MODELS, type ManifestDiff, McpClient, type McpDiscoveryResult, McpOAuthProvider, type McpOAuthState, type McpOAuthStore, type McpServerConfig$1 as McpServerConfig, type McpServerRename, type MemoryConfig, MemoryStore, type Message, type MessageContent, type MessagePayload, type MessageStatus, type MessageType, type ModelInfo, type ModelOverrides, type NativeProvider, OLLAMA_BASE_URL, OpenAICompatibleEmbedder, type OpenAIEmbedderOptions, PROVIDER_DISPLAY_NAMES, type PeerMessage, type PeerMessageEvent, type PeerSyncPayload, type PeerSyncType, type PermissionDecision, type PermissionDecisionPayload, type PermissionRequest, type PermissionTrailEntry, type PlanReviewConfig, type ProviderConfig, type ProviderType, type RankedFact, type RefreshResult, type RenderOptions, type Reranker, type RetrievalContext, type RetrievalMode, type RetrievalPlan, Retriever, type RetrieverSearchOptions, type RuntimeNode, type RuntimeNodeLog, type RuntimeRefreshPayload, type RuntimeScope, type RuntimeSession, type RuntimeSnapshotPayload, type ScheduledTask, type ScoredChunk, type SearchOptions, type Session, type SessionCheckpoint, type SessionMetadata, type SessionSubscriptionPayload, type Slide, SqliteVectorStore, type StatusUpdate, type StoredMessage, type StreamChunk, type SyncBundle, T1Administrator, type T1ToT2Assignment, T1_MODEL_PRIORITY, T2Manager, type T2Result, type T2ToT3Assignment, T2_MODEL_PRIORITY, type T3Result, type T3ResultPayload, type T3SubtaskSpec, T3Worker, T3_MODEL_PRIORITY, THEME_NAMES, TOOL_NAMES, type TaskComplexity, TaskScheduler, Telemetry, type TelemetryConfig, type Theme, type ThemeColors, type ThemeName, type TierConfig, type TierLimits, type TierRole, type TierStatus, type TokenUsage, type ToolCall, type ToolDefinition, type ToolExecuteOptions, ToolRegistry, type ToolResult, type ToolsConfig, VISION_MODEL_PRIORITY, type VectorStore, type WebSearchConfig, type WebhookConfig, type WorkspaceConfig, type WorkspaceFileReader, WorkspaceIndex, type WorkspaceIndexOptions, applySyncBundle, azureModelForDeployment, beginMcpOAuth, buildDocumentTools, buildManifest, buildSessionTranscript, bytesToBase64, cagCharBudget, chartKind, chartToTableRows, chatCompleterFromProviders, chunkCode, chunkText, completeMcpOAuth, connectMcpWithLoopbackOAuth, createCascade, decryptJSON as decryptSyncBlob, diffManifest, disambiguateMcpServerNames, discoverMcpAuthServer, discoverMcpTools, distillSessionFacts, embedderFromProviders, encryptJSON as encryptSyncBlob, extractCharts, fileExt, fileOAuthProvider, gatherSyncBundle, hashContent, heuristicCodeChunker, inferAzureBaseModel, inlineRuns, isDocumentFormat, isMcpToolName, matchImageLine, mcpServerPrefix, mcpToolName, nodeHttpFetch, parseBlocks, parseChartSpec, parseDelimited, parseRankOrder, parseSlide, planRetrieval, preferIpv4Host, reciprocalRankFusion, refreshMcpToken, removeMcpServerDenials, renderDocument, renderDocx, renderPptx, renderXlsx, runCascade, sessionWorthRemembering, sniffImage, splitSlides, streamCascade, stripInline, uniqueMcpServerName };
package/dist/index.d.ts CHANGED
@@ -2556,6 +2556,24 @@ declare class Cascade extends EventEmitter {
2556
2556
  */
2557
2557
  setCurrentPageProvider(provider: CurrentPageProvider): void;
2558
2558
  private registerMediaTools;
2559
+ /**
2560
+ * Register `generate_document` where there is a real workspace to write into.
2561
+ *
2562
+ * A `.docx`/`.pptx`/`.xlsx` is a ZIP of OOXML parts, so `file_write` — which
2563
+ * does exactly what it says and writes the model's text verbatim — produced
2564
+ * files Word/Excel/PowerPoint correctly reported as corrupted. This tool owns
2565
+ * the conversion (see tools/generate-document.ts for why it isn't folded into
2566
+ * file_write).
2567
+ *
2568
+ * Registered OUTSIDE `enabledTools` for the same reason the media tools are:
2569
+ * that allowlist is a blast-radius control for tools that reach the machine
2570
+ * or the network, and this one only writes the artifact the user asked for,
2571
+ * into the workspace the run already owns. `disabledTools` still removes it.
2572
+ * A host with no filesystem (the cloud) has its own browser-side exporter and
2573
+ * simply never reaches this path — `buildDocumentTools` returns nothing
2574
+ * without a file reader, mirroring `transcribe_audio`.
2575
+ */
2576
+ private registerDocumentTools;
2559
2577
  /**
2560
2578
  * Supply per-model thumbs-up/down counts so Auto routing can weigh how models
2561
2579
  * have actually performed for this user, on top of public benchmarks.
@@ -4032,6 +4050,257 @@ declare class GraphRetriever {
4032
4050
  format(facts: RankedFact[]): string;
4033
4051
  }
4034
4052
 
4053
+ /** File extension (lowercased, no dot), or '' when there is none. */
4054
+ declare function fileExt(name: string): string;
4055
+ /**
4056
+ * Parse CSV/TSV into rows of cells. Handles quoted fields, escaped quotes (""),
4057
+ * and embedded newlines/commas inside quotes. Delimiter is auto-detected from the
4058
+ * extension (tsv → tab) or inferred from the first line. Bounded for safety.
4059
+ */
4060
+ declare function parseDelimited(text: string, name?: string): string[][];
4061
+ /** Chart shapes we can render. Anything else falls back to a table. */
4062
+ type ChartKind = 'bar' | 'line' | 'pie' | 'doughnut' | 'area' | 'scatter';
4063
+ /** Normalise a fence's chart type, or null when it isn't one we can draw. */
4064
+ declare function chartKind(raw: string): ChartKind | null;
4065
+ interface ChartSeries {
4066
+ name: string;
4067
+ values: number[];
4068
+ }
4069
+ /** A chart's data, format-independent. Renderers decide how to draw it. */
4070
+ interface ChartSpec {
4071
+ kind: ChartKind;
4072
+ /** Optional heading, from a leading `title:` line. */
4073
+ title?: string;
4074
+ /** Label for the category axis — the header row's first cell. */
4075
+ categoryName: string;
4076
+ categories: string[];
4077
+ series: ChartSeries[];
4078
+ }
4079
+ /**
4080
+ * Parse a `chart:<kind>` fence body into a ChartSpec.
4081
+ *
4082
+ * Returns null for anything that isn't plausibly chartable (fewer than two
4083
+ * rows, or no series column). The caller then keeps the block as CODE rather
4084
+ * than dropping it, so a malformed chart is visible in the output instead of
4085
+ * silently missing.
4086
+ */
4087
+ declare function parseChartSpec(kind: ChartKind, body: string): ChartSpec | null;
4088
+ /**
4089
+ * The chart's data as table rows — the fallback for every format that cannot
4090
+ * hold a real chart object (Word and PDF; see render.ts).
4091
+ *
4092
+ * Losing the numbers would be strictly worse than the flat table this replaces,
4093
+ * so no renderer is allowed to just skip a chart block.
4094
+ */
4095
+ declare function chartToTableRows(spec: ChartSpec): string[][];
4096
+ type Block = {
4097
+ t: 'heading';
4098
+ level: number;
4099
+ text: string;
4100
+ } | {
4101
+ t: 'para';
4102
+ text: string;
4103
+ } | {
4104
+ t: 'bullet';
4105
+ ordered: boolean;
4106
+ index: number;
4107
+ text: string;
4108
+ } | {
4109
+ t: 'code';
4110
+ lines: string[];
4111
+ } | {
4112
+ t: 'quote';
4113
+ text: string;
4114
+ } | {
4115
+ t: 'table';
4116
+ rows: string[][];
4117
+ } | {
4118
+ t: 'chart';
4119
+ spec: ChartSpec;
4120
+ } | {
4121
+ t: 'hr';
4122
+ };
4123
+ declare function parseBlocks(md: string): Block[];
4124
+ /** One `![alt](url)` reference lifted out of the Markdown. */
4125
+ interface ImageRef {
4126
+ alt: string;
4127
+ url: string;
4128
+ }
4129
+ declare function matchImageLine(s: string): ImageRef | null;
4130
+ /** Format + intrinsic size, sniffed from the bytes. */
4131
+ interface ImageInfo {
4132
+ /** Narrowed to the four raster types docx's ImageRun accepts. */
4133
+ type: 'png' | 'jpg' | 'gif' | 'bmp';
4134
+ mime: string;
4135
+ width: number;
4136
+ height: number;
4137
+ }
4138
+ type LoadedImage = ImageInfo & {
4139
+ bytes: Uint8Array;
4140
+ alt: string;
4141
+ };
4142
+ /**
4143
+ * Read an image's format and pixel dimensions out of its header.
4144
+ *
4145
+ * Both renderers need this and neither can ask a host for it: docx must state
4146
+ * the type and a transformation in pixels up front, and decoding through an
4147
+ * <img> would make the exporter depend on the browser's image pipeline (and
4148
+ * fail under jsdom, and be unavailable in Node entirely). Returns null for
4149
+ * anything we can't measure, which the caller treats as "not embeddable" rather
4150
+ * than guessing a size.
4151
+ */
4152
+ declare function sniffImage(b: Uint8Array): ImageInfo | null;
4153
+ /**
4154
+ * base64 of raw bytes.
4155
+ *
4156
+ * Node's Buffer where it exists (desktop/CLI, and jsdom tests), otherwise a
4157
+ * chunked btoa so a multi-MB image can't blow the call stack through
4158
+ * String.fromCharCode's argument list. Read off globalThis rather than
4159
+ * referenced directly so a browser bundler never tries to resolve `Buffer`.
4160
+ */
4161
+ declare function bytesToBase64(bytes: Uint8Array): string;
4162
+ /** Strip inline Markdown emphasis to plain text (for renderers with no rich runs). */
4163
+ declare function stripInline(s: string): string;
4164
+ /** One styled span of a line, from inlineRuns(). */
4165
+ interface InlineRun {
4166
+ text: string;
4167
+ bold?: boolean;
4168
+ italic?: boolean;
4169
+ code?: boolean;
4170
+ }
4171
+ /**
4172
+ * Split a line's inline emphasis into styled spans.
4173
+ *
4174
+ * Kept format-neutral (plain objects, not docx TextRuns) so the Word renderer
4175
+ * and any future rich-text renderer share one understanding of what `**bold**`
4176
+ * means. A link becomes its "label (url)" text — no renderer here emits real
4177
+ * hyperlinks yet, and dropping the URL would lose information.
4178
+ */
4179
+ declare function inlineRuns(text: string): InlineRun[];
4180
+ interface Slide {
4181
+ title: string;
4182
+ body: string[];
4183
+ images: ImageRef[];
4184
+ charts: ChartSpec[];
4185
+ }
4186
+ /** Split a Markdown deck into slides: on `---` rules, else on top-level headings. */
4187
+ declare function splitSlides(md: string): Slide[];
4188
+ declare function parseSlide(chunk: string): Slide;
4189
+ /**
4190
+ * Pull `chart:` fences out of a source, returning them plus the text with those
4191
+ * fences removed.
4192
+ *
4193
+ * The spreadsheet convention is plain CSV, so a chart block inside an `.xlsx`
4194
+ * source would otherwise be parsed as three junk rows. SheetJS's community
4195
+ * build cannot write a chart OBJECT (see render.ts), so the data instead lands
4196
+ * on its own worksheet — real rows a user can select and chart in one click,
4197
+ * rather than data that vanished.
4198
+ */
4199
+ declare function extractCharts(source: string): {
4200
+ charts: ChartSpec[];
4201
+ rest: string;
4202
+ };
4203
+
4204
+ /** Office formats we can render into a real binary. */
4205
+ type DocumentFormat = 'docx' | 'pptx' | 'xlsx';
4206
+ declare const DOCUMENT_MIME: Record<DocumentFormat, string>;
4207
+ declare function isDocumentFormat(ext: string): ext is DocumentFormat;
4208
+ /**
4209
+ * Resolve a Markdown image URL to raw bytes, or null when it can't be had.
4210
+ *
4211
+ * Returning null rather than throwing is the contract: one dead image must
4212
+ * never cost the user the whole document.
4213
+ */
4214
+ type ImageByteLoader = (url: string) => Promise<Uint8Array | null>;
4215
+ interface RenderOptions {
4216
+ loadImageBytes?: ImageByteLoader;
4217
+ /** Target file name — only used to pick the CSV vs TSV delimiter for xlsx. */
4218
+ name?: string;
4219
+ }
4220
+ /**
4221
+ * CSV → a real `.xlsx` workbook.
4222
+ *
4223
+ * SheetJS's community build can WRITE cells but not chart objects — charts are
4224
+ * not part of the open-source writer's feature set at any version we can
4225
+ * depend on. So a `chart:` block in a spreadsheet source does not become an
4226
+ * Excel chart; its data lands on its own worksheet as ordinary rows, which the
4227
+ * user can select and chart in one click. Dropping it would be the one
4228
+ * genuinely bad option.
4229
+ */
4230
+ declare function renderXlsx(source: string, opts?: RenderOptions): Promise<Uint8Array>;
4231
+ /**
4232
+ * Markdown → a real `.docx`.
4233
+ *
4234
+ * CHART GAP, stated explicitly: the `docx` library exposes no chart API (it
4235
+ * writes WordprocessingML; a Word chart needs a DrawingML chart part plus an
4236
+ * embedded workbook, which the library does not model). A `chart:` block
4237
+ * therefore renders as its title plus a real Word table of the same numbers —
4238
+ * every value preserved, nothing silently dropped. If a caller needs a drawn
4239
+ * chart in Word, the path is to render it to an image first and reference it
4240
+ * with ordinary `![alt](url)` syntax, which this renderer does embed.
4241
+ */
4242
+ declare function renderDocx(md: string, opts?: RenderOptions): Promise<Uint8Array>;
4243
+ /**
4244
+ * Markdown slides → a real `.pptx`.
4245
+ *
4246
+ * A `chart:` block becomes a genuine, editable PowerPoint chart via
4247
+ * `addChart` — the numbers live in the chart part's embedded workbook, so the
4248
+ * user can click Edit Data and see the exact values the model wrote. That is
4249
+ * the whole point of the convention: an image model cannot be trusted to draw
4250
+ * an accurate axis, and a Markdown table isn't a chart.
4251
+ */
4252
+ declare function renderPptx(md: string, opts?: RenderOptions): Promise<Uint8Array>;
4253
+ /**
4254
+ * Render a document source into the real binary for `format`.
4255
+ *
4256
+ * `source` is Markdown for docx, Markdown slides for pptx, and CSV for xlsx —
4257
+ * the same conventions the hosted `file:<name>.<ext>` blocks already use, so a
4258
+ * model that can produce one can produce the other.
4259
+ */
4260
+ declare function renderDocument(format: DocumentFormat, source: string, opts?: RenderOptions): Promise<Uint8Array>;
4261
+
4262
+ /** Reads a workspace file; supplied by the host so tests need no real disk. */
4263
+ type WorkspaceFileReader = (absPath: string) => Promise<Uint8Array>;
4264
+ declare class GenerateDocumentTool extends BaseTool {
4265
+ private readFile;
4266
+ readonly name = "generate_document";
4267
+ readonly description: string;
4268
+ readonly inputSchema: {
4269
+ type: string;
4270
+ properties: {
4271
+ path: {
4272
+ type: string;
4273
+ description: string;
4274
+ };
4275
+ content: {
4276
+ type: string;
4277
+ description: string;
4278
+ };
4279
+ format: {
4280
+ type: string;
4281
+ description: string;
4282
+ };
4283
+ };
4284
+ required: string[];
4285
+ };
4286
+ /**
4287
+ * `readFile` is injected so the image loader is testable and so a host with a
4288
+ * different workspace (not plain disk) can supply its own reader.
4289
+ */
4290
+ constructor(readFile?: WorkspaceFileReader);
4291
+ isDangerous(): boolean;
4292
+ execute(input: Record<string, unknown>, options: ToolExecuteOptions): Promise<string>;
4293
+ }
4294
+ /**
4295
+ * Register the document tool only where there is a workspace to write into.
4296
+ *
4297
+ * Mirrors how buildMediaTools() conditions `transcribe_audio` on a file reader:
4298
+ * a hosted run has no disk, and a tool that always fails is worse than an
4299
+ * absent one — the planner writes steps around it and the run ends in an
4300
+ * apology. The cloud keeps its browser-side exporter instead.
4301
+ */
4302
+ declare function buildDocumentTools(readFile?: WorkspaceFileReader): BaseTool[];
4303
+
4035
4304
  /**
4036
4305
  * Lets a worker search the indexed workspace codebase by meaning + keywords and
4037
4306
  * get back the most relevant passages with their file paths. Backed by the
@@ -4543,4 +4812,4 @@ declare function gatherSyncBundle(config: CascadeConfig): SyncBundle;
4543
4812
  /** Merge a pulled bundle into a config, returning the updated config to persist. */
4544
4813
  declare function applySyncBundle(bundle: SyncBundle, config: CascadeConfig): CascadeConfig;
4545
4814
 
4546
- export { AZURE_BASE_MODELS, AZURE_BASE_URL_TEMPLATE, type ApprovalRequest, type ApprovalResponse, type AuditEntry, AuditLogger, type BenchmarksConfig, type BudgetConfig, CASCADE_AUDIT_FILE, CASCADE_CONFIG_DIR, CASCADE_CONFIG_FILE, CASCADE_DASHBOARD_SECRET_FILE, CASCADE_DB_FILE, CASCADE_IGNORE_FILE, CASCADE_KEYSTORE_FILE, CASCADE_MD_FILE, CASCADE_VERSION, CHARS_PER_TOKEN, COMPLEXITY_T2_COUNT, Cascade, CascadeCancelledError, type CascadeConfig, type CascadeEvent, type CascadeEventType, CascadeIgnore, type CascadeMessage, CascadeRouter, type CascadeRunOptions, type CascadeRunResult, type CascadeThemeName, CascadeToolError, type Chunk, type ChunkOptions, CloudClient, type CloudConversation, type CloudMessage, type CloudSession, type CloudSessionStore, type CloudTurnInput, type CloudUser, type CodeChunkOptions, type CodeChunker, CodeSearchTool, type CompleteFn, ConfigManager, type ConversationMessage, type CurrentPageProvider, type CurrentPageSnapshot, CurrentPageTool, DEFAULT_API_PORT, DEFAULT_APPROVAL_REQUIRED, DEFAULT_AUTO_SUMMARIZE_AT, DEFAULT_CLOUD_URL, DEFAULT_CONTEXT_LIMIT, DEFAULT_DASHBOARD_PORT, DEFAULT_MAX_SESSION_MESSAGES, DEFAULT_RETENTION_DAYS, DEFAULT_THEME, type DashboardConfig, DashboardServer, type DeviceStart, type DiscoveredMcpTool, type DistilledFact, type Embedder, type EncryptedBlob, type EscalationDecision, type EscalationPayload, type ExtendedContextConfig, type FileManifest, FileMcpOAuthStore, GITHUB_MODELS_API_VERSION, GITHUB_MODELS_CATALOG_URL, GITHUB_MODELS_INFERENCE_URL, GLOBAL_CONFIG_DIR, GLOBAL_CREDENTIALS_FILE, GLOBAL_DB_FILE, GLOBAL_KEYSTORE_FILE, GLOBAL_RUNTIME_DB_FILE, type GenerateOptions, type GenerateResult, type GraphFactSource, GraphRetriever, type GraphSearchOptions, GraphSearchTool, type HookDefinition, type HooksConfig, HooksRunner, type Identity, type ImageAttachment, Keystore, LLMReranker, LM_STUDIO_BASE_URL, type LegacyThemeName, MAX_PAGE_TEXT_CHARS, MCP_TOOL_PREFIX, MODELS, type ManifestDiff, McpClient, type McpDiscoveryResult, McpOAuthProvider, type McpOAuthState, type McpOAuthStore, type McpServerConfig$1 as McpServerConfig, type McpServerRename, type MemoryConfig, MemoryStore, type Message, type MessageContent, type MessagePayload, type MessageStatus, type MessageType, type ModelInfo, type ModelOverrides, type NativeProvider, OLLAMA_BASE_URL, OpenAICompatibleEmbedder, type OpenAIEmbedderOptions, PROVIDER_DISPLAY_NAMES, type PeerMessage, type PeerMessageEvent, type PeerSyncPayload, type PeerSyncType, type PermissionDecision, type PermissionDecisionPayload, type PermissionRequest, type PermissionTrailEntry, type PlanReviewConfig, type ProviderConfig, type ProviderType, type RankedFact, type RefreshResult, type Reranker, type RetrievalContext, type RetrievalMode, type RetrievalPlan, Retriever, type RetrieverSearchOptions, type RuntimeNode, type RuntimeNodeLog, type RuntimeRefreshPayload, type RuntimeScope, type RuntimeSession, type RuntimeSnapshotPayload, type ScheduledTask, type ScoredChunk, type SearchOptions, type Session, type SessionCheckpoint, type SessionMetadata, type SessionSubscriptionPayload, SqliteVectorStore, type StatusUpdate, type StoredMessage, type StreamChunk, type SyncBundle, T1Administrator, type T1ToT2Assignment, T1_MODEL_PRIORITY, T2Manager, type T2Result, type T2ToT3Assignment, T2_MODEL_PRIORITY, type T3Result, type T3ResultPayload, type T3SubtaskSpec, T3Worker, T3_MODEL_PRIORITY, THEME_NAMES, TOOL_NAMES, type TaskComplexity, TaskScheduler, Telemetry, type TelemetryConfig, type Theme, type ThemeColors, type ThemeName, type TierConfig, type TierLimits, type TierRole, type TierStatus, type TokenUsage, type ToolCall, type ToolDefinition, type ToolExecuteOptions, ToolRegistry, type ToolResult, type ToolsConfig, VISION_MODEL_PRIORITY, type VectorStore, type WebSearchConfig, type WebhookConfig, type WorkspaceConfig, WorkspaceIndex, type WorkspaceIndexOptions, applySyncBundle, azureModelForDeployment, beginMcpOAuth, buildManifest, buildSessionTranscript, cagCharBudget, chatCompleterFromProviders, chunkCode, chunkText, completeMcpOAuth, connectMcpWithLoopbackOAuth, createCascade, decryptJSON as decryptSyncBlob, diffManifest, disambiguateMcpServerNames, discoverMcpAuthServer, discoverMcpTools, distillSessionFacts, embedderFromProviders, encryptJSON as encryptSyncBlob, fileOAuthProvider, gatherSyncBundle, hashContent, heuristicCodeChunker, inferAzureBaseModel, isMcpToolName, mcpServerPrefix, mcpToolName, nodeHttpFetch, parseRankOrder, planRetrieval, preferIpv4Host, reciprocalRankFusion, refreshMcpToken, removeMcpServerDenials, runCascade, sessionWorthRemembering, streamCascade, uniqueMcpServerName };
4815
+ export { AZURE_BASE_MODELS, AZURE_BASE_URL_TEMPLATE, type ApprovalRequest, type ApprovalResponse, type AuditEntry, AuditLogger, type BenchmarksConfig, type Block, type BudgetConfig, CASCADE_AUDIT_FILE, CASCADE_CONFIG_DIR, CASCADE_CONFIG_FILE, CASCADE_DASHBOARD_SECRET_FILE, CASCADE_DB_FILE, CASCADE_IGNORE_FILE, CASCADE_KEYSTORE_FILE, CASCADE_MD_FILE, CASCADE_VERSION, CHARS_PER_TOKEN, COMPLEXITY_T2_COUNT, Cascade, CascadeCancelledError, type CascadeConfig, type CascadeEvent, type CascadeEventType, CascadeIgnore, type CascadeMessage, CascadeRouter, type CascadeRunOptions, type CascadeRunResult, type CascadeThemeName, CascadeToolError, type ChartSeries, type ChartSpec, type Chunk, type ChunkOptions, CloudClient, type CloudConversation, type CloudMessage, type CloudSession, type CloudSessionStore, type CloudTurnInput, type CloudUser, type CodeChunkOptions, type CodeChunker, CodeSearchTool, type CompleteFn, ConfigManager, type ConversationMessage, type CurrentPageProvider, type CurrentPageSnapshot, CurrentPageTool, DEFAULT_API_PORT, DEFAULT_APPROVAL_REQUIRED, DEFAULT_AUTO_SUMMARIZE_AT, DEFAULT_CLOUD_URL, DEFAULT_CONTEXT_LIMIT, DEFAULT_DASHBOARD_PORT, DEFAULT_MAX_SESSION_MESSAGES, DEFAULT_RETENTION_DAYS, DEFAULT_THEME, DOCUMENT_MIME, type DashboardConfig, DashboardServer, type DeviceStart, type DiscoveredMcpTool, type DistilledFact, type ChartKind as DocumentChartKind, type DocumentFormat, type Embedder, type EncryptedBlob, type EscalationDecision, type EscalationPayload, type ExtendedContextConfig, type FileManifest, FileMcpOAuthStore, GITHUB_MODELS_API_VERSION, GITHUB_MODELS_CATALOG_URL, GITHUB_MODELS_INFERENCE_URL, GLOBAL_CONFIG_DIR, GLOBAL_CREDENTIALS_FILE, GLOBAL_DB_FILE, GLOBAL_KEYSTORE_FILE, GLOBAL_RUNTIME_DB_FILE, GenerateDocumentTool, type GenerateOptions, type GenerateResult, type GraphFactSource, GraphRetriever, type GraphSearchOptions, GraphSearchTool, type HookDefinition, type HooksConfig, HooksRunner, type Identity, type ImageAttachment, type ImageByteLoader, type ImageInfo, type ImageRef, type InlineRun, Keystore, LLMReranker, LM_STUDIO_BASE_URL, type LegacyThemeName, type LoadedImage, MAX_PAGE_TEXT_CHARS, MCP_TOOL_PREFIX, MODELS, type ManifestDiff, McpClient, type McpDiscoveryResult, McpOAuthProvider, type McpOAuthState, type McpOAuthStore, type McpServerConfig$1 as McpServerConfig, type McpServerRename, type MemoryConfig, MemoryStore, type Message, type MessageContent, type MessagePayload, type MessageStatus, type MessageType, type ModelInfo, type ModelOverrides, type NativeProvider, OLLAMA_BASE_URL, OpenAICompatibleEmbedder, type OpenAIEmbedderOptions, PROVIDER_DISPLAY_NAMES, type PeerMessage, type PeerMessageEvent, type PeerSyncPayload, type PeerSyncType, type PermissionDecision, type PermissionDecisionPayload, type PermissionRequest, type PermissionTrailEntry, type PlanReviewConfig, type ProviderConfig, type ProviderType, type RankedFact, type RefreshResult, type RenderOptions, type Reranker, type RetrievalContext, type RetrievalMode, type RetrievalPlan, Retriever, type RetrieverSearchOptions, type RuntimeNode, type RuntimeNodeLog, type RuntimeRefreshPayload, type RuntimeScope, type RuntimeSession, type RuntimeSnapshotPayload, type ScheduledTask, type ScoredChunk, type SearchOptions, type Session, type SessionCheckpoint, type SessionMetadata, type SessionSubscriptionPayload, type Slide, SqliteVectorStore, type StatusUpdate, type StoredMessage, type StreamChunk, type SyncBundle, T1Administrator, type T1ToT2Assignment, T1_MODEL_PRIORITY, T2Manager, type T2Result, type T2ToT3Assignment, T2_MODEL_PRIORITY, type T3Result, type T3ResultPayload, type T3SubtaskSpec, T3Worker, T3_MODEL_PRIORITY, THEME_NAMES, TOOL_NAMES, type TaskComplexity, TaskScheduler, Telemetry, type TelemetryConfig, type Theme, type ThemeColors, type ThemeName, type TierConfig, type TierLimits, type TierRole, type TierStatus, type TokenUsage, type ToolCall, type ToolDefinition, type ToolExecuteOptions, ToolRegistry, type ToolResult, type ToolsConfig, VISION_MODEL_PRIORITY, type VectorStore, type WebSearchConfig, type WebhookConfig, type WorkspaceConfig, type WorkspaceFileReader, WorkspaceIndex, type WorkspaceIndexOptions, applySyncBundle, azureModelForDeployment, beginMcpOAuth, buildDocumentTools, buildManifest, buildSessionTranscript, bytesToBase64, cagCharBudget, chartKind, chartToTableRows, chatCompleterFromProviders, chunkCode, chunkText, completeMcpOAuth, connectMcpWithLoopbackOAuth, createCascade, decryptJSON as decryptSyncBlob, diffManifest, disambiguateMcpServerNames, discoverMcpAuthServer, discoverMcpTools, distillSessionFacts, embedderFromProviders, encryptJSON as encryptSyncBlob, extractCharts, fileExt, fileOAuthProvider, gatherSyncBundle, hashContent, heuristicCodeChunker, inferAzureBaseModel, inlineRuns, isDocumentFormat, isMcpToolName, matchImageLine, mcpServerPrefix, mcpToolName, nodeHttpFetch, parseBlocks, parseChartSpec, parseDelimited, parseRankOrder, parseSlide, planRetrieval, preferIpv4Host, reciprocalRankFusion, refreshMcpToken, removeMcpServerDenials, renderDocument, renderDocx, renderPptx, renderXlsx, runCascade, sessionWorthRemembering, sniffImage, splitSlides, streamCascade, stripInline, uniqueMcpServerName };