@datalayer/agent-runtimes 1.5.89 → 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 (87) hide show
  1. package/README.md +29 -297
  2. package/dist-embed/datalayer-app-main.js +40 -36
  3. package/lib/apps/embed/element.js +20 -5
  4. package/lib/apps/embed/visitorApp.d.ts +23 -45
  5. package/lib/apps/embed/visitorApp.js +65 -13
  6. package/lib/components/teams/A2ATeamGraph.d.ts +58 -152
  7. package/lib/components/teams/A2ATeamGraph.js +169 -410
  8. package/lib/components/teams/SceneTranscript.d.ts +5 -1
  9. package/lib/components/teams/SceneTranscript.js +2 -2
  10. package/lib/components/teams/SceneView.d.ts +17 -5
  11. package/lib/components/teams/SceneView.js +7 -3
  12. package/lib/components/teams/a2aTeamFlow.d.ts +16 -7
  13. package/lib/components/teams/a2aTeamFlow.js +17 -14
  14. package/lib/components/teams/backdrops/catalogue.d.ts +35 -0
  15. package/lib/components/teams/backdrops/catalogue.js +34 -0
  16. package/lib/components/teams/backdrops/edges.d.ts +20 -0
  17. package/lib/components/teams/backdrops/edges.js +29 -0
  18. package/lib/components/teams/backdrops/faces.d.ts +24 -0
  19. package/lib/components/teams/backdrops/faces.js +39 -0
  20. package/lib/components/teams/backdrops/halo.d.ts +14 -0
  21. package/lib/components/teams/backdrops/halo.js +5 -0
  22. package/lib/components/teams/backdrops/hero.d.ts +14 -0
  23. package/lib/components/teams/backdrops/hero.js +178 -0
  24. package/lib/components/teams/backdrops/index.d.ts +22 -0
  25. package/lib/components/teams/backdrops/index.js +38 -0
  26. package/lib/components/teams/backdrops/nodes.d.ts +123 -0
  27. package/lib/components/teams/backdrops/nodes.js +265 -0
  28. package/lib/components/teams/backdrops/plain.d.ts +14 -0
  29. package/lib/components/teams/backdrops/plain.js +116 -0
  30. package/lib/components/teams/backdrops/studio.d.ts +17 -0
  31. package/lib/components/teams/backdrops/studio.js +122 -0
  32. package/lib/components/teams/backdrops/theme.d.ts +14 -0
  33. package/lib/components/teams/backdrops/theme.js +19 -0
  34. package/lib/components/teams/backdrops/types.d.ts +214 -0
  35. package/lib/components/teams/backdrops/types.js +5 -0
  36. package/lib/components/teams/index.d.ts +2 -0
  37. package/lib/components/teams/index.js +2 -0
  38. package/lib/components/teams/sceneTranscriptRules.d.ts +32 -1
  39. package/lib/components/teams/sceneTranscriptRules.js +104 -2
  40. package/lib/components/teams/transcript/RecordingLabel.d.ts +17 -0
  41. package/lib/components/teams/transcript/RecordingLabel.js +7 -0
  42. package/lib/components/teams/transcript/SequenceDiagram.d.ts +39 -0
  43. package/lib/components/teams/transcript/SequenceDiagram.js +190 -0
  44. package/lib/components/teams/transcript/TranscriptDetail.d.ts +27 -0
  45. package/lib/components/teams/transcript/TranscriptDetail.js +48 -0
  46. package/lib/components/teams/transcript/TranscriptTable.d.ts +23 -0
  47. package/lib/components/teams/transcript/TranscriptTable.js +112 -0
  48. package/lib/components/teams/transcript/TranscriptViews.d.ts +66 -0
  49. package/lib/components/teams/transcript/TranscriptViews.js +135 -0
  50. package/lib/components/teams/transcript/TranscriptViewsTypes.d.ts +13 -0
  51. package/lib/components/teams/transcript/TranscriptViewsTypes.js +5 -0
  52. package/lib/components/teams/transcript/index.d.ts +23 -0
  53. package/lib/components/teams/transcript/index.js +27 -0
  54. package/lib/components/teams/transcript/recordingPlayback.d.ts +52 -0
  55. package/lib/components/teams/transcript/recordingPlayback.js +146 -0
  56. package/lib/components/teams/transcript/selection.d.ts +59 -0
  57. package/lib/components/teams/transcript/selection.js +79 -0
  58. package/lib/components/teams/transcript/sequenceDiagramRules.d.ts +35 -0
  59. package/lib/components/teams/transcript/sequenceDiagramRules.js +158 -0
  60. package/lib/components/teams/transcript/transcriptDetailRules.d.ts +80 -0
  61. package/lib/components/teams/transcript/transcriptDetailRules.js +208 -0
  62. package/lib/components/teams/transcript/transcriptExport.d.ts +31 -0
  63. package/lib/components/teams/transcript/transcriptExport.js +82 -0
  64. package/lib/components/teams/transcript/transcriptRows.d.ts +76 -0
  65. package/lib/components/teams/transcript/transcriptRows.js +187 -0
  66. package/lib/components/teams/transcript/useSceneRecording.d.ts +45 -0
  67. package/lib/components/teams/transcript/useSceneRecording.js +96 -0
  68. package/lib/examples/ScenesExample.js +16 -3
  69. package/lib/portable/hosts/agentClient.d.ts +8 -0
  70. package/lib/portable/hosts/agentClient.js +2 -0
  71. package/lib/portable/hosts/approvalRenderers.d.ts +10 -2
  72. package/lib/portable/hosts/approvalRenderers.js +81 -2
  73. package/lib/portable/hosts/contracts.d.ts +1 -0
  74. package/lib/portable/hosts/contracts.js +2 -0
  75. package/lib/portable/hosts/contracts.json +56 -2
  76. package/lib/specs/actions.js +2 -0
  77. package/lib/specs/apps.d.ts +1 -0
  78. package/lib/specs/apps.js +219 -0
  79. package/lib/specs/sceneRecordings.d.ts +14 -0
  80. package/lib/specs/sceneRecordings.js +12 -0
  81. package/lib/specs/sceneSchema.js +11 -0
  82. package/lib/specs/scenes.d.ts +1 -0
  83. package/lib/specs/scenes.js +159 -0
  84. package/lib/types/scenes.d.ts +54 -0
  85. package/package.json +2 -1
  86. package/scripts/codegen/generate_mcp_servers.py +5 -16
  87. package/scripts/codegen/generate_scenes.py +80 -0
@@ -144,7 +144,17 @@ export interface SceneStageSpec {
144
144
  /** How long the scene plays before it rests, `10m`. */
145
145
  restsAfter: string;
146
146
  pace: ScenePace;
147
+ /**
148
+ * How the stage is drawn, here and wherever the scene plays: `studio`,
149
+ * characters with speech balloons and each message flowing along its
150
+ * line; `hero`, round faces on a deep tint, thin lines and a dot that
151
+ * flies with each message; `plain`, boxes and arrows that do not move.
152
+ * `studio` when unsaid, so every scene written before draws as before.
153
+ */
154
+ backdrop?: SceneBackdropId;
147
155
  }
156
+ /** A backdrop, by its id (agentspecs `Backdrop`). */
157
+ export type SceneBackdropId = 'studio' | 'hero' | 'plain';
148
158
  /** Who may watch and ask, and what an ask may cost. */
149
159
  export interface SceneAudienceSpec {
150
160
  who: 'visitors' | 'signed-in' | 'nobody';
@@ -168,6 +178,50 @@ export interface SceneRecordingSpec {
168
178
  taken: string;
169
179
  note: string;
170
180
  }
181
+ /** A line of a recording: the transcript's line as a stage exports it (`SceneTranscriptLine`). */
182
+ export interface SceneRecordedLine {
183
+ key: string;
184
+ /** When, in milliseconds since the epoch. */
185
+ at: number;
186
+ from: string;
187
+ to?: string;
188
+ kind: 'said' | 'asked' | 'called';
189
+ text: string;
190
+ open?: boolean;
191
+ failed?: boolean;
192
+ ended?: number;
193
+ }
194
+ /** A beat of a recording: which of its lines it played (`first`, `count`). */
195
+ export interface SceneRecordedBeat {
196
+ beat: string;
197
+ cue: string;
198
+ state: string;
199
+ seconds: number;
200
+ first: number;
201
+ count: number;
202
+ }
203
+ /**
204
+ * A scene's recording, as `<id>/recording.json` holds it: the transcript of
205
+ * a passing rehearsal (version 1, the JSON a stage exports), when it was
206
+ * taken, the rehearsal it came from and the beats its lines belong to.
207
+ */
208
+ export interface SceneRecordingFile {
209
+ version: 1;
210
+ scene: string;
211
+ /** When it was taken: the label says *Recording, taken <date>*. */
212
+ taken: string;
213
+ /** What the audience is told of it. */
214
+ note?: string;
215
+ exported?: string;
216
+ rehearsal?: {
217
+ at: string;
218
+ where: string;
219
+ passed: boolean;
220
+ says: string;
221
+ };
222
+ beats?: SceneRecordedBeat[];
223
+ lines: SceneRecordedLine[];
224
+ }
171
225
  /** The scene's tests: a passing rehearsal is the gallery's *Live*. */
172
226
  export interface SceneRehearsalSpec {
173
227
  beats: SceneRehearsalBeatSpec[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/agent-runtimes",
3
- "version": "1.5.89",
3
+ "version": "1.5.91",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",
@@ -254,6 +254,7 @@
254
254
  "localforage": "^1.10.0",
255
255
  "lucide-react": "^0.542.0",
256
256
  "marked": "^4.0.10",
257
+ "mermaid": "^10.9.8",
257
258
  "mock-socket": "^9.3.1",
258
259
  "motion": "^12.23.26",
259
260
  "nanoid": "^5.1.6",
@@ -356,18 +356,6 @@ def generate_typescript_code(specs: list[dict[str, Any]]) -> str:
356
356
 
357
357
  def update_init_file(specs: list[dict[str, Any]], init_file: Path) -> None:
358
358
  """Update the __init__.py file with correct imports based on generated specs."""
359
- # Generate list of MCP server constant names
360
- server_constants = []
361
- for spec in specs:
362
- server_id = spec["id"]
363
- version = spec.get("version", "0.0.1")
364
- const_name = (
365
- server_id.upper().replace("-", "_")
366
- + "_MCP_SERVER"
367
- + version_suffix(version)
368
- )
369
- server_constants.append(const_name)
370
-
371
359
  # Read the current __init__.py
372
360
  init_content = init_file.read_text()
373
361
 
@@ -386,9 +374,12 @@ def update_init_file(specs: list[dict[str, Any]], init_file: Path) -> None:
386
374
  return
387
375
 
388
376
  # Generate new import lines - all names sorted alphabetically (ruff/isort order)
377
+ # Only the catalogue and its readers are re-exported: entries are read by
378
+ # id, never by a version-named constant (decided 14 October 2026), so the
379
+ # *_MCP_SERVER_<version> constants stay in catalog_mcp_servers alone and a
380
+ # version bump touches no caller (test_catalogue_by_id.py holds it).
389
381
  all_names = sorted(
390
- server_constants
391
- + [
382
+ [
392
383
  "MCP_SERVER_CATALOG",
393
384
  "check_env_vars_available",
394
385
  "get_catalog_server",
@@ -423,8 +414,6 @@ def update_init_file(specs: list[dict[str, Any]], init_file: Path) -> None:
423
414
  ' "get_catalog_server",',
424
415
  ' "list_catalog_servers",',
425
416
  ]
426
- for const in sorted(server_constants):
427
- all_entries.append(f' "{const}",')
428
417
  all_entries.append("]")
429
418
 
430
419
  # Replace the section
@@ -21,6 +21,12 @@ The scene spec's JSON Schema is written beside the TypeScript catalogue as
21
21
  ``generate_apps.py`` writes ``appspecSchema.ts``: what an editor of the text
22
22
  completes and explains is what the spec accepts (S-01, A-03).
23
23
 
24
+ A scene's recording — the transcript of a passing rehearsal, kept beside
25
+ the specs as ``<id>/recording.json`` and named by ``rehearsal.recording`` —
26
+ is written to ``sceneRecordings.ts`` beside the catalogue, apart from it, so
27
+ that a page that never plays one never loads one: ``SCENE_RECORDINGS``, read
28
+ by ``useSceneRecording`` at the recorded pace.
29
+
24
30
  Usage:
25
31
  python generate_scenes.py \\
26
32
  --specs-dir agentspecs/agentspecs/scenes \\
@@ -290,6 +296,76 @@ def generate_typescript_code(specs: list[dict[str, Any]]) -> str:
290
296
  return "\n".join(lines)
291
297
 
292
298
 
299
+ def load_recordings(specs_dir: Path) -> dict[str, dict[str, Any]]:
300
+ """Every scene's recording its spec names, by the scene's id, as its file holds it.
301
+
302
+ A file the spec names that is not there, or is not a transcript of
303
+ version 1, stops the generation in a sentence (agentspecs'
304
+ ``scene_recording``, when the clone has it).
305
+ """
306
+ scenes_module = import_from_clone(specs_dir, "scenes")
307
+ read = getattr(scenes_module, "scene_recording", None)
308
+ recordings: dict[str, dict[str, Any]] = {}
309
+ for identity, scene in sorted(scenes_module.load_scenes(specs_dir).items()):
310
+ named = scene.rehearsal.recording
311
+ if named is None:
312
+ continue
313
+ path = specs_dir / named.path
314
+ if read is not None and path == specs_dir / identity / "recording.json":
315
+ found = read(identity, specs_dir)
316
+ else:
317
+ found = json.loads(path.read_text()) if path.is_file() else None
318
+ if not found:
319
+ raise SystemExit(
320
+ f"The recording of {identity} ({named.path}) is not there."
321
+ )
322
+ recordings[identity] = {
323
+ **found,
324
+ "scene": identity,
325
+ "taken": named.taken or found.get("taken") or "",
326
+ **({"note": named.note} if named.note else {}),
327
+ }
328
+ return recordings
329
+
330
+
331
+ def generate_recordings_typescript_code(recordings: dict[str, dict[str, Any]]) -> str:
332
+ """The scenes' recordings, apart from the catalogue: a page that plays none loads none."""
333
+ body = json.dumps(recordings, indent=2, ensure_ascii=False)
334
+ return "\n".join(
335
+ [
336
+ "/*",
337
+ " * Copyright (c) 2025-2026 Datalayer, Inc.",
338
+ " * Distributed under the terms of the Modified BSD License.",
339
+ " */",
340
+ "",
341
+ "/**",
342
+ " * The scenes' recordings: each the transcript of a passing rehearsal, kept",
343
+ " * beside its spec as `<id>/recording.json` (`loop scenes record`) and played",
344
+ " * at its recorded pace when the scene cannot play live (`useSceneRecording`).",
345
+ " *",
346
+ *[f" * {line}" for line in HEADER],
347
+ " *",
348
+ " * @module specs/sceneRecordings",
349
+ " */",
350
+ "",
351
+ "import type { SceneRecordingFile } from '../types/scenes';",
352
+ "",
353
+ f"export const SCENE_RECORDINGS: Record<string, SceneRecordingFile> = {body};",
354
+ "",
355
+ "/** A scene's recording, by its id or `id:version`; undefined when it has none. */",
356
+ "export function getSceneRecording(",
357
+ " ref: string,",
358
+ "): SceneRecordingFile | undefined {",
359
+ " const id = ref.split(':')[0];",
360
+ " return Object.prototype.hasOwnProperty.call(SCENE_RECORDINGS, id)",
361
+ " ? SCENE_RECORDINGS[id]",
362
+ " : undefined;",
363
+ "}",
364
+ "",
365
+ ]
366
+ )
367
+
368
+
293
369
  def generate_schema_typescript_code(specs_dir: Path) -> str:
294
370
  """The scene spec's JSON Schema, for the editor of its text (S-01, A-03).
295
371
 
@@ -344,6 +420,10 @@ def main() -> None:
344
420
  args.typescript_output.with_name("sceneSchema.ts"),
345
421
  generate_schema_typescript_code(args.specs_dir),
346
422
  ),
423
+ (
424
+ args.typescript_output.with_name("sceneRecordings.ts"),
425
+ generate_recordings_typescript_code(load_recordings(args.specs_dir)),
426
+ ),
347
427
  ):
348
428
  path.parent.mkdir(parents=True, exist_ok=True)
349
429
  path.write_text(text)