@ouispec/contract 0.9.0 → 0.11.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.
@@ -1145,22 +1145,49 @@ export const CONTRACT_SCHEMAS = {
1145
1145
  "$ref": "control-kind-registration.json#/$defs/SchemaProps"
1146
1146
  },
1147
1147
  "display": {
1148
- "description": "It shows facts rather than taking input (a clip's parameters): a binding on it names what it shows, and the page reports its facts by label. Its facts are the array prop `itemsProp`, each labelled by `labelKey`. Not a control, so a use without a binding is not unbound.",
1148
+ "description": "It reports what it shows (`useAgentFacts`): its facts by label, under a binding the page declares, which the manifest records as one of the page's `displays`. One that only shows facts (a clip's parameters, a stat) has no `kind`, `slots` or `entries`: it is not a control, so a use without a binding is not unbound. A control or a composite that also reports what it shows (a card bound to open, a list) keeps its `kind`, `slots` or `entries` beside it. It reports under its own `agent`; a composite, under its `agent`'s `slot` binding when the page gives one, else under the first of its `parts` the page bound (as that row, when the composite has an `item`).",
1149
1149
  "type": "object",
1150
1150
  "properties": {
1151
1151
  "itemsProp": {
1152
+ "description": "An array prop that holds its facts, each labelled by `labelKey`.",
1152
1153
  "type": "string",
1153
1154
  "minLength": 1
1154
1155
  },
1155
1156
  "labelKey": {
1157
+ "description": "The key of each entry of `itemsProp` that holds its label.",
1156
1158
  "type": "string",
1157
1159
  "minLength": 1
1160
+ },
1161
+ "labels": {
1162
+ "description": "Labels of facts it reports that the page does not write (a stat's `Change`), which the manifest records with the display.",
1163
+ "type": "array",
1164
+ "items": {
1165
+ "type": "string",
1166
+ "minLength": 1
1167
+ }
1168
+ },
1169
+ "slot": {
1170
+ "description": "A composite's: the key of its `agent` that names what it shows apart from its controls (`facts`), as `{ id, description }`.",
1171
+ "type": "string",
1172
+ "minLength": 1
1173
+ },
1174
+ "parts": {
1175
+ "description": "A composite's: the slots whose binding it reports under, in order, when the page gives no `slot` binding.",
1176
+ "type": "array",
1177
+ "items": {
1178
+ "type": "string",
1179
+ "minLength": 1
1180
+ }
1158
1181
  }
1159
1182
  },
1160
- "required": [
1161
- "itemsProp",
1162
- "labelKey"
1163
- ],
1183
+ "dependentRequired": {
1184
+ "itemsProp": [
1185
+ "labelKey"
1186
+ ],
1187
+ "labelKey": [
1188
+ "itemsProp"
1189
+ ]
1190
+ },
1164
1191
  "additionalProperties": false
1165
1192
  },
1166
1193
  "titleProps": {
@@ -2258,6 +2285,39 @@ export const CONTRACT_SCHEMAS = {
2258
2285
  "navigation"
2259
2286
  ]
2260
2287
  },
2288
+ "ManifestDisplay": {
2289
+ "description": "One display a page shows: what reports its facts under the page state's `shown`.",
2290
+ "type": "object",
2291
+ "properties": {
2292
+ "id": {
2293
+ "description": "Its binding id: the `id` of its entries in `shown`.",
2294
+ "type": "string",
2295
+ "minLength": 1
2296
+ },
2297
+ "title": {
2298
+ "description": "Its heading, as the build reads it.",
2299
+ "type": "string"
2300
+ },
2301
+ "description": {
2302
+ "description": "What it shows, from its binding.",
2303
+ "type": "string"
2304
+ },
2305
+ "labels": {
2306
+ "description": "The labels of its facts the build can read.",
2307
+ "type": "array",
2308
+ "items": {
2309
+ "type": "string"
2310
+ }
2311
+ }
2312
+ },
2313
+ "required": [
2314
+ "id",
2315
+ "title",
2316
+ "description",
2317
+ "labels"
2318
+ ],
2319
+ "additionalProperties": false
2320
+ },
2261
2321
  "ManifestSurface": {
2262
2322
  "description": "One surface: what it offers, where it can be mounted, and what it reports.",
2263
2323
  "type": "object",
@@ -2294,6 +2354,13 @@ export const CONTRACT_SCHEMAS = {
2294
2354
  "items": {
2295
2355
  "$ref": "#/$defs/ManifestObservation"
2296
2356
  }
2357
+ },
2358
+ "displays": {
2359
+ "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.",
2360
+ "type": "array",
2361
+ "items": {
2362
+ "$ref": "#/$defs/ManifestDisplay"
2363
+ }
2297
2364
  }
2298
2365
  },
2299
2366
  "required": [
@@ -4740,6 +4807,20 @@ export const CONTRACT_SCHEMAS = {
4740
4807
  "allControls": {
4741
4808
  "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.",
4742
4809
  "type": "boolean"
4810
+ },
4811
+ "shown": {
4812
+ "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.",
4813
+ "type": "array",
4814
+ "items": {
4815
+ "$ref": "#/$defs/AgentEvalShown"
4816
+ }
4817
+ },
4818
+ "problems": {
4819
+ "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.",
4820
+ "type": "array",
4821
+ "items": {
4822
+ "$ref": "#/$defs/AgentEvalProblems"
4823
+ }
4743
4824
  }
4744
4825
  },
4745
4826
  "required": [
@@ -4747,6 +4828,107 @@ export const CONTRACT_SCHEMAS = {
4747
4828
  ],
4748
4829
  "additionalProperties": false
4749
4830
  },
4831
+ "AgentEvalShown": {
4832
+ "description": "One display's facts, in the shape the runtime reports them under the page state's `shown`, and where the page shows them.",
4833
+ "type": "object",
4834
+ "properties": {
4835
+ "id": {
4836
+ "description": "The display's binding id.",
4837
+ "type": "string",
4838
+ "minLength": 1
4839
+ },
4840
+ "title": {
4841
+ "description": "Its heading, as the page shows it. Default: the title the manifest records for the display, else its id.",
4842
+ "type": "string",
4843
+ "minLength": 1
4844
+ },
4845
+ "facts": {
4846
+ "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.",
4847
+ "type": "object",
4848
+ "additionalProperties": {
4849
+ "anyOf": [
4850
+ {
4851
+ "type": "string"
4852
+ },
4853
+ {
4854
+ "type": "number"
4855
+ },
4856
+ {
4857
+ "type": "boolean"
4858
+ }
4859
+ ]
4860
+ }
4861
+ },
4862
+ "item": {
4863
+ "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.",
4864
+ "$ref": "agent-binding.json#/$defs/AgentItem"
4865
+ },
4866
+ "routes": {
4867
+ "$ref": "#/$defs/AgentEvalShownRoutes"
4868
+ },
4869
+ "query": {
4870
+ "$ref": "#/$defs/AgentEvalShownQuery"
4871
+ }
4872
+ },
4873
+ "required": [
4874
+ "id",
4875
+ "facts"
4876
+ ],
4877
+ "additionalProperties": false
4878
+ },
4879
+ "AgentEvalProblems": {
4880
+ "description": "Problems one area of the page shows, in the shape the runtime reports them, and where the page shows them.",
4881
+ "type": "object",
4882
+ "properties": {
4883
+ "source": {
4884
+ "description": "The binding id of the page area that shows them (`useAgentProblems(source, …)`). Default: `page`.",
4885
+ "type": "string",
4886
+ "minLength": 1
4887
+ },
4888
+ "problems": {
4889
+ "type": "array",
4890
+ "items": {
4891
+ "$ref": "room-catalog-data.json#/$defs/RoomProblem"
4892
+ }
4893
+ },
4894
+ "routes": {
4895
+ "$ref": "#/$defs/AgentEvalShownRoutes"
4896
+ },
4897
+ "query": {
4898
+ "$ref": "#/$defs/AgentEvalShownQuery"
4899
+ }
4900
+ },
4901
+ "required": [
4902
+ "problems"
4903
+ ],
4904
+ "additionalProperties": false
4905
+ },
4906
+ "AgentEvalShownRoutes": {
4907
+ "description": "Where the page shows it, as route patterns.",
4908
+ "type": "array",
4909
+ "items": {
4910
+ "type": "string",
4911
+ "pattern": "^/"
4912
+ },
4913
+ "uniqueItems": true
4914
+ },
4915
+ "AgentEvalShownQuery": {
4916
+ "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.",
4917
+ "type": "object",
4918
+ "additionalProperties": {
4919
+ "anyOf": [
4920
+ {
4921
+ "type": "string"
4922
+ },
4923
+ {
4924
+ "type": "number"
4925
+ },
4926
+ {
4927
+ "type": "boolean"
4928
+ }
4929
+ ]
4930
+ }
4931
+ },
4750
4932
  "AgentEvalPageSurface": {
4751
4933
  "description": "A surface of the page: its actions, and what it reports.",
4752
4934
  "type": "object",
@@ -4777,6 +4959,20 @@ export const CONTRACT_SCHEMAS = {
4777
4959
  "type": "object",
4778
4960
  "additionalProperties": true
4779
4961
  },
4962
+ "shown": {
4963
+ "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.",
4964
+ "type": "array",
4965
+ "items": {
4966
+ "$ref": "#/$defs/AgentEvalShown"
4967
+ }
4968
+ },
4969
+ "problems": {
4970
+ "description": "The problems it shows: its `problems` observation, as a page's. One its `state` gives, or an action leaves, is reported instead.",
4971
+ "type": "array",
4972
+ "items": {
4973
+ "$ref": "#/$defs/AgentEvalProblems"
4974
+ }
4975
+ },
4780
4976
  "actions": {
4781
4977
  "type": "array",
4782
4978
  "items": {
@@ -4915,6 +5111,11 @@ export const CONTRACT_SCHEMAS = {
4915
5111
  "value": {
4916
5112
  "description": "What it shows when the page opens. A run sets it to the value it was given."
4917
5113
  },
5114
+ "query": {
5115
+ "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`).",
5116
+ "type": "string",
5117
+ "minLength": 1
5118
+ },
4918
5119
  "title": {
4919
5120
  "description": "What it is called on screen. Default: the manifest's title.",
4920
5121
  "type": "string",
@@ -5291,6 +5492,7 @@ export const CONTRACT_TYPES = {
5291
5492
  ManifestAction: 'oui-manifest.json#/$defs/ManifestAction',
5292
5493
  ManifestObservation: 'oui-manifest.json#/$defs/ManifestObservation',
5293
5494
  ManifestSurfaceKind: 'oui-manifest.json#/$defs/ManifestSurfaceKind',
5495
+ ManifestDisplay: 'oui-manifest.json#/$defs/ManifestDisplay',
5294
5496
  ManifestSurface: 'oui-manifest.json#/$defs/ManifestSurface',
5295
5497
  GeneratedKnowledge: 'generated-knowledge.json',
5296
5498
  KnowledgeEntry: 'generated-knowledge.json#/$defs/KnowledgeEntry',
@@ -5363,6 +5565,10 @@ export const CONTRACT_TYPES = {
5363
5565
  AgentEvalStubCase: 'agent-evals.json#/$defs/AgentEvalStubCase',
5364
5566
  AgentEvalStubs: 'agent-evals.json#/$defs/AgentEvalStubs',
5365
5567
  AgentEvalPage: 'agent-evals.json#/$defs/AgentEvalPage',
5568
+ AgentEvalShown: 'agent-evals.json#/$defs/AgentEvalShown',
5569
+ AgentEvalProblems: 'agent-evals.json#/$defs/AgentEvalProblems',
5570
+ AgentEvalShownRoutes: 'agent-evals.json#/$defs/AgentEvalShownRoutes',
5571
+ AgentEvalShownQuery: 'agent-evals.json#/$defs/AgentEvalShownQuery',
5366
5572
  AgentEvalPageSurface: 'agent-evals.json#/$defs/AgentEvalPageSurface',
5367
5573
  AgentEvalPageAction: 'agent-evals.json#/$defs/AgentEvalPageAction',
5368
5574
  AgentEvalPageControl: 'agent-evals.json#/$defs/AgentEvalPageControl',