@dudousxd/nestjs-agent-react 0.32.0 → 0.33.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/{client-C7eu9WMJ.d.cts → client-B6EE8-AC.d.cts} +36 -1
- package/dist/{client-C7eu9WMJ.d.ts → client-B6EE8-AC.d.ts} +36 -1
- package/dist/{generative-ui-VTZ1EADD.d.cts → generative-ui-DOe2RsoO.d.cts} +35 -9
- package/dist/{generative-ui-VTZ1EADD.d.ts → generative-ui-DOe2RsoO.d.ts} +35 -9
- package/dist/genui-json-render.cjs +51 -8
- package/dist/genui-json-render.cjs.map +1 -1
- package/dist/genui-json-render.d.cts +1 -1
- package/dist/genui-json-render.d.ts +1 -1
- package/dist/genui-json-render.js +51 -8
- package/dist/genui-json-render.js.map +1 -1
- package/dist/genui.cjs +51 -8
- package/dist/genui.cjs.map +1 -1
- package/dist/genui.d.cts +2 -2
- package/dist/genui.d.ts +2 -2
- package/dist/genui.js +51 -8
- package/dist/genui.js.map +1 -1
- package/dist/index.cjs +557 -123
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -10
- package/dist/index.d.ts +28 -10
- package/dist/index.js +551 -120
- package/dist/index.js.map +1 -1
- package/dist/media.cjs.map +1 -1
- package/dist/media.d.cts +1 -1
- package/dist/media.d.ts +1 -1
- package/dist/media.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
2
|
import { ChatTransport, UIMessage, UIMessageChunk, DataUIPart, UIDataTypes } from 'ai';
|
|
3
|
-
import { A as AgentRequestError, a as AgentBackend, U as UploadAttachmentOptions, C as ChatStreamRequest, b as ChatStreamResponse, H as HttpErrorListener, c as AttachmentUploadStrategy } from './client-
|
|
4
|
-
export { d as AgentBackendUnsupportedError, e as AgentClient, f as AgentClientOptions, g as AgentConnection, h as AgentHttpError, i as CancelResult, M as MessageFeedbackInput, Q as QueuedMessageUpdate, j as QueuedSendResult, R as ResumeStreamRequest, T as ThreadPatch, r as requireBackendMethod } from './client-
|
|
5
|
-
import { MessageAttachment, AgentClientConfig, AgentCatalogEntry, PersonaCatalogEntry, ModelCatalogEntry, ModelCatalogView, ModelCatalogLock, QuotaReport, QuotaWindow, QuotaBlock, QuotaWarning, MessageFeedback, MessageFeedbackValue, ThreadSummary, StoredMessage, QueuePause, ToolCatalogEntry } from '@dudousxd/nestjs-agent-core';
|
|
3
|
+
import { A as AgentRequestError, a as AgentBackend, U as UploadAttachmentOptions, C as ChatStreamRequest, b as ChatStreamResponse, H as HttpErrorListener, c as AttachmentUploadStrategy } from './client-B6EE8-AC.cjs';
|
|
4
|
+
export { d as AgentBackendUnsupportedError, e as AgentClient, f as AgentClientOptions, g as AgentConnection, h as AgentHttpError, i as CancelResult, M as MessageFeedbackInput, Q as QueuedMessageUpdate, j as QueuedSendResult, R as ResumeStreamRequest, T as ThreadPatch, r as requireBackendMethod } from './client-B6EE8-AC.cjs';
|
|
5
|
+
import { MessageAttachment, AgentClientConfig, AgentCatalogEntry, PersonaCatalogEntry, ModelCatalogEntry, ModelCatalogView, ModelCatalogLock, QuotaReport, QuotaWindow, QuotaBlock, QuotaWarning, MessageFeedback, MessageFeedbackValue, ThreadSummary, StoredMessage, QueuePause, ToolCatalogEntry, ActionProposal } from '@dudousxd/nestjs-agent-core';
|
|
6
6
|
export { ALL_AGENTS, ChatQueueState, ElicitationInput, ElicitationInputType, QueuePause, QueuePauseReason, QueuedMessageView, 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 {
|
|
10
|
-
export {
|
|
9
|
+
import { UiCapabilities } from '@dudousxd/nestjs-agent-core/genui';
|
|
10
|
+
export { UiCapabilities } from '@dudousxd/nestjs-agent-core/genui';
|
|
11
|
+
import { o as GenuiProviderValue, T as TranscriptUiBlock, A as ApproveOptions, t as ApprovalTarget, v as TranscriptBlock, U as UsageSummary, w as TimestampInfo, C as ChatStatus, x as TranscriptFile, M as MessageUsageInfo, y as ToolCatalog, z as AnyToolUIPart } from './generative-ui-DOe2RsoO.cjs';
|
|
12
|
+
export { B as ApprovalBlockOptions, D as BuildBlocksOptions, E as CoercibleQuestion, F as DescribeToolCallOptions, H as ElicitationBlockOptions, I as GroupToolActivityOptions, J as RawAnswer, K as ResolvedReading, L as ResolvedResultView, N as RetrievedPassage, S as SettleAction, O as ToolActivityGroup, P as ToolCallDescription, Q as ToolCallState, V as ToolCallStatus, W as TranscriptApproval, X as TranscriptApprovalStatus, Y as TranscriptElicitationBlock, Z as TranscriptElicitationOutcome, _ as TranscriptFilesBlock, $ as TranscriptQuestion, a0 as TranscriptQuestionOption, a1 as TranscriptReasoningBlock, a2 as TranscriptSettleState, a3 as TranscriptSource, a4 as TranscriptSourcesBlock, a5 as TranscriptTextBlock, a6 as TranscriptToolBlock, a7 as TranscriptToolCall, a8 as buildTranscriptBlocks, a9 as coerceAnswer, aa as correctedCallIds, ab as describeTimestamp, ac as describeToolCall, ad as describeUsage, ae as extractMessageText, af as fillTemplate, ag as formatRelativeTime, ah as groupToolActivity, ai as inferResultView, aj as isActionCall, ak as phraseFor, al as proposalNeedsPolling, am as readPath, an as reconcileProposalMessages, ao as resolveResultView, ap as toolCallState, aq as toolCatalogFrom } from './generative-ui-DOe2RsoO.cjs';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* The `code`s this library's own loop closes a failed run's stream with (`event: error`). A client
|
|
@@ -408,7 +410,7 @@ interface AgUiChatStreamOptions {
|
|
|
408
410
|
/** Defaults to the global `fetch`, with `credentials: 'same-origin'`. */
|
|
409
411
|
fetch?: typeof fetch;
|
|
410
412
|
/**
|
|
411
|
-
* Shape `forwardedProps` from the send's body. Default: `{ pageContext, agent, model }` from the
|
|
413
|
+
* Shape `forwardedProps` from the send's body. Default: `{ pageContext, agent, model, persona, uiCapabilities }` from the
|
|
412
414
|
* body, whichever are present.
|
|
413
415
|
*/
|
|
414
416
|
forwardedProps?: (body: Record<string, unknown>) => unknown;
|
|
@@ -455,6 +457,8 @@ declare function reframeAgUiStream(source: ReadableStream<Uint8Array>, ids: {
|
|
|
455
457
|
}): ReadableStream<Uint8Array>;
|
|
456
458
|
|
|
457
459
|
interface AgentProviderProps {
|
|
460
|
+
/** Advertise exact supported component versions; omission keeps legacy support, [] is text only. */
|
|
461
|
+
uiCapabilities?: UiCapabilities;
|
|
458
462
|
/**
|
|
459
463
|
* A backend of your own — see {@link AgentBackend}. Omitted → an {@link AgentClient} over this
|
|
460
464
|
* library's REST routes, built from the connection props below (which are ignored when a backend
|
|
@@ -507,7 +511,7 @@ interface AgentProviderProps {
|
|
|
507
511
|
*
|
|
508
512
|
* Without a provider every hook shares one same-origin client on `/agent`.
|
|
509
513
|
*/
|
|
510
|
-
declare function AgentProvider({ backend, baseUrl, path, headers, getHeaders, credentials, fetch, onHttpError, attachments, genui, children, }: AgentProviderProps): React.JSX.Element;
|
|
514
|
+
declare function AgentProvider({ backend, uiCapabilities, baseUrl, path, headers, getHeaders, credentials, fetch, onHttpError, attachments, genui, children, }: AgentProviderProps): React.JSX.Element;
|
|
511
515
|
/**
|
|
512
516
|
* The backend a hook talks to: `own` when given, else the enclosing {@link AgentProvider}'s, else a
|
|
513
517
|
* shared same-origin client on `/agent`. For your own hooks over the same connection.
|
|
@@ -976,12 +980,14 @@ interface SkipInput {
|
|
|
976
980
|
}
|
|
977
981
|
/** Approving a tool call parked on a human. */
|
|
978
982
|
interface ApproveInput extends ApproveOptions {
|
|
983
|
+
target?: ApprovalTarget;
|
|
979
984
|
toolCallId: string;
|
|
980
985
|
/** The surface the decision came through; the server records `'web'` when omitted. */
|
|
981
986
|
via?: string;
|
|
982
987
|
}
|
|
983
988
|
/** Rejecting a tool call parked on a human. */
|
|
984
989
|
interface RejectInput {
|
|
990
|
+
target?: ApprovalTarget;
|
|
985
991
|
toolCallId: string;
|
|
986
992
|
reason?: string;
|
|
987
993
|
via?: string;
|
|
@@ -1711,6 +1717,10 @@ interface AgentMessageMetadata extends Partial<StoredTurnMetadata> {
|
|
|
1711
1717
|
declare function storedThreadToUiMessages(messages: StoredMessage[]): UIMessage[];
|
|
1712
1718
|
|
|
1713
1719
|
interface UseAgentChatOptions<B extends AgentBackend = AgentBackend> {
|
|
1720
|
+
uiCapabilities?: UiCapabilities;
|
|
1721
|
+
proposalPollMs?: number;
|
|
1722
|
+
/** Enable proposal reads even when history and resume are both disabled. */
|
|
1723
|
+
proposals?: boolean;
|
|
1714
1724
|
/**
|
|
1715
1725
|
* What the chat talks to — see {@link AgentBackend}. Omitted → the enclosing `<AgentProvider>`'s,
|
|
1716
1726
|
* else a same-origin client on `/agent`. Must be stable across renders.
|
|
@@ -1960,6 +1970,7 @@ declare function useAgentChat<B extends AgentBackend = AgentBackend>(options?: U
|
|
|
1960
1970
|
addToolResult: ({ tool, toolCallId, output }: AddToolResultArgs) => void | PromiseLike<void>;
|
|
1961
1971
|
/** Sub-agents this conversation started and did not wait for. */
|
|
1962
1972
|
background: ChatBackground;
|
|
1973
|
+
proposals: ActionProposalsState;
|
|
1963
1974
|
runId: string | undefined;
|
|
1964
1975
|
/** The loaded thread's running turn, or `null` once read with none. */
|
|
1965
1976
|
activeRunId: string | null;
|
|
@@ -2002,8 +2013,8 @@ declare function useAgentChat<B extends AgentBackend = AgentBackend>(options?: U
|
|
|
2002
2013
|
/** The window blocking sends right now (the `blocked` option, else the quota report's). */
|
|
2003
2014
|
blocked: QuotaBlock | null;
|
|
2004
2015
|
cancel: () => Promise<void>;
|
|
2005
|
-
approve: ({ toolCallId, remember, via }: ApproveInput) => Promise<void>;
|
|
2006
|
-
reject: ({ toolCallId, reason, via }: RejectInput) => Promise<void>;
|
|
2016
|
+
approve: ({ toolCallId, target, remember, via }: ApproveInput) => Promise<void>;
|
|
2017
|
+
reject: ({ toolCallId, target, reason, via }: RejectInput) => Promise<void>;
|
|
2007
2018
|
answer: ({ toolCallId, answers, via }: AnswerInput) => Promise<void>;
|
|
2008
2019
|
skip: ({ toolCallId, via }: SkipInput) => Promise<void>;
|
|
2009
2020
|
regenerate: (_input?: Partial<MessageActionInput>) => void;
|
|
@@ -2032,4 +2043,11 @@ declare class QuotaBlockedError extends Error {
|
|
|
2032
2043
|
constructor(block: QuotaBlock);
|
|
2033
2044
|
}
|
|
2034
2045
|
|
|
2035
|
-
|
|
2046
|
+
interface ActionProposalsState {
|
|
2047
|
+
items: ActionProposal[];
|
|
2048
|
+
error: Error | null;
|
|
2049
|
+
refresh(): Promise<void>;
|
|
2050
|
+
}
|
|
2051
|
+
declare function useActionProposals(backend: AgentBackend, threadId: string | undefined, setMessages: (update: (current: UIMessage[]) => UIMessage[]) => void, refreshKey: string, pollMs?: number): ActionProposalsState;
|
|
2052
|
+
|
|
2053
|
+
export { AGENT_RUN_ERROR_CODES, type ActionProposalsState, type AgUiChatStreamOptions, type AgUiContentPart, AgentBackend, AgentChatTransport, type AgentChatTransportOptions, type AgentConfigState, type AgentMessageMetadata, AgentProvider, type AgentProviderProps, AgentRequestError, type AgentRunErrorCode, type AgentRunFailure, type AgentStreamMeta, type AgentsState, type AggregatedTurnUsage, type AmbientRenderUi, AmbientRenderUiContext, type AnswerInput, AnyToolUIPart, type ApprovalCountdown, ApprovalTarget, 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, type ChatQueue, ChatStatus, ChatStreamRequest, ChatStreamResponse, 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, type QueuedChatMessage, QuotaBlockedError, type QuotaState, RUN_NOT_ACTIVE_CODE, type ReconnectOptions, type RejectInput, type RenderFilesFn, type RenderReasoningFn, type RenderTextFn, type RenderToolGroupFn, type RenderToolPartFn, type RenderUiFn, SPEECH_LANGUAGES, type SendWhileRunning, 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 TranscriptQueuedFile, type TranscriptQueuedItem, 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, type WhileRunning, acceptsFile, agUiChatStream, applyCompletion, approvalCountdown, attachmentFile, backgroundRunsFromThread, createSkillsSource, dragHasFiles, fileKind, filesFromClipboard, filterAutocompleteItems, findActiveTrigger, formatElapsed, isRunNotActiveError, loadStoredSpeechLang, messageFiles, notifyThreads, onThreadsEvent, persistSpeechLang, readReasoningMs, reframeAgUiStream, storedMessageToUiMessage, storedThreadToUiMessages, useActionProposals, 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,15 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
2
|
import { ChatTransport, UIMessage, UIMessageChunk, DataUIPart, UIDataTypes } from 'ai';
|
|
3
|
-
import { A as AgentRequestError, a as AgentBackend, U as UploadAttachmentOptions, C as ChatStreamRequest, b as ChatStreamResponse, H as HttpErrorListener, c as AttachmentUploadStrategy } from './client-
|
|
4
|
-
export { d as AgentBackendUnsupportedError, e as AgentClient, f as AgentClientOptions, g as AgentConnection, h as AgentHttpError, i as CancelResult, M as MessageFeedbackInput, Q as QueuedMessageUpdate, j as QueuedSendResult, R as ResumeStreamRequest, T as ThreadPatch, r as requireBackendMethod } from './client-
|
|
5
|
-
import { MessageAttachment, AgentClientConfig, AgentCatalogEntry, PersonaCatalogEntry, ModelCatalogEntry, ModelCatalogView, ModelCatalogLock, QuotaReport, QuotaWindow, QuotaBlock, QuotaWarning, MessageFeedback, MessageFeedbackValue, ThreadSummary, StoredMessage, QueuePause, ToolCatalogEntry } from '@dudousxd/nestjs-agent-core';
|
|
3
|
+
import { A as AgentRequestError, a as AgentBackend, U as UploadAttachmentOptions, C as ChatStreamRequest, b as ChatStreamResponse, H as HttpErrorListener, c as AttachmentUploadStrategy } from './client-B6EE8-AC.js';
|
|
4
|
+
export { d as AgentBackendUnsupportedError, e as AgentClient, f as AgentClientOptions, g as AgentConnection, h as AgentHttpError, i as CancelResult, M as MessageFeedbackInput, Q as QueuedMessageUpdate, j as QueuedSendResult, R as ResumeStreamRequest, T as ThreadPatch, r as requireBackendMethod } from './client-B6EE8-AC.js';
|
|
5
|
+
import { MessageAttachment, AgentClientConfig, AgentCatalogEntry, PersonaCatalogEntry, ModelCatalogEntry, ModelCatalogView, ModelCatalogLock, QuotaReport, QuotaWindow, QuotaBlock, QuotaWarning, MessageFeedback, MessageFeedbackValue, ThreadSummary, StoredMessage, QueuePause, ToolCatalogEntry, ActionProposal } from '@dudousxd/nestjs-agent-core';
|
|
6
6
|
export { ALL_AGENTS, ChatQueueState, ElicitationInput, ElicitationInputType, QueuePause, QueuePauseReason, QueuedMessageView, 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 {
|
|
10
|
-
export {
|
|
9
|
+
import { UiCapabilities } from '@dudousxd/nestjs-agent-core/genui';
|
|
10
|
+
export { UiCapabilities } from '@dudousxd/nestjs-agent-core/genui';
|
|
11
|
+
import { o as GenuiProviderValue, T as TranscriptUiBlock, A as ApproveOptions, t as ApprovalTarget, v as TranscriptBlock, U as UsageSummary, w as TimestampInfo, C as ChatStatus, x as TranscriptFile, M as MessageUsageInfo, y as ToolCatalog, z as AnyToolUIPart } from './generative-ui-DOe2RsoO.js';
|
|
12
|
+
export { B as ApprovalBlockOptions, D as BuildBlocksOptions, E as CoercibleQuestion, F as DescribeToolCallOptions, H as ElicitationBlockOptions, I as GroupToolActivityOptions, J as RawAnswer, K as ResolvedReading, L as ResolvedResultView, N as RetrievedPassage, S as SettleAction, O as ToolActivityGroup, P as ToolCallDescription, Q as ToolCallState, V as ToolCallStatus, W as TranscriptApproval, X as TranscriptApprovalStatus, Y as TranscriptElicitationBlock, Z as TranscriptElicitationOutcome, _ as TranscriptFilesBlock, $ as TranscriptQuestion, a0 as TranscriptQuestionOption, a1 as TranscriptReasoningBlock, a2 as TranscriptSettleState, a3 as TranscriptSource, a4 as TranscriptSourcesBlock, a5 as TranscriptTextBlock, a6 as TranscriptToolBlock, a7 as TranscriptToolCall, a8 as buildTranscriptBlocks, a9 as coerceAnswer, aa as correctedCallIds, ab as describeTimestamp, ac as describeToolCall, ad as describeUsage, ae as extractMessageText, af as fillTemplate, ag as formatRelativeTime, ah as groupToolActivity, ai as inferResultView, aj as isActionCall, ak as phraseFor, al as proposalNeedsPolling, am as readPath, an as reconcileProposalMessages, ao as resolveResultView, ap as toolCallState, aq as toolCatalogFrom } from './generative-ui-DOe2RsoO.js';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* The `code`s this library's own loop closes a failed run's stream with (`event: error`). A client
|
|
@@ -408,7 +410,7 @@ interface AgUiChatStreamOptions {
|
|
|
408
410
|
/** Defaults to the global `fetch`, with `credentials: 'same-origin'`. */
|
|
409
411
|
fetch?: typeof fetch;
|
|
410
412
|
/**
|
|
411
|
-
* Shape `forwardedProps` from the send's body. Default: `{ pageContext, agent, model }` from the
|
|
413
|
+
* Shape `forwardedProps` from the send's body. Default: `{ pageContext, agent, model, persona, uiCapabilities }` from the
|
|
412
414
|
* body, whichever are present.
|
|
413
415
|
*/
|
|
414
416
|
forwardedProps?: (body: Record<string, unknown>) => unknown;
|
|
@@ -455,6 +457,8 @@ declare function reframeAgUiStream(source: ReadableStream<Uint8Array>, ids: {
|
|
|
455
457
|
}): ReadableStream<Uint8Array>;
|
|
456
458
|
|
|
457
459
|
interface AgentProviderProps {
|
|
460
|
+
/** Advertise exact supported component versions; omission keeps legacy support, [] is text only. */
|
|
461
|
+
uiCapabilities?: UiCapabilities;
|
|
458
462
|
/**
|
|
459
463
|
* A backend of your own — see {@link AgentBackend}. Omitted → an {@link AgentClient} over this
|
|
460
464
|
* library's REST routes, built from the connection props below (which are ignored when a backend
|
|
@@ -507,7 +511,7 @@ interface AgentProviderProps {
|
|
|
507
511
|
*
|
|
508
512
|
* Without a provider every hook shares one same-origin client on `/agent`.
|
|
509
513
|
*/
|
|
510
|
-
declare function AgentProvider({ backend, baseUrl, path, headers, getHeaders, credentials, fetch, onHttpError, attachments, genui, children, }: AgentProviderProps): React.JSX.Element;
|
|
514
|
+
declare function AgentProvider({ backend, uiCapabilities, baseUrl, path, headers, getHeaders, credentials, fetch, onHttpError, attachments, genui, children, }: AgentProviderProps): React.JSX.Element;
|
|
511
515
|
/**
|
|
512
516
|
* The backend a hook talks to: `own` when given, else the enclosing {@link AgentProvider}'s, else a
|
|
513
517
|
* shared same-origin client on `/agent`. For your own hooks over the same connection.
|
|
@@ -976,12 +980,14 @@ interface SkipInput {
|
|
|
976
980
|
}
|
|
977
981
|
/** Approving a tool call parked on a human. */
|
|
978
982
|
interface ApproveInput extends ApproveOptions {
|
|
983
|
+
target?: ApprovalTarget;
|
|
979
984
|
toolCallId: string;
|
|
980
985
|
/** The surface the decision came through; the server records `'web'` when omitted. */
|
|
981
986
|
via?: string;
|
|
982
987
|
}
|
|
983
988
|
/** Rejecting a tool call parked on a human. */
|
|
984
989
|
interface RejectInput {
|
|
990
|
+
target?: ApprovalTarget;
|
|
985
991
|
toolCallId: string;
|
|
986
992
|
reason?: string;
|
|
987
993
|
via?: string;
|
|
@@ -1711,6 +1717,10 @@ interface AgentMessageMetadata extends Partial<StoredTurnMetadata> {
|
|
|
1711
1717
|
declare function storedThreadToUiMessages(messages: StoredMessage[]): UIMessage[];
|
|
1712
1718
|
|
|
1713
1719
|
interface UseAgentChatOptions<B extends AgentBackend = AgentBackend> {
|
|
1720
|
+
uiCapabilities?: UiCapabilities;
|
|
1721
|
+
proposalPollMs?: number;
|
|
1722
|
+
/** Enable proposal reads even when history and resume are both disabled. */
|
|
1723
|
+
proposals?: boolean;
|
|
1714
1724
|
/**
|
|
1715
1725
|
* What the chat talks to — see {@link AgentBackend}. Omitted → the enclosing `<AgentProvider>`'s,
|
|
1716
1726
|
* else a same-origin client on `/agent`. Must be stable across renders.
|
|
@@ -1960,6 +1970,7 @@ declare function useAgentChat<B extends AgentBackend = AgentBackend>(options?: U
|
|
|
1960
1970
|
addToolResult: ({ tool, toolCallId, output }: AddToolResultArgs) => void | PromiseLike<void>;
|
|
1961
1971
|
/** Sub-agents this conversation started and did not wait for. */
|
|
1962
1972
|
background: ChatBackground;
|
|
1973
|
+
proposals: ActionProposalsState;
|
|
1963
1974
|
runId: string | undefined;
|
|
1964
1975
|
/** The loaded thread's running turn, or `null` once read with none. */
|
|
1965
1976
|
activeRunId: string | null;
|
|
@@ -2002,8 +2013,8 @@ declare function useAgentChat<B extends AgentBackend = AgentBackend>(options?: U
|
|
|
2002
2013
|
/** The window blocking sends right now (the `blocked` option, else the quota report's). */
|
|
2003
2014
|
blocked: QuotaBlock | null;
|
|
2004
2015
|
cancel: () => Promise<void>;
|
|
2005
|
-
approve: ({ toolCallId, remember, via }: ApproveInput) => Promise<void>;
|
|
2006
|
-
reject: ({ toolCallId, reason, via }: RejectInput) => Promise<void>;
|
|
2016
|
+
approve: ({ toolCallId, target, remember, via }: ApproveInput) => Promise<void>;
|
|
2017
|
+
reject: ({ toolCallId, target, reason, via }: RejectInput) => Promise<void>;
|
|
2007
2018
|
answer: ({ toolCallId, answers, via }: AnswerInput) => Promise<void>;
|
|
2008
2019
|
skip: ({ toolCallId, via }: SkipInput) => Promise<void>;
|
|
2009
2020
|
regenerate: (_input?: Partial<MessageActionInput>) => void;
|
|
@@ -2032,4 +2043,11 @@ declare class QuotaBlockedError extends Error {
|
|
|
2032
2043
|
constructor(block: QuotaBlock);
|
|
2033
2044
|
}
|
|
2034
2045
|
|
|
2035
|
-
|
|
2046
|
+
interface ActionProposalsState {
|
|
2047
|
+
items: ActionProposal[];
|
|
2048
|
+
error: Error | null;
|
|
2049
|
+
refresh(): Promise<void>;
|
|
2050
|
+
}
|
|
2051
|
+
declare function useActionProposals(backend: AgentBackend, threadId: string | undefined, setMessages: (update: (current: UIMessage[]) => UIMessage[]) => void, refreshKey: string, pollMs?: number): ActionProposalsState;
|
|
2052
|
+
|
|
2053
|
+
export { AGENT_RUN_ERROR_CODES, type ActionProposalsState, type AgUiChatStreamOptions, type AgUiContentPart, AgentBackend, AgentChatTransport, type AgentChatTransportOptions, type AgentConfigState, type AgentMessageMetadata, AgentProvider, type AgentProviderProps, AgentRequestError, type AgentRunErrorCode, type AgentRunFailure, type AgentStreamMeta, type AgentsState, type AggregatedTurnUsage, type AmbientRenderUi, AmbientRenderUiContext, type AnswerInput, AnyToolUIPart, type ApprovalCountdown, ApprovalTarget, 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, type ChatQueue, ChatStatus, ChatStreamRequest, ChatStreamResponse, 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, type QueuedChatMessage, QuotaBlockedError, type QuotaState, RUN_NOT_ACTIVE_CODE, type ReconnectOptions, type RejectInput, type RenderFilesFn, type RenderReasoningFn, type RenderTextFn, type RenderToolGroupFn, type RenderToolPartFn, type RenderUiFn, SPEECH_LANGUAGES, type SendWhileRunning, 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 TranscriptQueuedFile, type TranscriptQueuedItem, 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, type WhileRunning, acceptsFile, agUiChatStream, applyCompletion, approvalCountdown, attachmentFile, backgroundRunsFromThread, createSkillsSource, dragHasFiles, fileKind, filesFromClipboard, filterAutocompleteItems, findActiveTrigger, formatElapsed, isRunNotActiveError, loadStoredSpeechLang, messageFiles, notifyThreads, onThreadsEvent, persistSpeechLang, readReasoningMs, reframeAgUiStream, storedMessageToUiMessage, storedThreadToUiMessages, useActionProposals, useAgentBackend, useAgentChat, useAgentConfig, useAgents, useAmbientRenderUi, useApprovalCountdown, useAttachments, useChatTranscript, useComposerAutocomplete, useElapsed, useMessageFeedback, useModels, useQuota, useSpeechRecognition, useStickToBottom, useThreads, useToolCatalog, useTranscriptItem };
|