@tangle-network/agent-app 0.53.3 → 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 +86 -39
- 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 +1 -1
- package/dist/{chunk-36ZV7KIP.js → chunk-7HMDNSIA.js} +3 -2
- package/dist/chunk-7HMDNSIA.js.map +1 -0
- package/dist/web-react/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-36ZV7KIP.js.map +0 -1
|
@@ -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
|
@@ -1205,7 +1205,8 @@ function ChatComposer({
|
|
|
1205
1205
|
] })
|
|
1206
1206
|
}
|
|
1207
1207
|
),
|
|
1208
|
-
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: [
|
|
1209
1210
|
/* @__PURE__ */ jsx2("kbd", { className: "rounded border border-border bg-background px-1 py-0.5 text-xs", children: IS_APPLE_PLATFORM ? "Cmd" : "Ctrl" }),
|
|
1210
1211
|
/* @__PURE__ */ jsx2("kbd", { className: "ml-0.5 rounded border border-border bg-background px-1 py-0.5 text-xs", children: "L" }),
|
|
1211
1212
|
/* @__PURE__ */ jsx2("span", { className: "ml-1", children: "to focus" })
|
|
@@ -2039,4 +2040,4 @@ export {
|
|
|
2039
2040
|
ComposerModeControls,
|
|
2040
2041
|
EntryComposer
|
|
2041
2042
|
};
|
|
2042
|
-
//# sourceMappingURL=chunk-
|
|
2043
|
+
//# sourceMappingURL=chunk-7HMDNSIA.js.map
|