@datalayer/agent-runtimes 1.3.68 → 1.3.69

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.
@@ -100,6 +100,12 @@ export interface AssistantStageProps {
100
100
  * the talking loop. Still, for a reader who asks for reduced motion.
101
101
  */
102
102
  mouthLevel?: () => number;
103
+ /**
104
+ * Set in a layout — a team's graph — rather than floating over the page:
105
+ * it never steps aside (T-27), since what is around it is its own label
106
+ * and its neighbours, not a page somebody is working on.
107
+ */
108
+ stayPut?: boolean;
103
109
  }
104
110
  /** The openings of the mouth, by level: shut, a little, half, wide. */
105
111
  export declare function mouthOpening(level: number): 0 | 1 | 2 | 3;
@@ -108,5 +114,5 @@ export declare function mouthOpening(level: number): 0 | 1 | 2 | 3;
108
114
  * `data-assistant-mouth`, each frame, without drawing the character again.
109
115
  */
110
116
  export declare function useMouth(stageRef: RefObject<HTMLElement | null>, mouthLevel: (() => number) | undefined, speaking: boolean): void;
111
- export declare function AssistantStage({ character, state, size, place, stageRef, onDragStart, open, onToggle, balloon, insist, onDismiss, ownRef, decide, mouthLevel, }: AssistantStageProps): JSX.Element;
117
+ export declare function AssistantStage({ character, state, size, place, stageRef, onDragStart, open, onToggle, balloon, insist, onDismiss, ownRef, decide, mouthLevel, stayPut, }: AssistantStageProps): JSX.Element;
112
118
  export default AssistantStage;
@@ -209,7 +209,7 @@ export function useMouth(stageRef, mouthLevel, speaking) {
209
209
  };
210
210
  }, [stageRef, mouthLevel, speaking]);
211
211
  }
212
- export function AssistantStage({ character, state, size = 88, place, stageRef, onDragStart, open, onToggle, balloon, insist = false, onDismiss, ownRef, decide, mouthLevel, }) {
212
+ export function AssistantStage({ character, state, size = 88, place, stageRef, onDragStart, open, onToggle, balloon, insist = false, onDismiss, ownRef, decide, mouthLevel, stayPut = false, }) {
213
213
  // A shipped one by id, a drawing contributed by a plugin (T-24), or a
214
214
  // character read from a file (T-26).
215
215
  const shipped = typeof character === 'string'
@@ -227,7 +227,7 @@ export function AssistantStage({ character, state, size = 88, place, stageRef, o
227
227
  const [menuOpen, setMenuOpen] = useState(false);
228
228
  // Where the press began: a press that moves is a drag, not a click.
229
229
  const pressedAt = useRef(null);
230
- const aside = useKeepClear(stageRef, ownRef, menuOpen);
230
+ const aside = useKeepClear(stageRef, ownRef, menuOpen || stayPut);
231
231
  useMouth(stageRef, mouthLevel, state === 'speaking');
232
232
  // A decision being asked, or its answer, keeps the balloon up.
233
233
  const [deciding, setDeciding] = useState(false);
@@ -72,7 +72,9 @@ const MemberNode = memo(function MemberNode({ data, }) {
72
72
  ? { position: 'absolute', left: 'auto' }
73
73
  : { position: 'absolute', right: 'auto' }, stageRef: stageRef, onDragStart: () => undefined, open: false, onToggle: member.onToggle ?? (() => undefined), balloon: persona.saying
74
74
  ? { text: persona.saying, more: persona.saying.endsWith('…') }
75
- : undefined, insist: persona.insist, onDismiss: away => member.onAway?.(away !== 'none') })) }), _jsxs(Text, { sx: { fontWeight: 600, textAlign: 'center' }, children: [member.emoji ? `${member.emoji} ` : '', member.name] }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', textAlign: 'center' }, "data-member-where": "", children: member.where }), _jsx(Handle, { type: "source", position: Position.Right, style: HANDLE(size), isConnectable: false }), member.connections?.length ? (_jsx(Handle, { id: "connections", type: "source", position: Position.Bottom, style: { ...HANDLE(size), top: 'auto', bottom: 0 }, isConnectable: false })) : null] }));
75
+ : undefined, insist: persona.insist, onDismiss: away => member.onAway?.(away !== 'none'),
76
+ // A member of the graph: what is clicked around it is the graph.
77
+ stayPut: true })) }), _jsxs(Text, { sx: { fontWeight: 600, textAlign: 'center' }, children: [member.emoji ? `${member.emoji} ` : '', member.name] }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted', textAlign: 'center' }, "data-member-where": "", children: member.where }), _jsx(Handle, { type: "source", position: Position.Right, style: HANDLE(size), isConnectable: false }), member.connections?.length ? (_jsx(Handle, { id: "connections", type: "source", position: Position.Bottom, style: { ...HANDLE(size), top: 'auto', bottom: 0 }, isConnectable: false })) : null] }));
76
78
  });
77
79
  /** A connection of a member's: the server's mark, what it reaches, and how. */
78
80
  const ConnectionNode = memo(function ConnectionNode({ id, data, }) {
@@ -183,6 +183,9 @@ export function useA2ATeam(options) {
183
183
  state: 'thinking',
184
184
  saying: 'Thanks!',
185
185
  }));
186
+ // Accounting has handed its answer over: back at rest, its last
187
+ // words still in its balloon.
188
+ setPeerPersona(prev => ({ ...prev, state: 'idle' }));
186
189
  }
187
190
  else if (part.type === 'text-delta') {
188
191
  said += part.text;
@@ -227,6 +230,8 @@ export function useA2ATeam(options) {
227
230
  finally {
228
231
  abort.current = null;
229
232
  setBusy(false);
233
+ // However the turn ended, neither member is still at work.
234
+ setPeerPersona(prev => prev.state === 'idle' ? prev : { ...prev, state: 'idle' });
230
235
  }
231
236
  }, [agent, busy, askTool, peerApp.name]);
232
237
  const stop = useCallback(() => abort.current?.abort(), []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/agent-runtimes",
3
- "version": "1.3.68",
3
+ "version": "1.3.69",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",