@tangle-network/agent-app 0.53.2 → 0.53.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assistant/AssistantDock.d.ts +7 -5
- package/dist/assistant/index.d.ts +2 -1
- package/dist/assistant/index.js +91 -42
- package/dist/assistant/index.js.map +1 -1
- package/dist/assistant/launcher.d.ts +29 -7
- package/dist/assistant/page-context.d.ts +2 -1
- package/dist/assistant/usePanelPrefs.d.ts +33 -11
- package/dist/chat-react/index.js +3 -2
- package/dist/chunk-6FYFGQ6I.js +48 -0
- package/dist/chunk-6FYFGQ6I.js.map +1 -0
- package/dist/{chunk-EV5UI4VH.js → chunk-7HMDNSIA.js} +154 -65
- package/dist/chunk-7HMDNSIA.js.map +1 -0
- package/dist/{chunk-2LPNGZFG.js → chunk-BINC6OWR.js} +183 -152
- package/dist/chunk-BINC6OWR.js.map +1 -0
- package/dist/{chunk-CIYMRDAM.js → chunk-IYK5BRL4.js} +6 -2
- package/dist/chunk-IYK5BRL4.js.map +1 -0
- package/dist/{chunk-FRABQIQ4.js → chunk-NH32EPWU.js} +2 -2
- package/dist/chunk-ODP3X4BN.js +114 -0
- package/dist/chunk-ODP3X4BN.js.map +1 -0
- package/dist/{mention-editor-YPKFP2LF.js → mention-editor-E6J2RUG4.js} +2 -2
- package/dist/studio-react/index.js +2 -2
- package/dist/web-react/agent-profile-choices.d.ts +6 -0
- package/dist/web-react/agent-session-controls.d.ts +6 -1
- package/dist/web-react/agent-settings-popover.d.ts +15 -0
- package/dist/web-react/index.d.ts +3 -0
- package/dist/web-react/index.js +13 -4
- package/dist/web-react/popover-dialog.d.ts +13 -0
- package/dist/web-react/workspace-switcher.d.ts +24 -0
- package/dist/workspace-react/index.d.ts +1 -0
- package/dist/workspace-react/index.js +8 -0
- package/dist/workspace-react/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-2LPNGZFG.js.map +0 -1
- package/dist/chunk-CIYMRDAM.js.map +0 -1
- package/dist/chunk-EV5UI4VH.js.map +0 -1
- /package/dist/{chunk-FRABQIQ4.js.map → chunk-NH32EPWU.js.map} +0 -0
- /package/dist/{mention-editor-YPKFP2LF.js.map → mention-editor-E6J2RUG4.js.map} +0 -0
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared panel state for the assistant. The dock is mounted once in the app
|
|
3
3
|
* shell, but other surfaces need to open it (a page's "Create with assistant"
|
|
4
|
-
* button seeds the composer
|
|
5
|
-
* much room the docked panel takes so
|
|
6
|
-
* This context owns the open state, the
|
|
7
|
-
*
|
|
4
|
+
* button seeds the composer, a page names itself for the panel header), and the
|
|
5
|
+
* shell's page column needs to know how much room the docked panel takes so
|
|
6
|
+
* the panel never covers page content. This context owns the open state, the
|
|
7
|
+
* one-shot composer seed, the page's label, the panel's per-user width and open
|
|
8
|
+
* preference, and the docked-or-sheet layout.
|
|
8
9
|
*/
|
|
9
10
|
import { type ReactNode } from "react";
|
|
10
11
|
import { type PanelPrefs } from "./usePanelPrefs";
|
|
11
|
-
/** `docked`: a column beside the page
|
|
12
|
-
* overlay, full screen on phones. */
|
|
12
|
+
/** `docked`: a column beside the page, wherever the page keeps a usable column
|
|
13
|
+
* beside it. `sheet`: a modal overlay, full screen on phones. */
|
|
13
14
|
export type AssistantPanelLayout = "docked" | "sheet";
|
|
14
15
|
export interface AssistantLauncher {
|
|
15
16
|
/** Whether the assistant panel is open. */
|
|
@@ -34,13 +35,34 @@ export interface AssistantLauncher {
|
|
|
34
35
|
inset: number;
|
|
35
36
|
/** The panel's per-user width controls (used by the dock). */
|
|
36
37
|
panel: Pick<PanelPrefs, "width" | "maxWidth" | "setWidth" | "previewWidth" | "nudgeWidth">;
|
|
38
|
+
/** The open page's own name for the assistant, set through
|
|
39
|
+
* {@link useAssistantPageLabel}; null when the page sets none. */
|
|
40
|
+
pageLabel: string | null;
|
|
41
|
+
setPageLabel: (update: (current: string | null) => string | null) => void;
|
|
37
42
|
}
|
|
38
|
-
export declare function AssistantLauncherProvider({ userId, children, }: {
|
|
43
|
+
export declare function AssistantLauncherProvider({ userId, reservedWidth, dockMediaQuery, children, }: {
|
|
39
44
|
/** The signed-in user. Open state and width persist per user; null keeps
|
|
40
45
|
* them in memory only. */
|
|
41
46
|
userId?: string | null;
|
|
47
|
+
/** Pixels of host chrome beside the page column while the panel is open (a
|
|
48
|
+
* left sidebar, its collapsed rail, or a gutter). A host that hides its
|
|
49
|
+
* sidebar to make room for the panel passes the hidden width. The panel
|
|
50
|
+
* docks only where the page keeps a usable column beside it. Defaults to a
|
|
51
|
+
* 16rem sidebar. */
|
|
52
|
+
reservedWidth?: number;
|
|
53
|
+
/** Viewports where the host's layout can hold a panel beside its page, e.g.
|
|
54
|
+
* where its desktop shell starts. Defaults to 64rem. */
|
|
55
|
+
dockMediaQuery?: string;
|
|
42
56
|
children: ReactNode;
|
|
43
57
|
}): import("react").JSX.Element;
|
|
44
58
|
/** The launcher, or null outside an `AssistantLauncherProvider`. */
|
|
45
59
|
export declare function useOptionalAssistantLauncher(): AssistantLauncher | null;
|
|
46
60
|
export declare function useAssistantLauncher(): AssistantLauncher;
|
|
61
|
+
/**
|
|
62
|
+
* Names the open page for the assistant when its document title does not say
|
|
63
|
+
* enough, e.g. a run page titled by its trigger ("Run manually") that should
|
|
64
|
+
* read "Run of nightly-ping" in the panel header and in the turn's context.
|
|
65
|
+
* The label applies while the calling page is mounted; null or an empty label
|
|
66
|
+
* leaves the title-derived name in place.
|
|
67
|
+
*/
|
|
68
|
+
export declare function useAssistantPageLabel(label: string | null | undefined): void;
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* pages already name themselves in `<title>` for tabs and history, so the
|
|
4
4
|
* title is the label; watching it keeps hosts free of per-page wiring and
|
|
5
5
|
* follows titles that settle late (a run page names its workflow once the
|
|
6
|
-
* workflow loads).
|
|
6
|
+
* workflow loads). A page whose title does not name what it shows sets its own
|
|
7
|
+
* label with `useAssistantPageLabel`, which wins over the title.
|
|
7
8
|
*/
|
|
8
9
|
import type { AssistantPageContext } from "./types";
|
|
9
10
|
/** Pass module-level `titleSuffix`, `ignoreTitles` and `ids` so the context
|
|
@@ -1,20 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Persisted presentation preferences for the assistant panel: whether it is
|
|
3
|
-
* open and how wide it is, per signed-in user, plus the
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* one place.
|
|
3
|
+
* open and how wide it is, per signed-in user, plus the geometry that decides
|
|
4
|
+
* whether the panel docks beside the page or opens as a sheet over it. Kept out
|
|
5
|
+
* of the components so the storage, clamping, and SSR guards live in one place.
|
|
7
6
|
*/
|
|
8
7
|
/** Narrowest the panel may be dragged; below this the chat is unusable. */
|
|
9
8
|
export declare const MIN_PANEL_WIDTH = 360;
|
|
10
9
|
/** Default panel width: the main chat's reading measure at the 15px body size. */
|
|
11
10
|
export declare const DEFAULT_PANEL_WIDTH = 480;
|
|
12
11
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* Narrowest page column the docked panel leaves beside it. The panel docks
|
|
13
|
+
* whenever the page keeps this much room beside the narrowest panel, and a
|
|
14
|
+
* docked panel cannot be dragged wider than that allows. Below it the panel
|
|
15
|
+
* opens as a sheet over the page.
|
|
16
16
|
*/
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const MIN_PAGE_WIDTH = 400;
|
|
18
|
+
/** Host chrome beside the page column when the host does not say: a 16rem
|
|
19
|
+
* sidebar. */
|
|
20
|
+
export declare const DEFAULT_RESERVED_WIDTH = 256;
|
|
21
|
+
/**
|
|
22
|
+
* Viewports where a host's layout can hold a panel beside its page at all,
|
|
23
|
+
* when the host does not say. 64rem is where the shared dashboard shell
|
|
24
|
+
* switches to its desktop layout.
|
|
25
|
+
*/
|
|
26
|
+
export declare const DOCKED_MEDIA_QUERY = "(min-width: 64rem)";
|
|
27
|
+
/** Whether the panel docks: the host's layout allows it at this viewport, and
|
|
28
|
+
* the page keeps {@link MIN_PAGE_WIDTH} beside the narrowest panel. */
|
|
29
|
+
export declare function canDock(viewportWidth: number, reservedWidth: number, hostAllows: boolean): boolean;
|
|
30
|
+
/** Where the panel sits and how much of the viewport the host's chrome takes. */
|
|
31
|
+
export interface PanelGeometry {
|
|
32
|
+
/** Host chrome beside the page column, in px (a left sidebar). */
|
|
33
|
+
reservedWidth: number;
|
|
34
|
+
/** Whether the panel docks beside the page (false: a sheet over it). */
|
|
35
|
+
docked: boolean;
|
|
36
|
+
}
|
|
18
37
|
export interface PanelPrefs {
|
|
19
38
|
/** Last open state the user chose, or null when they never chose one. */
|
|
20
39
|
storedOpen: boolean | null;
|
|
@@ -34,10 +53,10 @@ export interface PanelPrefs {
|
|
|
34
53
|
/**
|
|
35
54
|
* The panel's per-user open state and width. Both reload when the user
|
|
36
55
|
* changes, so two accounts on one browser keep their own layout. The width is
|
|
37
|
-
* re-clamped
|
|
38
|
-
* window never overwrites the choice.
|
|
56
|
+
* re-clamped from the user's chosen value when the viewport or the geometry
|
|
57
|
+
* changes, so a narrow window never overwrites the choice.
|
|
39
58
|
*/
|
|
40
|
-
export declare function usePanelPrefs(userId: string | null): PanelPrefs;
|
|
59
|
+
export declare function usePanelPrefs(userId: string | null, geometry?: PanelGeometry): PanelPrefs;
|
|
41
60
|
/**
|
|
42
61
|
* Whether a media query matches, read synchronously on first render so the
|
|
43
62
|
* panel never first-paints in the wrong layout. A runtime without matchMedia
|
|
@@ -45,3 +64,6 @@ export declare function usePanelPrefs(userId: string | null): PanelPrefs;
|
|
|
45
64
|
* in the always-mounted shell.
|
|
46
65
|
*/
|
|
47
66
|
export declare function useMediaQuery(query: string, fallback?: boolean): boolean;
|
|
67
|
+
/** The viewport's width, tracked across resizes. Without a window it is
|
|
68
|
+
* unbounded, so server renders lay the panel out as docked. */
|
|
69
|
+
export declare function useViewportWidth(): number;
|
package/dist/chat-react/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComposerModeControls,
|
|
3
3
|
EntryComposer
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-7HMDNSIA.js";
|
|
5
5
|
import "../chunk-L7MB2LLM.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-6FYFGQ6I.js";
|
|
7
|
+
import "../chunk-IYK5BRL4.js";
|
|
7
8
|
import "../chunk-SJWIZT7B.js";
|
|
8
9
|
import "../chunk-MLG6XKPV.js";
|
|
9
10
|
import "../chunk-2S7QRQUS.js";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
usePopover
|
|
3
|
+
} from "./chunk-IYK5BRL4.js";
|
|
4
|
+
|
|
5
|
+
// src/web-react/popover-dialog.ts
|
|
6
|
+
import { useEffect, useId } from "react";
|
|
7
|
+
function usePopoverDialog(open, onOpenChange) {
|
|
8
|
+
const popover = usePopover(open, onOpenChange);
|
|
9
|
+
const id = useId();
|
|
10
|
+
const { triggerRef, panelRef } = popover;
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (!open) return;
|
|
13
|
+
const panel = panelRef.current;
|
|
14
|
+
if (!panel) return;
|
|
15
|
+
const controls = () => Array.from(panel.querySelectorAll(
|
|
16
|
+
'button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href], [tabindex="0"]'
|
|
17
|
+
)).filter((element) => !element.closest("[hidden]"));
|
|
18
|
+
const first = panel.querySelector("[data-autofocus]") ?? controls()[0];
|
|
19
|
+
first?.focus();
|
|
20
|
+
function onKeyDown(event) {
|
|
21
|
+
if (event.defaultPrevented || event.key !== "Tab") return;
|
|
22
|
+
const items = controls();
|
|
23
|
+
const index = items.indexOf(document.activeElement);
|
|
24
|
+
if (index < 0) return;
|
|
25
|
+
if (event.shiftKey && index === 0 || !event.shiftKey && index === items.length - 1) {
|
|
26
|
+
onOpenChange(false);
|
|
27
|
+
triggerRef.current?.focus();
|
|
28
|
+
if (event.shiftKey) event.preventDefault();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
panel.addEventListener("keydown", onKeyDown);
|
|
32
|
+
return () => panel.removeEventListener("keydown", onKeyDown);
|
|
33
|
+
}, [open, onOpenChange, panelRef, triggerRef]);
|
|
34
|
+
return {
|
|
35
|
+
...popover,
|
|
36
|
+
id,
|
|
37
|
+
triggerProps: {
|
|
38
|
+
...popover.triggerProps,
|
|
39
|
+
"aria-haspopup": "dialog",
|
|
40
|
+
"aria-controls": open ? id : void 0
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
usePopoverDialog
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=chunk-6FYFGQ6I.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/web-react/popover-dialog.ts"],"sourcesContent":["import { useEffect, useId } from 'react'\nimport { usePopover } from './controls'\n\n/** Non-modal dialog focus over the canonical portaled popover surface. */\nexport function usePopoverDialog(open: boolean, onOpenChange: (open: boolean) => void) {\n const popover = usePopover(open, onOpenChange)\n const id = useId()\n const { triggerRef, panelRef } = popover\n useEffect(() => {\n if (!open) return\n const panel = panelRef.current\n if (!panel) return\n const controls = () => Array.from(panel.querySelectorAll<HTMLElement>(\n 'button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href], [tabindex=\"0\"]',\n )).filter((element) => !element.closest('[hidden]'))\n const first = panel.querySelector<HTMLElement>('[data-autofocus]') ?? controls()[0]\n first?.focus()\n function onKeyDown(event: KeyboardEvent) {\n if (event.defaultPrevented || event.key !== 'Tab') return\n const items = controls()\n const index = items.indexOf(document.activeElement as HTMLElement)\n if (index < 0) return\n if ((event.shiftKey && index === 0) || (!event.shiftKey && index === items.length - 1)) {\n onOpenChange(false)\n triggerRef.current?.focus()\n // Forward Tab continues after the trigger in document order.\n if (event.shiftKey) event.preventDefault()\n }\n }\n panel.addEventListener('keydown', onKeyDown)\n return () => panel.removeEventListener('keydown', onKeyDown)\n }, [open, onOpenChange, panelRef, triggerRef])\n return {\n ...popover,\n id,\n triggerProps: {\n ...popover.triggerProps,\n 'aria-haspopup': 'dialog' as const,\n 'aria-controls': open ? id : undefined,\n },\n }\n}\n"],"mappings":";;;;;AAAA,SAAS,WAAW,aAAa;AAI1B,SAAS,iBAAiB,MAAe,cAAuC;AACrF,QAAM,UAAU,WAAW,MAAM,YAAY;AAC7C,QAAM,KAAK,MAAM;AACjB,QAAM,EAAE,YAAY,SAAS,IAAI;AACjC,YAAU,MAAM;AACd,QAAI,CAAC,KAAM;AACX,UAAM,QAAQ,SAAS;AACvB,QAAI,CAAC,MAAO;AACZ,UAAM,WAAW,MAAM,MAAM,KAAK,MAAM;AAAA,MACtC;AAAA,IACF,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,QAAQ,QAAQ,UAAU,CAAC;AACnD,UAAM,QAAQ,MAAM,cAA2B,kBAAkB,KAAK,SAAS,EAAE,CAAC;AAClF,WAAO,MAAM;AACb,aAAS,UAAU,OAAsB;AACvC,UAAI,MAAM,oBAAoB,MAAM,QAAQ,MAAO;AACnD,YAAM,QAAQ,SAAS;AACvB,YAAM,QAAQ,MAAM,QAAQ,SAAS,aAA4B;AACjE,UAAI,QAAQ,EAAG;AACf,UAAK,MAAM,YAAY,UAAU,KAAO,CAAC,MAAM,YAAY,UAAU,MAAM,SAAS,GAAI;AACtF,qBAAa,KAAK;AAClB,mBAAW,SAAS,MAAM;AAE1B,YAAI,MAAM,SAAU,OAAM,eAAe;AAAA,MAC3C;AAAA,IACF;AACA,UAAM,iBAAiB,WAAW,SAAS;AAC3C,WAAO,MAAM,MAAM,oBAAoB,WAAW,SAAS;AAAA,EAC7D,GAAG,CAAC,MAAM,cAAc,UAAU,UAAU,CAAC;AAC7C,SAAO;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA,cAAc;AAAA,MACZ,GAAG,QAAQ;AAAA,MACX,iBAAiB;AAAA,MACjB,iBAAiB,OAAO,KAAK;AAAA,IAC/B;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
joinClasses
|
|
3
3
|
} from "./chunk-L7MB2LLM.js";
|
|
4
|
+
import {
|
|
5
|
+
usePopoverDialog
|
|
6
|
+
} from "./chunk-6FYFGQ6I.js";
|
|
4
7
|
import {
|
|
5
8
|
CheckGlyph,
|
|
6
9
|
EffortPicker,
|
|
@@ -11,7 +14,7 @@ import {
|
|
|
11
14
|
pickerRootClass,
|
|
12
15
|
quietPickerTriggerClass,
|
|
13
16
|
usePopover
|
|
14
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-IYK5BRL4.js";
|
|
15
18
|
import {
|
|
16
19
|
filterCommandPaletteItems
|
|
17
20
|
} from "./chunk-SJWIZT7B.js";
|
|
@@ -335,7 +338,7 @@ import {
|
|
|
335
338
|
} from "react";
|
|
336
339
|
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
337
340
|
function createLazyMentionEditor() {
|
|
338
|
-
return lazy(() => import("./mention-editor-
|
|
341
|
+
return lazy(() => import("./mention-editor-E6J2RUG4.js").then((m) => m.loadMentionEditor()));
|
|
339
342
|
}
|
|
340
343
|
var IS_APPLE_PLATFORM = typeof navigator !== "undefined" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform);
|
|
341
344
|
function SendGlyph({ className }) {
|
|
@@ -1202,7 +1205,8 @@ function ChatComposer({
|
|
|
1202
1205
|
] })
|
|
1203
1206
|
}
|
|
1204
1207
|
),
|
|
1205
|
-
focusShortcut &&
|
|
1208
|
+
focusShortcut && // A touch screen has no keyboard to press the shortcut on.
|
|
1209
|
+
/* @__PURE__ */ jsx2("div", { className: "mt-1.5 flex justify-end px-1 [@media(pointer:coarse)]:hidden", children: /* @__PURE__ */ jsxs2("span", { className: "text-xs text-muted-foreground", children: [
|
|
1206
1210
|
/* @__PURE__ */ jsx2("kbd", { className: "rounded border border-border bg-background px-1 py-0.5 text-xs", children: IS_APPLE_PLATFORM ? "Cmd" : "Ctrl" }),
|
|
1207
1211
|
/* @__PURE__ */ jsx2("kbd", { className: "ml-0.5 rounded border border-border bg-background px-1 py-0.5 text-xs", children: "L" }),
|
|
1208
1212
|
/* @__PURE__ */ jsx2("span", { className: "ml-1", children: "to focus" })
|
|
@@ -1562,9 +1566,71 @@ function HarnessGlyph({ harness, className }) {
|
|
|
1562
1566
|
return /* @__PURE__ */ jsx3("span", { role: "img", "aria-label": harness, "data-glyph": kind, className: "inline-flex", children: /* @__PURE__ */ jsx3(Fallback, { className }) });
|
|
1563
1567
|
}
|
|
1564
1568
|
|
|
1569
|
+
// src/web-react/agent-settings-popover.tsx
|
|
1570
|
+
import { useCallback as useCallback4, useEffect as useEffect5, useState as useState4 } from "react";
|
|
1571
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1572
|
+
function AgentSettingsPopover({
|
|
1573
|
+
label = "Agent settings",
|
|
1574
|
+
summary,
|
|
1575
|
+
children,
|
|
1576
|
+
open: controlledOpen,
|
|
1577
|
+
onOpenChange,
|
|
1578
|
+
disabled = false,
|
|
1579
|
+
className,
|
|
1580
|
+
panelClassName
|
|
1581
|
+
}) {
|
|
1582
|
+
const [localOpen, setLocalOpen] = useState4(false);
|
|
1583
|
+
const open = !disabled && (controlledOpen ?? localOpen);
|
|
1584
|
+
const changeOpen = useCallback4((next) => {
|
|
1585
|
+
setLocalOpen(next);
|
|
1586
|
+
onOpenChange?.(next);
|
|
1587
|
+
}, [onOpenChange]);
|
|
1588
|
+
useEffect5(() => {
|
|
1589
|
+
if (disabled) changeOpen(false);
|
|
1590
|
+
}, [disabled, changeOpen]);
|
|
1591
|
+
const { containerRef, triggerRef, panelRef, triggerProps, id } = usePopoverDialog(open, changeOpen);
|
|
1592
|
+
return /* @__PURE__ */ jsxs4("div", { ref: containerRef, className: `inline-flex min-w-0 max-w-full ${className ?? ""}`, children: [
|
|
1593
|
+
/* @__PURE__ */ jsxs4(
|
|
1594
|
+
"button",
|
|
1595
|
+
{
|
|
1596
|
+
type: "button",
|
|
1597
|
+
...triggerProps,
|
|
1598
|
+
disabled,
|
|
1599
|
+
"aria-label": label,
|
|
1600
|
+
title: label,
|
|
1601
|
+
"data-agent-settings-trigger": "",
|
|
1602
|
+
onClick: () => changeOpen(!open),
|
|
1603
|
+
"data-state": open ? "open" : "closed",
|
|
1604
|
+
className: "inline-flex min-h-9 max-w-[15rem] items-center gap-1.5 rounded-full border border-border bg-transparent px-2.5 text-sm font-normal text-muted-foreground transition-colors hover:bg-muted hover:text-foreground data-[state=open]:text-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
1605
|
+
children: [
|
|
1606
|
+
/* @__PURE__ */ jsxs4("svg", { className: "h-4 w-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": true, children: [
|
|
1607
|
+
/* @__PURE__ */ jsx4("rect", { x: "4", y: "7", width: "16", height: "14", rx: "3" }),
|
|
1608
|
+
/* @__PURE__ */ jsx4("path", { d: "M12 7V3M9 3h6M1 12v4m22-4v4m-15-3h.01M16 13h.01M9 17h6" })
|
|
1609
|
+
] }),
|
|
1610
|
+
/* @__PURE__ */ jsx4("span", { className: "min-w-0 truncate", children: summary ?? label }),
|
|
1611
|
+
/* @__PURE__ */ jsx4("svg", { className: "h-3 w-3 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: /* @__PURE__ */ jsx4("path", { d: "m6 9 6 6 6-6" }) })
|
|
1612
|
+
]
|
|
1613
|
+
}
|
|
1614
|
+
),
|
|
1615
|
+
/* @__PURE__ */ jsx4(
|
|
1616
|
+
PopoverSurface,
|
|
1617
|
+
{
|
|
1618
|
+
open,
|
|
1619
|
+
id,
|
|
1620
|
+
role: "dialog",
|
|
1621
|
+
"aria-label": label,
|
|
1622
|
+
triggerRef,
|
|
1623
|
+
panelRef,
|
|
1624
|
+
className: `w-80 max-w-[calc(100vw-2rem)] space-y-4 overflow-y-auto rounded-xl border border-card-edge bg-popover p-4 text-foreground ${OVERLAY_SHADOW} ${panelClassName ?? ""}`,
|
|
1625
|
+
children
|
|
1626
|
+
}
|
|
1627
|
+
)
|
|
1628
|
+
] });
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1565
1631
|
// src/web-react/agent-session-controls.tsx
|
|
1566
|
-
import { useId as useId2, useMemo as useMemo3, useRef as useRef4, useState as
|
|
1567
|
-
import { Fragment as Fragment2, jsx as
|
|
1632
|
+
import { useId as useId2, useMemo as useMemo3, useRef as useRef4, useState as useState5 } from "react";
|
|
1633
|
+
import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1568
1634
|
var HARNESS_LABELS = {
|
|
1569
1635
|
opencode: "OpenCode (any model)",
|
|
1570
1636
|
"claude-code": "Claude Code (Anthropic)",
|
|
@@ -1584,18 +1650,18 @@ function harnessLabel(h) {
|
|
|
1584
1650
|
return HARNESS_LABELS[h] ?? h;
|
|
1585
1651
|
}
|
|
1586
1652
|
function ChevronDown({ className }) {
|
|
1587
|
-
return /* @__PURE__ */
|
|
1653
|
+
return /* @__PURE__ */ jsx5("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx5("path", { d: "m6 9 6 6 6-6" }) });
|
|
1588
1654
|
}
|
|
1589
1655
|
function LockGlyph({ className }) {
|
|
1590
|
-
return /* @__PURE__ */
|
|
1591
|
-
/* @__PURE__ */
|
|
1592
|
-
/* @__PURE__ */
|
|
1656
|
+
return /* @__PURE__ */ jsxs5("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
1657
|
+
/* @__PURE__ */ jsx5("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }),
|
|
1658
|
+
/* @__PURE__ */ jsx5("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
|
|
1593
1659
|
] });
|
|
1594
1660
|
}
|
|
1595
1661
|
function GearGlyph({ className }) {
|
|
1596
|
-
return /* @__PURE__ */
|
|
1597
|
-
/* @__PURE__ */
|
|
1598
|
-
/* @__PURE__ */
|
|
1662
|
+
return /* @__PURE__ */ jsxs5("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
1663
|
+
/* @__PURE__ */ jsx5("circle", { cx: "12", cy: "12", r: "3" }),
|
|
1664
|
+
/* @__PURE__ */ jsx5("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z" })
|
|
1599
1665
|
] });
|
|
1600
1666
|
}
|
|
1601
1667
|
var FOCUS_RING = "";
|
|
@@ -1607,8 +1673,8 @@ function HarnessPicker({
|
|
|
1607
1673
|
lockReason,
|
|
1608
1674
|
variant = "chip"
|
|
1609
1675
|
}) {
|
|
1610
|
-
const [open, setOpen] =
|
|
1611
|
-
const [hintOpen, setHintOpen] =
|
|
1676
|
+
const [open, setOpen] = useState5(false);
|
|
1677
|
+
const [hintOpen, setHintOpen] = useState5(false);
|
|
1612
1678
|
const { containerRef, triggerRef, panelRef, triggerProps } = usePopover(open, setOpen);
|
|
1613
1679
|
const hintPanelRef = useRef4(null);
|
|
1614
1680
|
const panelId = useId2();
|
|
@@ -1617,8 +1683,8 @@ function HarnessPicker({
|
|
|
1617
1683
|
const options = available ?? Object.keys(HARNESS_LABELS);
|
|
1618
1684
|
const showHint = () => setHintOpen(true);
|
|
1619
1685
|
const hideHint = () => setHintOpen(false);
|
|
1620
|
-
return /* @__PURE__ */
|
|
1621
|
-
/* @__PURE__ */
|
|
1686
|
+
return /* @__PURE__ */ jsxs5("div", { ref: containerRef, className: pickerRootClass(fullWidth), children: [
|
|
1687
|
+
/* @__PURE__ */ jsxs5(
|
|
1622
1688
|
"button",
|
|
1623
1689
|
{
|
|
1624
1690
|
type: "button",
|
|
@@ -1637,17 +1703,17 @@ function HarnessPicker({
|
|
|
1637
1703
|
"data-state": !locked && open ? "open" : "closed",
|
|
1638
1704
|
className: variant === "quiet" ? `${quietPickerTriggerClass({ interactive: !locked })} w-full justify-between` : `inline-flex min-h-[36px] w-full items-center justify-between gap-1.5 rounded-full border border-border bg-card px-3 py-1.5 text-sm font-medium text-foreground transition ${locked ? "cursor-default" : "hover:bg-accent"} ${FOCUS_RING}`,
|
|
1639
1705
|
children: [
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
/* @__PURE__ */
|
|
1706
|
+
/* @__PURE__ */ jsxs5("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
1707
|
+
/* @__PURE__ */ jsx5(HarnessGlyph, { harness: value, className: variant === "quiet" ? "h-4 w-4 shrink-0" : "h-4 w-4 shrink-0 text-foreground" }),
|
|
1708
|
+
/* @__PURE__ */ jsx5("span", { className: "truncate", children: harnessLabel(value) })
|
|
1643
1709
|
] }),
|
|
1644
|
-
locked ? /* @__PURE__ */
|
|
1710
|
+
locked ? /* @__PURE__ */ jsx5(LockGlyph, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ jsx5(ChevronDown, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" })
|
|
1645
1711
|
]
|
|
1646
1712
|
}
|
|
1647
1713
|
),
|
|
1648
|
-
locked && /* @__PURE__ */
|
|
1649
|
-
/* @__PURE__ */
|
|
1650
|
-
/* @__PURE__ */
|
|
1714
|
+
locked && /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
1715
|
+
/* @__PURE__ */ jsx5("span", { id: reasonId, className: "sr-only", children: lockReason }),
|
|
1716
|
+
/* @__PURE__ */ jsx5(
|
|
1651
1717
|
PopoverSurface,
|
|
1652
1718
|
{
|
|
1653
1719
|
open: hintOpen,
|
|
@@ -1656,11 +1722,11 @@ function HarnessPicker({
|
|
|
1656
1722
|
panelRef: hintPanelRef,
|
|
1657
1723
|
matchTriggerWidth: fullWidth,
|
|
1658
1724
|
className: `max-w-[248px] rounded-lg border border-card-edge bg-popover px-2.5 py-1.5 text-xs leading-snug text-muted-foreground ${OVERLAY_SHADOW}`,
|
|
1659
|
-
children: /* @__PURE__ */
|
|
1725
|
+
children: /* @__PURE__ */ jsx5("span", { "aria-hidden": true, children: lockReason })
|
|
1660
1726
|
}
|
|
1661
1727
|
)
|
|
1662
1728
|
] }),
|
|
1663
|
-
/* @__PURE__ */
|
|
1729
|
+
/* @__PURE__ */ jsx5(
|
|
1664
1730
|
PopoverSurface,
|
|
1665
1731
|
{
|
|
1666
1732
|
open: !locked && open,
|
|
@@ -1670,7 +1736,7 @@ function HarnessPicker({
|
|
|
1670
1736
|
panelRef,
|
|
1671
1737
|
matchTriggerWidth: true,
|
|
1672
1738
|
className: `max-h-64 min-w-[248px] overflow-y-auto rounded-xl border border-card-edge bg-popover p-1 ${OVERLAY_SHADOW}`,
|
|
1673
|
-
children: options.map((h) => /* @__PURE__ */
|
|
1739
|
+
children: options.map((h) => /* @__PURE__ */ jsxs5(
|
|
1674
1740
|
"button",
|
|
1675
1741
|
{
|
|
1676
1742
|
type: "button",
|
|
@@ -1682,9 +1748,9 @@ function HarnessPicker({
|
|
|
1682
1748
|
},
|
|
1683
1749
|
className: `flex w-full items-center gap-2.5 rounded-md px-3 py-2 text-left text-sm transition ${FOCUS_RING} ${h === value ? "bg-primary/10 font-medium" : "hover:bg-accent"}`,
|
|
1684
1750
|
children: [
|
|
1685
|
-
/* @__PURE__ */
|
|
1686
|
-
/* @__PURE__ */
|
|
1687
|
-
h === value && /* @__PURE__ */
|
|
1751
|
+
/* @__PURE__ */ jsx5(HarnessGlyph, { harness: h, className: "h-4 w-4 shrink-0 text-foreground" }),
|
|
1752
|
+
/* @__PURE__ */ jsx5("span", { className: "truncate", children: harnessLabel(h) }),
|
|
1753
|
+
h === value && /* @__PURE__ */ jsx5(CheckGlyph, { className: "ml-auto h-3.5 w-3.5 shrink-0 text-primary" })
|
|
1688
1754
|
]
|
|
1689
1755
|
},
|
|
1690
1756
|
h
|
|
@@ -1725,15 +1791,17 @@ function AgentSessionControls(props) {
|
|
|
1725
1791
|
harnessLockReason,
|
|
1726
1792
|
variant = "chip",
|
|
1727
1793
|
renderProviderBadge,
|
|
1728
|
-
className
|
|
1794
|
+
className,
|
|
1795
|
+
profileControl,
|
|
1796
|
+
settingsSummary
|
|
1729
1797
|
} = props;
|
|
1730
1798
|
const { onModel, onHarness } = useCoherentHandlers(props);
|
|
1731
|
-
const [open, setOpen] =
|
|
1799
|
+
const [open, setOpen] = useState5(false);
|
|
1732
1800
|
const { containerRef: popoverRef, triggerRef, panelRef, triggerProps } = usePopover(open, setOpen);
|
|
1733
1801
|
const panelId = useId2();
|
|
1734
1802
|
const selectedModel = models.find((m) => m.id === model);
|
|
1735
1803
|
const showEffort = selectedModel?.supportsReasoning ?? true;
|
|
1736
|
-
const modelPicker = /* @__PURE__ */
|
|
1804
|
+
const modelPicker = /* @__PURE__ */ jsx5(
|
|
1737
1805
|
ModelPicker,
|
|
1738
1806
|
{
|
|
1739
1807
|
value: model,
|
|
@@ -1744,10 +1812,30 @@ function AgentSessionControls(props) {
|
|
|
1744
1812
|
variant
|
|
1745
1813
|
}
|
|
1746
1814
|
);
|
|
1815
|
+
if (layout === "grouped") {
|
|
1816
|
+
return /* @__PURE__ */ jsxs5(AgentSettingsPopover, { summary: settingsSummary ?? selectedModel?.name ?? model, className, children: [
|
|
1817
|
+
profileControl != null && /* @__PURE__ */ jsxs5("div", { className: "space-y-1.5", children: [
|
|
1818
|
+
/* @__PURE__ */ jsx5("p", { className: "text-xs font-medium text-muted-foreground", children: "Profile" }),
|
|
1819
|
+
profileControl
|
|
1820
|
+
] }),
|
|
1821
|
+
/* @__PURE__ */ jsxs5("div", { className: "space-y-1.5", children: [
|
|
1822
|
+
/* @__PURE__ */ jsx5("p", { className: "text-xs font-medium text-muted-foreground", children: "Model" }),
|
|
1823
|
+
modelPicker
|
|
1824
|
+
] }),
|
|
1825
|
+
showHarness && /* @__PURE__ */ jsxs5("div", { className: "space-y-1.5", children: [
|
|
1826
|
+
/* @__PURE__ */ jsx5("p", { className: "text-xs font-medium text-muted-foreground", children: "Agent backend" }),
|
|
1827
|
+
/* @__PURE__ */ jsx5(HarnessPicker, { value: harness, onChange: onHarness, available: availableHarnesses, lockReason: harnessLockReason, fullWidth: true, variant })
|
|
1828
|
+
] }),
|
|
1829
|
+
showEffort && /* @__PURE__ */ jsxs5("div", { className: "space-y-1.5", children: [
|
|
1830
|
+
/* @__PURE__ */ jsx5("p", { className: "text-xs font-medium text-muted-foreground", children: "Thinking" }),
|
|
1831
|
+
/* @__PURE__ */ jsx5(EffortPicker, { value: effort, onChange: onEffortChange, levels: effortLevels, fullWidth: true, variant })
|
|
1832
|
+
] })
|
|
1833
|
+
] });
|
|
1834
|
+
}
|
|
1747
1835
|
if (layout === "inline") {
|
|
1748
|
-
return /* @__PURE__ */
|
|
1836
|
+
return /* @__PURE__ */ jsxs5("div", { className: `flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1 ${className ?? ""}`, children: [
|
|
1749
1837
|
modelPicker,
|
|
1750
|
-
showHarness && /* @__PURE__ */
|
|
1838
|
+
showHarness && /* @__PURE__ */ jsx5(
|
|
1751
1839
|
HarnessPicker,
|
|
1752
1840
|
{
|
|
1753
1841
|
value: harness,
|
|
@@ -1757,14 +1845,14 @@ function AgentSessionControls(props) {
|
|
|
1757
1845
|
variant
|
|
1758
1846
|
}
|
|
1759
1847
|
),
|
|
1760
|
-
showEffort && /* @__PURE__ */
|
|
1848
|
+
showEffort && /* @__PURE__ */ jsx5(EffortPicker, { value: effort, onChange: onEffortChange, levels: effortLevels, variant })
|
|
1761
1849
|
] });
|
|
1762
1850
|
}
|
|
1763
1851
|
const hasAdvanced = showHarness || showEffort;
|
|
1764
|
-
return /* @__PURE__ */
|
|
1852
|
+
return /* @__PURE__ */ jsxs5("div", { className: `flex items-center gap-1.5 ${className ?? ""}`, children: [
|
|
1765
1853
|
modelPicker,
|
|
1766
|
-
hasAdvanced && /* @__PURE__ */
|
|
1767
|
-
/* @__PURE__ */
|
|
1854
|
+
hasAdvanced && /* @__PURE__ */ jsxs5("div", { ref: popoverRef, className: "relative inline-flex", children: [
|
|
1855
|
+
/* @__PURE__ */ jsx5(
|
|
1768
1856
|
"button",
|
|
1769
1857
|
{
|
|
1770
1858
|
type: "button",
|
|
@@ -1774,10 +1862,10 @@ function AgentSessionControls(props) {
|
|
|
1774
1862
|
title: "Model settings \u2014 pick the agent backend and how hard it thinks",
|
|
1775
1863
|
className: `flex h-8 w-8 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted hover:text-foreground data-[state=open]:bg-muted ${FOCUS_RING}`,
|
|
1776
1864
|
"data-state": open ? "open" : "closed",
|
|
1777
|
-
children: /* @__PURE__ */
|
|
1865
|
+
children: /* @__PURE__ */ jsx5(GearGlyph, { className: "h-4 w-4" })
|
|
1778
1866
|
}
|
|
1779
1867
|
),
|
|
1780
|
-
/* @__PURE__ */
|
|
1868
|
+
/* @__PURE__ */ jsxs5(
|
|
1781
1869
|
PopoverSurface,
|
|
1782
1870
|
{
|
|
1783
1871
|
open,
|
|
@@ -1786,9 +1874,9 @@ function AgentSessionControls(props) {
|
|
|
1786
1874
|
panelRef,
|
|
1787
1875
|
className: `w-72 space-y-3 overflow-y-auto rounded-xl border border-card-edge bg-popover p-3 ${OVERLAY_SHADOW}`,
|
|
1788
1876
|
children: [
|
|
1789
|
-
showHarness && /* @__PURE__ */
|
|
1790
|
-
/* @__PURE__ */
|
|
1791
|
-
/* @__PURE__ */
|
|
1877
|
+
showHarness && /* @__PURE__ */ jsxs5("div", { className: "space-y-1.5", children: [
|
|
1878
|
+
/* @__PURE__ */ jsx5("p", { className: "text-xs font-medium text-foreground", children: "Agent backend" }),
|
|
1879
|
+
/* @__PURE__ */ jsx5(
|
|
1792
1880
|
HarnessPicker,
|
|
1793
1881
|
{
|
|
1794
1882
|
value: harness,
|
|
@@ -1799,12 +1887,12 @@ function AgentSessionControls(props) {
|
|
|
1799
1887
|
variant
|
|
1800
1888
|
}
|
|
1801
1889
|
),
|
|
1802
|
-
/* @__PURE__ */
|
|
1890
|
+
/* @__PURE__ */ jsx5("p", { className: "text-xs leading-snug text-muted-foreground", children: "The engine that runs the agent. Switching it keeps your model choice compatible." })
|
|
1803
1891
|
] }),
|
|
1804
|
-
showEffort && /* @__PURE__ */
|
|
1805
|
-
/* @__PURE__ */
|
|
1806
|
-
/* @__PURE__ */
|
|
1807
|
-
/* @__PURE__ */
|
|
1892
|
+
showEffort && /* @__PURE__ */ jsxs5("div", { className: "space-y-1.5", children: [
|
|
1893
|
+
/* @__PURE__ */ jsx5("p", { className: "text-xs font-medium text-foreground", children: "Thinking" }),
|
|
1894
|
+
/* @__PURE__ */ jsx5(EffortPicker, { value: effort, onChange: onEffortChange, levels: effortLevels, label: "", fullWidth: true, variant }),
|
|
1895
|
+
/* @__PURE__ */ jsx5("p", { className: "text-xs leading-snug text-muted-foreground", children: "How hard the agent thinks before answering. Higher is slower but more thorough." })
|
|
1808
1896
|
] })
|
|
1809
1897
|
]
|
|
1810
1898
|
}
|
|
@@ -1814,13 +1902,13 @@ function AgentSessionControls(props) {
|
|
|
1814
1902
|
}
|
|
1815
1903
|
|
|
1816
1904
|
// src/web-react/composer-mode-controls.tsx
|
|
1817
|
-
import { jsx as
|
|
1905
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1818
1906
|
function ListChecksGlyph({ className }) {
|
|
1819
|
-
return /* @__PURE__ */
|
|
1907
|
+
return /* @__PURE__ */ jsx6("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx6("path", { d: "m3 17 2 2 4-4M3 7l2 2 4-4M13 6h8M13 12h8M13 18h8" }) });
|
|
1820
1908
|
}
|
|
1821
1909
|
function ComposerModeControls({ planMode }) {
|
|
1822
1910
|
if (!planMode) return null;
|
|
1823
|
-
return /* @__PURE__ */
|
|
1911
|
+
return /* @__PURE__ */ jsxs6(
|
|
1824
1912
|
"button",
|
|
1825
1913
|
{
|
|
1826
1914
|
type: "button",
|
|
@@ -1837,7 +1925,7 @@ function ComposerModeControls({ planMode }) {
|
|
|
1837
1925
|
planMode.saving && "opacity-60"
|
|
1838
1926
|
),
|
|
1839
1927
|
children: [
|
|
1840
|
-
/* @__PURE__ */
|
|
1928
|
+
/* @__PURE__ */ jsx6(ListChecksGlyph, { className: "h-3.5 w-3.5" }),
|
|
1841
1929
|
"Plan"
|
|
1842
1930
|
]
|
|
1843
1931
|
}
|
|
@@ -1845,8 +1933,8 @@ function ComposerModeControls({ planMode }) {
|
|
|
1845
1933
|
}
|
|
1846
1934
|
|
|
1847
1935
|
// src/web-react/entry-composer.tsx
|
|
1848
|
-
import { useState as
|
|
1849
|
-
import { jsx as
|
|
1936
|
+
import { useState as useState6 } from "react";
|
|
1937
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1850
1938
|
function EntryComposer({
|
|
1851
1939
|
heading,
|
|
1852
1940
|
subheading,
|
|
@@ -1870,7 +1958,7 @@ function EntryComposer({
|
|
|
1870
1958
|
composerClassName,
|
|
1871
1959
|
maxWidth = 820
|
|
1872
1960
|
}) {
|
|
1873
|
-
const [value, setValue] =
|
|
1961
|
+
const [value, setValue] = useState6(initialValue);
|
|
1874
1962
|
const attachments = useComposerAttachments({
|
|
1875
1963
|
uploadUrl,
|
|
1876
1964
|
enabled: !!uploadUrl,
|
|
@@ -1890,14 +1978,14 @@ function EntryComposer({
|
|
|
1890
1978
|
attachments.clear();
|
|
1891
1979
|
mentions?.clearMentions();
|
|
1892
1980
|
}
|
|
1893
|
-
return /* @__PURE__ */
|
|
1981
|
+
return /* @__PURE__ */ jsx7(
|
|
1894
1982
|
"div",
|
|
1895
1983
|
{
|
|
1896
|
-
className: className ?? "relative flex flex-1 flex-col items-center
|
|
1897
|
-
children: /* @__PURE__ */
|
|
1898
|
-
heading ? /* @__PURE__ */
|
|
1899
|
-
subheading ? /* @__PURE__ */
|
|
1900
|
-
/* @__PURE__ */
|
|
1984
|
+
className: className ?? "relative flex min-h-0 flex-1 flex-col items-center overflow-y-auto bg-background px-5 py-8",
|
|
1985
|
+
children: /* @__PURE__ */ jsxs7("div", { className: "my-auto w-full shrink-0", style: { maxWidth }, children: [
|
|
1986
|
+
heading ? /* @__PURE__ */ jsx7("h2", { className: "mb-4 text-center text-[1.75rem] font-medium tracking-tight text-foreground", children: heading }) : null,
|
|
1987
|
+
subheading ? /* @__PURE__ */ jsx7("p", { className: "mx-auto mb-9 max-w-md text-center text-sm leading-relaxed text-muted-foreground", children: subheading }) : heading ? /* @__PURE__ */ jsx7("div", { className: "mb-7" }) : null,
|
|
1988
|
+
/* @__PURE__ */ jsx7(
|
|
1901
1989
|
ChatComposer,
|
|
1902
1990
|
{
|
|
1903
1991
|
className: composerClassName ?? "vt-composer",
|
|
@@ -1924,11 +2012,11 @@ function EntryComposer({
|
|
|
1924
2012
|
// brighter overlay tone the component defaults to.
|
|
1925
2013
|
popoverClassName: mentionPopoverClassName ?? "bg-surface-container-low border-[var(--md3-outline-variant)]"
|
|
1926
2014
|
} : void 0,
|
|
1927
|
-
controls: modes ?? /* @__PURE__ */
|
|
1928
|
-
trailing: agent ? /* @__PURE__ */
|
|
2015
|
+
controls: modes ?? /* @__PURE__ */ jsx7(ComposerModeControls, { planMode }),
|
|
2016
|
+
trailing: agent ? /* @__PURE__ */ jsx7(AgentSessionControls, { ...agent }) : void 0
|
|
1929
2017
|
}
|
|
1930
2018
|
),
|
|
1931
|
-
footer ? /* @__PURE__ */
|
|
2019
|
+
footer ? /* @__PURE__ */ jsx7("div", { className: "mt-7", children: footer }) : null
|
|
1932
2020
|
] })
|
|
1933
2021
|
}
|
|
1934
2022
|
);
|
|
@@ -1947,8 +2035,9 @@ export {
|
|
|
1947
2035
|
ChatComposer,
|
|
1948
2036
|
useComposerAttachments,
|
|
1949
2037
|
HarnessGlyph,
|
|
2038
|
+
AgentSettingsPopover,
|
|
1950
2039
|
AgentSessionControls,
|
|
1951
2040
|
ComposerModeControls,
|
|
1952
2041
|
EntryComposer
|
|
1953
2042
|
};
|
|
1954
|
-
//# sourceMappingURL=chunk-
|
|
2043
|
+
//# sourceMappingURL=chunk-7HMDNSIA.js.map
|