@ouispec/contract 0.7.0 → 0.10.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.
- package/INTEGRATOR-GUIDE.md +166 -7
- package/dist/generated/contract.d.ts +444 -5
- package/dist/generated/contract.d.ts.map +1 -1
- package/dist/generated/schemas.d.ts +24 -0
- package/dist/generated/schemas.d.ts.map +1 -1
- package/dist/generated/schemas.js +977 -4
- package/dist/generated/schemas.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/render-contract.d.ts.map +1 -1
- package/dist/render-contract.js +1 -0
- package/dist/render-contract.js.map +1 -1
- package/package.json +1 -1
- package/schemas/agent-evals.json +365 -1
- package/schemas/json-schema.json +13 -4
- package/schemas/oui-manifest.json +40 -0
- package/schemas/page-query.json +103 -0
package/schemas/agent-evals.json
CHANGED
|
@@ -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,351 @@
|
|
|
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
|
+
"shown": {
|
|
271
|
+
"description": "What the product's pages show that is not a control (`useAgentFacts`): each display's facts, one entry per card of a list, registered with the binding registry as the product's displays register them, so the page state reports them under `shown` (indexed by `x-rows`, read further with `ui_read`) exactly as the product's tab does. Each is shown while the page is on its `routes` and its address holds its `query`; with no `routes`, where the manifest records the display, else on every page.",
|
|
272
|
+
"type": "array",
|
|
273
|
+
"items": { "$ref": "#/$defs/AgentEvalShown" }
|
|
274
|
+
},
|
|
275
|
+
"problems": {
|
|
276
|
+
"description": "Problems the product's pages show (`useAgentProblems`), registered as the product's page areas register them, so the page reports them in its `problems` observation, or the navigation surface does when no page is open to report them.",
|
|
277
|
+
"type": "array",
|
|
278
|
+
"items": { "$ref": "#/$defs/AgentEvalProblems" }
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
"required": ["at"],
|
|
282
|
+
"additionalProperties": false
|
|
283
|
+
},
|
|
284
|
+
"AgentEvalShown": {
|
|
285
|
+
"description": "One display's facts, in the shape the runtime reports them under the page state's `shown`, and where the page shows them.",
|
|
286
|
+
"type": "object",
|
|
287
|
+
"properties": {
|
|
288
|
+
"id": { "description": "The display's binding id.", "type": "string", "minLength": 1 },
|
|
289
|
+
"title": { "description": "Its heading, as the page shows it. Default: the title the manifest records for the display, else its id.", "type": "string", "minLength": 1 },
|
|
290
|
+
"facts": {
|
|
291
|
+
"description": "Each fact by its label. Reported as text, as `useAgentFacts` reports it: a number or flag is written out, and an empty one is left out.",
|
|
292
|
+
"type": "object",
|
|
293
|
+
"additionalProperties": { "anyOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] }
|
|
294
|
+
},
|
|
295
|
+
"item": { "description": "The row of a list it describes, when it is one of many (a card each): how the page state's `x-rows` addresses and indexes it.", "$ref": "agent-binding.json#/$defs/AgentItem" },
|
|
296
|
+
"routes": { "$ref": "#/$defs/AgentEvalShownRoutes" },
|
|
297
|
+
"query": { "$ref": "#/$defs/AgentEvalShownQuery" }
|
|
298
|
+
},
|
|
299
|
+
"required": ["id", "facts"],
|
|
300
|
+
"additionalProperties": false
|
|
301
|
+
},
|
|
302
|
+
"AgentEvalProblems": {
|
|
303
|
+
"description": "Problems one area of the page shows, in the shape the runtime reports them, and where the page shows them.",
|
|
304
|
+
"type": "object",
|
|
305
|
+
"properties": {
|
|
306
|
+
"source": { "description": "The binding id of the page area that shows them (`useAgentProblems(source, …)`). Default: `page`.", "type": "string", "minLength": 1 },
|
|
307
|
+
"problems": { "type": "array", "items": { "$ref": "room-catalog-data.json#/$defs/RoomProblem" } },
|
|
308
|
+
"routes": { "$ref": "#/$defs/AgentEvalShownRoutes" },
|
|
309
|
+
"query": { "$ref": "#/$defs/AgentEvalShownQuery" }
|
|
310
|
+
},
|
|
311
|
+
"required": ["problems"],
|
|
312
|
+
"additionalProperties": false
|
|
313
|
+
},
|
|
314
|
+
"AgentEvalShownRoutes": {
|
|
315
|
+
"description": "Where the page shows it, as route patterns.",
|
|
316
|
+
"type": "array",
|
|
317
|
+
"items": { "type": "string", "pattern": "^/" },
|
|
318
|
+
"uniqueItems": true
|
|
319
|
+
},
|
|
320
|
+
"AgentEvalShownQuery": {
|
|
321
|
+
"description": "Shown only while the page's address holds these query parameters, each read as the page's declared query reads it (`readQuery`, its default for one the address leaves out), or as written when the page declares none. A list of several values is written comma-separated.",
|
|
322
|
+
"type": "object",
|
|
323
|
+
"additionalProperties": { "anyOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }] }
|
|
324
|
+
},
|
|
325
|
+
"AgentEvalPageSurface": {
|
|
326
|
+
"description": "A surface of the page: its actions, and what it reports.",
|
|
327
|
+
"type": "object",
|
|
328
|
+
"properties": {
|
|
329
|
+
"id": { "type": "string", "minLength": 1 },
|
|
330
|
+
"name": { "type": "string", "minLength": 1 },
|
|
331
|
+
"description": { "type": "string", "minLength": 1 },
|
|
332
|
+
"routes": {
|
|
333
|
+
"description": "Where it is mounted, as route patterns. Absent: on every page, as a shell is.",
|
|
334
|
+
"type": "array",
|
|
335
|
+
"items": { "type": "string", "pattern": "^/" },
|
|
336
|
+
"uniqueItems": true
|
|
337
|
+
},
|
|
338
|
+
"state": { "description": "What it reports when the page opens, by observation id.", "type": "object", "additionalProperties": true },
|
|
339
|
+
"shown": {
|
|
340
|
+
"description": "What it shows that is not an action, as a page's displays report it: its `state` observation's `shown`, declared with `x-rows` as a generated page's is, so a long list keeps an index of its rows and the rest is read with `ui_read`. A `shown` its `state` gives itself, or an action leaves, is reported instead.",
|
|
341
|
+
"type": "array",
|
|
342
|
+
"items": { "$ref": "#/$defs/AgentEvalShown" }
|
|
343
|
+
},
|
|
344
|
+
"problems": {
|
|
345
|
+
"description": "The problems it shows: its `problems` observation, as a page's. One its `state` gives, or an action leaves, is reported instead.",
|
|
346
|
+
"type": "array",
|
|
347
|
+
"items": { "$ref": "#/$defs/AgentEvalProblems" }
|
|
348
|
+
},
|
|
349
|
+
"actions": { "type": "array", "items": { "$ref": "#/$defs/AgentEvalPageAction" } }
|
|
350
|
+
},
|
|
351
|
+
"required": ["id", "name", "description", "actions"],
|
|
352
|
+
"additionalProperties": false
|
|
353
|
+
},
|
|
354
|
+
"AgentEvalPageAction": {
|
|
355
|
+
"description": "An action of a declared surface, and what it does when it runs.",
|
|
356
|
+
"type": "object",
|
|
357
|
+
"properties": {
|
|
358
|
+
"id": { "description": "As the page's index names it, and `ui_act` takes it.", "type": "string", "minLength": 1 },
|
|
359
|
+
"title": { "type": "string", "minLength": 1 },
|
|
360
|
+
"description": { "type": "string", "minLength": 1 },
|
|
361
|
+
"effect": {
|
|
362
|
+
"description": "What it changes (oui-spec's effect kinds).",
|
|
363
|
+
"enum": ["view", "selection", "navigate", "open", "edit", "file", "mutate", "job", "transaction"]
|
|
364
|
+
},
|
|
365
|
+
"confirm": { "description": "It asks the person to approve it first.", "type": "boolean" },
|
|
366
|
+
"input": { "description": "What it takes, as a JSON Schema. Default: nothing.", "type": "object" },
|
|
367
|
+
"result": {
|
|
368
|
+
"description": "What it answers. Default: it succeeds, returning nothing.",
|
|
369
|
+
"type": "object",
|
|
370
|
+
"properties": { "success": { "type": "boolean" }, "data": {}, "error": { "type": "string" } },
|
|
371
|
+
"required": ["success"],
|
|
372
|
+
"additionalProperties": false
|
|
373
|
+
},
|
|
374
|
+
"state": {
|
|
375
|
+
"description": "Its surface's observations once it has run, by observation id: each given replaces the one before.",
|
|
376
|
+
"type": "object",
|
|
377
|
+
"additionalProperties": true
|
|
378
|
+
},
|
|
379
|
+
"navigate": { "description": "The address the page goes to once it has run.", "type": "string", "pattern": "^/" },
|
|
380
|
+
"cases": {
|
|
381
|
+
"description": "What it does for a call whose input holds `when`, the first that matches; a call none matches gets the defaults beside them.",
|
|
382
|
+
"type": "array",
|
|
383
|
+
"items": {
|
|
384
|
+
"type": "object",
|
|
385
|
+
"properties": {
|
|
386
|
+
"when": { "description": "A subset of its input; absent: any call.", "type": "object", "additionalProperties": true },
|
|
387
|
+
"result": {
|
|
388
|
+
"description": "What it answers. Default: it succeeds, returning nothing.",
|
|
389
|
+
"type": "object",
|
|
390
|
+
"properties": { "success": { "type": "boolean" }, "data": {}, "error": { "type": "string" } },
|
|
391
|
+
"required": ["success"],
|
|
392
|
+
"additionalProperties": false
|
|
393
|
+
},
|
|
394
|
+
"state": {
|
|
395
|
+
"description": "Its surface's observations once it has run, by observation id: each given replaces the one before.",
|
|
396
|
+
"type": "object",
|
|
397
|
+
"additionalProperties": true
|
|
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
|
+
"required": ["id", "description"],
|
|
407
|
+
"additionalProperties": false
|
|
408
|
+
},
|
|
409
|
+
"AgentEvalPageControl": {
|
|
410
|
+
"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).",
|
|
411
|
+
"type": "object",
|
|
412
|
+
"properties": {
|
|
413
|
+
"value": { "description": "What it shows when the page opens. A run sets it to the value it was given." },
|
|
414
|
+
"query": {
|
|
415
|
+
"description": "The query parameter of the page's address it shows, as a page that reads its filters with `readQuery` and writes them with `writeQuery` does: on a page whose declared query (the manifest's `app.navigate`) takes it, its value is the address's, read as the declaration reads it (its default when the address leaves it out; `value` when there is none), it follows the address whenever the page goes to another, and a run writes the value it is given to the address. Not for a list's control (`rows`).",
|
|
416
|
+
"type": "string",
|
|
417
|
+
"minLength": 1
|
|
418
|
+
},
|
|
419
|
+
"title": { "description": "What it is called on screen. Default: the manifest's title.", "type": "string", "minLength": 1 },
|
|
420
|
+
"valueSchema": { "description": "Its live value schema (its options, its range), within the manifest's.", "type": "object" },
|
|
421
|
+
"disabled": { "description": "It cannot be used: it is not offered.", "type": "boolean" },
|
|
422
|
+
"rows": {
|
|
423
|
+
"description": "For a list's control: one per row shown.",
|
|
424
|
+
"type": "array",
|
|
425
|
+
"items": {
|
|
426
|
+
"type": "object",
|
|
427
|
+
"properties": {
|
|
428
|
+
"key": { "type": "string", "minLength": 1 },
|
|
429
|
+
"title": { "type": "string", "minLength": 1 },
|
|
430
|
+
"description": { "type": "string" },
|
|
431
|
+
"value": {}
|
|
432
|
+
},
|
|
433
|
+
"required": ["key", "title"],
|
|
434
|
+
"additionalProperties": false
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
"routes": {
|
|
438
|
+
"description": "Where it is mounted, when not wherever its surface is.",
|
|
439
|
+
"type": "array",
|
|
440
|
+
"items": { "type": "string", "pattern": "^/" },
|
|
441
|
+
"uniqueItems": true
|
|
442
|
+
},
|
|
443
|
+
"result": {
|
|
444
|
+
"description": "What it answers. Default: it succeeds, returning nothing.",
|
|
445
|
+
"type": "object",
|
|
446
|
+
"properties": { "success": { "type": "boolean" }, "data": {}, "error": { "type": "string" } },
|
|
447
|
+
"required": ["success"],
|
|
448
|
+
"additionalProperties": false
|
|
449
|
+
},
|
|
450
|
+
"navigate": { "description": "The address the page goes to once it has run.", "type": "string", "pattern": "^/" },
|
|
451
|
+
"cases": {
|
|
452
|
+
"description": "What it does for a call whose input holds `when`, the first that matches; a call none matches gets the defaults beside them.",
|
|
453
|
+
"type": "array",
|
|
454
|
+
"items": {
|
|
455
|
+
"type": "object",
|
|
456
|
+
"properties": {
|
|
457
|
+
"when": { "description": "A subset of its input; absent: any call.", "type": "object", "additionalProperties": true },
|
|
458
|
+
"result": {
|
|
459
|
+
"description": "What it answers. Default: it succeeds, returning nothing.",
|
|
460
|
+
"type": "object",
|
|
461
|
+
"properties": { "success": { "type": "boolean" }, "data": {}, "error": { "type": "string" } },
|
|
462
|
+
"required": ["success"],
|
|
463
|
+
"additionalProperties": false
|
|
464
|
+
},
|
|
465
|
+
"navigate": { "description": "The address the page goes to once it has run.", "type": "string", "pattern": "^/" }
|
|
466
|
+
},
|
|
467
|
+
"additionalProperties": false
|
|
468
|
+
},
|
|
469
|
+
"minItems": 1
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
"additionalProperties": false
|
|
473
|
+
},
|
|
474
|
+
"AgentEvalBound": {
|
|
475
|
+
"description": "A number at least `min` and at most `max`.",
|
|
476
|
+
"type": "object",
|
|
477
|
+
"properties": { "min": { "type": "number", "minimum": 0 }, "max": { "type": "number", "minimum": 0 } },
|
|
478
|
+
"minProperties": 1,
|
|
479
|
+
"additionalProperties": false
|
|
480
|
+
},
|
|
481
|
+
"AgentEvalShareBound": {
|
|
482
|
+
"description": "A share, from 0 to 1, at least `min` and at most `max`.",
|
|
483
|
+
"type": "object",
|
|
484
|
+
"properties": { "min": { "type": "number", "minimum": 0, "maximum": 1 }, "max": { "type": "number", "minimum": 0, "maximum": 1 } },
|
|
485
|
+
"minProperties": 1,
|
|
486
|
+
"additionalProperties": false
|
|
487
|
+
},
|
|
488
|
+
"AgentEvalCallCount": {
|
|
489
|
+
"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.",
|
|
490
|
+
"oneOf": [
|
|
491
|
+
{
|
|
492
|
+
"type": "object",
|
|
493
|
+
"properties": {
|
|
494
|
+
"tool": { "type": "string", "minLength": 1 },
|
|
495
|
+
"args": { "type": "object", "additionalProperties": true },
|
|
496
|
+
"times": { "type": "integer", "minimum": 0 },
|
|
497
|
+
"min": { "type": "integer", "minimum": 0 },
|
|
498
|
+
"max": { "type": "integer", "minimum": 0 }
|
|
499
|
+
},
|
|
500
|
+
"required": ["tool"],
|
|
501
|
+
"additionalProperties": false
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
"type": "object",
|
|
505
|
+
"properties": {
|
|
506
|
+
"action": { "type": "string", "minLength": 1 },
|
|
507
|
+
"args": { "type": "object", "additionalProperties": true },
|
|
508
|
+
"times": { "type": "integer", "minimum": 0 },
|
|
509
|
+
"min": { "type": "integer", "minimum": 0 },
|
|
510
|
+
"max": { "type": "integer", "minimum": 0 }
|
|
511
|
+
},
|
|
512
|
+
"required": ["action"],
|
|
513
|
+
"additionalProperties": false
|
|
514
|
+
}
|
|
515
|
+
]
|
|
516
|
+
},
|
|
517
|
+
"AgentEvalUsage": {
|
|
518
|
+
"description": "Bounds on what the turn's model calls used, as the provider reported it. Every bound given must hold.",
|
|
519
|
+
"type": "object",
|
|
520
|
+
"properties": {
|
|
521
|
+
"modelCalls": { "description": "How many model calls the turn made.", "$ref": "#/$defs/AgentEvalBound" },
|
|
522
|
+
"firstCallInputTokens": {
|
|
523
|
+
"description": "The input tokens of the turn's first model call: what the turn costs before it has done anything.",
|
|
524
|
+
"$ref": "#/$defs/AgentEvalBound"
|
|
525
|
+
},
|
|
526
|
+
"callInputTokens": {
|
|
527
|
+
"description": "The input tokens of every one of the turn's model calls: `max` holds the largest, `min` the smallest.",
|
|
528
|
+
"$ref": "#/$defs/AgentEvalBound"
|
|
529
|
+
},
|
|
530
|
+
"inputTokens": { "description": "The input tokens of all the turn's model calls together.", "$ref": "#/$defs/AgentEvalBound" },
|
|
531
|
+
"outputTokens": { "description": "The output tokens of all the turn's model calls together.", "$ref": "#/$defs/AgentEvalBound" },
|
|
532
|
+
"cachedShare": { "description": "The share of the turn's input tokens read from the prompt cache.", "$ref": "#/$defs/AgentEvalShareBound" }
|
|
533
|
+
},
|
|
534
|
+
"minProperties": 1,
|
|
535
|
+
"additionalProperties": false
|
|
536
|
+
},
|
|
537
|
+
"AgentEvalChoicesExpectation": {
|
|
538
|
+
"description": "The choice buttons the turn offered (`present_options`).",
|
|
539
|
+
"type": "object",
|
|
540
|
+
"properties": {
|
|
541
|
+
"options": {
|
|
542
|
+
"description": "Each matches one option offered: its label, or its label and description.",
|
|
543
|
+
"type": "array",
|
|
544
|
+
"items": { "$ref": "#/$defs/AgentEvalTextMatcher" }
|
|
545
|
+
},
|
|
546
|
+
"question": {
|
|
547
|
+
"description": "Each matches what is asked with them: the question, and what it says before it.",
|
|
548
|
+
"type": "array",
|
|
549
|
+
"items": { "$ref": "#/$defs/AgentEvalTextMatcher" }
|
|
550
|
+
},
|
|
551
|
+
"count": { "description": "How many options were offered.", "$ref": "#/$defs/AgentEvalBound" }
|
|
552
|
+
},
|
|
553
|
+
"additionalProperties": false
|
|
554
|
+
},
|
|
555
|
+
"AgentEvalPageExpectation": {
|
|
556
|
+
"description": "What the page did in the turn: where it is, and what ran on it.",
|
|
557
|
+
"type": "object",
|
|
558
|
+
"properties": {
|
|
559
|
+
"at": {
|
|
560
|
+
"description": "Where the page is after the turn: this path, and each query parameter given with the value given.",
|
|
561
|
+
"type": "string",
|
|
562
|
+
"pattern": "^/"
|
|
563
|
+
},
|
|
564
|
+
"ran": {
|
|
565
|
+
"description": "Each ran on the page in the turn (by its id or its index name), its input holding `input` as a subset.",
|
|
566
|
+
"type": "array",
|
|
567
|
+
"items": {
|
|
568
|
+
"type": "object",
|
|
569
|
+
"properties": { "action": { "type": "string", "minLength": 1 }, "input": { "type": "object", "additionalProperties": true } },
|
|
570
|
+
"required": ["action"],
|
|
571
|
+
"additionalProperties": false
|
|
572
|
+
}
|
|
573
|
+
},
|
|
574
|
+
"notRan": {
|
|
575
|
+
"description": "None of these ran on the page in the turn; `*`: nothing did.",
|
|
576
|
+
"type": "array",
|
|
577
|
+
"items": { "type": "string", "minLength": 1 }
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
"additionalProperties": false
|
|
217
581
|
}
|
|
218
582
|
}
|
|
219
583
|
}
|
package/schemas/json-schema.json
CHANGED
|
@@ -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"
|
|
@@ -293,6 +293,39 @@
|
|
|
293
293
|
"navigation"
|
|
294
294
|
]
|
|
295
295
|
},
|
|
296
|
+
"ManifestDisplay": {
|
|
297
|
+
"description": "One display a page shows: what reports its facts under the page state's `shown`.",
|
|
298
|
+
"type": "object",
|
|
299
|
+
"properties": {
|
|
300
|
+
"id": {
|
|
301
|
+
"description": "Its binding id: the `id` of its entries in `shown`.",
|
|
302
|
+
"type": "string",
|
|
303
|
+
"minLength": 1
|
|
304
|
+
},
|
|
305
|
+
"title": {
|
|
306
|
+
"description": "Its heading, as the build reads it.",
|
|
307
|
+
"type": "string"
|
|
308
|
+
},
|
|
309
|
+
"description": {
|
|
310
|
+
"description": "What it shows, from its binding.",
|
|
311
|
+
"type": "string"
|
|
312
|
+
},
|
|
313
|
+
"labels": {
|
|
314
|
+
"description": "The labels of its facts the build can read.",
|
|
315
|
+
"type": "array",
|
|
316
|
+
"items": {
|
|
317
|
+
"type": "string"
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
"required": [
|
|
322
|
+
"id",
|
|
323
|
+
"title",
|
|
324
|
+
"description",
|
|
325
|
+
"labels"
|
|
326
|
+
],
|
|
327
|
+
"additionalProperties": false
|
|
328
|
+
},
|
|
296
329
|
"ManifestSurface": {
|
|
297
330
|
"description": "One surface: what it offers, where it can be mounted, and what it reports.",
|
|
298
331
|
"type": "object",
|
|
@@ -329,6 +362,13 @@
|
|
|
329
362
|
"items": {
|
|
330
363
|
"$ref": "#/$defs/ManifestObservation"
|
|
331
364
|
}
|
|
365
|
+
},
|
|
366
|
+
"displays": {
|
|
367
|
+
"description": "What a page or shell shows that is not a control (`useAgentFacts`): each display it renders, by binding id, whose facts its state reports under `shown`. Absent when it renders none, and in a manifest generated before 0.10.",
|
|
368
|
+
"type": "array",
|
|
369
|
+
"items": {
|
|
370
|
+
"$ref": "#/$defs/ManifestDisplay"
|
|
371
|
+
}
|
|
332
372
|
}
|
|
333
373
|
},
|
|
334
374
|
"required": [
|
|
@@ -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
|
+
}
|