@dudousxd/nestjs-agent-react 0.24.0 → 0.26.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
@@ -1,13 +1,13 @@
1
1
  import * as ai from 'ai';
2
2
  import { ChatTransport, UIMessage, UIMessageChunk, DataUIPart, UIDataTypes } from 'ai';
3
- import { A as AgentBackend, U as UploadAttachmentOptions, a as AttachmentUploadStrategy } from './client-ioKDyV2q.cjs';
4
- export { b as AgentBackendUnsupportedError, c as AgentClient, d as AgentClientOptions, e as AgentConnection, f as AgentHttpError, C as CancelResult, g as ChatStreamRequest, h as ChatStreamResponse, M as MessageFeedbackInput, R as ResumeStreamRequest, T as ThreadPatch, r as requireBackendMethod } from './client-ioKDyV2q.cjs';
5
- import { MessageAttachment, AgentClientConfig, AgentCatalogEntry, ModelCatalogEntry, ModelCatalogView, QuotaReport, QuotaWindow, QuotaBlock, MessageFeedback, MessageFeedbackValue, ThreadSummary, StoredMessage, ToolCatalogEntry } from '@dudousxd/nestjs-agent-core';
6
- export { ElicitationInput, ElicitationInputType, validateElicitationAnswer as validateAnswer, validateElicitationValue as validateAnswerValue } from '@dudousxd/nestjs-agent-core';
3
+ import { A as AgentBackend, U as UploadAttachmentOptions, H as HttpErrorListener, a as AttachmentUploadStrategy } from './client-D4ZSbZJ8.cjs';
4
+ export { b as AgentBackendUnsupportedError, c as AgentClient, d as AgentClientOptions, e as AgentConnection, f as AgentHttpError, g as AgentRequestError, C as CancelResult, h as ChatStreamRequest, i as ChatStreamResponse, M as MessageFeedbackInput, R as ResumeStreamRequest, T as ThreadPatch, r as requireBackendMethod } from './client-D4ZSbZJ8.cjs';
5
+ import { MessageAttachment, AgentClientConfig, AgentCatalogEntry, ModelCatalogEntry, ModelCatalogView, ModelCatalogLock, QuotaReport, QuotaWindow, QuotaBlock, QuotaWarning, MessageFeedback, MessageFeedbackValue, ThreadSummary, StoredMessage, ToolCatalogEntry } from '@dudousxd/nestjs-agent-core';
6
+ export { ALL_AGENTS, ElicitationInput, ElicitationInputType, validateElicitationAnswer as validateAnswer, validateElicitationValue as validateAnswerValue } from '@dudousxd/nestjs-agent-core';
7
7
  import * as React from 'react';
8
8
  import React__default, { ReactNode, Context } from 'react';
9
- import { o as GenuiProviderValue, T as TranscriptUiBlock, A as ApproveOptions, t as TranscriptBlock, U as UsageSummary, v as TimestampInfo, C as ChatStatus, M as MessageUsageInfo, w as ToolCatalog, x as AnyToolUIPart, y as TranscriptFile } from './generative-ui-9AJNVKBZ.cjs';
10
- export { z as ApprovalBlockOptions, B as BuildBlocksOptions, D as CoercibleQuestion, E as DescribeToolCallOptions, F as ElicitationBlockOptions, H as GroupToolActivityOptions, I as RawAnswer, J as ResolvedReading, K as ResolvedResultView, L as RetrievedPassage, S as SettleAction, N as ToolActivityGroup, O as ToolCallDescription, P as ToolCallState, Q as ToolCallStatus, V as TranscriptApproval, W as TranscriptApprovalStatus, X as TranscriptElicitationBlock, Y as TranscriptElicitationOutcome, Z as TranscriptFilesBlock, _ as TranscriptQuestion, $ as TranscriptQuestionOption, a0 as TranscriptReasoningBlock, a1 as TranscriptSettleState, a2 as TranscriptSource, a3 as TranscriptSourcesBlock, a4 as TranscriptTextBlock, a5 as TranscriptToolBlock, a6 as TranscriptToolCall, a7 as buildTranscriptBlocks, a8 as coerceAnswer, a9 as correctedCallIds, aa as describeTimestamp, ab as describeToolCall, ac as describeUsage, ad as extractMessageText, ae as fillTemplate, af as formatRelativeTime, ag as groupToolActivity, ah as inferResultView, ai as isActionCall, aj as phraseFor, ak as readPath, al as resolveResultView, am as toolCallState, an as toolCatalogFrom } from './generative-ui-9AJNVKBZ.cjs';
9
+ import { o as GenuiProviderValue, T as TranscriptUiBlock, A as ApproveOptions, t as TranscriptBlock, U as UsageSummary, v as TimestampInfo, C as ChatStatus, M as MessageUsageInfo, w as ToolCatalog, x as AnyToolUIPart, y as TranscriptFile } from './generative-ui-BejHxxbR.cjs';
10
+ export { z as ApprovalBlockOptions, B as BuildBlocksOptions, D as CoercibleQuestion, E as DescribeToolCallOptions, F as ElicitationBlockOptions, H as GroupToolActivityOptions, I as RawAnswer, J as ResolvedReading, K as ResolvedResultView, L as RetrievedPassage, S as SettleAction, N as ToolActivityGroup, O as ToolCallDescription, P as ToolCallState, Q as ToolCallStatus, V as TranscriptApproval, W as TranscriptApprovalStatus, X as TranscriptElicitationBlock, Y as TranscriptElicitationOutcome, Z as TranscriptFilesBlock, _ as TranscriptQuestion, $ as TranscriptQuestionOption, a0 as TranscriptReasoningBlock, a1 as TranscriptSettleState, a2 as TranscriptSource, a3 as TranscriptSourcesBlock, a4 as TranscriptTextBlock, a5 as TranscriptToolBlock, a6 as TranscriptToolCall, a7 as buildTranscriptBlocks, a8 as coerceAnswer, a9 as correctedCallIds, aa as describeTimestamp, ab as describeToolCall, ac as describeUsage, ad as extractMessageText, ae as fillTemplate, af as formatRelativeTime, ag as groupToolActivity, ah as inferResultView, ai as isActionCall, aj as phraseFor, ak as readPath, al as resolveResultView, am as toolCallState, an as toolCatalogFrom } from './generative-ui-BejHxxbR.cjs';
11
11
 
12
12
  /** Identity surfaced by the backend's `meta` SSE frame / response headers. */
13
13
  interface AgentStreamMeta {
@@ -329,6 +329,12 @@ interface AgentProviderProps {
329
329
  credentials?: RequestCredentials;
330
330
  /** Injectable for tests / non-browser runtimes. */
331
331
  fetch?: typeof fetch;
332
+ /**
333
+ * Every error answer of the built-in client (an `AgentHttpError`, or a `MediaUploadError` from
334
+ * `mediaAttachments()`), right before it is thrown — for app-wide reactions such as "401 → sign
335
+ * in again". Read at call time, so it may change between renders.
336
+ */
337
+ onHttpError?: HttpErrorListener;
332
338
  /** Attachment uploads of the built-in client. */
333
339
  attachments?: {
334
340
  /** e.g. `mediaAttachments()` from `@dudousxd/nestjs-agent-react/media`. */
@@ -354,7 +360,7 @@ interface AgentProviderProps {
354
360
  *
355
361
  * Without a provider every hook shares one same-origin client on `/agent`.
356
362
  */
357
- declare function AgentProvider({ backend, baseUrl, path, headers, getHeaders, credentials, fetch, attachments, genui, children, }: AgentProviderProps): React.JSX.Element;
363
+ declare function AgentProvider({ backend, baseUrl, path, headers, getHeaders, credentials, fetch, onHttpError, attachments, genui, children, }: AgentProviderProps): React.JSX.Element;
358
364
  /**
359
365
  * The backend a hook talks to: `own` when given, else the enclosing {@link AgentProvider}'s, else a
360
366
  * shared same-origin client on `/agent`. For your own hooks over the same connection.
@@ -421,6 +427,11 @@ interface ModelsState {
421
427
  models: ModelOption[];
422
428
  /** The model a turn runs on when none is picked, or `null` when the provider decides. */
423
429
  defaultModel: string | null;
430
+ /**
431
+ * The agent always runs on one model (`{ model, reason? }`), or `null`. A picker shows it
432
+ * read-only: the server runs every turn on it and refuses any other.
433
+ */
434
+ locked: ModelCatalogLock | null;
424
435
  /** The entry for `id`, or `undefined`. */
425
436
  find: (id: string | null | undefined) => ModelOption | undefined;
426
437
  isLoading: boolean;
@@ -430,8 +441,8 @@ interface ModelsState {
430
441
  /**
431
442
  * The models this caller may pick (`GET <base>/models?agent=`), with badges and availability — the
432
443
  * data behind a model picker. Headless: render the options however you like, then send the pick
433
- * as `useAgentChat({ model })`, `sendMessage(msg, { body: { model } })`, or pin it on the thread
434
- * with `chat.setThreadModel(id)`.
444
+ * as `useAgentChat({ model })` or `sendMessage(msg, { body: { model } })` (that turn only), or
445
+ * pin it on the thread with `chat.models.pinToThread(id)`.
435
446
  */
436
447
  declare function useModels(options?: UseModelsOptions): ModelsState;
437
448
 
@@ -452,6 +463,11 @@ interface QuotaState {
452
463
  month: QuotaWindow | undefined;
453
464
  /** The window that blocks sends, or `null` — pass it to `useAgentChat({ blocked })`. */
454
465
  blocked: QuotaBlock | null;
466
+ /**
467
+ * The soft limit: the fullest window past its `warnAt` (`{ period, ratio, reason? }`), or `null`.
468
+ * The server's `warning`, else derived from the windows; never set while `blocked`.
469
+ */
470
+ warning: QuotaWarning | null;
455
471
  isLoading: boolean;
456
472
  error: Error | null;
457
473
  refresh: () => Promise<void>;
@@ -723,10 +739,14 @@ interface MessageActionInput {
723
739
  interface AnswerInput {
724
740
  toolCallId: string;
725
741
  answers?: Record<string, string[]>;
742
+ /** The surface the answer came through; the server records `'web'` when omitted. */
743
+ via?: string;
726
744
  }
727
745
  /** Declining a parked question set. */
728
746
  interface SkipInput {
729
747
  toolCallId: string;
748
+ /** The surface the skip came through; the server records `'web'` when omitted. */
749
+ via?: string;
730
750
  }
731
751
  /** Approving a tool call parked on a human. */
732
752
  interface ApproveInput extends ApproveOptions {
@@ -741,6 +761,16 @@ interface RejectInput {
741
761
  via?: string;
742
762
  }
743
763
  interface TranscriptItemOptions {
764
+ /**
765
+ * A transcript nobody acts on (an audit view, a shared or archived conversation): no approve /
766
+ * reject, answer / skip, edit, fork, regenerate or stop — whatever handlers or backend are in
767
+ * scope. Parked approvals and question sets still render, with their actions unavailable.
768
+ *
769
+ * Without it the decision handlers DEFAULT to the in-scope backend (`<AgentProvider>`'s), so a
770
+ * parked call is actionable with no wiring; a read-only surface would otherwise have to pass
771
+ * `onApprove: null`, `onReject: null`, `onAnswer: null` and `onSkip: null` one by one.
772
+ */
773
+ readOnly?: boolean;
744
774
  /** User messages get an inline edit-and-resubmit machine. */
745
775
  editable?: boolean;
746
776
  onEditSubmit?: (input: EditSubmitInput) => void | Promise<void>;
@@ -967,6 +997,11 @@ interface MessageListProps {
967
997
  reasoningLabel?: React__default.ReactNode;
968
998
  /** Extra content for one message's action row — e.g. a badge naming which agent answered. */
969
999
  getMeta?: (message: UIMessage) => React__default.ReactNode;
1000
+ /**
1001
+ * Nobody acts on this list (an audit or shared view): parked approvals and question sets render
1002
+ * without their actions, and no fork / edit / regenerate — see `useChatTranscript({ readOnly })`.
1003
+ */
1004
+ readOnly?: boolean;
970
1005
  /** When set, every message gets a "Fork" affordance calling back with its id. */
971
1006
  onFork?: (input: MessageActionInput) => void | Promise<void>;
972
1007
  /** User messages get an inline edit-and-resubmit affordance. */
@@ -999,7 +1034,7 @@ interface MessageListProps {
999
1034
  * Every decision here comes from `useChatTranscript`; the file below it is markup. A host that
1000
1035
  * wants a different layout drives that hook directly and never imports this component.
1001
1036
  */
1002
- declare function MessageList({ messages, status, renderToolPart, renderToolGroup, renderText, renderReasoning, renderFiles, renderUi, reasoningLabel, getMeta, onFork, editable, onEditSubmit, regeneratable, onRegenerate, getUsage, getCreatedAt, emptyState, typingIndicator, followUps, onFollowUpClick, error, onRetry, classNames, }: MessageListProps): React__default.JSX.Element;
1037
+ declare function MessageList({ messages, status, renderToolPart, renderToolGroup, renderText, renderReasoning, renderFiles, renderUi, reasoningLabel, getMeta, readOnly, onFork, editable, onEditSubmit, regeneratable, onRegenerate, getUsage, getCreatedAt, emptyState, typingIndicator, followUps, onFollowUpClick, error, onRetry, classNames, }: MessageListProps): React__default.JSX.Element;
1003
1038
 
1004
1039
  /**
1005
1040
  * Languages the dictation mic offers. The Web Speech API expects a
@@ -1236,7 +1271,11 @@ interface UseToolCatalogOptions {
1236
1271
  * (the shared copy is keyed by it): a backend constructed inline refetches every render.
1237
1272
  */
1238
1273
  backend?: ToolsBackend;
1239
- /** The agent whose tools to list. Omitted → the server's default agent. */
1274
+ /**
1275
+ * The agent whose tools to list. Omitted → the server's default agent. {@link ALL_AGENTS} (`'*'`)
1276
+ * → every tool the actor reaches through any agent, each once — for an app with several agents
1277
+ * whose conversations one surface shows.
1278
+ */
1240
1279
  agent?: string;
1241
1280
  /** `false` holds the request (e.g. until the user is signed in). Default `true`. */
1242
1281
  enabled?: boolean;
@@ -1425,7 +1464,9 @@ interface UseAgentChatOptions<B extends AgentBackend = AgentBackend> {
1425
1464
  /**
1426
1465
  * The model every turn runs on, controlled by you. Omitted → `chat.models.selected` (what
1427
1466
  * `chat.models.select(id)` picked), else the thread's pinned model, else the server default. A
1428
- * single send can still override it with `sendMessage(msg, { body: { model } })`.
1467
+ * single send can still override it with `sendMessage(msg, { body: { model } })`. Sent as the
1468
+ * turn's `model`, which the server applies to that turn only — pinning a model on the thread is
1469
+ * `chat.models.pinToThread(id)`.
1429
1470
  */
1430
1471
  model?: string;
1431
1472
  /**
@@ -1499,21 +1540,41 @@ interface ChatBackground {
1499
1540
  /** Re-read the thread now, instead of waiting for the next poll. */
1500
1541
  refresh: () => Promise<void>;
1501
1542
  }
1502
- /** The chat's model picker state. Loaded the first time `list`/`providers` is read. */
1543
+ /**
1544
+ * The chat's model picker state. Loaded the first time `list`/`providers`/`defaultModel`/`locked`
1545
+ * is read.
1546
+ *
1547
+ * Two different choices: `select(id)` picks the model this chat's following sends name — each send
1548
+ * carries it as `model`, which the server applies to that turn only and never stores; the pick is
1549
+ * this conversation's, so switching threads drops it. `pinToThread(id)` stores a model on the
1550
+ * thread (`PATCH threads/:id { model }`), which every later turn without a `model` of its own runs
1551
+ * on, across reloads and devices.
1552
+ */
1503
1553
  interface ChatModels {
1504
1554
  /** Every model the caller may pick, flattened (`[]` until loaded). */
1505
1555
  readonly list: ModelOption[];
1506
1556
  /** The same, grouped by provider. */
1507
1557
  readonly providers: ModelsState['providers'];
1508
- /** What the next turn runs on: the `model` option, the pick, the thread's pin, else the default. */
1558
+ /**
1559
+ * What the next turn runs on: the lock, the `model` option, the pick, the thread's pin, else the
1560
+ * default.
1561
+ */
1509
1562
  selected: string | null;
1563
+ /** The model pinned on the thread (`null` when none, or before the thread is read). */
1564
+ pinned: string | null;
1510
1565
  /** The catalog's default — what a turn runs on when nothing is picked or pinned (`null` until loaded). */
1511
1566
  readonly defaultModel: string | null;
1512
- /** Run the following turns on `id` (sent as the body's `model`). */
1567
+ /**
1568
+ * The agent always runs on one model (`{ model, reason? }`), or `null`. While locked, `select`
1569
+ * does nothing and `selected` is the locked model.
1570
+ */
1571
+ readonly locked: ModelsState['locked'];
1572
+ /** Run this chat's following sends on `id` — each send's `model`, that turn only. */
1513
1573
  select: (id: string) => void;
1514
1574
  /**
1515
1575
  * Pin `id` on the thread (`null` unpins) — every later turn without its own `model` runs on it,
1516
- * across reloads. On a chat with no thread yet, the pin lands when the first send creates one.
1576
+ * across reloads. Replaces the pick, so the next send runs on the pin. On a chat with no thread
1577
+ * yet, the pin lands when the first send creates one.
1517
1578
  */
1518
1579
  pinToThread: (id: string | null) => Promise<void>;
1519
1580
  isLoading: boolean;
@@ -1598,8 +1659,8 @@ declare function useAgentChat<B extends AgentBackend = AgentBackend>(options?: U
1598
1659
  cancel: () => Promise<void>;
1599
1660
  approve: ({ toolCallId, remember, via }: ApproveInput) => Promise<void>;
1600
1661
  reject: ({ toolCallId, reason, via }: RejectInput) => Promise<void>;
1601
- answer: ({ toolCallId, answers }: AnswerInput) => Promise<void>;
1602
- skip: ({ toolCallId }: SkipInput) => Promise<void>;
1662
+ answer: ({ toolCallId, answers, via }: AnswerInput) => Promise<void>;
1663
+ skip: ({ toolCallId, via }: SkipInput) => Promise<void>;
1603
1664
  regenerate: (_input?: Partial<MessageActionInput>) => void;
1604
1665
  fork: ({ messageId, threadId, }: MessageActionInput & {
1605
1666
  threadId?: string;
@@ -1626,4 +1687,4 @@ declare class QuotaBlockedError extends Error {
1626
1687
  constructor(block: QuotaBlock);
1627
1688
  }
1628
1689
 
1629
- export { AgentBackend, AgentChatTransport, type AgentChatTransportOptions, type AgentConfigState, type AgentMessageMetadata, AgentProvider, type AgentProviderProps, type AgentStreamMeta, type AgentsState, type AggregatedTurnUsage, type AmbientRenderUi, AmbientRenderUiContext, type AnswerInput, AnyToolUIPart, type ApprovalCountdown, type ApproveInput, ApproveOptions, type AttachmentRejection, AttachmentUploadStrategy, type AttachmentsState, type AutocompleteInputProps, type AutocompleteItem, type AutocompleteListboxProps, type AutocompleteOptionProps, type AutocompleteSource, type BackgroundRun, type ChatBackground, ChatInput, type ChatInputProps, ChatStatus, type ChatTranscript, type ClipboardLikeEvent, type CompletionEdit, type ComposerAutocomplete, DEFAULT_SPEECH_LANG, type DragLikeEvent, type EditSubmitInput, type MessageActionInput, type MessageFeedbackState, type MessageFile, type MessageFileKind, MessageItem, type MessageItemClassNames, type MessageItemProps, MessageItemView, type MessageItemViewProps, MessageList, type MessageListClassNames, type MessageListProps, MessageUsageInfo, type ModelOption, type ModelsState, QuotaBlockedError, type QuotaState, type ReconnectOptions, type RejectInput, type RenderFilesFn, type RenderReasoningFn, type RenderTextFn, type RenderToolGroupFn, type RenderToolPartFn, type RenderUiFn, SPEECH_LANGUAGES, type SkillSuggestionData, type SkillsSourceOptions, type SkipInput, type SpeechLanguage, type SpeechRecognitionHook, type StagedAttachment, type StagedAttachmentStatus, type StickToBottom, type StickToBottomOptions, type StoredTurnMetadata, type StreamConnectionState, type ThreadsEvent, type ThreadsState, TimestampInfo, ToolCatalog, type ToolCatalogState, type TranscriptActionState, TranscriptBlock, type TranscriptCopyState, type TranscriptEditState, TranscriptFile, type TranscriptItem, type TranscriptItemOptions, type TranscriptStopState, TranscriptUiBlock, type TranscriptWindow, type TriggerMatch, type TriggerPosition, UploadAttachmentOptions, UsageSummary, type UseAgentChatOptions, type UseAgentConfigOptions, type UseAgentsOptions, type UseApprovalCountdownOptions, type UseAttachmentsOptions, type UseChatTranscriptOptions, type UseComposerAutocompleteOptions, type UseElapsedOptions, type UseMessageFeedbackOptions, type UseModelsOptions, type UseQuotaOptions, type UseSpeechRecognitionOptions, type UseThreadsOptions, type UseToolCatalogOptions, type UseTranscriptItemOptions, acceptsFile, applyCompletion, approvalCountdown, backgroundRunsFromThread, createSkillsSource, dragHasFiles, fileKind, filesFromClipboard, filterAutocompleteItems, findActiveTrigger, formatElapsed, loadStoredSpeechLang, messageFiles, notifyThreads, onThreadsEvent, persistSpeechLang, readReasoningMs, storedMessageToUiMessage, storedThreadToUiMessages, useAgentBackend, useAgentChat, useAgentConfig, useAgents, useAmbientRenderUi, useApprovalCountdown, useAttachments, useChatTranscript, useComposerAutocomplete, useElapsed, useMessageFeedback, useModels, useQuota, useSpeechRecognition, useStickToBottom, useThreads, useToolCatalog, useTranscriptItem };
1690
+ export { AgentBackend, AgentChatTransport, type AgentChatTransportOptions, type AgentConfigState, type AgentMessageMetadata, AgentProvider, type AgentProviderProps, type AgentStreamMeta, type AgentsState, type AggregatedTurnUsage, type AmbientRenderUi, AmbientRenderUiContext, type AnswerInput, AnyToolUIPart, type ApprovalCountdown, type ApproveInput, ApproveOptions, type AttachmentRejection, AttachmentUploadStrategy, type AttachmentsState, type AutocompleteInputProps, type AutocompleteItem, type AutocompleteListboxProps, type AutocompleteOptionProps, type AutocompleteSource, type BackgroundRun, type ChatBackground, ChatInput, type ChatInputProps, ChatStatus, type ChatTranscript, type ClipboardLikeEvent, type CompletionEdit, type ComposerAutocomplete, DEFAULT_SPEECH_LANG, type DragLikeEvent, type EditSubmitInput, HttpErrorListener, type MessageActionInput, type MessageFeedbackState, type MessageFile, type MessageFileKind, MessageItem, type MessageItemClassNames, type MessageItemProps, MessageItemView, type MessageItemViewProps, MessageList, type MessageListClassNames, type MessageListProps, MessageUsageInfo, type ModelOption, type ModelsState, QuotaBlockedError, type QuotaState, type ReconnectOptions, type RejectInput, type RenderFilesFn, type RenderReasoningFn, type RenderTextFn, type RenderToolGroupFn, type RenderToolPartFn, type RenderUiFn, SPEECH_LANGUAGES, type SkillSuggestionData, type SkillsSourceOptions, type SkipInput, type SpeechLanguage, type SpeechRecognitionHook, type StagedAttachment, type StagedAttachmentStatus, type StickToBottom, type StickToBottomOptions, type StoredTurnMetadata, type StreamConnectionState, type ThreadsEvent, type ThreadsState, TimestampInfo, ToolCatalog, type ToolCatalogState, type TranscriptActionState, TranscriptBlock, type TranscriptCopyState, type TranscriptEditState, TranscriptFile, type TranscriptItem, type TranscriptItemOptions, type TranscriptStopState, TranscriptUiBlock, type TranscriptWindow, type TriggerMatch, type TriggerPosition, UploadAttachmentOptions, UsageSummary, type UseAgentChatOptions, type UseAgentConfigOptions, type UseAgentsOptions, type UseApprovalCountdownOptions, type UseAttachmentsOptions, type UseChatTranscriptOptions, type UseComposerAutocompleteOptions, type UseElapsedOptions, type UseMessageFeedbackOptions, type UseModelsOptions, type UseQuotaOptions, type UseSpeechRecognitionOptions, type UseThreadsOptions, type UseToolCatalogOptions, type UseTranscriptItemOptions, acceptsFile, applyCompletion, approvalCountdown, backgroundRunsFromThread, createSkillsSource, dragHasFiles, fileKind, filesFromClipboard, filterAutocompleteItems, findActiveTrigger, formatElapsed, loadStoredSpeechLang, messageFiles, notifyThreads, onThreadsEvent, persistSpeechLang, readReasoningMs, storedMessageToUiMessage, storedThreadToUiMessages, useAgentBackend, useAgentChat, useAgentConfig, useAgents, useAmbientRenderUi, useApprovalCountdown, useAttachments, useChatTranscript, useComposerAutocomplete, useElapsed, useMessageFeedback, useModels, useQuota, useSpeechRecognition, useStickToBottom, useThreads, useToolCatalog, useTranscriptItem };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import * as ai from 'ai';
2
2
  import { ChatTransport, UIMessage, UIMessageChunk, DataUIPart, UIDataTypes } from 'ai';
3
- import { A as AgentBackend, U as UploadAttachmentOptions, a as AttachmentUploadStrategy } from './client-ioKDyV2q.js';
4
- export { b as AgentBackendUnsupportedError, c as AgentClient, d as AgentClientOptions, e as AgentConnection, f as AgentHttpError, C as CancelResult, g as ChatStreamRequest, h as ChatStreamResponse, M as MessageFeedbackInput, R as ResumeStreamRequest, T as ThreadPatch, r as requireBackendMethod } from './client-ioKDyV2q.js';
5
- import { MessageAttachment, AgentClientConfig, AgentCatalogEntry, ModelCatalogEntry, ModelCatalogView, QuotaReport, QuotaWindow, QuotaBlock, MessageFeedback, MessageFeedbackValue, ThreadSummary, StoredMessage, ToolCatalogEntry } from '@dudousxd/nestjs-agent-core';
6
- export { ElicitationInput, ElicitationInputType, validateElicitationAnswer as validateAnswer, validateElicitationValue as validateAnswerValue } from '@dudousxd/nestjs-agent-core';
3
+ import { A as AgentBackend, U as UploadAttachmentOptions, H as HttpErrorListener, a as AttachmentUploadStrategy } from './client-D4ZSbZJ8.js';
4
+ export { b as AgentBackendUnsupportedError, c as AgentClient, d as AgentClientOptions, e as AgentConnection, f as AgentHttpError, g as AgentRequestError, C as CancelResult, h as ChatStreamRequest, i as ChatStreamResponse, M as MessageFeedbackInput, R as ResumeStreamRequest, T as ThreadPatch, r as requireBackendMethod } from './client-D4ZSbZJ8.js';
5
+ import { MessageAttachment, AgentClientConfig, AgentCatalogEntry, ModelCatalogEntry, ModelCatalogView, ModelCatalogLock, QuotaReport, QuotaWindow, QuotaBlock, QuotaWarning, MessageFeedback, MessageFeedbackValue, ThreadSummary, StoredMessage, ToolCatalogEntry } from '@dudousxd/nestjs-agent-core';
6
+ export { ALL_AGENTS, ElicitationInput, ElicitationInputType, validateElicitationAnswer as validateAnswer, validateElicitationValue as validateAnswerValue } from '@dudousxd/nestjs-agent-core';
7
7
  import * as React from 'react';
8
8
  import React__default, { ReactNode, Context } from 'react';
9
- import { o as GenuiProviderValue, T as TranscriptUiBlock, A as ApproveOptions, t as TranscriptBlock, U as UsageSummary, v as TimestampInfo, C as ChatStatus, M as MessageUsageInfo, w as ToolCatalog, x as AnyToolUIPart, y as TranscriptFile } from './generative-ui-9AJNVKBZ.js';
10
- export { z as ApprovalBlockOptions, B as BuildBlocksOptions, D as CoercibleQuestion, E as DescribeToolCallOptions, F as ElicitationBlockOptions, H as GroupToolActivityOptions, I as RawAnswer, J as ResolvedReading, K as ResolvedResultView, L as RetrievedPassage, S as SettleAction, N as ToolActivityGroup, O as ToolCallDescription, P as ToolCallState, Q as ToolCallStatus, V as TranscriptApproval, W as TranscriptApprovalStatus, X as TranscriptElicitationBlock, Y as TranscriptElicitationOutcome, Z as TranscriptFilesBlock, _ as TranscriptQuestion, $ as TranscriptQuestionOption, a0 as TranscriptReasoningBlock, a1 as TranscriptSettleState, a2 as TranscriptSource, a3 as TranscriptSourcesBlock, a4 as TranscriptTextBlock, a5 as TranscriptToolBlock, a6 as TranscriptToolCall, a7 as buildTranscriptBlocks, a8 as coerceAnswer, a9 as correctedCallIds, aa as describeTimestamp, ab as describeToolCall, ac as describeUsage, ad as extractMessageText, ae as fillTemplate, af as formatRelativeTime, ag as groupToolActivity, ah as inferResultView, ai as isActionCall, aj as phraseFor, ak as readPath, al as resolveResultView, am as toolCallState, an as toolCatalogFrom } from './generative-ui-9AJNVKBZ.js';
9
+ import { o as GenuiProviderValue, T as TranscriptUiBlock, A as ApproveOptions, t as TranscriptBlock, U as UsageSummary, v as TimestampInfo, C as ChatStatus, M as MessageUsageInfo, w as ToolCatalog, x as AnyToolUIPart, y as TranscriptFile } from './generative-ui-BejHxxbR.js';
10
+ export { z as ApprovalBlockOptions, B as BuildBlocksOptions, D as CoercibleQuestion, E as DescribeToolCallOptions, F as ElicitationBlockOptions, H as GroupToolActivityOptions, I as RawAnswer, J as ResolvedReading, K as ResolvedResultView, L as RetrievedPassage, S as SettleAction, N as ToolActivityGroup, O as ToolCallDescription, P as ToolCallState, Q as ToolCallStatus, V as TranscriptApproval, W as TranscriptApprovalStatus, X as TranscriptElicitationBlock, Y as TranscriptElicitationOutcome, Z as TranscriptFilesBlock, _ as TranscriptQuestion, $ as TranscriptQuestionOption, a0 as TranscriptReasoningBlock, a1 as TranscriptSettleState, a2 as TranscriptSource, a3 as TranscriptSourcesBlock, a4 as TranscriptTextBlock, a5 as TranscriptToolBlock, a6 as TranscriptToolCall, a7 as buildTranscriptBlocks, a8 as coerceAnswer, a9 as correctedCallIds, aa as describeTimestamp, ab as describeToolCall, ac as describeUsage, ad as extractMessageText, ae as fillTemplate, af as formatRelativeTime, ag as groupToolActivity, ah as inferResultView, ai as isActionCall, aj as phraseFor, ak as readPath, al as resolveResultView, am as toolCallState, an as toolCatalogFrom } from './generative-ui-BejHxxbR.js';
11
11
 
12
12
  /** Identity surfaced by the backend's `meta` SSE frame / response headers. */
13
13
  interface AgentStreamMeta {
@@ -329,6 +329,12 @@ interface AgentProviderProps {
329
329
  credentials?: RequestCredentials;
330
330
  /** Injectable for tests / non-browser runtimes. */
331
331
  fetch?: typeof fetch;
332
+ /**
333
+ * Every error answer of the built-in client (an `AgentHttpError`, or a `MediaUploadError` from
334
+ * `mediaAttachments()`), right before it is thrown — for app-wide reactions such as "401 → sign
335
+ * in again". Read at call time, so it may change between renders.
336
+ */
337
+ onHttpError?: HttpErrorListener;
332
338
  /** Attachment uploads of the built-in client. */
333
339
  attachments?: {
334
340
  /** e.g. `mediaAttachments()` from `@dudousxd/nestjs-agent-react/media`. */
@@ -354,7 +360,7 @@ interface AgentProviderProps {
354
360
  *
355
361
  * Without a provider every hook shares one same-origin client on `/agent`.
356
362
  */
357
- declare function AgentProvider({ backend, baseUrl, path, headers, getHeaders, credentials, fetch, attachments, genui, children, }: AgentProviderProps): React.JSX.Element;
363
+ declare function AgentProvider({ backend, baseUrl, path, headers, getHeaders, credentials, fetch, onHttpError, attachments, genui, children, }: AgentProviderProps): React.JSX.Element;
358
364
  /**
359
365
  * The backend a hook talks to: `own` when given, else the enclosing {@link AgentProvider}'s, else a
360
366
  * shared same-origin client on `/agent`. For your own hooks over the same connection.
@@ -421,6 +427,11 @@ interface ModelsState {
421
427
  models: ModelOption[];
422
428
  /** The model a turn runs on when none is picked, or `null` when the provider decides. */
423
429
  defaultModel: string | null;
430
+ /**
431
+ * The agent always runs on one model (`{ model, reason? }`), or `null`. A picker shows it
432
+ * read-only: the server runs every turn on it and refuses any other.
433
+ */
434
+ locked: ModelCatalogLock | null;
424
435
  /** The entry for `id`, or `undefined`. */
425
436
  find: (id: string | null | undefined) => ModelOption | undefined;
426
437
  isLoading: boolean;
@@ -430,8 +441,8 @@ interface ModelsState {
430
441
  /**
431
442
  * The models this caller may pick (`GET <base>/models?agent=`), with badges and availability — the
432
443
  * data behind a model picker. Headless: render the options however you like, then send the pick
433
- * as `useAgentChat({ model })`, `sendMessage(msg, { body: { model } })`, or pin it on the thread
434
- * with `chat.setThreadModel(id)`.
444
+ * as `useAgentChat({ model })` or `sendMessage(msg, { body: { model } })` (that turn only), or
445
+ * pin it on the thread with `chat.models.pinToThread(id)`.
435
446
  */
436
447
  declare function useModels(options?: UseModelsOptions): ModelsState;
437
448
 
@@ -452,6 +463,11 @@ interface QuotaState {
452
463
  month: QuotaWindow | undefined;
453
464
  /** The window that blocks sends, or `null` — pass it to `useAgentChat({ blocked })`. */
454
465
  blocked: QuotaBlock | null;
466
+ /**
467
+ * The soft limit: the fullest window past its `warnAt` (`{ period, ratio, reason? }`), or `null`.
468
+ * The server's `warning`, else derived from the windows; never set while `blocked`.
469
+ */
470
+ warning: QuotaWarning | null;
455
471
  isLoading: boolean;
456
472
  error: Error | null;
457
473
  refresh: () => Promise<void>;
@@ -723,10 +739,14 @@ interface MessageActionInput {
723
739
  interface AnswerInput {
724
740
  toolCallId: string;
725
741
  answers?: Record<string, string[]>;
742
+ /** The surface the answer came through; the server records `'web'` when omitted. */
743
+ via?: string;
726
744
  }
727
745
  /** Declining a parked question set. */
728
746
  interface SkipInput {
729
747
  toolCallId: string;
748
+ /** The surface the skip came through; the server records `'web'` when omitted. */
749
+ via?: string;
730
750
  }
731
751
  /** Approving a tool call parked on a human. */
732
752
  interface ApproveInput extends ApproveOptions {
@@ -741,6 +761,16 @@ interface RejectInput {
741
761
  via?: string;
742
762
  }
743
763
  interface TranscriptItemOptions {
764
+ /**
765
+ * A transcript nobody acts on (an audit view, a shared or archived conversation): no approve /
766
+ * reject, answer / skip, edit, fork, regenerate or stop — whatever handlers or backend are in
767
+ * scope. Parked approvals and question sets still render, with their actions unavailable.
768
+ *
769
+ * Without it the decision handlers DEFAULT to the in-scope backend (`<AgentProvider>`'s), so a
770
+ * parked call is actionable with no wiring; a read-only surface would otherwise have to pass
771
+ * `onApprove: null`, `onReject: null`, `onAnswer: null` and `onSkip: null` one by one.
772
+ */
773
+ readOnly?: boolean;
744
774
  /** User messages get an inline edit-and-resubmit machine. */
745
775
  editable?: boolean;
746
776
  onEditSubmit?: (input: EditSubmitInput) => void | Promise<void>;
@@ -967,6 +997,11 @@ interface MessageListProps {
967
997
  reasoningLabel?: React__default.ReactNode;
968
998
  /** Extra content for one message's action row — e.g. a badge naming which agent answered. */
969
999
  getMeta?: (message: UIMessage) => React__default.ReactNode;
1000
+ /**
1001
+ * Nobody acts on this list (an audit or shared view): parked approvals and question sets render
1002
+ * without their actions, and no fork / edit / regenerate — see `useChatTranscript({ readOnly })`.
1003
+ */
1004
+ readOnly?: boolean;
970
1005
  /** When set, every message gets a "Fork" affordance calling back with its id. */
971
1006
  onFork?: (input: MessageActionInput) => void | Promise<void>;
972
1007
  /** User messages get an inline edit-and-resubmit affordance. */
@@ -999,7 +1034,7 @@ interface MessageListProps {
999
1034
  * Every decision here comes from `useChatTranscript`; the file below it is markup. A host that
1000
1035
  * wants a different layout drives that hook directly and never imports this component.
1001
1036
  */
1002
- declare function MessageList({ messages, status, renderToolPart, renderToolGroup, renderText, renderReasoning, renderFiles, renderUi, reasoningLabel, getMeta, onFork, editable, onEditSubmit, regeneratable, onRegenerate, getUsage, getCreatedAt, emptyState, typingIndicator, followUps, onFollowUpClick, error, onRetry, classNames, }: MessageListProps): React__default.JSX.Element;
1037
+ declare function MessageList({ messages, status, renderToolPart, renderToolGroup, renderText, renderReasoning, renderFiles, renderUi, reasoningLabel, getMeta, readOnly, onFork, editable, onEditSubmit, regeneratable, onRegenerate, getUsage, getCreatedAt, emptyState, typingIndicator, followUps, onFollowUpClick, error, onRetry, classNames, }: MessageListProps): React__default.JSX.Element;
1003
1038
 
1004
1039
  /**
1005
1040
  * Languages the dictation mic offers. The Web Speech API expects a
@@ -1236,7 +1271,11 @@ interface UseToolCatalogOptions {
1236
1271
  * (the shared copy is keyed by it): a backend constructed inline refetches every render.
1237
1272
  */
1238
1273
  backend?: ToolsBackend;
1239
- /** The agent whose tools to list. Omitted → the server's default agent. */
1274
+ /**
1275
+ * The agent whose tools to list. Omitted → the server's default agent. {@link ALL_AGENTS} (`'*'`)
1276
+ * → every tool the actor reaches through any agent, each once — for an app with several agents
1277
+ * whose conversations one surface shows.
1278
+ */
1240
1279
  agent?: string;
1241
1280
  /** `false` holds the request (e.g. until the user is signed in). Default `true`. */
1242
1281
  enabled?: boolean;
@@ -1425,7 +1464,9 @@ interface UseAgentChatOptions<B extends AgentBackend = AgentBackend> {
1425
1464
  /**
1426
1465
  * The model every turn runs on, controlled by you. Omitted → `chat.models.selected` (what
1427
1466
  * `chat.models.select(id)` picked), else the thread's pinned model, else the server default. A
1428
- * single send can still override it with `sendMessage(msg, { body: { model } })`.
1467
+ * single send can still override it with `sendMessage(msg, { body: { model } })`. Sent as the
1468
+ * turn's `model`, which the server applies to that turn only — pinning a model on the thread is
1469
+ * `chat.models.pinToThread(id)`.
1429
1470
  */
1430
1471
  model?: string;
1431
1472
  /**
@@ -1499,21 +1540,41 @@ interface ChatBackground {
1499
1540
  /** Re-read the thread now, instead of waiting for the next poll. */
1500
1541
  refresh: () => Promise<void>;
1501
1542
  }
1502
- /** The chat's model picker state. Loaded the first time `list`/`providers` is read. */
1543
+ /**
1544
+ * The chat's model picker state. Loaded the first time `list`/`providers`/`defaultModel`/`locked`
1545
+ * is read.
1546
+ *
1547
+ * Two different choices: `select(id)` picks the model this chat's following sends name — each send
1548
+ * carries it as `model`, which the server applies to that turn only and never stores; the pick is
1549
+ * this conversation's, so switching threads drops it. `pinToThread(id)` stores a model on the
1550
+ * thread (`PATCH threads/:id { model }`), which every later turn without a `model` of its own runs
1551
+ * on, across reloads and devices.
1552
+ */
1503
1553
  interface ChatModels {
1504
1554
  /** Every model the caller may pick, flattened (`[]` until loaded). */
1505
1555
  readonly list: ModelOption[];
1506
1556
  /** The same, grouped by provider. */
1507
1557
  readonly providers: ModelsState['providers'];
1508
- /** What the next turn runs on: the `model` option, the pick, the thread's pin, else the default. */
1558
+ /**
1559
+ * What the next turn runs on: the lock, the `model` option, the pick, the thread's pin, else the
1560
+ * default.
1561
+ */
1509
1562
  selected: string | null;
1563
+ /** The model pinned on the thread (`null` when none, or before the thread is read). */
1564
+ pinned: string | null;
1510
1565
  /** The catalog's default — what a turn runs on when nothing is picked or pinned (`null` until loaded). */
1511
1566
  readonly defaultModel: string | null;
1512
- /** Run the following turns on `id` (sent as the body's `model`). */
1567
+ /**
1568
+ * The agent always runs on one model (`{ model, reason? }`), or `null`. While locked, `select`
1569
+ * does nothing and `selected` is the locked model.
1570
+ */
1571
+ readonly locked: ModelsState['locked'];
1572
+ /** Run this chat's following sends on `id` — each send's `model`, that turn only. */
1513
1573
  select: (id: string) => void;
1514
1574
  /**
1515
1575
  * Pin `id` on the thread (`null` unpins) — every later turn without its own `model` runs on it,
1516
- * across reloads. On a chat with no thread yet, the pin lands when the first send creates one.
1576
+ * across reloads. Replaces the pick, so the next send runs on the pin. On a chat with no thread
1577
+ * yet, the pin lands when the first send creates one.
1517
1578
  */
1518
1579
  pinToThread: (id: string | null) => Promise<void>;
1519
1580
  isLoading: boolean;
@@ -1598,8 +1659,8 @@ declare function useAgentChat<B extends AgentBackend = AgentBackend>(options?: U
1598
1659
  cancel: () => Promise<void>;
1599
1660
  approve: ({ toolCallId, remember, via }: ApproveInput) => Promise<void>;
1600
1661
  reject: ({ toolCallId, reason, via }: RejectInput) => Promise<void>;
1601
- answer: ({ toolCallId, answers }: AnswerInput) => Promise<void>;
1602
- skip: ({ toolCallId }: SkipInput) => Promise<void>;
1662
+ answer: ({ toolCallId, answers, via }: AnswerInput) => Promise<void>;
1663
+ skip: ({ toolCallId, via }: SkipInput) => Promise<void>;
1603
1664
  regenerate: (_input?: Partial<MessageActionInput>) => void;
1604
1665
  fork: ({ messageId, threadId, }: MessageActionInput & {
1605
1666
  threadId?: string;
@@ -1626,4 +1687,4 @@ declare class QuotaBlockedError extends Error {
1626
1687
  constructor(block: QuotaBlock);
1627
1688
  }
1628
1689
 
1629
- export { AgentBackend, AgentChatTransport, type AgentChatTransportOptions, type AgentConfigState, type AgentMessageMetadata, AgentProvider, type AgentProviderProps, type AgentStreamMeta, type AgentsState, type AggregatedTurnUsage, type AmbientRenderUi, AmbientRenderUiContext, type AnswerInput, AnyToolUIPart, type ApprovalCountdown, type ApproveInput, ApproveOptions, type AttachmentRejection, AttachmentUploadStrategy, type AttachmentsState, type AutocompleteInputProps, type AutocompleteItem, type AutocompleteListboxProps, type AutocompleteOptionProps, type AutocompleteSource, type BackgroundRun, type ChatBackground, ChatInput, type ChatInputProps, ChatStatus, type ChatTranscript, type ClipboardLikeEvent, type CompletionEdit, type ComposerAutocomplete, DEFAULT_SPEECH_LANG, type DragLikeEvent, type EditSubmitInput, type MessageActionInput, type MessageFeedbackState, type MessageFile, type MessageFileKind, MessageItem, type MessageItemClassNames, type MessageItemProps, MessageItemView, type MessageItemViewProps, MessageList, type MessageListClassNames, type MessageListProps, MessageUsageInfo, type ModelOption, type ModelsState, QuotaBlockedError, type QuotaState, type ReconnectOptions, type RejectInput, type RenderFilesFn, type RenderReasoningFn, type RenderTextFn, type RenderToolGroupFn, type RenderToolPartFn, type RenderUiFn, SPEECH_LANGUAGES, type SkillSuggestionData, type SkillsSourceOptions, type SkipInput, type SpeechLanguage, type SpeechRecognitionHook, type StagedAttachment, type StagedAttachmentStatus, type StickToBottom, type StickToBottomOptions, type StoredTurnMetadata, type StreamConnectionState, type ThreadsEvent, type ThreadsState, TimestampInfo, ToolCatalog, type ToolCatalogState, type TranscriptActionState, TranscriptBlock, type TranscriptCopyState, type TranscriptEditState, TranscriptFile, type TranscriptItem, type TranscriptItemOptions, type TranscriptStopState, TranscriptUiBlock, type TranscriptWindow, type TriggerMatch, type TriggerPosition, UploadAttachmentOptions, UsageSummary, type UseAgentChatOptions, type UseAgentConfigOptions, type UseAgentsOptions, type UseApprovalCountdownOptions, type UseAttachmentsOptions, type UseChatTranscriptOptions, type UseComposerAutocompleteOptions, type UseElapsedOptions, type UseMessageFeedbackOptions, type UseModelsOptions, type UseQuotaOptions, type UseSpeechRecognitionOptions, type UseThreadsOptions, type UseToolCatalogOptions, type UseTranscriptItemOptions, acceptsFile, applyCompletion, approvalCountdown, backgroundRunsFromThread, createSkillsSource, dragHasFiles, fileKind, filesFromClipboard, filterAutocompleteItems, findActiveTrigger, formatElapsed, loadStoredSpeechLang, messageFiles, notifyThreads, onThreadsEvent, persistSpeechLang, readReasoningMs, storedMessageToUiMessage, storedThreadToUiMessages, useAgentBackend, useAgentChat, useAgentConfig, useAgents, useAmbientRenderUi, useApprovalCountdown, useAttachments, useChatTranscript, useComposerAutocomplete, useElapsed, useMessageFeedback, useModels, useQuota, useSpeechRecognition, useStickToBottom, useThreads, useToolCatalog, useTranscriptItem };
1690
+ export { AgentBackend, AgentChatTransport, type AgentChatTransportOptions, type AgentConfigState, type AgentMessageMetadata, AgentProvider, type AgentProviderProps, type AgentStreamMeta, type AgentsState, type AggregatedTurnUsage, type AmbientRenderUi, AmbientRenderUiContext, type AnswerInput, AnyToolUIPart, type ApprovalCountdown, type ApproveInput, ApproveOptions, type AttachmentRejection, AttachmentUploadStrategy, type AttachmentsState, type AutocompleteInputProps, type AutocompleteItem, type AutocompleteListboxProps, type AutocompleteOptionProps, type AutocompleteSource, type BackgroundRun, type ChatBackground, ChatInput, type ChatInputProps, ChatStatus, type ChatTranscript, type ClipboardLikeEvent, type CompletionEdit, type ComposerAutocomplete, DEFAULT_SPEECH_LANG, type DragLikeEvent, type EditSubmitInput, HttpErrorListener, type MessageActionInput, type MessageFeedbackState, type MessageFile, type MessageFileKind, MessageItem, type MessageItemClassNames, type MessageItemProps, MessageItemView, type MessageItemViewProps, MessageList, type MessageListClassNames, type MessageListProps, MessageUsageInfo, type ModelOption, type ModelsState, QuotaBlockedError, type QuotaState, type ReconnectOptions, type RejectInput, type RenderFilesFn, type RenderReasoningFn, type RenderTextFn, type RenderToolGroupFn, type RenderToolPartFn, type RenderUiFn, SPEECH_LANGUAGES, type SkillSuggestionData, type SkillsSourceOptions, type SkipInput, type SpeechLanguage, type SpeechRecognitionHook, type StagedAttachment, type StagedAttachmentStatus, type StickToBottom, type StickToBottomOptions, type StoredTurnMetadata, type StreamConnectionState, type ThreadsEvent, type ThreadsState, TimestampInfo, ToolCatalog, type ToolCatalogState, type TranscriptActionState, TranscriptBlock, type TranscriptCopyState, type TranscriptEditState, TranscriptFile, type TranscriptItem, type TranscriptItemOptions, type TranscriptStopState, TranscriptUiBlock, type TranscriptWindow, type TriggerMatch, type TriggerPosition, UploadAttachmentOptions, UsageSummary, type UseAgentChatOptions, type UseAgentConfigOptions, type UseAgentsOptions, type UseApprovalCountdownOptions, type UseAttachmentsOptions, type UseChatTranscriptOptions, type UseComposerAutocompleteOptions, type UseElapsedOptions, type UseMessageFeedbackOptions, type UseModelsOptions, type UseQuotaOptions, type UseSpeechRecognitionOptions, type UseThreadsOptions, type UseToolCatalogOptions, type UseTranscriptItemOptions, acceptsFile, applyCompletion, approvalCountdown, backgroundRunsFromThread, createSkillsSource, dragHasFiles, fileKind, filesFromClipboard, filterAutocompleteItems, findActiveTrigger, formatElapsed, loadStoredSpeechLang, messageFiles, notifyThreads, onThreadsEvent, persistSpeechLang, readReasoningMs, storedMessageToUiMessage, storedThreadToUiMessages, useAgentBackend, useAgentChat, useAgentConfig, useAgents, useAmbientRenderUi, useApprovalCountdown, useAttachments, useChatTranscript, useComposerAutocomplete, useElapsed, useMessageFeedback, useModels, useQuota, useSpeechRecognition, useStickToBottom, useThreads, useToolCatalog, useTranscriptItem };