@datalayer/agent-runtimes 1.5.90 → 1.5.91

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 (74) hide show
  1. package/README.md +29 -297
  2. package/dist-embed/datalayer-app-main.js +2 -2
  3. package/lib/components/teams/A2ATeamGraph.d.ts +40 -155
  4. package/lib/components/teams/A2ATeamGraph.js +122 -400
  5. package/lib/components/teams/SceneTranscript.d.ts +5 -1
  6. package/lib/components/teams/SceneTranscript.js +2 -2
  7. package/lib/components/teams/SceneView.d.ts +17 -5
  8. package/lib/components/teams/SceneView.js +7 -3
  9. package/lib/components/teams/backdrops/catalogue.d.ts +35 -0
  10. package/lib/components/teams/backdrops/catalogue.js +34 -0
  11. package/lib/components/teams/backdrops/edges.d.ts +20 -0
  12. package/lib/components/teams/backdrops/edges.js +29 -0
  13. package/lib/components/teams/backdrops/faces.d.ts +24 -0
  14. package/lib/components/teams/backdrops/faces.js +39 -0
  15. package/lib/components/teams/backdrops/halo.d.ts +14 -0
  16. package/lib/components/teams/backdrops/halo.js +5 -0
  17. package/lib/components/teams/backdrops/hero.d.ts +14 -0
  18. package/lib/components/teams/backdrops/hero.js +178 -0
  19. package/lib/components/teams/backdrops/index.d.ts +22 -0
  20. package/lib/components/teams/backdrops/index.js +38 -0
  21. package/lib/components/teams/backdrops/nodes.d.ts +123 -0
  22. package/lib/components/teams/backdrops/nodes.js +265 -0
  23. package/lib/components/teams/backdrops/plain.d.ts +14 -0
  24. package/lib/components/teams/backdrops/plain.js +116 -0
  25. package/lib/components/teams/backdrops/studio.d.ts +17 -0
  26. package/lib/components/teams/backdrops/studio.js +122 -0
  27. package/lib/components/teams/backdrops/theme.d.ts +14 -0
  28. package/lib/components/teams/backdrops/theme.js +19 -0
  29. package/lib/components/teams/backdrops/types.d.ts +214 -0
  30. package/lib/components/teams/backdrops/types.js +5 -0
  31. package/lib/components/teams/index.d.ts +2 -0
  32. package/lib/components/teams/index.js +2 -0
  33. package/lib/components/teams/sceneTranscriptRules.d.ts +32 -1
  34. package/lib/components/teams/sceneTranscriptRules.js +104 -2
  35. package/lib/components/teams/transcript/RecordingLabel.d.ts +17 -0
  36. package/lib/components/teams/transcript/RecordingLabel.js +7 -0
  37. package/lib/components/teams/transcript/SequenceDiagram.d.ts +39 -0
  38. package/lib/components/teams/transcript/SequenceDiagram.js +190 -0
  39. package/lib/components/teams/transcript/TranscriptDetail.d.ts +27 -0
  40. package/lib/components/teams/transcript/TranscriptDetail.js +48 -0
  41. package/lib/components/teams/transcript/TranscriptTable.d.ts +23 -0
  42. package/lib/components/teams/transcript/TranscriptTable.js +112 -0
  43. package/lib/components/teams/transcript/TranscriptViews.d.ts +66 -0
  44. package/lib/components/teams/transcript/TranscriptViews.js +135 -0
  45. package/lib/components/teams/transcript/TranscriptViewsTypes.d.ts +13 -0
  46. package/lib/components/teams/transcript/TranscriptViewsTypes.js +5 -0
  47. package/lib/components/teams/transcript/index.d.ts +23 -0
  48. package/lib/components/teams/transcript/index.js +27 -0
  49. package/lib/components/teams/transcript/recordingPlayback.d.ts +52 -0
  50. package/lib/components/teams/transcript/recordingPlayback.js +146 -0
  51. package/lib/components/teams/transcript/selection.d.ts +59 -0
  52. package/lib/components/teams/transcript/selection.js +79 -0
  53. package/lib/components/teams/transcript/sequenceDiagramRules.d.ts +35 -0
  54. package/lib/components/teams/transcript/sequenceDiagramRules.js +158 -0
  55. package/lib/components/teams/transcript/transcriptDetailRules.d.ts +80 -0
  56. package/lib/components/teams/transcript/transcriptDetailRules.js +208 -0
  57. package/lib/components/teams/transcript/transcriptExport.d.ts +31 -0
  58. package/lib/components/teams/transcript/transcriptExport.js +82 -0
  59. package/lib/components/teams/transcript/transcriptRows.d.ts +76 -0
  60. package/lib/components/teams/transcript/transcriptRows.js +187 -0
  61. package/lib/components/teams/transcript/useSceneRecording.d.ts +45 -0
  62. package/lib/components/teams/transcript/useSceneRecording.js +96 -0
  63. package/lib/examples/ScenesExample.js +16 -3
  64. package/lib/specs/actions.js +2 -0
  65. package/lib/specs/apps.d.ts +1 -0
  66. package/lib/specs/apps.js +219 -0
  67. package/lib/specs/sceneRecordings.d.ts +14 -0
  68. package/lib/specs/sceneRecordings.js +12 -0
  69. package/lib/specs/sceneSchema.js +11 -0
  70. package/lib/specs/scenes.d.ts +1 -0
  71. package/lib/specs/scenes.js +159 -0
  72. package/lib/types/scenes.d.ts +54 -0
  73. package/package.json +2 -1
  74. package/scripts/codegen/generate_scenes.py +80 -0
@@ -32,105 +32,27 @@
32
32
  * zoomed, and the wheel scrolls the page. Its viewport is worked out from its
33
33
  * box, so it fits a phone as it fits a desk.
34
34
  *
35
+ * How it is drawn is its *backdrop* (`backdrop`, the scene's
36
+ * `stage.backdrop`; {@link SceneBackdrop}): `studio`, the drawing above —
37
+ * characters, balloons, flowing edges — `hero`, faces on a deep tint with
38
+ * a dot that flies with each message, or `plain`, boxes and arrows that do
39
+ * not move. The graph works out the same things for every backdrop — who
40
+ * stands where, which way each link carries a message, which connection
41
+ * answers a call, the words a screen reader hears — and reads the node
42
+ * types, the edge types, the colours and the layout from the backdrop.
43
+ *
35
44
  * @module components/teams/A2ATeamGraph
36
45
  */
37
- import type { AssistantModel3D } from '../../chat/assistant/avatar3dModel';
38
46
  import type { JSX } from 'react';
39
- import { type Edge, type EdgeProps, type Viewport } from '@xyflow/react';
47
+ import { type Viewport } from '@xyflow/react';
40
48
  import '@xyflow/react/dist/base.css';
41
- import { type AssistantAbout } from '../../chat/assistant/AssistantStage';
42
- import type { BalloonSuggestion } from '../../chat/assistant/SpeechBalloon';
43
- import type { DisplayItem } from '../../types/chat';
44
- import type { AssistantMenuItem } from '../../chat/assistant/AssistantContextMenu';
45
- import type { AssistantSandbox } from '../../chat/assistant/assistantDetails';
46
- import type { OtelLiveTracer } from '@datalayer/core/lib/otel/live';
47
49
  import { type A2ATeamCall, type A2ATeamConnection, type A2ATeamFlow } from './a2aTeamFlow';
48
- import type { A2ATeamPersona } from './useA2ATeam';
49
- import type { BalloonExpandTarget } from '../../chat/assistant/BalloonVisual';
50
- import type { BalloonDisplay } from '../../chat/assistant/toolLine';
51
- /** One member of the team, as the graph draws it. */
52
- export type A2ATeamGraphMember = {
53
- id: string;
54
- name: string;
55
- emoji?: string;
56
- /** Its avatar, as its Appspec's `interface.avatar` names it: an id, or a 3D model. */
57
- character: string | AssistantModel3D;
58
- /** Where it runs, in a few words: "in your browser", "on a runtime". */
59
- where: string;
60
- persona: A2ATeamPersona;
61
- /** A click on the character. */
62
- onToggle?: () => void;
63
- /** It was sent away, or called back. */
64
- onAway?: (away: boolean) => void;
65
- /** The MCP servers it reaches, drawn to its right (`teamConnectionsOf`). */
66
- connections?: A2ATeamConnection[];
67
- /**
68
- * How its balloon shows what it says (T-23): only what it says or
69
- * does now (`current`, a team's default) — the words, the tool it calls,
70
- * a notebook it was given — or a peek (`history`).
71
- */
72
- balloonDisplay?: BalloonDisplay;
73
- /**
74
- * The notebook in its balloon was clicked: by default, it is expanded —
75
- * into `expandTarget`, scrolled to and focused, or in a dialog.
76
- */
77
- onNotebookOpen?: () => void;
78
- /**
79
- * Where the notebook it was given runs (`TeamNotebook`, editable, on the
80
- * browser sandbox): an element of the page — the area under the graph —
81
- * where it is drawn as it arrives and when it is expanded; without one,
82
- * *Expand* opens it in a dialog over the page.
83
- */
84
- expandTarget?: BalloonExpandTarget;
85
- /** What its notebook is called: `Accounting's notebook`. */
86
- notebookTitle?: string;
87
- /**
88
- * What the person may ask it: chips in its balloon while it waits for a
89
- * question, and a group of its menu; one chosen is sent (`onSuggestion`).
90
- */
91
- suggestions?: readonly BalloonSuggestion[];
92
- onSuggestion?: (suggestion: BalloonSuggestion) => void;
93
- /**
94
- * The team's Agent Inspector's tracer: its menu offers *Inspect the
95
- * agent…*, its own spans (what it did, and the A2A requests sent to it).
96
- */
97
- inspector?: OtelLiveTracer | null;
98
- /** Stops its turn, from its menu, while it works. */
99
- onStop?: () => void;
100
- /** What its menu's *About* and *Agent Details…* say. */
101
- about?: AssistantAbout;
102
- /**
103
- * Its code sandbox, for *Code Sandbox Details…*. The entry — the agent in
104
- * the page — has the kernel of the notebook open under the graph, while
105
- * one is.
106
- */
107
- sandbox?: AssistantSandbox;
108
- /** The host's own entries of its menu. */
109
- contextMenu?: readonly AssistantMenuItem[];
110
- /**
111
- * What its menu calls a click on it (`onToggle`): `Ask Sales` where it
112
- * takes the person to the composer. Without `onToggle`, its menu has no
113
- * such entry.
114
- */
115
- conversationLabel?: string;
116
- /**
117
- * What it said and did, as its `history` balloon lists it (`useA2ATeam`'s
118
- * `entryHistory`, `peerHistory`): shown when its menu chooses *History*.
119
- */
120
- history?: readonly DisplayItem[];
121
- /** Its balloon's display was chosen in its menu: the page may keep it. */
122
- onBalloonDisplayChange?: (display: BalloonDisplay) => void;
123
- };
124
- /** Who talks to whom over A2A: an edge of the graph. */
125
- export type A2ATeamGraphLink = {
126
- from: string;
127
- to: string;
128
- };
129
- /** Where a member stands: fractions of the box, as a scene's stage says. */
130
- export type A2ATeamGraphPosition = {
131
- x: number;
132
- y: number;
133
- };
50
+ import type { A2ATeamGraphLink, A2ATeamGraphMember, A2ATeamGraphPosition, SceneBackdropId } from './backdrops/types';
51
+ import type { SelectedEdge } from './transcript/selection';
52
+ export type { A2ATeamGraphLink, A2ATeamGraphMember, A2ATeamGraphPosition, } from './backdrops/types';
53
+ export { MEMBER_HANDLES, clampOffset, connectionDetails, connectionLabel, memberLabel, type MemberBounds, type MemberOffset, } from './backdrops/nodes';
54
+ export { arrowPath } from './backdrops/edges';
55
+ export { CallEdge, LinkEdge, MemberNode, ConnectionNode, } from './backdrops/studio';
134
56
  export type A2ATeamGraphProps = {
135
57
  /** The member that asks: drawn on the left. */
136
58
  entry: A2ATeamGraphMember;
@@ -166,25 +88,32 @@ export type A2ATeamGraphProps = {
166
88
  * The least room above the members for their balloons, in pixels at full
167
89
  * scale: the graph keeps what its balloons take now (`useBalloonRoom`) —
168
90
  * suggestions, *more* unfolded — and never less than this. A notebook in
169
- * a balloon gets at least its own.
91
+ * a balloon gets at least its own. Unsaid, the backdrop's.
170
92
  */
171
93
  balloonRoom?: number;
94
+ /**
95
+ * How the stage is drawn (`SceneStageSpec.backdrop`): `studio`, the
96
+ * drawing every scene had first, `hero` or `plain`. `studio` when unsaid,
97
+ * and for an id the graph does not know.
98
+ */
99
+ backdrop?: SceneBackdropId;
100
+ /**
101
+ * The exchange selected in the transcript, as the edge it is on
102
+ * (`selectedEdgeOf`, SCENES S3-02): drawn with a halo on every backdrop —
103
+ * the edge by its id, or by its ends either way, since an answer travels
104
+ * the asker's edge back.
105
+ */
106
+ selected?: SelectedEdge | null;
107
+ /**
108
+ * An edge was clicked: the page selects its latest exchange
109
+ * (`latestLineOnEdge`). With it, the edges take the pointer.
110
+ */
111
+ onSelectEdge?: (edge: A2ATeamGraphEdge) => void;
172
112
  };
173
- /**
174
- * The handles an edge leaves and reaches a member by, named: the middle of
175
- * its character on each side, chosen by where the other member stands.
176
- */
177
- export declare const MEMBER_HANDLES: {
178
- readonly inLeft: "in-left";
179
- readonly outRight: "out-right";
180
- readonly inTop: "in-top";
181
- readonly outBottom: "out-bottom";
182
- readonly inRight: "in-right";
183
- readonly outLeft: "out-left";
184
- readonly inBottom: "in-bottom";
185
- readonly outTop: "out-top";
186
- readonly connections: "connections";
187
- };
113
+ /** An edge of the graph, as a click names it: `selectedEdgeOf`'s shape without the selection's key. */
114
+ export type A2ATeamGraphEdge = Omit<SelectedEdge, 'key'>;
115
+ /** Whether a selection is on the edge between two ends: by its id, or by its ends either way. */
116
+ export declare function edgeSelected(selected: SelectedEdge | null | undefined, from: string, to: string): boolean;
188
117
  /**
189
118
  * The handles for an edge from one place to another: rightward across,
190
119
  * leftward across, or down or up when the other member is mostly below or
@@ -200,52 +129,8 @@ export declare function handlesBetween(from: {
200
129
  sourceHandle: string;
201
130
  targetHandle: string;
202
131
  };
203
- /** How far a member was moved from its place, in the graph's coordinates. */
204
- export type MemberOffset = {
205
- dx: number;
206
- dy: number;
207
- };
208
- /** How far a member may move: its node stays inside the graph's box. */
209
- export type MemberBounds = {
210
- minDx: number;
211
- maxDx: number;
212
- minDy: number;
213
- maxDy: number;
214
- };
215
- /** An offset kept inside its bounds. */
216
- export declare function clampOffset(offset: MemberOffset, bounds: MemberBounds): MemberOffset;
217
- /** A member's accessible name: its name, and where it runs. */
218
- export declare function memberLabel(member: Pick<A2ATeamGraphMember, 'name' | 'where'>): string;
219
- /** A connection's accessible name: `Odoo, Accounting's MCP connection`. */
220
- export declare function connectionLabel(connection: Pick<A2ATeamConnection, 'label'>, member: string | undefined): string;
221
- /** What a connection's details say: the server, who reaches it, and the call running now. */
222
- export declare function connectionDetails(connection: Pick<A2ATeamConnection, 'name' | 'tools'>, member: string | undefined, calling?: string): string;
223
132
  /** The words on the edge for a flow. */
224
133
  export declare function flowWords(flow: A2ATeamFlow, entry: string, peer: string): string;
225
- /**
226
- * An arrowhead at the end a message goes to — the target's when `forward`,
227
- * the source's otherwise — pointing along the edge.
228
- */
229
- export declare function arrowPath(source: {
230
- x: number;
231
- y: number;
232
- }, target: {
233
- x: number;
234
- y: number;
235
- }, forward: boolean): string;
236
- type CallData = {
237
- /** Which way it carries a call: out with the call, back with its result. */
238
- flow: A2ATeamFlow;
239
- /** The tool being called, in words (`list invoices`); empty while none is. */
240
- calling: string;
241
- /** What it says: `MCP`, and what it carries while it carries something. */
242
- label: string;
243
- };
244
- /**
245
- * A member's link to a connection, drawn as the A2A link is: still, flowing
246
- * toward the connection while a call runs, and back with its result.
247
- */
248
- export declare const CallEdge: import("react").NamedExoticComponent<EdgeProps<Edge<CallData>>>;
249
134
  /** What a link to a connection says at rest, as `A2A` says the members' link. */
250
135
  export declare const MCP_LABEL = "MCP";
251
136
  /**
@@ -281,5 +166,5 @@ export declare function placeMembers(entryId: string, peerIds: readonly string[]
281
166
  /** The one flow the graph reports for all its edges: asking before answering before still. */
282
167
  export declare function flowOfAll(flows: readonly A2ATeamFlow[]): A2ATeamFlow;
283
168
  /** Draw a team over A2A, each link moving with what travels on it. */
284
- export declare function A2ATeamGraph({ entry, peer, peers: more, flow, flows, connected, label, labels, links, positions, size, calls, balloonRoom, }: A2ATeamGraphProps): JSX.Element;
169
+ export declare function A2ATeamGraph({ entry, peer, peers: more, flow, flows, connected, label, labels, links, positions, size, calls, balloonRoom, backdrop, selected, onSelectEdge, }: A2ATeamGraphProps): JSX.Element;
285
170
  export default A2ATeamGraph;