@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.
Files changed (40) hide show
  1. package/dist/assistant/AssistantDock.d.ts +7 -5
  2. package/dist/assistant/index.d.ts +2 -1
  3. package/dist/assistant/index.js +92 -44
  4. package/dist/assistant/index.js.map +1 -1
  5. package/dist/assistant/launcher.d.ts +29 -7
  6. package/dist/assistant/page-context.d.ts +2 -1
  7. package/dist/assistant/usePanelPrefs.d.ts +33 -11
  8. package/dist/chat-react/index.js +3 -3
  9. package/dist/chunk-2WELYICW.js +78 -0
  10. package/dist/chunk-2WELYICW.js.map +1 -0
  11. package/dist/{chunk-6FYFGQ6I.js → chunk-AUA75YFF.js} +2 -2
  12. package/dist/{chunk-36ZV7KIP.js → chunk-JZ64GXYP.js} +6 -5
  13. package/dist/chunk-JZ64GXYP.js.map +1 -0
  14. package/dist/{chunk-IYK5BRL4.js → chunk-LVSKKDX2.js} +7 -4
  15. package/dist/chunk-LVSKKDX2.js.map +1 -0
  16. package/dist/{chunk-ODP3X4BN.js → chunk-QHLQPK2H.js} +11 -5
  17. package/dist/chunk-QHLQPK2H.js.map +1 -0
  18. package/dist/{chunk-NH32EPWU.js → chunk-WZ2FER6A.js} +15 -72
  19. package/dist/chunk-WZ2FER6A.js.map +1 -0
  20. package/dist/{chunk-BINC6OWR.js → chunk-ZFFBT5BF.js} +2 -2
  21. package/dist/{mention-editor-E6J2RUG4.js → mention-editor-4EWHJ5G5.js} +2 -2
  22. package/dist/studio-react/index.js +3 -2
  23. package/dist/studio-react/index.js.map +1 -1
  24. package/dist/web-react/action-dialog.d.ts +15 -0
  25. package/dist/web-react/controls.d.ts +6 -1
  26. package/dist/web-react/index.js +9 -6
  27. package/dist/web-react/workspace-switcher.d.ts +9 -0
  28. package/dist/workspace-react/index.d.ts +13 -1
  29. package/dist/workspace-react/index.js +589 -20
  30. package/dist/workspace-react/index.js.map +1 -1
  31. package/dist/workspace-react/rail-identity.d.ts +55 -0
  32. package/dist/workspace-react/workspace-list.d.ts +82 -0
  33. package/package.json +1 -1
  34. package/dist/chunk-36ZV7KIP.js.map +0 -1
  35. package/dist/chunk-IYK5BRL4.js.map +0 -1
  36. package/dist/chunk-NH32EPWU.js.map +0 -1
  37. package/dist/chunk-ODP3X4BN.js.map +0 -1
  38. /package/dist/{chunk-6FYFGQ6I.js.map → chunk-AUA75YFF.js.map} +0 -0
  39. /package/dist/{chunk-BINC6OWR.js.map → chunk-ZFFBT5BF.js.map} +0 -0
  40. /package/dist/{mention-editor-E6J2RUG4.js.map → mention-editor-4EWHJ5G5.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), and the shell's page column needs to know how
5
- * much room the docked panel takes so the panel never covers page content.
6
- * This context owns the open state, the one-shot composer seed, the panel's
7
- * per-user width and open preference, and the docked-or-sheet layout.
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 (wide viewports). `sheet`: a modal
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 viewport query that
4
- * decides whether the panel docks beside the page or opens as a sheet over it.
5
- * Kept out of the components so the storage, clamping, and SSR guards live in
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
- * Viewports at least this wide dock the panel beside the page; narrower ones
14
- * open it as a sheet over the page. 80rem leaves a host with a 16rem sidebar a
15
- * page column of at least 33rem beside the default panel width.
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 DOCKED_MEDIA_QUERY = "(min-width: 80rem)";
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 on viewport resize from the user's chosen value, so a narrow
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;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ComposerModeControls,
3
3
  EntryComposer
4
- } from "../chunk-36ZV7KIP.js";
4
+ } from "../chunk-JZ64GXYP.js";
5
5
  import "../chunk-L7MB2LLM.js";
6
- import "../chunk-6FYFGQ6I.js";
7
- import "../chunk-IYK5BRL4.js";
6
+ import "../chunk-AUA75YFF.js";
7
+ import "../chunk-LVSKKDX2.js";
8
8
  import "../chunk-SJWIZT7B.js";
9
9
  import "../chunk-MLG6XKPV.js";
10
10
  import "../chunk-2S7QRQUS.js";
@@ -0,0 +1,78 @@
1
+ import {
2
+ OVERLAY_SHADOW
3
+ } from "./chunk-LVSKKDX2.js";
4
+
5
+ // src/web-react/action-dialog.tsx
6
+ import { useEffect } from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ function ActionDialogButton({
9
+ children,
10
+ onClick,
11
+ disabled,
12
+ variant = "primary"
13
+ }) {
14
+ const tone = variant === "ghost" ? "text-muted-foreground hover:bg-accent hover:text-foreground" : variant === "destructive" ? "bg-destructive text-destructive-foreground hover:opacity-90" : "bg-primary text-primary-foreground hover:opacity-90";
15
+ return /* @__PURE__ */ jsx(
16
+ "button",
17
+ {
18
+ type: "button",
19
+ onClick,
20
+ disabled,
21
+ className: `h-9 rounded-md px-3 text-sm font-medium transition disabled:opacity-50 ${tone}`,
22
+ children
23
+ }
24
+ );
25
+ }
26
+ function ActionDialog({
27
+ title,
28
+ children,
29
+ footer,
30
+ onClose,
31
+ busy,
32
+ error
33
+ }) {
34
+ useEffect(() => {
35
+ const opener = document.activeElement instanceof HTMLElement ? document.activeElement : null;
36
+ return () => opener?.focus();
37
+ }, []);
38
+ useEffect(() => {
39
+ const onKey = (e) => {
40
+ if (e.key === "Escape" && !busy) onClose();
41
+ };
42
+ document.addEventListener("keydown", onKey);
43
+ return () => document.removeEventListener("keydown", onKey);
44
+ }, [busy, onClose]);
45
+ return /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
46
+ /* @__PURE__ */ jsx(
47
+ "div",
48
+ {
49
+ className: "absolute inset-0 bg-black/50",
50
+ onClick: () => {
51
+ if (!busy) onClose();
52
+ },
53
+ "aria-hidden": true
54
+ }
55
+ ),
56
+ /* @__PURE__ */ jsxs(
57
+ "div",
58
+ {
59
+ role: "dialog",
60
+ "aria-modal": "true",
61
+ "aria-label": title,
62
+ className: `relative w-full max-w-sm rounded-xl border border-card-edge bg-popover p-5 ${OVERLAY_SHADOW}`,
63
+ children: [
64
+ /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold text-foreground", children: title }),
65
+ /* @__PURE__ */ jsx("div", { className: "mt-3", children }),
66
+ error && /* @__PURE__ */ jsx("p", { role: "alert", className: "mt-3 rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive", children: error }),
67
+ /* @__PURE__ */ jsx("div", { className: "mt-5 flex justify-end gap-2", children: footer })
68
+ ]
69
+ }
70
+ )
71
+ ] });
72
+ }
73
+
74
+ export {
75
+ ActionDialogButton,
76
+ ActionDialog
77
+ };
78
+ //# sourceMappingURL=chunk-2WELYICW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/web-react/action-dialog.tsx"],"sourcesContent":["import { useEffect, type ReactNode } from 'react'\n\nimport { OVERLAY_SHADOW } from './controls'\n\n// The one confirm/edit dialog behind every rename and delete in the shell —\n// session history and the workspace listing share it so the two never drift\n// into subtly different destructive confirmations.\n\nexport function ActionDialogButton({\n children,\n onClick,\n disabled,\n variant = 'primary',\n}: {\n children: ReactNode\n onClick: () => void\n disabled?: boolean\n variant?: 'primary' | 'ghost' | 'destructive'\n}) {\n const tone =\n variant === 'ghost'\n ? 'text-muted-foreground hover:bg-accent hover:text-foreground'\n : variant === 'destructive'\n ? 'bg-destructive text-destructive-foreground hover:opacity-90'\n : 'bg-primary text-primary-foreground hover:opacity-90'\n return (\n <button\n type=\"button\"\n onClick={onClick}\n disabled={disabled}\n className={`h-9 rounded-md px-3 text-sm font-medium transition disabled:opacity-50 ${tone}`}\n >\n {children}\n </button>\n )\n}\n\nexport function ActionDialog({\n title,\n children,\n footer,\n onClose,\n busy,\n error,\n}: {\n title: string\n children: ReactNode\n footer: ReactNode\n onClose: () => void\n busy: boolean\n error: string | null\n}) {\n // Hand focus back to whatever opened the dialog when it closes.\n useEffect(() => {\n const opener = document.activeElement instanceof HTMLElement ? document.activeElement : null\n return () => opener?.focus()\n }, [])\n\n // Escape closes unless a mutation is in flight — closing mid-write would hide\n // the error the user needs to see.\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && !busy) onClose()\n }\n document.addEventListener('keydown', onKey)\n return () => document.removeEventListener('keydown', onKey)\n }, [busy, onClose])\n\n return (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center p-4\">\n <div\n className=\"absolute inset-0 bg-black/50\"\n onClick={() => {\n if (!busy) onClose()\n }}\n aria-hidden\n />\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={title}\n className={`relative w-full max-w-sm rounded-xl border border-card-edge bg-popover p-5 ${OVERLAY_SHADOW}`}\n >\n <h2 className=\"text-sm font-semibold text-foreground\">{title}</h2>\n <div className=\"mt-3\">{children}</div>\n {error && (\n <p role=\"alert\" className=\"mt-3 rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive\">\n {error}\n </p>\n )}\n <div className=\"mt-5 flex justify-end gap-2\">{footer}</div>\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;AAAA,SAAS,iBAAiC;AA0BtC,cAmDE,YAnDF;AAlBG,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AACZ,GAKG;AACD,QAAM,OACJ,YAAY,UACR,gEACA,YAAY,gBACV,gEACA;AACR,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA,WAAW,0EAA0E,IAAI;AAAA,MAExF;AAAA;AAAA,EACH;AAEJ;AAEO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAOG;AAED,YAAU,MAAM;AACd,UAAM,SAAS,SAAS,yBAAyB,cAAc,SAAS,gBAAgB;AACxF,WAAO,MAAM,QAAQ,MAAM;AAAA,EAC7B,GAAG,CAAC,CAAC;AAIL,YAAU,MAAM;AACd,UAAM,QAAQ,CAAC,MAAqB;AAClC,UAAI,EAAE,QAAQ,YAAY,CAAC,KAAM,SAAQ;AAAA,IAC3C;AACA,aAAS,iBAAiB,WAAW,KAAK;AAC1C,WAAO,MAAM,SAAS,oBAAoB,WAAW,KAAK;AAAA,EAC5D,GAAG,CAAC,MAAM,OAAO,CAAC;AAElB,SACE,qBAAC,SAAI,WAAU,2DACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,SAAS,MAAM;AACb,cAAI,CAAC,KAAM,SAAQ;AAAA,QACrB;AAAA,QACA,eAAW;AAAA;AAAA,IACb;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,cAAW;AAAA,QACX,cAAY;AAAA,QACZ,WAAW,8EAA8E,cAAc;AAAA,QAEvG;AAAA,8BAAC,QAAG,WAAU,yCAAyC,iBAAM;AAAA,UAC7D,oBAAC,SAAI,WAAU,QAAQ,UAAS;AAAA,UAC/B,SACC,oBAAC,OAAE,MAAK,SAAQ,WAAU,wEACvB,iBACH;AAAA,UAEF,oBAAC,SAAI,WAAU,+BAA+B,kBAAO;AAAA;AAAA;AAAA,IACvD;AAAA,KACF;AAEJ;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  usePopover
3
- } from "./chunk-IYK5BRL4.js";
3
+ } from "./chunk-LVSKKDX2.js";
4
4
 
5
5
  // src/web-react/popover-dialog.ts
6
6
  import { useEffect, useId } from "react";
@@ -45,4 +45,4 @@ function usePopoverDialog(open, onOpenChange) {
45
45
  export {
46
46
  usePopoverDialog
47
47
  };
48
- //# sourceMappingURL=chunk-6FYFGQ6I.js.map
48
+ //# sourceMappingURL=chunk-AUA75YFF.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-L7MB2LLM.js";
4
4
  import {
5
5
  usePopoverDialog
6
- } from "./chunk-6FYFGQ6I.js";
6
+ } from "./chunk-AUA75YFF.js";
7
7
  import {
8
8
  CheckGlyph,
9
9
  EffortPicker,
@@ -14,7 +14,7 @@ import {
14
14
  pickerRootClass,
15
15
  quietPickerTriggerClass,
16
16
  usePopover
17
- } from "./chunk-IYK5BRL4.js";
17
+ } from "./chunk-LVSKKDX2.js";
18
18
  import {
19
19
  filterCommandPaletteItems
20
20
  } from "./chunk-SJWIZT7B.js";
@@ -338,7 +338,7 @@ import {
338
338
  } from "react";
339
339
  import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
340
340
  function createLazyMentionEditor() {
341
- return lazy(() => import("./mention-editor-E6J2RUG4.js").then((m) => m.loadMentionEditor()));
341
+ return lazy(() => import("./mention-editor-4EWHJ5G5.js").then((m) => m.loadMentionEditor()));
342
342
  }
343
343
  var IS_APPLE_PLATFORM = typeof navigator !== "undefined" && /Mac|iPhone|iPad|iPod/i.test(navigator.platform);
344
344
  function SendGlyph({ className }) {
@@ -1205,7 +1205,8 @@ function ChatComposer({
1205
1205
  ] })
1206
1206
  }
1207
1207
  ),
1208
- focusShortcut && /* @__PURE__ */ jsx2("div", { className: "mt-1.5 flex justify-end px-1", children: /* @__PURE__ */ jsxs2("span", { className: "text-xs text-muted-foreground", children: [
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-36ZV7KIP.js.map
2043
+ //# sourceMappingURL=chunk-JZ64GXYP.js.map