@tangle-network/ui 11.12.0 → 11.13.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/CHANGELOG.md +17 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/auth/auth.d.ts +53 -0
- package/dist/{auth-DOETfnd9.js → auth/auth.js} +7 -37
- package/dist/auth/login-layout.d.ts +20 -0
- package/dist/auth/login-layout.js +36 -0
- package/dist/auth.d.ts +2 -1
- package/dist/auth.js +2 -1
- package/dist/chat/agent-timeline.d.ts +83 -0
- package/dist/chat/agent-timeline.js +236 -0
- package/dist/chat/chat-container.d.ts +51 -0
- package/dist/chat/chat-container.js +309 -0
- package/dist/chat/chat-message.d.ts +22 -0
- package/dist/chat/chat-message.js +38 -0
- package/dist/chat/message-list.d.ts +32 -0
- package/dist/chat/message-list.js +37 -0
- package/dist/chat/thinking-indicator.d.ts +6 -0
- package/dist/chat/thinking-indicator.js +38 -0
- package/dist/chat/user-message.d.ts +21 -0
- package/dist/chat/user-message.js +42 -0
- package/dist/chat.d.ts +6 -1
- package/dist/chat.js +6 -1
- package/dist/editor/document-editor-pane.d.ts +37 -0
- package/dist/editor/document-editor-pane.js +199 -0
- package/dist/editor/editor-lazy.js +37 -0
- package/dist/editor/editor-loading.js +21 -0
- package/dist/editor/editor-peers.d.ts +6 -0
- package/dist/editor/editor-peers.js +155 -0
- package/dist/editor/editor-provider.d.ts +97 -0
- package/dist/editor/editor-provider.js +253 -0
- package/dist/editor/editor-toolbar.d.ts +11 -0
- package/dist/editor/editor-toolbar.js +106 -0
- package/dist/editor/markdown-conversion.js +23 -0
- package/dist/editor/markdown-document-editor.js +103 -0
- package/dist/editor/tiptap-editor.d.ts +45 -0
- package/dist/editor/tiptap-editor.js +271 -0
- package/dist/editor/use-editor.d.ts +67 -0
- package/dist/editor/use-editor.js +158 -0
- package/dist/editor.d.ts +6 -119
- package/dist/editor.js +5 -1
- package/dist/files/file-artifact-pane.d.ts +47 -0
- package/dist/files/file-artifact-pane.js +114 -0
- package/dist/files/file-format.d.ts +51 -0
- package/dist/{file-format-BgXbr-Ib.js → files/file-format.js} +1 -1
- package/dist/files/file-preview.d.ts +27 -0
- package/dist/files/file-preview.js +359 -0
- package/dist/files/file-tabs.d.ts +19 -0
- package/dist/files/file-tabs.js +48 -0
- package/dist/files/file-tree.d.ts +31 -0
- package/dist/files/file-tree.js +135 -0
- package/dist/files/rich-file-tree.d.ts +62 -0
- package/dist/files/rich-file-tree.js +122 -0
- package/dist/files.d.ts +6 -1
- package/dist/files.js +6 -2
- package/dist/hooks/use-auth.d.ts +40 -0
- package/dist/hooks/use-auth.js +91 -0
- package/dist/hooks/use-auto-scroll.d.ts +11 -0
- package/dist/hooks/use-auto-scroll.js +48 -0
- package/dist/hooks/use-dropdown-menu.d.ts +12 -0
- package/dist/hooks/use-dropdown-menu.js +31 -0
- package/dist/hooks/use-live-time.d.ts +7 -0
- package/dist/hooks/use-live-time.js +22 -0
- package/dist/hooks/use-realtime-session.d.ts +32 -0
- package/dist/hooks/use-realtime-session.js +235 -0
- package/dist/hooks/use-run-collapse-state.d.ts +13 -0
- package/dist/hooks/use-run-collapse-state.js +24 -0
- package/dist/hooks/use-run-groups.d.ts +11 -0
- package/dist/hooks/use-run-groups.js +85 -0
- package/dist/hooks/use-sdk-session.d.ts +59 -0
- package/dist/hooks/use-sdk-session.js +322 -0
- package/dist/hooks/use-sse-stream.d.ts +124 -0
- package/dist/hooks/use-sse-stream.js +229 -0
- package/dist/hooks/use-tool-call-stream.d.ts +23 -0
- package/dist/hooks/use-tool-call-stream.js +75 -0
- package/dist/hooks.d.ts +11 -49
- package/dist/hooks.js +10 -110
- package/dist/index.d.ts +99 -25
- package/dist/index.js +86 -36
- package/dist/lib/focus.d.ts +55 -0
- package/dist/{focus-BcE_SHqz.js → lib/focus.js} +1 -1
- package/dist/lib/utils.d.ts +4 -0
- package/dist/{utils-C_uf36nf.js → lib/utils.js} +1 -1
- package/dist/{code-block-B9miUPht.d.ts → markdown/code-block.d.ts} +5 -6
- package/dist/{code-block-B36KVUSN.js → markdown/code-block.js} +22 -47
- package/dist/{markdown-C0atSabr.d.ts → markdown/markdown.d.ts} +4 -5
- package/dist/{markdown-Db08KAYF.js → markdown/markdown.js} +3 -3
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.js +2 -2
- package/dist/{openui-artifact-renderer-fkBQaoLO.d.ts → openui/openui-artifact-renderer.d.ts} +20 -21
- package/dist/{openui-artifact-renderer-DG_i2lOR.js → openui/openui-artifact-renderer.js} +9 -7
- package/dist/{schema-BpW9rSSG.js → openui/schema-compiled.js} +2 -354
- package/dist/{schema-DAstk-J4.d.ts → openui/schema-data.d.ts} +3 -24
- package/dist/openui/schema-data.js +206 -0
- package/dist/openui-schema.d.ts +22 -3
- package/dist/openui-schema.js +138 -1
- package/dist/openui.d.ts +3 -2
- package/dist/openui.js +3 -2
- package/dist/{artifact-pane-BL_DFWNl.d.ts → primitives/artifact-pane.d.ts} +3 -4
- package/dist/{artifact-pane-DMXT9a8U.js → primitives/artifact-pane.js} +2 -2
- package/dist/primitives/avatar.d.ts +8 -0
- package/dist/primitives/avatar.js +25 -0
- package/dist/primitives/badge.d.ts +22 -0
- package/dist/primitives/badge.js +47 -0
- package/dist/{button-yoIv77e2.d.ts → primitives/button.d.ts} +2 -2
- package/dist/primitives/button.js +113 -0
- package/dist/primitives/card.d.ts +18 -0
- package/dist/primitives/card.js +52 -0
- package/dist/primitives/code-block.d.ts +6 -0
- package/dist/primitives/code-block.js +13 -0
- package/dist/primitives/dialog.d.ts +23 -0
- package/dist/primitives/dialog.js +59 -0
- package/dist/primitives/drop-zone.d.ts +23 -0
- package/dist/primitives/drop-zone.js +104 -0
- package/dist/primitives/dropdown-menu.d.ts +29 -0
- package/dist/{dropdown-menu-BpcLa5vF.js → primitives/dropdown-menu.js} +2 -23
- package/dist/primitives/empty-state.d.ts +11 -0
- package/dist/primitives/empty-state.js +32 -0
- package/dist/primitives/heading.d.ts +23 -0
- package/dist/primitives/heading.js +38 -0
- package/dist/primitives/input.d.ts +23 -0
- package/dist/primitives/input.js +110 -0
- package/dist/primitives/label.d.ts +6 -0
- package/dist/primitives/label.js +16 -0
- package/dist/primitives/metric-strip.d.ts +48 -0
- package/dist/primitives/metric-strip.js +52 -0
- package/dist/primitives/page-header.d.ts +25 -0
- package/dist/primitives/page-header.js +47 -0
- package/dist/primitives/page-shell.d.ts +14 -0
- package/dist/primitives/page-shell.js +17 -0
- package/dist/primitives/progress.d.ts +9 -0
- package/dist/primitives/progress.js +29 -0
- package/dist/primitives/segmented-control.d.ts +40 -0
- package/dist/primitives/segmented-control.js +57 -0
- package/dist/primitives/select.d.ts +15 -0
- package/dist/primitives/select.js +74 -0
- package/dist/primitives/sidebar-drop-zone.d.ts +21 -0
- package/dist/primitives/sidebar-drop-zone.js +88 -0
- package/dist/primitives/skeleton.d.ts +10 -0
- package/dist/primitives/skeleton.js +50 -0
- package/dist/primitives/stat-card.d.ts +16 -0
- package/dist/primitives/stat-card.js +60 -0
- package/dist/primitives/status-pill.d.ts +44 -0
- package/dist/primitives/status-pill.js +119 -0
- package/dist/primitives/switch.d.ts +6 -0
- package/dist/primitives/switch.js +16 -0
- package/dist/primitives/table.d.ts +22 -0
- package/dist/primitives/table.js +63 -0
- package/dist/primitives/tabs.d.ts +13 -0
- package/dist/{tabs-BVHR6NkO.js → primitives/tabs.js} +3 -3
- package/dist/primitives/terminal-display.d.ts +25 -0
- package/dist/primitives/terminal-display.js +109 -0
- package/dist/primitives/text-shimmer.d.ts +16 -0
- package/dist/{text-shimmer-BUUo6I-g.js → primitives/text-shimmer.js} +2 -2
- package/dist/primitives/theme-toggle.d.ts +11 -0
- package/dist/primitives/theme-toggle.js +154 -0
- package/dist/primitives/toast.d.ts +29 -0
- package/dist/primitives/toast.js +142 -0
- package/dist/primitives/toolbar.d.ts +55 -0
- package/dist/primitives/toolbar.js +37 -0
- package/dist/primitives/upload-progress.d.ts +23 -0
- package/dist/primitives/upload-progress.js +72 -0
- package/dist/primitives.d.ts +35 -5
- package/dist/primitives.js +35 -9
- package/dist/{index-COgqsFAQ.d.ts → redaction/redacted-document.d.ts} +6 -7
- package/dist/{redaction-CGGB2ENG.js → redaction/redacted-document.js} +2 -2
- package/dist/redaction.d.ts +1 -1
- package/dist/redaction.js +1 -1
- package/dist/run/expandable-content.js +41 -0
- package/dist/run/expanded-tool-detail.d.ts +12 -0
- package/dist/run/expanded-tool-detail.js +163 -0
- package/dist/run/inline-thinking-item.d.ts +11 -0
- package/dist/run/inline-thinking-item.js +60 -0
- package/dist/run/inline-tool-item.d.ts +25 -0
- package/dist/run/inline-tool-item.js +63 -0
- package/dist/run/run-group.d.ts +26 -0
- package/dist/{run-group-BWGeesgs.js → run/run-group.js} +9 -60
- package/dist/run/run-item-primitives.d.ts +5 -0
- package/dist/{run-ZsIKPA6J.js → run/run-item-primitives.js} +2 -2
- package/dist/run/run-row-shell.d.ts +53 -0
- package/dist/run/run-row-shell.js +114 -0
- package/dist/{tool-call-feed-BeB1_4pX.d.ts → run/tool-call-feed.d.ts} +7 -12
- package/dist/{tool-call-feed-BpmMLpPX.js → run/tool-call-feed.js} +4 -4
- package/dist/run/tool-call-step.d.ts +5 -0
- package/dist/run/tool-call-step.js +82 -0
- package/dist/run.d.ts +8 -2
- package/dist/run.js +7 -4
- package/dist/sdk-hooks.d.ts +8 -1
- package/dist/sdk-hooks.js +8 -2
- package/dist/stores/active-sessions-store.d.ts +83 -0
- package/dist/{active-sessions-store-Gt1R0rFG.js → stores/active-sessions-store.js} +1 -1
- package/dist/stores/chat-store.d.ts +14 -0
- package/dist/stores/chat-store.js +33 -0
- package/dist/stores.d.ts +3 -16
- package/dist/stores.js +2 -33
- package/dist/tool-previews/command-preview.d.ts +11 -0
- package/dist/tool-previews/command-preview.js +91 -0
- package/dist/tool-previews/diff-preview.d.ts +7 -0
- package/dist/tool-previews/diff-preview.js +76 -0
- package/dist/tool-previews/glob-results-preview.d.ts +7 -0
- package/dist/tool-previews/glob-results-preview.js +53 -0
- package/dist/tool-previews/grep-results-preview.d.ts +7 -0
- package/dist/tool-previews/grep-results-preview.js +99 -0
- package/dist/tool-previews/preview-primitives.js +58 -0
- package/dist/tool-previews/question-preview.d.ts +7 -0
- package/dist/tool-previews/question-preview.js +63 -0
- package/dist/tool-previews/web-search-preview.d.ts +7 -0
- package/dist/tool-previews/web-search-preview.js +78 -0
- package/dist/tool-previews/write-file-preview.d.ts +11 -0
- package/dist/tool-previews/write-file-preview.js +52 -0
- package/dist/tool-previews.d.ts +7 -1
- package/dist/tool-previews.js +7 -1
- package/dist/{branding-26d5ARIr.d.ts → types/branding.d.ts} +2 -3
- package/dist/{message-vhUI0c5G.d.ts → types/message.d.ts} +2 -3
- package/dist/{parts-5mhy9yJ3.d.ts → types/parts.d.ts} +8 -9
- package/dist/{run-OyWmIDqu.d.ts → types/run.d.ts} +9 -10
- package/dist/{tool-display-DgmL5rIU.d.ts → types/tool-display.d.ts} +5 -6
- package/dist/types.d.ts +5 -5
- package/dist/utils/copy-text.d.ts +7 -0
- package/dist/{utils-Bl_CZ0Qp.js → utils/copy-text.js} +1 -11
- package/dist/utils/format.d.ts +22 -0
- package/dist/{format-DfcLWqMa.js → utils/format.js} +1 -1
- package/dist/utils/time-ago.d.ts +3 -0
- package/dist/utils/time-ago.js +11 -0
- package/dist/utils/tool-display.d.ts +16 -0
- package/dist/{tool-display-BAuAVa43.js → utils/tool-display.js} +1 -1
- package/dist/utils.d.ts +6 -1
- package/dist/utils.js +6 -5
- package/package.json +2 -2
- package/src/files/rich-file-tree.stories.tsx +1 -1
- package/src/files/rich-file-tree.tsx +12 -9
- package/src/markdown/code-block.test.tsx +46 -2
- package/src/markdown/code-block.tsx +23 -60
- package/src/primitives/button.stories.tsx +37 -1
- package/src/primitives/button.test.tsx +230 -0
- package/src/primitives/button.tsx +62 -14
- package/src/primitives/card-anatomy.stories.tsx +51 -0
- package/src/primitives/card.test.tsx +71 -0
- package/src/primitives/card.tsx +25 -13
- package/src/primitives/heading.stories.tsx +35 -0
- package/src/primitives/heading.test.tsx +56 -0
- package/src/primitives/heading.tsx +76 -0
- package/src/primitives/index.ts +8 -0
- package/src/primitives/input.stories.tsx +28 -0
- package/src/primitives/input.test.tsx +161 -0
- package/src/primitives/input.tsx +34 -28
- package/src/primitives/page-header.stories.tsx +51 -0
- package/src/primitives/page-header.test.tsx +48 -0
- package/src/primitives/page-header.tsx +35 -35
- package/src/primitives/page-shell.stories.tsx +89 -0
- package/src/primitives/page-shell.test.tsx +24 -0
- package/src/primitives/page-shell.tsx +26 -0
- package/src/primitives/table-wrapper.stories.tsx +54 -0
- package/src/primitives/table.test.tsx +72 -0
- package/src/primitives/table.tsx +33 -12
- package/src/primitives/theme-toggle.test.tsx +167 -0
- package/src/primitives/theme-toggle.tsx +111 -39
- package/dist/active-sessions-store-nl70ZnMC.d.ts +0 -84
- package/dist/button-C87nEe2R.js +0 -78
- package/dist/chat-DDvF2oGQ.js +0 -672
- package/dist/diff-preview-BcK3nRXb.js +0 -533
- package/dist/document-editor-pane-BilJfiCo.d.ts +0 -136
- package/dist/document-editor-pane-POsq5Q0o.js +0 -1279
- package/dist/files-hywocVZz.js +0 -753
- package/dist/index-2UntyjBb.d.ts +0 -52
- package/dist/index-BgUHilZm.d.ts +0 -108
- package/dist/index-CJ8wRfiC.d.ts +0 -236
- package/dist/index-CPDET_s1.d.ts +0 -549
- package/dist/index-Cg6gYAqh.d.ts +0 -73
- package/dist/index-Cs7j8V7l.d.ts +0 -203
- package/dist/index-DjKxO357.d.ts +0 -128
- package/dist/primitives-Bx59fT-U.js +0 -1239
- package/dist/table-Bss73DhB.js +0 -146
- package/dist/tool-call-step-DNebqhmX.js +0 -434
- package/dist/use-auto-scroll-C5Pjeqon.js +0 -153
- package/dist/use-sse-stream-DjqRuDft.js +0 -884
- package/dist/use-sse-stream-Dm6R5YWz.d.ts +0 -282
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
import { t as SessionMessage } from "./message-vhUI0c5G.js";
|
|
2
|
-
import { n as SessionPart } from "./parts-5mhy9yJ3.js";
|
|
3
|
-
import { a as Run, n as GroupedMessage } from "./run-OyWmIDqu.js";
|
|
4
|
-
import { t as FeedSegment } from "./tool-call-feed-BeB1_4pX.js";
|
|
5
|
-
import { c as ActiveSessionTransportMode, i as ActiveSessionConnectionState, u as RegisterActiveSessionOptions } from "./active-sessions-store-nl70ZnMC.js";
|
|
6
|
-
import { RefObject } from "react";
|
|
7
|
-
//#region src/hooks/use-auto-scroll.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* Scroll-to-bottom behaviour: sticks to the bottom while streaming,
|
|
10
|
-
* pauses when user scrolls up, resumes when user scrolls back down.
|
|
11
|
-
*/
|
|
12
|
-
declare function useAutoScroll(containerRef: RefObject<HTMLElement | null>, deps?: unknown[]): {
|
|
13
|
-
isAtBottom: boolean;
|
|
14
|
-
scrollToBottom: () => void;
|
|
15
|
-
};
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region src/hooks/use-dropdown-menu.d.ts
|
|
18
|
-
interface UseDropdownMenuOptions {
|
|
19
|
-
closeOnEsc?: boolean;
|
|
20
|
-
}
|
|
21
|
-
declare function useDropdownMenu(options?: UseDropdownMenuOptions): {
|
|
22
|
-
open: boolean;
|
|
23
|
-
setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
24
|
-
ref: import("react").RefObject<HTMLDivElement | null>;
|
|
25
|
-
toggle: () => void;
|
|
26
|
-
close: () => void;
|
|
27
|
-
};
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/hooks/use-run-collapse-state.d.ts
|
|
30
|
-
/**
|
|
31
|
-
* Manages per-run collapse state with auto-collapse after run completion.
|
|
32
|
-
*
|
|
33
|
-
* - Runs stay expanded by default
|
|
34
|
-
* - Collapse is manual only
|
|
35
|
-
*/
|
|
36
|
-
declare function useRunCollapseState(runs: Run[]): {
|
|
37
|
-
isCollapsed: (runId: string) => boolean;
|
|
38
|
-
toggleCollapse: (runId: string) => void;
|
|
39
|
-
};
|
|
40
|
-
//#endregion
|
|
41
|
-
//#region src/hooks/use-run-groups.d.ts
|
|
42
|
-
interface UseRunGroupsOptions {
|
|
43
|
-
messages: SessionMessage[];
|
|
44
|
-
partMap: Record<string, SessionPart[]>;
|
|
45
|
-
isStreaming: boolean;
|
|
46
|
-
}
|
|
47
|
-
declare function useRunGroups({ messages, partMap, isStreaming }: UseRunGroupsOptions): GroupedMessage[];
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/hooks/use-tool-call-stream.d.ts
|
|
50
|
-
interface UseToolCallStreamReturn {
|
|
51
|
-
/** Current feed segments (text + tool calls interleaved) */
|
|
52
|
-
segments: FeedSegment[];
|
|
53
|
-
/** Push a raw SSE event into the stream */
|
|
54
|
-
pushEvent: (event: {
|
|
55
|
-
type: string;
|
|
56
|
-
data: Record<string, unknown>;
|
|
57
|
-
}) => void;
|
|
58
|
-
/** Push a text delta (from message.part.updated) */
|
|
59
|
-
pushText: (delta: string) => void;
|
|
60
|
-
/** Mark a tool call as complete */
|
|
61
|
-
completeToolCall: (id: string, result: {
|
|
62
|
-
output?: string;
|
|
63
|
-
error?: string;
|
|
64
|
-
duration?: number;
|
|
65
|
-
}) => void;
|
|
66
|
-
/** Reset the stream */
|
|
67
|
-
reset: () => void;
|
|
68
|
-
}
|
|
69
|
-
declare function useToolCallStream(): UseToolCallStreamReturn;
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/hooks/use-sdk-session.d.ts
|
|
72
|
-
interface SdkSessionAttachment {
|
|
73
|
-
name: string;
|
|
74
|
-
size?: number;
|
|
75
|
-
}
|
|
76
|
-
interface SdkSessionSeed {
|
|
77
|
-
id: string;
|
|
78
|
-
role: SessionMessage["role"];
|
|
79
|
-
createdAt?: number | string | Date;
|
|
80
|
-
content?: string;
|
|
81
|
-
attachments?: SdkSessionAttachment[];
|
|
82
|
-
parts?: SessionPart[];
|
|
83
|
-
}
|
|
84
|
-
interface SdkSessionEvent {
|
|
85
|
-
type: string;
|
|
86
|
-
data?: Record<string, unknown>;
|
|
87
|
-
}
|
|
88
|
-
interface BeginAssistantMessageOptions {
|
|
89
|
-
id?: string;
|
|
90
|
-
role?: Extract<SessionMessage["role"], "assistant" | "system">;
|
|
91
|
-
createdAt?: number | string | Date;
|
|
92
|
-
}
|
|
93
|
-
interface AppendUserMessageOptions {
|
|
94
|
-
id?: string;
|
|
95
|
-
role?: Extract<SessionMessage["role"], "user" | "system">;
|
|
96
|
-
content: string;
|
|
97
|
-
createdAt?: number | string | Date;
|
|
98
|
-
attachments?: SdkSessionAttachment[];
|
|
99
|
-
}
|
|
100
|
-
interface CompleteAssistantMessageOptions {
|
|
101
|
-
messageId?: string;
|
|
102
|
-
finalText?: string;
|
|
103
|
-
}
|
|
104
|
-
interface ApplySdkEventOptions {
|
|
105
|
-
messageId?: string;
|
|
106
|
-
}
|
|
107
|
-
interface UseSdkSessionOptions {
|
|
108
|
-
initialMessages?: SdkSessionSeed[];
|
|
109
|
-
}
|
|
110
|
-
interface UseSdkSessionReturn {
|
|
111
|
-
messages: SessionMessage[];
|
|
112
|
-
partMap: Record<string, SessionPart[]>;
|
|
113
|
-
isStreaming: boolean;
|
|
114
|
-
activeAssistantMessageId: string | null;
|
|
115
|
-
replaceHistory: (messages: SdkSessionSeed[]) => void;
|
|
116
|
-
appendUserMessage: (message: AppendUserMessageOptions) => string;
|
|
117
|
-
beginAssistantMessage: (options?: BeginAssistantMessageOptions) => string;
|
|
118
|
-
applySdkEvent: (event: SdkSessionEvent, options?: ApplySdkEventOptions) => void;
|
|
119
|
-
completeAssistantMessage: (options?: CompleteAssistantMessageOptions) => void;
|
|
120
|
-
failAssistantMessage: (error: string, options?: {
|
|
121
|
-
messageId?: string;
|
|
122
|
-
}) => void;
|
|
123
|
-
setStreaming: (value: boolean) => void;
|
|
124
|
-
reset: () => void;
|
|
125
|
-
}
|
|
126
|
-
declare function useSdkSession({ initialMessages }?: UseSdkSessionOptions): UseSdkSessionReturn;
|
|
127
|
-
//#endregion
|
|
128
|
-
//#region src/hooks/use-realtime-session.d.ts
|
|
129
|
-
interface RealtimeSessionOptions extends RegisterActiveSessionOptions {
|
|
130
|
-
connectUrl?: string | null;
|
|
131
|
-
enabled?: boolean;
|
|
132
|
-
foreground?: boolean;
|
|
133
|
-
keepRegistered?: boolean;
|
|
134
|
-
reconnect?: boolean;
|
|
135
|
-
reconnectIntervalMs?: number;
|
|
136
|
-
maxReconnectAttempts?: number;
|
|
137
|
-
transportMode?: ActiveSessionTransportMode;
|
|
138
|
-
onEvent?: (event: SdkSessionEvent) => void;
|
|
139
|
-
onOpen?: () => void;
|
|
140
|
-
onClose?: () => void;
|
|
141
|
-
onError?: (error: Error) => void;
|
|
142
|
-
}
|
|
143
|
-
interface RealtimeSessionState {
|
|
144
|
-
connectionState: ActiveSessionConnectionState;
|
|
145
|
-
lastError: string | null;
|
|
146
|
-
reconnectAttempts: number;
|
|
147
|
-
isConnected: boolean;
|
|
148
|
-
}
|
|
149
|
-
interface RealtimeSessionTarget extends RealtimeSessionOptions {
|
|
150
|
-
key?: string;
|
|
151
|
-
}
|
|
152
|
-
interface RealtimeSessionRegistryProps {
|
|
153
|
-
sessions: RealtimeSessionTarget[];
|
|
154
|
-
}
|
|
155
|
-
declare function useRealtimeSession({ sessionId, projectId, projectLabel, title, href, metadata, connectUrl, enabled, foreground, keepRegistered, reconnect, reconnectIntervalMs, maxReconnectAttempts, transportMode, onEvent, onOpen, onClose, onError }: RealtimeSessionOptions): RealtimeSessionState;
|
|
156
|
-
declare function RealtimeSessionRegistry({ sessions }: RealtimeSessionRegistryProps): import("react").FunctionComponentElement<RealtimeSessionTarget>[];
|
|
157
|
-
//#endregion
|
|
158
|
-
//#region src/hooks/use-sse-stream.d.ts
|
|
159
|
-
/**
|
|
160
|
-
* SSE Event data structure
|
|
161
|
-
*/
|
|
162
|
-
interface SSEEvent<T = unknown> {
|
|
163
|
-
id?: string;
|
|
164
|
-
event: string;
|
|
165
|
-
data: T;
|
|
166
|
-
timestamp: number;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Connection state for SSE streams
|
|
170
|
-
*/
|
|
171
|
-
type ConnectionState = "connecting" | "connected" | "reconnecting" | "disconnected" | "error";
|
|
172
|
-
/**
|
|
173
|
-
* SSE stream options
|
|
174
|
-
*/
|
|
175
|
-
interface UseSSEStreamOptions<T = unknown> {
|
|
176
|
-
/** URL to connect to */
|
|
177
|
-
url: string;
|
|
178
|
-
/** Authorization header value */
|
|
179
|
-
authToken?: string;
|
|
180
|
-
/** Enable automatic reconnection (default: true) */
|
|
181
|
-
autoReconnect?: boolean;
|
|
182
|
-
/** Max reconnection attempts (default: 5) */
|
|
183
|
-
maxRetries?: number;
|
|
184
|
-
/** Base delay between reconnects in ms (default: 1000) */
|
|
185
|
-
reconnectDelay?: number;
|
|
186
|
-
/** Event types to listen for (default: all) */
|
|
187
|
-
eventTypes?: string[];
|
|
188
|
-
/** Callback for each event */
|
|
189
|
-
onEvent?: (event: SSEEvent<T>) => void;
|
|
190
|
-
/** Callback on connection state change */
|
|
191
|
-
onStateChange?: (state: ConnectionState) => void;
|
|
192
|
-
/** Callback on error */
|
|
193
|
-
onError?: (error: Error) => void;
|
|
194
|
-
/** Custom headers */
|
|
195
|
-
headers?: Record<string, string>;
|
|
196
|
-
/** Whether to start connected (default: true) */
|
|
197
|
-
enabled?: boolean;
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* SSE stream result
|
|
201
|
-
*/
|
|
202
|
-
interface UseSSEStreamResult<T = unknown> {
|
|
203
|
-
/** Current connection state */
|
|
204
|
-
state: ConnectionState;
|
|
205
|
-
/** All received events */
|
|
206
|
-
events: SSEEvent<T>[];
|
|
207
|
-
/** Most recent event */
|
|
208
|
-
lastEvent: SSEEvent<T> | null;
|
|
209
|
-
/** Error if any */
|
|
210
|
-
error: Error | null;
|
|
211
|
-
/** Manually connect */
|
|
212
|
-
connect: () => void;
|
|
213
|
-
/** Manually disconnect */
|
|
214
|
-
disconnect: () => void;
|
|
215
|
-
/** Clear events buffer */
|
|
216
|
-
clearEvents: () => void;
|
|
217
|
-
/** Retry count */
|
|
218
|
-
retryCount: number;
|
|
219
|
-
/** Time since last event (ms) */
|
|
220
|
-
timeSinceLastEvent: number;
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* React hook for consuming SSE streams with automatic reconnection,
|
|
224
|
-
* event buffering, and state management.
|
|
225
|
-
*
|
|
226
|
-
* @example
|
|
227
|
-
* ```tsx
|
|
228
|
-
* const { events, state, lastEvent } = useSSEStream({
|
|
229
|
-
* url: '/api/v1/tasks/123/stream',
|
|
230
|
-
* authToken: 'Bearer xxx',
|
|
231
|
-
* onEvent: (e) => console.log('Event:', e),
|
|
232
|
-
* });
|
|
233
|
-
*
|
|
234
|
-
* return (
|
|
235
|
-
* <div>
|
|
236
|
-
* <p>Status: {state}</p>
|
|
237
|
-
* {events.map((e, i) => (
|
|
238
|
-
* <div key={i}>{e.event}: {JSON.stringify(e.data)}</div>
|
|
239
|
-
* ))}
|
|
240
|
-
* </div>
|
|
241
|
-
* );
|
|
242
|
-
* ```
|
|
243
|
-
*/
|
|
244
|
-
declare function useSSEStream<T = unknown>(options: UseSSEStreamOptions<T>): UseSSEStreamResult<T>;
|
|
245
|
-
/**
|
|
246
|
-
* Typed event types for common streaming scenarios
|
|
247
|
-
*/
|
|
248
|
-
interface TaskStreamEvent {
|
|
249
|
-
task_id: string;
|
|
250
|
-
status?: string;
|
|
251
|
-
progress?: number;
|
|
252
|
-
message?: string;
|
|
253
|
-
result?: unknown;
|
|
254
|
-
error?: string;
|
|
255
|
-
}
|
|
256
|
-
interface AgentStreamEvent {
|
|
257
|
-
type: "message.updated" | "tool_call" | "tool_result" | "llm_response" | "error" | "session.idle" | "execution.started" | "execution.result";
|
|
258
|
-
data: unknown;
|
|
259
|
-
timestamp?: number;
|
|
260
|
-
}
|
|
261
|
-
interface TerminalStreamEvent {
|
|
262
|
-
type: "output" | "input" | "error" | "exit";
|
|
263
|
-
data: string;
|
|
264
|
-
timestamp: number;
|
|
265
|
-
}
|
|
266
|
-
interface AutomationStreamEvent {
|
|
267
|
-
automation_id: string;
|
|
268
|
-
event_id?: string;
|
|
269
|
-
status?: string;
|
|
270
|
-
variant_id?: string;
|
|
271
|
-
output?: string;
|
|
272
|
-
action_result?: unknown;
|
|
273
|
-
error?: string;
|
|
274
|
-
}
|
|
275
|
-
interface BotStreamEvent {
|
|
276
|
-
bot_id: string;
|
|
277
|
-
type: "balance" | "trade" | "decision" | "log" | "error";
|
|
278
|
-
data: unknown;
|
|
279
|
-
timestamp: number;
|
|
280
|
-
}
|
|
281
|
-
//#endregion
|
|
282
|
-
export { useRunGroups as A, SdkSessionSeed as C, UseToolCallStreamReturn as D, useSdkSession as E, useDropdownMenu as M, useAutoScroll as N, useToolCallStream as O, SdkSessionEvent as S, UseSdkSessionReturn as T, AppendUserMessageOptions as _, SSEEvent as a, CompleteAssistantMessageOptions as b, UseSSEStreamOptions as c, RealtimeSessionOptions as d, RealtimeSessionRegistry as f, useRealtimeSession as g, RealtimeSessionTarget as h, ConnectionState as i, useRunCollapseState as j, UseRunGroupsOptions as k, UseSSEStreamResult as l, RealtimeSessionState as m, AutomationStreamEvent as n, TaskStreamEvent as o, RealtimeSessionRegistryProps as p, BotStreamEvent as r, TerminalStreamEvent as s, AgentStreamEvent as t, useSSEStream as u, ApplySdkEventOptions as v, UseSdkSessionOptions as w, SdkSessionAttachment as x, BeginAssistantMessageOptions as y };
|