@dudousxd/nestjs-agent-react 0.29.2 → 0.31.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/README.md +34 -0
- package/dist/{client-DhHEJi7c.d.cts → client-BuobfZtx.d.cts} +1 -1
- package/dist/{client-DhHEJi7c.d.ts → client-BuobfZtx.d.ts} +1 -1
- package/dist/index.cjs +355 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +87 -3
- package/dist/index.d.ts +87 -3
- package/dist/index.js +353 -18
- package/dist/index.js.map +1 -1
- package/dist/media.d.cts +1 -1
- package/dist/media.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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, H as HttpErrorListener,
|
|
4
|
-
export {
|
|
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-BuobfZtx.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-BuobfZtx.cjs';
|
|
5
5
|
import { MessageAttachment, AgentClientConfig, AgentCatalogEntry, ModelCatalogEntry, ModelCatalogView, ModelCatalogLock, QuotaReport, QuotaWindow, QuotaBlock, QuotaWarning, MessageFeedback, MessageFeedbackValue, ThreadSummary, StoredMessage, QueuePause, ToolCatalogEntry } 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';
|
|
@@ -368,6 +368,90 @@ interface ClipboardLikeEvent {
|
|
|
368
368
|
*/
|
|
369
369
|
declare function useAttachments(options?: UseAttachmentsOptions): AttachmentsState;
|
|
370
370
|
|
|
371
|
+
/**
|
|
372
|
+
* Talk to an AG-UI 1.0 producer (https://docs.ag-ui.com/spec/1.0) through `useAgentChat`.
|
|
373
|
+
*
|
|
374
|
+
* `agUiChatStream` POSTs a `RunAgentInput` and hands the transport the answer re-framed in this
|
|
375
|
+
* library's stream protocol, so everything built on `useAgentChat` — the transcript, tool activity,
|
|
376
|
+
* generative UI — renders an AG-UI agent unchanged. Put it behind `openChatStream` of any backend:
|
|
377
|
+
*
|
|
378
|
+
* ```ts
|
|
379
|
+
* const backend: AgentBackend = {
|
|
380
|
+
* ...httpBackend,
|
|
381
|
+
* openChatStream: (request) => agUiChatStream(request, { url: '/agent/ag-ui' }),
|
|
382
|
+
* }
|
|
383
|
+
* ```
|
|
384
|
+
*
|
|
385
|
+
* What maps where (the inverse of the producer in `@adonis-agora/agent/ag-ui`):
|
|
386
|
+
* - `TEXT_MESSAGE_*` → `text`; `REASONING_MESSAGE_*` → `reasoning`; `STEP_*` → `step-start` /
|
|
387
|
+
* `step-finish`;
|
|
388
|
+
* - `TOOL_CALL_START` / `ARGS` / `END` → `tool-input-start` / `-delta` / `-available`;
|
|
389
|
+
* `TOOL_CALL_RESULT` → `tool-output` (or `tool-output-error` / `-denied`, from
|
|
390
|
+
* `metadata['agora.outcome']`);
|
|
391
|
+
* - `ACTIVITY_SNAPSHOT` / `ACTIVITY_DELTA` → a `ui` part named `AgUiActivity`, id
|
|
392
|
+
* `activity:<messageId>`, props `{ activityType, content }` — the whole content each time (the
|
|
393
|
+
* delta's JSON Patch applied here), so a repeat replaces the widget in place;
|
|
394
|
+
* - `RUN_ERROR` → the stream's `event: error`; `RUN_FINISHED` → `event: done` (a cancelled
|
|
395
|
+
* outcome writes `cancelled` first; an interrupt outcome writes a `ui` part named
|
|
396
|
+
* `AgUiInterrupt` carrying the interrupts, for the app to render);
|
|
397
|
+
* - `CUSTOM` events a producer of this family writes (`agora.ui`, `agora.title`, `agora.queue`,
|
|
398
|
+
* `agora.approval-requested` / `-settled`, `agora.run`) → the frames they stand for. Any other
|
|
399
|
+
* `CUSTOM` is ignored, as the protocol requires of a consumer that does not know it.
|
|
400
|
+
*/
|
|
401
|
+
interface AgUiChatStreamOptions {
|
|
402
|
+
/** The producer's endpoint (`POST`, `RunAgentInput` in, `text/event-stream` out). */
|
|
403
|
+
url: string;
|
|
404
|
+
/** Headers for every request (auth, CSRF). Per-request headers from the send win. */
|
|
405
|
+
headers?: Record<string, string>;
|
|
406
|
+
/** Defaults to the global `fetch`, with `credentials: 'same-origin'`. */
|
|
407
|
+
fetch?: typeof fetch;
|
|
408
|
+
/**
|
|
409
|
+
* Shape `forwardedProps` from the send's body. Default: `{ pageContext, agent, model }` from the
|
|
410
|
+
* body, whichever are present.
|
|
411
|
+
*/
|
|
412
|
+
forwardedProps?: (body: Record<string, unknown>) => unknown;
|
|
413
|
+
/** Read the refusal of a non-2xx answer. Default: the JSON body's `message`, else the status. */
|
|
414
|
+
refusal?: (response: Response) => Promise<Error>;
|
|
415
|
+
/**
|
|
416
|
+
* The user message's `content` for the send. Default: the body's `message` as a string. Return
|
|
417
|
+
* a list of AG-UI content parts to send a file with it — `{ type: 'image' | 'document' | …,
|
|
418
|
+
* source: { type: 'data', value: <base64>, mimeType } }` — and the text as a `text` part.
|
|
419
|
+
*/
|
|
420
|
+
content?: (body: Record<string, unknown>) => string | AgUiContentPart[];
|
|
421
|
+
}
|
|
422
|
+
/** One AG-UI content part of a user message (text, or media by inline data, url or file handle). */
|
|
423
|
+
type AgUiContentPart = {
|
|
424
|
+
type: 'text';
|
|
425
|
+
text: string;
|
|
426
|
+
} | {
|
|
427
|
+
type: 'image' | 'audio' | 'video' | 'document';
|
|
428
|
+
source: {
|
|
429
|
+
type: 'data';
|
|
430
|
+
value: string;
|
|
431
|
+
mimeType: string;
|
|
432
|
+
} | {
|
|
433
|
+
type: 'url';
|
|
434
|
+
value: string;
|
|
435
|
+
mimeType?: string;
|
|
436
|
+
} | {
|
|
437
|
+
type: 'file';
|
|
438
|
+
value: string;
|
|
439
|
+
provider?: string;
|
|
440
|
+
mimeType?: string;
|
|
441
|
+
};
|
|
442
|
+
metadata?: Record<string, unknown>;
|
|
443
|
+
};
|
|
444
|
+
/** Start a turn against an AG-UI producer; the stream comes back in this library's framing. */
|
|
445
|
+
declare function agUiChatStream(request: ChatStreamRequest, options: AgUiChatStreamOptions): Promise<ChatStreamResponse>;
|
|
446
|
+
/**
|
|
447
|
+
* Re-frame an AG-UI event stream (SSE, one event per `data:`) in this library's stream protocol:
|
|
448
|
+
* `event: meta`, numbered `data:` frames of {@link AgentStreamEvent}, then `event: done` or
|
|
449
|
+
* `event: error`. Exported for a backend that fetches the stream itself.
|
|
450
|
+
*/
|
|
451
|
+
declare function reframeAgUiStream(source: ReadableStream<Uint8Array>, ids: {
|
|
452
|
+
threadId: string;
|
|
453
|
+
}): ReadableStream<Uint8Array>;
|
|
454
|
+
|
|
371
455
|
interface AgentProviderProps {
|
|
372
456
|
/**
|
|
373
457
|
* A backend of your own — see {@link AgentBackend}. Omitted → an {@link AgentClient} over this
|
|
@@ -1922,4 +2006,4 @@ declare class QuotaBlockedError extends Error {
|
|
|
1922
2006
|
constructor(block: QuotaBlock);
|
|
1923
2007
|
}
|
|
1924
2008
|
|
|
1925
|
-
export { AGENT_RUN_ERROR_CODES, 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, 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, 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, applyCompletion, approvalCountdown, attachmentFile, backgroundRunsFromThread, createSkillsSource, dragHasFiles, fileKind, filesFromClipboard, filterAutocompleteItems, findActiveTrigger, formatElapsed, isRunNotActiveError, 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 };
|
|
2009
|
+
export { AGENT_RUN_ERROR_CODES, 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, 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, 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,7 +1,7 @@
|
|
|
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, H as HttpErrorListener,
|
|
4
|
-
export {
|
|
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-BuobfZtx.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-BuobfZtx.js';
|
|
5
5
|
import { MessageAttachment, AgentClientConfig, AgentCatalogEntry, ModelCatalogEntry, ModelCatalogView, ModelCatalogLock, QuotaReport, QuotaWindow, QuotaBlock, QuotaWarning, MessageFeedback, MessageFeedbackValue, ThreadSummary, StoredMessage, QueuePause, ToolCatalogEntry } 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';
|
|
@@ -368,6 +368,90 @@ interface ClipboardLikeEvent {
|
|
|
368
368
|
*/
|
|
369
369
|
declare function useAttachments(options?: UseAttachmentsOptions): AttachmentsState;
|
|
370
370
|
|
|
371
|
+
/**
|
|
372
|
+
* Talk to an AG-UI 1.0 producer (https://docs.ag-ui.com/spec/1.0) through `useAgentChat`.
|
|
373
|
+
*
|
|
374
|
+
* `agUiChatStream` POSTs a `RunAgentInput` and hands the transport the answer re-framed in this
|
|
375
|
+
* library's stream protocol, so everything built on `useAgentChat` — the transcript, tool activity,
|
|
376
|
+
* generative UI — renders an AG-UI agent unchanged. Put it behind `openChatStream` of any backend:
|
|
377
|
+
*
|
|
378
|
+
* ```ts
|
|
379
|
+
* const backend: AgentBackend = {
|
|
380
|
+
* ...httpBackend,
|
|
381
|
+
* openChatStream: (request) => agUiChatStream(request, { url: '/agent/ag-ui' }),
|
|
382
|
+
* }
|
|
383
|
+
* ```
|
|
384
|
+
*
|
|
385
|
+
* What maps where (the inverse of the producer in `@adonis-agora/agent/ag-ui`):
|
|
386
|
+
* - `TEXT_MESSAGE_*` → `text`; `REASONING_MESSAGE_*` → `reasoning`; `STEP_*` → `step-start` /
|
|
387
|
+
* `step-finish`;
|
|
388
|
+
* - `TOOL_CALL_START` / `ARGS` / `END` → `tool-input-start` / `-delta` / `-available`;
|
|
389
|
+
* `TOOL_CALL_RESULT` → `tool-output` (or `tool-output-error` / `-denied`, from
|
|
390
|
+
* `metadata['agora.outcome']`);
|
|
391
|
+
* - `ACTIVITY_SNAPSHOT` / `ACTIVITY_DELTA` → a `ui` part named `AgUiActivity`, id
|
|
392
|
+
* `activity:<messageId>`, props `{ activityType, content }` — the whole content each time (the
|
|
393
|
+
* delta's JSON Patch applied here), so a repeat replaces the widget in place;
|
|
394
|
+
* - `RUN_ERROR` → the stream's `event: error`; `RUN_FINISHED` → `event: done` (a cancelled
|
|
395
|
+
* outcome writes `cancelled` first; an interrupt outcome writes a `ui` part named
|
|
396
|
+
* `AgUiInterrupt` carrying the interrupts, for the app to render);
|
|
397
|
+
* - `CUSTOM` events a producer of this family writes (`agora.ui`, `agora.title`, `agora.queue`,
|
|
398
|
+
* `agora.approval-requested` / `-settled`, `agora.run`) → the frames they stand for. Any other
|
|
399
|
+
* `CUSTOM` is ignored, as the protocol requires of a consumer that does not know it.
|
|
400
|
+
*/
|
|
401
|
+
interface AgUiChatStreamOptions {
|
|
402
|
+
/** The producer's endpoint (`POST`, `RunAgentInput` in, `text/event-stream` out). */
|
|
403
|
+
url: string;
|
|
404
|
+
/** Headers for every request (auth, CSRF). Per-request headers from the send win. */
|
|
405
|
+
headers?: Record<string, string>;
|
|
406
|
+
/** Defaults to the global `fetch`, with `credentials: 'same-origin'`. */
|
|
407
|
+
fetch?: typeof fetch;
|
|
408
|
+
/**
|
|
409
|
+
* Shape `forwardedProps` from the send's body. Default: `{ pageContext, agent, model }` from the
|
|
410
|
+
* body, whichever are present.
|
|
411
|
+
*/
|
|
412
|
+
forwardedProps?: (body: Record<string, unknown>) => unknown;
|
|
413
|
+
/** Read the refusal of a non-2xx answer. Default: the JSON body's `message`, else the status. */
|
|
414
|
+
refusal?: (response: Response) => Promise<Error>;
|
|
415
|
+
/**
|
|
416
|
+
* The user message's `content` for the send. Default: the body's `message` as a string. Return
|
|
417
|
+
* a list of AG-UI content parts to send a file with it — `{ type: 'image' | 'document' | …,
|
|
418
|
+
* source: { type: 'data', value: <base64>, mimeType } }` — and the text as a `text` part.
|
|
419
|
+
*/
|
|
420
|
+
content?: (body: Record<string, unknown>) => string | AgUiContentPart[];
|
|
421
|
+
}
|
|
422
|
+
/** One AG-UI content part of a user message (text, or media by inline data, url or file handle). */
|
|
423
|
+
type AgUiContentPart = {
|
|
424
|
+
type: 'text';
|
|
425
|
+
text: string;
|
|
426
|
+
} | {
|
|
427
|
+
type: 'image' | 'audio' | 'video' | 'document';
|
|
428
|
+
source: {
|
|
429
|
+
type: 'data';
|
|
430
|
+
value: string;
|
|
431
|
+
mimeType: string;
|
|
432
|
+
} | {
|
|
433
|
+
type: 'url';
|
|
434
|
+
value: string;
|
|
435
|
+
mimeType?: string;
|
|
436
|
+
} | {
|
|
437
|
+
type: 'file';
|
|
438
|
+
value: string;
|
|
439
|
+
provider?: string;
|
|
440
|
+
mimeType?: string;
|
|
441
|
+
};
|
|
442
|
+
metadata?: Record<string, unknown>;
|
|
443
|
+
};
|
|
444
|
+
/** Start a turn against an AG-UI producer; the stream comes back in this library's framing. */
|
|
445
|
+
declare function agUiChatStream(request: ChatStreamRequest, options: AgUiChatStreamOptions): Promise<ChatStreamResponse>;
|
|
446
|
+
/**
|
|
447
|
+
* Re-frame an AG-UI event stream (SSE, one event per `data:`) in this library's stream protocol:
|
|
448
|
+
* `event: meta`, numbered `data:` frames of {@link AgentStreamEvent}, then `event: done` or
|
|
449
|
+
* `event: error`. Exported for a backend that fetches the stream itself.
|
|
450
|
+
*/
|
|
451
|
+
declare function reframeAgUiStream(source: ReadableStream<Uint8Array>, ids: {
|
|
452
|
+
threadId: string;
|
|
453
|
+
}): ReadableStream<Uint8Array>;
|
|
454
|
+
|
|
371
455
|
interface AgentProviderProps {
|
|
372
456
|
/**
|
|
373
457
|
* A backend of your own — see {@link AgentBackend}. Omitted → an {@link AgentClient} over this
|
|
@@ -1922,4 +2006,4 @@ declare class QuotaBlockedError extends Error {
|
|
|
1922
2006
|
constructor(block: QuotaBlock);
|
|
1923
2007
|
}
|
|
1924
2008
|
|
|
1925
|
-
export { AGENT_RUN_ERROR_CODES, 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, 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, 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, applyCompletion, approvalCountdown, attachmentFile, backgroundRunsFromThread, createSkillsSource, dragHasFiles, fileKind, filesFromClipboard, filterAutocompleteItems, findActiveTrigger, formatElapsed, isRunNotActiveError, 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 };
|
|
2009
|
+
export { AGENT_RUN_ERROR_CODES, 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, 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, useAgentBackend, useAgentChat, useAgentConfig, useAgents, useAmbientRenderUi, useApprovalCountdown, useAttachments, useChatTranscript, useComposerAutocomplete, useElapsed, useMessageFeedback, useModels, useQuota, useSpeechRecognition, useStickToBottom, useThreads, useToolCatalog, useTranscriptItem };
|