@datalayer/agent-runtimes 1.5.96 → 1.5.98

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 (92) hide show
  1. package/dist-embed/chunks/{index.esm-zOy6kFPv.js → index.esm-BLDeC6q1.js} +1 -1
  2. package/dist-embed/datalayer-app-main.js +80 -80
  3. package/lib/apps/apps/appspec.d.ts +11 -12
  4. package/lib/apps/apps/appspec.js +45 -87
  5. package/lib/components/cards/ToolApprovalCard.js +4 -2
  6. package/lib/components/teams/HarnessIcon.d.ts +11 -0
  7. package/lib/components/teams/HarnessIcon.js +17 -0
  8. package/lib/components/teams/SceneTranscript.d.ts +1 -1
  9. package/lib/components/teams/SceneTranscript.js +12 -7
  10. package/lib/components/teams/SceneView.d.ts +7 -1
  11. package/lib/components/teams/SceneView.js +2 -2
  12. package/lib/components/teams/backdrops/hero.js +1 -1
  13. package/lib/components/teams/backdrops/minimal.js +1 -1
  14. package/lib/components/teams/backdrops/nodes.js +4 -3
  15. package/lib/components/teams/backdrops/space.js +1 -1
  16. package/lib/components/teams/backdrops/types.d.ts +9 -0
  17. package/lib/components/teams/index.d.ts +2 -0
  18. package/lib/components/teams/index.js +2 -0
  19. package/lib/components/teams/memberHarness.d.ts +16 -0
  20. package/lib/components/teams/memberHarness.js +42 -0
  21. package/lib/components/teams/sceneTranscriptRules.js +6 -1
  22. package/lib/components/teams/transcript/LineSelect.d.ts +20 -0
  23. package/lib/components/teams/transcript/LineSelect.js +20 -0
  24. package/lib/components/teams/transcript/TranscriptTable.d.ts +11 -5
  25. package/lib/components/teams/transcript/TranscriptTable.js +24 -7
  26. package/lib/components/teams/transcript/TranscriptViews.js +1 -1
  27. package/lib/components/teams/transcript/recordingPlayback.d.ts +13 -0
  28. package/lib/components/teams/transcript/recordingPlayback.js +32 -0
  29. package/lib/components/teams/transcript/useSceneRecording.d.ts +1 -1
  30. package/lib/components/teams/transcript/useSceneRecording.js +19 -11
  31. package/lib/examples/PapAccountTokensExample.d.ts +1 -1
  32. package/lib/examples/PapAccountTokensExample.js +3 -3
  33. package/lib/examples/PapSessionJwtExample.d.ts +4 -0
  34. package/lib/examples/{PapDpopProofExample.js → PapSessionJwtExample.js} +9 -9
  35. package/lib/examples/PapSessionLifecycleExample.d.ts +1 -1
  36. package/lib/examples/PapSessionLifecycleExample.js +2 -2
  37. package/lib/examples/ScenesExample.js +15 -13
  38. package/lib/examples/example-selector.js +3 -3
  39. package/lib/examples/index.d.ts +1 -1
  40. package/lib/examples/index.js +1 -1
  41. package/lib/examples/main.js +1 -1
  42. package/lib/examples/pap/PapAccountTokensView.d.ts +1 -1
  43. package/lib/examples/pap/PapAuthorizationBoundaryView.js +15 -22
  44. package/lib/examples/pap/PapGuidedJourneyView.js +61 -60
  45. package/lib/examples/pap/PapSessionJwtView.d.ts +4 -0
  46. package/lib/examples/pap/PapSessionJwtView.js +69 -0
  47. package/lib/examples/pap/PapSessionLifecycleView.js +36 -58
  48. package/lib/examples/pap/PapSignInDisplayView.d.ts +1 -1
  49. package/lib/examples/pap/PapSignInDisplayView.js +1 -1
  50. package/lib/examples/pap/PapTraceView.d.ts +1 -1
  51. package/lib/examples/pap/PapTraceView.js +1 -1
  52. package/lib/examples/pap/traces/account-tokens.json +145 -173
  53. package/lib/examples/pap/traces/conversation-control.json +118 -140
  54. package/lib/examples/pap/traces/conversation-streaming.json +114 -134
  55. package/lib/examples/pap/traces/mediated-sign-in.json +151 -166
  56. package/lib/examples/pap/traces/operations.json +613 -391
  57. package/lib/examples/pap/traces/two-companies.json +380 -990
  58. package/lib/examples/pap/traces/user-with-a-company.json +319 -207
  59. package/lib/models/environments.generated.d.ts +2 -2
  60. package/lib/models/environments.generated.js +1 -1
  61. package/lib/pap/index.d.ts +1 -1
  62. package/lib/pap/index.js +3 -3
  63. package/lib/portable/displays.d.ts +13 -22
  64. package/lib/portable/displays.js +17 -65
  65. package/lib/portable/hosts/approvalRenderers.d.ts +4 -4
  66. package/lib/portable/hosts/approvalRenderers.js +26 -13
  67. package/lib/portable/hosts/contracts.json +5 -2
  68. package/lib/portable/index.d.ts +1 -1
  69. package/lib/portable/index.js +1 -1
  70. package/lib/protocols/decks/index.d.ts +37 -0
  71. package/lib/protocols/decks/index.js +48 -0
  72. package/lib/protocols/decks/pact-a-personal-agent-at-a-business.d.ts +2 -0
  73. package/lib/protocols/decks/pact-a-personal-agent-at-a-business.js +148 -0
  74. package/lib/protocols/decks/ucp-a-purchase-approved.d.ts +2 -0
  75. package/lib/protocols/decks/ucp-a-purchase-approved.js +154 -0
  76. package/lib/specs/actions.d.ts +1 -1
  77. package/lib/specs/actions.js +2 -2
  78. package/lib/specs/agents/agents.js +3 -3
  79. package/lib/specs/apps.d.ts +1 -1
  80. package/lib/specs/apps.js +10 -11
  81. package/lib/specs/appspecSchema.js +4 -112
  82. package/lib/specs/envvars.js +2 -2
  83. package/lib/specs/harnesses.js +9 -9
  84. package/lib/specs/scenes.js +10 -33
  85. package/lib/specs/teams/teams.js +2 -2
  86. package/lib/types/agentspecs.d.ts +91 -127
  87. package/package.json +409 -409
  88. package/scripts/codegen/generate_apps.py +6 -7
  89. package/scripts/validate_pap_examples.py +1 -1
  90. package/lib/examples/PapDpopProofExample.d.ts +0 -4
  91. package/lib/examples/pap/PapDpopProofView.d.ts +0 -4
  92. package/lib/examples/pap/PapDpopProofView.js +0 -61
@@ -27,23 +27,23 @@
27
27
  import type { AppAccent, AppThemeMode, AppThemeVariant, AppAvatar, AppAvatarId, AppAvatarModel3D, AppEmbedMode, PapProfile, AppCustomComponentSpec, AppVoiceSpec, AppKind, AppLayout, AppPageOutputComponent, AppSpec, UiChoice } from '../../types/agentspecs';
28
28
  /** The version of the spec itself. */
29
29
  export declare const APP_SCHEMA = "loop.app/v1";
30
- /** The language an application's own words are in, unless it says (P-26). */
30
+ /** The language an application's own words are in, unless it says. */
31
31
  export declare const DEFAULT_LANGUAGE = "en";
32
32
  /** The face of an application that has not chosen one. */
33
33
  export declare const DEFAULT_EMOJI = "\uD83D\uDC40";
34
34
  export declare const APP_KINDS: AppKind[];
35
35
  export declare const APP_ACCENTS: AppAccent[];
36
36
  /**
37
- * The themes an application may run in (T-30): Appearance's, as
37
+ * The themes an application may run in: Appearance's, as
38
38
  * primer-addons lists them (`themeVariants`), in its order.
39
39
  */
40
40
  export declare const APP_THEME_VARIANTS: AppThemeVariant[];
41
41
  /** The colour modes a theme is worn in. */
42
42
  export declare const APP_THEME_MODES: AppThemeMode[];
43
- /** The four ways an application sits in another product's page (D-07). */
43
+ /** The four ways an application sits in another product's page. */
44
44
  export declare const APP_EMBED_MODES: AppEmbedMode[];
45
45
  /**
46
- * How an Appspec names the avatar of its floating assistant (T-24): the
46
+ * How an Appspec names the avatar of its floating assistant: the
47
47
  * id a plugin contributes it under, `paperclip` or `acme-owl` — as
48
48
  * agentspecs' `ASSISTANT_AVATAR_ID`. Which ids exist is what the enabled
49
49
  * plugins contribute (`assistantCharacterNamed`), not the spec's to say.
@@ -105,7 +105,7 @@ type Data = Record<string, unknown>;
105
105
  export declare function retentionDays(keepFor: string): number;
106
106
  /** An application with nothing said: what *Start blank* opens. */
107
107
  export declare function emptyAppspec(kind?: AppKind): AppSpec;
108
- /** The Personal Agent Protocol profiles Datalayer speaks, as agentspecs' `PAP_PROFILES` (S-03). */
108
+ /** The Personal Agent Protocol profiles Datalayer speaks, as agentspecs' `PAP_PROFILES`. */
109
109
  export declare const PAP_PROFILES: readonly PapProfile[];
110
110
  /** The profile a `pap` block is written for when the Studio or a builder starts one. */
111
111
  export declare const PAP_PROFILE: PapProfile;
@@ -114,16 +114,16 @@ export declare const PAP_PROFILE: PapProfile;
114
114
  * (`pap_profile_problem`); `undefined` when it is one Datalayer speaks.
115
115
  */
116
116
  export declare function papProfileProblem(value: unknown): string | undefined;
117
- /** An application's voice (VO-41): off unless said. */
117
+ /** An application's voice: off unless said. */
118
118
  export declare const DEFAULT_VOICE: AppVoiceSpec;
119
- /** What a page's output may be drawn with (P-05), and the property of each that shows its value. */
119
+ /** What a page's output may be drawn with, and the property of each that shows its value. */
120
120
  export declare const PAGE_OUTPUT_SHOWS: Record<AppPageOutputComponent, string>;
121
- /** The height of a component its developer wrote (P-17), unless it says. */
121
+ /** The height of a component its developer wrote, unless it says. */
122
122
  export declare const DEFAULT_CUSTOM_HEIGHT = 240;
123
123
  /**
124
- * The property a page's output fills with its value (P-05): a catalog
124
+ * The property a page's output fills with its value: a catalog
125
125
  * component's (`PAGE_OUTPUT_SHOWS`), or what a component of the
126
- * application's own shows first (P-17). Undefined for any other.
126
+ * application's own shows first. Undefined for any other.
127
127
  */
128
128
  export declare function pageOutputShows(component: string, own?: readonly AppCustomComponentSpec[]): string | undefined;
129
129
  /** What reading a document gives: the application, and what the document got wrong. */
@@ -150,8 +150,7 @@ export declare function parseAppspec(document: unknown): ParsedAppspec;
150
150
  */
151
151
  export declare function uiProblems(app: Pick<AppSpec, 'ui' | 'enabled'>): string[];
152
152
  /**
153
- * What is wrong with the protocols an application says it speaks
154
- * (PS-02), as agentspecs says it: an id the catalogue does not
153
+ * What is wrong with the protocols an application says it speaks, as agentspecs says it: an id the catalogue does not
155
154
  * know or said twice, a planned protocol while it is offered, and a `pap`,
156
155
  * `pact`, `a2a` or `signed_fetch` block configuring a protocol it does not list.
157
156
  */
@@ -9,7 +9,7 @@ import { UI_RENDERER_CATALOGUE } from '../../specs/uiRenderers.js';
9
9
  import { DEFAULT_MAX_FILES, DEFAULT_UPLOAD_MB } from './uploads.js';
10
10
  /** The version of the spec itself. */
11
11
  export const APP_SCHEMA = 'loop.app/v1';
12
- /** The language an application's own words are in, unless it says (P-26). */
12
+ /** The language an application's own words are in, unless it says. */
13
13
  export const DEFAULT_LANGUAGE = 'en';
14
14
  /** The face of an application that has not chosen one. */
15
15
  export const DEFAULT_EMOJI = '\u{1F440}';
@@ -23,7 +23,7 @@ export const APP_ACCENTS = [
23
23
  'violet',
24
24
  ];
25
25
  /**
26
- * The themes an application may run in (T-30): Appearance's, as
26
+ * The themes an application may run in: Appearance's, as
27
27
  * primer-addons lists them (`themeVariants`), in its order.
28
28
  */
29
29
  export const APP_THEME_VARIANTS = [
@@ -40,7 +40,7 @@ export const APP_THEME_VARIANTS = [
40
40
  ];
41
41
  /** The colour modes a theme is worn in. */
42
42
  export const APP_THEME_MODES = ['light', 'dark', 'auto'];
43
- /** The four ways an application sits in another product's page (D-07). */
43
+ /** The four ways an application sits in another product's page. */
44
44
  export const APP_EMBED_MODES = [
45
45
  'inline',
46
46
  'bubble',
@@ -48,7 +48,7 @@ export const APP_EMBED_MODES = [
48
48
  'assistant',
49
49
  ];
50
50
  /**
51
- * How an Appspec names the avatar of its floating assistant (T-24): the
51
+ * How an Appspec names the avatar of its floating assistant: the
52
52
  * id a plugin contributes it under, `paperclip` or `acme-owl` — as
53
53
  * agentspecs' `ASSISTANT_AVATAR_ID`. Which ids exist is what the enabled
54
54
  * plugins contribute (`assistantCharacterNamed`), not the spec's to say.
@@ -188,7 +188,7 @@ const uiShapeProblems = (value) => Array.isArray(value)
188
188
  : '.'))
189
189
  : [];
190
190
  /**
191
- * One turn of a test's conversation as its document says it (E-01):
191
+ * One turn of a test's conversation as its document says it:
192
192
  * what it says, chooses or presses, with a press's payload; nothing it does
193
193
  * not say.
194
194
  */
@@ -327,9 +327,9 @@ const KNOWN_KEYS = [
327
327
  'avatar',
328
328
  'banner',
329
329
  ];
330
- /** Where a check of its code runs (P-06). */
330
+ /** Where a check of its code runs. */
331
331
  const CHECK_STAGES = ['answer', 'tool_call'];
332
- /** A tool of its own, written in its code (P-06); a wrong one is said by the checks. */
332
+ /** A tool of its own, written in its code; a wrong one is said by the checks. */
333
333
  function parseTool(data) {
334
334
  return {
335
335
  name: text(data.name),
@@ -348,7 +348,7 @@ function parseConnection(data) {
348
348
  only: texts(data.only),
349
349
  };
350
350
  }
351
- /** The Personal Agent Protocol profiles Datalayer speaks, as agentspecs' `PAP_PROFILES` (S-03). */
351
+ /** The Personal Agent Protocol profiles Datalayer speaks, as agentspecs' `PAP_PROFILES`. */
352
352
  export const PAP_PROFILES = ['draft-01'];
353
353
  /** The profile a `pap` block is written for when the Studio or a builder starts one. */
354
354
  export const PAP_PROFILE = PAP_PROFILES[PAP_PROFILES.length - 1];
@@ -376,7 +376,7 @@ const enumsOf = (value, allowed, otherwise) => {
376
376
  return value.filter((item) => allowed.includes(item));
377
377
  };
378
378
  /**
379
- * Personal Agent Protocol (S-01): the companies the
379
+ * Personal Agent Protocol: the companies the
380
380
  * application works with, and whether it is one. Defaults are agentspecs'.
381
381
  */
382
382
  function parsePap(data) {
@@ -410,11 +410,7 @@ function parsePap(data) {
410
410
  operations: records(company.operations).map(operation => ({
411
411
  action: text(operation.action),
412
412
  tool: text(operation.tool),
413
- ...(isData(operation.allows)
414
- ? { allows: parsePapStanding(operation.allows) }
415
- : {}),
416
413
  summary: text(operation.summary),
417
- userApprovalRequired: flag(operation.user_approval_required, true),
418
414
  })),
419
415
  },
420
416
  };
@@ -490,38 +486,6 @@ function dumpPapExcludedTask(task) {
490
486
  : {}),
491
487
  };
492
488
  }
493
- /** A standing permission an operation gives (R-07), as agentspecs reads it. */
494
- function parsePapStanding(data) {
495
- return {
496
- connection: text(data.connection),
497
- action: oneOf(data.action, ['write', 'buy'], 'buy'),
498
- limits: records(data.limits).map(limit => ({
499
- path: text(limit.path),
500
- ...(typeof limit.maximum === 'string'
501
- ? { maximum: text(limit.maximum) }
502
- : {}),
503
- ...(typeof limit.allowed === 'string'
504
- ? { allowed: text(limit.allowed) }
505
- : {}),
506
- })),
507
- uses: text(data.uses),
508
- days: text(data.days),
509
- };
510
- }
511
- /** A standing permission as its document says it: every field, none has a default. */
512
- function dumpPapStanding(standing) {
513
- return {
514
- connection: standing.connection,
515
- action: standing.action,
516
- limits: standing.limits.map(limit => ({
517
- path: limit.path,
518
- ...(limit.maximum !== undefined ? { maximum: limit.maximum } : {}),
519
- ...(limit.allowed !== undefined ? { allowed: limit.allowed } : {}),
520
- })),
521
- uses: standing.uses,
522
- days: standing.days,
523
- };
524
- }
525
489
  /** Personal Agent Protocol as its document says it, nothing at its default. */
526
490
  function dumpPap(pap) {
527
491
  if (!pap)
@@ -550,15 +514,10 @@ function dumpPap(pap) {
550
514
  .list('registered_agents', pap.company.registeredAgents)
551
515
  .list('operations', pap.company.operations.map(operation => new Writer()
552
516
  .text('action', operation.action, '\u0000')
553
- // An operation that allows a standing permission calls no tool (R-07).
554
- .text('tool', operation.tool, operation.allows ? '' : '\u0000')
555
- .present('allows', operation.allows
556
- ? dumpPapStanding(operation.allows)
557
- : undefined)
558
- .text('summary', operation.summary, '\u0000')
559
- .value('user_approval_required', operation.userApprovalRequired, true).data)).data).data;
517
+ .text('tool', operation.tool, '\u0000')
518
+ .text('summary', operation.summary, '\u0000').data)).data).data;
560
519
  }
561
- /** PACT (PI-01): the businesses it asks for each person, and as one (PR-13). */
520
+ /** PACT: the businesses it asks for each person, and as one. */
562
521
  function parsePact(data) {
563
522
  const business = isData(data.business) ? data.business : {};
564
523
  const scopes = {};
@@ -586,7 +545,7 @@ function parsePact(data) {
586
545
  },
587
546
  };
588
547
  }
589
- /** Commerce (PI-01): the merchants it shops at for each person. */
548
+ /** Commerce: the merchants it shops at for each person. */
590
549
  function parseCommerce(data) {
591
550
  return {
592
551
  merchants: records(data.merchants).map(merchant => ({
@@ -621,7 +580,7 @@ function dumpCommerce(commerce) {
621
580
  }
622
581
  : {}).data)).data;
623
582
  }
624
- /** Signed fetch (EX-11): the exact sites it reads pages of, each request signed. */
583
+ /** Signed fetch: the exact sites it reads pages of, each request signed. */
625
584
  function parseSignedFetch(data) {
626
585
  return {
627
586
  sites: records(data.sites).map(site => ({
@@ -638,7 +597,7 @@ function dumpSignedFetch(signedFetch) {
638
597
  .text('id', site.id, '\u0000')
639
598
  .text('site', site.site, '\u0000').data)).data;
640
599
  }
641
- /** One of a pair of examples (PR-13): its id and its side, or a problem. */
600
+ /** One of a pair of examples: its id and its side, or a problem. */
642
601
  function parsePair(data) {
643
602
  const id = text(data.id);
644
603
  const role = text(data.role);
@@ -675,7 +634,7 @@ function dumpPact(pact) {
675
634
  .text('issuer', agent.issuer, '\u0000')
676
635
  .text('jwks_uri', agent.jwksUri, '\u0000').data)).data).data;
677
636
  }
678
- /** A2A (PR-02): the extensions its Agent Card advertises. */
637
+ /** A2A: the extensions its Agent Card advertises. */
679
638
  function parseA2A(data) {
680
639
  return {
681
640
  extensions: records(data.extensions).map(extension => ({
@@ -705,8 +664,8 @@ function parseRule(data) {
705
664
  behaviour: oneOf(data.behaviour, BEHAVIOURS, 'ask_first'),
706
665
  };
707
666
  }
708
- /** A slash command (P-19); a wrong one is said by the checks. */
709
- /** An action of its code, typed (RU-5): its payload's schema kept as written. */
667
+ /** A slash command; a wrong one is said by the checks. */
668
+ /** An action of its code, typed: its payload's schema kept as written. */
710
669
  function parseAction(data) {
711
670
  const action = { name: text(data.name) };
712
671
  if (text(data.description)) {
@@ -737,7 +696,7 @@ function parseModeOption(data) {
737
696
  }
738
697
  return option;
739
698
  }
740
- /** A mode switch (P-19). */
699
+ /** A mode switch. */
741
700
  function parseMode(data) {
742
701
  const mode = {
743
702
  id: text(data.id),
@@ -749,7 +708,7 @@ function parseMode(data) {
749
708
  }
750
709
  return mode;
751
710
  }
752
- /** A starter, its category said only when it has one (P-20). */
711
+ /** A starter, its category said only when it has one. */
753
712
  function parseStarter(data) {
754
713
  const starter = {
755
714
  label: text(data.label),
@@ -760,7 +719,7 @@ function parseStarter(data) {
760
719
  }
761
720
  return starter;
762
721
  }
763
- /** One of several assistants in one application (P-20). */
722
+ /** One of several assistants in one application. */
764
723
  function parseProfile(data) {
765
724
  return {
766
725
  id: text(data.id),
@@ -780,7 +739,7 @@ function recordsBy(value) {
780
739
  return Object.fromEntries(Object.entries(isData(value) ? value : {}).filter((entry) => isData(entry[1])));
781
740
  }
782
741
  const mapValues = (value, map) => Object.fromEntries(Object.entries(value).map(([key, item]) => [key, map(item)]));
783
- /** An application's words in one other language (P-26), every key present. */
742
+ /** An application's words in one other language, every key present. */
784
743
  function parseTranslation(data) {
785
744
  return {
786
745
  name: text(data.name),
@@ -819,7 +778,7 @@ function parseSurface(data) {
819
778
  composedAt: text(data.composed_at),
820
779
  };
821
780
  }
822
- /** An application's voice (VO-41): off unless said. */
781
+ /** An application's voice: off unless said. */
823
782
  export const DEFAULT_VOICE = {
824
783
  enabled: false,
825
784
  input: 'push_to_talk',
@@ -839,7 +798,7 @@ function parseVoice(data) {
839
798
  where: oneOf(voice.where, ['auto', 'device', 'server'], DEFAULT_VOICE.where),
840
799
  };
841
800
  }
842
- /** What a person may send without being asked (P-21), as the spec says it. */
801
+ /** What a person may send without being asked, as the spec says it. */
843
802
  function parseUploads(data) {
844
803
  return {
845
804
  kinds: records(data.kinds).map(kind => ({
@@ -849,17 +808,17 @@ function parseUploads(data) {
849
808
  maxFiles: numberOf(data.max_files, DEFAULT_MAX_FILES),
850
809
  };
851
810
  }
852
- /** What a page's output may be drawn with (P-05), and the property of each that shows its value. */
811
+ /** What a page's output may be drawn with, and the property of each that shows its value. */
853
812
  export const PAGE_OUTPUT_SHOWS = {
854
813
  Text: 'text',
855
814
  Image: 'url',
856
815
  Table: 'rows',
857
816
  Chart: 'points',
858
817
  };
859
- /** The height of a component its developer wrote (P-17), unless it says. */
818
+ /** The height of a component its developer wrote, unless it says. */
860
819
  export const DEFAULT_CUSTOM_HEIGHT = 240;
861
820
  /**
862
- * A component its developer wrote (P-17), as written: its schema and
821
+ * A component its developer wrote, as written: its schema and
863
822
  * example kept whole, so that the checks say what is wrong with them.
864
823
  */
865
824
  function parseCustomComponent(data) {
@@ -897,9 +856,9 @@ function dumpCustomComponent(component) {
897
856
  return written.data;
898
857
  }
899
858
  /**
900
- * The property a page's output fills with its value (P-05): a catalog
859
+ * The property a page's output fills with its value: a catalog
901
860
  * component's (`PAGE_OUTPUT_SHOWS`), or what a component of the
902
- * application's own shows first (P-17). Undefined for any other.
861
+ * application's own shows first. Undefined for any other.
903
862
  */
904
863
  export function pageOutputShows(component, own = []) {
905
864
  if (component in PAGE_OUTPUT_SHOWS) {
@@ -908,7 +867,7 @@ export function pageOutputShows(component, own = []) {
908
867
  return own.find(each => each.name === component)?.shows[0];
909
868
  }
910
869
  /**
911
- * A widget's page written in its code (P-05), as written: its inputs a form
870
+ * A widget's page written in its code, as written: its inputs a form
912
871
  * kept whole, an output drawn with another component kept as written so that
913
872
  * the checks say it.
914
873
  */
@@ -966,13 +925,13 @@ function parseInterface(data, kind) {
966
925
  voice: parseVoice(data.voice),
967
926
  outputs: texts(data.outputs),
968
927
  };
969
- // Its settings are the JSON Schema of a form (C-16), kept as written: what
928
+ // Its settings are the JSON Schema of a form, kept as written: what
970
929
  // is not one — the list of settings of earlier versions among it — is not
971
930
  // read, and is said by the checks.
972
931
  if (isData(data.settings)) {
973
932
  parsed.settings = JSON.parse(JSON.stringify(data.settings));
974
933
  }
975
- // How its settings' fields are drawn (P-20), kept as written: a wrong
934
+ // How its settings' fields are drawn, kept as written: a wrong
976
935
  // widget is said by the checks.
977
936
  if (isData(data.settings_ui)) {
978
937
  parsed.settingsUi = JSON.parse(JSON.stringify(data.settings_ui));
@@ -980,7 +939,7 @@ function parseInterface(data, kind) {
980
939
  if (isData(data.uploads)) {
981
940
  parsed.uploads = parseUploads(data.uploads);
982
941
  }
983
- // Components its developer wrote (P-17): absent when it has none.
942
+ // Components its developer wrote: absent when it has none.
984
943
  if (Array.isArray(data.custom_components)) {
985
944
  parsed.customComponents = records(data.custom_components).map(parseCustomComponent);
986
945
  }
@@ -1035,7 +994,7 @@ function parseDecision(data) {
1035
994
  decisionModel: text(data.decision_model),
1036
995
  };
1037
996
  }
1038
- /** What it is tried on before it is anybody's (E-06, E-11): read only. */
997
+ /** What it is tried on before it is anybody's: read only. */
1039
998
  function parseSamples(data) {
1040
999
  return {
1041
1000
  documents: records(data.documents).map(document => ({
@@ -1068,7 +1027,7 @@ function parseDeployment(data) {
1068
1027
  host: {
1069
1028
  context: texts(data.embedded.host.context),
1070
1029
  // Kept as written when said: a value that is none is refused
1071
- // by the checks, never read as `claimed` (D-21).
1030
+ // by the checks, never read as `claimed`.
1072
1031
  ...(data.embedded.host.user !== undefined
1073
1032
  ? { user: text(data.embedded.host.user) }
1074
1033
  : {}),
@@ -1136,7 +1095,7 @@ export function parseAppspec(document) {
1136
1095
  const verified = isData(tests.verified) ? tests.verified : {};
1137
1096
  const record = isData(data.record) ? data.record : {};
1138
1097
  const checks = isData(data.checks) ? data.checks : {};
1139
- // A check of its code runs on an answer or a tool call (P-06).
1098
+ // A check of its code runs on an answer or a tool call.
1140
1099
  for (const check of records(checks.code)) {
1141
1100
  if (!CHECK_STAGES.includes(check.on)) {
1142
1101
  problems.push(`The check \`${text(check.name)}\` of its code runs on answer or tool_call, not \`${String(check.on)}\`.`);
@@ -1194,12 +1153,12 @@ export function parseAppspec(document) {
1194
1153
  evalset: text(tests.evalset),
1195
1154
  cases: records(tests.cases).map(testCase => ({
1196
1155
  ask: text(testCase.ask),
1197
- // A conversation, turn by turn, when it is one (E-01).
1156
+ // A conversation, turn by turn, when it is one.
1198
1157
  ...(records(testCase.turns).length
1199
1158
  ? { turns: records(testCase.turns).map(parseTestTurn) }
1200
1159
  : {}),
1201
1160
  expect: text(testCase.expect),
1202
- // Decided by its code (P-06), when it names the function.
1161
+ // Decided by its code, when it names the function.
1203
1162
  ...(text(testCase.code) ? { code: text(testCase.code) } : {}),
1204
1163
  // Given files with what it is asked, when it is.
1205
1164
  ...(records(testCase.files).length
@@ -1253,7 +1212,7 @@ export function parseAppspec(document) {
1253
1212
  app.decision = parseDecision(data.decision);
1254
1213
  }
1255
1214
  // A `pap` block names a profile Datalayer speaks, or it is refused and not
1256
- // read (S-03); a block saying nothing is no block.
1215
+ // read; a block saying nothing is no block.
1257
1216
  if (isData(data.pap) && Object.keys(data.pap).length > 0) {
1258
1217
  const problem = papProfileProblem(data.pap.profile);
1259
1218
  if (problem) {
@@ -1332,8 +1291,7 @@ export function uiProblems(app) {
1332
1291
  return problems;
1333
1292
  }
1334
1293
  /**
1335
- * What is wrong with the protocols an application says it speaks
1336
- * (PS-02), as agentspecs says it: an id the catalogue does not
1294
+ * What is wrong with the protocols an application says it speaks, as agentspecs says it: an id the catalogue does not
1337
1295
  * know or said twice, a planned protocol while it is offered, and a `pap`,
1338
1296
  * `pact`, `a2a` or `signed_fetch` block configuring a protocol it does not list.
1339
1297
  */
@@ -1445,7 +1403,7 @@ function dumpStarter(starter) {
1445
1403
  }
1446
1404
  /** Words by key, what is empty left out. */
1447
1405
  const saidWords = (words) => Object.fromEntries(Object.entries(words).filter(([, said]) => said !== ''));
1448
- /** One translation as it is written (P-26): only what it says. */
1406
+ /** One translation as it is written: only what it says. */
1449
1407
  function dumpTranslation(words) {
1450
1408
  const parts = (value, dump) => Object.fromEntries(Object.entries(value).map(([key, item]) => [key, dump(item)]));
1451
1409
  return new Writer()
@@ -1512,14 +1470,14 @@ function dumpInterface(spec, kind) {
1512
1470
  .text('model', profile.model ?? '')
1513
1471
  .list('starters', profile.starters.map(dumpStarter)).data))
1514
1472
  .part('settings', spec.settings ? { ...spec.settings } : {});
1515
- // How its settings' fields are drawn (P-20): written when said.
1473
+ // How its settings' fields are drawn: written when said.
1516
1474
  if (spec.settingsUi) {
1517
1475
  writer.data.settings_ui = { ...spec.settingsUi };
1518
1476
  }
1519
1477
  writer
1520
1478
  .text('language', spec.language ?? DEFAULT_LANGUAGE, DEFAULT_LANGUAGE)
1521
1479
  .part('translations', mapValues(spec.translations ?? {}, dumpTranslation));
1522
- // What a person may send without being asked (P-21): written when said.
1480
+ // What a person may send without being asked: written when said.
1523
1481
  if (spec.uploads) {
1524
1482
  writer.data.uploads = new Writer()
1525
1483
  .list('kinds', spec.uploads.kinds.map(kind => new Writer()
@@ -1547,7 +1505,7 @@ function dumpInterface(spec, kind) {
1547
1505
  ? { variant: spec.theme.variant, mode: spec.theme.mode }
1548
1506
  : { variant: spec.theme.variant };
1549
1507
  }
1550
- // Its voice, when it says one (VO-41): a spec made before voice has none.
1508
+ // Its voice, when it says one: a spec made before voice has none.
1551
1509
  if (spec.voice) {
1552
1510
  writer.part('voice', new Writer()
1553
1511
  .value('enabled', spec.voice.enabled, DEFAULT_VOICE.enabled)
@@ -1672,7 +1630,7 @@ export function dumpAppspec(app) {
1672
1630
  .value('ready_at', app.tests.readyAt, DEFAULT_READY_AT)
1673
1631
  .text('evalset', app.tests.evalset)
1674
1632
  .list('cases', app.tests.cases.map(testCase => ({
1675
- // One message, or a conversation in its place (E-01).
1633
+ // One message, or a conversation in its place.
1676
1634
  ...(testCase.turns?.length
1677
1635
  ? {
1678
1636
  turns: testCase.turns.map(turn => parseTestTurn({ ...turn })),
@@ -46,7 +46,7 @@ export function ToolApprovalCard({ approval, onApprove, onReject, onToggleRead,
46
46
  return (
47
47
  // primer-addons' Card, as the other pages' rows: an unread request is the
48
48
  // selected one (an accent border on an accent wash).
49
- _jsx(Card, { border: true, shadow: "none", display: "block", p: 3, selected: !isRead, children: _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: 3, children: [_jsxs(Box, { flex: 1, minWidth: 0, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, mb: 1, flexWrap: "wrap", children: [_jsx(Text, { sx: { fontWeight: 'bold', fontSize: 2 }, children: approval.toolName }), _jsx(Label, { variant: statusConfig.variant, children: statusConfig.label }), _jsx(Label, { variant: riskConfig.variant, children: riskConfig.label }), !isRead && _jsx(Label, { variant: "accent", children: "Unread" })] }), _jsxs(Text, { sx: { color: 'fg.muted', fontSize: 0, display: 'block' }, children: ["Requested by ", approval.requestedBy, ' ', formatRelativeTime(approval.requestedAt), reviewSummary] }), _jsx(Box, { mt: 2, width: "100%", p: 2, borderRadius: 2, border: "1px solid", borderColor: "border.muted", bg: "canvas.subtle", children: _jsxs("details", { open: isDetailsExpanded, children: [_jsx("summary", { onClick: e => {
49
+ _jsx(Card, { border: true, shadow: "none", display: "block", p: 3, selected: !isRead, children: _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: 3, children: [_jsxs(Box, { flex: 1, minWidth: 0, children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, mb: 1, flexWrap: "wrap", children: [_jsx(Text, { sx: { fontWeight: 'bold', fontSize: 2 }, children: approval.toolName }), _jsx(Label, { variant: statusConfig.variant, children: statusConfig.label }), _jsx(Label, { variant: riskConfig.variant, children: riskConfig.label }), !isRead && _jsx(Label, { variant: "accent", children: "Unread" })] }), _jsxs(Text, { sx: { color: 'fg.muted', fontSize: 0, display: 'block' }, children: ["Requested by ", approval.requestedBy, ' ', formatRelativeTime(approval.requestedAt), reviewSummary] }), _jsx(Card, { border: true, shadow: "none", variant: "accent", display: "block", mt: 2, width: "100%", p: 2, children: _jsxs("details", { open: isDetailsExpanded, children: [_jsx("summary", { onClick: e => {
50
50
  e.preventDefault();
51
51
  setIsDetailsExpanded(prev => !prev);
52
52
  }, style: {
@@ -54,6 +54,8 @@ export function ToolApprovalCard({ approval, onApprove, onReject, onToggleRead,
54
54
  display: 'flex',
55
55
  alignItems: 'center',
56
56
  minWidth: 0,
57
- }, children: _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, children: [_jsx(Box, { display: "flex", alignItems: "center", color: "fg.muted", transition: "transform 0.15s ease", transform: isDetailsExpanded ? 'rotate(180deg)' : 'rotate(0deg)', children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: { fontSize: 0, fontWeight: 'semibold' }, children: "View details" })] }) }), _jsxs(Box, { mt: 2, display: "grid", gap: 1, children: [_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Source:", ' '] }), _jsxs(Text, { as: "span", sx: detailValueSx, children: [approval.sourceName, " (", approval.sourceType, ")"] })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Request ID:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.id })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Requested at:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: new Date(approval.requestedAt).toLocaleString() })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Requested by:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.requestedBy })] }), approval.reviewedAt && (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Reviewed at:", ' '] }), _jsxs(Text, { as: "span", sx: detailValueSx, children: [new Date(approval.reviewedAt).toLocaleString(), " by", ' ', approval.reviewedBy || 'reviewer'] })] })), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Parameters:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: parameterCount })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Reason:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.reason || approval.toolDescription })] })] }), parameterCount > 0 && (_jsx(Box, { mt: 2, display: "grid", gap: 1, children: Object.entries(approval.parameters || {}).map(([key, value]) => (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: [key, ":", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: String(value) })] }, key))) }))] }) })] }), approval.status === 'pending' && (_jsxs(Box, { display: "flex", gap: 2, flexShrink: 0, children: [_jsx(Button, { size: "small", variant: "primary", leadingVisual: CheckCircleIcon, onClick: () => onApprove?.(approval.id), children: "Approve" }), _jsx(Button, { size: "small", variant: "danger", leadingVisual: XCircleIcon, onClick: () => onReject?.(approval.id), children: "Reject" })] })), _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, flexShrink: 0, children: [_jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead?.(approval.id, isRead), sx: { p: 1 }, title: `Mark as ${isRead ? 'unread' : 'read'}`, "aria-label": `Mark as ${isRead ? 'unread' : 'read'}`, children: isRead ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete?.(approval.id), sx: { p: 1, color: 'danger.fg' }, title: "Delete", "aria-label": "Delete", children: _jsx(TrashIcon, { size: 12 }) })] })] }) }));
57
+ }, children: _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, children: [_jsx(Box, { display: "flex", alignItems: "center", color: "fg.muted", transition: "transform 0.15s ease", transform: isDetailsExpanded ? 'rotate(180deg)' : 'rotate(0deg)', children: _jsx(ChevronDownIcon, { size: 12 }) }), _jsx(Text, { sx: { fontSize: 0, fontWeight: 'semibold' }, children: "View details" })] }) }), _jsxs(Box, { mt: 2, display: "grid", gap: 1, children: [_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Source:", ' '] }), _jsxs(Text, { as: "span", sx: detailValueSx, children: [approval.sourceName, " (", approval.sourceType, ")"] })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Request ID:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.id })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Requested at:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: new Date(approval.requestedAt).toLocaleString() })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Requested by:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.requestedBy })] }), approval.reviewedAt && (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Reviewed at:", ' '] }), _jsxs(Text, { as: "span", sx: detailValueSx, children: [new Date(approval.reviewedAt).toLocaleString(), " by", ' ', approval.reviewedBy || 'reviewer'] })] })), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Parameters:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: parameterCount })] }), _jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: ["Reason:", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: approval.reason || approval.toolDescription })] })] }), parameterCount > 0 && (_jsx(Box, { mt: 2, display: "grid", gap: 1, children: Object.entries(approval.parameters || {}).map(([key, value]) => (_jsxs(Text, { sx: detailLineSx, children: [_jsxs(Text, { as: "span", sx: detailLabelSx, children: [key, ":", ' '] }), _jsx(Text, { as: "span", sx: detailValueSx, children: typeof value === 'object' && value !== null
58
+ ? JSON.stringify(value)
59
+ : String(value) })] }, key))) }))] }) })] }), approval.status === 'pending' && (_jsxs(Box, { display: "flex", gap: 2, flexShrink: 0, children: [_jsx(Button, { size: "small", variant: "primary", leadingVisual: CheckCircleIcon, onClick: () => onApprove?.(approval.id), children: "Approve" }), _jsx(Button, { size: "small", variant: "danger", leadingVisual: XCircleIcon, onClick: () => onReject?.(approval.id), children: "Reject" })] })), _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, flexShrink: 0, children: [_jsx(Button, { size: "small", variant: "invisible", onClick: () => onToggleRead?.(approval.id, isRead), sx: { p: 1 }, title: `Mark as ${isRead ? 'unread' : 'read'}`, "aria-label": `Mark as ${isRead ? 'unread' : 'read'}`, children: isRead ? _jsx(EyeClosedIcon, { size: 12 }) : _jsx(EyeIcon, { size: 12 }) }), _jsx(Button, { size: "small", variant: "invisible", onClick: () => onDelete?.(approval.id), sx: { p: 1, color: 'danger.fg' }, title: "Delete", "aria-label": "Delete", children: _jsx(TrashIcon, { size: 12 }) })] })] }) }));
58
60
  }
59
61
  export default ToolApprovalCard;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A harness's mark, from Datalayer's icons.
3
+ *
4
+ * @module components/teams/HarnessIcon
5
+ */
6
+ import type { JSX } from 'react';
7
+ /** A harness's mark; the agent's own for one that has none. */
8
+ export declare function HarnessIcon({ id, size, }: {
9
+ id: string;
10
+ size?: number;
11
+ }): JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { AiAgentIcon, ClaudeCodeIcon, CodexIcon, GeminiCliIcon, GooseIcon, OpencodeIcon, OpenhandsIcon, PiCodingAgentIcon, PydanticIcon, } from '@datalayer/icons-react';
3
+ const HARNESS_ICONS = {
4
+ 'claude-code': ClaudeCodeIcon,
5
+ codex: CodexIcon,
6
+ 'gemini-cli': GeminiCliIcon,
7
+ goose: GooseIcon,
8
+ opencode: OpencodeIcon,
9
+ openhands: OpenhandsIcon,
10
+ pi: PiCodingAgentIcon,
11
+ 'pydantic-ai': PydanticIcon,
12
+ };
13
+ /** A harness's mark; the agent's own for one that has none. */
14
+ export function HarnessIcon({ id, size = 14, }) {
15
+ const Icon = HARNESS_ICONS[id] ?? AiAgentIcon;
16
+ return _jsx(Icon, { size: size });
17
+ }
@@ -25,7 +25,7 @@ export type SceneTranscriptProps = {
25
25
  writeText?: (text: string) => Promise<void>;
26
26
  /** The selected line's key: drawn marked (SCENES S2-03). */
27
27
  selected?: string | null;
28
- /** A line was clicked: its key. */
28
+ /** A line was clicked, or its time's button pressed: its key. */
29
29
  onSelect?: (key: string) => void;
30
30
  };
31
31
  /** The transcript as a list of lines, newest last, with *Copy as text*. */
@@ -4,6 +4,7 @@ import { Button, Text } from '@primer/react';
4
4
  import { Box } from '@datalayer/primer-addons';
5
5
  import { useOtelLiveSpans } from '@datalayer/core/lib/otel/live/index.js';
6
6
  import { ChatMarkdown } from '../../chat/messages/ChatMarkdown.js';
7
+ import { LineSelect } from './transcript/LineSelect.js';
7
8
  import { lineHeading, timeText, transcriptOfSpans, transcriptText, } from './sceneTranscriptRules.js';
8
9
  /** The transcript of a tracer's spans, kept current as they change. */
9
10
  export function useSceneTranscript(tracer, members) {
@@ -12,6 +13,16 @@ export function useSceneTranscript(tracer, members) {
12
13
  }
13
14
  /** How long *Copied* stays, in milliseconds. */
14
15
  const COPIED_MS = 1500;
16
+ /** A line's time, as a clock reads it. */
17
+ function LineTime({ at }) {
18
+ return (_jsx(Text, { as: "time", sx: {
19
+ color: 'fg.muted',
20
+ fontFamily: 'mono',
21
+ fontSize: 0,
22
+ pt: '2px',
23
+ whiteSpace: 'nowrap',
24
+ }, dateTime: new Date(at).toISOString(), children: timeText(at) }));
25
+ }
15
26
  /** The transcript as a list of lines, newest last, with *Copy as text*. */
16
27
  export function SceneTranscript({ lines, emptyText = 'What the scene says and does shows here, line by line.', maxHeight, copy = true, writeText, selected, onSelect, }) {
17
28
  const [copied, setCopied] = useState(false);
@@ -27,13 +38,7 @@ export function SceneTranscript({ lines, emptyText = 'What the scene says and do
27
38
  // The clipboard refused: nothing to say but the text, still on screen.
28
39
  }
29
40
  };
30
- return (_jsxs(Box, { "data-scene-transcript": "", "data-scene-lines": lines.length, children: [lines.length === 0 ? (_jsx(Text, { as: "p", sx: { color: 'fg.muted', fontSize: 1, m: 0 }, children: emptyText })) : (_jsx(Box, { as: "ol", "aria-label": "Transcript", listStyle: "none", m: 0, p: 0, fontSize: 1, sx: maxHeight ? { maxHeight, overflowY: 'auto' } : {}, children: lines.map(line => (_jsxs(Box, { as: "li", "data-transcript-line": line.kind, "data-transcript-from": line.from, "data-transcript-to": line.to, "aria-busy": line.open ? 'true' : undefined, "aria-selected": onSelect ? selected === line.key : undefined, onClick: onSelect ? () => onSelect(line.key) : undefined, bg: selected === line.key ? 'accent.subtle' : undefined, display: "grid", gridTemplateColumns: "auto 1fr", gap: 2, py: 1, borderBottom: "1px solid", borderColor: "border.muted", opacity: line.open ? 0.75 : 1, sx: onSelect ? { cursor: 'pointer' } : undefined, children: [_jsx(Text, { as: "time", sx: {
31
- color: 'fg.muted',
32
- fontFamily: 'mono',
33
- fontSize: 0,
34
- pt: '2px',
35
- whiteSpace: 'nowrap',
36
- }, dateTime: new Date(line.at).toISOString(), children: timeText(line.at) }), line.kind === 'called' ? (_jsxs(Box, { minWidth: 0, overflowWrap: "anywhere", children: [_jsxs(Text, { sx: { fontWeight: 600 }, children: [lineHeading(line), ": "] }), _jsxs(Text, { sx: {
41
+ return (_jsxs(Box, { "data-scene-transcript": "", "data-scene-lines": lines.length, children: [lines.length === 0 ? (_jsx(Text, { as: "p", sx: { color: 'fg.muted', fontSize: 1, m: 0 }, children: emptyText })) : (_jsx(Box, { as: "ol", "aria-label": "Transcript", listStyle: "none", m: 0, p: 0, fontSize: 1, sx: maxHeight ? { maxHeight, overflowY: 'auto' } : {}, children: lines.map(line => (_jsxs(Box, { as: "li", "data-transcript-line": line.kind, "data-transcript-from": line.from, "data-transcript-to": line.to, "aria-busy": line.open ? 'true' : undefined, "aria-current": selected === line.key ? 'true' : undefined, onClick: onSelect ? () => onSelect(line.key) : undefined, bg: selected === line.key ? 'accent.subtle' : undefined, display: "grid", gridTemplateColumns: "auto 1fr", gap: 2, py: 1, borderBottom: "1px solid", borderColor: "border.muted", opacity: line.open ? 0.75 : 1, sx: onSelect ? { cursor: 'pointer' } : undefined, children: [onSelect ? (_jsx(LineSelect, { label: `Select ${lineHeading(line)} at ${timeText(line.at)}`, selected: selected === line.key, children: _jsx(LineTime, { at: line.at }) })) : (_jsx(LineTime, { at: line.at })), line.kind === 'called' ? (_jsxs(Box, { minWidth: 0, overflowWrap: "anywhere", children: [_jsxs(Text, { sx: { fontWeight: 600 }, children: [lineHeading(line), ": "] }), _jsxs(Text, { sx: {
37
42
  fontFamily: 'mono',
38
43
  color: line.failed ? 'danger.fg' : undefined,
39
44
  }, children: [line.text, line.open ? '…' : '', line.failed ? ' (failed)' : ''] })] })) : (
@@ -43,11 +43,17 @@ export type SceneViewProps = {
43
43
  aside?: ReactNode;
44
44
  /** The scene, by id: the transcript's export is named after it. */
45
45
  scene?: string;
46
+ /**
47
+ * The selected line's key, held by the page; with `onSelect`. The transcript
48
+ * is mounted only while it shows: held here, a line selected from the graph
49
+ * is there when it opens.
50
+ */
51
+ selected?: string | null;
46
52
  /** The selected line changed (SCENES S3-02): the page hands the stage its edge (`selectedEdgeOf`). */
47
53
  onSelect?: (selection: TranscriptSelection | null) => void;
48
54
  /** The Inspector's page for a span, when the site has one. */
49
55
  inspectorHref?: (ids: TranscriptSpanIds) => string | undefined;
50
56
  };
51
57
  /** The graph and the transcript of a scene, behind a *Graph · Transcript* toggle. */
52
- export declare function SceneView({ children, members, tracer, lines, defaultView, view, onViewChange, emptyText, maxHeight, aside, scene, onSelect, inspectorHref, }: SceneViewProps): JSX.Element;
58
+ export declare function SceneView({ children, members, tracer, lines, defaultView, view, onViewChange, emptyText, maxHeight, aside, scene, selected, onSelect, inspectorHref, }: SceneViewProps): JSX.Element;
53
59
  export default SceneView;
@@ -7,7 +7,7 @@ import { useSceneTranscript } from './SceneTranscript.js';
7
7
  import { TranscriptViews } from './transcript/TranscriptViews.js';
8
8
  const NO_MEMBERS = [];
9
9
  /** The graph and the transcript of a scene, behind a *Graph · Transcript* toggle. */
10
- export function SceneView({ children, members = NO_MEMBERS, tracer, lines, defaultView = 'graph', view, onViewChange, emptyText, maxHeight = 360, aside, scene, onSelect, inspectorHref, }) {
10
+ export function SceneView({ children, members = NO_MEMBERS, tracer, lines, defaultView = 'graph', view, onViewChange, emptyText, maxHeight = 360, aside, scene, selected, onSelect, inspectorHref, }) {
11
11
  const [own, setOwn] = useState(defaultView);
12
12
  // *Open in the Inspector*: the Agent Inspector over the page, on the tracer's record.
13
13
  const [inspecting, setInspecting] = useState(false);
@@ -20,6 +20,6 @@ export function SceneView({ children, members = NO_MEMBERS, tracer, lines, defau
20
20
  const transcript = lines ?? live;
21
21
  return (_jsxs(Box, { "data-scene-view": shown, children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 2, flexWrap: "wrap", mb: 2, children: [_jsxs(SegmentedControl, { "aria-label": "Scene view", size: "small", children: [_jsx(SegmentedControl.Button, { selected: shown === 'graph', onClick: () => choose('graph'), "data-scene-choice": "graph", children: "Graph" }), _jsx(SegmentedControl.Button, { selected: shown === 'transcript', onClick: () => choose('transcript'), "data-scene-choice": "transcript", children: transcript.length
22
22
  ? `Transcript (${transcript.length})`
23
- : 'Transcript' })] }), aside] }), _jsx(Box, { hidden: shown !== 'graph', "data-scene-graph": "", children: children }), shown === 'transcript' && (_jsx(TranscriptViews, { lines: transcript, members: members, tracer: lines ? null : tracer, recorded: Boolean(lines), scene: scene, emptyText: emptyText, maxHeight: maxHeight, onSelect: onSelect, inspectorHref: inspectorHref, onOpenInspector: tracer && !lines ? () => setInspecting(true) : undefined })), inspecting && tracer && (_jsx(AgentInspectorDialog, { tracer: tracer, onClose: () => setInspecting(false) }))] }));
23
+ : 'Transcript' })] }), aside] }), _jsx(Box, { hidden: shown !== 'graph', "data-scene-graph": "", children: children }), shown === 'transcript' && (_jsx(TranscriptViews, { lines: transcript, members: members, tracer: lines ? null : tracer, recorded: Boolean(lines), scene: scene, emptyText: emptyText, maxHeight: maxHeight, selected: selected, onSelect: onSelect, inspectorHref: inspectorHref, onOpenInspector: tracer && !lines ? () => setInspecting(true) : undefined })), inspecting && tracer && (_jsx(AgentInspectorDialog, { tracer: tracer, onClose: () => setInspecting(false) }))] }));
24
24
  }
25
25
  export default SceneView;