primitive-admin 1.1.0-alpha.44 → 1.1.0-alpha.45

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.
Files changed (37) hide show
  1. package/dist/bin/primitive.js +0 -0
  2. package/dist/src/commands/blob-buckets.js +20 -7
  3. package/dist/src/commands/blob-buckets.js.map +1 -1
  4. package/dist/src/commands/sync.js +113 -28
  5. package/dist/src/commands/sync.js.map +1 -1
  6. package/dist/src/commands/workflows.js +185 -20
  7. package/dist/src/commands/workflows.js.map +1 -1
  8. package/dist/src/lib/api-client.d.ts +1 -0
  9. package/dist/src/lib/api-client.js +4 -0
  10. package/dist/src/lib/api-client.js.map +1 -1
  11. package/dist/src/lib/codegen-shared/generatedFiles.d.ts +61 -0
  12. package/dist/src/lib/codegen-shared/generatedFiles.js +127 -0
  13. package/dist/src/lib/codegen-shared/generatedFiles.js.map +1 -0
  14. package/dist/src/lib/db-codegen/dbGenerator.d.ts +30 -5
  15. package/dist/src/lib/db-codegen/dbGenerator.js +227 -165
  16. package/dist/src/lib/db-codegen/dbGenerator.js.map +1 -1
  17. package/dist/src/lib/db-codegen/dbTemplates.d.ts +11 -23
  18. package/dist/src/lib/db-codegen/dbTemplates.js +21 -41
  19. package/dist/src/lib/db-codegen/dbTemplates.js.map +1 -1
  20. package/dist/src/lib/db-codegen/dbTsTypes.d.ts +7 -3
  21. package/dist/src/lib/db-codegen/dbTsTypes.js +23 -1
  22. package/dist/src/lib/db-codegen/dbTsTypes.js.map +1 -1
  23. package/dist/src/lib/generated-allowlist.js +13 -0
  24. package/dist/src/lib/generated-allowlist.js.map +1 -1
  25. package/dist/src/lib/workflow-codegen/generated-schema-descriptor.d.ts +96 -0
  26. package/dist/src/lib/workflow-codegen/generated-schema-descriptor.js +112 -0
  27. package/dist/src/lib/workflow-codegen/generated-schema-descriptor.js.map +1 -0
  28. package/dist/src/lib/workflow-codegen/generator.d.ts +70 -0
  29. package/dist/src/lib/workflow-codegen/generator.js +186 -0
  30. package/dist/src/lib/workflow-codegen/generator.js.map +1 -0
  31. package/dist/src/lib/workflow-codegen/naming.d.ts +33 -0
  32. package/dist/src/lib/workflow-codegen/naming.js +81 -0
  33. package/dist/src/lib/workflow-codegen/naming.js.map +1 -0
  34. package/dist/src/lib/workflow-codegen/schemaToTs.d.ts +55 -0
  35. package/dist/src/lib/workflow-codegen/schemaToTs.js +237 -0
  36. package/dist/src/lib/workflow-codegen/schemaToTs.js.map +1 -0
  37. package/package.json +4 -2
@@ -38,34 +38,31 @@ export interface QueryResult<T = Record<string, unknown>> {
38
38
  nextCursor?: string;
39
39
  }
40
40
 
41
- /** One write-step result inside a \`mutation\` op's batch response. */
41
+ /**
42
+ * One step's result inside a \`mutation\` op's uniform response (#1458).
43
+ * \`op\` is the step kind; \`id\` is the record id (the resolved canonical id for
44
+ * \`upsertOn\` saves). \`values\` carries an \`increment\` step's post-increment
45
+ * counters; \`error\` a per-step failure string.
46
+ */
42
47
  export interface MutationStepResult {
48
+ op: "save" | "patch" | "delete" | "increment" | "addToSet" | "removeFromSet";
43
49
  success: boolean;
44
50
  id: string;
51
+ values?: Record<string, number>;
52
+ error?: string;
45
53
  }
46
54
 
47
55
  /**
48
- * \`mutation\` ops composed of save/patch/delete steps return the batch
49
- * write-step results, in the batch (save/patch/delete) step order. Individual
50
- * increment/stringset steps in the same op are not reflected here the runtime
51
- * returns only the batch call's body.
56
+ * Every \`mutation\` op returns a uniform \`{ results: MutationStepResult[] }\`
57
+ * in DEFINITION-STEP order one entry per step, tagged with its \`op\` kind and
58
+ * record \`id\` (#1458). This is a SUCCESS-PATH guarantee: a step that fails at
59
+ * the HTTP level surfaces as an error, and committed sibling writes in the same
60
+ * op are not reported (the ops are not yet executed atomically — see #1478).
52
61
  */
53
62
  export interface MutationResult {
54
63
  results: MutationStepResult[];
55
64
  }
56
65
 
57
- /** \`mutation\` ops composed only of \`increment\` steps return a flat result. */
58
- export interface IncrementMutationResult {
59
- success: boolean;
60
- id: string;
61
- values: Record<string, number>;
62
- }
63
-
64
- /** \`mutation\` ops composed only of addToSet/removeFromSet steps return a flat result. */
65
- export interface StringSetMutationResult {
66
- success: boolean;
67
- }
68
-
69
66
  /** \`count\` ops return a single count. */
70
67
  export interface CountResult {
71
68
  count: number;
@@ -158,7 +155,7 @@ export function renderOpParamsInterface(input) {
158
155
  lines.push(`export interface ${interfaceName} {`);
159
156
  for (const p of params) {
160
157
  const optional = p.required ? "" : "?";
161
- lines.push(` ${p.name}${optional}: ${tsTypeForDbParamType(p.type, p.enum)};`);
158
+ lines.push(` ${p.name}${optional}: ${tsTypeForDbParamType(p.type, p.enum, p.items)};`);
162
159
  }
163
160
  lines.push(`}`);
164
161
  return lines.join("\n");
@@ -196,9 +193,8 @@ function queryResultGeneric(recordInterfaceName, projection) {
196
193
  * Render a per-op result alias. The alias is derived from `op.type` and, where
197
194
  * the shape is derivable from the parsed op definition, a narrowed form:
198
195
  * - `query` → `QueryResult<M>`, narrowed by the op `projection` (#1439).
199
- * - `mutation` → `MutationResult` / `IncrementMutationResult` /
200
- * `StringSetMutationResult` (or the union of the last two for
201
- * a mixed individual-only op) per the op's step kinds (#1438).
196
+ * - `mutation` → `MutationResult` every mutation op returns the uniform
197
+ * `{ results: MutationStepResult[] }` in definition order (#1458).
202
198
  * - `pipeline` → the returned step's result type (#1437); `return: "all"` /
203
199
  * no-return / unresolvable keep the generic `PipelineResult`.
204
200
  */
@@ -207,26 +203,10 @@ export function renderOpResultAlias(input) {
207
203
  switch (opType) {
208
204
  case "query":
209
205
  return `export type ${aliasName} = QueryResult<${queryResultGeneric(recordInterfaceName, projection)}>;`;
210
- case "mutation": {
211
- switch (input.mutationCategory) {
212
- case "increment":
213
- return `export type ${aliasName} = IncrementMutationResult;`;
214
- case "stringset":
215
- return `export type ${aliasName} = StringSetMutationResult;`;
216
- // A mix of only individual increment + stringset steps sends no
217
- // `/batch`, so the runtime returns the first op's flat response — one
218
- // of these two shapes, never a `{ results: [...] }` body.
219
- case "mixed":
220
- return `export type ${aliasName} = IncrementMutationResult | StringSetMutationResult;`;
221
- // `batch` and `opaque` (empty/malformed/unresolvable) both fall back to
222
- // the batch `MutationResult` — the most common shape and the safe
223
- // default when the step kinds can't be resolved.
224
- case "batch":
225
- case "opaque":
226
- default:
227
- return `export type ${aliasName} = MutationResult;`;
228
- }
229
- }
206
+ case "mutation":
207
+ // Every mutation op returns the uniform `{ results: MutationStepResult[] }`
208
+ // in definition-step order (#1458) — no more per-category flat shapes.
209
+ return `export type ${aliasName} = MutationResult;`;
230
210
  case "count":
231
211
  return `export type ${aliasName} = CountResult;`;
232
212
  case "aggregate":
@@ -1 +1 @@
1
- {"version":3,"file":"dbTemplates.js","sourceRoot":"","sources":["../../../../src/lib/db-codegen/dbTemplates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAExE,MAAM,aAAa,GACjB,2DAA2D,CAAC;AAC9D,MAAM,iBAAiB,GACrB,qEAAqE,CAAC;AAiIxE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DnC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,WAAmB;IAC9C,OAAO;QACL,aAAa;QACb,iBAAiB;QACjB,mBAAmB,WAAW,EAAE;KACjC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAiC;IAEjC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IACvD,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,KAAK,MAAM,CAAC,IAAI,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AAG;QAClB,6EAA6E;QAC7E,yEAAyE;QACzE,4BAA4B;QAC5B,mBAAmB;QACnB,oBAAoB;QACpB,uBAAuB;QACvB,qBAAqB;QACrB,GAAG;KACJ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,MAAM,WAAW,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;QACjC,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;QAC9C,IAAI,EAAE,CAAC,SAAS,EAAE,CAAC;YACjB,OAAO,CACL,OAAO,EAAE,CAAC,WAAW,cAAc,EAAE,CAAC,mBAAmB,wCAAwC,EAAE,CAAC,eAAe,QAAQ;gBAC3H,2CAA2C,EAAE,CAAC,eAAe,iBAAiB,WAAW,4BAA4B,CACtH,CAAC;QACJ,CAAC;QACD,4EAA4E;QAC5E,qDAAqD;QACrD,OAAO,CACL,OAAO,EAAE,CAAC,WAAW,yCAAyC,EAAE,CAAC,eAAe,QAAQ;YACxF,2CAA2C,EAAE,CAAC,eAAe,iBAAiB,WAAW,oBAAoB,CAC9G,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG;QACd,4BAA4B,YAAY,mBAAmB;QAC3D,mBAAmB,WAAW,2CAA2C;QACzE,YAAY;QACZ,GAAG,WAAW;QACd,MAAM;QACN,GAAG;KACJ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,OAAO,CAAC,eAAe,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC9D,CAAC"}
@@ -33,8 +33,12 @@
33
33
  * library's internal type paths.
34
34
  */
35
35
  export type DbFieldType = "string" | "number" | "boolean" | "date" | "id" | "stringset";
36
- /** Param types accepted in an `[[operations]]` `params` block. */
37
- export type DbParamType = "string" | "number" | "boolean" | "object";
36
+ /**
37
+ * Param types accepted in an `[[operations]]` `params` block. `array` (#1488)
38
+ * carries a scalar `items` element type; `integer` (also surfaced in #1488 when
39
+ * reconciling the registration/runtime type lists) maps to `number`.
40
+ */
41
+ export type DbParamType = "string" | "number" | "boolean" | "integer" | "object" | "array";
38
42
  /**
39
43
  * Returns the TS type expression for a record field type. Unknown types
40
44
  * fall back to `unknown` rather than throwing: the database-type TOML is
@@ -75,4 +79,4 @@ export declare function tsTypeForDbField(fieldType: string, enumValues?: string[
75
79
  * the base type for a non-string param or an empty enum rather than throwing —
76
80
  * the server is the source of truth for rejecting a malformed param `enum`.
77
81
  */
78
- export declare function tsTypeForDbParamType(paramType: string, enumValues?: string[]): string;
82
+ export declare function tsTypeForDbParamType(paramType: string, enumValues?: string[], items?: string): string;
@@ -90,7 +90,28 @@ export function tsTypeForDbField(fieldType, enumValues) {
90
90
  * the base type for a non-string param or an empty enum rather than throwing —
91
91
  * the server is the source of truth for rejecting a malformed param `enum`.
92
92
  */
93
- export function tsTypeForDbParamType(paramType, enumValues) {
93
+ export function tsTypeForDbParamType(paramType, enumValues, items) {
94
+ // Array param (#1488): a declared `type = "array"` (Phase 2) or one inferred
95
+ // from a `$in`/`$nin` binding (Phase 1). `items` is the scalar element type;
96
+ // a per-element `enum` on a string-element array renders `("a" | "b")[]`.
97
+ // A missing/unresolved `items` renders `unknown[]` (the conservative widen).
98
+ if (paramType === "array") {
99
+ let elem;
100
+ if (items === "string" &&
101
+ Array.isArray(enumValues) &&
102
+ enumValues.length > 0) {
103
+ elem = `(${tsUnionFromEnum(enumValues)})`;
104
+ }
105
+ else if (items) {
106
+ // Element type is always scalar here, so the recursion never re-enters
107
+ // this array branch.
108
+ elem = tsTypeForDbParamType(items);
109
+ }
110
+ else {
111
+ elem = "unknown";
112
+ }
113
+ return `${elem}[]`;
114
+ }
94
115
  if (paramType === "string" &&
95
116
  Array.isArray(enumValues) &&
96
117
  enumValues.length > 0) {
@@ -100,6 +121,7 @@ export function tsTypeForDbParamType(paramType, enumValues) {
100
121
  case "string":
101
122
  return "string";
102
123
  case "number":
124
+ case "integer":
103
125
  return "number";
104
126
  case "boolean":
105
127
  return "boolean";
@@ -1 +1 @@
1
- {"version":3,"file":"dbTsTypes.js","sourceRoot":"","sources":["../../../../src/lib/db-codegen/dbTsTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAoBH;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAiB;IACpD,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,QAAQ,CAAC;QACd,KAAK,IAAI,CAAC;QACV,KAAK,MAAM;YACT,OAAO,QAAQ,CAAC;QAClB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,WAAW;YACd,sDAAsD;YACtD,OAAO,UAAU,CAAC;QACpB;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAC,MAAgB;IAC9C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAiB,EACjB,UAAqB;IAErB,IACE,SAAS,KAAK,QAAQ;QACtB,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;QACzB,UAAU,CAAC,MAAM,GAAG,CAAC,EACrB,CAAC;QACD,OAAO,eAAe,CAAC,UAAU,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,oBAAoB,CAAC,SAAS,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,oBAAoB,CAClC,SAAiB,EACjB,UAAqB;IAErB,IACE,SAAS,KAAK,QAAQ;QACtB,KAAK,CAAC,OAAO,CAAC,UAAU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C"}
@@ -43,18 +43,21 @@ export const GENERATED_ALLOWLISTED_FIELDS = [
43
43
  "cases",
44
44
  "category",
45
45
  "collectionId",
46
+ "collectionType",
46
47
  "concurrency",
47
48
  "configId",
48
49
  "content",
49
50
  "contentBase64",
50
51
  "contentType",
51
52
  "context",
53
+ "contextId",
52
54
  "continueOnError",
53
55
  "create",
54
56
  "cursor",
55
57
  "cursorField",
56
58
  "data",
57
59
  "databaseId",
60
+ "databaseType",
58
61
  "default",
59
62
  "description",
60
63
  "direction",
@@ -89,6 +92,7 @@ export const GENERATED_ALLOWLISTED_FIELDS = [
89
92
  "maxPages",
90
93
  "message",
91
94
  "messages",
95
+ "metadata",
92
96
  "metrics",
93
97
  "model",
94
98
  "modelName",
@@ -169,10 +173,17 @@ export const GENERATED_KNOWN_KINDS = [
169
173
  "blob.upload",
170
174
  "block.call",
171
175
  "collect",
176
+ "collection.addDocument",
177
+ "collection.create",
178
+ "collection.delete",
179
+ "collection.grantGroupPermission",
180
+ "collection.removeDocument",
172
181
  "create",
173
182
  "database.aggregate",
174
183
  "database.applyToQuery",
175
184
  "database.count",
185
+ "database.create",
186
+ "database.delete",
176
187
  "database.mutate",
177
188
  "database.pipeline",
178
189
  "database.query",
@@ -199,6 +210,8 @@ export const GENERATED_KNOWN_KINDS = [
199
210
  "gemini.generateRaw",
200
211
  "group.addMember",
201
212
  "group.checkMembership",
213
+ "group.create",
214
+ "group.delete",
202
215
  "group.listMembers",
203
216
  "group.listUserMemberships",
204
217
  "group.removeAll",
@@ -1 +1 @@
1
- {"version":3,"file":"generated-allowlist.js","sourceRoot":"","sources":["../../../src/lib/generated-allowlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,4BAA4B,GAAsB;IAC7D,kBAAkB;IAClB,YAAY;IACZ,QAAQ;IACR,UAAU;IACV,OAAO;IACP,IAAI;IACJ,UAAU;IACV,aAAa;IACb,QAA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,SAAS;IACT,OAAO;IACP,IAAI;IACJ,UAAU;IACV,aAAa;IACb,OAAO;IACP,OAAO;IACP,MAAM;IACN,MAAM;IACN,QAAQ;IACR,UAAU;IACV,WAAW;IACX,SAAS;IACT,YAAY;IACZ,MAAM;IACN,aAAa;CACd,CAAC;AAEF,0GAA0G;AAC1G,MAAM,CAAC,MAAM,qBAAqB,GAAsB;IACtD,iBAAiB;IACjB,iBAAiB;IACjB,wBAAwB;IACxB,aAAa;IACb,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,oBAAoB;IACpB,uBAAuB;IACvB,gBAAgB;IAChB,iBAAiB;IACjB,mBAAmB;IACnB,gBAAgB;IAChB,sBAAsB;IACtB,OAAO;IACP,gBAAgB;IAChB,iBAAiB;IACjB,qBAAqB;IACrB,sCAAsC;IACtC,yBAAyB;IACzB,4BAA4B;IAC5B,uBAAuB;IACvB,sBAAsB;IACtB,gBAAgB;IAChB,gBAAgB;IAChB,mBAAmB;IACnB,uBAAuB;IACvB,8BAA8B;IAC9B,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,oBAAoB;IACpB,iBAAiB;IACjB,oBAAoB;IACpB,iBAAiB;IACjB,uBAAuB;IACvB,mBAAmB;IACnB,2BAA2B;IAC3B,iBAAiB;IACjB,oBAAoB;IACpB,MAAM;IACN,kBAAkB;IAClB,eAAe;IACf,UAAU;IACV,eAAe;IACf,gBAAgB;IAChB,MAAM;IACN,gBAAgB;IAChB,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,UAAU;IACV,cAAc;IACd,eAAe;CAChB,CAAC"}
1
+ {"version":3,"file":"generated-allowlist.js","sourceRoot":"","sources":["../../../src/lib/generated-allowlist.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,4BAA4B,GAAsB;IAC7D,kBAAkB;IAClB,YAAY;IAC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U;IACV,cAAc;IACd,eAAe;CAChB,CAAC"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * GENERATED FILE — DO NOT EDIT BY HAND.
3
+ *
4
+ * Vendored byte-for-byte from the canonical server module
5
+ * `src/workflows/schema-descriptor.ts` — the SAME interpretation the server
6
+ * validator (`validateValue`) enforces. The CLI cannot import server `src/`
7
+ * at runtime, so `workflows codegen`'s type converter imports this committed
8
+ * copy instead.
9
+ *
10
+ * Regenerate with:
11
+ * node cli/scripts/gen-workflow-schema-descriptor.mjs (runs at CLI prebuild)
12
+ *
13
+ * A CI freshness guard
14
+ * (`cli/scripts/gen-workflow-schema-descriptor.mjs --check`, also asserted by
15
+ * `cli/tests/unit/workflow-codegen-descriptor-drift-guard.test.ts`) fails if
16
+ * this committed copy does not match the source — see issue #1442 / #998.
17
+ */
18
+ /**
19
+ * Canonical interpretation of the JSON-Schema subset the workflow platform
20
+ * supports (issue #1442).
21
+ *
22
+ * The server validator (`validateValue` in `schema-validation.ts`) and the CLI
23
+ * `workflows codegen` type converter (`workflow-codegen/schemaToTs.ts`) must
24
+ * agree EXACTLY on how a workflow `inputSchema`/`outputSchema` is interpreted —
25
+ * otherwise a generated `<Key>Input` type promises a shape the runtime does not
26
+ * enforce (or rejects a value the runtime accepts). Previously the converter
27
+ * re-derived those interpretation decisions by hand, which drifts from the
28
+ * validator over time.
29
+ *
30
+ * This module is the single source of that interpretation. Both consumers read
31
+ * from `describeSchema` + `isType`:
32
+ *
33
+ * - the type gate is checked before `enum` (a value failing `type` is
34
+ * rejected before `enum` is consulted);
35
+ * - a type UNION (`type: ["string","null"]`) never descends into
36
+ * `properties`/`items` — only the exact string types `"object"`/`"array"`
37
+ * do;
38
+ * - `integer` means `Number.isInteger`;
39
+ * - `additionalProperties` only closes an object; it is not a nested schema.
40
+ *
41
+ * It is deliberately dependency-free (no imports) so the CLI can vendor a
42
+ * byte-for-byte copy as a committed artifact via
43
+ * `cli/scripts/gen-workflow-schema-descriptor.mjs` (the #998 gen-allowlist
44
+ * pattern). A drift-guard test runs that generator in `--check` mode, so a
45
+ * change here that isn't regenerated into the CLI artifact fails CI. The CLI
46
+ * never imports server `src/` at runtime — only the build-time generator reads
47
+ * this file.
48
+ */
49
+ /** Does a value satisfy a JSON-schema `type` name? `integer` = `Number.isInteger`. */
50
+ export declare function isType(value: any, type: string): boolean;
51
+ /**
52
+ * The interpretation of a single schema node, normalized so both the validator
53
+ * and the type converter can consume it without re-reading raw schema fields.
54
+ */
55
+ export interface SchemaDescriptor {
56
+ /** True when `schema.type` is an array (a type union). */
57
+ isUnion: boolean;
58
+ /** `schema.type` when it is a single string; null for a union or absent type. */
59
+ singularType: string | null;
60
+ /**
61
+ * The declared type(s) normalized to an array. An array `type` is kept as-is;
62
+ * a single string becomes a one-element array; an absent/falsy type is `[]`
63
+ * (no type gate). Matches the validator's `allowedTypes` normalization.
64
+ */
65
+ types: string[];
66
+ /** The `enum` array when present, else null. */
67
+ enumValues: any[] | null;
68
+ /**
69
+ * Object descent info — non-null ONLY when `schema.type` is exactly the
70
+ * string `"object"` AND `properties` is a declared object (matching the
71
+ * validator's `schema.type === "object" && schema.properties` descent gate).
72
+ * A type UNION containing `"object"` never descends.
73
+ */
74
+ object: {
75
+ /** The raw `properties` map (child schemas). May be empty `{}`. */
76
+ properties: Record<string, any>;
77
+ /** The raw `required` list (unfiltered, as the validator reads it). */
78
+ required: any[];
79
+ /** True when `additionalProperties === false` (a closed object). */
80
+ additionalPropertiesClosed: boolean;
81
+ } | null;
82
+ /**
83
+ * Array descent info — non-null ONLY when `schema.type` is exactly the string
84
+ * `"array"` AND `items` is present (matching the validator's
85
+ * `schema.type === "array" && schema.items` descent gate).
86
+ */
87
+ array: {
88
+ /** The raw `items` schema (may be a tuple array the validator no-ops on). */
89
+ items: any;
90
+ } | null;
91
+ }
92
+ /**
93
+ * Interpret a parsed schema node. A non-object schema (null, array, scalar)
94
+ * enforces nothing → the empty descriptor.
95
+ */
96
+ export declare function describeSchema(schema: any): SchemaDescriptor;
@@ -0,0 +1,112 @@
1
+ /**
2
+ * GENERATED FILE — DO NOT EDIT BY HAND.
3
+ *
4
+ * Vendored byte-for-byte from the canonical server module
5
+ * `src/workflows/schema-descriptor.ts` — the SAME interpretation the server
6
+ * validator (`validateValue`) enforces. The CLI cannot import server `src/`
7
+ * at runtime, so `workflows codegen`'s type converter imports this committed
8
+ * copy instead.
9
+ *
10
+ * Regenerate with:
11
+ * node cli/scripts/gen-workflow-schema-descriptor.mjs (runs at CLI prebuild)
12
+ *
13
+ * A CI freshness guard
14
+ * (`cli/scripts/gen-workflow-schema-descriptor.mjs --check`, also asserted by
15
+ * `cli/tests/unit/workflow-codegen-descriptor-drift-guard.test.ts`) fails if
16
+ * this committed copy does not match the source — see issue #1442 / #998.
17
+ */
18
+ /**
19
+ * Canonical interpretation of the JSON-Schema subset the workflow platform
20
+ * supports (issue #1442).
21
+ *
22
+ * The server validator (`validateValue` in `schema-validation.ts`) and the CLI
23
+ * `workflows codegen` type converter (`workflow-codegen/schemaToTs.ts`) must
24
+ * agree EXACTLY on how a workflow `inputSchema`/`outputSchema` is interpreted —
25
+ * otherwise a generated `<Key>Input` type promises a shape the runtime does not
26
+ * enforce (or rejects a value the runtime accepts). Previously the converter
27
+ * re-derived those interpretation decisions by hand, which drifts from the
28
+ * validator over time.
29
+ *
30
+ * This module is the single source of that interpretation. Both consumers read
31
+ * from `describeSchema` + `isType`:
32
+ *
33
+ * - the type gate is checked before `enum` (a value failing `type` is
34
+ * rejected before `enum` is consulted);
35
+ * - a type UNION (`type: ["string","null"]`) never descends into
36
+ * `properties`/`items` — only the exact string types `"object"`/`"array"`
37
+ * do;
38
+ * - `integer` means `Number.isInteger`;
39
+ * - `additionalProperties` only closes an object; it is not a nested schema.
40
+ *
41
+ * It is deliberately dependency-free (no imports) so the CLI can vendor a
42
+ * byte-for-byte copy as a committed artifact via
43
+ * `cli/scripts/gen-workflow-schema-descriptor.mjs` (the #998 gen-allowlist
44
+ * pattern). A drift-guard test runs that generator in `--check` mode, so a
45
+ * change here that isn't regenerated into the CLI artifact fails CI. The CLI
46
+ * never imports server `src/` at runtime — only the build-time generator reads
47
+ * this file.
48
+ */
49
+ /** Does a value satisfy a JSON-schema `type` name? `integer` = `Number.isInteger`. */
50
+ export function isType(value, type) {
51
+ if (type === "array")
52
+ return Array.isArray(value);
53
+ if (type === "object")
54
+ return !!value && typeof value === "object" && !Array.isArray(value);
55
+ if (type === "string")
56
+ return typeof value === "string";
57
+ if (type === "number")
58
+ return typeof value === "number" && !Number.isNaN(value);
59
+ if (type === "integer")
60
+ return Number.isInteger(value);
61
+ if (type === "boolean")
62
+ return typeof value === "boolean";
63
+ if (type === "null")
64
+ return value === null;
65
+ // Unknown type name: nothing to enforce, so treat as a match (the validator
66
+ // must not reject a value against a keyword it does not model).
67
+ return true;
68
+ }
69
+ const EMPTY_DESCRIPTOR = {
70
+ isUnion: false,
71
+ singularType: null,
72
+ types: [],
73
+ enumValues: null,
74
+ object: null,
75
+ array: null,
76
+ };
77
+ /**
78
+ * Interpret a parsed schema node. A non-object schema (null, array, scalar)
79
+ * enforces nothing → the empty descriptor.
80
+ */
81
+ export function describeSchema(schema) {
82
+ if (!schema || typeof schema !== "object" || Array.isArray(schema)) {
83
+ return EMPTY_DESCRIPTOR;
84
+ }
85
+ const typeSpec = schema.type;
86
+ const isUnion = Array.isArray(typeSpec);
87
+ const singularType = typeof typeSpec === "string" ? typeSpec : null;
88
+ // Mirror the validator's normalization exactly: an array stays an array; a
89
+ // truthy non-array becomes `[typeSpec]`; anything falsy is `[]`.
90
+ const types = isUnion ? typeSpec : typeSpec ? [typeSpec] : [];
91
+ const enumValues = Array.isArray(schema.enum)
92
+ ? schema.enum
93
+ : null;
94
+ const props = schema.properties;
95
+ const object = singularType === "object" &&
96
+ props &&
97
+ typeof props === "object" &&
98
+ !Array.isArray(props)
99
+ ? {
100
+ properties: props,
101
+ required: Array.isArray(schema.required)
102
+ ? schema.required
103
+ : [],
104
+ additionalPropertiesClosed: schema.additionalProperties === false,
105
+ }
106
+ : null;
107
+ const array = singularType === "array" && schema.items
108
+ ? { items: schema.items }
109
+ : null;
110
+ return { isUnion, singularType, types, enumValues, object, array };
111
+ }
112
+ //# sourceMappingURL=generated-schema-descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-schema-descriptor.js","sourceRoot":"","sources":["../../../../src/lib/workflow-codegen/generated-schema-descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,sFAAsF;AACtF,MAAM,UAAU,MAAM,CAAC,KAAU,EAAE,IAAY;IAC7C,IAAI,IAAI,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClD,IAAI,IAAI,KAAK,QAAQ;QACnB,OAAO,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACvE,IAAI,IAAI,KAAK,QAAQ;QAAE,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;IACxD,IAAI,IAAI,KAAK,QAAQ;QAAE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAChF,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACvD,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,OAAO,KAAK,KAAK,SAAS,CAAC;IAC1D,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,KAAK,KAAK,IAAI,CAAC;IAC3C,4EAA4E;IAC5E,gEAAgE;IAChE,OAAO,IAAI,CAAC;AACd,CAAC;AA4CD,MAAM,gBAAgB,GAAqB;IACzC,OAAO,EAAE,KAAK;IACd,YAAY,EAAE,IAAI;IAClB,KAAK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K,KAAK;SACjD;QACH,CAAC,CAAC,IAAI,CAAC;IAEX,MAAM,KAAK,GACT,YAAY,KAAK,OAAO,IAAK,MAAc,CAAC,KAAK;QAC/C,CAAC,CAAC,EAAE,KAAK,EAAG,MAAc,CAAC,KAAK,EAAE;QAClC,CAAC,CAAC,IAAI,CAAC;IAEX,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AACrE,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * `workflows codegen` orchestrator (issue #1442).
3
+ *
4
+ * Reads synced workflow TOMLs (`.primitive/sync/<env>/<appId>/workflows/*.toml`)
5
+ * and emits ONE generated file per workflow —
6
+ * `workflows/generated/<key>.generated.ts` — each containing the workflow's
7
+ * `<Key>Input`/`<Key>Output` types plus a typed `<key>(client)` invoker factory
8
+ * returning `{ runSync?, start }`. This mirrors `databases codegen`'s per-type
9
+ * `<Type>.generated.ts` layout (#1441's `<type>Ops`): per-file artifacts keep
10
+ * team merges conflict-free and let a `[workflow-key]` filter regenerate exactly
11
+ * one file.
12
+ *
13
+ * Design decisions (see the plan of record on #1442, post-pivot):
14
+ * - Schemas are interpreted through the SHARED descriptor
15
+ * (`generated-schema-descriptor.ts`, a vendored copy of the server's
16
+ * `schema-validation` descriptor) so the generated types match runtime
17
+ * validation exactly. A malformed schema throws (fail-and-exit).
18
+ * - `.runSync` is emitted only for `syncCallable: true` workflows (the server
19
+ * rejects run-sync otherwise); `.start` for every non-reserved workflow.
20
+ * - `input` is a REQUIRED option iff the schema rejects `{}` (the client's
21
+ * `input ?? {}` fallback would fail validation); otherwise `input?`.
22
+ * - The runtime call always passes the ORIGINAL key string; only identifiers
23
+ * are sanitized. `workflowKey` is set AFTER spreading `opts`, so a caller
24
+ * cannot override it.
25
+ * - Disk lifecycle (write / `--check` / suffix-based cleanup) delegates to the
26
+ * shared `writeOrCheckGeneratedFiles`, exactly like `databases codegen`.
27
+ */
28
+ import { type WriteOrCheckResult } from "../codegen-shared/generatedFiles.js";
29
+ /** Suffix identifying a generated file (shared with `databases codegen`). */
30
+ export declare const GENERATED_FILE_SUFFIX = ".generated.ts";
31
+ export interface WorkflowCodegenInput {
32
+ /** Source `.toml` filename stem (fallback key when `[workflow].key` is absent). */
33
+ fileStem: string;
34
+ /** Path to the source `workflows/<key>.toml` file. */
35
+ tomlPath: string;
36
+ /** Raw TOML content (already read from disk). */
37
+ tomlContent: string;
38
+ }
39
+ export interface GenerateWorkflowTypesOptions {
40
+ inputs: WorkflowCodegenInput[];
41
+ /** Directory where the `<key>.generated.ts` files are written. */
42
+ outputDir: string;
43
+ /** `--check`: compare against disk, do not write. */
44
+ check?: boolean;
45
+ /**
46
+ * Set when the run was filtered to a single workflow key (the
47
+ * `primitive workflows codegen <key>` argument). The `inputs` set is then
48
+ * PARTIAL — it does not represent the full set of owned generated files — so
49
+ * stale-output cleanup (and `--check` stale detection) is scoped to the
50
+ * filtered workflow's own file and must NOT touch / flag sibling workflows'
51
+ * `*.generated.ts` files. The unfiltered "generate all" run leaves this unset
52
+ * and keeps full orphan cleanup. Mirrors `databases codegen`'s `singleType`.
53
+ */
54
+ singleWorkflow?: boolean;
55
+ }
56
+ /**
57
+ * Render the full `<key>.generated.ts` content for a single workflow TOML input.
58
+ * Returns null for a reserved (`__internal.*`) workflow. Pure — exported so
59
+ * tests can assert on the string directly.
60
+ */
61
+ export declare function renderWorkflowFile(input: WorkflowCodegenInput): {
62
+ key: string;
63
+ content: string;
64
+ } | null;
65
+ /**
66
+ * Run workflow codegen end-to-end. One `<key>.generated.ts` per workflow;
67
+ * delegates the disk lifecycle to the shared writer/checker, exactly like
68
+ * `databases codegen`.
69
+ */
70
+ export declare function generateWorkflowTypes(options: GenerateWorkflowTypesOptions): Promise<WriteOrCheckResult>;