@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/INTEGRATOR-GUIDE.md
CHANGED
|
@@ -41,6 +41,7 @@ Every schema of the contract is versioned together by `MANIFEST_VERSION`, and th
|
|
|
41
41
|
| [`json-schema.json`](schemas/json-schema.json) | `JsonSchema` | `https://schemas.closurestudio.ai/oui/v1/json-schema.json` |
|
|
42
42
|
| [`action-effect.json`](schemas/action-effect.json) | `ActionEffect` | `https://schemas.closurestudio.ai/oui/v1/action-effect.json` |
|
|
43
43
|
| [`agent-binding.json`](schemas/agent-binding.json) | `AgentBinding` | `https://schemas.closurestudio.ai/oui/v1/agent-binding.json` |
|
|
44
|
+
| [`page-query.json`](schemas/page-query.json) | `PageQuery` | `https://schemas.closurestudio.ai/oui/v1/page-query.json` |
|
|
44
45
|
| [`control-kind-registration.json`](schemas/control-kind-registration.json) | `ControlKindRegistration` | `https://schemas.closurestudio.ai/oui/v1/control-kind-registration.json` |
|
|
45
46
|
| [`control-table.json`](schemas/control-table.json) | `ControlTableFile` | `https://schemas.closurestudio.ai/oui/v1/control-table.json` |
|
|
46
47
|
| [`tier2-mapping.json`](schemas/tier2-mapping.json) | `Tier2Mapping` | `https://schemas.closurestudio.ai/oui/v1/tier2-mapping.json` |
|
|
@@ -411,7 +412,7 @@ const catalog: RoomCatalog<LedgerContext> = {
|
|
|
411
412
|
};
|
|
412
413
|
```
|
|
413
414
|
|
|
414
|
-
- **`x-rows`** on the list in the observation's schema says how a row is addressed (`ref`), what a person calls it (`title`), and what an index row keeps. A list too long for the page state is cut to index rows, never to a count; the selected rows, and the rows an action just changed, stay whole.
|
|
415
|
+
- **`x-rows`** on the list in the observation's schema says how a row is addressed (`ref`), what a person calls it (`title`), and what an index row keeps, each a property of the row or a dotted path into it (`item.key`). A list too long for the page state is cut to index rows, never to a count; the selected rows, and the rows an action just changed, stay whole.
|
|
415
416
|
- **`roomReaders`** makes the room's `inspect` (everything about the rows named) and `query` (a list's rows, narrowed by an indexed property or by name, a page at a time). Both only read.
|
|
416
417
|
- **`x-ref`** on an input that takes a row (`{ type: 'string', ...refTo(POSITIONS) }`) names the list it addresses. The runtime then takes a row's exact name where its id is expected, when one row has it, and refuses an ambiguous one with the ids it could mean.
|
|
417
418
|
- **`changed`** on an action's result reports the rows it changed, added or removed, each as `inspect` would return it now (`changedRows(lists, ctx, refs)`), so the assistant checks an edit against what the room holds, not against what it meant to do.
|
|
@@ -422,9 +423,9 @@ The generator refuses a catalog whose observation lists things with an `id` and
|
|
|
422
423
|
>
|
|
423
424
|
> | Field | Type | Required | What it is |
|
|
424
425
|
> |---|---|---|---|
|
|
425
|
-
> | `ref` | string | yes | The property of a row that actions address it by (`id`). |
|
|
426
|
-
> | `title` | string | yes | The property of a row a person calls it by (`name`). |
|
|
427
|
-
> | `index` | string[] | | The other properties an index row keeps: the few that tell rows apart (a layer's kind, the artboard it is on). |
|
|
426
|
+
> | `ref` | string | yes | The property of a row that actions address it by (`id`), or a dotted path to it (`item.key`). |
|
|
427
|
+
> | `title` | string | yes | The property of a row a person calls it by (`name`), or a dotted path to it (`item.title`). |
|
|
428
|
+
> | `index` | string[] | | 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). |
|
|
428
429
|
> | `selection` | string | | The property beside the list, in the same object, that holds the refs of the rows the person has selected. |
|
|
429
430
|
|
|
430
431
|
> **Schema:** [`room-catalog-data.json#/$defs/RoomChangedRow`](schemas/room-catalog-data.json) · `https://schemas.closurestudio.ai/oui/v1/room-catalog-data.json#/$defs/RoomChangedRow` · TypeScript: `RoomChangedRow` from `@ouispec/contract`
|
|
@@ -471,6 +472,7 @@ Every input, value and observation schema, here and in tier 1, is written in the
|
|
|
471
472
|
> | `x-space` | string | | The frame a length, a point or a fraction is measured in, in the room's own words: `artboard` (from its top left), `canvas`, `layer` (the layer's own content), `artboard-fraction` (0–1 of the artboard's width and height). |
|
|
472
473
|
> | `x-rows` | RowList | | On an array of objects in an observation: the list is a collection the assistant addresses rows of (a document's layers, its artboards). |
|
|
473
474
|
> | `x-ref` | string[] | | On a string (or the items of an array of strings) in an action's input: the value addresses a row of one of the surface's `x-rows` lists, each named `<observation id>/<list property>`, or `<observation id>` when the observation itself is the list. |
|
|
475
|
+
> | `x-routes` | string[] | | On one alternative of the generated `app.navigate` action's `query`: the routes whose page takes that query (`/dashboard/service-lane`). |
|
|
474
476
|
> | `x-enum-omitted` | number | | How many allowed values a shortened `enum` leaves out. |
|
|
475
477
|
> | `x-oui-attachment` | { as: "file" \| "text", mediaTypes?: string[] } | | On a string with `format: oui-attachment`: what the action takes once the client resolves the attachment's id. |
|
|
476
478
|
|
|
@@ -636,10 +638,58 @@ A page's action definitions weigh what its whole catalogue weighs. On a studio p
|
|
|
636
638
|
- **Only the newest answer carries the page's state to the model.** Every earlier answer of the turn keeps what its action did (its result, the rows it changed, what the page offers since) and says where the state is, so a turn of many actions costs about what one does, plus what each did.
|
|
637
639
|
- **UI actions are not counted against a per-tool quota:** they run as the person, bounded by the turn's steps and deadline. What is refused is a loop: the same call with the same input, once it has changed nothing three times in a row. Undo five times is five undos.
|
|
638
640
|
- **Every answer is fitted to a byte budget before it is sent** (480 KB by default, 256 KB for a snapshot). The action's own result is kept whole. Long lists in the page's state are cut first, and the answer says where, so the assistant can read the rest with `ui_read` or a room's `query`.
|
|
641
|
+
- **What a page shows keeps an index too.** A page reports its displays' facts under `shown` in its state, and a display that describes one row of a list (a card each) carries the row as `item`. The page state declares `x-rows` on `shown` (`ref: item.key`, `title: item.title`, `index: [id]`), and the bindings report each display's rows together. The manifest records each display a page or shell shows (`displays`: its binding id, title, description and the labels the build can read), so a test can name it as the build does. Over budget, the page's own facts stay whole, and a long list of cards keeps its first rows whole and the rest as index rows (the display, the row's key and title), the rows an action just changed whole. When even the index does not fit, the list says how many rows are left out and the `ui_read` call (`path: /shown`, `offset`, `limit`) that returns exactly them, one display at a time.
|
|
639
642
|
- **The assistant never changes a page it cannot see.** After an answer that arrived without the page's state, or no answer, the worker runs only reads until one succeeds. After two refused changes in a row, the assistant stops and tells the person what it could not confirm.
|
|
640
643
|
|
|
641
644
|
Nothing here is written per feature: the index, the outlines and the fitting are computed from the declarations.
|
|
642
645
|
|
|
646
|
+
## Going to a page, already filtered
|
|
647
|
+
|
|
648
|
+
The generator gives every build one navigation surface, `app:navigation`, with one action, `app.navigate` (tool `app_navigate`): go to a page by its address, as following a link does. Its `path` lists every page's route with its title. `connectBindings({ navigation })` runs it with the app's router.
|
|
649
|
+
|
|
650
|
+
A list page that keeps its filters in its address (`/dashboard/service-lane?view=declined&period=this_month`) can be opened by the assistant exactly as the person asked, in one call, when the page declares the query it reads. The page declares it once, where it reads it:
|
|
651
|
+
|
|
652
|
+
```ts
|
|
653
|
+
import { defineQuery, readQuery, writeQuery } from '@ouispec/bindings';
|
|
654
|
+
|
|
655
|
+
export const LANE_QUERY = defineQuery({
|
|
656
|
+
view: { values: LANE_VIEWS, default: 'lane', description: 'The open lane, or closed repair orders with declined work' },
|
|
657
|
+
period: { values: DECLINED_PERIODS, default: 'this_month', description: 'The declined list’s period' },
|
|
658
|
+
advisor: { type: 'string', description: 'A service advisor, by name as the lane shows it' },
|
|
659
|
+
page: { type: 'integer', minimum: 1, default: 1, description: 'The page of the list' },
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
function ServiceLanePage() {
|
|
663
|
+
const [searchParams, setSearchParams] = useSearchParams();
|
|
664
|
+
const query = readQuery(LANE_QUERY, searchParams); // { view: 'lane' | 'declined', period, advisor?: string, page: number }
|
|
665
|
+
const setView = (view: string) => setSearchParams(writeQuery(LANE_QUERY, searchParams, { view, page: undefined }));
|
|
666
|
+
// …
|
|
667
|
+
}
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
- `values` is the option list the page's select or tabs already render: strings, or `{ value, label, description }`. Other kinds are `type: 'string'` (free text), `'integer'` or `'number'` (with `minimum`, `maximum`, `unit`), `'boolean'` (`1` on, `0` off) and `'date'` (`YYYY-MM-DD`). `multiple: true` takes several, comma-separated.
|
|
671
|
+
- `readQuery` reads the address as the declaration says: a value the page does not take falls back to its `default` (or is left out), so a hand-edited address never breaks the page. `writeQuery` writes changes back and leaves out a default or empty value, so the plain address stays plain.
|
|
672
|
+
- The generator finds `readQuery(<a defineQuery constant>, …)` in the page, in a component it renders, or in an app hook they call, and fails the build when the declaration is not a build-time constant or does not match the schema below, or when two declarations on one page give the same parameter different meanings.
|
|
673
|
+
|
|
674
|
+
What the build then offers:
|
|
675
|
+
|
|
676
|
+
- `app.navigate` takes `query` beside `path`: one alternative per page that declares one, each with `x-routes` naming its routes and a property per parameter (`enum` and meanings, range, default). `path` names the parameters beside each such page (`/dashboard/service-lane (Service lane; ?view, ?period, ?advisor, ?page)`), and the page's knowledge lists them.
|
|
677
|
+
- `params` fills a route's `:parameters` when `path` is written as its route (`{ "path": "/dashboard/inventory/:unitId", "params": { "unitId": "u 7" } }` goes to `/dashboard/inventory/u%207`).
|
|
678
|
+
- The runtime builds the address from the path, `params` and `query`, encoding each part. It refuses a path that is not one of the build's routes, one that could leave the app (`//host`, a backslash, a scheme, `.` or `..` segments), a query parameter a declaring page does not take, and a value it does not accept, naming what the page takes. A query in `path` itself (`?view=declined`) is read the same way. A page that declares no query takes its address as before.
|
|
679
|
+
- Going to the address the person is already on does nothing, and says so (`alreadyThere`).
|
|
680
|
+
- A page known only by its manifest reads its address the same way: `pageQueryOf` reads a page's alternative of `query` back into the declaration `readQuery` and `writeQuery` take (its values, ranges and defaults; a choice's labels are not in it), so a test page shows the filters the address holds (an eval's `controls` bound by `query`). `generatedNavigationSurface` is the navigation surface the generator emits, for a page made without a manifest.
|
|
681
|
+
|
|
682
|
+
> **Schema:** [`page-query.json`](schemas/page-query.json) · `https://schemas.closurestudio.ai/oui/v1/page-query.json` · TypeScript: `PageQuery` from `@ouispec/contract`
|
|
683
|
+
|
|
684
|
+
> **Schema:** [`page-query.json#/$defs/QueryChoice`](schemas/page-query.json) · `https://schemas.closurestudio.ai/oui/v1/page-query.json#/$defs/QueryChoice` · TypeScript: `QueryChoice` from `@ouispec/contract`
|
|
685
|
+
>
|
|
686
|
+
> | Field | Type | Required | What it is |
|
|
687
|
+
> |---|---|---|---|
|
|
688
|
+
> | `values` | QueryValue[] | yes | Every value the page takes, each a string or `{ value, label, description }`: the same option list its control renders. |
|
|
689
|
+
> | `description` | string | yes | |
|
|
690
|
+
> | `default` | string | | One of `values`: what the page shows when the address leaves it out. |
|
|
691
|
+
> | `multiple` | boolean | | It takes several of the values, comma-separated in the address (`?signals=a,b`). |
|
|
692
|
+
|
|
643
693
|
## Work that outlives the call: the job effect
|
|
644
694
|
|
|
645
695
|
A binding or room action whose work finishes later — a render, an export, an order that fills — declares `effect: { kind: 'job', estimatedDuration?, timeoutMs? }`, and its handler returns `{ ok: true, pending: { jobId } }`. The action is reported `started` at once, then settles on the job's outcome: `complete` when its completion arrives, `failed` when its failure does, and after `timeoutMs` (default five minutes) a `timeout` failure, never a late success. With no tracker, or no job id, it is `unverified`: started, but not confirmable from the page. Three rules make this hold, and the kit checks the first: every `run` returns its callback's result; a job is tracked at dispatch, not at the first poll; a disabled job control is still followed.
|
|
@@ -1025,6 +1075,10 @@ A person on the product's staff can take a live conversation from the agent, ans
|
|
|
1025
1075
|
| `refusal` | the reply declines (`true`: the usual phrasing; or a matcher) |
|
|
1026
1076
|
| `doesNotStore` | the matchers appear nowhere the turn stored: its text, its tool arguments, its tool results |
|
|
1027
1077
|
| `held` | the turn ran no model call, because a person held the conversation |
|
|
1078
|
+
| `calls` | each tool (`tool`), or each of the page's actions run through `ui_act` (`action`, by its id or its index name), was called exactly `times`, or `min` to `max` times (none given: at least once), counting only calls whose arguments or input hold `args` |
|
|
1079
|
+
| `usage` | the turn's model calls stayed within each bound: `modelCalls`, `firstCallInputTokens`, `callInputTokens` (every call), `inputTokens` and `outputTokens` (all of them), and `cachedShare` (the share of its input read from the prompt cache, 0 to 1), as the provider reported them |
|
|
1080
|
+
| `choices` | the turn offered choice buttons (`present_options`) with an option matching each of `options`, a question matching each of `question`, and a `count` of options within its bound (`false`: it offered none) |
|
|
1081
|
+
| `page` | the page is `at` that path after the turn (with a query string, those parameters too), each of `ran` ran on it with input holding `input`, and none of `notRan` did (`*`: nothing) |
|
|
1028
1082
|
|
|
1029
1083
|
```yaml
|
|
1030
1084
|
version: 1
|
|
@@ -1044,7 +1098,44 @@ scenarios:
|
|
|
1044
1098
|
mustNotSay: [{ pattern: "per month|/mo|APR", flags: i }]
|
|
1045
1099
|
```
|
|
1046
1100
|
|
|
1047
|
-
**Every tool is stubbed.** A stub is data in the suite or the scenario (`when`, a subset of the call's arguments; `result`), first match wins, the scenario's first; or a function in the configuration. A call to a tool with no stub fails the scenario: an eval never reaches your backend.
|
|
1101
|
+
**Every tool is stubbed.** A stub is data in the suite or the scenario (`when`, a subset of the call's arguments; `result`), first match wins, the scenario's first; or a function in the configuration. A call to a tool with no stub fails the scenario: an eval never reaches your backend. The SDK's own interaction tools (`present_options`, `confirm_action`, `request_user_decision`) reach no backend, so with no stub they run as they are, and the choices they offer are read from the turn.
|
|
1102
|
+
|
|
1103
|
+
**The person's page.** A suite, or a scenario in its place (`page: false` for none), declares the page its turns are sent from (`AgentEvalPage`). The harness runs it on a real oui-spec surface runtime in index form, sends every turn from wherever the page is, with its snapshot and its address (`oui`, `currentPath`, and `uiKnowledge` when the configuration gives your knowledge), and answers the agent's `ui_act`, `ui_describe` and `ui_read` from it, as the person's tab would. Its surfaces are either declared in the suite (`surfaces`: each one's `routes`, its observations as `state`, and its actions, each with the `result` it answers, the `state` it leaves and the address it goes to, by `cases` on its input), or are your own: give the configuration your generated manifest (`page: { manifest, knowledge }`) and name your controls by binding id (`controls`: each one's value, rows and what it does; `allControls` mounts the rest of a surface's, empty). They are registered with a real binding registry and connected with `connectBindings`, as your tab does, so the agent is offered exactly what your build declares. Going to a page (`app.navigate`) mounts what is at the new address; the next turn is sent from there.
|
|
1104
|
+
|
|
1105
|
+
**What the page shows.** A page's numbers and a list's cards are not controls: your displays report them with `useAgentFacts`, and the page state carries them under `shown`. The fixture declares them in the same shape (`shown`: each display's `id`, `title`, `facts` by label and, for a card of a list, its row as `item`), and they are registered with the binding registry as your displays register them, so the page state reports them exactly as your tab does: by display, a long list kept as an index of its rows (`x-rows`), the rest read with `ui_read` at the display's own offset. A display is named by its binding id, which your manifest records on the page that shows it (`displays`, from 0.10): an id it does not record fails the page, a title left out is the manifest's, and an entry with no `routes` is shown where its page is. As in your tab, the page reports them while its surface is mounted, that is while one of its controls is (`controls`, or `allControls`). The problems your page areas show (`useAgentProblems`) are declared the same way (`problems`: each area's `source` and its `problems`), and reported with the page, or with the navigation surface when no page is open to report them. Either is shown only on its `routes` and while the address holds its `query` (read with the page's declared query, its defaults included), so the declined tab's cards are on the page only at `?view=declined`. A surface declared in the suite takes `shown` and `problems` too, as its `state` and `problems` observations.
|
|
1106
|
+
|
|
1107
|
+
**Filters in the address.** A control bound to a query parameter (`query`: the name the page's `defineQuery` declares) shows the address's value, read as the page's `readQuery` reads it (its default when the address leaves it out, else the control's `value`). It follows the address when `app.navigate` goes to the page with another query, and a run writes the value it is given to the address, as the page's `writeQuery` does, so what is shown at that query follows too. The declarations are your manifest's, as the generator records them in `app.navigate`'s `query`; a parameter no page declares fails the page.
|
|
1108
|
+
|
|
1109
|
+
```yaml
|
|
1110
|
+
page:
|
|
1111
|
+
at: /dashboard
|
|
1112
|
+
controls:
|
|
1113
|
+
service-lane.view: { query: view }
|
|
1114
|
+
service-lane.declined.advisor: {}
|
|
1115
|
+
shown:
|
|
1116
|
+
- { id: home.gross, facts: { Gross: $182k, Deals: 41 } }
|
|
1117
|
+
- id: lane.ro-card
|
|
1118
|
+
title: RO 7002
|
|
1119
|
+
facts: { Customer: Dana Reyes, Declined: $640 }
|
|
1120
|
+
item: { key: ro-7002, title: RO 7002 · Dana Reyes }
|
|
1121
|
+
query: { view: declined }
|
|
1122
|
+
scenarios:
|
|
1123
|
+
- id: declined-work-opens-the-lane
|
|
1124
|
+
title: Opens the service lane once, on its declined work, and pastes nothing
|
|
1125
|
+
turns:
|
|
1126
|
+
- user: Show me the declined work
|
|
1127
|
+
expect:
|
|
1128
|
+
page: { at: /dashboard/service-lane?view=declined, notRan: [service-lane.view] }
|
|
1129
|
+
calls: [{ action: app.navigate, times: 1 }, { tool: listRepairOrders, times: 0 }]
|
|
1130
|
+
says: [RO 7002]
|
|
1131
|
+
usage: { firstCallInputTokens: { max: 20000 }, callInputTokens: { max: 40000 } }
|
|
1132
|
+
```
|
|
1133
|
+
|
|
1134
|
+
**Your conversation store.** By default the harness keeps the whole conversation. To run later turns on what your worker really reads (a window that cuts old tool results, a summary, a step context), give the configuration `history`: your store as `EvalHistory` (`append`, `getHistory`, `persistMessages`), or `createMemoryHistory({ window })` with your window over the whole conversation. `getHistory` (and `window`) is given the worker's request and the turn it reads for (`request.turn`: its id and place, the suite, scenario and channel, the customer as `user`, the context it is sent with, which names its view and carries the page's, and where the page is, `at`), which your worker reads from the turn's payload: a step context written from the page the turn is sent from needs no `beforeTurn` to note it.
|
|
1135
|
+
|
|
1136
|
+
**Your agent's settings.** `agent` returns what your worker runs with, `modelProviderOptions`, `forcedToolChoice` and `uiActions` (its waits and how much of the page the model reads; the channel is the page's) included.
|
|
1137
|
+
|
|
1138
|
+
**The judge.** A rubric's verdict is asked for as structured output, which the provider gives its own way (a JSON schema, a forced tool, or instructions for a model that refuses one); an answer that is still no verdict is read as text, then asked for again (`judgeOptions: { retries, maxOutputTokens }`). A judge that never gives one is reported apart: the case is `unjudged`, not failed (`JUDGE` in the report, an `error` in JUnit, exit 3 when nothing failed).
|
|
1048
1139
|
|
|
1049
1140
|
**Channels.** Your configuration names them, and what each changes: `approvals` (the card, `ui`, or a conversation channel, `chat`, `sms`, `voice`, `phone`, where the readback is sent and the next message confirms it), `input` (what each customer message carries as `context.input`, so a voice channel marks it spoken), and `context`. The turn carries its channel, and the worker tells the model about approvals in that channel's terms. Every scenario runs on every channel of its suite unless it names fewer, so a change that breaks SMS and not web chat fails.
|
|
1050
1141
|
|
|
@@ -1073,9 +1164,9 @@ export default defineEvals({
|
|
|
1073
1164
|
});
|
|
1074
1165
|
```
|
|
1075
1166
|
|
|
1076
|
-
**Run it.** `agent-evals` (in CI: replays the recordings), `agent-evals --record` (runs the live model and writes them), `agent-evals --live` (runs it and writes nothing). `--channel` and `--scenario` narrow a run; `--json` and `--junit` write reports. It exits 1 when any case fails, listing each failed assertion with its turn, channel and the reply. In a test runner, `evalCases(config)` gives one case per scenario and channel, each throwing with every failure.
|
|
1167
|
+
**Run it.** `agent-evals` (in CI: replays the recordings), `agent-evals --record` (runs the live model and writes them), `agent-evals --live` (runs it and writes nothing). `--channel` and `--scenario` narrow a run; `--json` and `--junit` write reports. It exits 1 when any case fails, listing each failed assertion with its turn, channel and the reply, and 3 when none failed but a rubric could not be judged. In a test runner, `evalCases(config)` gives one case per scenario and channel, each throwing with every failure.
|
|
1077
1168
|
|
|
1078
|
-
**A recording knows what it was recorded against**: your system prompt, your tools' names, descriptions and schemas, the scenario's turns and the channel. Change any of them and its replay fails until you record it again, rather than passing on answers to a question no longer asked.
|
|
1169
|
+
**A recording knows what it was recorded against**: your system prompt, your tools' names, descriptions and schemas, the scenario's turns, its page and the channel. Change any of them and its replay fails until you record it again, rather than passing on answers to a question no longer asked.
|
|
1079
1170
|
|
|
1080
1171
|
The package ships an example: a fake dealer tool set, with scenarios for disclosure, price and no payments, an injected instruction, an SSN refused and not stored, a request for a person, a booking that runs only after its readback is confirmed, and a take-over and hand-back, on web chat, SMS and voice.
|
|
1081
1172
|
|
|
@@ -1089,6 +1180,7 @@ The package ships an example: a fake dealer tool set, with scenarios for disclos
|
|
|
1089
1180
|
> | `channels` | AgentEvalChannelList | | The channels every scenario runs on, as the eval configuration names them (`web_chat`, `sms`, `voice`). |
|
|
1090
1181
|
> | `context` | object | | What every turn of every scenario carries as its context, before the channel's and the scenario's own. |
|
|
1091
1182
|
> | `stubs` | AgentEvalStubs | | What each tool returns, for every scenario; a scenario's own stubs come first. |
|
|
1183
|
+
> | `page` | AgentEvalPage | | The person's page, scripted, for every scenario: what it offers at each address and what its actions do. |
|
|
1092
1184
|
> | `scenarios` | AgentEvalScenario[] | yes | |
|
|
1093
1185
|
|
|
1094
1186
|
> **Schema:** [`agent-evals.json#/$defs/AgentEvalExpectation`](schemas/agent-evals.json) · `https://schemas.closurestudio.ai/oui/v1/agent-evals.json#/$defs/AgentEvalExpectation` · TypeScript: `AgentEvalExpectation` from `@ouispec/contract`
|
|
@@ -1103,6 +1195,10 @@ The package ships an example: a fake dealer tool set, with scenarios for disclos
|
|
|
1103
1195
|
> | `refusal` | true \| AgentEvalTextMatcher | | The reply declines: `true` for the usual phrasing of a refusal (can't, cannot, unable, not able, won't, not allowed), or a matcher for the agent's own words. |
|
|
1104
1196
|
> | `doesNotStore` | AgentEvalTextMatcher[] | | None of these appears in anything the turn stored: its text, its tool calls' arguments, its tool results. |
|
|
1105
1197
|
> | `held` | boolean | | `true`: the turn ran no model call, because a person held the conversation. |
|
|
1198
|
+
> | `calls` | AgentEvalCallCount[] | | How many times each tool, or each of the page's actions, was called in the turn. |
|
|
1199
|
+
> | `usage` | AgentEvalUsage | | What the turn's model calls used, as the provider reported it. |
|
|
1200
|
+
> | `choices` | false \| AgentEvalChoicesExpectation | | The turn offered the person choice buttons (`present_options`) that match; `false`: it offered none. |
|
|
1201
|
+
> | `page` | AgentEvalPageExpectation | | What the page did in the turn, read from the page itself. |
|
|
1106
1202
|
|
|
1107
1203
|
> **Schema:** [`agent-evals.json#/$defs/AgentEvalStubCase`](schemas/agent-evals.json) · `https://schemas.closurestudio.ai/oui/v1/agent-evals.json#/$defs/AgentEvalStubCase` · TypeScript: `AgentEvalStubCase` from `@ouispec/contract`
|
|
1108
1204
|
>
|
|
@@ -1110,3 +1206,66 @@ The package ships an example: a fake dealer tool set, with scenarios for disclos
|
|
|
1110
1206
|
> |---|---|---|---|
|
|
1111
1207
|
> | `when` | object | | |
|
|
1112
1208
|
> | `result` | { success: boolean, data?: any, error?: string } | yes | |
|
|
1209
|
+
|
|
1210
|
+
> **Schema:** [`agent-evals.json#/$defs/AgentEvalPage`](schemas/agent-evals.json) · `https://schemas.closurestudio.ai/oui/v1/agent-evals.json#/$defs/AgentEvalPage` · TypeScript: `AgentEvalPage` from `@ouispec/contract`
|
|
1211
|
+
>
|
|
1212
|
+
> | Field | Type | Required | What it is |
|
|
1213
|
+
> |---|---|---|---|
|
|
1214
|
+
> | `at` | string | yes | The address the first turn is sent from. |
|
|
1215
|
+
> | `routes` | string[] | | The addresses going to a page accepts, as route patterns (`/leads/:id`), when the manifest declares no navigation surface of its own. |
|
|
1216
|
+
> | `navigation` | boolean | | 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. |
|
|
1217
|
+
> | `surfaces` | AgentEvalPageSurface[] | | Surfaces declared here, each mounted while the page is at one of its routes. |
|
|
1218
|
+
> | `controls` | map of AgentEvalPageControl | | 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. |
|
|
1219
|
+
> | `allControls` | boolean | | Also mount every other control the manifest declares on a surface that is mounted, with no value, as an empty form shows them. |
|
|
1220
|
+
> | `shown` | AgentEvalShown[] | | 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. |
|
|
1221
|
+
> | `problems` | AgentEvalProblems[] | | 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. |
|
|
1222
|
+
|
|
1223
|
+
> **Schema:** [`agent-evals.json#/$defs/AgentEvalPageAction`](schemas/agent-evals.json) · `https://schemas.closurestudio.ai/oui/v1/agent-evals.json#/$defs/AgentEvalPageAction` · TypeScript: `AgentEvalPageAction` from `@ouispec/contract`
|
|
1224
|
+
>
|
|
1225
|
+
> | Field | Type | Required | What it is |
|
|
1226
|
+
> |---|---|---|---|
|
|
1227
|
+
> | `id` | string | yes | As the page's index names it, and `ui_act` takes it. |
|
|
1228
|
+
> | `title` | string | | |
|
|
1229
|
+
> | `description` | string | yes | |
|
|
1230
|
+
> | `effect` | "view" \| "selection" \| "navigate" \| "open" \| "edit" \| "file" \| … | | What it changes (oui-spec's effect kinds). |
|
|
1231
|
+
> | `confirm` | boolean | | It asks the person to approve it first. |
|
|
1232
|
+
> | `input` | object | | What it takes, as a JSON Schema. |
|
|
1233
|
+
> | `result` | { success: boolean, data?: any, error?: string } | | What it answers. |
|
|
1234
|
+
> | `state` | object | | Its surface's observations once it has run, by observation id: each given replaces the one before. |
|
|
1235
|
+
> | `navigate` | string | | The address the page goes to once it has run. |
|
|
1236
|
+
> | `cases` | { when?: object, result?: { success: boolean, data?: any, error?: string }, state?: object, navigate?: string }[] | | What it does for a call whose input holds `when`, the first that matches; a call none matches gets the defaults beside them. |
|
|
1237
|
+
|
|
1238
|
+
> **Schema:** [`agent-evals.json#/$defs/AgentEvalPageControl`](schemas/agent-evals.json) · `https://schemas.closurestudio.ai/oui/v1/agent-evals.json#/$defs/AgentEvalPageControl` · TypeScript: `AgentEvalPageControl` from `@ouispec/contract`
|
|
1239
|
+
>
|
|
1240
|
+
> | Field | Type | Required | What it is |
|
|
1241
|
+
> |---|---|---|---|
|
|
1242
|
+
> | `value` | any | | What it shows when the page opens. |
|
|
1243
|
+
> | `query` | string | | 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. |
|
|
1244
|
+
> | `title` | string | | What it is called on screen. |
|
|
1245
|
+
> | `valueSchema` | object | | Its live value schema (its options, its range), within the manifest's. |
|
|
1246
|
+
> | `disabled` | boolean | | It cannot be used: it is not offered. |
|
|
1247
|
+
> | `rows` | { key: string, title: string, description?: string, value?: any }[] | | For a list's control: one per row shown. |
|
|
1248
|
+
> | `routes` | string[] | | Where it is mounted, when not wherever its surface is. |
|
|
1249
|
+
> | `result` | { success: boolean, data?: any, error?: string } | | What it answers. |
|
|
1250
|
+
> | `navigate` | string | | The address the page goes to once it has run. |
|
|
1251
|
+
> | `cases` | { when?: object, result?: { success: boolean, data?: any, error?: string }, navigate?: string }[] | | What it does for a call whose input holds `when`, the first that matches; a call none matches gets the defaults beside them. |
|
|
1252
|
+
|
|
1253
|
+
> **Schema:** [`agent-evals.json#/$defs/AgentEvalShown`](schemas/agent-evals.json) · `https://schemas.closurestudio.ai/oui/v1/agent-evals.json#/$defs/AgentEvalShown` · TypeScript: `AgentEvalShown` from `@ouispec/contract`
|
|
1254
|
+
>
|
|
1255
|
+
> | Field | Type | Required | What it is |
|
|
1256
|
+
> |---|---|---|---|
|
|
1257
|
+
> | `id` | string | yes | The display's binding id. |
|
|
1258
|
+
> | `title` | string | | Its heading, as the page shows it. |
|
|
1259
|
+
> | `facts` | map of string \| number \| boolean | yes | Each fact by its label. |
|
|
1260
|
+
> | `item` | AgentItem | | 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. |
|
|
1261
|
+
> | `routes` | AgentEvalShownRoutes | | |
|
|
1262
|
+
> | `query` | AgentEvalShownQuery | | |
|
|
1263
|
+
|
|
1264
|
+
> **Schema:** [`agent-evals.json#/$defs/AgentEvalProblems`](schemas/agent-evals.json) · `https://schemas.closurestudio.ai/oui/v1/agent-evals.json#/$defs/AgentEvalProblems` · TypeScript: `AgentEvalProblems` from `@ouispec/contract`
|
|
1265
|
+
>
|
|
1266
|
+
> | Field | Type | Required | What it is |
|
|
1267
|
+
> |---|---|---|---|
|
|
1268
|
+
> | `source` | string | | The binding id of the page area that shows them (`useAgentProblems(source, …)`). |
|
|
1269
|
+
> | `problems` | RoomProblem[] | yes | |
|
|
1270
|
+
> | `routes` | AgentEvalShownRoutes | | |
|
|
1271
|
+
> | `query` | AgentEvalShownQuery | | |
|