@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
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { parseToolEvent } from "../run/tool-call-feed.js";
|
|
2
|
+
import { useCallback, useRef, useState } from "react";
|
|
3
|
+
//#region src/hooks/use-tool-call-stream.ts
|
|
4
|
+
/**
|
|
5
|
+
* useToolCallStream — parses SSE events into ToolCallFeed segments.
|
|
6
|
+
*
|
|
7
|
+
* Takes raw SSE event data from the orchestrator stream and produces
|
|
8
|
+
* structured FeedSegments that ToolCallFeed can render.
|
|
9
|
+
*/
|
|
10
|
+
function useToolCallStream() {
|
|
11
|
+
const [segments, setSegments] = useState([]);
|
|
12
|
+
const pendingToolsRef = useRef(/* @__PURE__ */ new Map());
|
|
13
|
+
const lastSegmentKindRef = useRef(null);
|
|
14
|
+
const pushText = useCallback((delta) => {
|
|
15
|
+
setSegments((prev) => {
|
|
16
|
+
const last = prev[prev.length - 1];
|
|
17
|
+
if (last && last.kind === "text") return [...prev.slice(0, -1), {
|
|
18
|
+
kind: "text",
|
|
19
|
+
content: last.content + delta
|
|
20
|
+
}];
|
|
21
|
+
return [...prev, {
|
|
22
|
+
kind: "text",
|
|
23
|
+
content: delta
|
|
24
|
+
}];
|
|
25
|
+
});
|
|
26
|
+
lastSegmentKindRef.current = "text";
|
|
27
|
+
}, []);
|
|
28
|
+
return {
|
|
29
|
+
segments,
|
|
30
|
+
pushEvent: useCallback((event) => {
|
|
31
|
+
const toolCall = parseToolEvent(event);
|
|
32
|
+
if (!toolCall) return;
|
|
33
|
+
if (event.type === "tool.invocation" || event.type === "tool_use") {
|
|
34
|
+
pendingToolsRef.current.set(toolCall.id, toolCall);
|
|
35
|
+
setSegments((prev) => [...prev, {
|
|
36
|
+
kind: "tool_call",
|
|
37
|
+
call: {
|
|
38
|
+
...toolCall,
|
|
39
|
+
status: "running"
|
|
40
|
+
}
|
|
41
|
+
}]);
|
|
42
|
+
lastSegmentKindRef.current = "tool";
|
|
43
|
+
}
|
|
44
|
+
}, []),
|
|
45
|
+
pushText,
|
|
46
|
+
completeToolCall: useCallback((id, result) => {
|
|
47
|
+
const pending = pendingToolsRef.current.get(id);
|
|
48
|
+
if (pending) {
|
|
49
|
+
pending.status = result.error ? "error" : "success";
|
|
50
|
+
pending.output = result.output || result.error;
|
|
51
|
+
pending.duration = result.duration;
|
|
52
|
+
pendingToolsRef.current.delete(id);
|
|
53
|
+
}
|
|
54
|
+
setSegments((prev) => prev.map((seg) => {
|
|
55
|
+
if (seg.kind === "tool_call" && seg.call.id === id) return {
|
|
56
|
+
kind: "tool_call",
|
|
57
|
+
call: {
|
|
58
|
+
...seg.call,
|
|
59
|
+
status: result.error ? "error" : "success",
|
|
60
|
+
output: result.output || result.error,
|
|
61
|
+
duration: result.duration
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
return seg;
|
|
65
|
+
}));
|
|
66
|
+
}, []),
|
|
67
|
+
reset: useCallback(() => {
|
|
68
|
+
setSegments([]);
|
|
69
|
+
pendingToolsRef.current.clear();
|
|
70
|
+
lastSegmentKindRef.current = null;
|
|
71
|
+
}, [])
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { useToolCallStream };
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,49 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
email: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
tier: string;
|
|
15
|
-
github?: {
|
|
16
|
-
login: string;
|
|
17
|
-
connected: boolean;
|
|
18
|
-
} | null;
|
|
19
|
-
session_expires_at?: string;
|
|
20
|
-
}
|
|
21
|
-
export interface UseAuthOptions {
|
|
22
|
-
apiBaseUrl: string;
|
|
23
|
-
revalidateOnFocus?: boolean;
|
|
24
|
-
shouldRetryOnError?: boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface UseAuthResult {
|
|
27
|
-
user: AuthUser | null;
|
|
28
|
-
isLoading: boolean;
|
|
29
|
-
isError: boolean;
|
|
30
|
-
error: Error | null;
|
|
31
|
-
mutate: () => Promise<void>;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Hook for managing authentication state.
|
|
35
|
-
* Fetches user session from the API and provides loading/error states.
|
|
36
|
-
*/
|
|
37
|
-
export declare function useAuth({ apiBaseUrl, revalidateOnFocus, shouldRetryOnError }: UseAuthOptions): UseAuthResult;
|
|
38
|
-
/**
|
|
39
|
-
* Creates a fetcher function that includes auth credentials.
|
|
40
|
-
* Uses both cookie-based session and localStorage API key for backwards compatibility.
|
|
41
|
-
*/
|
|
42
|
-
export declare function createAuthFetcher(_apiBaseUrl: string): <T = unknown>(url: string, options?: RequestInit) => Promise<T>;
|
|
43
|
-
/**
|
|
44
|
-
* Hook to get the API key from localStorage.
|
|
45
|
-
* For backwards compatibility with API key-based auth.
|
|
46
|
-
*/
|
|
47
|
-
export declare function useApiKey(): string | null;
|
|
48
|
-
//#endregion
|
|
49
|
-
export { AgentStreamEvent, AppendUserMessageOptions, ApplySdkEventOptions, AutomationStreamEvent, BeginAssistantMessageOptions, BotStreamEvent, CompleteAssistantMessageOptions, ConnectionState, RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, SSEEvent, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, TaskStreamEvent, TerminalStreamEvent, UseRunGroupsOptions, UseSSEStreamOptions, UseSSEStreamResult, UseSdkSessionOptions, UseSdkSessionReturn, UseToolCallStreamReturn, useAutoScroll, useDropdownMenu, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useToolCallStream };
|
|
1
|
+
import { useAutoScroll } from "./hooks/use-auto-scroll.js";
|
|
2
|
+
import { useDropdownMenu } from "./hooks/use-dropdown-menu.js";
|
|
3
|
+
import { useLiveTime } from "./hooks/use-live-time.js";
|
|
4
|
+
import { useRunCollapseState } from "./hooks/use-run-collapse-state.js";
|
|
5
|
+
import { UseRunGroupsOptions, useRunGroups } from "./hooks/use-run-groups.js";
|
|
6
|
+
import { UseToolCallStreamReturn, useToolCallStream } from "./hooks/use-tool-call-stream.js";
|
|
7
|
+
import { AuthUser, UseAuthOptions, UseAuthResult, createAuthFetcher, useApiKey, useAuth } from "./hooks/use-auth.js";
|
|
8
|
+
import { AppendUserMessageOptions, ApplySdkEventOptions, BeginAssistantMessageOptions, CompleteAssistantMessageOptions, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, UseSdkSessionOptions, UseSdkSessionReturn, useSdkSession } from "./hooks/use-sdk-session.js";
|
|
9
|
+
import { RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, useRealtimeSession } from "./hooks/use-realtime-session.js";
|
|
10
|
+
import { AgentStreamEvent, AutomationStreamEvent, BotStreamEvent, ConnectionState, SSEEvent, TaskStreamEvent, TerminalStreamEvent, UseSSEStreamOptions, UseSSEStreamResult, useSSEStream } from "./hooks/use-sse-stream.js";
|
|
11
|
+
export { AgentStreamEvent, AppendUserMessageOptions, ApplySdkEventOptions, AuthUser, AutomationStreamEvent, BeginAssistantMessageOptions, BotStreamEvent, CompleteAssistantMessageOptions, ConnectionState, RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, SSEEvent, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, TaskStreamEvent, TerminalStreamEvent, UseAuthOptions, UseAuthResult, UseRunGroupsOptions, UseSSEStreamOptions, UseSSEStreamResult, UseSdkSessionOptions, UseSdkSessionReturn, UseToolCallStreamReturn, createAuthFetcher, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useLiveTime, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useToolCallStream };
|
package/dist/hooks.js
CHANGED
|
@@ -1,111 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
React.useEffect(() => {
|
|
12
|
-
const delay = Math.max(Number.isFinite(intervalMs) && intervalMs > 0 ? intervalMs : 1e3, 100);
|
|
13
|
-
const id = window.setInterval(() => {
|
|
14
|
-
setNow(Date.now());
|
|
15
|
-
}, delay);
|
|
16
|
-
return () => {
|
|
17
|
-
window.clearInterval(id);
|
|
18
|
-
};
|
|
19
|
-
}, [intervalMs]);
|
|
20
|
-
return now;
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/hooks/use-auth.ts
|
|
24
|
-
/**
|
|
25
|
-
* Hook for managing authentication state.
|
|
26
|
-
* Fetches user session from the API and provides loading/error states.
|
|
27
|
-
*/
|
|
28
|
-
function useAuth({ apiBaseUrl, revalidateOnFocus = false, shouldRetryOnError = false }) {
|
|
29
|
-
const [user, setUser] = React.useState(null);
|
|
30
|
-
const [isLoading, setIsLoading] = React.useState(true);
|
|
31
|
-
const [error, setError] = React.useState(null);
|
|
32
|
-
const retryTimerRef = React.useRef(null);
|
|
33
|
-
const abortRef = React.useRef(null);
|
|
34
|
-
const fetchSession = React.useCallback(async () => {
|
|
35
|
-
abortRef.current?.abort();
|
|
36
|
-
const controller = new AbortController();
|
|
37
|
-
abortRef.current = controller;
|
|
38
|
-
setIsLoading(true);
|
|
39
|
-
setError(null);
|
|
40
|
-
try {
|
|
41
|
-
const res = await fetch(`${apiBaseUrl}/auth/session`, {
|
|
42
|
-
credentials: "include",
|
|
43
|
-
signal: controller.signal
|
|
44
|
-
});
|
|
45
|
-
if (!res.ok) throw new Error("Not authenticated");
|
|
46
|
-
const data = await res.json();
|
|
47
|
-
if (data.success && data.data) setUser(data.data);
|
|
48
|
-
else setUser(null);
|
|
49
|
-
} catch (err) {
|
|
50
|
-
if (err.name === "AbortError") return;
|
|
51
|
-
setError(err instanceof Error ? err : /* @__PURE__ */ new Error("Unknown error"));
|
|
52
|
-
setUser(null);
|
|
53
|
-
if (shouldRetryOnError) {
|
|
54
|
-
if (retryTimerRef.current) clearTimeout(retryTimerRef.current);
|
|
55
|
-
retryTimerRef.current = setTimeout(fetchSession, 5e3);
|
|
56
|
-
}
|
|
57
|
-
} finally {
|
|
58
|
-
if (!controller.signal.aborted) setIsLoading(false);
|
|
59
|
-
}
|
|
60
|
-
}, [apiBaseUrl, shouldRetryOnError]);
|
|
61
|
-
React.useEffect(() => {
|
|
62
|
-
fetchSession();
|
|
63
|
-
return () => {
|
|
64
|
-
abortRef.current?.abort();
|
|
65
|
-
if (retryTimerRef.current) clearTimeout(retryTimerRef.current);
|
|
66
|
-
};
|
|
67
|
-
}, [fetchSession]);
|
|
68
|
-
React.useEffect(() => {
|
|
69
|
-
if (!revalidateOnFocus) return;
|
|
70
|
-
const handleFocus = () => {
|
|
71
|
-
fetchSession();
|
|
72
|
-
};
|
|
73
|
-
window.addEventListener("focus", handleFocus);
|
|
74
|
-
return () => window.removeEventListener("focus", handleFocus);
|
|
75
|
-
}, [revalidateOnFocus, fetchSession]);
|
|
76
|
-
return {
|
|
77
|
-
user,
|
|
78
|
-
isLoading,
|
|
79
|
-
isError: !!error,
|
|
80
|
-
error,
|
|
81
|
-
mutate: fetchSession
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Creates a fetcher function that includes auth credentials.
|
|
86
|
-
* Uses both cookie-based session and localStorage API key for backwards compatibility.
|
|
87
|
-
*/
|
|
88
|
-
function createAuthFetcher(_apiBaseUrl) {
|
|
89
|
-
return async function authFetcher(url, options) {
|
|
90
|
-
const res = await fetch(url, {
|
|
91
|
-
...options,
|
|
92
|
-
credentials: "include",
|
|
93
|
-
headers: { ...options?.headers }
|
|
94
|
-
});
|
|
95
|
-
if (!res.ok) throw new Error(`Request failed with status ${res.status}`);
|
|
96
|
-
return res.json();
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Hook to get the API key from localStorage.
|
|
101
|
-
* For backwards compatibility with API key-based auth.
|
|
102
|
-
*/
|
|
103
|
-
function useApiKey() {
|
|
104
|
-
const [apiKey, setApiKey] = React.useState(null);
|
|
105
|
-
React.useEffect(() => {
|
|
106
|
-
if (typeof window !== "undefined") setApiKey(localStorage.getItem("apiKey"));
|
|
107
|
-
}, []);
|
|
108
|
-
return apiKey;
|
|
109
|
-
}
|
|
110
|
-
//#endregion
|
|
1
|
+
import { useRunGroups } from "./hooks/use-run-groups.js";
|
|
2
|
+
import { useRunCollapseState } from "./hooks/use-run-collapse-state.js";
|
|
3
|
+
import { useAutoScroll } from "./hooks/use-auto-scroll.js";
|
|
4
|
+
import { useDropdownMenu } from "./hooks/use-dropdown-menu.js";
|
|
5
|
+
import { useLiveTime } from "./hooks/use-live-time.js";
|
|
6
|
+
import { useToolCallStream } from "./hooks/use-tool-call-stream.js";
|
|
7
|
+
import { createAuthFetcher, useApiKey, useAuth } from "./hooks/use-auth.js";
|
|
8
|
+
import { RealtimeSessionRegistry, useRealtimeSession } from "./hooks/use-realtime-session.js";
|
|
9
|
+
import { useSdkSession } from "./hooks/use-sdk-session.js";
|
|
10
|
+
import { useSSEStream } from "./hooks/use-sse-stream.js";
|
|
111
11
|
export { RealtimeSessionRegistry, createAuthFetcher, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useLiveTime, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useToolCallStream };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,102 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
1
|
+
import { Button, ButtonProps, buttonVariants } from "./primitives/button.js";
|
|
2
|
+
import { AuthHeader, AuthHeaderProps, GitHubLoginButton, GitHubLoginButtonProps, SessionUser, UserMenu, UserMenuProps } from "./auth/auth.js";
|
|
3
|
+
import { LoginLayout, LoginLayoutProps } from "./auth/login-layout.js";
|
|
4
|
+
import "./auth.js";
|
|
5
|
+
import { SessionMessage } from "./types/message.js";
|
|
6
|
+
import { ReasoningPart, SessionPart, TextPart, ToolPart, ToolState, ToolStatus, ToolTime } from "./types/parts.js";
|
|
7
|
+
import { AgentBranding } from "./types/branding.js";
|
|
8
|
+
import { CustomToolRenderer, DisplayVariant, ToolDisplayMetadata } from "./types/tool-display.js";
|
|
9
|
+
import { FinalTextPart, GroupedMessage, MessageRun, MessageUser, Run, RunStats, ToolCategory } from "./types/run.js";
|
|
10
|
+
import { Markdown, MarkdownProps, getSanitizedMarkdownHeadingIdFromRawFragment } from "./markdown/markdown.js";
|
|
11
|
+
import { OpenUIAction, OpenUIActionsNode, OpenUIArtifactRenderer, OpenUIArtifactRendererProps, OpenUIBadgeNode, OpenUICardNode, OpenUICodeNode, OpenUIComponentNode, OpenUIGridNode, OpenUIHeadingNode, OpenUIKeyValueNode, OpenUIMarkdownNode, OpenUIPrimitive, OpenUISeparatorNode, OpenUIStackNode, OpenUIStatNode, OpenUITableNode, OpenUITextNode } from "./openui/openui-artifact-renderer.js";
|
|
12
|
+
import { ChatContainer, ChatContainerProps } from "./chat/chat-container.js";
|
|
13
|
+
import { MessageList, MessageListProps } from "./chat/message-list.js";
|
|
14
|
+
import { UserMessage, UserMessageProps } from "./chat/user-message.js";
|
|
15
|
+
import { ChatMessage, ChatMessageProps, MessageRole } from "./chat/chat-message.js";
|
|
16
|
+
import { ThinkingIndicator, ThinkingIndicatorProps } from "./chat/thinking-indicator.js";
|
|
17
|
+
import { ToolCallStatus, ToolCallType } from "./run/tool-call-step.js";
|
|
18
|
+
import { FeedSegment, ToolCallData, ToolCallFeed, ToolCallFeedProps, parseToolEvent } from "./run/tool-call-feed.js";
|
|
19
|
+
import { AgentTimeline, AgentTimelineArtifactItem, AgentTimelineCustomItem, AgentTimelineItem, AgentTimelineMessageItem, AgentTimelineProps, AgentTimelineStatusItem, AgentTimelineTone, AgentTimelineToolGroupItem, AgentTimelineToolItem } from "./chat/agent-timeline.js";
|
|
20
|
+
import "./chat.js";
|
|
21
|
+
import { ArtifactPane, ArtifactPaneProps } from "./primitives/artifact-pane.js";
|
|
22
|
+
import { FileNode, FileTree, FileTreeProps, FileTreeVisibilityOptions, filterFileTree } from "./files/file-tree.js";
|
|
23
|
+
import { RichFileTree, RichFileTreeGitEntry, RichFileTreeGitStatus, RichFileTreeProps, RichFileTreeThemeVars } from "./files/rich-file-tree.js";
|
|
24
|
+
import { CSV_PREVIEW_ROW_LIMIT, FilePreview, FilePreviewProps, parseCsv } from "./files/file-preview.js";
|
|
25
|
+
import { FileTabData, FileTabs, FileTabsProps } from "./files/file-tabs.js";
|
|
26
|
+
import { FileArtifactPane, FileArtifactPaneProps } from "./files/file-artifact-pane.js";
|
|
27
|
+
import { FileFormat, FilePreviewKind, detectFileFormat, fileExtension, getCodeLanguage, getFormatLabel, getSyntaxLanguage, resolveFilePreviewKind } from "./files/file-format.js";
|
|
28
|
+
import "./files.js";
|
|
29
|
+
import { useAutoScroll } from "./hooks/use-auto-scroll.js";
|
|
30
|
+
import { useDropdownMenu } from "./hooks/use-dropdown-menu.js";
|
|
31
|
+
import { useLiveTime } from "./hooks/use-live-time.js";
|
|
32
|
+
import { useRunCollapseState } from "./hooks/use-run-collapse-state.js";
|
|
33
|
+
import { UseRunGroupsOptions, useRunGroups } from "./hooks/use-run-groups.js";
|
|
34
|
+
import { UseToolCallStreamReturn, useToolCallStream } from "./hooks/use-tool-call-stream.js";
|
|
35
|
+
import { AuthUser, UseAuthOptions, UseAuthResult, createAuthFetcher, useApiKey, useAuth } from "./hooks/use-auth.js";
|
|
36
|
+
import { AppendUserMessageOptions, ApplySdkEventOptions, BeginAssistantMessageOptions, CompleteAssistantMessageOptions, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, UseSdkSessionOptions, UseSdkSessionReturn, useSdkSession } from "./hooks/use-sdk-session.js";
|
|
37
|
+
import { ActiveProjectActivity, ActiveSessionActivityOptions, ActiveSessionConnectionOptions, ActiveSessionConnectionState, ActiveSessionReconnectState, ActiveSessionRecord, ActiveSessionStatus, ActiveSessionTransportMode, ActiveSessionsState, RegisterActiveSessionOptions, SessionProjectKey, activeSessionsAtom, bumpActiveSessionActivity, getActiveSession, getAllActiveSessions, getAllProjectActivity, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getTotalRunningSessionCount, hasBackgroundRunningSessions, registerActiveSession, resetActiveSessions, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, unregisterActiveSession, updateActiveSessionMeta, useActiveSession, useActiveSessions, useActiveSessionsState, useHasBackgroundRunningSessions, useNavbarSessions, useProjectActivity, useProjectSessions, useSessionsByActivity, useTotalRunningSessions } from "./stores/active-sessions-store.js";
|
|
38
|
+
import { RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, useRealtimeSession } from "./hooks/use-realtime-session.js";
|
|
39
|
+
import { AgentStreamEvent, AutomationStreamEvent, BotStreamEvent, ConnectionState, SSEEvent, TaskStreamEvent, TerminalStreamEvent, UseSSEStreamOptions, UseSSEStreamResult, useSSEStream } from "./hooks/use-sse-stream.js";
|
|
40
|
+
import "./hooks.js";
|
|
41
|
+
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CardTitleProps } from "./primitives/card.js";
|
|
42
|
+
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./primitives/dialog.js";
|
|
43
|
+
import { Input, InputProps, Textarea, TextareaProps } from "./primitives/input.js";
|
|
44
|
+
import { Badge, BadgeProps, badgeVariants } from "./primitives/badge.js";
|
|
45
|
+
import { Avatar, AvatarFallback, AvatarImage } from "./primitives/avatar.js";
|
|
46
|
+
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./primitives/dropdown-menu.js";
|
|
47
|
+
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from "./primitives/select.js";
|
|
48
|
+
import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableProps, TableRow } from "./primitives/table.js";
|
|
49
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./primitives/tabs.js";
|
|
50
|
+
import { SegmentedControl, SegmentedControlOption, SegmentedControlProps } from "./primitives/segmented-control.js";
|
|
51
|
+
import { Progress } from "./primitives/progress.js";
|
|
52
|
+
import { Switch } from "./primitives/switch.js";
|
|
53
|
+
import { Skeleton, SkeletonCard, SkeletonTable } from "./primitives/skeleton.js";
|
|
54
|
+
import { TextShimmer, TextShimmerProps } from "./primitives/text-shimmer.js";
|
|
55
|
+
import { Toast, ToastContainer, ToastProvider, useToast } from "./primitives/toast.js";
|
|
56
|
+
import { Label } from "./primitives/label.js";
|
|
57
|
+
import { EmptyState, EmptyStateProps } from "./primitives/empty-state.js";
|
|
58
|
+
import { StatCard, StatCardProps } from "./primitives/stat-card.js";
|
|
59
|
+
import { TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine } from "./primitives/terminal-display.js";
|
|
60
|
+
import { DropZone, DropZoneProps } from "./primitives/drop-zone.js";
|
|
61
|
+
import { UploadFile, UploadProgress, UploadProgressProps } from "./primitives/upload-progress.js";
|
|
62
|
+
import { SidebarDropZone, SidebarDropZoneProps } from "./primitives/sidebar-drop-zone.js";
|
|
63
|
+
import { CodeBlock, CodeBlockProps, CopyButton } from "./markdown/code-block.js";
|
|
64
|
+
import { InlineCode, InlineCodeProps } from "./primitives/code-block.js";
|
|
65
|
+
import { ThemeToggle, useTheme } from "./primitives/theme-toggle.js";
|
|
66
|
+
import { Heading, HeadingProps, HeadingVariant } from "./primitives/heading.js";
|
|
67
|
+
import { PageShell, PageShellProps } from "./primitives/page-shell.js";
|
|
68
|
+
import { PageHeader, PageHeaderProps } from "./primitives/page-header.js";
|
|
69
|
+
import { StatusPill, StatusPillProps, StatusTone } from "./primitives/status-pill.js";
|
|
70
|
+
import { Metric, MetricProps, MetricStrip, MetricStripProps } from "./primitives/metric-strip.js";
|
|
71
|
+
import { FilterField, FilterFieldProps, Toolbar, ToolbarProps } from "./primitives/toolbar.js";
|
|
72
|
+
import { Logo, LogoProps, TangleKnot } from "./primitives.js";
|
|
73
|
+
import { RunGroup, RunGroupProps } from "./run/run-group.js";
|
|
74
|
+
import { RunRowShell, RunRowShellProps, RunRowStatus, RunRowStatusDot } from "./run/run-row-shell.js";
|
|
75
|
+
import { InlineToolItem, InlineToolItemProps } from "./run/inline-tool-item.js";
|
|
76
|
+
import { InlineThinkingItem, InlineThinkingItemProps } from "./run/inline-thinking-item.js";
|
|
77
|
+
import { ExpandedToolDetail, ExpandedToolDetailProps } from "./run/expanded-tool-detail.js";
|
|
78
|
+
import { LiveDuration } from "./run/run-item-primitives.js";
|
|
79
|
+
import "./run.js";
|
|
80
|
+
import { OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES } from "./openui/schema-data.js";
|
|
81
|
+
import { OpenUISchemaIssue, OpenUISchemaValidation, findUnsupportedOpenUINode, validateOpenUIJsonArtifact, validateOpenUIJsonNode } from "./openui-schema.js";
|
|
21
82
|
import "./openui.js";
|
|
22
83
|
import "./markdown.js";
|
|
23
|
-
import { addMessage, addParts, clearChat, isStreamingAtom, messagesAtom, partMapAtom, updatePart } from "./stores.js";
|
|
84
|
+
import { addMessage, addParts, clearChat, isStreamingAtom, messagesAtom, partMapAtom, updatePart } from "./stores/chat-store.js";
|
|
24
85
|
import "./types.js";
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
|
|
86
|
+
import { copyText } from "./utils/copy-text.js";
|
|
87
|
+
import { formatBytes, formatDuration, formatUptime, truncateText } from "./utils/format.js";
|
|
88
|
+
import { timeAgo } from "./utils/time-ago.js";
|
|
89
|
+
import { TOOL_CATEGORY_ICONS, getToolCategory, getToolDisplayMetadata, getToolErrorText } from "./utils/tool-display.js";
|
|
90
|
+
import { cn } from "./lib/utils.js";
|
|
91
|
+
import { focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset } from "./lib/focus.js";
|
|
92
|
+
import "./utils.js";
|
|
93
|
+
import { CommandPreview, CommandPreviewProps } from "./tool-previews/command-preview.js";
|
|
94
|
+
import { WriteFilePreview, WriteFilePreviewProps } from "./tool-previews/write-file-preview.js";
|
|
95
|
+
import { GrepResultsPreview, GrepResultsPreviewProps } from "./tool-previews/grep-results-preview.js";
|
|
96
|
+
import { GlobResultsPreview, GlobResultsPreviewProps } from "./tool-previews/glob-results-preview.js";
|
|
97
|
+
import { WebSearchPreview, WebSearchPreviewProps } from "./tool-previews/web-search-preview.js";
|
|
98
|
+
import { QuestionPreview, QuestionPreviewProps } from "./tool-previews/question-preview.js";
|
|
99
|
+
import { DiffPreview, DiffPreviewProps } from "./tool-previews/diff-preview.js";
|
|
100
|
+
import { RedactedDocSegment, RedactedDocument, RedactedDocumentData, RedactedDocumentProps, RevealResult } from "./redaction/redacted-document.js";
|
|
101
|
+
import "./redaction.js";
|
|
102
|
+
export { ActiveProjectActivity, ActiveSessionActivityOptions, ActiveSessionConnectionOptions, ActiveSessionConnectionState, ActiveSessionReconnectState, ActiveSessionRecord, ActiveSessionStatus, ActiveSessionTransportMode, ActiveSessionsState, AgentBranding, AgentStreamEvent, AgentTimeline, type AgentTimelineArtifactItem, type AgentTimelineCustomItem, type AgentTimelineItem, type AgentTimelineMessageItem, type AgentTimelineProps, type AgentTimelineStatusItem, type AgentTimelineTone, type AgentTimelineToolGroupItem, type AgentTimelineToolItem, AppendUserMessageOptions, ApplySdkEventOptions, ArtifactPane, type ArtifactPaneProps, AuthHeader, type AuthHeaderProps, AuthUser, AutomationStreamEvent, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, BeginAssistantMessageOptions, BotStreamEvent, Button, type ButtonProps, CSV_PREVIEW_ROW_LIMIT, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CardTitleProps, ChatContainer, type ChatContainerProps, ChatMessage, type ChatMessageProps, CodeBlock, type CodeBlockProps, CommandPreview, type CommandPreviewProps, CompleteAssistantMessageOptions, ConnectionState, CopyButton, CustomToolRenderer, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffPreview, type DiffPreviewProps, DisplayVariant, DropZone, type DropZoneProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ExpandedToolDetail, type ExpandedToolDetailProps, type FeedSegment, FileArtifactPane, type FileArtifactPaneProps, type FileFormat, type FileNode, FilePreview, type FilePreviewKind, type FilePreviewProps, type FileTabData, FileTabs, type FileTabsProps, FileTree, type FileTreeProps, type FileTreeVisibilityOptions, FilterField, type FilterFieldProps, FinalTextPart, GitHubLoginButton, type GitHubLoginButtonProps, GlobResultsPreview, type GlobResultsPreviewProps, GrepResultsPreview, type GrepResultsPreviewProps, GroupedMessage, Heading, type HeadingProps, type HeadingVariant, InlineCode, type InlineCodeProps, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, Input, type InputProps, Label, LiveDuration, LoginLayout, type LoginLayoutProps, Logo, type LogoProps, Markdown, type MarkdownProps, MessageList, type MessageListProps, type MessageRole, MessageRun, MessageUser, Metric, type MetricProps, MetricStrip, type MetricStripProps, OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, type OpenUIAction, type OpenUIActionsNode, OpenUIArtifactRenderer, type OpenUIArtifactRendererProps, type OpenUIBadgeNode, type OpenUICardNode, type OpenUICodeNode, type OpenUIComponentNode, type OpenUIGridNode, type OpenUIHeadingNode, type OpenUIKeyValueNode, type OpenUIMarkdownNode, type OpenUIPrimitive, type OpenUISchemaIssue, type OpenUISchemaValidation, type OpenUISeparatorNode, type OpenUIStackNode, type OpenUIStatNode, type OpenUITableNode, type OpenUITextNode, PageHeader, type PageHeaderProps, PageShell, type PageShellProps, Progress, QuestionPreview, type QuestionPreviewProps, RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, ReasoningPart, type RedactedDocSegment, RedactedDocument, type RedactedDocumentData, type RedactedDocumentProps, RegisterActiveSessionOptions, type RevealResult, RichFileTree, type RichFileTreeGitEntry, type RichFileTreeGitStatus, type RichFileTreeProps, type RichFileTreeThemeVars, Run, RunGroup, type RunGroupProps, RunRowShell, type RunRowShellProps, type RunRowStatus, RunRowStatusDot, RunStats, SSEEvent, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SessionMessage, SessionPart, SessionProjectKey, type SessionUser, SidebarDropZone, type SidebarDropZoneProps, Skeleton, SkeletonCard, SkeletonTable, StatCard, type StatCardProps, StatusPill, type StatusPillProps, type StatusTone, Switch, TOOL_CATEGORY_ICONS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableProps, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TangleKnot, TaskStreamEvent, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TerminalStreamEvent, TextPart, TextShimmer, type TextShimmerProps, Textarea, type TextareaProps, ThemeToggle, ThinkingIndicator, type ThinkingIndicatorProps, type Toast, ToastContainer, ToastProvider, type ToolCallData, ToolCallFeed, type ToolCallFeedProps, type ToolCallStatus, type ToolCallType, ToolCategory, ToolDisplayMetadata, ToolPart, ToolState, ToolStatus, ToolTime, Toolbar, type ToolbarProps, type UploadFile, UploadProgress, type UploadProgressProps, UseAuthOptions, UseAuthResult, UseRunGroupsOptions, UseSSEStreamOptions, UseSSEStreamResult, UseSdkSessionOptions, UseSdkSessionReturn, UseToolCallStreamReturn, UserMenu, type UserMenuProps, UserMessage, type UserMessageProps, WebSearchPreview, type WebSearchPreviewProps, WriteFilePreview, type WriteFilePreviewProps, activeSessionsAtom, addMessage, addParts, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, copyText, createAuthFetcher, detectFileFormat, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatBytes, formatDuration, formatUptime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, isStreamingAtom, messagesAtom, parseCsv, parseToolEvent, partMapAtom, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, timeAgo, truncateText, unregisterActiveSession, updateActiveSessionMeta, updatePart, useActiveSession, useActiveSessions, useActiveSessionsState, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
|
package/dist/index.js
CHANGED
|
@@ -1,36 +1,86 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import "./
|
|
25
|
-
import {
|
|
26
|
-
import "./
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import "./
|
|
33
|
-
import {
|
|
34
|
-
import "./
|
|
35
|
-
import {
|
|
36
|
-
|
|
1
|
+
import { focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset } from "./lib/focus.js";
|
|
2
|
+
import { cn } from "./lib/utils.js";
|
|
3
|
+
import { Button, buttonVariants } from "./primitives/button.js";
|
|
4
|
+
import { Heading } from "./primitives/heading.js";
|
|
5
|
+
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./primitives/card.js";
|
|
6
|
+
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./primitives/dialog.js";
|
|
7
|
+
import { Label } from "./primitives/label.js";
|
|
8
|
+
import { Input, Textarea } from "./primitives/input.js";
|
|
9
|
+
import { Badge, badgeVariants } from "./primitives/badge.js";
|
|
10
|
+
import { Avatar, AvatarFallback, AvatarImage } from "./primitives/avatar.js";
|
|
11
|
+
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./primitives/dropdown-menu.js";
|
|
12
|
+
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from "./primitives/select.js";
|
|
13
|
+
import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "./primitives/table.js";
|
|
14
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./primitives/tabs.js";
|
|
15
|
+
import { SegmentedControl } from "./primitives/segmented-control.js";
|
|
16
|
+
import { Progress } from "./primitives/progress.js";
|
|
17
|
+
import { Switch } from "./primitives/switch.js";
|
|
18
|
+
import { Skeleton, SkeletonCard, SkeletonTable } from "./primitives/skeleton.js";
|
|
19
|
+
import { TextShimmer } from "./primitives/text-shimmer.js";
|
|
20
|
+
import { ToastContainer, ToastProvider, useToast } from "./primitives/toast.js";
|
|
21
|
+
import { EmptyState } from "./primitives/empty-state.js";
|
|
22
|
+
import { StatCard } from "./primitives/stat-card.js";
|
|
23
|
+
import { TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine } from "./primitives/terminal-display.js";
|
|
24
|
+
import { DropZone } from "./primitives/drop-zone.js";
|
|
25
|
+
import { UploadProgress } from "./primitives/upload-progress.js";
|
|
26
|
+
import { SidebarDropZone } from "./primitives/sidebar-drop-zone.js";
|
|
27
|
+
import { ArtifactPane } from "./primitives/artifact-pane.js";
|
|
28
|
+
import { CodeBlock, CopyButton } from "./markdown/code-block.js";
|
|
29
|
+
import { InlineCode } from "./primitives/code-block.js";
|
|
30
|
+
import { ThemeToggle, useTheme } from "./primitives/theme-toggle.js";
|
|
31
|
+
import { PageShell } from "./primitives/page-shell.js";
|
|
32
|
+
import { PageHeader } from "./primitives/page-header.js";
|
|
33
|
+
import { StatusPill } from "./primitives/status-pill.js";
|
|
34
|
+
import { Metric, MetricStrip } from "./primitives/metric-strip.js";
|
|
35
|
+
import { FilterField, Toolbar } from "./primitives/toolbar.js";
|
|
36
|
+
import { Logo, TangleKnot } from "./primitives.js";
|
|
37
|
+
import { TOOL_CATEGORY_ICONS, getToolCategory, getToolDisplayMetadata, getToolErrorText } from "./utils/tool-display.js";
|
|
38
|
+
import { useRunGroups } from "./hooks/use-run-groups.js";
|
|
39
|
+
import { useRunCollapseState } from "./hooks/use-run-collapse-state.js";
|
|
40
|
+
import { useAutoScroll } from "./hooks/use-auto-scroll.js";
|
|
41
|
+
import { formatBytes, formatDuration, formatUptime, truncateText } from "./utils/format.js";
|
|
42
|
+
import { CommandPreview } from "./tool-previews/command-preview.js";
|
|
43
|
+
import { detectFileFormat, fileExtension, getCodeLanguage, getFormatLabel, getSyntaxLanguage, resolveFilePreviewKind } from "./files/file-format.js";
|
|
44
|
+
import { WriteFilePreview } from "./tool-previews/write-file-preview.js";
|
|
45
|
+
import { GrepResultsPreview } from "./tool-previews/grep-results-preview.js";
|
|
46
|
+
import { GlobResultsPreview } from "./tool-previews/glob-results-preview.js";
|
|
47
|
+
import { WebSearchPreview } from "./tool-previews/web-search-preview.js";
|
|
48
|
+
import { QuestionPreview } from "./tool-previews/question-preview.js";
|
|
49
|
+
import { DiffPreview } from "./tool-previews/diff-preview.js";
|
|
50
|
+
import { ExpandedToolDetail } from "./run/expanded-tool-detail.js";
|
|
51
|
+
import { RunRowShell, RunRowStatusDot } from "./run/run-row-shell.js";
|
|
52
|
+
import { InlineToolItem } from "./run/inline-tool-item.js";
|
|
53
|
+
import { Markdown, getSanitizedMarkdownHeadingIdFromRawFragment } from "./markdown/markdown.js";
|
|
54
|
+
import { InlineThinkingItem } from "./run/inline-thinking-item.js";
|
|
55
|
+
import { OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES } from "./openui/schema-data.js";
|
|
56
|
+
import { findUnsupportedOpenUINode, validateOpenUIJsonArtifact, validateOpenUIJsonNode } from "./openui-schema.js";
|
|
57
|
+
import { OpenUIArtifactRenderer } from "./openui/openui-artifact-renderer.js";
|
|
58
|
+
import { RunGroup } from "./run/run-group.js";
|
|
59
|
+
import { UserMessage } from "./chat/user-message.js";
|
|
60
|
+
import { MessageList } from "./chat/message-list.js";
|
|
61
|
+
import { ThinkingIndicator } from "./chat/thinking-indicator.js";
|
|
62
|
+
import { AgentTimeline } from "./chat/agent-timeline.js";
|
|
63
|
+
import { ChatContainer } from "./chat/chat-container.js";
|
|
64
|
+
import { ChatMessage } from "./chat/chat-message.js";
|
|
65
|
+
import { LiveDuration } from "./run/run-item-primitives.js";
|
|
66
|
+
import { ToolCallFeed, parseToolEvent } from "./run/tool-call-feed.js";
|
|
67
|
+
import { FileTree, filterFileTree } from "./files/file-tree.js";
|
|
68
|
+
import { RichFileTree } from "./files/rich-file-tree.js";
|
|
69
|
+
import { CSV_PREVIEW_ROW_LIMIT, FilePreview, parseCsv } from "./files/file-preview.js";
|
|
70
|
+
import { FileTabs } from "./files/file-tabs.js";
|
|
71
|
+
import { FileArtifactPane } from "./files/file-artifact-pane.js";
|
|
72
|
+
import { AuthHeader, GitHubLoginButton, UserMenu } from "./auth/auth.js";
|
|
73
|
+
import { LoginLayout } from "./auth/login-layout.js";
|
|
74
|
+
import { useDropdownMenu } from "./hooks/use-dropdown-menu.js";
|
|
75
|
+
import { useLiveTime } from "./hooks/use-live-time.js";
|
|
76
|
+
import { useToolCallStream } from "./hooks/use-tool-call-stream.js";
|
|
77
|
+
import { createAuthFetcher, useApiKey, useAuth } from "./hooks/use-auth.js";
|
|
78
|
+
import { activeSessionsAtom, bumpActiveSessionActivity, getActiveSession, getAllActiveSessions, getAllProjectActivity, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getTotalRunningSessionCount, hasBackgroundRunningSessions, registerActiveSession, resetActiveSessions, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, unregisterActiveSession, updateActiveSessionMeta, useActiveSession, useActiveSessions, useActiveSessionsState, useHasBackgroundRunningSessions, useNavbarSessions, useProjectActivity, useProjectSessions, useSessionsByActivity, useTotalRunningSessions } from "./stores/active-sessions-store.js";
|
|
79
|
+
import { RealtimeSessionRegistry, useRealtimeSession } from "./hooks/use-realtime-session.js";
|
|
80
|
+
import { useSdkSession } from "./hooks/use-sdk-session.js";
|
|
81
|
+
import { useSSEStream } from "./hooks/use-sse-stream.js";
|
|
82
|
+
import { addMessage, addParts, clearChat, isStreamingAtom, messagesAtom, partMapAtom, updatePart } from "./stores/chat-store.js";
|
|
83
|
+
import { copyText } from "./utils/copy-text.js";
|
|
84
|
+
import { timeAgo } from "./utils/time-ago.js";
|
|
85
|
+
import { RedactedDocument } from "./redaction/redacted-document.js";
|
|
86
|
+
export { AgentTimeline, ArtifactPane, AuthHeader, Avatar, AvatarFallback, AvatarImage, Badge, Button, CSV_PREVIEW_ROW_LIMIT, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatContainer, ChatMessage, CodeBlock, CommandPreview, CopyButton, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffPreview, DropZone, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ExpandedToolDetail, FileArtifactPane, FilePreview, FileTabs, FileTree, FilterField, GitHubLoginButton, GlobResultsPreview, GrepResultsPreview, Heading, InlineCode, InlineThinkingItem, InlineToolItem, Input, Label, LiveDuration, LoginLayout, Logo, Markdown, MessageList, Metric, MetricStrip, OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, OpenUIArtifactRenderer, PageHeader, PageShell, Progress, QuestionPreview, RealtimeSessionRegistry, RedactedDocument, RichFileTree, RunGroup, RunRowShell, RunRowStatusDot, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SidebarDropZone, Skeleton, SkeletonCard, SkeletonTable, StatCard, StatusPill, Switch, TOOL_CATEGORY_ICONS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TangleKnot, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TextShimmer, Textarea, ThemeToggle, ThinkingIndicator, ToastContainer, ToastProvider, ToolCallFeed, Toolbar, UploadProgress, UserMenu, UserMessage, WebSearchPreview, WriteFilePreview, activeSessionsAtom, addMessage, addParts, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, copyText, createAuthFetcher, detectFileFormat, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatBytes, formatDuration, formatUptime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, isStreamingAtom, messagesAtom, parseCsv, parseToolEvent, partMapAtom, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, timeAgo, truncateText, unregisterActiveSession, updateActiveSessionMeta, updatePart, useActiveSession, useActiveSessions, useActiveSessionsState, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
|