@datalayer/agent-runtimes 1.6.99 → 1.6.101

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.
@@ -160,7 +160,7 @@ export const AGENT_UI_PLUGINS = {
160
160
  message: PageSheetPlugin,
161
161
  side: pageSheetSidePlugin,
162
162
  },
163
- // The Analyst's canvas and diagrams (19 November 2026): the tools of
163
+ // The Functional Analyst's canvas and diagrams (19 November 2026): the tools of
164
164
  // @datalayer/reactor-excalidraw and @datalayer/reactor-mermaid, in the page.
165
165
  'page-excalidraw': {
166
166
  needsConnection: false,
@@ -3,7 +3,7 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  /**
6
- * `@datalayer/loop-plugin-analysis-header` — the Analyst's title bar: what
6
+ * `@datalayer/loop-plugin-analysis-header` — the Functional Analyst's title bar: what
7
7
  * is being analysed, whether its diagrams parse (said by the agent from what
8
8
  * Mermaid's parser answered), and a Draw on the canvas button.
9
9
  *
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * `@datalayer/loop-plugin-page-excalidraw` — drawings the agent makes in the
3
3
  * conversation, on an Excalidraw canvas, with frontend tools run in the page
4
- * (the user, 19 November 2026: the Analyst's Excalidraw tools).
4
+ * (the user, 19 November 2026: the Functional Analyst's Excalidraw tools).
5
5
  *
6
6
  * The tools are `@datalayer/reactor-excalidraw`'s eleven, bound to the
7
7
  * conversation's drawings: insert a drawing, read it, add, change, connect
@@ -6,7 +6,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
6
6
  /**
7
7
  * `@datalayer/loop-plugin-page-excalidraw` — drawings the agent makes in the
8
8
  * conversation, on an Excalidraw canvas, with frontend tools run in the page
9
- * (the user, 19 November 2026: the Analyst's Excalidraw tools).
9
+ * (the user, 19 November 2026: the Functional Analyst's Excalidraw tools).
10
10
  *
11
11
  * The tools are `@datalayer/reactor-excalidraw`'s eleven, bound to the
12
12
  * conversation's drawings: insert a drawing, read it, add, change, connect
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * `@datalayer/loop-plugin-page-mermaid` — Mermaid diagrams the agent writes
3
3
  * in the conversation, with frontend tools run in the page (the user, 19
4
- * November 2026: the Analyst's Mermaid tools).
4
+ * November 2026: the Functional Analyst's Mermaid tools).
5
5
  *
6
6
  * The tools are `@datalayer/reactor-mermaid`'s six: write a diagram (checked
7
7
  * with Mermaid's parser first), read it back, list them, check a source,
@@ -6,7 +6,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
6
6
  /**
7
7
  * `@datalayer/loop-plugin-page-mermaid` — Mermaid diagrams the agent writes
8
8
  * in the conversation, with frontend tools run in the page (the user, 19
9
- * November 2026: the Analyst's Mermaid tools).
9
+ * November 2026: the Functional Analyst's Mermaid tools).
10
10
  *
11
11
  * The tools are `@datalayer/reactor-mermaid`'s six: write a diagram (checked
12
12
  * with Mermaid's parser first), read it back, list them, check a source,
@@ -79,6 +79,26 @@ export type WorkspaceFullScreenOptions = {
79
79
  */
80
80
  topOffset?: number | string;
81
81
  };
82
+ /** The class of the portal root put inside an element while the browser holds it at full screen. */
83
+ export declare const FULL_SCREEN_PORTAL_CLASS = "datalayer-fullscreen-portal";
84
+ /**
85
+ * Overlays at full screen. The browser paints only the full-screen element's
86
+ * own subtree, and Primer draws menus, dialogs and tooltips in a portal under
87
+ * `<body>`: at full screen they opened, unseen (the composer's footer menus,
88
+ * the user, 20 November 2026). While the element is held, Primer's default
89
+ * portal root is a node inside it, where the overlays are seen and wear its
90
+ * theme. `fixed` at the viewport's origin: inside a promoted element the
91
+ * viewport is the containing block, so the coordinates Primer measures from an
92
+ * anchor land where they should (the Stages' box, `StageBox`, found this first).
93
+ *
94
+ * The release hands the page's root back: the embed's
95
+ * (`.datalayer-app-portal`) when the element is in one, else the page's
96
+ * (`setupPrimerPortals` makes it when there is none yet). What is still open
97
+ * at that moment — a dialog Escape did not close, the browser having taken the
98
+ * Escape — moves out with the node into the page's root, where it is seen and
99
+ * can be closed; an empty node goes. Any landing for any element.
100
+ */
101
+ export declare function holdOverlaysInside(node: HTMLElement): () => void;
82
102
  /**
83
103
  * What full screen promotes, found from the control that asked.
84
104
  *
@@ -3,6 +3,8 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import { useCallback, useEffect, useRef, useState } from 'react';
6
+ import { registerPortalRoot } from '@primer/react';
7
+ import { getPrimerPortalRoot, setupPrimerPortals, } from '@datalayer/primer-addons';
6
8
  /**
7
9
  * A top offset as pixels: a number as given, or the bottom edge of the
8
10
  * element a CSS selector names — a host's fixed header, whose height depends
@@ -21,6 +23,66 @@ export function resolveTopOffset(offset) {
21
23
  ? Math.max(0, Math.round(element.getBoundingClientRect().bottom))
22
24
  : 0;
23
25
  }
26
+ /** The class of the portal root put inside an element while the browser holds it at full screen. */
27
+ export const FULL_SCREEN_PORTAL_CLASS = 'datalayer-fullscreen-portal';
28
+ /**
29
+ * Overlays at full screen. The browser paints only the full-screen element's
30
+ * own subtree, and Primer draws menus, dialogs and tooltips in a portal under
31
+ * `<body>`: at full screen they opened, unseen (the composer's footer menus,
32
+ * the user, 20 November 2026). While the element is held, Primer's default
33
+ * portal root is a node inside it, where the overlays are seen and wear its
34
+ * theme. `fixed` at the viewport's origin: inside a promoted element the
35
+ * viewport is the containing block, so the coordinates Primer measures from an
36
+ * anchor land where they should (the Stages' box, `StageBox`, found this first).
37
+ *
38
+ * The release hands the page's root back: the embed's
39
+ * (`.datalayer-app-portal`) when the element is in one, else the page's
40
+ * (`setupPrimerPortals` makes it when there is none yet). What is still open
41
+ * at that moment — a dialog Escape did not close, the browser having taken the
42
+ * Escape — moves out with the node into the page's root, where it is seen and
43
+ * can be closed; an empty node goes. Any landing for any element.
44
+ */
45
+ export function holdOverlaysInside(node) {
46
+ // An earlier hold's node, emptied since its overlays closed: gone now.
47
+ node.getRootNode()
48
+ .querySelectorAll?.(`.${FULL_SCREEN_PORTAL_CLASS}`)
49
+ .forEach(left => {
50
+ if (left.childElementCount === 0) {
51
+ left.remove();
52
+ }
53
+ });
54
+ const root = document.createElement('div');
55
+ root.className = FULL_SCREEN_PORTAL_CLASS;
56
+ Object.assign(root.style, {
57
+ position: 'fixed',
58
+ top: '0',
59
+ left: '0',
60
+ width: '100%',
61
+ zIndex: '9999',
62
+ });
63
+ node.appendChild(root);
64
+ registerPortalRoot(root);
65
+ return () => {
66
+ const scope = node.getRootNode();
67
+ const pageRoot = () => scope.querySelector?.('.datalayer-app-portal') ??
68
+ getPrimerPortalRoot();
69
+ const page = pageRoot();
70
+ if (page) {
71
+ registerPortalRoot(page);
72
+ }
73
+ else {
74
+ setupPrimerPortals();
75
+ }
76
+ const back = pageRoot();
77
+ if (back && root.childElementCount > 0) {
78
+ root.style.position = 'absolute';
79
+ back.appendChild(root);
80
+ }
81
+ else {
82
+ root.remove();
83
+ }
84
+ };
85
+ }
24
86
  /**
25
87
  * What full screen promotes, found from the control that asked.
26
88
  *
@@ -179,6 +241,18 @@ export function useWorkspaceFullScreen(anchorRef, options = {}) {
179
241
  window.addEventListener('keydown', leave);
180
242
  return () => window.removeEventListener('keydown', leave);
181
243
  }, [fullScreen]);
244
+ /*
245
+ * The overlays, inside the workspace while the browser holds it at full
246
+ * screen (`holdOverlaysInside`). The CSS overlay needs none of this: the
247
+ * page is still all there.
248
+ */
249
+ useEffect(() => {
250
+ if (!fullScreen || !usingApi.current) {
251
+ return undefined;
252
+ }
253
+ const node = fullScreenNode(anchorRef.current);
254
+ return node ? holdOverlaysInside(node) : undefined;
255
+ }, [anchorRef, fullScreen]);
182
256
  return { fullScreen, usingApi, toggle, topOffsetPx };
183
257
  }
184
258
  export default useWorkspaceFullScreen;
@@ -38,6 +38,10 @@ export type EquipmentSwitches = {
38
38
  };
39
39
  };
40
40
  export type EquipmentKind = 'servers' | 'skills';
41
+ /** A line longer than this is cut at a word, with "more…" to read the rest (the user, 20 November 2026). */
42
+ export declare const LINE_FOLD_CHARS = 140;
43
+ /** Where a long line is cut: the last space before the limit, else the limit. */
44
+ export declare function foldLine(text: string, limit?: number): string | null;
41
45
  /**
42
46
  * The overlay's content: the list, its switches, and what it says of them.
43
47
  * The one component both triggers open.
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  /*
3
3
  * Copyright (c) 2025-2026 Datalayer, Inc.
4
4
  * Distributed under the terms of the Modified BSD License.
@@ -23,8 +23,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
23
  *
24
24
  * @module chat/prompt/menus/EquipmentMenus
25
25
  */
26
- import { forwardRef, useEffect, useId, } from 'react';
27
- import { ActionList, ActionMenu, Button, Text, ToggleSwitch, Tooltip, } from '@primer/react';
26
+ import { forwardRef, useEffect, useId, useState, } from 'react';
27
+ import { ActionList, ActionMenu, Button, Link, Text, ToggleSwitch, Tooltip, } from '@primer/react';
28
28
  import { AiModelIcon, BriefcaseIcon } from '@primer/octicons-react';
29
29
  // Primer's MCP mark (the user, 19 November 2026), by its own path: the
30
30
  // package's index types do not declare it, its per-icon entry does.
@@ -78,15 +78,42 @@ function RowHead({ row, labelId, mark, }) {
78
78
  color: row.on ? undefined : 'fg.muted',
79
79
  }, children: row.name }), _jsx(StatePill, { row: row })] }));
80
80
  }
81
- /** A muted line under a name: its reason, its note, or its description. */
81
+ /** A line longer than this is cut at a word, with "more…" to read the rest (the user, 20 November 2026). */
82
+ export const LINE_FOLD_CHARS = 140;
83
+ /** Where a long line is cut: the last space before the limit, else the limit. */
84
+ export function foldLine(text, limit = LINE_FOLD_CHARS) {
85
+ if (text.length <= limit) {
86
+ return null;
87
+ }
88
+ const cut = text.lastIndexOf(' ', limit);
89
+ return text.slice(0, cut > limit / 2 ? cut : limit).trimEnd();
90
+ }
91
+ /**
92
+ * A muted line under a name: its reason, its note, or its description. A long
93
+ * one (a tool's description can run to a page) shows its start and "more…";
94
+ * a click shows the rest, and "less" folds it again. The click stays in the
95
+ * line: the row's switch is not touched, and the menu stays open.
96
+ */
82
97
  function Line({ children }) {
83
- return children ? (_jsx(Text, { sx: {
98
+ const [open, setOpen] = useState(false);
99
+ if (!children) {
100
+ return null;
101
+ }
102
+ const folded = typeof children === 'string' ? foldLine(children) : null;
103
+ const toggle = (event) => {
104
+ event.preventDefault();
105
+ event.stopPropagation();
106
+ setOpen(value => !value);
107
+ };
108
+ return (_jsxs(Text, { sx: {
84
109
  display: 'block',
85
110
  fontSize: 0,
86
111
  color: 'fg.muted',
87
112
  overflow: 'hidden',
88
113
  textOverflow: 'ellipsis',
89
- }, children: children })) : null;
114
+ whiteSpace: folded && open ? 'pre-wrap' : undefined,
115
+ overflowWrap: 'anywhere',
116
+ }, children: [folded && !open ? `${folded}… ` : children, folded ? (_jsxs(_Fragment, { children: [open ? ' ' : null, _jsx(Link, { as: "button", type: "button", onClick: toggle, "aria-expanded": open, sx: { fontSize: 0, verticalAlign: 'baseline' }, "data-equipment-more": "", children: open ? 'less' : 'more…' })] })) : null] }));
90
117
  }
91
118
  const ROW_SX = {
92
119
  display: 'flex',
@@ -1,6 +1,5 @@
1
- import { CardIconColors } from '@primer/react-brand';
2
1
  import { Icon } from '@primer/octicons-react';
3
- type CardIconColorsType = (typeof CardIconColors)[number];
2
+ type CardIconColorsType = 'blue' | 'coral' | 'gray' | 'green' | 'lemon' | 'lime' | 'orange' | 'pink' | 'purple' | 'teal';
4
3
  export type PageTagMetadata = {
5
4
  fillColor: React.CSSProperties['backgroundColor'];
6
5
  };
@@ -15,5 +14,5 @@ export type PageTag = {
15
14
  export declare const PAGE_TAGE_NONE: PageTag;
16
15
  export declare const PAGE_TAGS: PageTag[];
17
16
  export declare const PAGE_TAGS_BY_NAME_MAP: Map<PageTagName | undefined, PageTag>;
18
- export declare const PAGE_TAGS_BY_COLOR_MAP: Map<"blue" | "coral" | "gray" | "green" | "indigo" | "lime" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow" | "default" | "lemon", PageTag>;
17
+ export declare const PAGE_TAGS_BY_COLOR_MAP: Map<CardIconColorsType, PageTag>;
19
18
  export {};
@@ -1235,8 +1235,8 @@ export const APP_BEHAVIOURS = {
1235
1235
  'odoo-accounting.odoo_accounting_update_vendor_payment': 'leave_to_me',
1236
1236
  'odoo-accounting.odoo_accounting_vat_close_check': 'do_it',
1237
1237
  },
1238
- 'demo-analyst': {},
1239
1238
  'demo-aws-steward': {},
1239
+ 'demo-functional-analyst': {},
1240
1240
  'demo-jupyter-data-analyst': {},
1241
1241
  'demo-marketer': {},
1242
1242
  'demo-shop': {},
@@ -1596,8 +1596,8 @@ export const APP_ESCALATIONS = {
1596
1596
  decide: {},
1597
1597
  'deck-maker': {},
1598
1598
  'demo-accountant': {},
1599
- 'demo-analyst': {},
1600
1599
  'demo-aws-steward': {},
1600
+ 'demo-functional-analyst': {},
1601
1601
  'demo-jupyter-data-analyst': {},
1602
1602
  'demo-marketer': {},
1603
1603
  'demo-shop': {},
@@ -21,10 +21,10 @@ export const AGENT_PRESENTATIONS = {
21
21
  tagline: 'Matches payments, checks balances',
22
22
  presentation: 'Work with Odoo accounting data to reconcile invoices and payments, analyze\njournal balances, and prepare close-ready summaries.\n\n- Reads your Odoo books: invoices, payments, journals and ledgers\n- Lists unpaid invoices and the customers behind them\n- Matches payments against open invoices and flags what does not reconcile\n- Prepares a close summary with the balances that moved\n- Changes nothing in the books without a person\n\n[Watch it in the Sales and Accounting Stage](/stages?stage=sales-and-accounting)',
23
23
  },
24
- 'worker-analyst': {
25
- id: 'worker-analyst',
24
+ 'worker-functional-analyst': {
25
+ id: 'worker-functional-analyst',
26
26
  version: '0.0.1',
27
- name: 'Analyst',
27
+ name: 'Functional Analyst',
28
28
  emoji: '📐',
29
29
  description: "Works out how a system, a process or a plan fits together and draws it — Mermaid diagrams checked by Mermaid's own parser, and Excalidraw drawings you can draw on with it — then says what the picture shows and what it leaves open.",
30
30
  tagline: 'Works out how it fits, and draws it',
@@ -96,7 +96,6 @@ export declare const JUPYTER_TUTOR_AGENTSPEC_0_0_1: Agentspec;
96
96
  export declare const LOOP_SHELL_AGENTSPEC_0_0_1: Agentspec;
97
97
  export declare const WORKER_ACCOUNTANT_AGENTSPEC_0_0_1: Agentspec;
98
98
  export declare const WORKER_AGENT_REVIEWS_SQL_AGENTSPEC_0_0_1: Agentspec;
99
- export declare const WORKER_ANALYST_AGENTSPEC_0_0_1: Agentspec;
100
99
  export declare const WORKER_ANALYZE_CAMPAIGN_PERFORMANCE_AGENTSPEC_0_0_1: Agentspec;
101
100
  export declare const WORKER_ANALYZE_SUPPORT_TICKETS_AGENTSPEC_0_0_1: Agentspec;
102
101
  export declare const WORKER_AP_INVOICE_AGENTSPEC_0_0_1: Agentspec;
@@ -138,6 +137,7 @@ export declare const WORKER_EXTRACT_DATA_FROM_FILES_AGENTSPEC_0_0_1: Agentspec;
138
137
  export declare const WORKER_EXTRACT_KPIS_FROM_QUARTERLY_PDF_AGENTSPEC_0_0_1: Agentspec;
139
138
  export declare const WORKER_FACTOR_ANALYSIS_AGENTSPEC_0_0_1: Agentspec;
140
139
  export declare const WORKER_FINANCIAL_VIZ_AGENTSPEC_0_0_1: Agentspec;
140
+ export declare const WORKER_FUNCTIONAL_ANALYST_AGENTSPEC_0_0_1: Agentspec;
141
141
  export declare const WORKER_GENERATE_WEEKLY_REPORTS_AGENTSPEC_0_0_1: Agentspec;
142
142
  export declare const WORKER_GITHUB_AGENT_SPEC_0_0_1: Agentspec;
143
143
  export declare const WORKER_GRID_FORECAST_AGENTSPEC_0_0_1: Agentspec;