@agno-hq/chat-react 0.3.2 → 0.3.4
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 +81 -5
- package/dist/chat/index.cjs +99 -83
- package/dist/chat/index.d.cts +80 -16
- package/dist/chat/index.d.ts +80 -16
- package/dist/chat/index.js +2 -2
- package/dist/{chunk-RE7ZT73K.js → chunk-5QKU7OPE.js} +2 -2
- package/dist/{chunk-RE7ZT73K.js.map → chunk-5QKU7OPE.js.map} +1 -1
- package/dist/{chunk-6V2YIPHF.js → chunk-BCVKAMSO.js} +22 -4
- package/dist/chunk-BCVKAMSO.js.map +1 -0
- package/dist/{chunk-Q73XHL35.cjs → chunk-ESV52ERB.cjs} +771 -444
- package/dist/chunk-ESV52ERB.cjs.map +1 -0
- package/dist/{chunk-2WM3CCFE.cjs → chunk-HBSF434L.cjs} +2 -2
- package/dist/{chunk-2WM3CCFE.cjs.map → chunk-HBSF434L.cjs.map} +1 -1
- package/dist/{chunk-XTP3TMEZ.js → chunk-OGDPK4Z3.js} +602 -279
- package/dist/chunk-OGDPK4Z3.js.map +1 -0
- package/dist/{chunk-55HQJGLP.cjs → chunk-Y34YRC5T.cjs} +22 -3
- package/dist/chunk-Y34YRC5T.cjs.map +1 -0
- package/dist/{client-DUyVqxU9.d.cts → client-Dwk6ThnW.d.cts} +24 -12
- package/dist/{client-DUyVqxU9.d.ts → client-Dwk6ThnW.d.ts} +24 -12
- package/dist/core/index.cjs +23 -23
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +2 -2
- package/dist/index.cjs +122 -106
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/styles.css +79 -34
- package/package.json +1 -1
- package/dist/chunk-55HQJGLP.cjs.map +0 -1
- package/dist/chunk-6V2YIPHF.js.map +0 -1
- package/dist/chunk-Q73XHL35.cjs.map +0 -1
- package/dist/chunk-XTP3TMEZ.js.map +0 -1
package/dist/chat/index.d.cts
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
import { C as ChatMessage, l as RunEventData, e as ChatStatus, g as EntityType,
|
|
1
|
+
import { C as ChatMessage, l as RunEventData, e as ChatStatus, g as EntityType, s as ToolExecution, m as RunRequirement, S as SessionEntry, n as RunResolution, A as AgnoClient, E as Entity, j as ReferenceData, f as Citations$1, R as ReasoningStep, q as SubRun, t as WorkflowStep, I as ImageData, V as VideoData, c as AudioData } from '../client-Dwk6ThnW.cjs';
|
|
2
2
|
import React$1 from 'react';
|
|
3
3
|
import { StreamdownProps } from 'streamdown';
|
|
4
4
|
|
|
5
|
+
interface StreamingOptions {
|
|
6
|
+
/** Buffer plain text updates. Set false for immediate per-event updates. */
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
/** How long text accumulates before a flush, in ms. Zero disables buffering. */
|
|
9
|
+
flushIntervalMs?: number;
|
|
10
|
+
/** Flush when this many original events are pending. */
|
|
11
|
+
maxBufferEvents?: number;
|
|
12
|
+
/** Flush when this many UTF-16 characters are pending. */
|
|
13
|
+
maxBufferChars?: number;
|
|
14
|
+
}
|
|
15
|
+
declare const DEFAULT_STREAMING_OPTIONS: Readonly<Required<StreamingOptions>>;
|
|
16
|
+
|
|
5
17
|
/**
|
|
6
18
|
* useAgnoChat — a headless React hook for running any Agno agent, team or
|
|
7
19
|
* workflow against an AgentOS backend and consuming its streamed output.
|
|
@@ -30,7 +42,9 @@ interface UseAgnoChatOptions {
|
|
|
30
42
|
sessionId?: string;
|
|
31
43
|
/** Pre-seed the transcript (e.g. when restoring a session). */
|
|
32
44
|
initialMessages?: ChatMessage[];
|
|
33
|
-
/**
|
|
45
|
+
/** Plain-text buffering settings, captured when a run or continuation starts. */
|
|
46
|
+
streaming?: StreamingOptions;
|
|
47
|
+
/** Called immediately with every raw run event, for logging/telemetry. */
|
|
34
48
|
onEvent?: (event: RunEventData) => void;
|
|
35
49
|
/** Called when the session id changes (e.g. first run of a new session). */
|
|
36
50
|
onSessionId?: (sessionId: string) => void;
|
|
@@ -76,10 +90,7 @@ interface UseAgnoChat {
|
|
|
76
90
|
/** Stop the active run. */
|
|
77
91
|
cancel: () => Promise<void>;
|
|
78
92
|
/** Continue a paused run with explicitly resolved requirements. */
|
|
79
|
-
continueRun: (resolution:
|
|
80
|
-
tools?: ToolExecution[];
|
|
81
|
-
stepRequirements?: unknown[];
|
|
82
|
-
}) => Promise<void>;
|
|
93
|
+
continueRun: (resolution: RunResolution) => Promise<void>;
|
|
83
94
|
/** Approve or reject all pending tool confirmations, then continue. */
|
|
84
95
|
respondToConfirmation: (approve: boolean) => Promise<void>;
|
|
85
96
|
/** Provide values for pending tool user-input fields, then continue. */
|
|
@@ -148,6 +159,10 @@ interface ChatClassNames {
|
|
|
148
159
|
markdown?: string;
|
|
149
160
|
/** "Working…" line shown while streaming with no content yet. */
|
|
150
161
|
activity?: string;
|
|
162
|
+
/** `<MessageActions>` — the icon row under a finished answer. */
|
|
163
|
+
messageActions?: string;
|
|
164
|
+
/** The copy button in that row. */
|
|
165
|
+
messageCopyButton?: string;
|
|
151
166
|
/** `<ChatInput>` wrapper. */
|
|
152
167
|
input?: string;
|
|
153
168
|
/** Row holding attach / textarea / send. */
|
|
@@ -291,8 +306,12 @@ declare function sourceHost(url?: string): string | undefined;
|
|
|
291
306
|
/**
|
|
292
307
|
* The site's own icon. Same-origin to the site being cited, so no third-party
|
|
293
308
|
* favicon service is involved and nothing is requested until a card renders.
|
|
309
|
+
* `/favicon.ico` by convention; `/favicon.svg` is the next guess, for sites
|
|
310
|
+
* that only declare an SVG icon (see `faviconFallbacks`).
|
|
294
311
|
*/
|
|
295
312
|
declare function faviconUrl(url?: string): string | undefined;
|
|
313
|
+
/** Every same-origin icon path worth trying, in order. Empty for a bad URL. */
|
|
314
|
+
declare function faviconFallbacks(url?: string): string[];
|
|
296
315
|
/** `docs.agno.com/introduction` — the host plus a trimmed path, for card chrome. */
|
|
297
316
|
declare function displayUrl(url?: string): string | undefined;
|
|
298
317
|
/**
|
|
@@ -373,6 +392,8 @@ declare function useSources(): Source[];
|
|
|
373
392
|
* this one entirely.
|
|
374
393
|
*/
|
|
375
394
|
|
|
395
|
+
/** Everything a host may pass straight through to Streamdown. */
|
|
396
|
+
type StreamdownOptions = Omit<StreamdownProps, 'children' | 'className' | 'components'>;
|
|
376
397
|
interface MarkdownProps {
|
|
377
398
|
content: string;
|
|
378
399
|
className?: string;
|
|
@@ -397,8 +418,18 @@ interface MarkdownProps {
|
|
|
397
418
|
*/
|
|
398
419
|
linkComponent?: LinkComponent;
|
|
399
420
|
/** Escape hatch onto Streamdown itself — anything not set here. */
|
|
400
|
-
options?:
|
|
421
|
+
options?: StreamdownOptions;
|
|
401
422
|
}
|
|
423
|
+
declare function Markdown({ content, className, sources, streaming, codeCopy, linkComponent, options }: MarkdownProps): React$1.ReactElement;
|
|
424
|
+
type RenderMarkdown = (content: string) => React$1.ReactNode;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* The copy control — one component wherever something can be copied: the
|
|
428
|
+
* header of a fenced code block, the action row under an answer, a host's own
|
|
429
|
+
* surface. It owns the "copied" flash and the clipboard fallbacks, so every
|
|
430
|
+
* copy affordance in a transcript behaves the same way.
|
|
431
|
+
*/
|
|
432
|
+
|
|
402
433
|
/**
|
|
403
434
|
* Copy text, by whichever route the browser allows.
|
|
404
435
|
*
|
|
@@ -411,8 +442,16 @@ interface MarkdownProps {
|
|
|
411
442
|
* fallbacks, and because the failure paths are worth testing.
|
|
412
443
|
*/
|
|
413
444
|
declare function writeClipboard(text: string): Promise<boolean>;
|
|
414
|
-
|
|
415
|
-
|
|
445
|
+
interface CopyButtonProps {
|
|
446
|
+
/** What to copy — a string, or a function for text that is costly to build. */
|
|
447
|
+
text: string | (() => string);
|
|
448
|
+
/** Accessible name and tooltip. Defaults to "Copy". */
|
|
449
|
+
label?: string;
|
|
450
|
+
/** Icon size, in px. */
|
|
451
|
+
size?: number;
|
|
452
|
+
className?: string;
|
|
453
|
+
}
|
|
454
|
+
declare function CopyButton({ text, label, size, className }: CopyButtonProps): React$1.ReactElement;
|
|
416
455
|
|
|
417
456
|
/**
|
|
418
457
|
* `<ChatProvider>` runs a chat and shares it with everything below it, so the
|
|
@@ -597,6 +636,8 @@ interface AgnoChatProps {
|
|
|
597
636
|
client?: AgnoClient;
|
|
598
637
|
headers?: Record<string, string>;
|
|
599
638
|
userId?: string;
|
|
639
|
+
/** Override the default bounded plain-text buffering. */
|
|
640
|
+
streaming?: StreamingOptions;
|
|
600
641
|
/**
|
|
601
642
|
* The selected agent/team/workflow. Pass it to own the selection — the embed
|
|
602
643
|
* then only displays it, the way AgentOS drives the chat from its breadcrumb.
|
|
@@ -778,6 +819,10 @@ interface MessageProps {
|
|
|
778
819
|
hideTools?: boolean;
|
|
779
820
|
/** Hide the sources block under the answer. */
|
|
780
821
|
hideSources?: boolean;
|
|
822
|
+
/** Hide the action row (copy, and whatever `actions` adds) under the answer. */
|
|
823
|
+
hideActions?: boolean;
|
|
824
|
+
/** More actions for the row, after copy — regenerate, feedback, and so on. */
|
|
825
|
+
actions?: React$1.ReactNode;
|
|
781
826
|
/**
|
|
782
827
|
* Render the "Related questions" the agent suggested under this message,
|
|
783
828
|
* sending the clicked one here. Off by default: `<ChatWindow>` pins them
|
|
@@ -791,7 +836,26 @@ interface MessageProps {
|
|
|
791
836
|
className?: string;
|
|
792
837
|
classNames?: ChatClassNames;
|
|
793
838
|
}
|
|
794
|
-
declare function Message({ message, renderMarkdown, activity, avatar, children, className, classNames, entityType, userInitials, hideReasoning, hideTools, hideSources, onFollowup, }: MessageProps): React$1.ReactElement;
|
|
839
|
+
declare function Message({ message, renderMarkdown, activity, avatar, children, className, classNames, entityType, userInitials, hideReasoning, hideTools, hideSources, hideActions, actions, onFollowup, }: MessageProps): React$1.ReactElement;
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* The action row under a finished answer — the Figma `_Chat messages/Actions`
|
|
843
|
+
* strip: small icon buttons in a line, copy first. The package ships copy;
|
|
844
|
+
* anything a product adds (regenerate, feedback, "view JSON") goes in as
|
|
845
|
+
* children and lines up with it.
|
|
846
|
+
*/
|
|
847
|
+
|
|
848
|
+
interface MessageActionsProps {
|
|
849
|
+
/** The message the actions apply to; copy takes its content. */
|
|
850
|
+
message: ChatMessage;
|
|
851
|
+
/** Leave the copy button out (a host that copies differently). */
|
|
852
|
+
hideCopy?: boolean;
|
|
853
|
+
/** More actions, rendered after copy. */
|
|
854
|
+
children?: React$1.ReactNode;
|
|
855
|
+
className?: string;
|
|
856
|
+
classNames?: ChatClassNames;
|
|
857
|
+
}
|
|
858
|
+
declare function MessageActions({ message, hideCopy, children, className, classNames, }: MessageActionsProps): React$1.ReactElement | null;
|
|
795
859
|
|
|
796
860
|
/**
|
|
797
861
|
* The AgentOS chat dock: a rounded card holding an auto-growing textarea and a
|
|
@@ -1106,7 +1170,10 @@ declare function useLinkPreview(url: string | undefined, enabled: boolean): {
|
|
|
1106
1170
|
preview: LinkPreview | null;
|
|
1107
1171
|
loading: boolean;
|
|
1108
1172
|
};
|
|
1109
|
-
/**
|
|
1173
|
+
/**
|
|
1174
|
+
* The site's icon: `/favicon.ico`, then `/favicon.svg`, then a glyph when the
|
|
1175
|
+
* origin serves neither.
|
|
1176
|
+
*/
|
|
1110
1177
|
declare function Favicon({ url, kind, size, className, }: {
|
|
1111
1178
|
url?: string;
|
|
1112
1179
|
kind?: Source['kind'];
|
|
@@ -1183,10 +1250,7 @@ interface HumanInputProps {
|
|
|
1183
1250
|
entityType?: EntityType;
|
|
1184
1251
|
busy?: boolean;
|
|
1185
1252
|
/** Continue the run with the resolved tools (agent/team) or step requirements (workflow). */
|
|
1186
|
-
onResolve: (resolution:
|
|
1187
|
-
tools?: ToolExecution[];
|
|
1188
|
-
stepRequirements?: unknown[];
|
|
1189
|
-
}) => void;
|
|
1253
|
+
onResolve: (resolution: RunResolution) => void;
|
|
1190
1254
|
className?: string;
|
|
1191
1255
|
}
|
|
1192
1256
|
declare function HumanInput({ message, entityType, busy, onResolve, className, }: HumanInputProps): React$1.ReactElement | null;
|
|
@@ -1335,4 +1399,4 @@ declare function GridLoader({ className }: {
|
|
|
1335
1399
|
className?: string;
|
|
1336
1400
|
}): React$1.ReactElement;
|
|
1337
1401
|
|
|
1338
|
-
export { AgnoChat, type AgnoChatProps, AgnoMark, ArrowUp, BehindTheScenes, type BehindTheScenesProps, BookOpen, Box, Brain, ChatBubble, type ChatClassNames, type ChatContextValue, ChatInput, type ChatInputProps, ChatLauncher, type ChatLauncherProps, ChatProvider, type ChatProviderProps, type ChatTextareaProps, ChatWindow, type ChatWindowProps, Check, ChevronDown, Citations, type CitationsProps, Close, Copy, EntityBadge, type EntityBadgeProps, EntitySelector, EventLog, Favicon, FileAudio, FileIcon, type FileLimits, FilePreview, type FilePreviewProps, FileType, FileVideo, Followups, type FollowupsProps, Globe, GridLoader, HoverPreview, type HoverPreviewProps, HumanInput, type HumanInputProps, type LauncherPanel, type LauncherPosition, type LinkComponent, LinkIcon, type LinkPreview, LinkPreviewCard, type LinkPreviewCardProps, Markdown, type MarkdownProps, MemberResponses, Memory, Message, MessageList, type MessageListProps, type MessageProps, Multimedia, Paperclip, Plus, Pulse, type QuickPrompt, QuickPrompts, type QuickPromptsProps, Reasoning, type RenderMarkdown, Rerun, type ResolveLinkPreview, type SendOptions, SessionList, type SessionListProps, type Source, SourceCard, SourcesProvider, Spinner, StatusIndicator, Stop, TeamGlyph, ToolCalls, Trash, type UseAgnoChat, type UseAgnoChatOptions, WorkflowSteps, Wrench, admitFiles, behindTheScenesItems, behindTheScenesLabel, collectSources, displayUrl, faviconUrl, fileAccepted, getProviderIcon, hasBehindTheScenes, linkCitations, normalizeFollowups, quickPromptLabel, quickPromptText, sourceHost, sourcesFromMarkdown, useAgnoChat, useChatContext, useLinkComponent, useLinkPreview, useOptionalChatContext, useResolvedChat, useResolvedClassNames, useSources, withoutSourcesLine, writeClipboard };
|
|
1402
|
+
export { AgnoChat, type AgnoChatProps, AgnoMark, ArrowUp, BehindTheScenes, type BehindTheScenesProps, BookOpen, Box, Brain, ChatBubble, type ChatClassNames, type ChatContextValue, ChatInput, type ChatInputProps, ChatLauncher, type ChatLauncherProps, ChatProvider, type ChatProviderProps, type ChatTextareaProps, ChatWindow, type ChatWindowProps, Check, ChevronDown, Citations, type CitationsProps, Close, Copy, CopyButton, type CopyButtonProps, DEFAULT_STREAMING_OPTIONS, EntityBadge, type EntityBadgeProps, EntitySelector, EventLog, Favicon, FileAudio, FileIcon, type FileLimits, FilePreview, type FilePreviewProps, FileType, FileVideo, Followups, type FollowupsProps, Globe, GridLoader, HoverPreview, type HoverPreviewProps, HumanInput, type HumanInputProps, type LauncherPanel, type LauncherPosition, type LinkComponent, LinkIcon, type LinkPreview, LinkPreviewCard, type LinkPreviewCardProps, Markdown, type MarkdownProps, MemberResponses, Memory, Message, MessageActions, type MessageActionsProps, MessageList, type MessageListProps, type MessageProps, Multimedia, Paperclip, Plus, Pulse, type QuickPrompt, QuickPrompts, type QuickPromptsProps, Reasoning, type RenderMarkdown, Rerun, type ResolveLinkPreview, type SendOptions, SessionList, type SessionListProps, type Source, SourceCard, SourcesProvider, Spinner, StatusIndicator, Stop, type StreamingOptions, TeamGlyph, ToolCalls, Trash, type UseAgnoChat, type UseAgnoChatOptions, WorkflowSteps, Wrench, admitFiles, behindTheScenesItems, behindTheScenesLabel, collectSources, displayUrl, faviconFallbacks, faviconUrl, fileAccepted, getProviderIcon, hasBehindTheScenes, linkCitations, normalizeFollowups, quickPromptLabel, quickPromptText, sourceHost, sourcesFromMarkdown, useAgnoChat, useChatContext, useLinkComponent, useLinkPreview, useOptionalChatContext, useResolvedChat, useResolvedClassNames, useSources, withoutSourcesLine, writeClipboard };
|
package/dist/chat/index.d.ts
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
import { C as ChatMessage, l as RunEventData, e as ChatStatus, g as EntityType,
|
|
1
|
+
import { C as ChatMessage, l as RunEventData, e as ChatStatus, g as EntityType, s as ToolExecution, m as RunRequirement, S as SessionEntry, n as RunResolution, A as AgnoClient, E as Entity, j as ReferenceData, f as Citations$1, R as ReasoningStep, q as SubRun, t as WorkflowStep, I as ImageData, V as VideoData, c as AudioData } from '../client-Dwk6ThnW.js';
|
|
2
2
|
import React$1 from 'react';
|
|
3
3
|
import { StreamdownProps } from 'streamdown';
|
|
4
4
|
|
|
5
|
+
interface StreamingOptions {
|
|
6
|
+
/** Buffer plain text updates. Set false for immediate per-event updates. */
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
/** How long text accumulates before a flush, in ms. Zero disables buffering. */
|
|
9
|
+
flushIntervalMs?: number;
|
|
10
|
+
/** Flush when this many original events are pending. */
|
|
11
|
+
maxBufferEvents?: number;
|
|
12
|
+
/** Flush when this many UTF-16 characters are pending. */
|
|
13
|
+
maxBufferChars?: number;
|
|
14
|
+
}
|
|
15
|
+
declare const DEFAULT_STREAMING_OPTIONS: Readonly<Required<StreamingOptions>>;
|
|
16
|
+
|
|
5
17
|
/**
|
|
6
18
|
* useAgnoChat — a headless React hook for running any Agno agent, team or
|
|
7
19
|
* workflow against an AgentOS backend and consuming its streamed output.
|
|
@@ -30,7 +42,9 @@ interface UseAgnoChatOptions {
|
|
|
30
42
|
sessionId?: string;
|
|
31
43
|
/** Pre-seed the transcript (e.g. when restoring a session). */
|
|
32
44
|
initialMessages?: ChatMessage[];
|
|
33
|
-
/**
|
|
45
|
+
/** Plain-text buffering settings, captured when a run or continuation starts. */
|
|
46
|
+
streaming?: StreamingOptions;
|
|
47
|
+
/** Called immediately with every raw run event, for logging/telemetry. */
|
|
34
48
|
onEvent?: (event: RunEventData) => void;
|
|
35
49
|
/** Called when the session id changes (e.g. first run of a new session). */
|
|
36
50
|
onSessionId?: (sessionId: string) => void;
|
|
@@ -76,10 +90,7 @@ interface UseAgnoChat {
|
|
|
76
90
|
/** Stop the active run. */
|
|
77
91
|
cancel: () => Promise<void>;
|
|
78
92
|
/** Continue a paused run with explicitly resolved requirements. */
|
|
79
|
-
continueRun: (resolution:
|
|
80
|
-
tools?: ToolExecution[];
|
|
81
|
-
stepRequirements?: unknown[];
|
|
82
|
-
}) => Promise<void>;
|
|
93
|
+
continueRun: (resolution: RunResolution) => Promise<void>;
|
|
83
94
|
/** Approve or reject all pending tool confirmations, then continue. */
|
|
84
95
|
respondToConfirmation: (approve: boolean) => Promise<void>;
|
|
85
96
|
/** Provide values for pending tool user-input fields, then continue. */
|
|
@@ -148,6 +159,10 @@ interface ChatClassNames {
|
|
|
148
159
|
markdown?: string;
|
|
149
160
|
/** "Working…" line shown while streaming with no content yet. */
|
|
150
161
|
activity?: string;
|
|
162
|
+
/** `<MessageActions>` — the icon row under a finished answer. */
|
|
163
|
+
messageActions?: string;
|
|
164
|
+
/** The copy button in that row. */
|
|
165
|
+
messageCopyButton?: string;
|
|
151
166
|
/** `<ChatInput>` wrapper. */
|
|
152
167
|
input?: string;
|
|
153
168
|
/** Row holding attach / textarea / send. */
|
|
@@ -291,8 +306,12 @@ declare function sourceHost(url?: string): string | undefined;
|
|
|
291
306
|
/**
|
|
292
307
|
* The site's own icon. Same-origin to the site being cited, so no third-party
|
|
293
308
|
* favicon service is involved and nothing is requested until a card renders.
|
|
309
|
+
* `/favicon.ico` by convention; `/favicon.svg` is the next guess, for sites
|
|
310
|
+
* that only declare an SVG icon (see `faviconFallbacks`).
|
|
294
311
|
*/
|
|
295
312
|
declare function faviconUrl(url?: string): string | undefined;
|
|
313
|
+
/** Every same-origin icon path worth trying, in order. Empty for a bad URL. */
|
|
314
|
+
declare function faviconFallbacks(url?: string): string[];
|
|
296
315
|
/** `docs.agno.com/introduction` — the host plus a trimmed path, for card chrome. */
|
|
297
316
|
declare function displayUrl(url?: string): string | undefined;
|
|
298
317
|
/**
|
|
@@ -373,6 +392,8 @@ declare function useSources(): Source[];
|
|
|
373
392
|
* this one entirely.
|
|
374
393
|
*/
|
|
375
394
|
|
|
395
|
+
/** Everything a host may pass straight through to Streamdown. */
|
|
396
|
+
type StreamdownOptions = Omit<StreamdownProps, 'children' | 'className' | 'components'>;
|
|
376
397
|
interface MarkdownProps {
|
|
377
398
|
content: string;
|
|
378
399
|
className?: string;
|
|
@@ -397,8 +418,18 @@ interface MarkdownProps {
|
|
|
397
418
|
*/
|
|
398
419
|
linkComponent?: LinkComponent;
|
|
399
420
|
/** Escape hatch onto Streamdown itself — anything not set here. */
|
|
400
|
-
options?:
|
|
421
|
+
options?: StreamdownOptions;
|
|
401
422
|
}
|
|
423
|
+
declare function Markdown({ content, className, sources, streaming, codeCopy, linkComponent, options }: MarkdownProps): React$1.ReactElement;
|
|
424
|
+
type RenderMarkdown = (content: string) => React$1.ReactNode;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* The copy control — one component wherever something can be copied: the
|
|
428
|
+
* header of a fenced code block, the action row under an answer, a host's own
|
|
429
|
+
* surface. It owns the "copied" flash and the clipboard fallbacks, so every
|
|
430
|
+
* copy affordance in a transcript behaves the same way.
|
|
431
|
+
*/
|
|
432
|
+
|
|
402
433
|
/**
|
|
403
434
|
* Copy text, by whichever route the browser allows.
|
|
404
435
|
*
|
|
@@ -411,8 +442,16 @@ interface MarkdownProps {
|
|
|
411
442
|
* fallbacks, and because the failure paths are worth testing.
|
|
412
443
|
*/
|
|
413
444
|
declare function writeClipboard(text: string): Promise<boolean>;
|
|
414
|
-
|
|
415
|
-
|
|
445
|
+
interface CopyButtonProps {
|
|
446
|
+
/** What to copy — a string, or a function for text that is costly to build. */
|
|
447
|
+
text: string | (() => string);
|
|
448
|
+
/** Accessible name and tooltip. Defaults to "Copy". */
|
|
449
|
+
label?: string;
|
|
450
|
+
/** Icon size, in px. */
|
|
451
|
+
size?: number;
|
|
452
|
+
className?: string;
|
|
453
|
+
}
|
|
454
|
+
declare function CopyButton({ text, label, size, className }: CopyButtonProps): React$1.ReactElement;
|
|
416
455
|
|
|
417
456
|
/**
|
|
418
457
|
* `<ChatProvider>` runs a chat and shares it with everything below it, so the
|
|
@@ -597,6 +636,8 @@ interface AgnoChatProps {
|
|
|
597
636
|
client?: AgnoClient;
|
|
598
637
|
headers?: Record<string, string>;
|
|
599
638
|
userId?: string;
|
|
639
|
+
/** Override the default bounded plain-text buffering. */
|
|
640
|
+
streaming?: StreamingOptions;
|
|
600
641
|
/**
|
|
601
642
|
* The selected agent/team/workflow. Pass it to own the selection — the embed
|
|
602
643
|
* then only displays it, the way AgentOS drives the chat from its breadcrumb.
|
|
@@ -778,6 +819,10 @@ interface MessageProps {
|
|
|
778
819
|
hideTools?: boolean;
|
|
779
820
|
/** Hide the sources block under the answer. */
|
|
780
821
|
hideSources?: boolean;
|
|
822
|
+
/** Hide the action row (copy, and whatever `actions` adds) under the answer. */
|
|
823
|
+
hideActions?: boolean;
|
|
824
|
+
/** More actions for the row, after copy — regenerate, feedback, and so on. */
|
|
825
|
+
actions?: React$1.ReactNode;
|
|
781
826
|
/**
|
|
782
827
|
* Render the "Related questions" the agent suggested under this message,
|
|
783
828
|
* sending the clicked one here. Off by default: `<ChatWindow>` pins them
|
|
@@ -791,7 +836,26 @@ interface MessageProps {
|
|
|
791
836
|
className?: string;
|
|
792
837
|
classNames?: ChatClassNames;
|
|
793
838
|
}
|
|
794
|
-
declare function Message({ message, renderMarkdown, activity, avatar, children, className, classNames, entityType, userInitials, hideReasoning, hideTools, hideSources, onFollowup, }: MessageProps): React$1.ReactElement;
|
|
839
|
+
declare function Message({ message, renderMarkdown, activity, avatar, children, className, classNames, entityType, userInitials, hideReasoning, hideTools, hideSources, hideActions, actions, onFollowup, }: MessageProps): React$1.ReactElement;
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* The action row under a finished answer — the Figma `_Chat messages/Actions`
|
|
843
|
+
* strip: small icon buttons in a line, copy first. The package ships copy;
|
|
844
|
+
* anything a product adds (regenerate, feedback, "view JSON") goes in as
|
|
845
|
+
* children and lines up with it.
|
|
846
|
+
*/
|
|
847
|
+
|
|
848
|
+
interface MessageActionsProps {
|
|
849
|
+
/** The message the actions apply to; copy takes its content. */
|
|
850
|
+
message: ChatMessage;
|
|
851
|
+
/** Leave the copy button out (a host that copies differently). */
|
|
852
|
+
hideCopy?: boolean;
|
|
853
|
+
/** More actions, rendered after copy. */
|
|
854
|
+
children?: React$1.ReactNode;
|
|
855
|
+
className?: string;
|
|
856
|
+
classNames?: ChatClassNames;
|
|
857
|
+
}
|
|
858
|
+
declare function MessageActions({ message, hideCopy, children, className, classNames, }: MessageActionsProps): React$1.ReactElement | null;
|
|
795
859
|
|
|
796
860
|
/**
|
|
797
861
|
* The AgentOS chat dock: a rounded card holding an auto-growing textarea and a
|
|
@@ -1106,7 +1170,10 @@ declare function useLinkPreview(url: string | undefined, enabled: boolean): {
|
|
|
1106
1170
|
preview: LinkPreview | null;
|
|
1107
1171
|
loading: boolean;
|
|
1108
1172
|
};
|
|
1109
|
-
/**
|
|
1173
|
+
/**
|
|
1174
|
+
* The site's icon: `/favicon.ico`, then `/favicon.svg`, then a glyph when the
|
|
1175
|
+
* origin serves neither.
|
|
1176
|
+
*/
|
|
1110
1177
|
declare function Favicon({ url, kind, size, className, }: {
|
|
1111
1178
|
url?: string;
|
|
1112
1179
|
kind?: Source['kind'];
|
|
@@ -1183,10 +1250,7 @@ interface HumanInputProps {
|
|
|
1183
1250
|
entityType?: EntityType;
|
|
1184
1251
|
busy?: boolean;
|
|
1185
1252
|
/** Continue the run with the resolved tools (agent/team) or step requirements (workflow). */
|
|
1186
|
-
onResolve: (resolution:
|
|
1187
|
-
tools?: ToolExecution[];
|
|
1188
|
-
stepRequirements?: unknown[];
|
|
1189
|
-
}) => void;
|
|
1253
|
+
onResolve: (resolution: RunResolution) => void;
|
|
1190
1254
|
className?: string;
|
|
1191
1255
|
}
|
|
1192
1256
|
declare function HumanInput({ message, entityType, busy, onResolve, className, }: HumanInputProps): React$1.ReactElement | null;
|
|
@@ -1335,4 +1399,4 @@ declare function GridLoader({ className }: {
|
|
|
1335
1399
|
className?: string;
|
|
1336
1400
|
}): React$1.ReactElement;
|
|
1337
1401
|
|
|
1338
|
-
export { AgnoChat, type AgnoChatProps, AgnoMark, ArrowUp, BehindTheScenes, type BehindTheScenesProps, BookOpen, Box, Brain, ChatBubble, type ChatClassNames, type ChatContextValue, ChatInput, type ChatInputProps, ChatLauncher, type ChatLauncherProps, ChatProvider, type ChatProviderProps, type ChatTextareaProps, ChatWindow, type ChatWindowProps, Check, ChevronDown, Citations, type CitationsProps, Close, Copy, EntityBadge, type EntityBadgeProps, EntitySelector, EventLog, Favicon, FileAudio, FileIcon, type FileLimits, FilePreview, type FilePreviewProps, FileType, FileVideo, Followups, type FollowupsProps, Globe, GridLoader, HoverPreview, type HoverPreviewProps, HumanInput, type HumanInputProps, type LauncherPanel, type LauncherPosition, type LinkComponent, LinkIcon, type LinkPreview, LinkPreviewCard, type LinkPreviewCardProps, Markdown, type MarkdownProps, MemberResponses, Memory, Message, MessageList, type MessageListProps, type MessageProps, Multimedia, Paperclip, Plus, Pulse, type QuickPrompt, QuickPrompts, type QuickPromptsProps, Reasoning, type RenderMarkdown, Rerun, type ResolveLinkPreview, type SendOptions, SessionList, type SessionListProps, type Source, SourceCard, SourcesProvider, Spinner, StatusIndicator, Stop, TeamGlyph, ToolCalls, Trash, type UseAgnoChat, type UseAgnoChatOptions, WorkflowSteps, Wrench, admitFiles, behindTheScenesItems, behindTheScenesLabel, collectSources, displayUrl, faviconUrl, fileAccepted, getProviderIcon, hasBehindTheScenes, linkCitations, normalizeFollowups, quickPromptLabel, quickPromptText, sourceHost, sourcesFromMarkdown, useAgnoChat, useChatContext, useLinkComponent, useLinkPreview, useOptionalChatContext, useResolvedChat, useResolvedClassNames, useSources, withoutSourcesLine, writeClipboard };
|
|
1402
|
+
export { AgnoChat, type AgnoChatProps, AgnoMark, ArrowUp, BehindTheScenes, type BehindTheScenesProps, BookOpen, Box, Brain, ChatBubble, type ChatClassNames, type ChatContextValue, ChatInput, type ChatInputProps, ChatLauncher, type ChatLauncherProps, ChatProvider, type ChatProviderProps, type ChatTextareaProps, ChatWindow, type ChatWindowProps, Check, ChevronDown, Citations, type CitationsProps, Close, Copy, CopyButton, type CopyButtonProps, DEFAULT_STREAMING_OPTIONS, EntityBadge, type EntityBadgeProps, EntitySelector, EventLog, Favicon, FileAudio, FileIcon, type FileLimits, FilePreview, type FilePreviewProps, FileType, FileVideo, Followups, type FollowupsProps, Globe, GridLoader, HoverPreview, type HoverPreviewProps, HumanInput, type HumanInputProps, type LauncherPanel, type LauncherPosition, type LinkComponent, LinkIcon, type LinkPreview, LinkPreviewCard, type LinkPreviewCardProps, Markdown, type MarkdownProps, MemberResponses, Memory, Message, MessageActions, type MessageActionsProps, MessageList, type MessageListProps, type MessageProps, Multimedia, Paperclip, Plus, Pulse, type QuickPrompt, QuickPrompts, type QuickPromptsProps, Reasoning, type RenderMarkdown, Rerun, type ResolveLinkPreview, type SendOptions, SessionList, type SessionListProps, type Source, SourceCard, SourcesProvider, Spinner, StatusIndicator, Stop, type StreamingOptions, TeamGlyph, ToolCalls, Trash, type UseAgnoChat, type UseAgnoChatOptions, WorkflowSteps, Wrench, admitFiles, behindTheScenesItems, behindTheScenesLabel, collectSources, displayUrl, faviconFallbacks, faviconUrl, fileAccepted, getProviderIcon, hasBehindTheScenes, linkCitations, normalizeFollowups, quickPromptLabel, quickPromptText, sourceHost, sourcesFromMarkdown, useAgnoChat, useChatContext, useLinkComponent, useLinkPreview, useOptionalChatContext, useResolvedChat, useResolvedClassNames, useSources, withoutSourcesLine, writeClipboard };
|
package/dist/chat/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { AgnoChat, AgnoMark, ArrowUp, BehindTheScenes, BookOpen, Box, Brain, ChatBubble, ChatInput, ChatLauncher, ChatProvider, ChatWindow, Check, ChevronDown, Citations, Close, Copy, EntityBadge, EntitySelector, EventLog, Favicon, FileAudio, FileIcon, FilePreview, FileType, FileVideo, Followups, Globe, GridLoader, HoverPreview, HumanInput, LinkIcon, LinkPreviewCard, Markdown, MemberResponses, Memory, Message, MessageList, Multimedia, Paperclip, Plus, Pulse, QuickPrompts, Reasoning, Rerun, SessionList, SourceCard, SourcesProvider, Spinner, StatusIndicator, Stop, TeamGlyph, ToolCalls, Trash, WorkflowSteps, Wrench, admitFiles, behindTheScenesItems, behindTheScenesLabel, collectSources, displayUrl, faviconUrl, fileAccepted, getProviderIcon, hasBehindTheScenes, linkCitations, normalizeFollowups, quickPromptLabel, quickPromptText, sourceHost, sourcesFromMarkdown, useAgnoChat, useChatContext, useLinkComponent, useLinkPreview, useOptionalChatContext, useResolvedChat, useResolvedClassNames, useSources, withoutSourcesLine, writeClipboard } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
2
|
+
export { AgnoChat, AgnoMark, ArrowUp, BehindTheScenes, BookOpen, Box, Brain, ChatBubble, ChatInput, ChatLauncher, ChatProvider, ChatWindow, Check, ChevronDown, Citations, Close, Copy, CopyButton, DEFAULT_STREAMING_OPTIONS, EntityBadge, EntitySelector, EventLog, Favicon, FileAudio, FileIcon, FilePreview, FileType, FileVideo, Followups, Globe, GridLoader, HoverPreview, HumanInput, LinkIcon, LinkPreviewCard, Markdown, MemberResponses, Memory, Message, MessageActions, MessageList, Multimedia, Paperclip, Plus, Pulse, QuickPrompts, Reasoning, Rerun, SessionList, SourceCard, SourcesProvider, Spinner, StatusIndicator, Stop, TeamGlyph, ToolCalls, Trash, WorkflowSteps, Wrench, admitFiles, behindTheScenesItems, behindTheScenesLabel, collectSources, displayUrl, faviconFallbacks, faviconUrl, fileAccepted, getProviderIcon, hasBehindTheScenes, linkCitations, normalizeFollowups, quickPromptLabel, quickPromptText, sourceHost, sourcesFromMarkdown, useAgnoChat, useChatContext, useLinkComponent, useLinkPreview, useOptionalChatContext, useResolvedChat, useResolvedClassNames, useSources, withoutSourcesLine, writeClipboard } from '../chunk-OGDPK4Z3.js';
|
|
3
|
+
import '../chunk-BCVKAMSO.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -98,5 +98,5 @@ var WorkflowRunEvent = /* @__PURE__ */ ((WorkflowRunEvent2) => {
|
|
|
98
98
|
})(WorkflowRunEvent || {});
|
|
99
99
|
|
|
100
100
|
export { RunEvent, TeamRunEvent, WorkflowRunEvent };
|
|
101
|
-
//# sourceMappingURL=chunk-
|
|
102
|
-
//# sourceMappingURL=chunk-
|
|
101
|
+
//# sourceMappingURL=chunk-5QKU7OPE.js.map
|
|
102
|
+
//# sourceMappingURL=chunk-5QKU7OPE.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/types.ts"],"names":["RunEvent","TeamRunEvent","WorkflowRunEvent"],"mappings":";AAYO,IAAK,QAAA,qBAAAA,SAAAA,KAAL;AACL,EAAAA,UAAA,YAAA,CAAA,GAAa,YAAA;AACb,EAAAA,UAAA,YAAA,CAAA,GAAa,YAAA;AACb,EAAAA,UAAA,qBAAA,CAAA,GAAsB,qBAAA;AACtB,EAAAA,UAAA,wBAAA,CAAA,GAAyB,wBAAA;AACzB,EAAAA,UAAA,cAAA,CAAA,GAAe,cAAA;AACf,EAAAA,UAAA,UAAA,CAAA,GAAW,UAAA;AACX,EAAAA,UAAA,cAAA,CAAA,GAAe,cAAA;AACf,EAAAA,UAAA,WAAA,CAAA,GAAY,WAAA;AACZ,EAAAA,UAAA,cAAA,CAAA,GAAe,cAAA;AAEf,EAAAA,UAAA,gBAAA,CAAA,GAAiB,gBAAA;AACjB,EAAAA,UAAA,kBAAA,CAAA,GAAmB,kBAAA;AACnB,EAAAA,UAAA,iBAAA,CAAA,GAAkB,iBAAA;AAClB,EAAAA,UAAA,mBAAA,CAAA,GAAoB,mBAAA;AAEpB,EAAAA,UAAA,iBAAA,CAAA,GAAkB,iBAAA;AAClB,EAAAA,UAAA,mBAAA,CAAA,GAAoB,mBAAA;AACpB,EAAAA,UAAA,eAAA,CAAA,GAAgB,eA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ZT73K.js","sourcesContent":["/**\n * Types for AgentOS run events, messages, and entities.\n *\n * These mirror the wire format emitted by Agno's AgentOS when streaming a run\n * for an agent, team, or workflow. Field names match the JSON sent on the wire.\n */\n\n/* ------------------------------------------------------------------ */\n/* Run event names */\n/* ------------------------------------------------------------------ */\n\n/** Agent run event names. */\nexport enum RunEvent {\n RunStarted = 'RunStarted',\n RunContent = 'RunContent',\n RunContentCompleted = 'RunContentCompleted',\n RunIntermediateContent = 'RunIntermediateContent',\n RunCompleted = 'RunCompleted',\n RunError = 'RunError',\n RunCancelled = 'RunCancelled',\n RunPaused = 'RunPaused',\n RunContinued = 'RunContinued',\n\n PreHookStarted = 'PreHookStarted',\n PreHookCompleted = 'PreHookCompleted',\n PostHookStarted = 'PostHookStarted',\n PostHookCompleted = 'PostHookCompleted',\n\n ToolCallStarted = 'ToolCallStarted',\n ToolCallCompleted = 'ToolCallCompleted',\n ToolCallError = 'ToolCallError',\n\n ReasoningStarted = 'ReasoningStarted',\n ReasoningStep = 'ReasoningStep',\n ReasoningContentDelta = 'ReasoningContentDelta',\n ReasoningCompleted = 'ReasoningCompleted',\n\n MemoryUpdateStarted = 'MemoryUpdateStarted',\n MemoryUpdateCompleted = 'MemoryUpdateCompleted',\n\n SessionSummaryStarted = 'SessionSummaryStarted',\n SessionSummaryCompleted = 'SessionSummaryCompleted',\n\n ParserModelResponseStarted = 'ParserModelResponseStarted',\n ParserModelResponseCompleted = 'ParserModelResponseCompleted',\n OutputModelResponseStarted = 'OutputModelResponseStarted',\n OutputModelResponseCompleted = 'OutputModelResponseCompleted',\n\n ModelRequestStarted = 'ModelRequestStarted',\n ModelRequestCompleted = 'ModelRequestCompleted',\n\n CompressionStarted = 'CompressionStarted',\n CompressionCompleted = 'CompressionCompleted',\n\n FollowupsStarted = 'FollowupsStarted',\n FollowupsCompleted = 'FollowupsCompleted',\n\n CustomEvent = 'CustomEvent',\n}\n\n/** Team run event names. */\nexport enum TeamRunEvent {\n TeamRunStarted = 'TeamRunStarted',\n TeamRunContent = 'TeamRunContent',\n TeamRunIntermediateContent = 'TeamRunIntermediateContent',\n TeamRunContentCompleted = 'TeamRunContentCompleted',\n TeamRunCompleted = 'TeamRunCompleted',\n TeamRunError = 'TeamRunError',\n TeamRunCancelled = 'TeamRunCancelled',\n TeamRunPaused = 'TeamRunPaused',\n TeamRunContinued = 'TeamRunContinued',\n\n TeamToolCallStarted = 'TeamToolCallStarted',\n TeamToolCallCompleted = 'TeamToolCallCompleted',\n TeamToolCallError = 'TeamToolCallError',\n\n TeamReasoningStarted = 'TeamReasoningStarted',\n TeamReasoningStep = 'TeamReasoningStep',\n TeamReasoningContentDelta = 'TeamReasoningContentDelta',\n TeamReasoningCompleted = 'TeamReasoningCompleted',\n\n TeamMemoryUpdateStarted = 'TeamMemoryUpdateStarted',\n TeamMemoryUpdateCompleted = 'TeamMemoryUpdateCompleted',\n\n TeamFollowupsStarted = 'TeamFollowupsStarted',\n TeamFollowupsCompleted = 'TeamFollowupsCompleted',\n\n TeamTaskIterationStarted = 'TeamTaskIterationStarted',\n TeamTaskIterationCompleted = 'TeamTaskIterationCompleted',\n TeamTaskStateUpdated = 'TeamTaskStateUpdated',\n TeamTaskCreated = 'TeamTaskCreated',\n TeamTaskUpdated = 'TeamTaskUpdated',\n}\n\n/** Workflow run event names. */\nexport enum WorkflowRunEvent {\n WorkflowStarted = 'WorkflowStarted',\n WorkflowCompleted = 'WorkflowCompleted',\n WorkflowPaused = 'WorkflowPaused',\n WorkflowCancelled = 'WorkflowCancelled',\n WorkflowError = 'WorkflowError',\n\n WorkflowAgentStarted = 'WorkflowAgentStarted',\n WorkflowAgentCompleted = 'WorkflowAgentCompleted',\n\n StepStarted = 'StepStarted',\n StepCompleted = 'StepCompleted',\n StepPaused = 'StepPaused',\n StepContinued = 'StepContinued',\n StepError = 'StepError',\n StepOutput = 'StepOutput',\n StepOutputReview = 'StepOutputReview',\n\n LoopExecutionStarted = 'LoopExecutionStarted',\n LoopIterationStarted = 'LoopIterationStarted',\n LoopIterationCompleted = 'LoopIterationCompleted',\n LoopExecutionCompleted = 'LoopExecutionCompleted',\n\n ParallelExecutionStarted = 'ParallelExecutionStarted',\n ParallelExecutionCompleted = 'ParallelExecutionCompleted',\n\n ConditionExecutionStarted = 'ConditionExecutionStarted',\n ConditionExecutionCompleted = 'ConditionExecutionCompleted',\n ConditionPaused = 'ConditionPaused',\n\n RouterExecutionStarted = 'RouterExecutionStarted',\n RouterExecutionCompleted = 'RouterExecutionCompleted',\n RouterPaused = 'RouterPaused',\n\n StepsExecutionStarted = 'StepsExecutionStarted',\n StepsExecutionCompleted = 'StepsExecutionCompleted',\n}\n\n/** Any run event name, across agents, teams and workflows. */\nexport type AnyRunEventName = RunEvent | TeamRunEvent | WorkflowRunEvent | string\n\n/* ------------------------------------------------------------------ */\n/* Tool calls */\n/* ------------------------------------------------------------------ */\n\nexport interface UserInputField {\n name: string\n field_type?: string\n description?: string\n value?: unknown\n}\n\nexport interface ToolExecution {\n tool_call_id?: string\n tool_name?: string\n tool_args?: Record<string, unknown>\n tool_call_error?: boolean\n result?: string\n metrics?: { time?: number }\n created_at?: number\n stop_after_tool_call?: boolean\n\n // Human-in-the-loop\n requires_confirmation?: boolean\n confirmed?: boolean\n confirmation_note?: string\n requires_user_input?: boolean\n user_input_schema?: UserInputField[]\n answered?: boolean\n external_execution_required?: boolean\n\n // present on a few content payloads under the legacy `role`/`content` shape\n role?: string\n content?: string | null\n}\n\n/* ------------------------------------------------------------------ */\n/* Reasoning, references, media */\n/* ------------------------------------------------------------------ */\n\nexport interface ReasoningStep {\n title?: string\n action?: string\n result?: string\n reasoning?: string\n confidence?: number\n next_action?: string\n}\n\nexport interface Reference {\n content: string\n name?: string\n meta_data?: Record<string, unknown>\n}\n\nexport interface ReferenceData {\n query: string\n references: Reference[]\n time?: number\n}\n\nexport interface ImageData {\n url?: string\n revised_prompt?: string\n content?: string\n}\n\nexport interface VideoData {\n id?: number | string\n url?: string\n eta?: number\n}\n\nexport interface AudioData {\n id?: string\n url?: string\n base64_audio?: string\n mime_type?: string\n content?: string\n transcript?: string\n channels?: number\n sample_rate?: number\n}\n\nexport interface Citations {\n raw?: unknown\n urls?: Array<{ url?: string; title?: string }>\n}\n\n/* ------------------------------------------------------------------ */\n/* The raw streamed event */\n/* ------------------------------------------------------------------ */\n\n/**\n * A single run event off the wire, normalised to a flat object. The `event`\n * field is the discriminator; other fields depend on the event type. This is a\n * permissive superset — most fields are optional and present only for the\n * events that carry them.\n */\nexport interface RunEventData {\n event: AnyRunEventName\n created_at?: number\n run_id?: string\n parent_run_id?: string\n session_id?: string\n agent_id?: string\n agent_name?: string\n team_id?: string\n team_name?: string\n workflow_id?: string\n workflow_name?: string\n\n content?: string | object | null\n content_type?: string\n reasoning_content?: string\n\n tool?: ToolExecution\n tools?: ToolExecution[]\n\n reasoning_steps?: ReasoningStep[]\n references?: ReferenceData[]\n citations?: Citations\n\n /** `FollowupsCompleted`: the suggested next prompts. */\n followups?: string[]\n\n images?: ImageData[]\n videos?: VideoData[]\n audio?: AudioData[]\n response_audio?: AudioData\n\n // workflow / step context\n step_name?: string\n step_index?: number | [number, number]\n iteration?: number\n max_iterations?: number\n\n // pause / human-in-the-loop\n requirements?: RunRequirement[]\n requires_confirmation?: boolean\n confirmation_message?: string\n requires_user_input?: boolean\n user_input_message?: string\n user_input_schema?: UserInputField[]\n available_choices?: string[]\n allow_multiple_selections?: boolean\n\n // error\n error?: string\n error_type?: string\n\n // model metrics\n model?: string\n model_provider?: string\n input_tokens?: number\n output_tokens?: number\n total_tokens?: number\n\n metrics?: Record<string, unknown>\n extra_data?: {\n reasoning_steps?: ReasoningStep[]\n references?: ReferenceData[]\n }\n\n // allow forward-compatible access to any other field\n [key: string]: unknown\n}\n\n/* ------------------------------------------------------------------ */\n/* Human-in-the-loop requirement */\n/* ------------------------------------------------------------------ */\n\nexport type PauseType = 'confirmation' | 'user_input' | 'user_feedback' | 'external_execution'\n\nexport interface RunRequirement {\n id: string\n tool_execution?: ToolExecution\n confirmation?: boolean\n confirmation_note?: string\n user_input_schema?: UserInputField[]\n external_execution_result?: string\n member_agent_id?: string\n member_agent_name?: string\n pause_type?: PauseType\n}\n\n/* ------------------------------------------------------------------ */\n/* Chat message (the accumulated, render-ready view of a run) */\n/* ------------------------------------------------------------------ */\n\nexport type ChatRole = 'user' | 'agent' | 'system'\n\nexport type ChatStatus = 'idle' | 'streaming' | 'paused' | 'completed' | 'error' | 'cancelled'\n\nexport type SubRunStatus = 'running' | 'completed' | 'error'\n\n/**\n * A nested run inside a team or workflow run — a team member's turn, or the\n * agent/team that executes a workflow step. Accumulated from events that carry\n * a `parent_run_id`.\n */\nexport interface SubRun {\n run_id: string\n kind: 'member' | 'executor'\n name?: string\n agent_id?: string\n content: string\n tool_calls?: ToolExecution[]\n status: SubRunStatus\n}\n\n/** A workflow step and its output, accumulated from `Step*` events. */\nexport interface WorkflowStep {\n key: string\n name?: string\n index?: number | [number, number]\n status: SubRunStatus\n content?: string\n error?: string\n}\n\nexport interface ChatMessage {\n id: string\n role: ChatRole\n content: string\n created_at: number\n\n /** Set while this message is being streamed. */\n streaming?: boolean\n /** Run-level status, set for agent messages. */\n status?: ChatStatus\n error?: string\n\n run_id?: string\n session_id?: string\n\n tool_calls?: ToolExecution[]\n reasoning_steps?: ReasoningStep[]\n references?: ReferenceData[]\n citations?: Citations\n\n /**\n * Suggested next prompts, when the agent was built with `followups=True`.\n * Rendered under the latest answer as \"Related questions\".\n */\n followups?: string[]\n\n images?: ImageData[]\n videos?: VideoData[]\n audio?: AudioData[]\n response_audio?: AudioData\n\n /** Live \"what is it doing right now\" label, e.g. \"Calling get_weather\". */\n activity?: string\n\n /** Pause requirements when the run is waiting for a human. */\n requirements?: RunRequirement[]\n\n /** Team member turns / workflow step executors (nested runs). */\n members?: SubRun[]\n\n /** Workflow steps and their outputs. */\n steps?: WorkflowStep[]\n\n /** Every raw event that contributed to this message, in order. */\n events?: RunEventData[]\n}\n\n/* ------------------------------------------------------------------ */\n/* Entities (agents / teams / workflows) and sessions */\n/* ------------------------------------------------------------------ */\n\nexport interface Model {\n name?: string\n model?: string\n provider?: string\n}\n\nexport type EntityType = 'agent' | 'team' | 'workflow'\n\nexport interface Entity {\n type: EntityType\n id: string\n name: string\n description?: string\n model?: Model\n db_id?: string\n}\n\nexport interface SessionEntry {\n session_id: string\n session_name?: string\n /** Unix seconds, Unix milliseconds, or an ISO date string, depending on the backend. */\n created_at: number | string\n updated_at?: number | string\n}\n\nexport interface Pagination {\n page: number\n limit: number\n total_pages: number\n total_count: number\n}\n\nexport interface SessionsResponse {\n data: SessionEntry[]\n meta?: Pagination\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/core/types.ts"],"names":["RunEvent","TeamRunEvent","WorkflowRunEvent"],"mappings":";AAYO,IAAK,QAAA,qBAAAA,SAAAA,KAAL;AACL,EAAAA,UAAA,YAAA,CAAA,GAAa,YAAA;AACb,EAAAA,UAAA,YAAA,CAAA,GAAa,YAAA;AACb,EAAAA,UAAA,qBAAA,CAAA,GAAsB,qBAAA;AACtB,EAAAA,UAAA,wBAAA,CAAA,GAAyB,wBAAA;AACzB,EAAAA,UAAA,cAAA,CAAA,GAAe,cAAA;AACf,EAAAA,UAAA,UAAA,CAAA,GAAW,UAAA;AACX,EAAAA,UAAA,cAAA,CAAA,GAAe,cAAA;AACf,EAAAA,UAAA,WAAA,CAAA,GAAY,WAAA;AACZ,EAAAA,UAAA,cAAA,CAAA,GAAe,cAAA;AAEf,EAAAA,UAAA,gBAAA,CAAA,GAAiB,gBAAA;AACjB,EAAAA,UAAA,kBAAA,CAAA,GAAmB,kBAAA;AACnB,EAAAA,UAAA,iBAAA,CAAA,GAAkB,iBAAA;AAClB,EAAAA,UAAA,mBAAA,CAAA,GAAoB,mBAAA;AAEpB,EAAAA,UAAA,iBAAA,CAAA,GAAkB,iBAAA;AAClB,EAAAA,UAAA,mBAAA,CAAA,GAAoB,mBAAA;AACpB,EAAAA,UAAA,eAAA,CAAA,GA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k-5QKU7OPE.js","sourcesContent":["/**\n * Types for AgentOS run events, messages, and entities.\n *\n * These mirror the wire format emitted by Agno's AgentOS when streaming a run\n * for an agent, team, or workflow. Field names match the JSON sent on the wire.\n */\n\n/* ------------------------------------------------------------------ */\n/* Run event names */\n/* ------------------------------------------------------------------ */\n\n/** Agent run event names. */\nexport enum RunEvent {\n RunStarted = 'RunStarted',\n RunContent = 'RunContent',\n RunContentCompleted = 'RunContentCompleted',\n RunIntermediateContent = 'RunIntermediateContent',\n RunCompleted = 'RunCompleted',\n RunError = 'RunError',\n RunCancelled = 'RunCancelled',\n RunPaused = 'RunPaused',\n RunContinued = 'RunContinued',\n\n PreHookStarted = 'PreHookStarted',\n PreHookCompleted = 'PreHookCompleted',\n PostHookStarted = 'PostHookStarted',\n PostHookCompleted = 'PostHookCompleted',\n\n ToolCallStarted = 'ToolCallStarted',\n ToolCallCompleted = 'ToolCallCompleted',\n ToolCallError = 'ToolCallError',\n\n ReasoningStarted = 'ReasoningStarted',\n ReasoningStep = 'ReasoningStep',\n ReasoningContentDelta = 'ReasoningContentDelta',\n ReasoningCompleted = 'ReasoningCompleted',\n\n MemoryUpdateStarted = 'MemoryUpdateStarted',\n MemoryUpdateCompleted = 'MemoryUpdateCompleted',\n\n SessionSummaryStarted = 'SessionSummaryStarted',\n SessionSummaryCompleted = 'SessionSummaryCompleted',\n\n ParserModelResponseStarted = 'ParserModelResponseStarted',\n ParserModelResponseCompleted = 'ParserModelResponseCompleted',\n OutputModelResponseStarted = 'OutputModelResponseStarted',\n OutputModelResponseCompleted = 'OutputModelResponseCompleted',\n\n ModelRequestStarted = 'ModelRequestStarted',\n ModelRequestCompleted = 'ModelRequestCompleted',\n\n CompressionStarted = 'CompressionStarted',\n CompressionCompleted = 'CompressionCompleted',\n\n FollowupsStarted = 'FollowupsStarted',\n FollowupsCompleted = 'FollowupsCompleted',\n\n CustomEvent = 'CustomEvent',\n}\n\n/** Team run event names. */\nexport enum TeamRunEvent {\n TeamRunStarted = 'TeamRunStarted',\n TeamRunContent = 'TeamRunContent',\n TeamRunIntermediateContent = 'TeamRunIntermediateContent',\n TeamRunContentCompleted = 'TeamRunContentCompleted',\n TeamRunCompleted = 'TeamRunCompleted',\n TeamRunError = 'TeamRunError',\n TeamRunCancelled = 'TeamRunCancelled',\n TeamRunPaused = 'TeamRunPaused',\n TeamRunContinued = 'TeamRunContinued',\n\n TeamToolCallStarted = 'TeamToolCallStarted',\n TeamToolCallCompleted = 'TeamToolCallCompleted',\n TeamToolCallError = 'TeamToolCallError',\n\n TeamReasoningStarted = 'TeamReasoningStarted',\n TeamReasoningStep = 'TeamReasoningStep',\n TeamReasoningContentDelta = 'TeamReasoningContentDelta',\n TeamReasoningCompleted = 'TeamReasoningCompleted',\n\n TeamMemoryUpdateStarted = 'TeamMemoryUpdateStarted',\n TeamMemoryUpdateCompleted = 'TeamMemoryUpdateCompleted',\n\n TeamFollowupsStarted = 'TeamFollowupsStarted',\n TeamFollowupsCompleted = 'TeamFollowupsCompleted',\n\n TeamTaskIterationStarted = 'TeamTaskIterationStarted',\n TeamTaskIterationCompleted = 'TeamTaskIterationCompleted',\n TeamTaskStateUpdated = 'TeamTaskStateUpdated',\n TeamTaskCreated = 'TeamTaskCreated',\n TeamTaskUpdated = 'TeamTaskUpdated',\n}\n\n/** Workflow run event names. */\nexport enum WorkflowRunEvent {\n WorkflowStarted = 'WorkflowStarted',\n WorkflowCompleted = 'WorkflowCompleted',\n WorkflowPaused = 'WorkflowPaused',\n WorkflowCancelled = 'WorkflowCancelled',\n WorkflowError = 'WorkflowError',\n\n WorkflowAgentStarted = 'WorkflowAgentStarted',\n WorkflowAgentCompleted = 'WorkflowAgentCompleted',\n\n StepStarted = 'StepStarted',\n StepCompleted = 'StepCompleted',\n StepPaused = 'StepPaused',\n StepContinued = 'StepContinued',\n StepError = 'StepError',\n StepOutput = 'StepOutput',\n StepOutputReview = 'StepOutputReview',\n\n LoopExecutionStarted = 'LoopExecutionStarted',\n LoopIterationStarted = 'LoopIterationStarted',\n LoopIterationCompleted = 'LoopIterationCompleted',\n LoopExecutionCompleted = 'LoopExecutionCompleted',\n\n ParallelExecutionStarted = 'ParallelExecutionStarted',\n ParallelExecutionCompleted = 'ParallelExecutionCompleted',\n\n ConditionExecutionStarted = 'ConditionExecutionStarted',\n ConditionExecutionCompleted = 'ConditionExecutionCompleted',\n ConditionPaused = 'ConditionPaused',\n\n RouterExecutionStarted = 'RouterExecutionStarted',\n RouterExecutionCompleted = 'RouterExecutionCompleted',\n RouterPaused = 'RouterPaused',\n\n StepsExecutionStarted = 'StepsExecutionStarted',\n StepsExecutionCompleted = 'StepsExecutionCompleted',\n}\n\n/** Any run event name, across agents, teams and workflows. */\nexport type AnyRunEventName = RunEvent | TeamRunEvent | WorkflowRunEvent | string\n\n/* ------------------------------------------------------------------ */\n/* Tool calls */\n/* ------------------------------------------------------------------ */\n\nexport interface UserInputField {\n name: string\n field_type?: string\n description?: string\n value?: unknown\n}\n\nexport interface ToolExecution {\n tool_call_id?: string\n tool_name?: string\n tool_args?: Record<string, unknown>\n tool_call_error?: boolean\n result?: string\n metrics?: { time?: number }\n created_at?: number\n stop_after_tool_call?: boolean\n\n // Human-in-the-loop\n requires_confirmation?: boolean\n confirmed?: boolean\n confirmation_note?: string\n requires_user_input?: boolean\n user_input_schema?: UserInputField[]\n answered?: boolean\n external_execution_required?: boolean\n\n // present on a few content payloads under the legacy `role`/`content` shape\n role?: string\n content?: string | null\n}\n\n/* ------------------------------------------------------------------ */\n/* Reasoning, references, media */\n/* ------------------------------------------------------------------ */\n\nexport interface ReasoningStep {\n title?: string | null\n action?: string | null\n result?: string | null\n reasoning?: string | null\n confidence?: number | null\n next_action?: string | null\n}\n\nexport interface Reference {\n content: string\n name?: string\n meta_data?: Record<string, unknown>\n}\n\nexport interface ReferenceData {\n query: string\n references: Reference[]\n time?: number\n}\n\nexport interface ImageData {\n url?: string\n revised_prompt?: string\n content?: string\n}\n\nexport interface VideoData {\n id?: number | string\n url?: string\n eta?: number\n}\n\nexport interface AudioData {\n id?: string\n url?: string\n base64_audio?: string\n mime_type?: string\n content?: string\n transcript?: string\n channels?: number\n sample_rate?: number\n}\n\nexport interface Citations {\n raw?: unknown\n urls?: Array<{ url?: string; title?: string }>\n}\n\n/* ------------------------------------------------------------------ */\n/* The raw streamed event */\n/* ------------------------------------------------------------------ */\n\n/**\n * A single run event off the wire, normalised to a flat object. The `event`\n * field is the discriminator; other fields depend on the event type. This is a\n * permissive superset — most fields are optional and present only for the\n * events that carry them.\n */\nexport interface RunEventData {\n event: AnyRunEventName\n created_at?: number\n run_id?: string\n parent_run_id?: string\n session_id?: string\n agent_id?: string\n agent_name?: string\n team_id?: string\n team_name?: string\n workflow_id?: string\n workflow_name?: string\n\n content?: string | object | null\n content_type?: string\n reasoning_content?: string\n\n tool?: ToolExecution\n tools?: ToolExecution[]\n\n reasoning_steps?: ReasoningStep[]\n references?: ReferenceData[]\n citations?: Citations\n\n /** `FollowupsCompleted`: the suggested next prompts. */\n followups?: string[]\n\n images?: ImageData[]\n videos?: VideoData[]\n audio?: AudioData[]\n response_audio?: AudioData\n\n // workflow / step context\n step_name?: string\n step_index?: number | [number, number]\n iteration?: number\n max_iterations?: number\n\n // pause / human-in-the-loop\n requirements?: RunRequirement[]\n step_requirements?: StepRequirement[]\n requires_confirmation?: boolean\n confirmation_message?: string\n requires_user_input?: boolean\n user_input_message?: string\n user_input_schema?: UserInputField[]\n available_choices?: string[]\n allow_multiple_selections?: boolean\n\n // error\n error?: string\n error_type?: string\n\n // model metrics\n model?: string\n model_provider?: string\n input_tokens?: number\n output_tokens?: number\n total_tokens?: number\n\n metrics?: Record<string, unknown>\n extra_data?: {\n reasoning_steps?: ReasoningStep[]\n references?: ReferenceData[]\n }\n\n // allow forward-compatible access to any other field\n [key: string]: unknown\n}\n\n/* ------------------------------------------------------------------ */\n/* Human-in-the-loop requirement */\n/* ------------------------------------------------------------------ */\n\nexport type PauseType = 'confirmation' | 'user_input' | 'user_feedback' | 'external_execution'\n\nexport interface RunRequirement {\n id: string\n tool_execution?: ToolExecution\n confirmation?: boolean\n confirmation_note?: string\n user_input_schema?: UserInputField[]\n external_execution_result?: string\n member_agent_id?: string\n member_agent_name?: string\n member_run_id?: string\n pause_type?: PauseType\n}\n\nexport interface RunResolution {\n tools?: ToolExecution[]\n requirements?: RunRequirement[]\n stepRequirements?: unknown[]\n}\n\nexport interface StepRequirement {\n step_id: string\n step_name?: string\n requires_confirmation?: boolean\n confirmed?: boolean | null\n confirmation_message?: string\n [key: string]: unknown\n}\n\n/* ------------------------------------------------------------------ */\n/* Chat message (the accumulated, render-ready view of a run) */\n/* ------------------------------------------------------------------ */\n\nexport type ChatRole = 'user' | 'agent' | 'system'\n\nexport type ChatStatus = 'idle' | 'streaming' | 'paused' | 'completed' | 'error' | 'cancelled'\n\nexport type SubRunStatus = 'running' | 'completed' | 'error'\n\n/**\n * A nested run inside a team or workflow run — a team member's turn, or the\n * agent/team that executes a workflow step. Accumulated from events that carry\n * a `parent_run_id`.\n */\nexport interface SubRun {\n run_id: string\n kind: 'member' | 'executor'\n name?: string\n agent_id?: string\n content: string\n tool_calls?: ToolExecution[]\n status: SubRunStatus\n}\n\n/** A workflow step and its output, accumulated from `Step*` events. */\nexport interface WorkflowStep {\n key: string\n name?: string\n index?: number | [number, number]\n status: SubRunStatus\n content?: string\n error?: string\n}\n\nexport interface ChatMessage {\n id: string\n role: ChatRole\n content: string\n created_at: number\n\n /** Set while this message is being streamed. */\n streaming?: boolean\n /** Run-level status, set for agent messages. */\n status?: ChatStatus\n error?: string\n\n run_id?: string\n session_id?: string\n\n tool_calls?: ToolExecution[]\n reasoning_steps?: ReasoningStep[]\n references?: ReferenceData[]\n citations?: Citations\n\n /**\n * Suggested next prompts, when the agent was built with `followups=True`.\n * Rendered under the latest answer as \"Related questions\".\n */\n followups?: string[]\n\n images?: ImageData[]\n videos?: VideoData[]\n audio?: AudioData[]\n response_audio?: AudioData\n\n /** Live \"what is it doing right now\" label, e.g. \"Calling get_weather\". */\n activity?: string\n\n /** Pause requirements when the run is waiting for a human. */\n requirements?: RunRequirement[]\n step_requirements?: StepRequirement[]\n\n /** Team member turns / workflow step executors (nested runs). */\n members?: SubRun[]\n\n /** Workflow steps and their outputs. */\n steps?: WorkflowStep[]\n\n /** Every raw event that contributed to this message, in order. */\n events?: RunEventData[]\n}\n\n/* ------------------------------------------------------------------ */\n/* Entities (agents / teams / workflows) and sessions */\n/* ------------------------------------------------------------------ */\n\nexport interface Model {\n name?: string\n model?: string\n provider?: string\n}\n\nexport type EntityType = 'agent' | 'team' | 'workflow'\n\nexport interface Entity {\n type: EntityType\n id: string\n name: string\n description?: string\n model?: Model\n db_id?: string\n}\n\nexport interface SessionEntry {\n session_id: string\n session_name?: string\n /** Unix seconds, Unix milliseconds, or an ISO date string, depending on the backend. */\n created_at: number | string\n updated_at?: number | string\n}\n\nexport interface Pagination {\n page: number\n limit: number\n total_pages: number\n total_count: number\n}\n\nexport interface SessionsResponse {\n data: SessionEntry[]\n meta?: Pagination\n}\n"]}
|
|
@@ -53,7 +53,7 @@ function drainBuffer(buffer, onEvent) {
|
|
|
53
53
|
start = buffer.indexOf("{", start + 1);
|
|
54
54
|
continue;
|
|
55
55
|
}
|
|
56
|
-
buffer = buffer.slice(end + 1)
|
|
56
|
+
buffer = buffer.slice(end + 1);
|
|
57
57
|
start = buffer.indexOf("{");
|
|
58
58
|
}
|
|
59
59
|
return buffer;
|
|
@@ -242,6 +242,8 @@ var AgnoClient = class {
|
|
|
242
242
|
if (args.userId) form.append("user_id", args.userId);
|
|
243
243
|
if (args.type === "workflow") {
|
|
244
244
|
if (args.stepRequirements) form.append("step_requirements", JSON.stringify(args.stepRequirements));
|
|
245
|
+
} else if (args.requirements) {
|
|
246
|
+
form.append("requirements", JSON.stringify(args.requirements));
|
|
245
247
|
} else if (args.tools) {
|
|
246
248
|
form.append("tools", JSON.stringify(args.tools));
|
|
247
249
|
}
|
|
@@ -340,6 +342,22 @@ var isToolCompletedEvent = (e) => name(e) === "ToolCallCompleted" || name(e) ===
|
|
|
340
342
|
var isToolEvent = (e) => isToolStartedEvent(e) || isToolCompletedEvent(e) || name(e) === "ToolCallError" || name(e) === "TeamToolCallError";
|
|
341
343
|
var isReasoningStepEvent = (e) => name(e) === "ReasoningStep" || name(e) === "TeamReasoningStep";
|
|
342
344
|
var isReasoningCompletedEvent = (e) => name(e) === "ReasoningCompleted" || name(e) === "TeamReasoningCompleted";
|
|
345
|
+
function reasoningStepsFromEvent(e) {
|
|
346
|
+
const legacy = e.reasoning_steps ?? e.extra_data?.reasoning_steps;
|
|
347
|
+
if (legacy?.length) return legacy;
|
|
348
|
+
if (!isReasoningStepEvent(e) && !isReasoningCompletedEvent(e)) return [];
|
|
349
|
+
const content = e.content;
|
|
350
|
+
if (!content || typeof content !== "object" || Array.isArray(content)) return [];
|
|
351
|
+
if ("reasoning_steps" in content && Array.isArray(content.reasoning_steps)) {
|
|
352
|
+
return content.reasoning_steps.filter(isReasoningStep);
|
|
353
|
+
}
|
|
354
|
+
return isReasoningStep(content) ? [content] : [];
|
|
355
|
+
}
|
|
356
|
+
function isReasoningStep(value) {
|
|
357
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
358
|
+
const fields = ["title", "action", "result", "reasoning", "next_action"];
|
|
359
|
+
return fields.some((key) => typeof Reflect.get(value, key) === "string") && fields.every((key) => Reflect.get(value, key) == null || typeof Reflect.get(value, key) === "string") && (!("confidence" in value) || value.confidence == null || typeof value.confidence === "number");
|
|
360
|
+
}
|
|
343
361
|
var isFollowupsCompletedEvent = (e) => name(e) === "FollowupsCompleted" || name(e) === "TeamFollowupsCompleted";
|
|
344
362
|
function isSubRunEvent(e) {
|
|
345
363
|
if (!e.parent_run_id) return false;
|
|
@@ -498,6 +516,6 @@ function mergeTool(list, tool) {
|
|
|
498
516
|
return [...list, tool];
|
|
499
517
|
}
|
|
500
518
|
|
|
501
|
-
export { AgnoClient, activityLabel, applyContentEvent, applyStepEvent, applySubRunEvent, isCancelledEvent, isCompletedEvent, isContentEvent, isErrorEvent, isFollowupsCompletedEvent, isPausedEvent, isReasoningCompletedEvent, isReasoningStepEvent, isStartedEvent, isStepEvent, isSubRunEvent, isToolCompletedEvent, isToolEvent, mergeTool, normaliseBaseUrl, sessionRunsToMessages, streamRun, toolsFromEvent };
|
|
502
|
-
//# sourceMappingURL=chunk-
|
|
503
|
-
//# sourceMappingURL=chunk-
|
|
519
|
+
export { AgnoClient, activityLabel, applyContentEvent, applyStepEvent, applySubRunEvent, isCancelledEvent, isCompletedEvent, isContentEvent, isErrorEvent, isFollowupsCompletedEvent, isPausedEvent, isReasoningCompletedEvent, isReasoningStepEvent, isStartedEvent, isStepEvent, isSubRunEvent, isToolCompletedEvent, isToolEvent, mergeTool, normaliseBaseUrl, reasoningStepsFromEvent, sessionRunsToMessages, streamRun, toolsFromEvent };
|
|
520
|
+
//# sourceMappingURL=chunk-BCVKAMSO.js.map
|
|
521
|
+
//# sourceMappingURL=chunk-BCVKAMSO.js.map
|