@datalayer/agent-runtimes 1.3.83 → 1.3.85

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 (168) hide show
  1. package/lib/chat/ChatFloating.d.ts +5 -4
  2. package/lib/chat/ChatFloating.js +8 -6
  3. package/lib/chat/ChatLanguage.d.ts +17 -0
  4. package/lib/chat/ChatLanguage.js +29 -0
  5. package/lib/chat/assistant/AssistantStage.d.ts +4 -4
  6. package/lib/chat/assistant/AssistantStage.js +4 -2
  7. package/lib/chat/assistant/BalloonParts.d.ts +2 -1
  8. package/lib/chat/assistant/BalloonParts.js +12 -5
  9. package/lib/chat/assistant/BalloonVisual.js +3 -1
  10. package/lib/chat/assistant/ConversationBalloon.d.ts +1 -1
  11. package/lib/chat/assistant/ConversationBalloon.js +3 -2
  12. package/lib/chat/assistant/SpeechBalloon.d.ts +1 -1
  13. package/lib/chat/assistant/SpeechBalloon.js +10 -7
  14. package/lib/chat/assistant/toolLine.d.ts +8 -4
  15. package/lib/chat/assistant/toolLine.js +13 -9
  16. package/lib/chat/base/ChatBase.js +30 -11
  17. package/lib/chat/base/loopElement.d.ts +53 -0
  18. package/lib/chat/base/loopElement.js +78 -0
  19. package/lib/chat/base/loopWindow.d.ts +31 -0
  20. package/lib/chat/base/loopWindow.js +74 -0
  21. package/lib/chat/display/EmptyState.js +3 -1
  22. package/lib/chat/index.d.ts +2 -0
  23. package/lib/chat/index.js +3 -0
  24. package/lib/chat/messages/ChatMessages.js +3 -1
  25. package/lib/chat/messages/TurnFooter.js +3 -1
  26. package/lib/chat/prompt/InputPrompt.js +3 -1
  27. package/lib/chat/prompt/InputPromptLexical.js +3 -1
  28. package/lib/chat/prompt/footer/InPromptFooter.js +3 -1
  29. package/lib/chat/tools/ToolApprovalBanner.js +5 -3
  30. package/lib/chat/tools/ToolApprovalDialog.js +5 -3
  31. package/lib/chat/tools/ToolCallDisplay.js +29 -25
  32. package/lib/chat/words.d.ts +102 -0
  33. package/lib/chat/words.js +460 -0
  34. package/lib/components/a2ui/custom/index.d.ts +39 -0
  35. package/lib/components/a2ui/custom/index.js +95 -0
  36. package/lib/components/a2ui/custom/sandbox.d.ts +73 -0
  37. package/lib/components/a2ui/custom/sandbox.js +188 -0
  38. package/lib/components/a2ui/datalayer/FileUpload.d.ts +10 -2
  39. package/lib/components/a2ui/datalayer/FileUpload.js +10 -7
  40. package/lib/components/a2ui/datalayer/Form.d.ts +2 -0
  41. package/lib/components/a2ui/datalayer/Form.js +9 -2
  42. package/lib/components/a2ui/datalayer/formWidgets.d.ts +19 -0
  43. package/lib/components/a2ui/datalayer/formWidgets.js +51 -0
  44. package/lib/components/a2ui/datalayer/index.d.ts +1 -1
  45. package/lib/components/a2ui/datalayer/index.js +1 -1
  46. package/lib/components/a2ui/datalayer/schema.d.ts +10 -0
  47. package/lib/components/a2ui/datalayer/schema.js +12 -1
  48. package/lib/components/a2ui/index.d.ts +1 -0
  49. package/lib/components/a2ui/index.js +1 -0
  50. package/lib/components/a2ui/visibleWhen.d.ts +12 -1
  51. package/lib/components/a2ui/visibleWhen.js +24 -3
  52. package/lib/components/inspector/AgentInspector.d.ts +25 -44
  53. package/lib/components/inspector/AgentInspector.js +27 -215
  54. package/lib/components/inspector/AgentInspectorDialog.d.ts +6 -6
  55. package/lib/components/inspector/AgentInspectorDialog.js +2 -2
  56. package/lib/components/inspector/a2aSpans.d.ts +51 -0
  57. package/lib/components/inspector/a2aSpans.js +373 -0
  58. package/lib/components/inspector/agentSpans.d.ts +120 -0
  59. package/lib/components/inspector/agentSpans.js +253 -0
  60. package/lib/components/inspector/chatSpans.d.ts +36 -0
  61. package/lib/components/inspector/chatSpans.js +50 -0
  62. package/lib/components/inspector/classify.d.ts +11 -8
  63. package/lib/components/inspector/classify.js +23 -24
  64. package/lib/components/inspector/index.d.ts +7 -7
  65. package/lib/components/inspector/index.js +7 -7
  66. package/lib/components/teams/A2ATeamGraph.d.ts +4 -4
  67. package/lib/components/teams/SceneTranscript.d.ts +29 -0
  68. package/lib/components/teams/SceneTranscript.js +54 -0
  69. package/lib/components/teams/SceneView.d.ts +41 -0
  70. package/lib/components/teams/SceneView.js +28 -0
  71. package/lib/components/teams/index.d.ts +3 -0
  72. package/lib/components/teams/index.js +3 -0
  73. package/lib/components/teams/sceneTranscript.d.ts +74 -0
  74. package/lib/components/teams/sceneTranscript.js +294 -0
  75. package/lib/components/teams/teamConnections.d.ts +2 -2
  76. package/lib/components/teams/teamConnections.js +3 -3
  77. package/lib/components/teams/useA2ATeam.d.ts +4 -4
  78. package/lib/components/teams/useA2ATeam.js +50 -46
  79. package/lib/examples/AgentA2ATeamExample.d.ts +10 -9
  80. package/lib/examples/AgentA2ATeamExample.js +70 -60
  81. package/lib/examples/AssistantExample.js +2 -2
  82. package/lib/loop/apps/AppComposer.d.ts +40 -4
  83. package/lib/loop/apps/AppComposer.js +194 -19
  84. package/lib/loop/apps/AppRenderer.d.ts +21 -3
  85. package/lib/loop/apps/AppRenderer.js +88 -48
  86. package/lib/loop/apps/appspec.d.ts +13 -1
  87. package/lib/loop/apps/appspec.js +305 -12
  88. package/lib/loop/apps/checks.d.ts +14 -0
  89. package/lib/loop/apps/checks.js +276 -5
  90. package/lib/loop/apps/composer.d.ts +21 -10
  91. package/lib/loop/apps/composer.js +41 -8
  92. package/lib/loop/apps/customComponents.d.ts +41 -0
  93. package/lib/loop/apps/customComponents.js +260 -0
  94. package/lib/loop/apps/hostTools.d.ts +8 -1
  95. package/lib/loop/apps/hostTools.js +9 -0
  96. package/lib/loop/apps/index.d.ts +1 -0
  97. package/lib/loop/apps/index.js +1 -0
  98. package/lib/loop/apps/language.d.ts +68 -0
  99. package/lib/loop/apps/language.js +275 -0
  100. package/lib/loop/apps/settingsInputs.d.ts +29 -0
  101. package/lib/loop/apps/settingsInputs.js +147 -0
  102. package/lib/loop/apps/uploads.d.ts +43 -0
  103. package/lib/loop/apps/uploads.js +66 -0
  104. package/lib/loop/core/a2uiComponents.d.ts +10 -0
  105. package/lib/loop/core/a2uiComponents.js +15 -0
  106. package/lib/loop/core/index.d.ts +15 -1
  107. package/lib/loop/core/index.js +3 -0
  108. package/lib/loop/embed/AppEmbed.d.ts +25 -3
  109. package/lib/loop/embed/AppEmbed.js +106 -18
  110. package/lib/loop/embed/element.d.ts +5 -0
  111. package/lib/loop/embed/element.js +84 -5
  112. package/lib/loop/embed/embedConfig.d.ts +8 -0
  113. package/lib/loop/embed/embedConfig.js +18 -0
  114. package/lib/loop/embed/embedSession.d.ts +14 -0
  115. package/lib/loop/embed/embedSession.js +34 -0
  116. package/lib/loop/embed/hostBridge.d.ts +50 -3
  117. package/lib/loop/embed/hostBridge.js +22 -2
  118. package/lib/loop/index.d.ts +4 -3
  119. package/lib/loop/index.js +4 -3
  120. package/lib/loop/plugins/a2ui-surface/InlineSurface.d.ts +7 -1
  121. package/lib/loop/plugins/a2ui-surface/InlineSurface.js +7 -2
  122. package/lib/loop/plugins/a2ui-surface/SurfaceToolResult.js +4 -1
  123. package/lib/loop/plugins/a2ui-surface/ownComponents.d.ts +6 -0
  124. package/lib/loop/plugins/a2ui-surface/ownComponents.js +30 -0
  125. package/lib/loop/plugins/app-components/index.d.ts +26 -0
  126. package/lib/loop/plugins/app-components/index.js +56 -0
  127. package/lib/loop/plugins/app-elements/AppElements.d.ts +27 -0
  128. package/lib/loop/plugins/app-elements/AppElements.js +79 -0
  129. package/lib/loop/plugins/app-elements/index.d.ts +20 -0
  130. package/lib/loop/plugins/app-elements/index.js +43 -0
  131. package/lib/loop/plugins/app-page/AppPage.d.ts +9 -0
  132. package/lib/loop/plugins/app-page/AppPage.js +106 -8
  133. package/lib/loop/plugins/app-page/appPageModel.d.ts +17 -1
  134. package/lib/loop/plugins/app-page/appPageModel.js +122 -4
  135. package/lib/loop/plugins/app-page/index.d.ts +1 -0
  136. package/lib/loop/plugins/app-page/index.js +1 -0
  137. package/lib/loop/plugins/app-page/pageRun.d.ts +46 -0
  138. package/lib/loop/plugins/app-page/pageRun.js +111 -0
  139. package/lib/loop/plugins/assistant/index.js +8 -6
  140. package/lib/loop/plugins/chat/ChatView.js +16 -6
  141. package/lib/loop/plugins/chat/index.d.ts +1 -1
  142. package/lib/loop/plugins/chat/index.js +2 -1
  143. package/lib/models/PageTag.d.ts +1 -1
  144. package/lib/protocols/BrowserAgentAdapter.d.ts +8 -6
  145. package/lib/protocols/BrowserAgentAdapter.js +13 -10
  146. package/lib/runtimes/browser/a2aPeer.d.ts +2 -1
  147. package/lib/runtimes/browser/protocol.d.ts +1 -1
  148. package/lib/specs/actions.js +78 -1
  149. package/lib/specs/apps.d.ts +5 -0
  150. package/lib/specs/apps.js +1518 -216
  151. package/lib/specs/appspecSchema.js +630 -3
  152. package/lib/specs/teams/teams.d.ts +3 -0
  153. package/lib/specs/teams/teams.js +249 -0
  154. package/lib/specs/uiPlugins.js +6 -1
  155. package/lib/types/agentspecs.d.ts +200 -1
  156. package/lib/types/chat.d.ts +6 -5
  157. package/lib/types/teams.d.ts +13 -2
  158. package/package.json +2 -2
  159. package/scripts/codegen/generate_apps.py +20 -2
  160. package/scripts/codegen/generate_teams.py +15 -2
  161. package/lib/components/inspector/JsonTree.d.ts +0 -24
  162. package/lib/components/inspector/JsonTree.js +0 -89
  163. package/lib/components/inspector/a2aInspect.d.ts +0 -56
  164. package/lib/components/inspector/a2aInspect.js +0 -478
  165. package/lib/components/inspector/agentInspector.d.ts +0 -179
  166. package/lib/components/inspector/agentInspector.js +0 -267
  167. package/lib/components/inspector/chatInspect.d.ts +0 -38
  168. package/lib/components/inspector/chatInspect.js +0 -65
@@ -16,6 +16,12 @@ export const APPSPEC_SCHEMA = {
16
16
  title: 'Access',
17
17
  type: 'string',
18
18
  },
19
+ ActionClass: {
20
+ description: 'What a tool does to the world.',
21
+ enum: ['read', 'write', 'send', 'buy', 'delete', 'publish'],
22
+ title: 'ActionClass',
23
+ type: 'string',
24
+ },
19
25
  ActsAs: {
20
26
  description: 'In whose name a connection acts.',
21
27
  enum: ['owner', 'user'],
@@ -24,7 +30,7 @@ export const APPSPEC_SCHEMA = {
24
30
  },
25
31
  AppChecks: {
26
32
  additionalProperties: false,
27
- description: 'Optional: checks from the catalogue, for a builder who wants them.',
33
+ description: "Optional: checks from the catalogue, for a builder who wants them — and its code's own.",
28
34
  properties: {
29
35
  guards: {
30
36
  description: 'Guards, `id` or `id:version`',
@@ -48,10 +54,43 @@ export const APPSPEC_SCHEMA = {
48
54
  title: 'Track',
49
55
  type: 'string',
50
56
  },
57
+ code: {
58
+ description: 'Checks written in its code (`@app.check`), each run at its stage (LOOP P-06)',
59
+ items: {
60
+ $ref: '#/$defs/AppCodeCheck',
61
+ },
62
+ title: 'Code',
63
+ type: 'array',
64
+ },
51
65
  },
52
66
  title: 'AppChecks',
53
67
  type: 'object',
54
68
  },
69
+ AppCodeCheck: {
70
+ additionalProperties: false,
71
+ description: "A check written in the application's code (LOOP P-06): `@app.check`.\n\nRun at its stage beside the built-in checks and the catalogue's Guards;\nwhat it refuses is said in its own sentence. Without its file nothing\nruns it, and validation says so.",
72
+ properties: {
73
+ name: {
74
+ description: 'The function of its code that checks, by name',
75
+ pattern: '^[A-Za-z_][A-Za-z0-9_]*$',
76
+ title: 'Name',
77
+ type: 'string',
78
+ },
79
+ on: {
80
+ $ref: '#/$defs/CheckStage',
81
+ description: '`answer` or `tool_call`: where it runs',
82
+ },
83
+ description: {
84
+ description: 'What it checks, in a sentence a person reads',
85
+ minLength: 1,
86
+ title: 'Description',
87
+ type: 'string',
88
+ },
89
+ },
90
+ required: ['name', 'on', 'description'],
91
+ title: 'AppCodeCheck',
92
+ type: 'object',
93
+ },
55
94
  AppCommand: {
56
95
  additionalProperties: false,
57
96
  description: "A slash command the user picks in the composer (LOOP P-19).\n\nTyping `/` lists the application's commands; picking one sends its\n`prompt`, `{input}` replaced by the words typed after the command.",
@@ -191,6 +230,82 @@ export const APPSPEC_SCHEMA = {
191
230
  title: 'AppCriterion',
192
231
  type: 'object',
193
232
  },
233
+ AppCustomComponent: {
234
+ additionalProperties: false,
235
+ description: "A component the developer writes (LOOP P-17), an A2UI component of this\napplication only: the catalog grows for it, it does not open.\n\nReviewed like any component of the catalog — its properties a JSON\nSchema, what it shows and sends bindings into the page's data — and drawn\nin a sandboxed frame of no origin, its module loaded from `source` and\nnothing else: what it is given is its properties and data, and what it\ngives back is what it sends.",
236
+ properties: {
237
+ name: {
238
+ description: "Its name on a surface, as a catalog component's (`Gauge`); none of the catalog's own",
239
+ pattern: '^[A-Z][A-Za-z0-9]{0,63}$',
240
+ title: 'Name',
241
+ type: 'string',
242
+ },
243
+ description: {
244
+ description: 'What it is for, in a sentence: what the palette says',
245
+ minLength: 1,
246
+ title: 'Description',
247
+ type: 'string',
248
+ },
249
+ props: {
250
+ additionalProperties: true,
251
+ description: 'Its properties, as the JSON Schema of an object: each typed `string`, `integer`, `number`, `boolean`, `array` or `object`, or an `enum` of words, with its `title`, `description` and `default`; `required` among them',
252
+ title: 'Props',
253
+ type: 'object',
254
+ },
255
+ shows: {
256
+ description: "What it shows from the page's data: each a binding, given a path or a value in place",
257
+ items: {
258
+ type: 'string',
259
+ },
260
+ title: 'Shows',
261
+ type: 'array',
262
+ },
263
+ sends: {
264
+ description: 'What it sends back: each a binding it writes, then its `action` dispatched',
265
+ items: {
266
+ type: 'string',
267
+ },
268
+ title: 'Sends',
269
+ type: 'array',
270
+ },
271
+ source: {
272
+ description: "The address of its module, a built ES module whose default export draws it (`export default function (root, {props, send})`): over `https://`, or `http://localhost` while it is written. A module of the application's folder waits for its packaging (LOOP P-29)",
273
+ title: 'Source',
274
+ type: 'string',
275
+ },
276
+ integrity: {
277
+ default: '',
278
+ description: 'The module as it was reviewed: its Subresource Integrity hash (`sha384-…`); a module that differs is not drawn. Any module at the address when unsaid',
279
+ title: 'Integrity',
280
+ type: 'string',
281
+ },
282
+ height: {
283
+ default: 240,
284
+ description: 'Its height on the page, in pixels',
285
+ maximum: 2000,
286
+ minimum: 40,
287
+ title: 'Height',
288
+ type: 'integer',
289
+ },
290
+ example: {
291
+ anyOf: [
292
+ {
293
+ additionalProperties: true,
294
+ type: 'object',
295
+ },
296
+ {
297
+ type: 'null',
298
+ },
299
+ ],
300
+ default: null,
301
+ description: 'A configuration of it its schema accepts: what the palette previews',
302
+ title: 'Example',
303
+ },
304
+ },
305
+ required: ['name', 'description', 'source'],
306
+ title: 'AppCustomComponent',
307
+ type: 'object',
308
+ },
194
309
  AppDecision: {
195
310
  additionalProperties: false,
196
311
  description: 'What a decision application decides.',
@@ -275,6 +390,34 @@ export const APPSPEC_SCHEMA = {
275
390
  title: 'AppDeployment',
276
391
  type: 'object',
277
392
  },
393
+ AppFieldTranslation: {
394
+ additionalProperties: false,
395
+ description: 'A field of the settings in another language.',
396
+ properties: {
397
+ title: {
398
+ default: '',
399
+ description: 'Its title',
400
+ title: 'Title',
401
+ type: 'string',
402
+ },
403
+ description: {
404
+ default: '',
405
+ description: 'What it is for',
406
+ title: 'Description',
407
+ type: 'string',
408
+ },
409
+ options: {
410
+ additionalProperties: {
411
+ type: 'string',
412
+ },
413
+ description: "What each value of its `enum` (or of its items') reads as, by the value; the value is sent",
414
+ title: 'Options',
415
+ type: 'object',
416
+ },
417
+ },
418
+ title: 'AppFieldTranslation',
419
+ type: 'object',
420
+ },
278
421
  AppInterface: {
279
422
  additionalProperties: false,
280
423
  description: 'What the user sees.',
@@ -338,6 +481,14 @@ export const APPSPEC_SCHEMA = {
338
481
  title: 'Modes',
339
482
  type: 'array',
340
483
  },
484
+ profiles: {
485
+ description: 'Several assistants in one application, two at least: the person picks one before the conversation starts — the first unless they do — and keeps it to the end; its instructions, model and starters go with every run (LOOP P-20). None when unsaid',
486
+ items: {
487
+ $ref: '#/$defs/AppProfile',
488
+ },
489
+ title: 'Profiles',
490
+ type: 'array',
491
+ },
341
492
  settings: {
342
493
  anyOf: [
343
494
  {
@@ -352,6 +503,46 @@ export const APPSPEC_SCHEMA = {
352
503
  description: "What the user may set: the JSON Schema of a form, an object of named fields, each with its `title` and its `default` (LOOP C-16). Drawn with `@datalayer/primer-rjsf` beside the conversation and on a deployment's Ship card, its values go with every run and are checked by the runtime against the same schema. None when unsaid",
353
504
  title: 'Settings',
354
505
  },
506
+ settings_ui: {
507
+ anyOf: [
508
+ {
509
+ additionalProperties: true,
510
+ type: 'object',
511
+ },
512
+ {
513
+ type: 'null',
514
+ },
515
+ ],
516
+ default: null,
517
+ description: "How the settings' fields are drawn, as `@datalayer/primer-rjsf` reads a uiSchema: by field name, its `ui:` options — `ui:widget` one of `select`, `radio`, `range`, `updown`, `switch`, `checkbox`, `text`, `textarea`, `date`, `checkboxes`, `tags` — and `ui:order` (LOOP P-20). Each field's own widget when unsaid",
518
+ title: 'Settings Ui',
519
+ },
520
+ language: {
521
+ default: 'en',
522
+ description: 'The language its own words are in, as BCP 47 tags it (`en`, `fr`, `pt-BR`) (LOOP P-26)',
523
+ title: 'Language',
524
+ type: 'string',
525
+ },
526
+ translations: {
527
+ additionalProperties: {
528
+ $ref: '#/$defs/AppTranslation',
529
+ },
530
+ description: "What a person reads of it in other languages, by BCP 47 tag: its name, welcome, starters and their categories, settings, commands, modes and profiles. The page shows the person's language when it has it, else its own words (LOOP P-26)",
531
+ title: 'Translations',
532
+ type: 'object',
533
+ },
534
+ uploads: {
535
+ anyOf: [
536
+ {
537
+ $ref: '#/$defs/AppUploads',
538
+ },
539
+ {
540
+ type: 'null',
541
+ },
542
+ ],
543
+ default: null,
544
+ description: 'What a person may send in the composer without being asked — images, files, audio — by kind, each with its largest size, and how many at once (LOOP P-21). None when unsaid: the composer offers no attachment, and a file sent with a message is refused',
545
+ },
355
546
  components: {
356
547
  description: "The components of the catalog the surface may use; the kind's own when empty",
357
548
  items: {
@@ -360,6 +551,14 @@ export const APPSPEC_SCHEMA = {
360
551
  title: 'Components',
361
552
  type: 'array',
362
553
  },
554
+ custom_components: {
555
+ description: "Components its developer wrote (LOOP P-17), of this application only: each named, its props a JSON Schema, its module's address; placed, shown and drawn as the catalog's own",
556
+ items: {
557
+ $ref: '#/$defs/AppCustomComponent',
558
+ },
559
+ title: 'Custom Components',
560
+ type: 'array',
561
+ },
363
562
  surface: {
364
563
  anyOf: [
365
564
  {
@@ -372,6 +571,18 @@ export const APPSPEC_SCHEMA = {
372
571
  default: null,
373
572
  description: 'The component tree, when there is one',
374
573
  },
574
+ page: {
575
+ anyOf: [
576
+ {
577
+ $ref: '#/$defs/AppPage',
578
+ },
579
+ {
580
+ type: 'null',
581
+ },
582
+ ],
583
+ default: null,
584
+ description: "A widget's page written in its code (`@app.page`, LOOP P-05): its inputs as a form, its outputs as values; run again as an input changes, its outputs shown in place. None when unsaid",
585
+ },
375
586
  assistant: {
376
587
  anyOf: [
377
588
  {
@@ -512,6 +723,131 @@ export const APPSPEC_SCHEMA = {
512
723
  title: 'AppModeOption',
513
724
  type: 'object',
514
725
  },
726
+ AppModeTranslation: {
727
+ additionalProperties: false,
728
+ description: 'A mode in another language.',
729
+ properties: {
730
+ label: {
731
+ default: '',
732
+ description: 'What the switch is called',
733
+ title: 'Label',
734
+ type: 'string',
735
+ },
736
+ options: {
737
+ additionalProperties: {
738
+ $ref: '#/$defs/AppOptionTranslation',
739
+ },
740
+ description: 'Its options, by id',
741
+ title: 'Options',
742
+ type: 'object',
743
+ },
744
+ },
745
+ title: 'AppModeTranslation',
746
+ type: 'object',
747
+ },
748
+ AppOptionTranslation: {
749
+ additionalProperties: false,
750
+ description: 'An option of a mode in another language.',
751
+ properties: {
752
+ label: {
753
+ default: '',
754
+ description: 'What the switch says',
755
+ title: 'Label',
756
+ type: 'string',
757
+ },
758
+ description: {
759
+ default: '',
760
+ description: 'What it changes',
761
+ title: 'Description',
762
+ type: 'string',
763
+ },
764
+ },
765
+ title: 'AppOptionTranslation',
766
+ type: 'object',
767
+ },
768
+ AppPage: {
769
+ additionalProperties: false,
770
+ description: "A widget's page written in its code (LOOP P-05): `@app.page`.\n\nIts inputs are a form, drawn on the page; as one changes, the function\nof its code runs again on them and the page shows what it returned, in\nplace. Without its file nothing runs it, and validation says so.",
771
+ properties: {
772
+ function: {
773
+ description: 'The function of its code that runs the page',
774
+ pattern: '^[A-Za-z_][A-Za-z0-9_]*$',
775
+ title: 'Function',
776
+ type: 'string',
777
+ },
778
+ inputs: {
779
+ additionalProperties: true,
780
+ description: 'Its inputs: the JSON Schema of a form, an object of named fields, each with its `title` and its `default`; on the page at `/inputs/<name>`, checked by the runtime against the same schema',
781
+ title: 'Inputs',
782
+ type: 'object',
783
+ },
784
+ inputs_ui: {
785
+ anyOf: [
786
+ {
787
+ additionalProperties: true,
788
+ type: 'object',
789
+ },
790
+ {
791
+ type: 'null',
792
+ },
793
+ ],
794
+ default: null,
795
+ description: 'How its inputs are drawn, as `interface.settings_ui` draws the settings: a uiSchema by field name',
796
+ title: 'Inputs Ui',
797
+ },
798
+ outputs: {
799
+ description: 'What it shows for its inputs, in order, each at `/outputs/<name>`',
800
+ items: {
801
+ $ref: '#/$defs/AppPageOutput',
802
+ },
803
+ minItems: 1,
804
+ title: 'Outputs',
805
+ type: 'array',
806
+ },
807
+ live: {
808
+ default: true,
809
+ description: 'Whether it runs again as an input changes; `false`: when the person presses Run',
810
+ title: 'Live',
811
+ type: 'boolean',
812
+ },
813
+ },
814
+ required: ['function', 'inputs', 'outputs'],
815
+ title: 'AppPage',
816
+ type: 'object',
817
+ },
818
+ AppPageOutput: {
819
+ additionalProperties: false,
820
+ description: 'One thing a page shows for its inputs (LOOP P-05): a value, drawn with a component.',
821
+ properties: {
822
+ name: {
823
+ description: 'Its name: what its code returns it under, and where the page shows it (`/outputs/<name>`)',
824
+ pattern: '^[A-Za-z_][A-Za-z0-9_]*$',
825
+ title: 'Name',
826
+ type: 'string',
827
+ },
828
+ title: {
829
+ default: '',
830
+ description: 'What a person reads above it; none when unsaid',
831
+ title: 'Title',
832
+ type: 'string',
833
+ },
834
+ component: {
835
+ default: 'Text',
836
+ description: "What draws it: `Text` (words, unless said), `Image` (an address), `Table` (rows) or `Chart` (points), or a component of the application's own (`interface.custom_components`, LOOP P-17), its value what it shows first",
837
+ title: 'Component',
838
+ type: 'string',
839
+ },
840
+ props: {
841
+ additionalProperties: true,
842
+ description: "The component's other properties: a Table's `columns`, a Chart's `kind`, `x` and `y`",
843
+ title: 'Props',
844
+ type: 'object',
845
+ },
846
+ },
847
+ required: ['name'],
848
+ title: 'AppPageOutput',
849
+ type: 'object',
850
+ },
515
851
  AppPermissions: {
516
852
  additionalProperties: false,
517
853
  description: 'What the application may reach beside its connections. Nothing, unless said.',
@@ -532,6 +868,80 @@ export const APPSPEC_SCHEMA = {
532
868
  title: 'AppPermissions',
533
869
  type: 'object',
534
870
  },
871
+ AppProfile: {
872
+ additionalProperties: false,
873
+ description: "One of several assistants in one application (LOOP P-20): a variant of its agent.\n\nThe person picks a profile before the conversation starts, and keeps it to\nthe end: its instructions are told to the agent on top of the\napplication's in every run, its model run in place of the application's\n(a mode's model wins over it), and its starters offered in place of the\napplication's.",
874
+ properties: {
875
+ id: {
876
+ description: 'Its id, what a conversation says it is with',
877
+ pattern: '^[a-z][a-z0-9_-]{0,39}$',
878
+ title: 'Id',
879
+ type: 'string',
880
+ },
881
+ label: {
882
+ description: 'What the person picks it by',
883
+ minLength: 1,
884
+ title: 'Label',
885
+ type: 'string',
886
+ },
887
+ description: {
888
+ default: '',
889
+ description: 'What it is for, in a sentence, beside its label',
890
+ title: 'Description',
891
+ type: 'string',
892
+ },
893
+ instructions: {
894
+ default: '',
895
+ description: 'What the agent is told besides its instructions, in every run with this profile',
896
+ title: 'Instructions',
897
+ type: 'string',
898
+ },
899
+ model: {
900
+ anyOf: [
901
+ {
902
+ type: 'string',
903
+ },
904
+ {
905
+ type: 'null',
906
+ },
907
+ ],
908
+ default: null,
909
+ description: "The model it runs on, in place of the application's; a mode's model wins over it",
910
+ title: 'Model',
911
+ },
912
+ starters: {
913
+ description: "The first messages it offers, in place of the application's; the application's when empty",
914
+ items: {
915
+ $ref: '#/$defs/AppStarter',
916
+ },
917
+ title: 'Starters',
918
+ type: 'array',
919
+ },
920
+ },
921
+ required: ['id', 'label'],
922
+ title: 'AppProfile',
923
+ type: 'object',
924
+ },
925
+ AppProfileTranslation: {
926
+ additionalProperties: false,
927
+ description: 'A profile in another language.',
928
+ properties: {
929
+ label: {
930
+ default: '',
931
+ description: 'What the person picks it by',
932
+ title: 'Label',
933
+ type: 'string',
934
+ },
935
+ description: {
936
+ default: '',
937
+ description: 'What it is for',
938
+ title: 'Description',
939
+ type: 'string',
940
+ },
941
+ },
942
+ title: 'AppProfileTranslation',
943
+ type: 'object',
944
+ },
535
945
  AppRecord: {
536
946
  additionalProperties: false,
537
947
  description: 'What is kept of what the application did, and for how long.',
@@ -648,11 +1058,37 @@ export const APPSPEC_SCHEMA = {
648
1058
  title: 'Message',
649
1059
  type: 'string',
650
1060
  },
1061
+ category: {
1062
+ default: '',
1063
+ description: 'The heading it is offered under: the starters of one category are shown together, those without one first (LOOP P-20)',
1064
+ title: 'Category',
1065
+ type: 'string',
1066
+ },
651
1067
  },
652
1068
  required: ['label', 'message'],
653
1069
  title: 'AppStarter',
654
1070
  type: 'object',
655
1071
  },
1072
+ AppStarterTranslation: {
1073
+ additionalProperties: false,
1074
+ description: 'A starter in another language.',
1075
+ properties: {
1076
+ label: {
1077
+ default: '',
1078
+ description: 'What the button says',
1079
+ title: 'Label',
1080
+ type: 'string',
1081
+ },
1082
+ message: {
1083
+ default: '',
1084
+ description: 'What is sent when it is chosen',
1085
+ title: 'Message',
1086
+ type: 'string',
1087
+ },
1088
+ },
1089
+ title: 'AppStarterTranslation',
1090
+ type: 'object',
1091
+ },
656
1092
  AppSurface: {
657
1093
  additionalProperties: false,
658
1094
  description: 'The component tree the user meets, over the approved catalog (A2UI).',
@@ -690,7 +1126,7 @@ export const APPSPEC_SCHEMA = {
690
1126
  },
691
1127
  AppTestCase: {
692
1128
  additionalProperties: false,
693
- description: 'An example of what the application should do, in plain words.',
1129
+ description: "An example of what the application should do, in plain words.\n\nWhen plain words are not enough, its code decides it (LOOP P-06): `code`\nnames the function of the application's `app.py` that is given the\nconversation and says whether it passed — `@app.test` writes it. `expect`\nstill says it in words: without its file, the case is judged by them.",
694
1130
  properties: {
695
1131
  ask: {
696
1132
  description: 'What it is asked',
@@ -702,6 +1138,13 @@ export const APPSPEC_SCHEMA = {
702
1138
  title: 'Expect',
703
1139
  type: 'string',
704
1140
  },
1141
+ code: {
1142
+ default: '',
1143
+ description: 'The function of its code that decides the case, by name, when words are not enough; `expect` says it in words',
1144
+ pattern: '^(?:[A-Za-z_][A-Za-z0-9_]*)?$',
1145
+ title: 'Code',
1146
+ type: 'string',
1147
+ },
705
1148
  },
706
1149
  required: ['ask', 'expect'],
707
1150
  title: 'AppTestCase',
@@ -766,6 +1209,116 @@ export const APPSPEC_SCHEMA = {
766
1209
  title: 'AppTheme',
767
1210
  type: 'object',
768
1211
  },
1212
+ AppTool: {
1213
+ additionalProperties: false,
1214
+ description: "A tool of the application's own, written in its code (LOOP P-06): `@app.tool`.\n\nIts agent calls it as any tool; the rules decide each call by what it\n`does` — a rule may name it, by its name alone — and the Canvas lists it.\nWithout its file the agent is not given it.",
1215
+ properties: {
1216
+ name: {
1217
+ description: 'Its name: what the agent calls, and a rule names',
1218
+ pattern: '^[A-Za-z_][A-Za-z0-9_]*$',
1219
+ title: 'Name',
1220
+ type: 'string',
1221
+ },
1222
+ description: {
1223
+ description: 'What it does, for the agent: when to call it',
1224
+ minLength: 1,
1225
+ title: 'Description',
1226
+ type: 'string',
1227
+ },
1228
+ parameters: {
1229
+ additionalProperties: true,
1230
+ description: 'The JSON Schema of its arguments, an object; none when unsaid',
1231
+ title: 'Parameters',
1232
+ type: 'object',
1233
+ },
1234
+ does: {
1235
+ description: 'What it does, by class of action (`read`, `write`, `send`…): what the rules decide',
1236
+ items: {
1237
+ $ref: '#/$defs/ActionClass',
1238
+ },
1239
+ minItems: 1,
1240
+ title: 'Does',
1241
+ type: 'array',
1242
+ },
1243
+ },
1244
+ required: ['name', 'description', 'does'],
1245
+ title: 'AppTool',
1246
+ type: 'object',
1247
+ },
1248
+ AppTranslation: {
1249
+ additionalProperties: false,
1250
+ description: "What a person reads of an application, in another language (LOOP P-26).\n\nEach part is keyed by what names it in the spec: a starter by its label,\na category by its words, a setting by its field, a command by its name,\na mode and a profile by their ids. What is not translated is shown in\nthe spec's own words; what is translated is shown, never sent, but a\nstarter's message — the agent is written to in the person's language.",
1251
+ properties: {
1252
+ name: {
1253
+ default: '',
1254
+ description: 'Its display name',
1255
+ title: 'Name',
1256
+ type: 'string',
1257
+ },
1258
+ description: {
1259
+ default: '',
1260
+ description: 'What it does',
1261
+ title: 'Description',
1262
+ type: 'string',
1263
+ },
1264
+ welcome: {
1265
+ default: '',
1266
+ description: 'What it says first',
1267
+ title: 'Welcome',
1268
+ type: 'string',
1269
+ },
1270
+ starters: {
1271
+ additionalProperties: {
1272
+ $ref: '#/$defs/AppStarterTranslation',
1273
+ },
1274
+ description: "Its starters and its profiles', by their label",
1275
+ title: 'Starters',
1276
+ type: 'object',
1277
+ },
1278
+ categories: {
1279
+ additionalProperties: {
1280
+ type: 'string',
1281
+ },
1282
+ description: "The starters' categories, by their words",
1283
+ title: 'Categories',
1284
+ type: 'object',
1285
+ },
1286
+ settings: {
1287
+ additionalProperties: {
1288
+ $ref: '#/$defs/AppFieldTranslation',
1289
+ },
1290
+ description: 'The fields of its settings, by name',
1291
+ title: 'Settings',
1292
+ type: 'object',
1293
+ },
1294
+ commands: {
1295
+ additionalProperties: {
1296
+ type: 'string',
1297
+ },
1298
+ description: "Its commands' descriptions, by name",
1299
+ title: 'Commands',
1300
+ type: 'object',
1301
+ },
1302
+ modes: {
1303
+ additionalProperties: {
1304
+ $ref: '#/$defs/AppModeTranslation',
1305
+ },
1306
+ description: 'Its modes, by id',
1307
+ title: 'Modes',
1308
+ type: 'object',
1309
+ },
1310
+ profiles: {
1311
+ additionalProperties: {
1312
+ $ref: '#/$defs/AppProfileTranslation',
1313
+ },
1314
+ description: 'Its profiles, by id',
1315
+ title: 'Profiles',
1316
+ type: 'object',
1317
+ },
1318
+ },
1319
+ title: 'AppTranslation',
1320
+ type: 'object',
1321
+ },
769
1322
  AppTrigger: {
770
1323
  additionalProperties: false,
771
1324
  description: "What starts a worker's work.",
@@ -809,6 +1362,55 @@ export const APPSPEC_SCHEMA = {
809
1362
  title: 'AppTrigger',
810
1363
  type: 'object',
811
1364
  },
1365
+ AppUploadKind: {
1366
+ additionalProperties: false,
1367
+ description: 'A kind of file a person may send, and how large (LOOP P-21).',
1368
+ properties: {
1369
+ type: {
1370
+ description: 'A media type (`application/pdf`), a family of them (`image/*`, `audio/*`) or an extension (`.csv`), lowercase',
1371
+ pattern: '^(?:[a-z0-9][a-z0-9.+-]*/(?:\\*|[a-z0-9][a-z0-9.+-]*)|\\.[a-z0-9][a-z0-9_+-]*)$',
1372
+ title: 'Type',
1373
+ type: 'string',
1374
+ },
1375
+ max_mb: {
1376
+ default: 10,
1377
+ description: 'The largest file of this kind, in megabytes; 25 at most',
1378
+ exclusiveMinimum: 0,
1379
+ maximum: 25,
1380
+ title: 'Max Mb',
1381
+ type: 'number',
1382
+ },
1383
+ },
1384
+ required: ['type'],
1385
+ title: 'AppUploadKind',
1386
+ type: 'object',
1387
+ },
1388
+ AppUploads: {
1389
+ additionalProperties: false,
1390
+ description: 'What a person may send in the composer without being asked (LOOP P-21): images, files, audio.\n\nA file of a kind it does not name, larger than its kind takes, or one too\nmany is refused, in a sentence — by the page before it is sent, and by the\nruntime when it is sent all the same.',
1391
+ properties: {
1392
+ kinds: {
1393
+ description: 'The kinds of file it takes, each with its largest size',
1394
+ items: {
1395
+ $ref: '#/$defs/AppUploadKind',
1396
+ },
1397
+ minItems: 1,
1398
+ title: 'Kinds',
1399
+ type: 'array',
1400
+ },
1401
+ max_files: {
1402
+ default: 5,
1403
+ description: 'The most files sent with one message',
1404
+ maximum: 20,
1405
+ minimum: 1,
1406
+ title: 'Max Files',
1407
+ type: 'integer',
1408
+ },
1409
+ },
1410
+ required: ['kinds'],
1411
+ title: 'AppUploads',
1412
+ type: 'object',
1413
+ },
812
1414
  AppVerified: {
813
1415
  additionalProperties: false,
814
1416
  description: 'What was verified, and how, each in a sentence a person reads (LOOP E-14).\n\nAn example says it on its card and on its page: what was tried live,\nwhat runs on recorded data instead, and what is not verified yet. Said\nby whoever tried it; nothing here is computed.',
@@ -895,6 +1497,12 @@ export const APPSPEC_SCHEMA = {
895
1497
  title: 'Behaviour',
896
1498
  type: 'string',
897
1499
  },
1500
+ CheckStage: {
1501
+ description: 'Where a check of its code runs (LOOP P-06), as the built-in checks do (R-06).',
1502
+ enum: ['answer', 'tool_call'],
1503
+ title: 'CheckStage',
1504
+ type: 'string',
1505
+ },
898
1506
  CriterionKind: {
899
1507
  description: 'How a criterion is assessed.',
900
1508
  enum: ['metric', 'noul', 'choice', 'score'],
@@ -942,7 +1550,7 @@ export const APPSPEC_SCHEMA = {
942
1550
  },
943
1551
  HostBridge: {
944
1552
  additionalProperties: false,
945
- description: "What the host page and the application say to each other (LOOP D-10).\n\nThe values of the host it reads (`context`: `user`, `page`, or a name of\nthe host's own), through the tool `host_context`; the functions of the\nhost it may call, each through `host_<name>`. Every one of these tools is\ndecided by a rule that names it, as any tool is: one no rule names is\nleft to the person.",
1553
+ description: "What the host page and the application say to each other (LOOP D-10).\n\nThe values of the host it reads (`context`: `user`, `page`, or a name of\nthe host's own), through the tool `host_context`; the functions of the\nhost it may call, each through `host_<name>`. Every one of these tools is\ndecided by a rule that names it, as any tool is: one no rule names is\nleft to the person.\n\nWho its user is (`user`, LOOP D-21): what the page says (`claimed`), or\nonly what the host's server signed (`signed`) — a short token, HS256\nwith the deployment's secret, naming `sub`, `name` and `exp` at most an\nhour away. An application that acts in each user's name, or shows data\nthat is theirs, says `signed`.",
946
1554
  properties: {
947
1555
  context: {
948
1556
  description: "The host's values it reads: `user`, `page`, or names of the host's own",
@@ -960,6 +1568,11 @@ export const APPSPEC_SCHEMA = {
960
1568
  title: 'Functions',
961
1569
  type: 'array',
962
1570
  },
1571
+ user: {
1572
+ $ref: '#/$defs/HostUser',
1573
+ default: 'claimed',
1574
+ description: "Who its user is: `claimed`, what the page says; `signed`, only a token the host's server signed with the deployment's secret, the unsigned one refused",
1575
+ },
963
1576
  },
964
1577
  title: 'HostBridge',
965
1578
  type: 'object',
@@ -989,6 +1602,12 @@ export const APPSPEC_SCHEMA = {
989
1602
  title: 'HostFunction',
990
1603
  type: 'object',
991
1604
  },
1605
+ HostUser: {
1606
+ description: "What the host page's word on its visitor is worth (LOOP D-21).",
1607
+ enum: ['claimed', 'signed'],
1608
+ title: 'HostUser',
1609
+ type: 'string',
1610
+ },
992
1611
  HostedDeployment: {
993
1612
  additionalProperties: false,
994
1613
  description: 'The application at an address of its own.',
@@ -1170,6 +1789,14 @@ export const APPSPEC_SCHEMA = {
1170
1789
  title: 'Backend Tools',
1171
1790
  type: 'array',
1172
1791
  },
1792
+ tools: {
1793
+ description: 'Tools of its own, written in its code (`@app.tool`): the agent calls them, rules decide them',
1794
+ items: {
1795
+ $ref: '#/$defs/AppTool',
1796
+ },
1797
+ title: 'Tools',
1798
+ type: 'array',
1799
+ },
1173
1800
  context: {
1174
1801
  description: "The Frames it works under: the catalogue's, or its organization's own (`org-…`)",
1175
1802
  items: {