@tangle-network/agent-app 0.53.3 → 0.53.5
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 +92 -44
- 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 -3
- package/dist/chunk-2WELYICW.js +78 -0
- package/dist/chunk-2WELYICW.js.map +1 -0
- package/dist/{chunk-6FYFGQ6I.js → chunk-AUA75YFF.js} +2 -2
- package/dist/{chunk-36ZV7KIP.js → chunk-JZ64GXYP.js} +6 -5
- package/dist/chunk-JZ64GXYP.js.map +1 -0
- package/dist/{chunk-IYK5BRL4.js → chunk-LVSKKDX2.js} +7 -4
- package/dist/chunk-LVSKKDX2.js.map +1 -0
- package/dist/{chunk-ODP3X4BN.js → chunk-QHLQPK2H.js} +11 -5
- package/dist/chunk-QHLQPK2H.js.map +1 -0
- package/dist/{chunk-NH32EPWU.js → chunk-WZ2FER6A.js} +15 -72
- package/dist/chunk-WZ2FER6A.js.map +1 -0
- package/dist/{chunk-BINC6OWR.js → chunk-ZFFBT5BF.js} +2 -2
- package/dist/{mention-editor-E6J2RUG4.js → mention-editor-4EWHJ5G5.js} +2 -2
- package/dist/studio-react/index.js +3 -2
- package/dist/studio-react/index.js.map +1 -1
- package/dist/web-react/action-dialog.d.ts +15 -0
- package/dist/web-react/controls.d.ts +6 -1
- package/dist/web-react/index.js +9 -6
- package/dist/web-react/workspace-switcher.d.ts +9 -0
- package/dist/workspace-react/index.d.ts +13 -1
- package/dist/workspace-react/index.js +589 -20
- package/dist/workspace-react/index.js.map +1 -1
- package/dist/workspace-react/rail-identity.d.ts +55 -0
- package/dist/workspace-react/workspace-list.d.ts +82 -0
- package/package.json +1 -1
- package/dist/chunk-36ZV7KIP.js.map +0 -1
- package/dist/chunk-IYK5BRL4.js.map +0 -1
- package/dist/chunk-NH32EPWU.js.map +0 -1
- package/dist/chunk-ODP3X4BN.js.map +0 -1
- /package/dist/{chunk-6FYFGQ6I.js.map → chunk-AUA75YFF.js.map} +0 -0
- /package/dist/{chunk-BINC6OWR.js.map → chunk-ZFFBT5BF.js.map} +0 -0
- /package/dist/{mention-editor-E6J2RUG4.js.map → mention-editor-4EWHJ5G5.js.map} +0 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The assistant's place in the app shell: a right-side panel that mirrors the
|
|
3
3
|
* left sidebar. A panel toggle opens and closes it (top right while closed,
|
|
4
|
-
* the header's inner edge while open) and ⌘E / Ctrl+E does the same.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* the header's inner edge while open) and ⌘E / Ctrl+E does the same. Wherever
|
|
5
|
+
* the page keeps a usable column beside it (the launcher's `reservedWidth` and
|
|
6
|
+
* `dockMediaQuery` say what the host's chrome takes), the panel docks beside
|
|
7
|
+
* the page: it is non-modal, resizable, and the launcher's `inset` tells the
|
|
8
|
+
* shell how far to pad its page column so the panel never covers page content.
|
|
9
|
+
* Where it would not fit, it opens as a modal sheet, full screen on phones.
|
|
10
|
+
* Width and open state persist per user.
|
|
9
11
|
*
|
|
10
12
|
* The dock owns the chat state (via useAssistantChat) so the conversation
|
|
11
13
|
* survives the panel closing. Host-shell concerns (the user, navigation,
|
|
@@ -18,6 +18,7 @@ export { AssistantDock, type AssistantDockProps } from "./AssistantDock";
|
|
|
18
18
|
export { AssistantPanel, type AssistantPanelProps } from "./AssistantPanel";
|
|
19
19
|
export { AssistantTranscript, type AssistantTranscriptProps, type AssistantTimelineOptions, buildAssistantTimeline, assistantIsThinking, } from "./transcript";
|
|
20
20
|
export { ProposalCard, type ProposalCardProps } from "./ProposalCard";
|
|
21
|
-
export { AssistantLauncherProvider, useAssistantLauncher, type AssistantLauncher, type AssistantPanelLayout, } from "./launcher";
|
|
21
|
+
export { AssistantLauncherProvider, useAssistantLauncher, useAssistantPageLabel, type AssistantLauncher, type AssistantPanelLayout, } from "./launcher";
|
|
22
|
+
export { MIN_PAGE_WIDTH, MIN_PANEL_WIDTH } from "./usePanelPrefs";
|
|
22
23
|
export { useDocumentPageContext, pageLabelFromTitle, type DocumentPageContextOptions, } from "./page-context";
|
|
23
24
|
export { AssistantPanelToggle, type AssistantPanelToggleProps, ASSISTANT_PANEL_ID, assistantShortcutLabel, } from "./panel-toggle";
|
package/dist/assistant/index.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
chatToolCallPart
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-ZFFBT5BF.js";
|
|
4
|
+
import "../chunk-WZ2FER6A.js";
|
|
5
5
|
import "../chunk-3HUFJ5LO.js";
|
|
6
6
|
import "../chunk-FBVLEGEG.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-QHLQPK2H.js";
|
|
8
|
+
import "../chunk-2WELYICW.js";
|
|
8
9
|
import "../chunk-E4AY62T2.js";
|
|
9
10
|
import "../chunk-ENLRJYVW.js";
|
|
10
11
|
import "../chunk-GEYACSFW.js";
|
|
11
12
|
import {
|
|
12
13
|
ChatComposer
|
|
13
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-JZ64GXYP.js";
|
|
14
15
|
import "../chunk-L7MB2LLM.js";
|
|
15
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-AUA75YFF.js";
|
|
16
17
|
import {
|
|
17
18
|
ModelPicker
|
|
18
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-LVSKKDX2.js";
|
|
19
20
|
import "../chunk-SJWIZT7B.js";
|
|
20
21
|
import "../chunk-MLG6XKPV.js";
|
|
21
22
|
import {
|
|
@@ -1925,8 +1926,17 @@ import { useCallback as useCallback3, useEffect as useEffect4, useRef as useRef3
|
|
|
1925
1926
|
var MIN_PANEL_WIDTH = 360;
|
|
1926
1927
|
var DEFAULT_PANEL_WIDTH = 480;
|
|
1927
1928
|
var MAX_PANEL_WIDTH = 800;
|
|
1928
|
-
var
|
|
1929
|
-
var
|
|
1929
|
+
var SHEET_MAX_WIDTH_FRACTION = 0.5;
|
|
1930
|
+
var MIN_PAGE_WIDTH = 400;
|
|
1931
|
+
var DEFAULT_RESERVED_WIDTH = 256;
|
|
1932
|
+
var DOCKED_MEDIA_QUERY = "(min-width: 64rem)";
|
|
1933
|
+
function canDock(viewportWidth, reservedWidth, hostAllows) {
|
|
1934
|
+
return hostAllows && viewportWidth - reservedWidth - MIN_PANEL_WIDTH >= MIN_PAGE_WIDTH;
|
|
1935
|
+
}
|
|
1936
|
+
var DEFAULT_GEOMETRY = {
|
|
1937
|
+
reservedWidth: DEFAULT_RESERVED_WIDTH,
|
|
1938
|
+
docked: true
|
|
1939
|
+
};
|
|
1930
1940
|
var LEGACY_WIDTH_KEY = "assistant.panel.width";
|
|
1931
1941
|
function prefsKey(userId) {
|
|
1932
1942
|
return userId ? `assistant:v1:${userId}:panel` : null;
|
|
@@ -1956,26 +1966,24 @@ function writePrefs(userId, next) {
|
|
|
1956
1966
|
} catch {
|
|
1957
1967
|
}
|
|
1958
1968
|
}
|
|
1959
|
-
function maxPanelWidth() {
|
|
1969
|
+
function maxPanelWidth(geometry) {
|
|
1960
1970
|
if (typeof window === "undefined") return MAX_PANEL_WIDTH;
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
Math.min(
|
|
1964
|
-
Math.round(window.innerWidth * MAX_PANEL_WIDTH_FRACTION),
|
|
1965
|
-
MAX_PANEL_WIDTH
|
|
1966
|
-
)
|
|
1967
|
-
);
|
|
1971
|
+
const room = geometry.docked ? window.innerWidth - geometry.reservedWidth - MIN_PAGE_WIDTH : Math.round(window.innerWidth * SHEET_MAX_WIDTH_FRACTION);
|
|
1972
|
+
return Math.max(MIN_PANEL_WIDTH, Math.min(room, MAX_PANEL_WIDTH));
|
|
1968
1973
|
}
|
|
1969
|
-
function clampWidth(value) {
|
|
1974
|
+
function clampWidth(value, geometry) {
|
|
1970
1975
|
return Math.min(
|
|
1971
1976
|
Math.max(Math.round(value), MIN_PANEL_WIDTH),
|
|
1972
|
-
maxPanelWidth()
|
|
1977
|
+
maxPanelWidth(geometry)
|
|
1973
1978
|
);
|
|
1974
1979
|
}
|
|
1975
|
-
function usePanelPrefs(userId) {
|
|
1980
|
+
function usePanelPrefs(userId, geometry = DEFAULT_GEOMETRY) {
|
|
1981
|
+
const { reservedWidth, docked } = geometry;
|
|
1982
|
+
const geometryRef = useRef3(geometry);
|
|
1983
|
+
geometryRef.current = { reservedWidth, docked };
|
|
1976
1984
|
const [storedOpen, setStoredOpen] = useState4(null);
|
|
1977
1985
|
const [width, setWidthState] = useState4(DEFAULT_PANEL_WIDTH);
|
|
1978
|
-
const [maxWidth, setMaxWidth] = useState4(() => maxPanelWidth());
|
|
1986
|
+
const [maxWidth, setMaxWidth] = useState4(() => maxPanelWidth(geometry));
|
|
1979
1987
|
const desiredRef = useRef3(DEFAULT_PANEL_WIDTH);
|
|
1980
1988
|
const userRef = useRef3(userId);
|
|
1981
1989
|
userRef.current = userId;
|
|
@@ -1986,32 +1994,33 @@ function usePanelPrefs(userId) {
|
|
|
1986
1994
|
Math.round(prefs.width ?? DEFAULT_PANEL_WIDTH),
|
|
1987
1995
|
MIN_PANEL_WIDTH
|
|
1988
1996
|
);
|
|
1989
|
-
setMaxWidth(maxPanelWidth());
|
|
1990
|
-
setWidthState(clampWidth(desiredRef.current));
|
|
1997
|
+
setMaxWidth(maxPanelWidth(geometryRef.current));
|
|
1998
|
+
setWidthState(clampWidth(desiredRef.current, geometryRef.current));
|
|
1991
1999
|
}, [userId]);
|
|
1992
2000
|
useEffect4(() => {
|
|
1993
|
-
const
|
|
1994
|
-
setMaxWidth(maxPanelWidth());
|
|
1995
|
-
setWidthState(clampWidth(desiredRef.current));
|
|
2001
|
+
const fit = () => {
|
|
2002
|
+
setMaxWidth(maxPanelWidth(geometryRef.current));
|
|
2003
|
+
setWidthState(clampWidth(desiredRef.current, geometryRef.current));
|
|
1996
2004
|
};
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2005
|
+
fit();
|
|
2006
|
+
window.addEventListener("resize", fit);
|
|
2007
|
+
return () => window.removeEventListener("resize", fit);
|
|
2008
|
+
}, [reservedWidth, docked]);
|
|
2000
2009
|
const persistOpen = useCallback3((open) => {
|
|
2001
2010
|
setStoredOpen(open);
|
|
2002
2011
|
writePrefs(userRef.current, { open });
|
|
2003
2012
|
}, []);
|
|
2004
2013
|
const setWidth = useCallback3((next) => {
|
|
2005
|
-
const clamped = clampWidth(next);
|
|
2014
|
+
const clamped = clampWidth(next, geometryRef.current);
|
|
2006
2015
|
desiredRef.current = clamped;
|
|
2007
2016
|
writePrefs(userRef.current, { width: clamped });
|
|
2008
2017
|
setWidthState(clamped);
|
|
2009
2018
|
}, []);
|
|
2010
2019
|
const previewWidth = useCallback3((next) => {
|
|
2011
|
-
setWidthState(clampWidth(next));
|
|
2020
|
+
setWidthState(clampWidth(next, geometryRef.current));
|
|
2012
2021
|
}, []);
|
|
2013
2022
|
const nudgeWidth = useCallback3((deltaPx) => {
|
|
2014
|
-
const clamped = clampWidth(desiredRef.current + deltaPx);
|
|
2023
|
+
const clamped = clampWidth(desiredRef.current + deltaPx, geometryRef.current);
|
|
2015
2024
|
desiredRef.current = clamped;
|
|
2016
2025
|
writePrefs(userRef.current, { width: clamped });
|
|
2017
2026
|
setWidthState(clamped);
|
|
@@ -2042,19 +2051,36 @@ function useMediaQuery(query, fallback = true) {
|
|
|
2042
2051
|
}, [query]);
|
|
2043
2052
|
return matches;
|
|
2044
2053
|
}
|
|
2054
|
+
function useViewportWidth() {
|
|
2055
|
+
const [width, setWidth] = useState4(
|
|
2056
|
+
() => typeof window === "undefined" ? Number.POSITIVE_INFINITY : window.innerWidth
|
|
2057
|
+
);
|
|
2058
|
+
useEffect4(() => {
|
|
2059
|
+
const update = () => setWidth(window.innerWidth);
|
|
2060
|
+
update();
|
|
2061
|
+
window.addEventListener("resize", update);
|
|
2062
|
+
return () => window.removeEventListener("resize", update);
|
|
2063
|
+
}, []);
|
|
2064
|
+
return width;
|
|
2065
|
+
}
|
|
2045
2066
|
|
|
2046
2067
|
// src/assistant/launcher.tsx
|
|
2047
2068
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
2048
2069
|
var AssistantLauncherContext = createContext2(null);
|
|
2049
2070
|
function AssistantLauncherProvider({
|
|
2050
2071
|
userId = null,
|
|
2072
|
+
reservedWidth = DEFAULT_RESERVED_WIDTH,
|
|
2073
|
+
dockMediaQuery = DOCKED_MEDIA_QUERY,
|
|
2051
2074
|
children
|
|
2052
2075
|
}) {
|
|
2053
2076
|
const [open, setOpen] = useState5(false);
|
|
2054
2077
|
const [seed, setSeed] = useState5(null);
|
|
2055
2078
|
const [openedOnLoad, setOpenedOnLoad] = useState5(false);
|
|
2056
|
-
const
|
|
2057
|
-
const
|
|
2079
|
+
const [pageLabel, setPageLabelState] = useState5(null);
|
|
2080
|
+
const hostAllowsDock = useMediaQuery(dockMediaQuery, true);
|
|
2081
|
+
const viewportWidth = useViewportWidth();
|
|
2082
|
+
const docked = canDock(viewportWidth, reservedWidth, hostAllowsDock);
|
|
2083
|
+
const prefs = usePanelPrefs(userId, { reservedWidth, docked });
|
|
2058
2084
|
const layout = docked ? "docked" : "sheet";
|
|
2059
2085
|
const { persistOpen, storedOpen } = prefs;
|
|
2060
2086
|
const restoredFor = useRef4(null);
|
|
@@ -2085,6 +2111,10 @@ function AssistantLauncherProvider({
|
|
|
2085
2111
|
persistOpen(!open);
|
|
2086
2112
|
}, [open, persistOpen]);
|
|
2087
2113
|
const clearSeed = useCallback4(() => setSeed(null), []);
|
|
2114
|
+
const setPageLabel = useCallback4(
|
|
2115
|
+
(update) => setPageLabelState(update),
|
|
2116
|
+
[]
|
|
2117
|
+
);
|
|
2088
2118
|
const { width, maxWidth, setWidth, previewWidth, nudgeWidth } = prefs;
|
|
2089
2119
|
const panel = useMemo2(
|
|
2090
2120
|
() => ({ width, maxWidth, setWidth, previewWidth, nudgeWidth }),
|
|
@@ -2102,7 +2132,9 @@ function AssistantLauncherProvider({
|
|
|
2102
2132
|
layout,
|
|
2103
2133
|
openedOnLoad,
|
|
2104
2134
|
inset,
|
|
2105
|
-
panel
|
|
2135
|
+
panel,
|
|
2136
|
+
pageLabel,
|
|
2137
|
+
setPageLabel
|
|
2106
2138
|
}),
|
|
2107
2139
|
[
|
|
2108
2140
|
open,
|
|
@@ -2114,7 +2146,9 @@ function AssistantLauncherProvider({
|
|
|
2114
2146
|
layout,
|
|
2115
2147
|
openedOnLoad,
|
|
2116
2148
|
inset,
|
|
2117
|
-
panel
|
|
2149
|
+
panel,
|
|
2150
|
+
pageLabel,
|
|
2151
|
+
setPageLabel
|
|
2118
2152
|
]
|
|
2119
2153
|
);
|
|
2120
2154
|
return /* @__PURE__ */ jsx3(AssistantLauncherContext.Provider, { value, children });
|
|
@@ -2131,6 +2165,15 @@ function useAssistantLauncher() {
|
|
|
2131
2165
|
}
|
|
2132
2166
|
return ctx;
|
|
2133
2167
|
}
|
|
2168
|
+
function useAssistantPageLabel(label) {
|
|
2169
|
+
const setPageLabel = useOptionalAssistantLauncher()?.setPageLabel;
|
|
2170
|
+
const trimmed = label?.trim() || null;
|
|
2171
|
+
useEffect5(() => {
|
|
2172
|
+
if (!setPageLabel || !trimmed) return;
|
|
2173
|
+
setPageLabel(() => trimmed);
|
|
2174
|
+
return () => setPageLabel((current) => current === trimmed ? null : current);
|
|
2175
|
+
}, [setPageLabel, trimmed]);
|
|
2176
|
+
}
|
|
2134
2177
|
|
|
2135
2178
|
// src/assistant/panel-toggle.tsx
|
|
2136
2179
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
@@ -2152,6 +2195,7 @@ function AssistantPanelToggle({
|
|
|
2152
2195
|
const open = openOverride ?? launcher?.open ?? false;
|
|
2153
2196
|
const toggleAssistant = onToggle ?? launcher?.toggleAssistant;
|
|
2154
2197
|
const label = open ? "Close assistant" : "Open assistant";
|
|
2198
|
+
const touch = useMediaQuery("(pointer: coarse)", false);
|
|
2155
2199
|
return /* @__PURE__ */ jsx4(
|
|
2156
2200
|
"button",
|
|
2157
2201
|
{
|
|
@@ -2162,7 +2206,7 @@ function AssistantPanelToggle({
|
|
|
2162
2206
|
"aria-expanded": open,
|
|
2163
2207
|
"aria-controls": open && launcher ? ASSISTANT_PANEL_ID : void 0,
|
|
2164
2208
|
"aria-keyshortcuts": "Meta+E Control+E",
|
|
2165
|
-
title: `${label} (${assistantShortcutLabel()})`,
|
|
2209
|
+
title: touch ? label : `${label} (${assistantShortcutLabel()})`,
|
|
2166
2210
|
style,
|
|
2167
2211
|
className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-[var(--accent-surface-soft)] hover:text-foreground ${focusRing} ${className ?? ""}`,
|
|
2168
2212
|
children: /* @__PURE__ */ jsx4(PanelRight, { "aria-hidden": "true", className: "h-[18px] w-[18px] shrink-0" })
|
|
@@ -2555,7 +2599,7 @@ function AssistantTranscript({
|
|
|
2555
2599
|
[view, toolRenderers, renderConfirmedResult]
|
|
2556
2600
|
);
|
|
2557
2601
|
if (items.length === 0 && !view.isStreaming) return /* @__PURE__ */ jsx6(Fragment, { children: emptyState });
|
|
2558
|
-
return /* @__PURE__ */ jsx6(AgentTimeline, { items, isThinking: view.isThinking });
|
|
2602
|
+
return /* @__PURE__ */ jsx6(AgentTimeline, { items, isThinking: view.isThinking, className: "px-6" });
|
|
2559
2603
|
}
|
|
2560
2604
|
|
|
2561
2605
|
// src/assistant/use-stick-to-bottom.ts
|
|
@@ -2666,9 +2710,9 @@ function FirstRun({
|
|
|
2666
2710
|
onPick
|
|
2667
2711
|
}) {
|
|
2668
2712
|
const starters = hasPage ? [PAGE_STARTER, ...STARTERS] : STARTERS;
|
|
2669
|
-
return /* @__PURE__ */ jsxs4("div", { className: "px-
|
|
2670
|
-
/* @__PURE__ */ jsx7("h3", { className: "font-semibold text-[var(--font-size-lg)] text-foreground leading-snug", children: "What should the assistant do?" }),
|
|
2671
|
-
/* @__PURE__ */ jsx7("p", { className: "mt-1.5 text-[var(--font-size-base)] text-muted-foreground leading-[1.5]", children: "It creates workflows, checks usage, and manages API keys. Changes wait for your approval." }),
|
|
2713
|
+
return /* @__PURE__ */ jsxs4("div", { className: "px-6 pt-6 pb-4", children: [
|
|
2714
|
+
/* @__PURE__ */ jsx7("h3", { className: "font-semibold text-[length:var(--font-size-lg)] text-foreground leading-snug", children: "What should the assistant do?" }),
|
|
2715
|
+
/* @__PURE__ */ jsx7("p", { className: "mt-1.5 text-[length:var(--font-size-base)] text-muted-foreground leading-[1.5]", children: "It creates workflows, checks usage, and manages API keys. Changes wait for your approval." }),
|
|
2672
2716
|
/* @__PURE__ */ jsx7("ul", { className: "mt-5 flex flex-col gap-2", children: starters.map((starter) => /* @__PURE__ */ jsx7("li", { children: /* @__PURE__ */ jsxs4(
|
|
2673
2717
|
"button",
|
|
2674
2718
|
{
|
|
@@ -2849,7 +2893,7 @@ function AssistantPanel({
|
|
|
2849
2893
|
layout === "docked" && /* @__PURE__ */ jsx7(AssistantPanelToggle, { open: true, onToggle: onClose, buttonRef: toggleRef }),
|
|
2850
2894
|
/* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 flex-col justify-center", children: [
|
|
2851
2895
|
/* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-baseline gap-2", children: [
|
|
2852
|
-
/* @__PURE__ */ jsx7("h2", { className: "truncate font-semibold text-[var(--font-size-base)] text-foreground leading-tight", children: "Assistant" }),
|
|
2896
|
+
/* @__PURE__ */ jsx7("h2", { className: "truncate font-semibold text-[length:var(--font-size-base)] text-foreground leading-tight", children: "Assistant" }),
|
|
2853
2897
|
effectiveBalance != null && /* @__PURE__ */ jsx7(
|
|
2854
2898
|
"span",
|
|
2855
2899
|
{
|
|
@@ -3273,7 +3317,7 @@ function AssistantDock({
|
|
|
3273
3317
|
tabIndex: -1,
|
|
3274
3318
|
onKeyDown: trapTab,
|
|
3275
3319
|
style: { width: wideSheet ? `min(${width}px, 100vw)` : "100%" },
|
|
3276
|
-
className:
|
|
3320
|
+
className: `fixed inset-y-0 right-0 z-50 flex flex-col shadow-[var(--shadow-overlay)] focus:outline-none ${wideSheet ? "border-border border-l" : ""}`,
|
|
3277
3321
|
children: panel
|
|
3278
3322
|
}
|
|
3279
3323
|
)
|
|
@@ -3337,12 +3381,13 @@ function useDocumentPageContext({
|
|
|
3337
3381
|
ids
|
|
3338
3382
|
}) {
|
|
3339
3383
|
const title = useDocumentTitle();
|
|
3384
|
+
const pageLabel = useOptionalAssistantLauncher()?.pageLabel ?? null;
|
|
3340
3385
|
return useMemo5(() => {
|
|
3341
|
-
const label = pageLabelFromTitle(title, titleSuffix, ignoreTitles);
|
|
3386
|
+
const label = (pageLabel && pageLabelFromTitle(pageLabel)) ?? pageLabelFromTitle(title, titleSuffix, ignoreTitles);
|
|
3342
3387
|
if (!label) return null;
|
|
3343
3388
|
const pageIds = ids?.(path);
|
|
3344
3389
|
return { label, path, ...pageIds ? { ids: pageIds } : {} };
|
|
3345
|
-
}, [title, path, titleSuffix, ignoreTitles, ids]);
|
|
3390
|
+
}, [pageLabel, title, path, titleSuffix, ignoreTitles, ids]);
|
|
3346
3391
|
}
|
|
3347
3392
|
export {
|
|
3348
3393
|
ASSISTANT_PANEL_ID,
|
|
@@ -3353,6 +3398,8 @@ export {
|
|
|
3353
3398
|
AssistantPanel,
|
|
3354
3399
|
AssistantPanelToggle,
|
|
3355
3400
|
AssistantTranscript,
|
|
3401
|
+
MIN_PAGE_WIDTH,
|
|
3402
|
+
MIN_PANEL_WIDTH,
|
|
3356
3403
|
ProposalCard,
|
|
3357
3404
|
assistantIsThinking,
|
|
3358
3405
|
assistantShortcutLabel,
|
|
@@ -3363,6 +3410,7 @@ export {
|
|
|
3363
3410
|
useAssistantClient,
|
|
3364
3411
|
useAssistantLauncher,
|
|
3365
3412
|
useAssistantModels,
|
|
3413
|
+
useAssistantPageLabel,
|
|
3366
3414
|
useAssistantThreads,
|
|
3367
3415
|
useDocumentPageContext
|
|
3368
3416
|
};
|