@datalayer/agent-runtimes 1.6.82 → 1.6.83

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.
@@ -133,6 +133,8 @@ export type AssistantAside = 'obstacle' | 'pointer' | undefined;
133
133
  */
134
134
  export declare function useKeepClear(stageRef: RefObject<HTMLElement | null>, own: RefObject<HTMLElement | null> | undefined, paused: boolean): AssistantAside;
135
135
  export interface AssistantStageProps {
136
+ /** Its balloon's width, fixed (`BALLOON_WIDTH`, 300, unless given). */
137
+ balloonWidth?: number;
136
138
  /**
137
139
  * The avatar: one Datalayer ships, by id (T-25), one loaded from a file
138
140
  * (T-26), or a 3D model.
@@ -322,5 +324,5 @@ export { mouthOpening };
322
324
  * `data-assistant-mouth`, each frame, without drawing the character again.
323
325
  */
324
326
  export declare function useMouth(stageRef: RefObject<HTMLElement | null>, mouthLevel: (() => number) | undefined, speaking: boolean): void;
325
- export declare function AssistantStage({ character, state, size, replay, place, stageRef, onDragStart, open, onToggle, onCharacterClick, onCharacterKeyDown, balloon, insist, onDismiss, ownRef, decide, mouthLevel, stayPut, dismissHidesBalloon, prompt, balloonDisplay, expandTarget, expandOnArrival, suggestions, onSuggestion, inspector, inspectAgent, conversationLabel, onBalloonDisplayChange, onStop, onNewChat, onClear, onChangeCharacter, speech, onResetPosition, about, sandbox, contextMenu, agentName, label, }: AssistantStageProps): JSX.Element;
327
+ export declare function AssistantStage({ balloonWidth, character, state, size, replay, place, stageRef, onDragStart, open, onToggle, onCharacterClick, onCharacterKeyDown, balloon, insist, onDismiss, ownRef, decide, mouthLevel, stayPut, dismissHidesBalloon, prompt, balloonDisplay, expandTarget, expandOnArrival, suggestions, onSuggestion, inspector, inspectAgent, conversationLabel, onBalloonDisplayChange, onStop, onNewChat, onClear, onChangeCharacter, speech, onResetPosition, about, sandbox, contextMenu, agentName, label, }: AssistantStageProps): JSX.Element;
326
328
  export default AssistantStage;
@@ -371,7 +371,7 @@ export function useMouth(stageRef, mouthLevel, speaking) {
371
371
  };
372
372
  }, [stageRef, mouthLevel, speaking]);
373
373
  }
374
- export function AssistantStage({ character, state, size = 88, replay, place, stageRef, onDragStart, open, onToggle, onCharacterClick, onCharacterKeyDown, balloon, insist = false, onDismiss, ownRef, decide, mouthLevel, stayPut = false, dismissHidesBalloon = false, prompt, balloonDisplay = 'history', expandTarget, expandOnArrival = false, suggestions, onSuggestion, inspector, inspectAgent, conversationLabel, onBalloonDisplayChange, onStop, onNewChat, onClear, onChangeCharacter, speech, onResetPosition, about, sandbox, contextMenu, agentName, label, }) {
374
+ export function AssistantStage({ balloonWidth, character, state, size = 88, replay, place, stageRef, onDragStart, open, onToggle, onCharacterClick, onCharacterKeyDown, balloon, insist = false, onDismiss, ownRef, decide, mouthLevel, stayPut = false, dismissHidesBalloon = false, prompt, balloonDisplay = 'history', expandTarget, expandOnArrival = false, suggestions, onSuggestion, inspector, inspectAgent, conversationLabel, onBalloonDisplayChange, onStop, onNewChat, onClear, onChangeCharacter, speech, onResetPosition, about, sandbox, contextMenu, agentName, label, }) {
375
375
  const chatText = useChatWords();
376
376
  // A shipped one by id, a drawing contributed by a plugin (T-24), a
377
377
  // character read from a file (T-26), or a 3D model.
@@ -689,7 +689,7 @@ export function AssistantStage({ character, state, size = 88, replay, place, sta
689
689
  : undefined, suggestions: waitsForQuestion ? suggestions : undefined, fullText: balloon.fullText, waiting: (state === 'thinking' ||
690
690
  state === 'working' ||
691
691
  state === 'waiting') &&
692
- !balloon.speaking, onSuggestion: onSuggestion, decide: decide, onDecisionActive: setDeciding, wide: deciding, onOpen: onToggle, above: size + 8, side: balloonSide(place).side, align: balloonSide(place).align, tailAt: size / 2 }) })), _jsxs(Box, { as: "button", type: "button", "aria-label": label ??
692
+ !balloon.speaking, onSuggestion: onSuggestion, decide: decide, onDecisionActive: setDeciding, ...(balloonWidth ? { width: balloonWidth } : {}), onOpen: onToggle, above: size + 8, side: balloonSide(place).side, align: balloonSide(place).align, tailAt: size / 2 }) })), _jsxs(Box, { as: "button", type: "button", "aria-label": label ??
693
693
  (open ? `Close the conversation with ${name}` : `Talk to ${name}`), "aria-describedby": described ? describedBy : undefined, "aria-expanded": open, "aria-haspopup": "menu", ref: characterRef, "data-assistant-figure": "", onContextMenu: (event) => {
694
694
  event.preventDefault();
695
695
  clearTimeout(longPress.current);
@@ -159,5 +159,5 @@ export function CurrentBalloonBody({ text, tool, busy = false, speaking = false,
159
159
  }, [text, whole, onOverflow]);
160
160
  return (_jsxs(Box, { "data-balloon-current": "", display: "flex", flexDirection: "column", gap: 1, minWidth: 0, children: [_jsx(BalloonNow, { busy: busy }), tool ? (_jsx(BalloonToolCall, { line: tool, waiting: waiting })) : text ? (_jsxs(Box
161
161
  // Read in place, not live: `WordsAnnouncer` says the words.
162
- , { "aria-busy": speaking, ref: textRef, "data-balloon-current-text": whole ? 'whole' : '', maxHeight: whole ? 240 : '5.6em', overflowY: whole ? 'auto' : undefined, overflowWrap: whole ? 'anywhere' : 'anywhere', pr: whole ? 1 : undefined, overflow: whole ? undefined : 'hidden', children: [cut ? (_jsxs(_Fragment, { children: [_jsx(Box, { "aria-hidden": "true", children: _jsx(ChatMarkdown, { density: "compact", text: text }) }), _jsx(Box, { as: "span", "data-balloon-words-whole": "", ...VISUALLY_HIDDEN, children: plainWords(fullText ?? '') })] })) : (_jsx(ChatMarkdown, { density: "compact", text: whole ? (fullText ?? text) : text })), waiting && (_jsx(Box, { as: "span", ml: 2, display: "inline-flex", children: _jsx(TypingDots, { size: 5 }) }))] })) : waiting ? (_jsx(TypingDots, { size: 6 })) : null, attachment, _jsx(WordsAnnouncer, { text: tool ? undefined : (fullText ?? text), speaking: speaking }), _jsx(ToolLineAnnouncer, { line: tool })] }));
162
+ , { "aria-busy": speaking, ref: textRef, "data-balloon-current-text": whole ? 'whole' : '', maxHeight: whole ? 240 : '5.6em', overflowY: whole ? 'auto' : undefined, overflowWrap: whole ? 'anywhere' : 'anywhere', pr: whole ? 1 : undefined, overflow: whole ? undefined : 'hidden', children: [cut ? (_jsxs(_Fragment, { children: [_jsx(Box, { "aria-hidden": "true", children: _jsx(ChatMarkdown, { density: "compact", text: fullText ?? text }) }), _jsx(Box, { as: "span", "data-balloon-words-whole": "", ...VISUALLY_HIDDEN, children: plainWords(fullText ?? '') })] })) : (_jsx(ChatMarkdown, { density: "compact", text: whole ? (fullText ?? text) : text })), waiting && (_jsx(Box, { as: "span", ml: 2, display: "inline-flex", children: _jsx(TypingDots, { size: 5 }) }))] })) : waiting ? (_jsx(TypingDots, { size: 6 })) : null, attachment, _jsx(WordsAnnouncer, { text: tool ? undefined : (fullText ?? text), speaking: speaking }), _jsx(ToolLineAnnouncer, { line: tool })] }));
163
163
  }
@@ -83,8 +83,12 @@ export interface SpeechBalloonProps {
83
83
  decide?: DecisionAsker;
84
84
  /** The decision's form or answer is on screen: it stays, and is wider. */
85
85
  onDecisionActive?: (active: boolean) => void;
86
- /** Wider, for the decision's form. */
87
- wide?: boolean;
86
+ /**
87
+ * The balloon's width, fixed whatever it says (the user, 17 November 2026:
88
+ * "stable and fixed"), never wider than its container; `BALLOON_WIDTH`
89
+ * unless given.
90
+ */
91
+ width?: number;
88
92
  /** Puts the peek away: a × beside its line. Never for an approval. */
89
93
  onDismissPeek?: () => void;
90
94
  /**
@@ -153,5 +157,7 @@ export declare function BalloonHistoryLarge({ history, tool, attachment, }: {
153
157
  tool?: BalloonToolLine;
154
158
  attachment?: ReactNode;
155
159
  }): JSX.Element;
156
- export declare function SpeechBalloon({ text, more, onOpen, above, side, align, tailAt, approval, decide, onDecisionActive, wide, onDismissPeek, display, tool, speaking, busy, attachment, history, onExpand, expandTitle, suggestions, onSuggestion, waiting, fullText, onExpandHistory, prompt, }: SpeechBalloonProps): JSX.Element;
160
+ /** A balloon's width unless given: room for a table, a form or a list without growing. */
161
+ export declare const BALLOON_WIDTH = 300;
162
+ export declare function SpeechBalloon({ text, more, onOpen, above, side, align, tailAt, approval, decide, onDecisionActive, width, onDismissPeek, display, tool, speaking, busy, attachment, history, onExpand, expandTitle, suggestions, onSuggestion, waiting, fullText, onExpandHistory, prompt, }: SpeechBalloonProps): JSX.Element;
157
163
  export default SpeechBalloon;
@@ -87,7 +87,9 @@ function BalloonHistory({ history, onOpen, maxHeight = BALLOON_HISTORY_MAX_HEIGH
87
87
  }, []);
88
88
  return (_jsxs(Box, { "data-balloon-history": "", flex: 1, minWidth: 0, display: "flex", flexDirection: "column", children: [_jsx(Box, { as: "button", type: "button", "data-balloon-peek": "", "data-balloon-header": "", onClick: onOpen, m: 0, p: 0, pb: 1, border: 0, bg: "transparent", font: "inherit", textAlign: "left", cursor: "pointer", fontSize: 0, fontWeight: "semibold", color: "fg.muted", hover: { textDecoration: 'underline' }, children: conversationHeaderText(conversationCount(history), chatText) }), onExpand ? (_jsx(IconButton, { icon: ScreenFullIcon, size: "small", variant: "invisible", "aria-label": chatText.expandConversation, "data-balloon-history-expand": "", onClick: onExpand, sx: { position: 'absolute', top: '4px', right: '28px' } })) : null, _jsx(Box, { ref: listRef, role: "log", "aria-label": chatText.conversation, "data-balloon-history-list": "", maxHeight: maxHeight, overflowY: "auto", display: "flex", flexDirection: "column", pr: 1, children: _jsx(BalloonChatItems, { items: withToolCall(history, tool), waiting: waiting }) })] }));
89
89
  }
90
- export function SpeechBalloon({ text, more = false, onOpen, above, side = 'above', align, tailAt, approval, decide, onDecisionActive, wide = false, onDismissPeek, display = 'history', tool, speaking = false, busy = false, attachment, history, onExpand, expandTitle, suggestions, onSuggestion, waiting = false, fullText, onExpandHistory, prompt, }) {
90
+ /** A balloon's width unless given: room for a table, a form or a list without growing. */
91
+ export const BALLOON_WIDTH = 300;
92
+ export function SpeechBalloon({ text, more = false, onOpen, above, side = 'above', align, tailAt, approval, decide, onDecisionActive, width = BALLOON_WIDTH, onDismissPeek, display = 'history', tool, speaking = false, busy = false, attachment, history, onExpand, expandTitle, suggestions, onSuggestion, waiting = false, fullText, onExpandHistory, prompt, }) {
91
93
  const chatText = useChatWords();
92
94
  // *more*: the words whole, when they were cut or overflow their lines.
93
95
  const [whole, setWhole] = useState(false);
@@ -116,24 +118,15 @@ export function SpeechBalloon({ text, more = false, onOpen, above, side = 'above
116
118
  const current = display === 'current';
117
119
  // History with messages to list: all of them, not the newest line alone.
118
120
  const listed = !current && history && history.length > 0 ? history : null;
119
- return (_jsxs(Box, { "data-speech-balloon": "", "data-balloon-display": display, maxWidth: wide || listed || offered || whole || prompt || (current && attachment)
120
- ? 300
121
- : current
122
- ? 260
123
- : 280, px: 3, py: 2, color: "fg.default", border: "1px solid", borderRadius: "bubble", boxShadow: "shadow.medium", fontSize: 1, textAlign: "left",
121
+ return (_jsxs(Box, { "data-speech-balloon": "", "data-balloon-display": display, px: 3, py: 2, color: "fg.default", border: "1px solid", borderRadius: "bubble", boxShadow: "shadow.medium", fontSize: 1, textAlign: "left",
124
122
  // Pixels, as strings: a number here is read as the theme's space
125
123
  // scale (`-7` would be `-space[7]`, 48px).
126
124
  bottom: side === 'above' ? `${above}px` : undefined, top: side === 'above' ? undefined : `${above}px`, sx: {
127
125
  position: 'absolute',
128
126
  [align]: 0,
129
- width: wide ||
130
- listed ||
131
- offered ||
132
- whole ||
133
- prompt ||
134
- (current && attachment)
135
- ? 300
136
- : 'max-content',
127
+ // Fixed, whatever it says: never sized by its words.
128
+ width,
129
+ maxWidth: '100%',
137
130
  bg: 'canvas.overlay',
138
131
  // The current balloon is the agent's voice now: its accent's edge.
139
132
  borderColor: current ? 'accent.muted' : 'border.default',
@@ -94,6 +94,8 @@ export type A2ATeamGraphProps = {
94
94
  * a balloon gets at least its own. Unsaid, the backdrop's.
95
95
  */
96
96
  balloonRoom?: number;
97
+ /** Every member's balloon width, fixed (`BALLOON_WIDTH`, 300, unless given). */
98
+ balloonWidth?: number;
97
99
  /**
98
100
  * How the stage is drawn (`SceneStageSpec.backdrop`): `studio`, the
99
101
  * drawing every scene had first, `hero` or `plain`. `studio` when unsaid,
@@ -175,5 +177,5 @@ export declare function placeMembers(entryId: string, peerIds: readonly string[]
175
177
  /** The one flow the graph reports for all its edges: asking before answering before still. */
176
178
  export declare function flowOfAll(flows: readonly A2ATeamFlow[]): A2ATeamFlow;
177
179
  /** Draw a team over A2A, each link moving with what travels on it. */
178
- export declare function A2ATeamGraph({ entry, peer, peers: more, flow, flows, connected, label, labels, links, positions, size, calls, balloonRoom, backdrop, minHeight, selected, onSelectEdge, }: A2ATeamGraphProps): JSX.Element;
180
+ export declare function A2ATeamGraph({ entry, peer, peers: more, flow, flows, connected, label, labels, links, positions, size, calls, balloonRoom, balloonWidth, backdrop, minHeight, selected, onSelectEdge, }: A2ATeamGraphProps): JSX.Element;
179
181
  export default A2ATeamGraph;
@@ -194,7 +194,7 @@ function stageRules(theme, clickable) {
194
194
  };
195
195
  }
196
196
  /** Draw a team over A2A, each link moving with what travels on it. */
197
- export function A2ATeamGraph({ entry, peer, peers: more = NO_PEERS, flow, flows, connected, label = 'A2A', labels, links, positions, size = 96, calls = [], balloonRoom, backdrop, minHeight, selected, onSelectEdge, }) {
197
+ export function A2ATeamGraph({ entry, peer, peers: more = NO_PEERS, flow, flows, connected, label = 'A2A', labels, links, positions, size = 96, calls = [], balloonRoom, balloonWidth, backdrop, minHeight, selected, onSelectEdge, }) {
198
198
  // How the stage is drawn: its nodes and edges, its colours, its layout.
199
199
  const look = sceneBackdrop(backdrop);
200
200
  const { layout: sized, theme } = look;
@@ -340,7 +340,7 @@ export function A2ATeamGraph({ entry, peer, peers: more = NO_PEERS, flow, flows,
340
340
  selectable: false,
341
341
  // Above the edge and its label: a balloon overflows its node.
342
342
  zIndex: 10,
343
- data: { id, side, size },
343
+ data: { id, side, size, ...(balloonWidth ? { balloonWidth } : {}) },
344
344
  },
345
345
  // A member's connections move with it.
346
346
  ...connections.map((connection, at) => {
@@ -371,6 +371,7 @@ export function A2ATeamGraph({ entry, peer, peers: more = NO_PEERS, flow, flows,
371
371
  CONNECTION_X,
372
372
  CONNECTION_WIDTH,
373
373
  NODE_WIDTH,
374
+ balloonWidth,
374
375
  ]);
375
376
  // The notebook open under the graph runs on a Pyodide kernel in the page:
376
377
  // the entry's sandbox, while it is open.
@@ -13,7 +13,9 @@ const CONNECTION_WIDTH = 88;
13
13
  /** The hero's layout: faces closer together than the studio's characters, a smaller ring beside each. */
14
14
  export const HERO_LAYOUT = {
15
15
  nodeWidth: NODE_WIDTH,
16
- gap: 200,
16
+ // Room between the faces for their balloons side by side (up to 300 px
17
+ // each): at 200 the two balloons overlapped (the user, 17 November 2026).
18
+ gap: 320,
17
19
  rowGap: 40,
18
20
  // The face, its name and where it runs.
19
21
  memberHeight: size => size + 50,
@@ -147,7 +147,7 @@ export function memberDetails(member, state) {
147
147
  }
148
148
  /** A member of the team, drawn in a look. */
149
149
  export function MemberNodeBase({ data, look, }) {
150
- const { id, side, size } = data;
150
+ const { id, side, size, balloonWidth } = data;
151
151
  const member = useContext(Members)[id];
152
152
  const moving = useContext(Moving);
153
153
  const offset = moving.offsetOf(id);
@@ -230,7 +230,7 @@ export function MemberNodeBase({ data, look, }) {
230
230
  ? `${Math.round(offset.dx)},${Math.round(offset.dy)}`
231
231
  : undefined, "data-member-state": persona.state, "data-member-color": member.color || undefined, style: tone ? { '--scene-member': tone } : undefined, children: [_jsx(Handle, { id: MEMBER_HANDLES.inLeft, type: "target", position: Position.Left, style: HANDLE(size), isConnectable: false }), _jsx(Handle, { id: MEMBER_HANDLES.inRight, type: "target", position: Position.Right, style: HANDLE(size), isConnectable: false }), _jsx(Handle, { id: MEMBER_HANDLES.inTop, type: "target", position: Position.Top, style: { ...HANDLE(size), top: 0 }, isConnectable: false }), _jsx(Handle, { id: MEMBER_HANDLES.inBottom, type: "target", position: Position.Bottom, style: { ...HANDLE(size), top: size }, isConnectable: false }), _jsx(Box, { width: size, height: size, position: "relative",
232
232
  // Hovered or focused, its details peek (its card, under its words).
233
- onMouseEnter: details.peekOn, onMouseLeave: details.peekOff, onFocus: details.peekOn, onBlur: details.peekOff, children: persona.away ? (_jsxs(Button, { size: "small", sx: { position: 'absolute', top: size / 2 - 16, left: -24 }, onClick: () => member.onAway?.(false), children: ["Call ", member.name, " back"] })) : (_jsx(AssistantStage, { character: look.figure(member), state: persona.state, size: size,
233
+ onMouseEnter: details.peekOn, onMouseLeave: details.peekOff, onFocus: details.peekOn, onBlur: details.peekOff, children: persona.away ? (_jsxs(Button, { size: "small", sx: { position: 'absolute', top: size / 2 - 16, left: -24 }, onClick: () => member.onAway?.(false), children: ["Call ", member.name, " back"] })) : (_jsx(AssistantStage, { balloonWidth: balloonWidth, character: look.figure(member), state: persona.state, size: size,
234
234
  // In the node, not over the page; the balloon opens toward the
235
235
  // middle of the graph: rightward from the left member.
236
236
  place: side === 'left'
@@ -140,6 +140,8 @@ export type MemberData = {
140
140
  side: 'left' | 'right';
141
141
  /** Its figure's size, in pixels at full scale. */
142
142
  size: number;
143
+ /** Its balloon's width, fixed (`BALLOON_WIDTH` unless given). */
144
+ balloonWidth?: number;
143
145
  };
144
146
  /** What a connection's node is given. */
145
147
  export type ConnectionData = {
@@ -28,7 +28,14 @@ const sampleCompany = (domain) => ({
28
28
  },
29
29
  },
30
30
  agent: {
31
- protocols: [{ type: 'a2a', endpoint: `https://${domain}/agent` }],
31
+ protocols: [
32
+ {
33
+ type: 'a2a',
34
+ endpoint: `https://${domain}/agent`,
35
+ // What its agent can help with (1.0 §3.1, required).
36
+ description: 'Orders, exchanges and the catalogue',
37
+ },
38
+ ],
32
39
  },
33
40
  apis: [
34
41
  {
@@ -262,6 +262,7 @@ const runJourney = async () => {
262
262
  {
263
263
  type: 'poppy',
264
264
  endpoint: 'https://api.northstar.example/poppy/conversations',
265
+ description: 'Orders, returns and exchanges',
265
266
  },
266
267
  ],
267
268
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/agent-runtimes",
3
- "version": "1.6.82",
3
+ "version": "1.6.83",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",
@@ -164,7 +164,7 @@
164
164
  "@datalayer/lexical-loro": "^1.0.6",
165
165
  "@datalayer/primer-addons": "^1.0.51",
166
166
  "@datalayer/primer-rjsf": "^1.0.3",
167
- "@datalayer/personal-agent-protocol": ">=0.36.0 <0.37",
167
+ "@datalayer/personal-agent-protocol": ">=0.37.0 <0.38",
168
168
  "@datalayer/reactor": "^1.3.5",
169
169
  "@datalayer/reactor-commands": "^1.0.4",
170
170
  "@datalayer/reactor-manager": "^1.0.4",