@rayspec/spec 1.5.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/LICENSE +105 -0
- package/dist/brace-params.d.ts +32 -0
- package/dist/brace-params.d.ts.map +1 -0
- package/dist/brace-params.js +89 -0
- package/dist/brace-params.js.map +1 -0
- package/dist/detect.d.ts +44 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/detect.js +72 -0
- package/dist/detect.js.map +1 -0
- package/dist/errors.d.ts +204 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +165 -0
- package/dist/errors.js.map +1 -0
- package/dist/export.d.ts +54 -0
- package/dist/export.d.ts.map +1 -0
- package/dist/export.js +121 -0
- package/dist/export.js.map +1 -0
- package/dist/grammar.d.ts +569 -0
- package/dist/grammar.d.ts.map +1 -0
- package/dist/grammar.js +503 -0
- package/dist/grammar.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/lint.d.ts +79 -0
- package/dist/lint.d.ts.map +1 -0
- package/dist/lint.js +823 -0
- package/dist/lint.js.map +1 -0
- package/dist/parse.d.ts +8 -0
- package/dist/parse.d.ts.map +1 -0
- package/dist/parse.js +118 -0
- package/dist/parse.js.map +1 -0
- package/dist/product-events.d.ts +73 -0
- package/dist/product-events.d.ts.map +1 -0
- package/dist/product-events.js +42 -0
- package/dist/product-events.js.map +1 -0
- package/dist/product-grammar.d.ts +948 -0
- package/dist/product-grammar.d.ts.map +1 -0
- package/dist/product-grammar.js +581 -0
- package/dist/product-grammar.js.map +1 -0
- package/dist/product-lint.d.ts +74 -0
- package/dist/product-lint.d.ts.map +1 -0
- package/dist/product-lint.js +821 -0
- package/dist/product-lint.js.map +1 -0
- package/dist/product-parse.d.ts +8 -0
- package/dist/product-parse.d.ts.map +1 -0
- package/dist/product-parse.js +119 -0
- package/dist/product-parse.js.map +1 -0
- package/dist/product-scope.d.ts +53 -0
- package/dist/product-scope.d.ts.map +1 -0
- package/dist/product-scope.js +55 -0
- package/dist/product-scope.js.map +1 -0
- package/dist/product-views-lint.d.ts +14 -0
- package/dist/product-views-lint.d.ts.map +1 -0
- package/dist/product-views-lint.js +669 -0
- package/dist/product-views-lint.js.map +1 -0
- package/dist/product-views.d.ts +426 -0
- package/dist/product-views.d.ts.map +1 -0
- package/dist/product-views.js +317 -0
- package/dist/product-views.js.map +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-grammar.d.ts","sourceRoot":"","sources":["../src/product-grammar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,eAAO,MAAM,eAAe;;;;;;kBAWjB,CAAC;AACZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAM9D,eAAO,MAAM,YAAY;;kBAId,CAAC;AACZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAMxD,0FAA0F;AAC1F,eAAO,MAAM,cAAc;;EAAgB,CAAC;AAC5C,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;;;EAAuD,CAAC;AACrF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;kBAMhB,CAAC;AACZ,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB;;;kBAgB1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M,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE,eAAO,MAAM,mBAAmB;;;;kBAIrB,CAAC;AACZ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAMtE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmBb,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Product-YAML grammar — `ProductSpec` and its sections.
|
|
3
|
+
*
|
|
4
|
+
* A Product-YAML document declares PRODUCT MEANING ONLY (Tier C — the Product-YAML
|
|
5
|
+
* program): product identity, required Tier-B capabilities, product-owned artifact kinds + response
|
|
6
|
+
* contracts, declarative TYPED PRODUCT STORES (data shape, never handlers/SQL),
|
|
7
|
+
* declarative agent EXTRACTION contracts, workflow COMPOSITION over Tier A/B primitives, grounding
|
|
8
|
+
* policy, and declarative view/read contracts. It is a DIFFERENT document family from `RaySpec`
|
|
9
|
+
* (grammar.ts): its `extractors` are extraction contracts (not backend/model/instructions wrappers),
|
|
10
|
+
* and it deliberately has NO `handlers`/`tooling`/`api` — the whole point is that NO product-owned backend
|
|
11
|
+
* code lives here (that belongs in Tier A/B). The minimal typed `stores` section below reuses the
|
|
12
|
+
* backend column vocabulary so the derived output stays a standard `StoreSpec`. The two
|
|
13
|
+
* profiles share ONE `version:'1.0'` key and are told apart by the presence of the `product:`
|
|
14
|
+
* section (the archetype discriminant) at the parse/deploy/CLI layer (`detect.ts`); the backend
|
|
15
|
+
* profile (`RaySpec`) IS the internal engine target and its shape stays byte-unchanged.
|
|
16
|
+
*
|
|
17
|
+
* ENFORCEMENT POINT: this module IS the real, fail-closed parser for the product profile — the closed
|
|
18
|
+
* grammar is enforced here (an unknown key is rejected — see below), not merely described. The product
|
|
19
|
+
* profile carries the unified production version literal `'1.0'` (the product profile of one language).
|
|
20
|
+
*
|
|
21
|
+
* FAIL-CLOSED BY CONSTRUCTION: every object level is `.strict()` (an unknown key is rejected — no
|
|
22
|
+
* silent passthrough, mirroring grammar.ts). The `contracts[]` values are INTENTIONALLY open
|
|
23
|
+
* records (they ARE JSON-Schema-like payloads) — their CLOSED vocabulary is enforced separately
|
|
24
|
+
* by `product-lint.ts`, exactly as `RaySpec` validates a tool's `parameters` via ajv in lint
|
|
25
|
+
* rather than by strict-key rejection.
|
|
26
|
+
*
|
|
27
|
+
* BRIDGE ALIGNMENT: the `workflows`/`extractors` shapes here are FIELD-COMPATIBLE
|
|
28
|
+
* with `ProductYamlBridgeInput` (`@rayspec/product-yaml-workflow-bridge`) — same key names (workflows:
|
|
29
|
+
* id/trigger{capability,event,scope}/steps[]{id,type,use,inputs,outputs,depends_on,on_error,retry}; and
|
|
30
|
+
* the extractor extraction contract) — so a validated `ProductSpec` feeds the real bridge compiler unchanged.
|
|
31
|
+
*
|
|
32
|
+
* REPRESENTABLE: only string/literal/enum/array/record/object/boolean/number types are used, so
|
|
33
|
+
* `z.toJSONSchema` (export.ts `exportProductJsonSchema`) exports it without throwing.
|
|
34
|
+
*/
|
|
35
|
+
import { z } from 'zod';
|
|
36
|
+
// Reuse the SAME safe-identifier rule + the SAME store-column vocabulary as the RaySpec grammar
|
|
37
|
+
// (grammar.ts stays byte-unchanged; these are IMPORTS, not modifications) so a product id / artifact
|
|
38
|
+
// kind / declared store column is rejected the same way backend store/column names are — and so a derived
|
|
39
|
+
// product store is a standard `StoreSpec` the whole backend store machinery (generateProductSql /
|
|
40
|
+
// diffProductStores / drift / classify / the update seam) consumes UNCHANGED.
|
|
41
|
+
import { SafeIdentifier, SPEC_VERSION, StoreColumn } from './grammar.js';
|
|
42
|
+
// The view read+projection vocabulary — a SEPARATE module so this file's diff
|
|
43
|
+
// stays minimal. See product-views.ts for the design laws.
|
|
44
|
+
import { ViewConditionalRead, ViewParamSpec, ViewRead } from './product-views.js';
|
|
45
|
+
// One language, one version constant: the product profile and the backend profile share the single
|
|
46
|
+
// `SPEC_VERSION` ('1.0') from grammar.ts. The top-level dispatch key is `version` (the same literal as
|
|
47
|
+
// the backend profile); the two profiles are told apart by the presence of the required `product:`
|
|
48
|
+
// section (the archetype discriminant — see detect.ts). Parsed FIRST (two-phase, `product-parse.ts`)
|
|
49
|
+
// so an unknown version fails cleanly with `unsupported_version` instead of a wall of strict errors.
|
|
50
|
+
// ---------------------------------------------------------------------------------------
|
|
51
|
+
// product — identity + metadata (product meaning boundary; NOT a tenant id / route prefix)
|
|
52
|
+
// ---------------------------------------------------------------------------------------
|
|
53
|
+
export const ProductIdentity = z
|
|
54
|
+
.object({
|
|
55
|
+
/** Stable safe identifier (e.g. `acme_notes`) — same safe-identifier rule as store/column names. */
|
|
56
|
+
id: SafeIdentifier,
|
|
57
|
+
name: z.string().min(1),
|
|
58
|
+
description: z.string().optional(),
|
|
59
|
+
/** Human ownership metadata (free-form small strings). */
|
|
60
|
+
owners: z.array(z.string().min(1)).optional(),
|
|
61
|
+
/** Small string metadata — NOT runtime behavior. */
|
|
62
|
+
metadata: z.record(z.string(), z.string()).optional(),
|
|
63
|
+
})
|
|
64
|
+
.strict();
|
|
65
|
+
// ---------------------------------------------------------------------------------------
|
|
66
|
+
// requires — the capability ids the product depends on (each must resolve to capabilities[].id)
|
|
67
|
+
// ---------------------------------------------------------------------------------------
|
|
68
|
+
export const RequiresSpec = z
|
|
69
|
+
.object({
|
|
70
|
+
capabilities: z.array(z.string().min(1)).default([]),
|
|
71
|
+
})
|
|
72
|
+
.strict();
|
|
73
|
+
// ---------------------------------------------------------------------------------------
|
|
74
|
+
// capabilities[] — product REFERENCES to Tier B contracts (declaration, not implementation)
|
|
75
|
+
// ---------------------------------------------------------------------------------------
|
|
76
|
+
/** Reusable Tier B capability references are tier `B` (the draft's only allowed tier). */
|
|
77
|
+
export const CapabilityTier = z.enum(['B']);
|
|
78
|
+
/**
|
|
79
|
+
* A capability's runtime availability. All three statuses are shape-valid: `available`
|
|
80
|
+
* declares the capability is runtime-backed; `reserved`/`not_yet_runtime` declare a future
|
|
81
|
+
* dependency. WIREDNESS is enforced at the deploy composition, not here — a MOUNT rejects any
|
|
82
|
+
* capability that is not `available` + actually runtime-backed (fail-closed, section named), while
|
|
83
|
+
* `doctor`/`plan` (validate-only) accept all three (the frozen legacy fixture stays valid).
|
|
84
|
+
*/
|
|
85
|
+
export const CapabilityStatus = z.enum(['reserved', 'not_yet_runtime', 'available']);
|
|
86
|
+
/**
|
|
87
|
+
* Narrow, DECLARATIVE provider policy (draft): provider/model SELECTION by policy — NOT a
|
|
88
|
+
* provider-native request/response blob. Allowed ONLY here (on a capability) and in
|
|
89
|
+
* `deployment_overrides`; product-lint rejects provider policy that leaks into `workflows`/`extractors`.
|
|
90
|
+
*/
|
|
91
|
+
export const ProviderPolicy = z
|
|
92
|
+
.object({
|
|
93
|
+
default_provider: z.string().min(1).optional(),
|
|
94
|
+
default_model: z.string().min(1).optional(),
|
|
95
|
+
adapter_visibility: z.enum(['internal', 'public']).optional(),
|
|
96
|
+
})
|
|
97
|
+
.strict();
|
|
98
|
+
/**
|
|
99
|
+
* OPTIONAL declarative INPUT-NORMALIZE step for a submit-ingress capability (default OFF). When
|
|
100
|
+
* declared, a submitted record is transformed by the named agent AFTER shape-validation and BEFORE
|
|
101
|
+
* persist — the NORMALIZED value is what is re-validated, stored, and emitted. ABSENT ⇒ behaviour is
|
|
102
|
+
* byte-identical to today (a capability that does not declare it is completely unaffected). The agent
|
|
103
|
+
* runs through the platform's neutral agent-invocation path (the deployment wires a normalizer for the
|
|
104
|
+
* declared `agent` id — the config-side wiring precedent); the model output must conform to
|
|
105
|
+
* `output_contract`. Fail-closed: a normalize failure REJECTS the submit and persists nothing.
|
|
106
|
+
*/
|
|
107
|
+
export const CapabilityInputNormalize = z
|
|
108
|
+
.object({
|
|
109
|
+
/**
|
|
110
|
+
* The config-side agent id that normalizes the submitted record (same safe-identifier discipline as
|
|
111
|
+
* every sibling id). It is a stable label the deployment binds a normalizer to — NOT a declared
|
|
112
|
+
* `extractors[]` id (an input-normalize step is the record-ingress equivalent of the config-side
|
|
113
|
+
* responder, wired at deploy, not a workflow-graph extractor).
|
|
114
|
+
*/
|
|
115
|
+
agent: SafeIdentifier,
|
|
116
|
+
/**
|
|
117
|
+
* The declared contract id the NORMALIZED record must conform to before persist (product-lint
|
|
118
|
+
* resolves it against `contracts[]` / a declared capability contract, exactly like an
|
|
119
|
+
* `artifacts[].contract` ref). The runtime uses it as the agent's expected output shape.
|
|
120
|
+
*/
|
|
121
|
+
output_contract: z.string().min(1),
|
|
122
|
+
})
|
|
123
|
+
.strict();
|
|
124
|
+
export const CapabilitySpec = z
|
|
125
|
+
.object({
|
|
126
|
+
id: z.string().min(1),
|
|
127
|
+
tier: CapabilityTier,
|
|
128
|
+
status: CapabilityStatus,
|
|
129
|
+
/** Named input/output contracts the capability provides (contract ids). */
|
|
130
|
+
contracts: z.array(z.string().min(1)).default([]),
|
|
131
|
+
provider_policy: ProviderPolicy.optional(),
|
|
132
|
+
/** Non-normative explanation (may mention providers — this is NOT the executable graph). */
|
|
133
|
+
runtime_notes: z.string().optional(),
|
|
134
|
+
/** OPTIONAL declarative input-normalize step (default OFF — see CapabilityInputNormalize). */
|
|
135
|
+
input_normalize: CapabilityInputNormalize.optional(),
|
|
136
|
+
})
|
|
137
|
+
.strict();
|
|
138
|
+
// ---------------------------------------------------------------------------------------
|
|
139
|
+
// artifacts[] — product-owned meaning + output contracts
|
|
140
|
+
// ---------------------------------------------------------------------------------------
|
|
141
|
+
export const ArtifactProvenance = z
|
|
142
|
+
.object({
|
|
143
|
+
/** Source artifact/span contract id (e.g. `stt.transcript_span`). */
|
|
144
|
+
source: z.string().min(1).optional(),
|
|
145
|
+
/** The candidate field carrying evidence span ids. */
|
|
146
|
+
evidence_field: z.string().min(1).optional(),
|
|
147
|
+
/**
|
|
148
|
+
* OPT-IN quote-text verification (default OFF). Names a STRING property of this artifact's
|
|
149
|
+
* `contract` that carries a VERBATIM quote. When declared, grounding additionally requires that
|
|
150
|
+
* quote to be a token-run subset of the TEXT of at least one of the member's cited, in-closed-set
|
|
151
|
+
* spans (per-span, never the concatenation — see grounding-runtime). ABSENT ⇒ behaviour is
|
|
152
|
+
* byte-identical to id-only closed-set grounding (the default-off invariant: a product that does
|
|
153
|
+
* NOT declare a quote_field is completely unaffected). The consequence of an unsupported quote is
|
|
154
|
+
* `grounding.on_unquoted_claim` (default `'ignore'` = advisory). Compose-time, a declared
|
|
155
|
+
* quote_field must name a string property of the contract (fail-closed; product-lint `dangling_ref`).
|
|
156
|
+
* Coupling note: a product with paraphrasing extractors opts in only by declaring a `quote_field`
|
|
157
|
+
* plus an `on_unquoted_claim` mode; until it declares one it is unaffected and never enforces
|
|
158
|
+
* quote-text — so enabling this feature cannot retroactively break an existing deployed product.
|
|
159
|
+
*/
|
|
160
|
+
quote_field: z.string().min(1).optional(),
|
|
161
|
+
required: z.boolean().optional(),
|
|
162
|
+
})
|
|
163
|
+
.strict();
|
|
164
|
+
export const ArtifactLifecycle = z
|
|
165
|
+
.object({
|
|
166
|
+
persist: z.boolean().optional(),
|
|
167
|
+
preserve_human_edits: z.boolean().optional(),
|
|
168
|
+
reconcile_stale_rows: z.boolean().optional(),
|
|
169
|
+
})
|
|
170
|
+
.strict();
|
|
171
|
+
export const ArtifactSpec = z
|
|
172
|
+
.object({
|
|
173
|
+
/** Safe identifier (e.g. `decision`) — same rule as store/column names. */
|
|
174
|
+
kind: SafeIdentifier,
|
|
175
|
+
label: z.string().min(1).optional(),
|
|
176
|
+
/** Contract id for the artifact payload (product-lint resolves it against `contracts`). */
|
|
177
|
+
contract: z.string().min(1),
|
|
178
|
+
/** Object scope such as `session`. */
|
|
179
|
+
scope: z.string().min(1).optional(),
|
|
180
|
+
collection: z.string().min(1).optional(),
|
|
181
|
+
provenance: ArtifactProvenance.optional(),
|
|
182
|
+
lifecycle: ArtifactLifecycle.optional(),
|
|
183
|
+
})
|
|
184
|
+
.strict();
|
|
185
|
+
// ---------------------------------------------------------------------------------------
|
|
186
|
+
// contracts — named dictionary of reusable product-local JSON-Schema-like contracts
|
|
187
|
+
// ---------------------------------------------------------------------------------------
|
|
188
|
+
/**
|
|
189
|
+
* `contracts` maps a contract id to a JSON-Schema-like payload. INTENTIONALLY an OPEN record at the
|
|
190
|
+
* grammar level (like a `RaySpec` tool's `parameters` — a free-form schema slot): its CLOSED
|
|
191
|
+
* declarative vocabulary (allowed keys: type/description/properties/items/required/enum/
|
|
192
|
+
* additional_properties/nullable/ref; allowed types: object/array/string/number/integer/boolean/null;
|
|
193
|
+
* FORBIDDEN: functions/transforms/computed expressions/provider-native shapes) is enforced by
|
|
194
|
+
* `product-lint.ts` (`invalid_contract`), which walks each contract schema against the allowlist.
|
|
195
|
+
*/
|
|
196
|
+
export const ContractsSpec = z.record(z.string(), z.record(z.string(), z.unknown()));
|
|
197
|
+
// ---------------------------------------------------------------------------------------
|
|
198
|
+
// extractors[] — declarative EXTRACTION contracts (NOT RaySpec backend/model/instructions agents)
|
|
199
|
+
// Field-compatible with the bridge's ProductYamlAgentDeclaration. Each extractor declares a runtime
|
|
200
|
+
// `agent.<id>` operation (the byte-identity runtime namespace) — the section is `extractors`, the
|
|
201
|
+
// runtime operation it registers is `agent.<id>`.
|
|
202
|
+
// ---------------------------------------------------------------------------------------
|
|
203
|
+
export const AgentArtifactInput = z
|
|
204
|
+
.object({
|
|
205
|
+
name: z.string().min(1),
|
|
206
|
+
ref: z.string().min(1),
|
|
207
|
+
kind: z.string().min(1),
|
|
208
|
+
required: z.boolean().optional(),
|
|
209
|
+
source_step_id: z.string().min(1).optional(),
|
|
210
|
+
})
|
|
211
|
+
.strict();
|
|
212
|
+
export const AgentArtifactOutput = z
|
|
213
|
+
.object({
|
|
214
|
+
name: z.string().min(1),
|
|
215
|
+
ref: z.string().min(1),
|
|
216
|
+
kind: z.string().min(1),
|
|
217
|
+
schema_ref: z.string().min(1).optional(),
|
|
218
|
+
materialization_target: z.string().min(1).optional(),
|
|
219
|
+
})
|
|
220
|
+
.strict();
|
|
221
|
+
export const RequiredOutputShape = z
|
|
222
|
+
.object({
|
|
223
|
+
schema_ref: z.string().min(1),
|
|
224
|
+
required_paths: z.array(z.string().min(1)).optional(),
|
|
225
|
+
additional_properties: z.boolean().optional(),
|
|
226
|
+
})
|
|
227
|
+
.strict();
|
|
228
|
+
export const AcceptanceBoundary = z
|
|
229
|
+
.object({
|
|
230
|
+
type: z.literal('validation_node'),
|
|
231
|
+
/** Tier-B validation/grounding operations the candidate must clear (e.g. grounding.check). */
|
|
232
|
+
requires: z.array(z.string().min(1)).min(1),
|
|
233
|
+
closed_source_artifacts: z.array(z.string().min(1)).optional(),
|
|
234
|
+
})
|
|
235
|
+
.strict();
|
|
236
|
+
export const ArtifactMaterialization = z
|
|
237
|
+
.object({
|
|
238
|
+
target: z.literal('typed_artifact_ref'),
|
|
239
|
+
persist_via: z.string().min(1).optional(),
|
|
240
|
+
handle_ref: z.string().min(1).optional(),
|
|
241
|
+
})
|
|
242
|
+
.strict();
|
|
243
|
+
export const AgentExtraction = z
|
|
244
|
+
.object({
|
|
245
|
+
/** Stable extraction intent (e.g. `note_extraction`). */
|
|
246
|
+
intent: z.string().min(1),
|
|
247
|
+
input_artifacts: z.array(AgentArtifactInput).default([]),
|
|
248
|
+
output_artifacts: z.array(AgentArtifactOutput).default([]),
|
|
249
|
+
required_output_shape: RequiredOutputShape,
|
|
250
|
+
acceptance_boundary: AcceptanceBoundary,
|
|
251
|
+
materialization: ArtifactMaterialization,
|
|
252
|
+
})
|
|
253
|
+
.strict();
|
|
254
|
+
export const ExtractorSpec = z
|
|
255
|
+
.object({
|
|
256
|
+
/**
|
|
257
|
+
* Stable safe identifier (e.g. `note_extractor`) — the SAME SafeIdentifier
|
|
258
|
+
* discipline as every sibling id (product id / artifact kind / store name+key / store-step ids).
|
|
259
|
+
* SECURITY: the extractor id flows UNSANITIZED into the per-agent
|
|
260
|
+
* extractor-config PATH (`resolveExtractorConfigPath` → `<specDir>/extraction/<id>.extractor.json`),
|
|
261
|
+
* so a `..`/`/` id would escape the extraction dir under `path.resolve`. Constraining it here closes
|
|
262
|
+
* that source at parse; `resolveExtractorConfigPath` adds a belt-and-suspenders traversal jail.
|
|
263
|
+
*/
|
|
264
|
+
id: SafeIdentifier,
|
|
265
|
+
purpose: z.string().min(1),
|
|
266
|
+
extraction: AgentExtraction,
|
|
267
|
+
/** Declarative extraction LIMITS — plain text, NOT executable instructions. */
|
|
268
|
+
extraction_constraints: z.array(z.string().min(1)).optional(),
|
|
269
|
+
})
|
|
270
|
+
.strict();
|
|
271
|
+
// ---------------------------------------------------------------------------------------
|
|
272
|
+
// stores[] — declared TYPED product stores
|
|
273
|
+
// ---------------------------------------------------------------------------------------
|
|
274
|
+
/**
|
|
275
|
+
* A declared product store: the MINIMAL typed data declaration the store_read/store_write step
|
|
276
|
+
* runtime targets, and the backing for store-sourced views. DESIGN LAWS:
|
|
277
|
+
* - the columns are EXACTLY the backend `StoreColumn` vocabulary (imported from grammar.ts, which stays
|
|
278
|
+
* byte-stable), so the DERIVED output (`deriveProductStores`) is a standard `StoreSpec` and the
|
|
279
|
+
* whole existing store machinery — `generateProductSql` (tenancy/GDPR injection), `diffProductStores`,
|
|
280
|
+
* drift/classify, the update seam, `eraseTenant` — consumes declared stores UNCHANGED;
|
|
281
|
+
* - authors declare BUSINESS columns only; the tenancy/GDPR columns (`id`/`tenant_id`/`created_at`/
|
|
282
|
+
* `deleted_at`/`retention_days`/`region`) are INJECTED downstream exactly like collection stores get
|
|
283
|
+
* them (declaring one is rejected by lint, `reserved_column_name`);
|
|
284
|
+
* - `key` is the REQUIRED conflict/idempotency identity: the durable engine's at-least-once law
|
|
285
|
+
* re-executes a mid-crash node, so EVERY store_write is an UPSERT on this declared key (single-flight — never
|
|
286
|
+
* insert-and-recover; an in-tx unique-violation would poison the whole run transaction). It lives on
|
|
287
|
+
* the STORE (not the write step) because row identity is a property of the DATA — two write paths to
|
|
288
|
+
* one store must agree on one identity — and because the derivation must materialize the backing
|
|
289
|
+
* UNIQUE index (the key column derives `unique: true`). v1 admits EXACTLY ONE key column (the backend
|
|
290
|
+
* `StoreSpec` family has per-column uniques only — no composite/table-level unique vocabulary; a
|
|
291
|
+
* composite identity is composed into one column, the platform's `artifact_ref`/`track_ref` idiom);
|
|
292
|
+
* - deliberately NOT supported in v1 (honest scope): product-to-product foreign keys, composite keys,
|
|
293
|
+
* per-column defaults (the backend `StoreColumn` vocabulary carries none), non-tenant stores.
|
|
294
|
+
*/
|
|
295
|
+
export const ProductStoreSpec = z
|
|
296
|
+
.object({
|
|
297
|
+
/** The store name (same SafeIdentifier discipline as backend stores; lint rejects collisions with
|
|
298
|
+
* derived collection stores; the derivation rejects collisions with capability-owned stores). */
|
|
299
|
+
name: SafeIdentifier,
|
|
300
|
+
description: z.string().min(1).optional(),
|
|
301
|
+
/** Business columns — EXACTLY the backend column vocabulary (name/type/nullable/unique). */
|
|
302
|
+
columns: z.array(StoreColumn).min(1),
|
|
303
|
+
/**
|
|
304
|
+
* The REQUIRED conflict/idempotency key (see the design laws above): the declared column every
|
|
305
|
+
* store_write upserts on. v1: exactly one column; it must be a declared, NON-nullable column
|
|
306
|
+
* (lint-enforced) and derives `unique: true` (the backing index the upsert targets).
|
|
307
|
+
*/
|
|
308
|
+
key: z
|
|
309
|
+
.array(SafeIdentifier)
|
|
310
|
+
.min(1)
|
|
311
|
+
.max(1, 'v1 supports exactly one conflict-key column (the backend StoreSpec family has no composite/' +
|
|
312
|
+
'table-level unique vocabulary — compose a composite identity into one column, the ' +
|
|
313
|
+
'artifact_ref/track_ref idiom; a multi-column key is a later spec-version decision)'),
|
|
314
|
+
})
|
|
315
|
+
.strict();
|
|
316
|
+
// ---------------------------------------------------------------------------------------
|
|
317
|
+
// store step value sources (store_read filters / store_write values)
|
|
318
|
+
// ---------------------------------------------------------------------------------------
|
|
319
|
+
/** A value read from the TRIGGER EVENT payload (`payload[<event>]` — a scalar, fail-closed at run). */
|
|
320
|
+
export const StoreEventValue = z.object({ event: z.string().min(1) }).strict();
|
|
321
|
+
/**
|
|
322
|
+
* A literal scalar. The FILTER variant excludes null (SQL equality on NULL never matches a row).
|
|
323
|
+
*
|
|
324
|
+
* ⚠ KNOWN LIMITATION (GLI-1 — INTENDED; do NOT "fix" by narrowing the guard): a `{const:}` literal
|
|
325
|
+
* lives inside the `workflows` graph subtree, so the graph NEUTRALITY guardrails
|
|
326
|
+
* (`scanProductGuardrails` — provider names, code-like tokens, handler/module paths,
|
|
327
|
+
* production-/prompt-execution claims) scan it like every other graph string. A BUSINESS constant
|
|
328
|
+
* that happens to contain such a token (e.g. a status text naming a provider, or `llm call`) is
|
|
329
|
+
* therefore OVER-REJECTED fail-closed. This is the deliberate posture: the guard is trust-boundary-adjacent
|
|
330
|
+
* and MUST NOT be weakened for literal convenience — rephrase the constant, or carry the value as
|
|
331
|
+
* DATA through an `{event:}` / `{artifact:}` source instead of YAML meaning. Pinned by a lint test
|
|
332
|
+
* (product-stores.test.ts GLI-1) so an accidental narrowing of the guard goes red.
|
|
333
|
+
*/
|
|
334
|
+
export const StoreFilterConstValue = z
|
|
335
|
+
.object({ const: z.union([z.string(), z.number(), z.boolean()]) })
|
|
336
|
+
.strict();
|
|
337
|
+
/** The write-variant literal (incl. null). The GLI-1 over-rejection note above applies here too. */
|
|
338
|
+
export const StoreWriteConstValue = z
|
|
339
|
+
.object({ const: z.union([z.string(), z.number(), z.boolean(), z.null()]) })
|
|
340
|
+
.strict();
|
|
341
|
+
/**
|
|
342
|
+
* An UPSTREAM ARTIFACT value by its declared contract ref (last producer wins — the same resolution
|
|
343
|
+
* every other node uses). Write-values only: it feeds a step's produced data (e.g. a store_read's
|
|
344
|
+
* rows) into a written column; a whole artifact is not an equality-filter scalar.
|
|
345
|
+
*/
|
|
346
|
+
export const StoreArtifactValue = z.object({ artifact: z.string().min(1) }).strict();
|
|
347
|
+
/** store_read filter sources: event payload key or a non-null literal (EQUALITY-ONLY, see below). */
|
|
348
|
+
export const StoreFilterValue = z.union([StoreEventValue, StoreFilterConstValue]);
|
|
349
|
+
/** store_write value sources: event payload key, literal (incl. null), or an upstream artifact. */
|
|
350
|
+
export const StoreWriteValue = z.union([StoreEventValue, StoreWriteConstValue, StoreArtifactValue]);
|
|
351
|
+
/**
|
|
352
|
+
* The store_read row cap: `limit` may not exceed this (shape-level), the node clamps to it
|
|
353
|
+
* (defense-in-depth), and an omitted limit defaults to `STORE_READ_DEFAULT_LIMIT`. A step read is a
|
|
354
|
+
* BOUNDED reference lookup feeding a workflow node — unbounded reads belong to paged views.
|
|
355
|
+
*/
|
|
356
|
+
export const STORE_READ_MAX_LIMIT = 1000;
|
|
357
|
+
export const STORE_READ_DEFAULT_LIMIT = 100;
|
|
358
|
+
// ---------------------------------------------------------------------------------------
|
|
359
|
+
// workflows[] — composition over Tier A/B primitives (field-compatible with the bridge)
|
|
360
|
+
// ---------------------------------------------------------------------------------------
|
|
361
|
+
/**
|
|
362
|
+
* The closed set of workflow step types. `capability`/`agent`/`validation`/`artifact_persist`/
|
|
363
|
+
* `artifact_read` are what the bridge compiles today; `store_read`/`store_write` are draft Tier-A
|
|
364
|
+
* node types (validated statically here, compiled by later stages). An unknown/typo'd `type` is
|
|
365
|
+
* fail-closed-rejected by this enum (the fail-open lesson: never silently drop a step; reject loudly).
|
|
366
|
+
*/
|
|
367
|
+
export const WorkflowStepType = z.enum([
|
|
368
|
+
'capability',
|
|
369
|
+
'agent',
|
|
370
|
+
'validation',
|
|
371
|
+
'artifact_persist',
|
|
372
|
+
'artifact_read',
|
|
373
|
+
'store_read',
|
|
374
|
+
'store_write',
|
|
375
|
+
]);
|
|
376
|
+
/** Bounded failure policy a step may select (Tier A runtime executes it). */
|
|
377
|
+
export const WorkflowOnError = z.enum(['fail', 'retry', 'drop', 'quarantine']);
|
|
378
|
+
/** A BOUNDED retry policy — a positive attempt cap (no unbounded loops). */
|
|
379
|
+
export const WorkflowRetry = z
|
|
380
|
+
.object({
|
|
381
|
+
max_attempts: z.number().int().positive(),
|
|
382
|
+
})
|
|
383
|
+
.strict();
|
|
384
|
+
export const WorkflowStep = z
|
|
385
|
+
.object({
|
|
386
|
+
id: z.string().min(1),
|
|
387
|
+
type: WorkflowStepType,
|
|
388
|
+
/** `namespace.operation` (e.g. `stt.transcribe_session`, `agent.note_extractor`). */
|
|
389
|
+
use: z.string().min(1),
|
|
390
|
+
/** Named input contract refs (product-lint resolves them). */
|
|
391
|
+
inputs: z.record(z.string(), z.string().min(1)).optional(),
|
|
392
|
+
/** Named output contract refs (product-lint resolves them). */
|
|
393
|
+
outputs: z.record(z.string(), z.string().min(1)).optional(),
|
|
394
|
+
depends_on: z.array(z.string().min(1)).optional(),
|
|
395
|
+
on_error: WorkflowOnError.optional(),
|
|
396
|
+
retry: WorkflowRetry.optional(),
|
|
397
|
+
// ── the store-step vocabulary — ADDITIVE, all optional. ──────
|
|
398
|
+
// Lint enforces the per-type discipline fail-closed: store_read carries store (+ optional
|
|
399
|
+
// filter/limit) and EXACTLY ONE output (the rows artifact); store_write carries store + values
|
|
400
|
+
// (which MUST include the store's conflict-key column); every other step type carries NONE of
|
|
401
|
+
// these. DELIBERATELY NOT SUPPORTED (honest v1 scope): comparison/range/LIKE/IN filters (the
|
|
402
|
+
// HandlerDb facade is equality-only by design), joins, multi-store transactions, deletes/updates
|
|
403
|
+
// (a store_write is an UPSERT on the declared key — the only re-run-safe write under the durable
|
|
404
|
+
// engine's at-least-once law).
|
|
405
|
+
/** The DECLARED target store (must resolve to `stores[].name` — never a derived/capability store). */
|
|
406
|
+
store: SafeIdentifier.optional(),
|
|
407
|
+
/** store_read: EQUALITY-ONLY column filters, AND-combined (column → event-payload key | literal). */
|
|
408
|
+
filter: z.record(SafeIdentifier, StoreFilterValue).optional(),
|
|
409
|
+
/** store_read: the row cap (defaults to STORE_READ_DEFAULT_LIMIT; shape-capped at the max). */
|
|
410
|
+
limit: z.number().int().positive().max(STORE_READ_MAX_LIMIT).optional(),
|
|
411
|
+
/** store_write: the written row (column → event key | literal | upstream artifact).
|
|
412
|
+
* NOTE: `{const:}` string literals here are graph strings — the neutrality guardrails scan
|
|
413
|
+
* them, and business constants containing provider names / code-like tokens are over-rejected
|
|
414
|
+
* fail-closed BY DESIGN (GLI-1 — see StoreFilterConstValue above; do not narrow the guard). */
|
|
415
|
+
values: z.record(SafeIdentifier, StoreWriteValue).optional(),
|
|
416
|
+
})
|
|
417
|
+
.strict();
|
|
418
|
+
export const WorkflowTrigger = z
|
|
419
|
+
.object({
|
|
420
|
+
/** The Tier-B capability whose event fires the workflow (product-lint resolves it). */
|
|
421
|
+
capability: z.string().min(1),
|
|
422
|
+
event: z.string().min(1),
|
|
423
|
+
scope: z.string().min(1).optional(),
|
|
424
|
+
})
|
|
425
|
+
.strict();
|
|
426
|
+
export const ProductWorkflowSpec = z
|
|
427
|
+
.object({
|
|
428
|
+
id: z.string().min(1),
|
|
429
|
+
trigger: WorkflowTrigger,
|
|
430
|
+
steps: z.array(WorkflowStep).min(1),
|
|
431
|
+
})
|
|
432
|
+
.strict();
|
|
433
|
+
// ---------------------------------------------------------------------------------------
|
|
434
|
+
// grounding — product policy for evidence validation (mechanics are Tier B; policy is here)
|
|
435
|
+
// ---------------------------------------------------------------------------------------
|
|
436
|
+
export const AttributionPolicy = z
|
|
437
|
+
.object({
|
|
438
|
+
/** Track → speaker-role mapping (e.g. mic → local, system → remote). */
|
|
439
|
+
tracks: z.record(z.string(), z.string().min(1)).optional(),
|
|
440
|
+
})
|
|
441
|
+
.strict();
|
|
442
|
+
export const GroundingSpec = z
|
|
443
|
+
.object({
|
|
444
|
+
require_source_spans: z.boolean().optional(),
|
|
445
|
+
source_span_contract: z.string().min(1).optional(),
|
|
446
|
+
/** Bounded policy for an invalid citation (Tier A runtime executes it). */
|
|
447
|
+
on_invalid_citation: z.enum(['prune', 'drop', 'repair', 'fail']).optional(),
|
|
448
|
+
/** Bounded policy for a candidate with no evidence. */
|
|
449
|
+
on_empty_evidence: z.enum(['drop', 'prune', 'keep', 'fail']).optional(),
|
|
450
|
+
/**
|
|
451
|
+
* Bounded policy for an UNSUPPORTED quote — a member whose declared `provenance.quote_field`
|
|
452
|
+
* value is NOT a verbatim token-run subset of any of its cited, in-closed-set spans. Only bites
|
|
453
|
+
* artifacts that declare a `quote_field` (default-off otherwise). Default `'ignore'` (advisory:
|
|
454
|
+
* the `unsupported_claim` finding is recorded but the member persists) — a product must opt into
|
|
455
|
+
* `'prune'` (drop the unsupporting citations, then the `on_empty_evidence` machinery), `'drop'`
|
|
456
|
+
* (drop the whole member), or `'fail'` (terminal). Mirrors the bounded-enum idiom of
|
|
457
|
+
* `on_invalid_citation` / `on_empty_evidence`.
|
|
458
|
+
*/
|
|
459
|
+
on_unquoted_claim: z.enum(['fail', 'prune', 'drop', 'ignore']).optional(),
|
|
460
|
+
validation_capability: z.string().min(1).optional(),
|
|
461
|
+
attribution_policy: AttributionPolicy.optional(),
|
|
462
|
+
})
|
|
463
|
+
.strict();
|
|
464
|
+
// ---------------------------------------------------------------------------------------
|
|
465
|
+
// views[] — declarative read/command contracts (NOT route handlers)
|
|
466
|
+
// ---------------------------------------------------------------------------------------
|
|
467
|
+
/** Views are reads plus a playback-token command — GET/POST only (a mutating verb implies a handler). */
|
|
468
|
+
export const ViewMethod = z.enum(['GET', 'POST']);
|
|
469
|
+
export const ViewRoute = z
|
|
470
|
+
.object({
|
|
471
|
+
method: ViewMethod,
|
|
472
|
+
path: z.string().min(1),
|
|
473
|
+
})
|
|
474
|
+
.strict();
|
|
475
|
+
export const ViewSource = z
|
|
476
|
+
.object({
|
|
477
|
+
kind: z.enum(['artifact_query', 'capability', 'store']),
|
|
478
|
+
/** Contract / capability id the view reads from (product-lint resolves it). */
|
|
479
|
+
ref: z.string().min(1),
|
|
480
|
+
})
|
|
481
|
+
.strict();
|
|
482
|
+
export const ViewPagination = z
|
|
483
|
+
.object({
|
|
484
|
+
limit_param: z.string().min(1).optional(),
|
|
485
|
+
offset_param: z.string().min(1).optional(),
|
|
486
|
+
max_limit: z.number().int().positive().optional(),
|
|
487
|
+
/**
|
|
488
|
+
* The limit applied when the request omits/mis-shapes the limit param. The frozen
|
|
489
|
+
* clamp law (the golden): a missing / non-integer / `< 1` limit clamps to THIS default (never
|
|
490
|
+
* an empty page), `> max_limit` clamps to `max_limit`, a negative/malformed offset clamps to 0.
|
|
491
|
+
* Defaults to `max_limit` when omitted. Lint rejects `default_limit > max_limit`.
|
|
492
|
+
*/
|
|
493
|
+
default_limit: z.number().int().positive().optional(),
|
|
494
|
+
})
|
|
495
|
+
.strict();
|
|
496
|
+
/**
|
|
497
|
+
* Response behavior for processing/absent data. The draft BANS `processing_200`; this enum omits it, so
|
|
498
|
+
* it is fail-closed-rejected by construction (a bad-enum `schema_violation`). `not_ready_409` preserves
|
|
499
|
+
* the playback-token readiness contract; `empty_200` is the empty-read-model shape.
|
|
500
|
+
*/
|
|
501
|
+
export const ViewAbsentState = z.enum(['empty_200', 'not_ready_409']);
|
|
502
|
+
/**
|
|
503
|
+
* VERSION-DISCIPLINE NOTE: the view read+projection vocabulary below (`params`/`read`/
|
|
504
|
+
* `conditional_read` + `pagination.default_limit`) is a STRICTLY ADDITIVE, ALL-OPTIONAL extension of
|
|
505
|
+
* the product profile, so it needs no version bump: every previously-valid product document parses
|
|
506
|
+
* byte-identically (the `version` literal + `product:` discriminant select document PROFILES, not
|
|
507
|
+
* additive vocabulary), and `.strict()` still rejects unknown keys fail-closed. The committed
|
|
508
|
+
* schema and the fixtures are regenerated/updated DELIBERATELY with this change (never silently).
|
|
509
|
+
*
|
|
510
|
+
* SEMANTIC SPLIT: `source` (+ `read`) declare the BACKING DATA and are validated
|
|
511
|
+
* kind-aware (store name / declared artifact / capability contract — a contract id NEVER satisfies a
|
|
512
|
+
* source); `response_contract` (+ `read.shape`) declare the DTO and are validated by the separate
|
|
513
|
+
* shape⊆contract conformance pass. See product-views.ts + product-views-lint.ts.
|
|
514
|
+
*/
|
|
515
|
+
export const ProductViewSpec = z
|
|
516
|
+
.object({
|
|
517
|
+
id: z.string().min(1),
|
|
518
|
+
route: ViewRoute,
|
|
519
|
+
/** Named auth policy (e.g. `bearer_tenant`). */
|
|
520
|
+
auth: z.string().min(1).optional(),
|
|
521
|
+
/** Declared request inputs. Required (with full path-param coverage) when `read` is set. */
|
|
522
|
+
params: z.record(z.string().min(1), ViewParamSpec).optional(),
|
|
523
|
+
source: ViewSource.optional(),
|
|
524
|
+
/** The declarative read + DTO projection — interpretable by @rayspec/views-runtime. */
|
|
525
|
+
read: ViewRead.optional(),
|
|
526
|
+
pagination: ViewPagination.optional(),
|
|
527
|
+
absent_state: ViewAbsentState.optional(),
|
|
528
|
+
/** Conditional-read behavior: `etag` → strong ETag + If-None-Match 304 on GET. */
|
|
529
|
+
conditional_read: ViewConditionalRead.optional(),
|
|
530
|
+
/** Contract id for generated clients (product-lint resolves it). */
|
|
531
|
+
response_contract: z.string().min(1),
|
|
532
|
+
})
|
|
533
|
+
.strict();
|
|
534
|
+
// ---------------------------------------------------------------------------------------
|
|
535
|
+
// deployment_overrides — narrow provider bindings (NOT handler/route/migration code)
|
|
536
|
+
// ---------------------------------------------------------------------------------------
|
|
537
|
+
export const ProviderOverride = z
|
|
538
|
+
.object({
|
|
539
|
+
default_model: z.string().min(1).optional(),
|
|
540
|
+
})
|
|
541
|
+
.strict();
|
|
542
|
+
export const DeploymentOverrides = z
|
|
543
|
+
.object({
|
|
544
|
+
providers: z.record(z.string(), ProviderOverride).optional(),
|
|
545
|
+
})
|
|
546
|
+
.strict();
|
|
547
|
+
// ---------------------------------------------------------------------------------------
|
|
548
|
+
// ProductSpec — the whole document
|
|
549
|
+
// ---------------------------------------------------------------------------------------
|
|
550
|
+
/**
|
|
551
|
+
* The full Product-YAML document (the product profile of the unified `version:'1.0'` language). Its
|
|
552
|
+
* top-level key is `version` (`z.literal('1.0')`) — checked FIRST by the two-phase `parseProductSpec`
|
|
553
|
+
* (product-parse.ts) so an unsupported version yields a clean `unsupported_version` instead of a wall
|
|
554
|
+
* of strict errors. The required `product:` section is the archetype discriminant that tells this
|
|
555
|
+
* profile apart from the backend profile (which never carries `product:` — see detect.ts). `.strict()`
|
|
556
|
+
* rejects any unknown top-level section. Only `product` is required; every other section defaults
|
|
557
|
+
* ([]/{}), so a minimal doc (just `version` + `product`) is valid and a product need not declare every
|
|
558
|
+
* section. The grammar is a single `z.literal(SPEC_VERSION)` — the parse boundary (product-parse.ts)
|
|
559
|
+
* accepts exactly `version:'1.0'` and rejects any other version fail-closed.
|
|
560
|
+
*/
|
|
561
|
+
export const ProductSpec = z
|
|
562
|
+
.object({
|
|
563
|
+
version: z.literal(SPEC_VERSION),
|
|
564
|
+
product: ProductIdentity,
|
|
565
|
+
requires: RequiresSpec.default({ capabilities: [] }),
|
|
566
|
+
capabilities: z.array(CapabilitySpec).default([]),
|
|
567
|
+
artifacts: z.array(ArtifactSpec).default([]),
|
|
568
|
+
/**
|
|
569
|
+
* Declared typed product stores. The ABSENT-section default is [] — a NO-OP:
|
|
570
|
+
* a document without a `stores` section (incl. the acme-notes reference product) parses and derives byte-identically.
|
|
571
|
+
*/
|
|
572
|
+
stores: z.array(ProductStoreSpec).default([]),
|
|
573
|
+
contracts: ContractsSpec.default({}),
|
|
574
|
+
extractors: z.array(ExtractorSpec).default([]),
|
|
575
|
+
workflows: z.array(ProductWorkflowSpec).default([]),
|
|
576
|
+
grounding: GroundingSpec.optional(),
|
|
577
|
+
views: z.array(ProductViewSpec).default([]),
|
|
578
|
+
deployment_overrides: DeploymentOverrides.optional(),
|
|
579
|
+
})
|
|
580
|
+
.strict();
|
|
581
|
+
//# sourceMappingURL=product-grammar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-grammar.js","sourceRoot":"","sources":["../src/product-grammar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,gGAAgG;AAChG,qGAAqG;AACrG,0GAA0G;AAC1G,kGAAkG;AAClG,8EAA8E;AAC9E,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACzE,8EAA8E;AAC9E,2DAA2D;AAC3D,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAElF,mGAAmG;AACnG,uGAAuG;AACvG,mGAAmG;AACnG,qGAAqG;AACrG,qGAAqG;AAErG,0FAA0F;AAC1F,2FAA2F;AAC3F,0FAA0F;AAE1F,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC;KAC7B,MAAM,CAAC;IACN,oGAAoG;IACpG,EAAE,EAAE,cAAc;IAClB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,0DAA0D;IAC1D,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC7C,oDAAoD;IACpD,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE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