@supersolutions/super-chat-core 0.2.3 → 0.4.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.ts CHANGED
@@ -424,14 +424,16 @@ type FormCard = {
424
424
  };
425
425
  type ConfirmCard = {
426
426
  kind: "confirm";
427
+ /** The one question the buttons answer, such as "Rename the report?". Shown last, above the buttons. */
427
428
  title: string;
428
- /** The consequential summary — what will actually happen. */
429
+ /** The consequential details — amounts, targets, anything irreversible. May be empty when `description` already says all of it. */
429
430
  summary: {
430
431
  label: string;
431
432
  value: string | number;
432
433
  tone?: CardTone;
433
434
  mono?: boolean;
434
435
  }[];
436
+ /** What will happen, in a sentence or two. Shown first. */
435
437
  description?: string;
436
438
  confirmLabel?: string;
437
439
  cancelLabel?: string;
@@ -490,9 +492,23 @@ type CardSpec = BuiltinCard | ({
490
492
  kind: string;
491
493
  } & Record<string, unknown>);
492
494
  /** Envelope attached to a tool result, or returned by `visualize`. */
495
+ /**
496
+ * Where a host shows a card: in the conversation (`inline`, the default), in its side panel
497
+ * (`panel`), or inside a document block (`document`). The same renderer draws it in every place.
498
+ * Structurally the same as super-protocol's `CardPlacement`; core has no dependencies, so it is
499
+ * repeated here. An interactive card is only ever inline.
500
+ */
501
+ type CardPlacement = "inline" | "panel" | "document";
502
+ declare const CARD_PLACEMENTS: readonly CardPlacement[];
503
+ declare const isCardPlacement: (value: unknown) => value is CardPlacement;
493
504
  type Card = {
494
505
  id: string;
495
506
  spec: CardSpec;
507
+ /**
508
+ * Where the agent or tool asked for the card to be shown. Absent means `inline`. A host with no
509
+ * side panel shows a `panel` card inline; it never drops it.
510
+ */
511
+ placement?: CardPlacement;
496
512
  /** Set when the payload was dropped from persisted history. */
497
513
  expired?: boolean;
498
514
  /** Tool call this card belongs to, for correlating an action back. */
@@ -523,7 +539,7 @@ type CardCarrier = {
523
539
  } & Record<string, unknown>;
524
540
  declare function isCardCarrier(value: unknown): value is CardCarrier;
525
541
  /** Attach a card to a tool result without disturbing the data the model reads. */
526
- declare function withCard<T extends Record<string, unknown>>(data: T, spec: CardSpec, id?: string): T & CardCarrier;
542
+ declare function withCard<T extends Record<string, unknown>>(data: T, spec: CardSpec, id?: string, placement?: CardPlacement): T & CardCarrier;
527
543
  /**
528
544
  * Remove a card payload from a tool output, leaving a note in its place.
529
545
  *
@@ -1254,6 +1270,11 @@ type ToolExecutionContext = {
1254
1270
  surfaceActionTools?: readonly string[];
1255
1271
  };
1256
1272
  type ToolResultExtras = {
1273
+ /**
1274
+ * Where the card should be shown: `inline` (the default) or `panel`, the host's side panel.
1275
+ * Ignored without a card; an interactive card stays inline whatever is asked.
1276
+ */
1277
+ placement?: "inline" | "panel";
1257
1278
  /**
1258
1279
  * Update an EXISTING card instead of minting a new one: the runtime reuses
1259
1280
  * this id, and the reducer's upsert replaces the old card in place.
@@ -1273,6 +1294,27 @@ type ToolResult = ToolResultExtras & {
1273
1294
  card?: CardSpec;
1274
1295
  failure?: "execution-error" | "denied" | "invalid-input" | "timeout" | "not-found";
1275
1296
  };
1297
+ /**
1298
+ * How an approval card reads, in the words of the person approving. The card shows
1299
+ * `description`, then any `summary` rows, then `title` as the question above the buttons.
1300
+ */
1301
+ type ToolApproval = {
1302
+ /** The one question the buttons answer, such as "Rename the report?". */
1303
+ title?: string;
1304
+ /** What will happen, in a sentence or two, such as "Your report will be titled “Q3 review”.". */
1305
+ description?: string;
1306
+ /** Exact details worth checking: amounts, targets, anything irreversible. Omit when the sentence says it all. */
1307
+ summary?: {
1308
+ label: string;
1309
+ value: string;
1310
+ }[];
1311
+ /** The verb on the approve button, such as "Rename". Defaults to "Allow". */
1312
+ confirmLabel?: string;
1313
+ /** Defaults to "Not now". */
1314
+ cancelLabel?: string;
1315
+ /** Marks an action that is hard to undo. */
1316
+ danger?: boolean;
1317
+ };
1276
1318
  type ToolDefinition = {
1277
1319
  name: string;
1278
1320
  description: string;
@@ -1298,6 +1340,12 @@ type ToolDefinition = {
1298
1340
  * saying so is asked about twice, which is the safe way for that to go wrong.
1299
1341
  */
1300
1342
  confirmation?: "runtime" | "tool";
1343
+ /**
1344
+ * The approval card's wording, written for the person approving the action. Without
1345
+ * it the card shows the first sentence of `description` and the input's plain fields.
1346
+ * Never shown to the model.
1347
+ */
1348
+ approval?: (input: unknown) => ToolApproval | undefined;
1301
1349
  /** Ask the provider to enforce the schema (OpenAI strict mode). */
1302
1350
  strict?: boolean;
1303
1351
  /** Default card renderer key when the result carries no explicit card. */
@@ -1820,7 +1868,53 @@ declare class CardRegistry {
1820
1868
  /** Per-kind schemas, for hosts that prefer one tool per card kind. */
1821
1869
  schemas(): Record<string, JSONSchema>;
1822
1870
  }
1823
- declare function makeCard(spec: CardSpec, callId?: string, id?: string): Card;
1871
+ declare function makeCard(spec: CardSpec, callId?: string, id?: string, placement?: CardPlacement): Card;
1872
+
1873
+ declare const CARD_REF_SCHEME = "ref";
1874
+ declare const CARD_REF_LIMITS: Readonly<{
1875
+ /** The whole link, in UTF-16 code units. */
1876
+ length: 512;
1877
+ /** The target (the card's id). */
1878
+ target: 128;
1879
+ /** Distinct param names. */
1880
+ names: 16;
1881
+ /** Values of one param name (`key=a&key=b`). */
1882
+ values: 32;
1883
+ /** One param name. */
1884
+ name: 32;
1885
+ /** One decoded value, in UTF-16 code units. */
1886
+ value: 256;
1887
+ }>;
1888
+ /** A parsed reference. A repeated param is a list in order; values are decoded once, never split on commas. */
1889
+ interface CardRef {
1890
+ /** The `id` of the card this points into. */
1891
+ target: string;
1892
+ params: Record<string, string[]>;
1893
+ }
1894
+ /** What the reader did with the link: pointed at it, left it, or chose it (click, Enter, tap). */
1895
+ type CardRefEvent = "enter" | "leave" | "activate";
1896
+ /** What a card answers. `ok: false` lets the host show a stale reference as plain text, with the reason. */
1897
+ type CardRefResult = {
1898
+ ok: true;
1899
+ label?: string;
1900
+ } | {
1901
+ ok: false;
1902
+ code: string;
1903
+ reason: string;
1904
+ };
1905
+ type CardRefParse = {
1906
+ ok: true;
1907
+ ref: CardRef;
1908
+ } | {
1909
+ ok: false;
1910
+ error: string;
1911
+ };
1912
+ /** A host's side of references: hands one on to the card it points into. `null` clears everything shown. */
1913
+ interface CardRefHost {
1914
+ ref(ref: CardRef | null, event: CardRefEvent): CardRefResult;
1915
+ }
1916
+ /** Reads a `ref:` link. */
1917
+ declare function parseCardRef(href: unknown): CardRefParse;
1824
1918
 
1825
1919
  declare const tableCard: CardKindDefinition;
1826
1920
  declare const statsCard: CardKindDefinition;
@@ -2096,6 +2190,22 @@ type RunEvent = {
2096
2190
  runId: string;
2097
2191
  mode: RunMode;
2098
2192
  }
2193
+ /**
2194
+ * Everything the run has produced so far, replacing what the consumer holds.
2195
+ *
2196
+ * For a consumer that joins a run part-way, or lost part of its stream: a
2197
+ * turn that runs on a server, followed over a connection that dropped, where
2198
+ * replaying every event is not possible. `runAgent` never emits it. The run
2199
+ * is live after it — a card still waiting on the person is announced again
2200
+ * with `awaiting-user`.
2201
+ */
2202
+ | {
2203
+ type: "run-snapshot";
2204
+ parts: ContentPart[];
2205
+ cards: Card[];
2206
+ usage?: Usage;
2207
+ steps?: number;
2208
+ }
2099
2209
  /** Emitted before the first provider call — the whole "why did it send that" answer. */
2100
2210
  | {
2101
2211
  type: "context-built";
@@ -2430,6 +2540,16 @@ type A2uiMessage = {
2430
2540
  /** The messages that would recreate this surface in an A2UI client. */
2431
2541
  declare function toA2uiMessages(spec: SurfaceSpec): A2uiMessage[];
2432
2542
 
2543
+ /** "documentId" → "Document", "max_retry_count" → "Max retry count". */
2544
+ declare function humanizeFieldName(key: string): string;
2545
+ /**
2546
+ * The approval card for a tool call. A tool's own `approval` wording wins; without it
2547
+ * the card uses the first sentence of the description and the input's plain fields.
2548
+ */
2549
+ declare function approvalCard(tool: Pick<ToolDefinition, "description" | "approval">, input: unknown, options?: {
2550
+ danger?: boolean;
2551
+ }): CardSpec;
2552
+
2433
2553
  type RepairResult = {
2434
2554
  value: unknown;
2435
2555
  repaired: boolean;
@@ -2489,10 +2609,18 @@ declare function parsePartialJson(text: string): {
2489
2609
  complete: boolean;
2490
2610
  };
2491
2611
 
2612
+ /** Where `visualize` may put a card. `document` is not the agent's to choose from a chat. */
2613
+ type VisualizePlacement = "inline" | "panel";
2492
2614
  type VisualizeToolOptions = {
2493
2615
  cards: CardRegistry;
2494
2616
  /** Restrict which kinds the agent may emit (a read-only chat may want no `confirm`). */
2495
2617
  kinds?: string[];
2618
+ /**
2619
+ * Where the agent may put a card. Default `["inline"]`: the tool is exactly as before. Add
2620
+ * `"panel"` when the host shows a side panel (super-chat-ui's `ChatPanel`): the agent can then open
2621
+ * a card beside the conversation, for a chart or a document worth room of its own.
2622
+ */
2623
+ placements?: readonly VisualizePlacement[];
2496
2624
  };
2497
2625
  /**
2498
2626
  * The generic visualization tool.
@@ -2525,6 +2653,7 @@ declare function createBuiltinTools(opts: {
2525
2653
  cards: CardRegistry;
2526
2654
  skills?: SkillRegistry;
2527
2655
  surfaces?: SurfaceCatalogue;
2656
+ placements?: readonly VisualizePlacement[];
2528
2657
  }): ToolDefinition[];
2529
2658
 
2530
2659
  type StopContext = {
@@ -3013,4 +3142,4 @@ declare function createMcpSkill(serverName: string, defs: readonly ToolDefinitio
3013
3142
  */
3014
3143
  declare function elicitViaCard(requestCard: (spec: CardSpec) => Promise<unknown>): McpElicitHandler;
3015
3144
 
3016
- export { A2UI_VERSION, type A2uiMessage, ANTHROPIC_OFFICIAL_PROFILE, AgentError, type AgentErrorKind, type AppAction, type AppStateBinding, type AppStateSourceOptions, type AppliedEdit, BUILTIN_CARDS, type BindingScope, type BudgetShares, type BuiltContext, type BuiltinCard, type BuiltinCardKind, CARD_COMPONENT, CARD_ENTRY_PREFIX, CARD_KEY, CallOptions, type CalloutCard, type Card, type CardAction, type CardCarrier, type CardKindDefinition, CardRegistry, type CardSpec, type CardTone, type CardValidation, type CardValueFormat, type ChartAnnotation, type ChartCard, type ChartSeries, type ChecklistCard, type ChoiceCard, type CitationsCard, type CodeCard, type CompactionResult, type ComparisonCard, type ConfirmCard, ContentPart, ContextBuilder, type ContextBuilderOptions, type ContextLayer, type ContextSource, type ContextSourceInput, type ContextSourceResult, type ContextTrace, DEFAULT_PRESETS, DEFAULT_STOP_CONDITIONS, type DiffCard, type DirectTransportConfig, type DocumentCard, type DocumentEdit, type DocumentOutlineEntry, type DocumentQuoteRef, type DocumentSnapshot, type DocumentStore, type DocumentToolsOptions, type EditHunk, type EditRejection, type EditResult, type EditReviewCard, type EmailCard, type ExecuteToolOptions, type FileStore, FinishReason, type FormCard, type FormField, type FunnelCard, type GaugeCard, type GenerateImageToolOptions, GenerateResult, type GeneratedMedia, type GeneratedMediaKind, type ImageGenerationRequest, JSONSchema, JobHandle, JobStatus, type KeyValueCard, type LayerId, MAILTO_SAFE_LENGTH, MESSAGE_OVERHEAD_TOKENS, type MailtoLink, type MarkdownBlock, type MarkdownBlockKind, type MarkdownCard, type McpCallResult, McpClient, type McpClientConfig, type McpContent, type McpElicitHandler, type McpElicitRequest, type McpElicitResult, type McpImportOptions, McpRpcError, type McpServerInfo, type McpTool, type MediaCard, type MediaJobHandle, type MediaJobSnapshot, type MediaProvider, type MediaProviderCapabilities, MediaSource, type MemoryEntry, type MemorySourceOptions, type MemoryStore, Message, MessageRole, type MeterSink, type MeteringError, type MeteringRecord, type MeteringSource, type MeteringStatus, ModelInfo, NormalizedRequest, OPENAI_OFFICIAL_PROFILE, type OpenAIImageProviderConfig, PartialJsonParser, type PartialToolCall, type PresetName, type ProfileDirectTransportConfig, type ProgressCard, type ProgressStep, Provider, ProviderCapabilities, ProviderFileRef, type ProviderProfile, type ProviderProtocol, type ProxyEnvelope, type ProxyTransportConfig, QUOTES_METADATA_KEY, type QuoteDrift, type RepairResult, type ResolvedSkill, type RestThreadStoreConfig, type RetrievalDoc, type RetrievalSourceOptions, type RetrievedChunk, type Retriever, RetryPolicy, type RunConfig, type RunEvent, type RunMeteringRecord, type RunMode, type RunState, SSEDecoder, type SSEMessage, SURFACE_A2UI_CATALOG_ID, SURFACE_ARTIFACT_KIND, SURFACE_CARD_KIND, SURFACE_EVENT_METADATA_KEY, SURFACE_FORMAT_VERSION, SURFACE_GUIDE, SURFACE_LIMITS, SURFACE_PRIMITIVES, SURFACE_SKILL_ID, SURFACE_TOOL_NAMES, type SchemaCheckOptions, type SchemaProblem, type SerializedMultipartBody, type Skill, type SkillContext, type SkillMatch, type SkillMatcher, type SkillMode, SkillRegistry, type SkillRegistryOptions, type SkillSection, type SpeechGenerationRequest, type StatItem, type StatsCard, type StepMeteringRecord, type StopCondition, type StopContext, type StoredFile, type StoredThread, type Summarizer, type SurfaceAction, type SurfaceActivity, type SurfaceActivityState, type SurfaceAggregateOp, type SurfaceBinding, type SurfaceBuildContext, type SurfaceBuildResult, type SurfaceCardAnswer, SurfaceCatalogue, type SurfaceCatalogueOptions, type SurfaceComponent, type SurfaceComponentCategory, type SurfaceComponentDefinition, type SurfaceCondition, type SurfaceConditionOp, type SurfaceEventRecord, type SurfaceIssue, type SurfaceIssueCode, type SurfaceItemBinding, SurfaceLedger, type SurfaceOperation, type SurfacePathBinding, type SurfacePendingPart, type SurfaceQuery, type SurfaceQueryBinding, type SurfaceSpec, type SurfaceTemplateBinding, type SurfaceToolAuthorization, type SurfaceToolRunConfig, type SurfaceToolsOptions, type SurfaceValidationContext, type SurfaceWhere, type SurfaceWhereOp, THREAD_SCHEMA_VERSION, type TableCard, type TableColumn, type ThreadMeta, type ThreadStore, type TimelineCard, type TokenBudget, type TokenCounter, type ToolCallOutcome, type ToolCallRequest, ToolCallStatus, type ToolDefinition, type ToolExecutionContext, ToolFailureKind, type ToolLoading, type ToolLoadingHint, ToolRegistry, type ToolResolution, type ToolResult, type ToolResultExtras, type ToolSide, ToolSpec, type TraceEntry, type Transcript, type TranscriptionRequest, Transport, TransportRequest, type TreeCard, type TreeNode, type TurnLayoutOptions, type TurnSegment, type UnsafeFinding, Usage, type VideoGenerationRequest, afterTool, appendReasoning, appendText, applyEdits, applySurfaceOperations, assistantMessage, authorizeSurfaceTool, backoffDelay, base64ToBytes, bindingProblems, buildEml, buildMailto, buildSummaryPrompt, buildSurface, buildUrl, bytesToBase64, calloutCard, chartCard, check, checkQuoteDrift, checkSchema, checklistCard, childrenOf, choiceCard, citationsCard, codeCard, combineMeteringSources, compactError, compactHistory, comparisonCard, confirmCard, consecutiveFailures, countMessageTokens, countMessagesTokens, createAppActionTools, createAppStateSource, createBudget, createBuiltinTools, createDirectTransport, createDirectTransportForProfile, createDocumentTools, createEmailDraftTool, createGenerateImageTool, createHttpTransport, createKeywordRetriever, createLoadSkillTool, createLocalDocumentStore, createLocalFileStore, createLocalMemoryStore, createLocalThreadStore, createMcpSkill, createMemoryDocumentStore, createMemoryFileStore, createMemoryMemoryStore, createMemorySource, createMemoryThreadStore, createOpenAICompatibleProfile, createOpenAIImageProvider, createProviderFromProfile, createProxyTransport, createRememberTool, createRestThreadStore, createRetrievalSource, createSurfaceContextSource, createSurfaceSkill, createSurfaceTools, createUpdateCardTool, createVisualizeTool, deliverMetering, diffCard, documentCard, editReviewCard, elicitViaCard, emailCard, emlFilename, errorFromResponse, estimateJsonTokens, estimateTokens, evaluateSurfaceCondition, executeToolCall, executeToolCalls, file, findUnsafe, foldSurfaces, formCard, formatQuotes, formatTemplate, funnelCard, gaugeCard, generatedMediaUrl, getAt, hasTurnOrder, hunksOf, image, importMcpTools, initialRunState, isAgentError, isCardCarrier, isScriptUrl, isSurfaceBinding, isSurfaceId, isSurfaceSpec, isTextPart, isToolCallPart, isToolResultPart, keyValueCard, kindFromStatus, lastUserText, latestLeaf, layoutTurn, linkLinear, makeCard, mapMcpResult, markdownCard, matchSkills, mediaCard, message, messageText, nextId, noToolCalls, normalizeProviderProfile, normalizeToolName, outlineOf, packByPriority, parsePartialJson, parsePointer, parseRetryAfter, parseSSE, parseSSEJson, pathTo, previewSurface, progressCard, quoteDrift, quotesOf, reduceRunEvent, removeAt, renderSkill, repairToolArguments, resolvePartialCard, resolveSurfaceAction, resolveSurfaceValue, resolveToolLoading, runAgent, runSurfaceQuery, runSurfaceToolAction, safeCutIndex, safeSurfaceUrl, sanitizeSurfaceSpec, scoreSkill, searchBlocks, setAt, shouldStop, siblingsOf, spanOf, splitBlocks, statsCard, stepCountIs, stripCardPayload, stripUiOnlyParts, surfaceActionTools, surfaceCardId, tableCard, text, threadSnapshot, timelineCard, toA2uiMessages, toAgentError, tokenBudgetExceeded, tokenize, toolCall, toolCallsIn, toolResult, totalAllocated, treeCard, trimHistory, usageSource, userDeclined, userMessage, usesBinding, validateSurfaceAction, validateSurfaceComponent, validateSurfaceComponents, validateSurfaceGraph, withCard, withQuotes, withRetry };
3145
+ export { A2UI_VERSION, type A2uiMessage, ANTHROPIC_OFFICIAL_PROFILE, AgentError, type AgentErrorKind, type AppAction, type AppStateBinding, type AppStateSourceOptions, type AppliedEdit, BUILTIN_CARDS, type BindingScope, type BudgetShares, type BuiltContext, type BuiltinCard, type BuiltinCardKind, CARD_COMPONENT, CARD_ENTRY_PREFIX, CARD_KEY, CARD_PLACEMENTS, CARD_REF_LIMITS, CARD_REF_SCHEME, CallOptions, type CalloutCard, type Card, type CardAction, type CardCarrier, type CardKindDefinition, type CardPlacement, type CardRef, type CardRefEvent, type CardRefHost, type CardRefParse, type CardRefResult, CardRegistry, type CardSpec, type CardTone, type CardValidation, type CardValueFormat, type ChartAnnotation, type ChartCard, type ChartSeries, type ChecklistCard, type ChoiceCard, type CitationsCard, type CodeCard, type CompactionResult, type ComparisonCard, type ConfirmCard, ContentPart, ContextBuilder, type ContextBuilderOptions, type ContextLayer, type ContextSource, type ContextSourceInput, type ContextSourceResult, type ContextTrace, DEFAULT_PRESETS, DEFAULT_STOP_CONDITIONS, type DiffCard, type DirectTransportConfig, type DocumentCard, type DocumentEdit, type DocumentOutlineEntry, type DocumentQuoteRef, type DocumentSnapshot, type DocumentStore, type DocumentToolsOptions, type EditHunk, type EditRejection, type EditResult, type EditReviewCard, type EmailCard, type ExecuteToolOptions, type FileStore, FinishReason, type FormCard, type FormField, type FunnelCard, type GaugeCard, type GenerateImageToolOptions, GenerateResult, type GeneratedMedia, type GeneratedMediaKind, type ImageGenerationRequest, JSONSchema, JobHandle, JobStatus, type KeyValueCard, type LayerId, MAILTO_SAFE_LENGTH, MESSAGE_OVERHEAD_TOKENS, type MailtoLink, type MarkdownBlock, type MarkdownBlockKind, type MarkdownCard, type McpCallResult, McpClient, type McpClientConfig, type McpContent, type McpElicitHandler, type McpElicitRequest, type McpElicitResult, type McpImportOptions, McpRpcError, type McpServerInfo, type McpTool, type MediaCard, type MediaJobHandle, type MediaJobSnapshot, type MediaProvider, type MediaProviderCapabilities, MediaSource, type MemoryEntry, type MemorySourceOptions, type MemoryStore, Message, MessageRole, type MeterSink, type MeteringError, type MeteringRecord, type MeteringSource, type MeteringStatus, ModelInfo, NormalizedRequest, OPENAI_OFFICIAL_PROFILE, type OpenAIImageProviderConfig, PartialJsonParser, type PartialToolCall, type PresetName, type ProfileDirectTransportConfig, type ProgressCard, type ProgressStep, Provider, ProviderCapabilities, ProviderFileRef, type ProviderProfile, type ProviderProtocol, type ProxyEnvelope, type ProxyTransportConfig, QUOTES_METADATA_KEY, type QuoteDrift, type RepairResult, type ResolvedSkill, type RestThreadStoreConfig, type RetrievalDoc, type RetrievalSourceOptions, type RetrievedChunk, type Retriever, RetryPolicy, type RunConfig, type RunEvent, type RunMeteringRecord, type RunMode, type RunState, SSEDecoder, type SSEMessage, SURFACE_A2UI_CATALOG_ID, SURFACE_ARTIFACT_KIND, SURFACE_CARD_KIND, SURFACE_EVENT_METADATA_KEY, SURFACE_FORMAT_VERSION, SURFACE_GUIDE, SURFACE_LIMITS, SURFACE_PRIMITIVES, SURFACE_SKILL_ID, SURFACE_TOOL_NAMES, type SchemaCheckOptions, type SchemaProblem, type SerializedMultipartBody, type Skill, type SkillContext, type SkillMatch, type SkillMatcher, type SkillMode, SkillRegistry, type SkillRegistryOptions, type SkillSection, type SpeechGenerationRequest, type StatItem, type StatsCard, type StepMeteringRecord, type StopCondition, type StopContext, type StoredFile, type StoredThread, type Summarizer, type SurfaceAction, type SurfaceActivity, type SurfaceActivityState, type SurfaceAggregateOp, type SurfaceBinding, type SurfaceBuildContext, type SurfaceBuildResult, type SurfaceCardAnswer, SurfaceCatalogue, type SurfaceCatalogueOptions, type SurfaceComponent, type SurfaceComponentCategory, type SurfaceComponentDefinition, type SurfaceCondition, type SurfaceConditionOp, type SurfaceEventRecord, type SurfaceIssue, type SurfaceIssueCode, type SurfaceItemBinding, SurfaceLedger, type SurfaceOperation, type SurfacePathBinding, type SurfacePendingPart, type SurfaceQuery, type SurfaceQueryBinding, type SurfaceSpec, type SurfaceTemplateBinding, type SurfaceToolAuthorization, type SurfaceToolRunConfig, type SurfaceToolsOptions, type SurfaceValidationContext, type SurfaceWhere, type SurfaceWhereOp, THREAD_SCHEMA_VERSION, type TableCard, type TableColumn, type ThreadMeta, type ThreadStore, type TimelineCard, type TokenBudget, type TokenCounter, type ToolApproval, type ToolCallOutcome, type ToolCallRequest, ToolCallStatus, type ToolDefinition, type ToolExecutionContext, ToolFailureKind, type ToolLoading, type ToolLoadingHint, ToolRegistry, type ToolResolution, type ToolResult, type ToolResultExtras, type ToolSide, ToolSpec, type TraceEntry, type Transcript, type TranscriptionRequest, Transport, TransportRequest, type TreeCard, type TreeNode, type TurnLayoutOptions, type TurnSegment, type UnsafeFinding, Usage, type VideoGenerationRequest, type VisualizePlacement, type VisualizeToolOptions, afterTool, appendReasoning, appendText, applyEdits, applySurfaceOperations, approvalCard, assistantMessage, authorizeSurfaceTool, backoffDelay, base64ToBytes, bindingProblems, buildEml, buildMailto, buildSummaryPrompt, buildSurface, buildUrl, bytesToBase64, calloutCard, chartCard, check, checkQuoteDrift, checkSchema, checklistCard, childrenOf, choiceCard, citationsCard, codeCard, combineMeteringSources, compactError, compactHistory, comparisonCard, confirmCard, consecutiveFailures, countMessageTokens, countMessagesTokens, createAppActionTools, createAppStateSource, createBudget, createBuiltinTools, createDirectTransport, createDirectTransportForProfile, createDocumentTools, createEmailDraftTool, createGenerateImageTool, createHttpTransport, createKeywordRetriever, createLoadSkillTool, createLocalDocumentStore, createLocalFileStore, createLocalMemoryStore, createLocalThreadStore, createMcpSkill, createMemoryDocumentStore, createMemoryFileStore, createMemoryMemoryStore, createMemorySource, createMemoryThreadStore, createOpenAICompatibleProfile, createOpenAIImageProvider, createProviderFromProfile, createProxyTransport, createRememberTool, createRestThreadStore, createRetrievalSource, createSurfaceContextSource, createSurfaceSkill, createSurfaceTools, createUpdateCardTool, createVisualizeTool, deliverMetering, diffCard, documentCard, editReviewCard, elicitViaCard, emailCard, emlFilename, errorFromResponse, estimateJsonTokens, estimateTokens, evaluateSurfaceCondition, executeToolCall, executeToolCalls, file, findUnsafe, foldSurfaces, formCard, formatQuotes, formatTemplate, funnelCard, gaugeCard, generatedMediaUrl, getAt, hasTurnOrder, humanizeFieldName, hunksOf, image, importMcpTools, initialRunState, isAgentError, isCardCarrier, isCardPlacement, isScriptUrl, isSurfaceBinding, isSurfaceId, isSurfaceSpec, isTextPart, isToolCallPart, isToolResultPart, keyValueCard, kindFromStatus, lastUserText, latestLeaf, layoutTurn, linkLinear, makeCard, mapMcpResult, markdownCard, matchSkills, mediaCard, message, messageText, nextId, noToolCalls, normalizeProviderProfile, normalizeToolName, outlineOf, packByPriority, parseCardRef, parsePartialJson, parsePointer, parseRetryAfter, parseSSE, parseSSEJson, pathTo, previewSurface, progressCard, quoteDrift, quotesOf, reduceRunEvent, removeAt, renderSkill, repairToolArguments, resolvePartialCard, resolveSurfaceAction, resolveSurfaceValue, resolveToolLoading, runAgent, runSurfaceQuery, runSurfaceToolAction, safeCutIndex, safeSurfaceUrl, sanitizeSurfaceSpec, scoreSkill, searchBlocks, setAt, shouldStop, siblingsOf, spanOf, splitBlocks, statsCard, stepCountIs, stripCardPayload, stripUiOnlyParts, surfaceActionTools, surfaceCardId, tableCard, text, threadSnapshot, timelineCard, toA2uiMessages, toAgentError, tokenBudgetExceeded, tokenize, toolCall, toolCallsIn, toolResult, totalAllocated, treeCard, trimHistory, usageSource, userDeclined, userMessage, usesBinding, validateSurfaceAction, validateSurfaceComponent, validateSurfaceComponents, validateSurfaceGraph, withCard, withQuotes, withRetry };