@mcp-b/react-components 0.26.1 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AgentChat-B6sgfQ_q.d.ts → AgentChat-CHEz8ts_.d.ts} +5 -5
- package/dist/{AgentChatStartScreen-DDZ25aax.d.ts → AgentChatStartScreen-DXZ0hAX0.d.ts} +23 -5
- package/dist/{PromptInput-CES0WO4u.d.ts → PromptInput-B75Np5VB.d.ts} +7 -1
- package/dist/SessionCompaction-DMa1vv6Y.d.ts +59 -0
- package/dist/{ThinkChat-DVhCEjq-.js → ThinkChat-Bp-nAnoW.js} +14 -2
- package/dist/{ThinkChatActivity-DawPYgga.d.ts → ThinkChatActivity-C2uaL3el.d.ts} +3 -3
- package/dist/{ThinkChatActivitySummary-kr5fE0wg.d.ts → ThinkChatActivitySummary-F062wneC.d.ts} +1 -1
- package/dist/{ThinkChatToolParts-CSzVwMXf.d.ts → ThinkChatToolParts-BfroXQ4F.d.ts} +19 -1
- package/dist/{Workspace-CIycQ4xE.d.ts → Workspace-Bn6In4wi.d.ts} +5 -1
- package/dist/{WorkspaceExplorer-BCipn7Vd.d.ts → WorkspaceExplorer-D0aiscG6.d.ts} +1 -1
- package/dist/components/ActionGuide.d.ts +23 -5
- package/dist/components/ActionGuide.js +18 -4
- package/dist/components/AgentChat.d.ts +1 -1
- package/dist/components/AgentChat.js +1 -1
- package/dist/components/AgentChatStartScreen.d.ts +2 -2
- package/dist/components/AgentChatStartScreen.js +16 -5
- package/dist/components/AgentConnection.d.ts +1 -1
- package/dist/components/AgentToolDetail.js +1 -1
- package/dist/components/ChatGptSignInScreen.d.ts +9 -1
- package/dist/components/ChatGptSignInScreen.js +15 -4
- package/dist/components/ConversationTabPicker.d.ts +31 -0
- package/dist/components/ConversationTabPicker.js +117 -0
- package/dist/components/Goal.d.ts +29 -2
- package/dist/components/Goal.js +78 -4
- package/dist/components/McpConnectionRequest.d.ts +11 -5
- package/dist/components/McpConnectionRequest.js +22 -16
- package/dist/components/McpPluginCatalog.d.ts +1 -1
- package/dist/components/McpServerPicker.d.ts +18 -3
- package/dist/components/McpServerPicker.js +38 -23
- package/dist/components/Plan.d.ts +18 -1
- package/dist/components/Plan.js +17 -1
- package/dist/components/PromptInput.d.ts +2 -2
- package/dist/components/PromptInput.js +43 -5
- package/dist/components/SessionCompaction.d.ts +1 -58
- package/dist/components/SettingsFormDialog.d.ts +43 -0
- package/dist/components/SettingsFormDialog.js +110 -0
- package/dist/components/ThinkChat.d.ts +11 -7
- package/dist/components/ThinkChat.js +3 -3
- package/dist/components/ThinkChatActivity.d.ts +3 -3
- package/dist/components/ThinkChatActivitySummary.d.ts +1 -1
- package/dist/components/ThinkChatToolPanels.d.ts +1 -1
- package/dist/components/ThinkChatToolPanels.js +1 -1
- package/dist/components/ThinkChatToolParts.d.ts +1 -1
- package/dist/components/ThinkFullApp.d.ts +6 -12
- package/dist/components/ThinkFullApp.js +4 -4
- package/dist/components/ThinkThreadPicker.d.ts +4 -1
- package/dist/components/ThinkThreadPicker.js +6 -1
- package/dist/components/Workspace.d.ts +2 -2
- package/dist/components/Workspace.js +10 -6
- package/dist/components/WorkspaceBrowser.d.ts +1 -1
- package/dist/components/WorkspaceExplorer.d.ts +3 -3
- package/dist/components/WorkspaceExplorer.js +2 -2
- package/dist/components/WorkspaceMountManager.d.ts +32 -0
- package/dist/components/WorkspaceMountManager.js +89 -0
- package/dist/{mcp-server-catalog-BewjV7Eq.d.ts → mcp-server-catalog-CO7GAl1f.d.ts} +1 -1
- package/dist/styles/chatgpt-sign-in-screen.css +10 -1
- package/dist/styles/conversation-tab-picker.css +24 -0
- package/dist/styles/index.css +2 -0
- package/dist/styles/workspace-mount-manager.css +24 -0
- package/dist/utils/codex-model-catalog.d.ts +4 -4
- package/dist/utils/mcp-server-catalog.d.ts +1 -1
- package/dist/utils/mcp-server-catalog.js +1 -1
- package/package.json +13 -13
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as mergeBaseClassName, t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
2
|
import { Button } from "./Button.js";
|
|
3
|
-
import { C as FileIcon, F as MonitorIcon, H as PlusIcon, J as SpinnerIcon, N as MicrophoneIcon, R as PaperclipIcon, X as StopIcon, Y as SquareIcon, a as ArrowUpIcon, d as CheckIcon, f as ChevronDownIcon, nt as WrenchIcon, rt as XIcon, tt as WarningIcon, w as FolderIcon } from "../icons-B4mGvCvc.js";
|
|
3
|
+
import { C as FileIcon, F as MonitorIcon, H as PlusIcon, J as SpinnerIcon, N as MicrophoneIcon, R as PaperclipIcon, X as StopIcon, Y as SquareIcon, a as ArrowUpIcon, c as BoxIcon, d as CheckIcon, f as ChevronDownIcon, j as McpIcon, nt as WrenchIcon, rt as XIcon, tt as WarningIcon, w as FolderIcon } from "../icons-B4mGvCvc.js";
|
|
4
4
|
import { Tooltip } from "./Tooltip.js";
|
|
5
5
|
import { IconButton } from "./IconButton.js";
|
|
6
6
|
import { t as AttachmentPreview } from "../attachment-preview-DIs50Q0h.js";
|
|
@@ -250,7 +250,7 @@ function PromptInput({ className, accept, multiple, globalDrop, syncHiddenInput,
|
|
|
250
250
|
const text = controller?.textInput.value ?? textarea?.value.trim() ?? "";
|
|
251
251
|
const submittedFiles = await Promise.all(files.map(resolveSubmittedFile));
|
|
252
252
|
try {
|
|
253
|
-
|
|
253
|
+
const submission = onSubmit?.({
|
|
254
254
|
text,
|
|
255
255
|
files: submittedFiles
|
|
256
256
|
}, event);
|
|
@@ -260,6 +260,7 @@ function PromptInput({ className, accept, multiple, globalDrop, syncHiddenInput,
|
|
|
260
260
|
}
|
|
261
261
|
controller?.textInput.clear();
|
|
262
262
|
clearAttachments();
|
|
263
|
+
await submission;
|
|
263
264
|
} catch {}
|
|
264
265
|
}, [
|
|
265
266
|
clearAttachments,
|
|
@@ -521,20 +522,29 @@ function PromptInputDictation({ voice, beforeStart, className, disabled, ref, ..
|
|
|
521
522
|
React.useImperativeHandle(ref, () => buttonRef.current, []);
|
|
522
523
|
React.useEffect(() => {
|
|
523
524
|
const transcript = voice.transcript;
|
|
524
|
-
if (!transcript)
|
|
525
|
+
if (!transcript) {
|
|
526
|
+
committedTranscriptRef.current = "";
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
525
529
|
const previous = committedTranscriptRef.current;
|
|
526
530
|
const addition = transcript.startsWith(previous) ? transcript.slice(previous.length).trim() : transcript.trim();
|
|
527
531
|
committedTranscriptRef.current = transcript;
|
|
528
532
|
if (!addition) return;
|
|
529
533
|
if (controller) {
|
|
530
534
|
controller.textInput.setInput(appendDictationTranscript(controller.textInput.value, addition));
|
|
535
|
+
voice.clear();
|
|
531
536
|
return;
|
|
532
537
|
}
|
|
533
538
|
const textarea = buttonRef.current?.form?.querySelector("textarea[data-prompt-input-textarea=\"true\"]");
|
|
534
539
|
if (!textarea) return;
|
|
535
540
|
Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set?.call(textarea, appendDictationTranscript(textarea.value, addition));
|
|
536
541
|
textarea.dispatchEvent(new Event("input", { bubbles: true }));
|
|
537
|
-
|
|
542
|
+
voice.clear();
|
|
543
|
+
}, [
|
|
544
|
+
controller,
|
|
545
|
+
voice.clear,
|
|
546
|
+
voice.transcript
|
|
547
|
+
]);
|
|
538
548
|
React.useEffect(() => {
|
|
539
549
|
if (!voice.isListening) {
|
|
540
550
|
recordingStartedAtRef.current = null;
|
|
@@ -1057,6 +1067,34 @@ const PromptInputCommandGroup = Combobox.Group;
|
|
|
1057
1067
|
const PromptInputCommandGroupLabel = Combobox.GroupLabel;
|
|
1058
1068
|
const PromptInputCommandItem = Combobox.Item;
|
|
1059
1069
|
const PromptInputCommandSeparator = Combobox.Separator;
|
|
1070
|
+
/** Project whole upstream Agents MCP state into composer mention commands. */
|
|
1071
|
+
function mcpPromptInputCommands(mcp) {
|
|
1072
|
+
return Object.entries(mcp.servers).flatMap(([id, server]) => server.state === "ready" ? [{
|
|
1073
|
+
id: `mcp:${id}`,
|
|
1074
|
+
value: id,
|
|
1075
|
+
label: server.name,
|
|
1076
|
+
description: server.server_url,
|
|
1077
|
+
icon: /* @__PURE__ */ jsx(McpIcon, {}),
|
|
1078
|
+
keywords: [id, server.server_url],
|
|
1079
|
+
group: "Connected MCP servers",
|
|
1080
|
+
meta: "Connected"
|
|
1081
|
+
}] : []);
|
|
1082
|
+
}
|
|
1083
|
+
/** Project whole upstream skill descriptors into composer slash commands. */
|
|
1084
|
+
function skillPromptInputCommands(skills) {
|
|
1085
|
+
return skills.map((skill) => ({
|
|
1086
|
+
id: `skill:${skill.sourceId ?? "built-in"}:${skill.name}`,
|
|
1087
|
+
value: skill.name,
|
|
1088
|
+
label: skill.name,
|
|
1089
|
+
description: skill.description,
|
|
1090
|
+
icon: /* @__PURE__ */ jsx(BoxIcon, {}),
|
|
1091
|
+
...skill.sourceId ? {
|
|
1092
|
+
keywords: [skill.sourceId],
|
|
1093
|
+
meta: skill.sourceId
|
|
1094
|
+
} : {},
|
|
1095
|
+
group: "Skills"
|
|
1096
|
+
}));
|
|
1097
|
+
}
|
|
1060
1098
|
/**
|
|
1061
1099
|
* Controlled PromptInput textarea with slash-command discovery. The host owns
|
|
1062
1100
|
* both the command catalog and the draft policy applied after selection.
|
|
@@ -1346,4 +1384,4 @@ function createId() {
|
|
|
1346
1384
|
return globalThis.crypto?.randomUUID?.() ?? `prompt-input-${Date.now()}-${Math.random()}`;
|
|
1347
1385
|
}
|
|
1348
1386
|
//#endregion
|
|
1349
|
-
export { PromptInput, PromptInputActionAddAttachments, PromptInputActionAddScreenshot, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputApproval, PromptInputAttachment, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommand, PromptInputCommandComposer, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandGroupLabel, PromptInputCommandInput, PromptInputCommandItem, PromptInputCommandList, PromptInputCommandSeparator, PromptInputContextSelector, PromptInputDictation, PromptInputFooter, PromptInputHeader, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger, PromptInputPermissionSelector, PromptInputProvider, PromptInputReferences, PromptInputSelect, PromptInputSubmit, PromptInputTab, PromptInputTabBody, PromptInputTabItem, PromptInputTabLabel, PromptInputTabsList, PromptInputTextarea, PromptInputTools, PromptInputTray, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, usePromptInputAttachments, usePromptInputController, useProviderAttachments };
|
|
1387
|
+
export { PromptInput, PromptInputActionAddAttachments, PromptInputActionAddScreenshot, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputApproval, PromptInputAttachment, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommand, PromptInputCommandComposer, PromptInputCommandEmpty, PromptInputCommandGroup, PromptInputCommandGroupLabel, PromptInputCommandInput, PromptInputCommandItem, PromptInputCommandList, PromptInputCommandSeparator, PromptInputContextSelector, PromptInputDictation, PromptInputFooter, PromptInputHeader, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardTrigger, PromptInputPermissionSelector, PromptInputProvider, PromptInputReferences, PromptInputSelect, PromptInputSubmit, PromptInputTab, PromptInputTabBody, PromptInputTabItem, PromptInputTabLabel, PromptInputTabsList, PromptInputTextarea, PromptInputTools, PromptInputTray, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, mcpPromptInputCommands, skillPromptInputCommands, usePromptInputAttachments, usePromptInputController, useProviderAttachments };
|
|
@@ -1,59 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/components/SessionCompaction.d.ts
|
|
4
|
-
type SessionStatusPhase = "idle" | "compacting";
|
|
5
|
-
interface SessionStatusFrame {
|
|
6
|
-
phase: SessionStatusPhase;
|
|
7
|
-
/** Present on the idle frame that follows a successful compaction. */
|
|
8
|
-
compacted: boolean;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Parse a raw websocket payload as a `cf_agent_session` status frame.
|
|
12
|
-
* Returns null for every other frame on the connection.
|
|
13
|
-
*/
|
|
14
|
-
declare function parseSessionStatusFrame(data: unknown): SessionStatusFrame | null;
|
|
15
|
-
/**
|
|
16
|
-
* Parse a raw websocket payload as a `cf_agent_session_error` frame,
|
|
17
|
-
* returning its error text. Null for every other frame on the connection.
|
|
18
|
-
*/
|
|
19
|
-
declare function parseSessionErrorFrame(data: unknown): string | null;
|
|
20
|
-
/** The message-frame surface of a `useAgent` connection. */
|
|
21
|
-
interface SessionFrameSource {
|
|
22
|
-
addEventListener(type: "message", listener: (event: MessageEvent) => void): void;
|
|
23
|
-
removeEventListener(type: "message", listener: (event: MessageEvent) => void): void;
|
|
24
|
-
}
|
|
25
|
-
interface UseSessionCompactionOptions<MessageT extends UIMessage> {
|
|
26
|
-
/** The conversation agent's `useAgent` connection. */
|
|
27
|
-
agent: SessionFrameSource;
|
|
28
|
-
/** The conversation's `useAgentChat` value (status + local view setter). */
|
|
29
|
-
chat: {
|
|
30
|
-
status: ChatStatus;
|
|
31
|
-
setMessages: (messages: MessageT[]) => void;
|
|
32
|
-
};
|
|
33
|
-
/** Server read used to reload the transcript after a compaction lands. */
|
|
34
|
-
getMessages: () => Promise<MessageT[]>;
|
|
35
|
-
}
|
|
36
|
-
interface UseSessionCompactionResult {
|
|
37
|
-
compacting: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Set when the post-compaction transcript reload rejected — the local view
|
|
40
|
-
* is stale relative to the server until a retry succeeds. Surface it
|
|
41
|
-
* ("Transcript may be out of date"); the hook retries on the next status
|
|
42
|
-
* transition to `"ready"`.
|
|
43
|
-
*/
|
|
44
|
-
reloadError: unknown;
|
|
45
|
-
/**
|
|
46
|
-
* Error text from the last `cf_agent_session_error` frame — the only signal
|
|
47
|
-
* a user who ran /compact gets when the server-side compaction itself fails
|
|
48
|
-
* (the phase just flips back to idle with no `compacted` payload). Cleared
|
|
49
|
-
* when the next compaction starts.
|
|
50
|
-
*/
|
|
51
|
-
sessionError: string | null;
|
|
52
|
-
}
|
|
53
|
-
declare function useSessionCompaction<MessageT extends UIMessage>({
|
|
54
|
-
agent,
|
|
55
|
-
chat,
|
|
56
|
-
getMessages
|
|
57
|
-
}: UseSessionCompactionOptions<MessageT>): UseSessionCompactionResult;
|
|
58
|
-
//#endregion
|
|
1
|
+
import { a as UseSessionCompactionResult, c as useSessionCompaction, i as UseSessionCompactionOptions, n as SessionStatusFrame, o as parseSessionErrorFrame, r as SessionStatusPhase, s as parseSessionStatusFrame, t as SessionFrameSource } from "../SessionCompaction-DMa1vv6Y.js";
|
|
59
2
|
export { SessionFrameSource, SessionStatusFrame, SessionStatusPhase, UseSessionCompactionOptions, UseSessionCompactionResult, parseSessionErrorFrame, parseSessionStatusFrame, useSessionCompaction };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/SettingsFormDialog.d.ts
|
|
4
|
+
type SettingsFormFieldType = "email" | "password" | "search" | "tel" | "text" | "url";
|
|
5
|
+
interface SettingsFormField {
|
|
6
|
+
name: string;
|
|
7
|
+
label: string;
|
|
8
|
+
description?: React.ReactNode;
|
|
9
|
+
type?: SettingsFormFieldType;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
autoComplete?: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
readOnly?: boolean;
|
|
14
|
+
}
|
|
15
|
+
type SettingsFormValues = Readonly<Record<string, string>>;
|
|
16
|
+
interface SettingsFormDialogProps {
|
|
17
|
+
open: boolean;
|
|
18
|
+
onOpenChange: (open: boolean) => void;
|
|
19
|
+
title: React.ReactNode;
|
|
20
|
+
description: React.ReactNode;
|
|
21
|
+
fields: readonly SettingsFormField[];
|
|
22
|
+
initialValues?: Readonly<Record<string, string | undefined>>;
|
|
23
|
+
submitLabel: string;
|
|
24
|
+
submittingLabel?: string;
|
|
25
|
+
removeLabel?: string;
|
|
26
|
+
removingLabel?: string;
|
|
27
|
+
externalError?: string;
|
|
28
|
+
onSubmit: (values: SettingsFormValues) => void | Promise<void>;
|
|
29
|
+
onRemove?: () => void | Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Uncontrolled, metadata-driven settings dialog with native validation and
|
|
33
|
+
* shared async submit/remove feedback. Product schemas remain in the host.
|
|
34
|
+
*/
|
|
35
|
+
declare function SettingsFormDialog({
|
|
36
|
+
open,
|
|
37
|
+
onOpenChange,
|
|
38
|
+
title,
|
|
39
|
+
description,
|
|
40
|
+
...contentProps
|
|
41
|
+
}: SettingsFormDialogProps): React.JSX.Element;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { SettingsFormDialog, SettingsFormDialogProps, SettingsFormField, SettingsFormFieldType, SettingsFormValues };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Button } from "./Button.js";
|
|
2
|
+
import { Dialog } from "./Dialog.js";
|
|
3
|
+
import { Field } from "./Field.js";
|
|
4
|
+
import { Form } from "./Form.js";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/SettingsFormDialog.tsx
|
|
8
|
+
function readSettingsValues(data, fields) {
|
|
9
|
+
return Object.fromEntries(fields.map((field) => {
|
|
10
|
+
const value = data[field.name];
|
|
11
|
+
return [field.name, typeof value === "string" ? value.trim() : ""];
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
function SettingsFormDialogContent({ fields, initialValues, submitLabel, submittingLabel = "Saving…", removeLabel, removingLabel = "Removing…", externalError, onSubmit, onRemove, onOpenChange }) {
|
|
15
|
+
const [submission, setSubmission] = React.useState(null);
|
|
16
|
+
const active = React.useRef(true);
|
|
17
|
+
const pending = submission === "submit" || submission === "remove";
|
|
18
|
+
const error = submission && typeof submission === "object" ? submission.error : null;
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
active.current = true;
|
|
21
|
+
return () => {
|
|
22
|
+
active.current = false;
|
|
23
|
+
};
|
|
24
|
+
}, []);
|
|
25
|
+
async function submit(values) {
|
|
26
|
+
setSubmission("submit");
|
|
27
|
+
try {
|
|
28
|
+
await onSubmit(readSettingsValues(values, fields));
|
|
29
|
+
if (!active.current) return;
|
|
30
|
+
setSubmission(null);
|
|
31
|
+
onOpenChange(false);
|
|
32
|
+
} catch (cause) {
|
|
33
|
+
if (!active.current) return;
|
|
34
|
+
setSubmission({ error: cause instanceof Error ? cause.message : String(cause) });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async function remove() {
|
|
38
|
+
if (!onRemove) return;
|
|
39
|
+
setSubmission("remove");
|
|
40
|
+
try {
|
|
41
|
+
await onRemove();
|
|
42
|
+
if (!active.current) return;
|
|
43
|
+
setSubmission(null);
|
|
44
|
+
onOpenChange(false);
|
|
45
|
+
} catch (cause) {
|
|
46
|
+
if (!active.current) return;
|
|
47
|
+
setSubmission({ error: cause instanceof Error ? cause.message : String(cause) });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return /* @__PURE__ */ jsxs(Form, {
|
|
51
|
+
onFormSubmit: submit,
|
|
52
|
+
children: [
|
|
53
|
+
fields.map((field) => /* @__PURE__ */ jsxs(Field.Root, {
|
|
54
|
+
name: field.name,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(Field.Label, { children: field.label }),
|
|
57
|
+
/* @__PURE__ */ jsx(Field.Control, {
|
|
58
|
+
autoComplete: field.autoComplete,
|
|
59
|
+
defaultValue: initialValues?.[field.name],
|
|
60
|
+
placeholder: field.placeholder,
|
|
61
|
+
readOnly: field.readOnly,
|
|
62
|
+
required: field.required,
|
|
63
|
+
type: field.type
|
|
64
|
+
}),
|
|
65
|
+
field.description ? /* @__PURE__ */ jsx(Field.Description, { children: field.description }) : null,
|
|
66
|
+
field.required ? /* @__PURE__ */ jsxs(Field.Error, {
|
|
67
|
+
match: "valueMissing",
|
|
68
|
+
children: [field.label, " is required."]
|
|
69
|
+
}) : null,
|
|
70
|
+
field.type === "url" ? /* @__PURE__ */ jsx(Field.Error, {
|
|
71
|
+
match: "typeMismatch",
|
|
72
|
+
children: "Enter a valid URL."
|
|
73
|
+
}) : null
|
|
74
|
+
]
|
|
75
|
+
}, field.name)),
|
|
76
|
+
error ? /* @__PURE__ */ jsx(Field.Errors, { errors: [error] }) : externalError ? /* @__PURE__ */ jsx(Field.Errors, { errors: [externalError] }) : null,
|
|
77
|
+
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [onRemove && removeLabel ? /* @__PURE__ */ jsx(Button, {
|
|
78
|
+
type: "button",
|
|
79
|
+
variant: "ghost",
|
|
80
|
+
color: "destructive",
|
|
81
|
+
disabled: pending,
|
|
82
|
+
focusableWhenDisabled: pending,
|
|
83
|
+
onClick: () => void remove(),
|
|
84
|
+
children: submission === "remove" ? removingLabel : removeLabel
|
|
85
|
+
}) : null, /* @__PURE__ */ jsx(Button, {
|
|
86
|
+
type: "submit",
|
|
87
|
+
color: "primary",
|
|
88
|
+
disabled: pending,
|
|
89
|
+
focusableWhenDisabled: pending,
|
|
90
|
+
children: submission === "submit" ? submittingLabel : submitLabel
|
|
91
|
+
})] })
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Uncontrolled, metadata-driven settings dialog with native validation and
|
|
97
|
+
* shared async submit/remove feedback. Product schemas remain in the host.
|
|
98
|
+
*/
|
|
99
|
+
function SettingsFormDialog({ open, onOpenChange, title, description, ...contentProps }) {
|
|
100
|
+
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
101
|
+
open,
|
|
102
|
+
onOpenChange,
|
|
103
|
+
children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, {}), /* @__PURE__ */ jsx(Dialog.Viewport, { children: /* @__PURE__ */ jsxs(Dialog.Popup, { children: [/* @__PURE__ */ jsxs(Dialog.Header, { children: [/* @__PURE__ */ jsx(Dialog.Title, { children: title }), /* @__PURE__ */ jsx(Dialog.Description, { children: description })] }), /* @__PURE__ */ jsx(SettingsFormDialogContent, {
|
|
104
|
+
...contentProps,
|
|
105
|
+
onOpenChange
|
|
106
|
+
}, open ? "open" : "closed")] }) })] })
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { SettingsFormDialog };
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { i as AgentMessageRenderPartContext } from "../AgentMessageParts-CyD2UB3V.js";
|
|
2
|
-
import { r as AgentChatProps } from "../AgentChat-
|
|
2
|
+
import { r as AgentChatProps } from "../AgentChat-CHEz8ts_.js";
|
|
3
3
|
import { i as useOptionalAgentToolRuns, n as AgentToolRunsProvider, r as AgentToolRunsProviderProps, t as AgentToolEventsValue } from "../AgentToolRunsContext-BVe4stgw.js";
|
|
4
|
-
import { S as isThinkChatActivityPart } from "../ThinkChatToolParts-
|
|
5
|
-
import { u as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-
|
|
6
|
-
import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-
|
|
4
|
+
import { S as isThinkChatActivityPart } from "../ThinkChatToolParts-BfroXQ4F.js";
|
|
5
|
+
import { u as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-F062wneC.js";
|
|
6
|
+
import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-C2uaL3el.js";
|
|
7
7
|
import { i as ThinkChatValue } from "../ThinkChatContext-B-Nk84Wi.js";
|
|
8
8
|
import { n as ThinkRecoveryNoticeProps, t as ThinkRecoveryNotice } from "../ThinkRecoveryNotice-D6gYcBbr.js";
|
|
9
|
+
import { a as UseSessionCompactionResult } from "../SessionCompaction-DMa1vv6Y.js";
|
|
9
10
|
import { n as BrowserLiveViewProps, t as BrowserLiveView } from "../BrowserLiveView-BV5qgFgI.js";
|
|
10
11
|
import { n as BrowserReplayProps, t as BrowserReplay } from "../BrowserReplay-xWvRjRAC.js";
|
|
11
12
|
import { d as inferWorkspaceLanguage, i as WorkspaceFileState } from "../WorkspaceFile-DMtRMwVv.js";
|
|
12
|
-
import { a as WorkspaceSource, c as workspaceBinaryFileQueryOptions, d as
|
|
13
|
-
import { n as WorkspaceExplorerProps, t as WorkspaceExplorer } from "../WorkspaceExplorer-
|
|
13
|
+
import { a as WorkspaceSource, c as workspaceBinaryFileQueryOptions, d as workspaceDirectoryQueryPrefix, f as workspaceFileAssetQueryOptions, g as workspaceTextFileQueryOptions, h as workspaceQueryKey, i as WorkspaceQueryKey, l as workspaceDirectoryQueryKey, m as workspaceInfoQueryOptions, n as WorkspaceFileReadTarget, o as WorkspaceState, p as workspaceFileStatQueryOptions, r as WorkspaceInfo, s as useWorkspace, t as UseWorkspaceOptions, u as workspaceDirectoryQueryOptions } from "../Workspace-Bn6In4wi.js";
|
|
14
|
+
import { n as WorkspaceExplorerProps, t as WorkspaceExplorer } from "../WorkspaceExplorer-D0aiscG6.js";
|
|
14
15
|
import * as React from "react";
|
|
15
16
|
import { UIMessage } from "ai";
|
|
16
17
|
import { UseAgentOptions } from "agents/react";
|
|
@@ -93,6 +94,8 @@ interface ThinkChatMessagesProps<MessageT extends UIMessage = UIMessage> extends
|
|
|
93
94
|
* `isRecovering`/`connectionError`) shown between transcript and composer.
|
|
94
95
|
*/
|
|
95
96
|
notice?: AgentChatProps<MessageT>["notice"];
|
|
97
|
+
/** Whole `useSessionCompaction` result for built-in progress and error notices. */
|
|
98
|
+
sessionCompaction?: UseSessionCompactionResult;
|
|
96
99
|
/**
|
|
97
100
|
* Extends the built-in Think activity renderer. Returning `undefined` keeps
|
|
98
101
|
* the built-in result; `defaultRender()` renders that same result on demand.
|
|
@@ -182,6 +185,7 @@ declare function ThinkChatMessages<State = unknown, MessageT extends UIMessage =
|
|
|
182
185
|
onExecutionSettled,
|
|
183
186
|
pendingApprovals,
|
|
184
187
|
notice,
|
|
188
|
+
sessionCompaction,
|
|
185
189
|
...props
|
|
186
190
|
}: ThinkChatMessagesProps<MessageT>): React.JSX.Element;
|
|
187
191
|
/**
|
|
@@ -224,4 +228,4 @@ declare const ThinkChat: {
|
|
|
224
228
|
createActivityRenderer: typeof createThinkChatActivityRenderer;
|
|
225
229
|
};
|
|
226
230
|
//#endregion
|
|
227
|
-
export { type AgentToolEventsValue, AgentToolRunsProvider, type AgentToolRunsProviderProps, BrowserLiveView, type BrowserLiveViewProps, BrowserReplay, type BrowserReplayProps, ThinkChat, ThinkChatActivity, type ThinkChatActivityProps, type ThinkChatActivityRendererOptions, ThinkChatMessages, ThinkChatMessagesProps, ThinkChatProvider, ThinkChatProviderProps, ThinkChatRoot, ThinkChatRootProps, type ThinkChatToolRenderer, type ThinkChatToolRenderers, ThinkPendingExecutionApprovalsQueryKey, ThinkPendingExecutionApprovalsQueryOptions, ThinkRecoveryNotice, type ThinkRecoveryNoticeProps, type UseWorkspaceOptions, WorkspaceExplorer, type WorkspaceExplorerProps, type WorkspaceFileReadTarget, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceQueryKey, type WorkspaceSource, type WorkspaceState, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, thinkPendingExecutionApprovalsQueryOptions, useOptionalAgentToolRuns, useThinkChat, useThinkPendingExecutionApprovals, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
231
|
+
export { type AgentToolEventsValue, AgentToolRunsProvider, type AgentToolRunsProviderProps, BrowserLiveView, type BrowserLiveViewProps, BrowserReplay, type BrowserReplayProps, ThinkChat, ThinkChatActivity, type ThinkChatActivityProps, type ThinkChatActivityRendererOptions, ThinkChatMessages, ThinkChatMessagesProps, ThinkChatProvider, ThinkChatProviderProps, ThinkChatRoot, ThinkChatRootProps, type ThinkChatToolRenderer, type ThinkChatToolRenderers, ThinkPendingExecutionApprovalsQueryKey, ThinkPendingExecutionApprovalsQueryOptions, ThinkRecoveryNotice, type ThinkRecoveryNoticeProps, type UseWorkspaceOptions, WorkspaceExplorer, type WorkspaceExplorerProps, type WorkspaceFileReadTarget, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceQueryKey, type WorkspaceSource, type WorkspaceState, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, thinkPendingExecutionApprovalsQueryOptions, useOptionalAgentToolRuns, useThinkChat, useThinkPendingExecutionApprovals, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
@@ -5,8 +5,8 @@ import { inferWorkspaceLanguage } from "./WorkspaceFile.js";
|
|
|
5
5
|
import { describeThinkChatActivityPart } from "./ThinkChatActivitySummary.js";
|
|
6
6
|
import { ThinkChatActivity, createThinkChatActivityRenderer, renderThinkChatActivityPart } from "./ThinkChatActivity.js";
|
|
7
7
|
import { ThinkRecoveryNotice } from "./ThinkRecoveryNotice.js";
|
|
8
|
-
import { a as thinkPendingExecutionApprovalsQueryOptions, i as ThinkChatRoot, n as ThinkChatMessages, o as useThinkChat, r as ThinkChatProvider, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../ThinkChat-
|
|
8
|
+
import { a as thinkPendingExecutionApprovalsQueryOptions, i as ThinkChatRoot, n as ThinkChatMessages, o as useThinkChat, r as ThinkChatProvider, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../ThinkChat-Bp-nAnoW.js";
|
|
9
9
|
import { BrowserReplay } from "./BrowserReplay.js";
|
|
10
|
-
import { useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions } from "./Workspace.js";
|
|
10
|
+
import { useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions } from "./Workspace.js";
|
|
11
11
|
import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
|
|
12
|
-
export { AgentToolRunsProvider, BrowserLiveView, BrowserReplay, ThinkChat, ThinkChatActivity, ThinkChatMessages, ThinkChatProvider, ThinkChatRoot, ThinkRecoveryNotice, WorkspaceExplorer, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, thinkPendingExecutionApprovalsQueryOptions, useOptionalAgentToolRuns, useThinkChat, useThinkPendingExecutionApprovals, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
12
|
+
export { AgentToolRunsProvider, BrowserLiveView, BrowserReplay, ThinkChat, ThinkChatActivity, ThinkChatMessages, ThinkChatProvider, ThinkChatRoot, ThinkRecoveryNotice, WorkspaceExplorer, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, thinkPendingExecutionApprovalsQueryOptions, useOptionalAgentToolRuns, useThinkChat, useThinkPendingExecutionApprovals, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as isThinkChatActivityPart } from "../ThinkChatToolParts-
|
|
2
|
-
import { u as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-
|
|
3
|
-
import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-
|
|
1
|
+
import { S as isThinkChatActivityPart } from "../ThinkChatToolParts-BfroXQ4F.js";
|
|
2
|
+
import { u as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-F062wneC.js";
|
|
3
|
+
import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-C2uaL3el.js";
|
|
4
4
|
export { ThinkChatActivity, ThinkChatActivityProps, ThinkChatActivityRendererOptions, ThinkChatToolRenderer, ThinkChatToolRenderers, createThinkChatActivityRenderer, describeThinkChatActivityPart, isThinkChatActivityPart, renderThinkChatActivityPart };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ThinkChatToolLifecycleSnapshot, c as deriveThinkChatActivityHeader, d as summarizeActivitySteps, i as ThinkChatToolDescribers, l as deriveThinkChatToolLifecycleHeader, n as ThinkChatActivityHeader, o as activityPartIconKind, r as ThinkChatToolDescriber, s as activityPartUrl, t as ThinkChatActivityDescription, u as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-
|
|
1
|
+
import { a as ThinkChatToolLifecycleSnapshot, c as deriveThinkChatActivityHeader, d as summarizeActivitySteps, i as ThinkChatToolDescribers, l as deriveThinkChatToolLifecycleHeader, n as ThinkChatActivityHeader, o as activityPartIconKind, r as ThinkChatToolDescriber, s as activityPartUrl, t as ThinkChatActivityDescription, u as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-F062wneC.js";
|
|
2
2
|
export { ThinkChatActivityDescription, ThinkChatActivityHeader, ThinkChatToolDescriber, ThinkChatToolDescribers, ThinkChatToolLifecycleSnapshot, activityPartIconKind, activityPartUrl, deriveThinkChatActivityHeader, deriveThinkChatToolLifecycleHeader, describeThinkChatActivityPart, summarizeActivitySteps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SessionContextToolPart, d as WorkspaceToolPart, n as ExecuteToolPart, o as SkillToolPart, r as FetchToolPart, t as BrowserToolPart } from "../ThinkChatToolParts-
|
|
1
|
+
import { a as SessionContextToolPart, d as WorkspaceToolPart, n as ExecuteToolPart, o as SkillToolPart, r as FetchToolPart, t as BrowserToolPart } from "../ThinkChatToolParts-BfroXQ4F.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/ThinkChatToolPanels.d.ts
|
|
@@ -110,7 +110,7 @@ function ThinkChatWorkspacePanel({ part }) {
|
|
|
110
110
|
}
|
|
111
111
|
case "tool-grep": {
|
|
112
112
|
const output = part.state === "output-available" ? part.output : void 0;
|
|
113
|
-
const matches = Array.isArray(output?.matches) ? output.matches.map((
|
|
113
|
+
const matches = Array.isArray(output?.matches) ? output.matches.map((match) => typeof match === "string" ? match : match.context ?? JSON.stringify(match)) : [];
|
|
114
114
|
const status = output && typeof output.totalMatches === "number" ? `${output.totalMatches} matches in ${String(output.filesWithMatches)} files` : void 0;
|
|
115
115
|
return /* @__PURE__ */ jsx(ActivityPanel, {
|
|
116
116
|
label: part.input?.query ?? "search",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as isToolPartFailed, S as isThinkChatActivityPart, T as isWorkspaceToolPart, _ as isPartFailed, a as SessionContextToolPart, b as isSessionContextToolPart, c as ThinkBashToolPart, d as WorkspaceToolPart, f as displayUrl, g as isFetchToolPart, h as isExecuteToolPart, i as SessionContextToolName, l as ThinkChatPart, m as isBrowserToolPart, n as ExecuteToolPart, o as SkillToolPart, p as getToolDisplayName, r as FetchToolPart, s as ThinkBashToolOutput, t as BrowserToolPart, u as ThinkWorkspaceToolName, v as isPartWorking, w as isToolPartWorking, x as isSkillToolPart, y as isSessionContextToolFailure } from "../ThinkChatToolParts-
|
|
1
|
+
import { C as isToolPartFailed, S as isThinkChatActivityPart, T as isWorkspaceToolPart, _ as isPartFailed, a as SessionContextToolPart, b as isSessionContextToolPart, c as ThinkBashToolPart, d as WorkspaceToolPart, f as displayUrl, g as isFetchToolPart, h as isExecuteToolPart, i as SessionContextToolName, l as ThinkChatPart, m as isBrowserToolPart, n as ExecuteToolPart, o as SkillToolPart, p as getToolDisplayName, r as FetchToolPart, s as ThinkBashToolOutput, t as BrowserToolPart, u as ThinkWorkspaceToolName, v as isPartWorking, w as isToolPartWorking, x as isSkillToolPart, y as isSessionContextToolFailure } from "../ThinkChatToolParts-BfroXQ4F.js";
|
|
2
2
|
export { BrowserToolPart, ExecuteToolPart, FetchToolPart, SessionContextToolName, SessionContextToolPart, SkillToolPart, ThinkBashToolOutput, ThinkBashToolPart, ThinkChatPart, ThinkWorkspaceToolName, WorkspaceToolPart, displayUrl, getToolDisplayName, isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartFailed, isPartWorking, isSessionContextToolFailure, isSessionContextToolPart, isSkillToolPart, isThinkChatActivityPart, isToolPartFailed, isToolPartWorking, isWorkspaceToolPart };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as WorkspaceNavigationAdapter } from "../WorkspaceLink-O-EBKUJ8.js";
|
|
2
2
|
import { r as WorkspaceFileAssetResolver } from "../WorkspaceFile-DMtRMwVv.js";
|
|
3
|
-
import { a as WorkspaceSource } from "../Workspace-
|
|
3
|
+
import { a as WorkspaceSource } from "../Workspace-Bn6In4wi.js";
|
|
4
4
|
import { ThinkChatMessagesProps } from "./ThinkChat.js";
|
|
5
5
|
import { t as ThinkAgent } from "../think-agent-Cip5KAPj.js";
|
|
6
6
|
import { McpPluginCatalogProps } from "./McpPluginCatalog.js";
|
|
@@ -60,14 +60,12 @@ interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unk
|
|
|
60
60
|
appBarTitle?: React.ReactNode;
|
|
61
61
|
/** Aggregate thread activity rendered beside the compact thread-title disclosure. */
|
|
62
62
|
threadStatusSummary?: ThinkThreadStatusSummary;
|
|
63
|
-
/** Whether to include the built-in Execution workbench. Defaults to true. */
|
|
64
|
-
showExecutionWorkbench?: boolean;
|
|
65
63
|
/** Whether narrow layouts render the built-in chat/workbench switch. Defaults to true. */
|
|
66
64
|
showMobileViewSwitch?: boolean;
|
|
67
65
|
/** Hide the thread app bar when a narrow workbench supplies its own navigation. */
|
|
68
66
|
hideAppBarInWorkbench?: boolean;
|
|
69
67
|
/** Whole native execution selected by the application route. */
|
|
70
|
-
selectedExecutionRun
|
|
68
|
+
selectedExecutionRun?: ThinkExecutionRun | null;
|
|
71
69
|
/**
|
|
72
70
|
* Stable, non-secret identity for the remote Think agent used by approvals
|
|
73
71
|
* and execution queries. Include endpoint, account or tenant scope, and
|
|
@@ -75,16 +73,14 @@ interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unk
|
|
|
75
73
|
* has its own source identity.
|
|
76
74
|
*/
|
|
77
75
|
sourceKey: string;
|
|
78
|
-
/** Returns an application-authored TanStack Router Link
|
|
79
|
-
renderExecutionRunLink
|
|
76
|
+
/** Returns an application-authored TanStack Router Link and enables the Execution workbench. */
|
|
77
|
+
renderExecutionRunLink?: ThinkExecutionWorkbenchProps["renderRunLink"];
|
|
80
78
|
/** Message rendering labels and approval overrides for ThinkChat. */
|
|
81
79
|
messages?: ThinkChatMessagesProps<MessageT>;
|
|
82
80
|
/** Extra workbench panels appended after the enabled built-in panels. */
|
|
83
81
|
workbenchPanels?: readonly ThinkFullAppPanel<AgentT, State, MessageT>[];
|
|
84
|
-
/**
|
|
85
|
-
|
|
86
|
-
/** Returns an application-authored TanStack Router Link for a retained child run. */
|
|
87
|
-
renderAgentToolRunLink: NonNullable<ThinkChatMessagesProps<MessageT>["renderAgentToolRunLink"]>;
|
|
82
|
+
/** Returns an application-authored TanStack Router Link and enables retained Agent Tool runs. */
|
|
83
|
+
renderAgentToolRunLink?: NonNullable<ThinkChatMessagesProps<MessageT>["renderAgentToolRunLink"]>;
|
|
88
84
|
/**
|
|
89
85
|
* Optional parent-owned thread picker/sidebar rendered beside the selected child app.
|
|
90
86
|
* Use the render form to close the compact drawer after selecting a thread.
|
|
@@ -134,8 +130,6 @@ declare function ThinkFullApp<AgentT extends ThinkFullAppAgent<State>, State = u
|
|
|
134
130
|
renderAgentToolRunLink,
|
|
135
131
|
renderExecutionRunLink,
|
|
136
132
|
selectedExecutionRun,
|
|
137
|
-
showAgentTools,
|
|
138
|
-
showExecutionWorkbench,
|
|
139
133
|
showMobileViewSwitch,
|
|
140
134
|
sourceKey,
|
|
141
135
|
style,
|
|
@@ -4,7 +4,7 @@ import { $ as TerminalIcon, C as FileIcon, J as SpinnerIcon, c as BoxIcon, f as
|
|
|
4
4
|
import { a as WorkspaceNavigationRestorationBoundary, i as WorkspaceNavigationFocusRestorer, n as WorkspaceNavigationProvider } from "../WorkspaceLink-BYYeTQLf.js";
|
|
5
5
|
import { n as mergeRefs } from "../merge-refs-DF_7w2x_.js";
|
|
6
6
|
import { AppTopBar } from "./AppTopBar.js";
|
|
7
|
-
import { c as resolveThinkApprovalProps, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../ThinkChat-
|
|
7
|
+
import { c as resolveThinkApprovalProps, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../ThinkChat-Bp-nAnoW.js";
|
|
8
8
|
import { useWorkspace } from "./Workspace.js";
|
|
9
9
|
import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
|
|
10
10
|
import { ScrollArea } from "./ScrollArea.js";
|
|
@@ -46,7 +46,7 @@ function PluginsPanel({ config }) {
|
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
/** Combines ThinkChat with an optional resizable workbench shell. */
|
|
49
|
-
function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat, className, defaultMobileView, defaultWorkbenchView, defaultThreadSidebarOpen, hideAppBarInWorkbench = false, messages, mobileView, onMobileViewChange, onThreadSidebarOpenChange, onWorkbenchViewChange, plugins, ref, renderAgentToolRunLink, renderExecutionRunLink, selectedExecutionRun
|
|
49
|
+
function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat, className, defaultMobileView, defaultWorkbenchView, defaultThreadSidebarOpen, hideAppBarInWorkbench = false, messages, mobileView, onMobileViewChange, onThreadSidebarOpenChange, onWorkbenchViewChange, plugins, ref, renderAgentToolRunLink, renderExecutionRunLink, selectedExecutionRun = null, showMobileViewSwitch = true, sourceKey, style, threadSidebar, threadSidebarOpen, threadStatusSummary, workbenchPanels, workbenchView, workspace, ...props }) {
|
|
50
50
|
const appRef = React.useRef(null);
|
|
51
51
|
const workbenchPanelRef = React.useRef(null);
|
|
52
52
|
const pendingPanelFocusRef = React.useRef(null);
|
|
@@ -108,7 +108,7 @@ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat,
|
|
|
108
108
|
icon: /* @__PURE__ */ jsx(FileIcon, {}),
|
|
109
109
|
render: () => /* @__PURE__ */ jsx(WorkspacePanel, { config: workspace })
|
|
110
110
|
});
|
|
111
|
-
if (
|
|
111
|
+
if (renderExecutionRunLink) availableWorkbenchPanels.push({
|
|
112
112
|
id: "execution",
|
|
113
113
|
label: "Execution",
|
|
114
114
|
icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
|
|
@@ -252,7 +252,7 @@ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat,
|
|
|
252
252
|
agentTools,
|
|
253
253
|
children: /* @__PURE__ */ jsx(ThinkChat.Messages, {
|
|
254
254
|
...resolvedMessages,
|
|
255
|
-
renderAgentToolRunLink
|
|
255
|
+
renderAgentToolRunLink
|
|
256
256
|
})
|
|
257
257
|
})
|
|
258
258
|
})
|
|
@@ -31,7 +31,7 @@ interface ThinkThreadStatusIndicatorsProps {
|
|
|
31
31
|
summary: ThinkThreadStatusSummary;
|
|
32
32
|
className?: string;
|
|
33
33
|
}
|
|
34
|
-
interface ThinkThreadPickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "title"> {
|
|
34
|
+
interface ThinkThreadPickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect" | "title"> {
|
|
35
35
|
/** Threads from the parent agent, already sorted in the order the app wants to show. */
|
|
36
36
|
threads: readonly ThinkThreadItem[];
|
|
37
37
|
/**
|
|
@@ -43,6 +43,8 @@ interface ThinkThreadPickerProps extends Omit<React.HTMLAttributes<HTMLElement>,
|
|
|
43
43
|
renderThreadLink: (thread: ThinkThreadItem) => React.ReactElement;
|
|
44
44
|
/** Optional parent-agent create action, usually `parent.stub.createThread()`. */
|
|
45
45
|
onCreate?: () => void | Promise<void>;
|
|
46
|
+
/** Handles unmodified primary activation while preserving link modifier behavior. */
|
|
47
|
+
onSelect?: (thread: ThinkThreadItem) => void;
|
|
46
48
|
/** Optional parent-agent delete action, usually `parent.stub.deleteThread(thread.id)`. */
|
|
47
49
|
onDelete?: (thread: ThinkThreadItem) => void | Promise<void>;
|
|
48
50
|
/** Visible heading for the roster. */
|
|
@@ -68,6 +70,7 @@ declare function ThinkThreadPicker({
|
|
|
68
70
|
threads,
|
|
69
71
|
renderThreadLink,
|
|
70
72
|
onCreate,
|
|
73
|
+
onSelect,
|
|
71
74
|
onDelete,
|
|
72
75
|
className,
|
|
73
76
|
title,
|
|
@@ -110,7 +110,7 @@ function ThinkThreadStatusIndicators({ summary, className }) {
|
|
|
110
110
|
* notes beside the parent Think agent because
|
|
111
111
|
* `listThreads()`/`createThread()`/`deleteThread()` are app-owned.
|
|
112
112
|
*/
|
|
113
|
-
function ThinkThreadPicker({ threads, renderThreadLink, onCreate, onDelete, className, title = "Recents", "aria-label": ariaLabel = "Threads", ref, ...props }) {
|
|
113
|
+
function ThinkThreadPicker({ threads, renderThreadLink, onCreate, onSelect, onDelete, className, title = "Recents", "aria-label": ariaLabel = "Threads", ref, ...props }) {
|
|
114
114
|
const statusSummary = summarizeThinkThreads(threads);
|
|
115
115
|
const [query, setQuery] = React.useState("");
|
|
116
116
|
const [deleteOpen, setDeleteOpen] = React.useState(false);
|
|
@@ -210,6 +210,11 @@ function ThinkThreadPicker({ threads, renderThreadLink, onCreate, onDelete, clas
|
|
|
210
210
|
className: "think-thread-picker__thread"
|
|
211
211
|
}),
|
|
212
212
|
"data-thread-status": thread.status,
|
|
213
|
+
onClick: onSelect ? (event) => {
|
|
214
|
+
if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
|
|
215
|
+
event.preventDefault();
|
|
216
|
+
onSelect(thread);
|
|
217
|
+
} : void 0,
|
|
213
218
|
children: [/* @__PURE__ */ jsx("span", {
|
|
214
219
|
className: "think-thread-picker__thread-title sigvelo-truncate",
|
|
215
220
|
children: thread.title
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as WorkspaceSource, c as workspaceBinaryFileQueryOptions, d as
|
|
2
|
-
export { UseWorkspaceOptions, WorkspaceFileReadTarget, WorkspaceInfo, WorkspaceQueryKey, WorkspaceSource, WorkspaceState, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
1
|
+
import { a as WorkspaceSource, c as workspaceBinaryFileQueryOptions, d as workspaceDirectoryQueryPrefix, f as workspaceFileAssetQueryOptions, g as workspaceTextFileQueryOptions, h as workspaceQueryKey, i as WorkspaceQueryKey, l as workspaceDirectoryQueryKey, m as workspaceInfoQueryOptions, n as WorkspaceFileReadTarget, o as WorkspaceState, p as workspaceFileStatQueryOptions, r as WorkspaceInfo, s as useWorkspace, t as UseWorkspaceOptions, u as workspaceDirectoryQueryOptions } from "../Workspace-Bn6In4wi.js";
|
|
2
|
+
export { UseWorkspaceOptions, WorkspaceFileReadTarget, WorkspaceInfo, WorkspaceQueryKey, WorkspaceSource, WorkspaceState, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
@@ -69,6 +69,14 @@ function workspaceQueryKey(sourceKey, root) {
|
|
|
69
69
|
root
|
|
70
70
|
];
|
|
71
71
|
}
|
|
72
|
+
/** Directory-listing prefix for targeted cache invalidation. */
|
|
73
|
+
function workspaceDirectoryQueryPrefix(sourceKey, root) {
|
|
74
|
+
return [...workspaceQueryKey(sourceKey, root), "directory"];
|
|
75
|
+
}
|
|
76
|
+
/** Exact directory-listing key shared by query options and live hosts. */
|
|
77
|
+
function workspaceDirectoryQueryKey(sourceKey, root, path) {
|
|
78
|
+
return [...workspaceDirectoryQueryPrefix(sourceKey, root), path];
|
|
79
|
+
}
|
|
72
80
|
function workspaceFileQueryKey(sourceKey, root, requestedPath) {
|
|
73
81
|
return [
|
|
74
82
|
...workspaceQueryKey(sourceKey, root),
|
|
@@ -91,11 +99,7 @@ function workspaceFileVersion(target) {
|
|
|
91
99
|
/** Shared directory options for workspace components and route loaders. */
|
|
92
100
|
function workspaceDirectoryQueryOptions(source, sourceKey, root, path) {
|
|
93
101
|
return queryOptions({
|
|
94
|
-
queryKey:
|
|
95
|
-
...workspaceQueryKey(sourceKey, root),
|
|
96
|
-
"directory",
|
|
97
|
-
path
|
|
98
|
-
],
|
|
102
|
+
queryKey: workspaceDirectoryQueryKey(sourceKey, root, path),
|
|
99
103
|
queryFn: async ({ signal }) => {
|
|
100
104
|
const entries = [];
|
|
101
105
|
let offset = 0;
|
|
@@ -436,4 +440,4 @@ function useWorkspace({ source, sourceKey, root = "/", selectedPath, onSelectedP
|
|
|
436
440
|
};
|
|
437
441
|
}
|
|
438
442
|
//#endregion
|
|
439
|
-
export { useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
443
|
+
export { useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as WorkspaceFileLinkProps, c as WorkspaceLinkResolution, d as WorkspaceNavigationProvider, f as WorkspaceNavigationProviderProps, i as WorkspaceFileLink, l as WorkspaceNavigationAdapter, n as WorkspaceDestination, o as WorkspaceInvalidDestination, p as resolveWorkspaceLink, r as WorkspaceExternalDestination, s as WorkspaceLinkBase, t as ResolveWorkspaceLinkOptions, u as WorkspaceNavigationEntry } from "../WorkspaceLink-O-EBKUJ8.js";
|
|
2
2
|
import { a as WorkspaceMediaInfo, c as WorkspaceMediaTrackKind, d as inferWorkspaceLanguage, f as inferWorkspaceMedia, g as parseWorkspaceSkill, h as isWorkspaceSkillPath, i as WorkspaceFileState, l as WorkspaceSkillDocument, m as isWorkspaceMediaPath, n as WorkspaceFileAssetRequest, o as WorkspaceMediaKind, p as isWorkspaceMarkdownPath, r as WorkspaceFileAssetResolver, s as WorkspaceMediaTrack, t as WorkspaceFileAsset } from "../WorkspaceFile-DMtRMwVv.js";
|
|
3
|
-
import { a as WorkspaceSource, c as workspaceBinaryFileQueryOptions, d as
|
|
4
|
-
import { n as WorkspaceExplorerProps, t as WorkspaceExplorer } from "../WorkspaceExplorer-
|
|
5
|
-
export { type ResolveWorkspaceLinkOptions, type UseWorkspaceOptions, type WorkspaceDestination, WorkspaceExplorer, WorkspaceExplorerProps, type WorkspaceExternalDestination, type WorkspaceFileAsset, type WorkspaceFileAssetRequest, type WorkspaceFileAssetResolver, WorkspaceFileLink, type WorkspaceFileLinkProps, type WorkspaceFileReadTarget, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceInvalidDestination, type WorkspaceLinkBase, type WorkspaceLinkResolution, type WorkspaceMediaInfo, type WorkspaceMediaKind, type WorkspaceMediaTrack, type WorkspaceMediaTrackKind, type WorkspaceNavigationAdapter, type WorkspaceNavigationEntry, WorkspaceNavigationProvider, type WorkspaceNavigationProviderProps, type WorkspaceQueryKey, type WorkspaceSkillDocument, type WorkspaceSource, type WorkspaceState, inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceMediaPath, isWorkspaceSkillPath, parseWorkspaceSkill, resolveWorkspaceLink, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
3
|
+
import { a as WorkspaceSource, c as workspaceBinaryFileQueryOptions, d as workspaceDirectoryQueryPrefix, f as workspaceFileAssetQueryOptions, g as workspaceTextFileQueryOptions, h as workspaceQueryKey, i as WorkspaceQueryKey, l as workspaceDirectoryQueryKey, m as workspaceInfoQueryOptions, n as WorkspaceFileReadTarget, o as WorkspaceState, p as workspaceFileStatQueryOptions, r as WorkspaceInfo, s as useWorkspace, t as UseWorkspaceOptions, u as workspaceDirectoryQueryOptions } from "../Workspace-Bn6In4wi.js";
|
|
4
|
+
import { n as WorkspaceExplorerProps, t as WorkspaceExplorer } from "../WorkspaceExplorer-D0aiscG6.js";
|
|
5
|
+
export { type ResolveWorkspaceLinkOptions, type UseWorkspaceOptions, type WorkspaceDestination, WorkspaceExplorer, WorkspaceExplorerProps, type WorkspaceExternalDestination, type WorkspaceFileAsset, type WorkspaceFileAssetRequest, type WorkspaceFileAssetResolver, WorkspaceFileLink, type WorkspaceFileLinkProps, type WorkspaceFileReadTarget, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceInvalidDestination, type WorkspaceLinkBase, type WorkspaceLinkResolution, type WorkspaceMediaInfo, type WorkspaceMediaKind, type WorkspaceMediaTrack, type WorkspaceMediaTrackKind, type WorkspaceNavigationAdapter, type WorkspaceNavigationEntry, WorkspaceNavigationProvider, type WorkspaceNavigationProviderProps, type WorkspaceQueryKey, type WorkspaceSkillDocument, type WorkspaceSource, type WorkspaceState, inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceMediaPath, isWorkspaceSkillPath, parseWorkspaceSkill, resolveWorkspaceLink, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|