@datalayer/agent-runtimes 1.3.85 → 1.3.87

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.
@@ -1,16 +1,26 @@
1
1
  /**
2
- * A team of two over A2A, as a graph (React Flow): each member is its
3
- * character (`AssistantStage`), with its name and where it runs under it, and
4
- * one edge links the entry to the peer.
2
+ * A team over A2A, as a graph (React Flow): each member is its character
3
+ * (`AssistantStage`), with its name and where it runs under it, and an edge
4
+ * links the entry to each peer it asks — one peer (`peer`, a team of two)
5
+ * or several (`peers`, a team of N; LOOP A-08). The edges are the team's
6
+ * `talks_to` (`links`): a peer that talks to another peer has its edge
7
+ * drawn too, still, since the page runs the entry's asks only.
5
8
  *
6
- * The edge is still until a message travels on it. While the entry asks, it
9
+ * An edge is still until a message travels on it. While the entry asks, it
7
10
  * flows from the entry to the peer; while the peer answers, from the peer to
8
- * the entry ({@link A2ATeamFlow}, from the `A2APeerEvent` phases). A reader
9
- * who asks for no motion sees the same thing without the movement: the arrow
10
- * at the end the message goes to, and the word for it on the edge.
11
+ * the entry ({@link A2ATeamFlow}, from the `A2APeerEvent` phases; one flow
12
+ * per peer, `flows`). A reader who asks for no motion sees the same thing
13
+ * without the movement: the arrow at the end the message goes to, and the
14
+ * word for it on the edge.
15
+ *
16
+ * The members stand where the layout puts them: the entry on the left and
17
+ * the peers to its right, one under another — or where a scene's stage
18
+ * directions say (`positions`, fractions of the box; LOOP A-13): the
19
+ * distinct `x` values are the columns, left to right, the distinct `y`
20
+ * values the rows, top to bottom.
11
21
  *
12
22
  * A member's connections — the MCP servers it reaches, Odoo for Accounting —
13
- * hang under it, each a node half a member's size with the server's mark
23
+ * stand to its right, each a node half a member's size with the server's mark
14
24
  * (`SpecMark`), linked to it by an edge of its own. That edge is still until
15
25
  * the member calls one of the connection's tools: then it flows toward the
16
26
  * connection for as long as the call runs ({@link A2ATeamCall}), with the
@@ -49,7 +59,7 @@ export type A2ATeamGraphMember = {
49
59
  onToggle?: () => void;
50
60
  /** It was sent away, or called back. */
51
61
  onAway?: (away: boolean) => void;
52
- /** The MCP servers it reaches, drawn under it (`teamConnectionsOf`). */
62
+ /** The MCP servers it reaches, drawn to its right (`teamConnectionsOf`). */
53
63
  connections?: A2ATeamConnection[];
54
64
  /**
55
65
  * How its balloon shows what it says (LOOP T-23): only what it says or
@@ -108,17 +118,43 @@ export type A2ATeamGraphMember = {
108
118
  /** Its balloon's display was chosen in its menu: the page may keep it. */
109
119
  onBalloonDisplayChange?: (display: BalloonDisplay) => void;
110
120
  };
121
+ /** Who talks to whom over A2A: an edge of the graph. */
122
+ export type A2ATeamGraphLink = {
123
+ from: string;
124
+ to: string;
125
+ };
126
+ /** Where a member stands: fractions of the box, as a scene's stage says. */
127
+ export type A2ATeamGraphPosition = {
128
+ x: number;
129
+ y: number;
130
+ };
111
131
  export type A2ATeamGraphProps = {
112
132
  /** The member that asks: drawn on the left. */
113
133
  entry: A2ATeamGraphMember;
114
- /** The member asked over A2A: drawn on the right. */
115
- peer: A2ATeamGraphMember;
116
- /** Which way the link carries a message now. */
117
- flow: A2ATeamFlow;
118
- /** Whether the peer is reached: the edge is drawn faint until it is. */
119
- connected: boolean;
120
- /** What the edge says at rest: `A2A · <the peer's skill>`. */
134
+ /** The member asked over A2A: drawn on the right. A team of two. */
135
+ peer?: A2ATeamGraphMember;
136
+ /** The members asked over A2A, a team of N: after `peer` when both are given. */
137
+ peers?: readonly A2ATeamGraphMember[];
138
+ /** Which way the link to `peer` carries a message now. */
139
+ flow?: A2ATeamFlow;
140
+ /** Which way each peer's link carries a message now, by the peer's id. */
141
+ flows?: Record<string, A2ATeamFlow>;
142
+ /**
143
+ * Whether the peers are reached: an edge is drawn faint until its peer
144
+ * is. One answer for all, or one per peer id.
145
+ */
146
+ connected: boolean | Record<string, boolean>;
147
+ /** What an edge says at rest: `A2A · <the peer's skill>`. */
121
148
  label?: string;
149
+ /** What each peer's edge says at rest, by the peer's id; `label` unsaid. */
150
+ labels?: Record<string, string>;
151
+ /**
152
+ * The edges: the team's `talks_to` over A2A. Unsaid, the entry to each
153
+ * peer. An edge between two peers is drawn still.
154
+ */
155
+ links?: readonly A2ATeamGraphLink[];
156
+ /** Where each member stands, by its id (a scene's `stage.positions`). */
157
+ positions?: Record<string, A2ATeamGraphPosition>;
122
158
  /** The character's size, in pixels at full scale. */
123
159
  size?: number;
124
160
  /** The tool calls running now, to the members' connections (`useA2ATeam`). */
@@ -130,6 +166,36 @@ export type A2ATeamGraphProps = {
130
166
  */
131
167
  balloonRoom?: number;
132
168
  };
169
+ /**
170
+ * The handles an edge leaves and reaches a member by, named: the middle of
171
+ * its character on each side, chosen by where the other member stands.
172
+ */
173
+ export declare const MEMBER_HANDLES: {
174
+ readonly inLeft: "in-left";
175
+ readonly outRight: "out-right";
176
+ readonly inTop: "in-top";
177
+ readonly outBottom: "out-bottom";
178
+ readonly inRight: "in-right";
179
+ readonly outLeft: "out-left";
180
+ readonly inBottom: "in-bottom";
181
+ readonly outTop: "out-top";
182
+ readonly connections: "connections";
183
+ };
184
+ /**
185
+ * The handles for an edge from one place to another: rightward across,
186
+ * leftward across, or down or up when the other member is mostly below or
187
+ * above.
188
+ */
189
+ export declare function handlesBetween(from: {
190
+ x: number;
191
+ y: number;
192
+ }, to: {
193
+ x: number;
194
+ y: number;
195
+ }): {
196
+ sourceHandle: string;
197
+ targetHandle: string;
198
+ };
133
199
  /** How far a member was moved from its place, in the graph's coordinates. */
134
200
  export type MemberOffset = {
135
201
  dx: number;
@@ -152,6 +218,17 @@ export declare function connectionLabel(connection: Pick<A2ATeamConnection, 'lab
152
218
  export declare function connectionDetails(connection: Pick<A2ATeamConnection, 'name' | 'tools'>, member: string | undefined, calling?: string): string;
153
219
  /** The words on the edge for a flow. */
154
220
  export declare function flowWords(flow: A2ATeamFlow, entry: string, peer: string): string;
221
+ /**
222
+ * An arrowhead at the end a message goes to — the target's when `forward`,
223
+ * the source's otherwise — pointing along the edge.
224
+ */
225
+ export declare function arrowPath(source: {
226
+ x: number;
227
+ y: number;
228
+ }, target: {
229
+ x: number;
230
+ y: number;
231
+ }, forward: boolean): string;
155
232
  type CallData = {
156
233
  /** The tool being called, in words (`list invoices`); empty while none is. */
157
234
  calling: string;
@@ -160,8 +237,26 @@ type CallData = {
160
237
  export declare const CallEdge: import("react").NamedExoticComponent<EdgeProps<Edge<CallData>>>;
161
238
  /** What a member's call says, on its edge and to a screen reader. */
162
239
  export declare function callWords(member: string, connection: A2ATeamConnection, tool: string): string;
163
- /** The viewport that shows the graph's width whole in a box `width` wide, never larger than drawn. */
164
- export declare function teamViewport(width: number): Viewport;
165
- /** Draw a team of two over A2A, the link moving with what travels on it. */
166
- export declare function A2ATeamGraph({ entry, peer, flow, connected, label, size, calls, balloonRoom, }: A2ATeamGraphProps): JSX.Element;
240
+ /** The viewport that shows a graph `drawn` wide whole in a box `width` wide, never larger than drawn. */
241
+ export declare function teamViewport(width: number, drawn?: number): Viewport;
242
+ /** Where a member is laid out: its column and row, from the positions or the default. */
243
+ export type MemberPlace = {
244
+ column: number;
245
+ row: number;
246
+ };
247
+ /**
248
+ * Where each member stands, as columns and rows: from the positions given
249
+ * (the distinct `x` values are the columns left to right, the distinct `y`
250
+ * values the rows top to bottom), or the entry in the first column and the
251
+ * peers one under another in the second.
252
+ */
253
+ export declare function placeMembers(entryId: string, peerIds: readonly string[], positions?: Record<string, A2ATeamGraphPosition>): {
254
+ places: Record<string, MemberPlace>;
255
+ columns: number;
256
+ rows: number;
257
+ };
258
+ /** The one flow the graph reports for all its edges: asking before answering before still. */
259
+ export declare function flowOfAll(flows: readonly A2ATeamFlow[]): A2ATeamFlow;
260
+ /** Draw a team over A2A, each link moving with what travels on it. */
261
+ export declare function A2ATeamGraph({ entry, peer, peers: more, flow, flows, connected, label, labels, links, positions, size, calls, balloonRoom, }: A2ATeamGraphProps): JSX.Element;
167
262
  export default A2ATeamGraph;