@ouispec/contract 0.6.0 → 0.9.0

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.
@@ -18,6 +18,10 @@
18
18
  "additionalProperties": true
19
19
  },
20
20
  "stubs": { "description": "What each tool returns, for every scenario; a scenario's own stubs come first.", "$ref": "#/$defs/AgentEvalStubs" },
21
+ "page": {
22
+ "description": "The person's page, scripted, for every scenario: what it offers at each address and what its actions do. Each turn is sent from it, and the agent's page actions are answered by it. A scenario's own `page` replaces it.",
23
+ "$ref": "#/$defs/AgentEvalPage"
24
+ },
21
25
  "scenarios": { "type": "array", "items": { "$ref": "#/$defs/AgentEvalScenario" }, "minItems": 1 }
22
26
  },
23
27
  "required": ["version", "name", "scenarios"],
@@ -40,6 +44,10 @@
40
44
  "channels": { "description": "The suite's channels this scenario runs on, when not all of them.", "$ref": "#/$defs/AgentEvalChannelList" },
41
45
  "context": { "description": "What each of its turns carries as its context, after the suite's and the channel's.", "type": "object", "additionalProperties": true },
42
46
  "stubs": { "description": "What each tool returns in this scenario, before the suite's stubs.", "$ref": "#/$defs/AgentEvalStubs" },
47
+ "page": {
48
+ "description": "The page this scenario's turns are sent from, in place of the suite's; `false`: no page.",
49
+ "oneOf": [{ "const": false }, { "$ref": "#/$defs/AgentEvalPage" }]
50
+ },
43
51
  "turns": { "type": "array", "items": { "$ref": "#/$defs/AgentEvalTurn" }, "minItems": 1 }
44
52
  },
45
53
  "required": ["id", "title", "turns"],
@@ -182,7 +190,18 @@
182
190
  "type": "array",
183
191
  "items": { "$ref": "#/$defs/AgentEvalTextMatcher" }
184
192
  },
185
- "held": { "description": "`true`: the turn ran no model call, because a person held the conversation.", "type": "boolean" }
193
+ "held": { "description": "`true`: the turn ran no model call, because a person held the conversation.", "type": "boolean" },
194
+ "calls": {
195
+ "description": "How many times each tool, or each of the page's actions, was called in the turn.",
196
+ "type": "array",
197
+ "items": { "$ref": "#/$defs/AgentEvalCallCount" }
198
+ },
199
+ "usage": { "description": "What the turn's model calls used, as the provider reported it.", "$ref": "#/$defs/AgentEvalUsage" },
200
+ "choices": {
201
+ "description": "The turn offered the person choice buttons (`present_options`) that match; `false`: it offered none.",
202
+ "oneOf": [{ "const": false }, { "$ref": "#/$defs/AgentEvalChoicesExpectation" }]
203
+ },
204
+ "page": { "description": "What the page did in the turn, read from the page itself.", "$ref": "#/$defs/AgentEvalPageExpectation" }
186
205
  },
187
206
  "additionalProperties": false
188
207
  },
@@ -214,6 +233,285 @@
214
233
  "description": "What each tool returns, by tool name: its cases in order, the first that matches the call wins. A call to a tool with no matching case fails the scenario: an eval never reaches a real backend.",
215
234
  "type": "object",
216
235
  "additionalProperties": { "type": "array", "items": { "$ref": "#/$defs/AgentEvalStubCase" }, "minItems": 1 }
236
+ },
237
+ "AgentEvalPage": {
238
+ "description": "The person's page, scripted. The harness runs it on a real oui-spec surface runtime in index form, sends each turn from where it is (its address and its snapshot, as the person's tab sends them), and answers the agent's page actions (`ui_act`, `ui_describe`, `ui_read`) from it. Its surfaces are declared here, or are the product's own: the controls of its generated manifest, given to the configuration (`page.manifest`), mounted as its tab mounts them.",
239
+ "type": "object",
240
+ "properties": {
241
+ "at": {
242
+ "description": "The address the first turn is sent from. Each later turn is sent from wherever the page is by then.",
243
+ "type": "string",
244
+ "pattern": "^/"
245
+ },
246
+ "routes": {
247
+ "description": "The addresses going to a page accepts, as route patterns (`/leads/:id`), when the manifest declares no navigation surface of its own. Default: every surface's routes, the manifest's pages, and `at`.",
248
+ "type": "array",
249
+ "items": { "type": "string", "pattern": "^/" },
250
+ "uniqueItems": true
251
+ },
252
+ "navigation": {
253
+ "description": "Whether the page offers going to a page by its address (`app.navigate`), as a generated app does: the manifest's navigation surface, or one made from `routes`, run by the bindings as the product's tab runs it. Default: true.",
254
+ "type": "boolean"
255
+ },
256
+ "surfaces": {
257
+ "description": "Surfaces declared here, each mounted while the page is at one of its routes.",
258
+ "type": "array",
259
+ "items": { "$ref": "#/$defs/AgentEvalPageSurface" }
260
+ },
261
+ "controls": {
262
+ "description": "The product's own controls, by binding id in the configuration's manifest: each is mounted while the page is on its surface, with what it shows and what it does.",
263
+ "type": "object",
264
+ "additionalProperties": { "$ref": "#/$defs/AgentEvalPageControl" }
265
+ },
266
+ "allControls": {
267
+ "description": "Also mount every other control the manifest declares on a surface that is mounted, with no value, as an empty form shows them. A list's per-row controls are not: no row is rendered. Default: false.",
268
+ "type": "boolean"
269
+ }
270
+ },
271
+ "required": ["at"],
272
+ "additionalProperties": false
273
+ },
274
+ "AgentEvalPageSurface": {
275
+ "description": "A surface of the page: its actions, and what it reports.",
276
+ "type": "object",
277
+ "properties": {
278
+ "id": { "type": "string", "minLength": 1 },
279
+ "name": { "type": "string", "minLength": 1 },
280
+ "description": { "type": "string", "minLength": 1 },
281
+ "routes": {
282
+ "description": "Where it is mounted, as route patterns. Absent: on every page, as a shell is.",
283
+ "type": "array",
284
+ "items": { "type": "string", "pattern": "^/" },
285
+ "uniqueItems": true
286
+ },
287
+ "state": { "description": "What it reports when the page opens, by observation id.", "type": "object", "additionalProperties": true },
288
+ "actions": { "type": "array", "items": { "$ref": "#/$defs/AgentEvalPageAction" } }
289
+ },
290
+ "required": ["id", "name", "description", "actions"],
291
+ "additionalProperties": false
292
+ },
293
+ "AgentEvalPageAction": {
294
+ "description": "An action of a declared surface, and what it does when it runs.",
295
+ "type": "object",
296
+ "properties": {
297
+ "id": { "description": "As the page's index names it, and `ui_act` takes it.", "type": "string", "minLength": 1 },
298
+ "title": { "type": "string", "minLength": 1 },
299
+ "description": { "type": "string", "minLength": 1 },
300
+ "effect": {
301
+ "description": "What it changes (oui-spec's effect kinds).",
302
+ "enum": ["view", "selection", "navigate", "open", "edit", "file", "mutate", "job", "transaction"]
303
+ },
304
+ "confirm": { "description": "It asks the person to approve it first.", "type": "boolean" },
305
+ "input": { "description": "What it takes, as a JSON Schema. Default: nothing.", "type": "object" },
306
+ "result": {
307
+ "description": "What it answers. Default: it succeeds, returning nothing.",
308
+ "type": "object",
309
+ "properties": { "success": { "type": "boolean" }, "data": {}, "error": { "type": "string" } },
310
+ "required": ["success"],
311
+ "additionalProperties": false
312
+ },
313
+ "state": {
314
+ "description": "Its surface's observations once it has run, by observation id: each given replaces the one before.",
315
+ "type": "object",
316
+ "additionalProperties": true
317
+ },
318
+ "navigate": { "description": "The address the page goes to once it has run.", "type": "string", "pattern": "^/" },
319
+ "cases": {
320
+ "description": "What it does for a call whose input holds `when`, the first that matches; a call none matches gets the defaults beside them.",
321
+ "type": "array",
322
+ "items": {
323
+ "type": "object",
324
+ "properties": {
325
+ "when": { "description": "A subset of its input; absent: any call.", "type": "object", "additionalProperties": true },
326
+ "result": {
327
+ "description": "What it answers. Default: it succeeds, returning nothing.",
328
+ "type": "object",
329
+ "properties": { "success": { "type": "boolean" }, "data": {}, "error": { "type": "string" } },
330
+ "required": ["success"],
331
+ "additionalProperties": false
332
+ },
333
+ "state": {
334
+ "description": "Its surface's observations once it has run, by observation id: each given replaces the one before.",
335
+ "type": "object",
336
+ "additionalProperties": true
337
+ },
338
+ "navigate": { "description": "The address the page goes to once it has run.", "type": "string", "pattern": "^/" }
339
+ },
340
+ "additionalProperties": false
341
+ },
342
+ "minItems": 1
343
+ }
344
+ },
345
+ "required": ["id", "description"],
346
+ "additionalProperties": false
347
+ },
348
+ "AgentEvalPageControl": {
349
+ "description": "One of the product's controls, as the page shows it, and what it does when it runs (default: it takes the value it is given, and succeeds).",
350
+ "type": "object",
351
+ "properties": {
352
+ "value": { "description": "What it shows when the page opens. A run sets it to the value it was given." },
353
+ "title": { "description": "What it is called on screen. Default: the manifest's title.", "type": "string", "minLength": 1 },
354
+ "valueSchema": { "description": "Its live value schema (its options, its range), within the manifest's.", "type": "object" },
355
+ "disabled": { "description": "It cannot be used: it is not offered.", "type": "boolean" },
356
+ "rows": {
357
+ "description": "For a list's control: one per row shown.",
358
+ "type": "array",
359
+ "items": {
360
+ "type": "object",
361
+ "properties": {
362
+ "key": { "type": "string", "minLength": 1 },
363
+ "title": { "type": "string", "minLength": 1 },
364
+ "description": { "type": "string" },
365
+ "value": {}
366
+ },
367
+ "required": ["key", "title"],
368
+ "additionalProperties": false
369
+ }
370
+ },
371
+ "routes": {
372
+ "description": "Where it is mounted, when not wherever its surface is.",
373
+ "type": "array",
374
+ "items": { "type": "string", "pattern": "^/" },
375
+ "uniqueItems": true
376
+ },
377
+ "result": {
378
+ "description": "What it answers. Default: it succeeds, returning nothing.",
379
+ "type": "object",
380
+ "properties": { "success": { "type": "boolean" }, "data": {}, "error": { "type": "string" } },
381
+ "required": ["success"],
382
+ "additionalProperties": false
383
+ },
384
+ "navigate": { "description": "The address the page goes to once it has run.", "type": "string", "pattern": "^/" },
385
+ "cases": {
386
+ "description": "What it does for a call whose input holds `when`, the first that matches; a call none matches gets the defaults beside them.",
387
+ "type": "array",
388
+ "items": {
389
+ "type": "object",
390
+ "properties": {
391
+ "when": { "description": "A subset of its input; absent: any call.", "type": "object", "additionalProperties": true },
392
+ "result": {
393
+ "description": "What it answers. Default: it succeeds, returning nothing.",
394
+ "type": "object",
395
+ "properties": { "success": { "type": "boolean" }, "data": {}, "error": { "type": "string" } },
396
+ "required": ["success"],
397
+ "additionalProperties": false
398
+ },
399
+ "navigate": { "description": "The address the page goes to once it has run.", "type": "string", "pattern": "^/" }
400
+ },
401
+ "additionalProperties": false
402
+ },
403
+ "minItems": 1
404
+ }
405
+ },
406
+ "additionalProperties": false
407
+ },
408
+ "AgentEvalBound": {
409
+ "description": "A number at least `min` and at most `max`.",
410
+ "type": "object",
411
+ "properties": { "min": { "type": "number", "minimum": 0 }, "max": { "type": "number", "minimum": 0 } },
412
+ "minProperties": 1,
413
+ "additionalProperties": false
414
+ },
415
+ "AgentEvalShareBound": {
416
+ "description": "A share, from 0 to 1, at least `min` and at most `max`.",
417
+ "type": "object",
418
+ "properties": { "min": { "type": "number", "minimum": 0, "maximum": 1 }, "max": { "type": "number", "minimum": 0, "maximum": 1 } },
419
+ "minProperties": 1,
420
+ "additionalProperties": false
421
+ },
422
+ "AgentEvalCallCount": {
423
+ "description": "The calls of one tool (`tool`), or of one of the page's actions run through `ui_act` (`action`, by its id or the name the page's index gives it), whose arguments (a tool's) or input (an action's) hold `args` as a subset, counted: exactly `times`, or at least `min` and at most `max`. With none of the three: at least once.",
424
+ "oneOf": [
425
+ {
426
+ "type": "object",
427
+ "properties": {
428
+ "tool": { "type": "string", "minLength": 1 },
429
+ "args": { "type": "object", "additionalProperties": true },
430
+ "times": { "type": "integer", "minimum": 0 },
431
+ "min": { "type": "integer", "minimum": 0 },
432
+ "max": { "type": "integer", "minimum": 0 }
433
+ },
434
+ "required": ["tool"],
435
+ "additionalProperties": false
436
+ },
437
+ {
438
+ "type": "object",
439
+ "properties": {
440
+ "action": { "type": "string", "minLength": 1 },
441
+ "args": { "type": "object", "additionalProperties": true },
442
+ "times": { "type": "integer", "minimum": 0 },
443
+ "min": { "type": "integer", "minimum": 0 },
444
+ "max": { "type": "integer", "minimum": 0 }
445
+ },
446
+ "required": ["action"],
447
+ "additionalProperties": false
448
+ }
449
+ ]
450
+ },
451
+ "AgentEvalUsage": {
452
+ "description": "Bounds on what the turn's model calls used, as the provider reported it. Every bound given must hold.",
453
+ "type": "object",
454
+ "properties": {
455
+ "modelCalls": { "description": "How many model calls the turn made.", "$ref": "#/$defs/AgentEvalBound" },
456
+ "firstCallInputTokens": {
457
+ "description": "The input tokens of the turn's first model call: what the turn costs before it has done anything.",
458
+ "$ref": "#/$defs/AgentEvalBound"
459
+ },
460
+ "callInputTokens": {
461
+ "description": "The input tokens of every one of the turn's model calls: `max` holds the largest, `min` the smallest.",
462
+ "$ref": "#/$defs/AgentEvalBound"
463
+ },
464
+ "inputTokens": { "description": "The input tokens of all the turn's model calls together.", "$ref": "#/$defs/AgentEvalBound" },
465
+ "outputTokens": { "description": "The output tokens of all the turn's model calls together.", "$ref": "#/$defs/AgentEvalBound" },
466
+ "cachedShare": { "description": "The share of the turn's input tokens read from the prompt cache.", "$ref": "#/$defs/AgentEvalShareBound" }
467
+ },
468
+ "minProperties": 1,
469
+ "additionalProperties": false
470
+ },
471
+ "AgentEvalChoicesExpectation": {
472
+ "description": "The choice buttons the turn offered (`present_options`).",
473
+ "type": "object",
474
+ "properties": {
475
+ "options": {
476
+ "description": "Each matches one option offered: its label, or its label and description.",
477
+ "type": "array",
478
+ "items": { "$ref": "#/$defs/AgentEvalTextMatcher" }
479
+ },
480
+ "question": {
481
+ "description": "Each matches what is asked with them: the question, and what it says before it.",
482
+ "type": "array",
483
+ "items": { "$ref": "#/$defs/AgentEvalTextMatcher" }
484
+ },
485
+ "count": { "description": "How many options were offered.", "$ref": "#/$defs/AgentEvalBound" }
486
+ },
487
+ "additionalProperties": false
488
+ },
489
+ "AgentEvalPageExpectation": {
490
+ "description": "What the page did in the turn: where it is, and what ran on it.",
491
+ "type": "object",
492
+ "properties": {
493
+ "at": {
494
+ "description": "Where the page is after the turn: this path, and each query parameter given with the value given.",
495
+ "type": "string",
496
+ "pattern": "^/"
497
+ },
498
+ "ran": {
499
+ "description": "Each ran on the page in the turn (by its id or its index name), its input holding `input` as a subset.",
500
+ "type": "array",
501
+ "items": {
502
+ "type": "object",
503
+ "properties": { "action": { "type": "string", "minLength": 1 }, "input": { "type": "object", "additionalProperties": true } },
504
+ "required": ["action"],
505
+ "additionalProperties": false
506
+ }
507
+ },
508
+ "notRan": {
509
+ "description": "None of these ran on the page in the turn; `*`: nothing did.",
510
+ "type": "array",
511
+ "items": { "type": "string", "minLength": 1 }
512
+ }
513
+ },
514
+ "additionalProperties": false
217
515
  }
218
516
  }
219
517
  }
@@ -223,7 +223,7 @@
223
223
  "$ref": "room-catalog-data.json#/$defs/AgentCatalogManifestEntry"
224
224
  },
225
225
  "personOnly": {
226
- "description": "Export name → why only the person may use it, such as the approval card. The generator refuses an `agent` binding on one.",
226
+ "description": "Export name → why only the person may use it, such as the approval card. The generator refuses an `agent` binding on one, in any package, a design system's included; a person-only export is in no control table.",
227
227
  "type": "object",
228
228
  "additionalProperties": {
229
229
  "type": "string",
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://schemas.closurestudio.ai/oui/v1/json-schema.json",
4
4
  "title": "JsonSchema",
5
- "description": "The subset of JSON Schema (draft 2020-12) every capability declares its input and values in. It is what assistant tool inputs are written in, so a declared or derived schema is used as is. `x-unit` names the unit a number is in: `px`, `%`, `°`; `x-space` names the frame it is measured in; `x-rows` and `x-ref` say which lists hold addressable rows and which inputs address them.",
5
+ "description": "The subset of JSON Schema (draft 2020-12) every capability declares its input and values in. It is what assistant tool inputs are written in, so a declared or derived schema is used as is. `x-unit` names the unit a number is in: `px`, `%`, `°`; `x-space` names the frame it is measured in; `x-rows` and `x-ref` say which lists hold addressable rows and which inputs address them; `x-routes` says which pages a navigation query belongs to.",
6
6
  "type": "object",
7
7
  "properties": {
8
8
  "type": {
@@ -149,6 +149,15 @@
149
149
  },
150
150
  "minItems": 1
151
151
  },
152
+ "x-routes": {
153
+ "description": "On one alternative of the generated `app.navigate` action's `query`: the routes whose page takes that query (`/dashboard/service-lane`). The page declares it (`page-query.json`); the navigation runtime checks a call's query against the alternative of the route it goes to.",
154
+ "type": "array",
155
+ "items": {
156
+ "type": "string",
157
+ "minLength": 1
158
+ },
159
+ "minItems": 1
160
+ },
152
161
  "x-enum-omitted": {
153
162
  "description": "How many allowed values a shortened `enum` leaves out. Only in the page state, where a row's options are summarised; a tool's input schema always lists every value.",
154
163
  "type": "number"
@@ -184,17 +193,17 @@
184
193
  "type": "object",
185
194
  "properties": {
186
195
  "ref": {
187
- "description": "The property of a row that actions address it by (`id`).",
196
+ "description": "The property of a row that actions address it by (`id`), or a dotted path to it (`item.key`).",
188
197
  "type": "string",
189
198
  "minLength": 1
190
199
  },
191
200
  "title": {
192
- "description": "The property of a row a person calls it by (`name`).",
201
+ "description": "The property of a row a person calls it by (`name`), or a dotted path to it (`item.title`).",
193
202
  "type": "string",
194
203
  "minLength": 1
195
204
  },
196
205
  "index": {
197
- "description": "The other properties an index row keeps: the few that tell rows apart (a layer's kind, the artboard it is on).",
206
+ "description": "The other properties an index row keeps, each a property or a dotted path: the few that tell rows apart (a layer's kind, the artboard it is on, the display a fact row belongs to).",
198
207
  "type": "array",
199
208
  "items": {
200
209
  "type": "string"
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://schemas.closurestudio.ai/oui/v1/oui-config.json",
4
4
  "title": "OuiConfigFile",
5
- "description": "`oui.config.json` at the app's root: where the app keeps its routes, navigation and output, which design systems and mappings its controls come from, where its API is described, and which of its pages are not yet bound. Paths are relative to the file. It is required and explicit: nothing an app depends on has a default, so a misconfigured app fails here, naming the setting, instead of generating an assistant that can do nothing. A setting the generator does not know is an error.",
5
+ "description": "`oui.config.json` at the app's root: where the app keeps its routes, navigation and output, which design systems and mappings its controls come from, where its API is described, which of its pages are not yet bound, and which the assistant is never on. Paths are relative to the file. It is required and explicit: nothing an app depends on has a default, so a misconfigured app fails here, naming the setting, instead of generating an assistant that can do nothing. A setting the generator does not know is an error.",
6
6
  "type": "object",
7
7
  "properties": {
8
8
  "$schema": {
@@ -88,6 +88,13 @@
88
88
  "pattern": "\\S"
89
89
  }
90
90
  },
91
+ "outside": {
92
+ "description": "Pages the assistant is never on: pages before sign-in, and public pages a link opens (a share link, a confirmation link). Each names its page by component or by route, with the reason. An outside page has no surface, its controls are not enforced, it is not among the pages the assistant goes to, and the knowledge says the assistant is not there. It is outside only if nothing around it or in it is the assistant's: no `shell` entry frames any of its routes; every element its routes render around it (a layout route's, or a `routeWrappers` component's, at any level) holds nothing someone can use and no person-only component; the page does not render the frame itself; and the page has no binding, display or room of its own (one a component shares with pages the assistant is on is that component's). A page listed here may not also be in `unbound`. Default none.",
93
+ "type": "array",
94
+ "items": {
95
+ "$ref": "#/$defs/OutsideEntry"
96
+ }
97
+ },
91
98
  "appCatalogs": {
92
99
  "description": "Room catalogs the app itself declares (tier 3, a page's own editor), each loaded through the app's own Vite config so its modules resolve as the app build resolves them: the app needs `vite` among its own dependencies. Only their declarations are read. Default none.",
93
100
  "type": "array",
@@ -112,6 +119,55 @@
112
119
  ],
113
120
  "additionalProperties": false,
114
121
  "$defs": {
122
+ "OutsideEntry": {
123
+ "description": "A page the assistant is never on: its page component, or one route it is on, and why. A page on several routes is outside on all of them: named by route, each of its routes is named.",
124
+ "oneOf": [
125
+ {
126
+ "type": "object",
127
+ "properties": {
128
+ "component": {
129
+ "description": "The page component, as the routes name it.",
130
+ "type": "string",
131
+ "minLength": 1,
132
+ "pattern": "\\S"
133
+ },
134
+ "reason": {
135
+ "description": "Why the assistant is never there (\"before sign-in\", \"a public share link\").",
136
+ "type": "string",
137
+ "minLength": 1,
138
+ "pattern": "\\S"
139
+ }
140
+ },
141
+ "required": [
142
+ "component",
143
+ "reason"
144
+ ],
145
+ "additionalProperties": false
146
+ },
147
+ {
148
+ "type": "object",
149
+ "properties": {
150
+ "route": {
151
+ "description": "A route pattern, exactly as the routes give it (`/watch/:clipId`).",
152
+ "type": "string",
153
+ "minLength": 1,
154
+ "pattern": "\\S"
155
+ },
156
+ "reason": {
157
+ "description": "Why the assistant is never there (\"before sign-in\", \"a public share link\").",
158
+ "type": "string",
159
+ "minLength": 1,
160
+ "pattern": "\\S"
161
+ }
162
+ },
163
+ "required": [
164
+ "route",
165
+ "reason"
166
+ ],
167
+ "additionalProperties": false
168
+ }
169
+ ]
170
+ },
115
171
  "ShellEntry": {
116
172
  "description": "One part of the app's frame.",
117
173
  "type": "object",
@@ -0,0 +1,103 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.closurestudio.ai/oui/v1/page-query.json",
4
+ "title": "PageQuery",
5
+ "description": "The query parameters a page reads from its address (`?view=declined&period=this_month`), each by name, declared once with `defineQuery` and read with `readQuery` (`@ouispec/bindings`). The generator reads the declaration where the page, a component it renders or an app hook they call reads it, and the generated `app.navigate` takes it, so the assistant opens the page already filtered to a question, in one call. A page that declares none takes its address as before.\n\n**Every value is a build-time constant**, as a binding's are: a literal, a `const` it can follow (an imported option list too), a property of a constant object, or a template literal or `+` over those.",
6
+ "type": "object",
7
+ "propertyNames": { "pattern": "^[A-Za-z][A-Za-z0-9_.-]{0,63}$" },
8
+ "additionalProperties": { "$ref": "#/$defs/QueryParam" },
9
+ "minProperties": 1,
10
+ "$defs": {
11
+ "QueryParam": {
12
+ "description": "One query parameter: free text, a number, an on/off flag, a day, or one of a list of values.",
13
+ "oneOf": [
14
+ { "$ref": "#/$defs/QueryText" },
15
+ { "$ref": "#/$defs/QueryNumber" },
16
+ { "$ref": "#/$defs/QueryFlag" },
17
+ { "$ref": "#/$defs/QueryDate" },
18
+ { "$ref": "#/$defs/QueryChoice" }
19
+ ]
20
+ },
21
+ "QueryText": {
22
+ "description": "Free text: a name as the page shows it, a search.",
23
+ "type": "object",
24
+ "properties": {
25
+ "type": { "const": "string" },
26
+ "description": { "description": "What the value picks, for someone who cannot see the screen: what to pass and where it comes from.", "type": "string", "minLength": 1 },
27
+ "default": { "description": "What the page shows when the address leaves it out.", "type": "string" },
28
+ "maxLength": { "type": "integer", "minimum": 1 },
29
+ "multiple": { "description": "It takes several values, written comma-separated in the address (`?tags=a,b`). A value cannot hold a comma.", "type": "boolean" }
30
+ },
31
+ "required": ["type", "description"],
32
+ "additionalProperties": false
33
+ },
34
+ "QueryNumber": {
35
+ "description": "A number: a page of a list (`integer`, from 1), a minimum score.",
36
+ "type": "object",
37
+ "properties": {
38
+ "type": { "enum": ["integer", "number"] },
39
+ "description": { "type": "string", "minLength": 1 },
40
+ "default": { "type": "number" },
41
+ "minimum": { "type": "number" },
42
+ "maximum": { "type": "number" },
43
+ "unit": { "description": "The unit the number is in (`%`, `days`, `$`), as `x-unit` names it.", "type": "string", "minLength": 1 }
44
+ },
45
+ "required": ["type", "description"],
46
+ "additionalProperties": false
47
+ },
48
+ "QueryFlag": {
49
+ "description": "On or off: `1` in the address is on, `0` or nothing is off (unless its default is on).",
50
+ "type": "object",
51
+ "properties": {
52
+ "type": { "const": "boolean" },
53
+ "description": { "type": "string", "minLength": 1 },
54
+ "default": { "type": "boolean" }
55
+ },
56
+ "required": ["type", "description"],
57
+ "additionalProperties": false
58
+ },
59
+ "QueryDate": {
60
+ "description": "A day, `YYYY-MM-DD`.",
61
+ "type": "object",
62
+ "properties": {
63
+ "type": { "const": "date" },
64
+ "description": { "type": "string", "minLength": 1 },
65
+ "default": { "description": "`YYYY-MM-DD`.", "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }
66
+ },
67
+ "required": ["type", "description"],
68
+ "additionalProperties": false
69
+ },
70
+ "QueryChoice": {
71
+ "description": "One of a list of values (a view, a period, a status): the list a select or tabs already show, by value and label.",
72
+ "type": "object",
73
+ "properties": {
74
+ "values": {
75
+ "description": "Every value the page takes, each a string or `{ value, label, description }`: the same option list its control renders.",
76
+ "type": "array",
77
+ "items": { "$ref": "#/$defs/QueryValue" },
78
+ "minItems": 1
79
+ },
80
+ "description": { "type": "string", "minLength": 1 },
81
+ "default": { "description": "One of `values`: what the page shows when the address leaves it out.", "type": "string" },
82
+ "multiple": { "description": "It takes several of the values, comma-separated in the address (`?signals=a,b`).", "type": "boolean" }
83
+ },
84
+ "required": ["values", "description"],
85
+ "additionalProperties": false
86
+ },
87
+ "QueryValue": {
88
+ "description": "One value of a choice: the value, or the value with what a person calls it and what it means.",
89
+ "anyOf": [
90
+ { "type": "string", "minLength": 1 },
91
+ {
92
+ "type": "object",
93
+ "properties": {
94
+ "value": { "type": "string", "minLength": 1 },
95
+ "label": { "description": "What a person calls it (`Declined work`).", "type": "string" },
96
+ "description": { "description": "What it means, when its label does not say.", "type": "string" }
97
+ },
98
+ "required": ["value"]
99
+ }
100
+ ]
101
+ }
102
+ }
103
+ }