primitive-admin 1.0.50 → 1.0.51
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/README.md +27 -8
- package/dist/src/commands/admins.js +25 -27
- package/dist/src/commands/admins.js.map +1 -1
- package/dist/src/commands/apps.js +8 -0
- package/dist/src/commands/apps.js.map +1 -1
- package/dist/src/commands/blob-buckets.js +30 -26
- package/dist/src/commands/blob-buckets.js.map +1 -1
- package/dist/src/commands/catalog.js +17 -18
- package/dist/src/commands/catalog.js.map +1 -1
- package/dist/src/commands/collection-type-configs.js +9 -9
- package/dist/src/commands/collection-type-configs.js.map +1 -1
- package/dist/src/commands/collections.js +33 -36
- package/dist/src/commands/collections.js.map +1 -1
- package/dist/src/commands/database-types.js +17 -18
- package/dist/src/commands/database-types.js.map +1 -1
- package/dist/src/commands/databases.js +41 -45
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.js +17 -18
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/email-templates.js +9 -9
- package/dist/src/commands/email-templates.js.map +1 -1
- package/dist/src/commands/group-type-configs.js +9 -9
- package/dist/src/commands/group-type-configs.js.map +1 -1
- package/dist/src/commands/groups.js +17 -18
- package/dist/src/commands/groups.js.map +1 -1
- package/dist/src/commands/integrations.js +17 -18
- package/dist/src/commands/integrations.js.map +1 -1
- package/dist/src/commands/llm.js +4 -2
- package/dist/src/commands/llm.js.map +1 -1
- package/dist/src/commands/prompts.js +33 -36
- package/dist/src/commands/prompts.js.map +1 -1
- package/dist/src/commands/rule-sets.js +9 -9
- package/dist/src/commands/rule-sets.js.map +1 -1
- package/dist/src/commands/sync.d.ts +0 -14
- package/dist/src/commands/sync.js +143 -91
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/commands/tokens.js +9 -9
- package/dist/src/commands/tokens.js.map +1 -1
- package/dist/src/commands/users.js +41 -45
- package/dist/src/commands/users.js.map +1 -1
- package/dist/src/commands/waitlist.js +9 -9
- package/dist/src/commands/waitlist.js.map +1 -1
- package/dist/src/commands/webhooks.js +9 -9
- package/dist/src/commands/webhooks.js.map +1 -1
- package/dist/src/commands/workflows.js +62 -36
- package/dist/src/commands/workflows.js.map +1 -1
- package/dist/src/lib/api-client.d.ts +9 -24
- package/dist/src/lib/api-client.js +36 -33
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/confirm-prompt.d.ts +25 -8
- package/dist/src/lib/confirm-prompt.js +44 -19
- package/dist/src/lib/confirm-prompt.js.map +1 -1
- package/dist/src/lib/generated-allowlist.d.ts +28 -0
- package/dist/src/lib/generated-allowlist.js +181 -0
- package/dist/src/lib/generated-allowlist.js.map +1 -0
- package/dist/src/lib/workflow-toml-validator.d.ts +26 -17
- package/dist/src/lib/workflow-toml-validator.js +52 -141
- package/dist/src/lib/workflow-toml-validator.js.map +1 -1
- package/package.json +4 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED FILE — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Source of truth: the server step runners in `src/workflows/steps/*.ts` and
|
|
5
|
+
* the universal `BaseStepDefinition` shape in
|
|
6
|
+
* `src/workflows/runner/types.ts`.
|
|
7
|
+
*
|
|
8
|
+
* Regenerate with:
|
|
9
|
+
* node cli/scripts/gen-allowlist.mjs (runs automatically at CLI prebuild)
|
|
10
|
+
*
|
|
11
|
+
* A CI freshness guard (`cli/scripts/gen-allowlist.mjs --check`, also asserted
|
|
12
|
+
* by `cli/tests/unit/workflow-toml-validator-drift-guard.test.ts`) fails if this
|
|
13
|
+
* committed artifact does not match a fresh scan — see issue #998.
|
|
14
|
+
*
|
|
15
|
+
* Two exports:
|
|
16
|
+
* - `GENERATED_ALLOWLISTED_FIELDS` — the union of universal step fields,
|
|
17
|
+
* per-kind fields each runner READS (not what the type declares), and the
|
|
18
|
+
* `collect` `step` structural pass-through. The validator accepts these as
|
|
19
|
+
* top-level step fields for KNOWN kinds.
|
|
20
|
+
* - `GENERATED_KNOWN_KINDS` — the step kinds the server registers. The
|
|
21
|
+
* validator skips the per-field check for an UNKNOWN kind (an old CLI
|
|
22
|
+
* against a newer server) while still running the kind-agnostic
|
|
23
|
+
* misnested-header footgun detector (#685).
|
|
24
|
+
*/
|
|
25
|
+
/** Top-level step fields the validator accepts for a known kind (#998). */
|
|
26
|
+
export const GENERATED_ALLOWLISTED_FIELDS = [
|
|
27
|
+
"_testSteps",
|
|
28
|
+
"action",
|
|
29
|
+
"aliasKey",
|
|
30
|
+
"appId",
|
|
31
|
+
"as",
|
|
32
|
+
"asBase64",
|
|
33
|
+
"attachments",
|
|
34
|
+
"blobId",
|
|
35
|
+
"bodyMode",
|
|
36
|
+
"bucketId",
|
|
37
|
+
"bucketKey",
|
|
38
|
+
"cacheTtlSeconds",
|
|
39
|
+
"cases",
|
|
40
|
+
"concurrency",
|
|
41
|
+
"configId",
|
|
42
|
+
"content",
|
|
43
|
+
"contentBase64",
|
|
44
|
+
"contentType",
|
|
45
|
+
"context",
|
|
46
|
+
"continueOnError",
|
|
47
|
+
"cursor",
|
|
48
|
+
"cursorField",
|
|
49
|
+
"data",
|
|
50
|
+
"databaseId",
|
|
51
|
+
"default",
|
|
52
|
+
"description",
|
|
53
|
+
"direction",
|
|
54
|
+
"documentAlias",
|
|
55
|
+
"documentId",
|
|
56
|
+
"dryRun",
|
|
57
|
+
"durationMs",
|
|
58
|
+
"email",
|
|
59
|
+
"events",
|
|
60
|
+
"expiresInSeconds",
|
|
61
|
+
"feature",
|
|
62
|
+
"filename",
|
|
63
|
+
"filter",
|
|
64
|
+
"filters",
|
|
65
|
+
"forEach",
|
|
66
|
+
"groupBy",
|
|
67
|
+
"groupId",
|
|
68
|
+
"groupType",
|
|
69
|
+
"htmlBody",
|
|
70
|
+
"id",
|
|
71
|
+
"includeUserDetails",
|
|
72
|
+
"input",
|
|
73
|
+
"integrationKey",
|
|
74
|
+
"itemsField",
|
|
75
|
+
"iterationName",
|
|
76
|
+
"kind",
|
|
77
|
+
"limit",
|
|
78
|
+
"limits",
|
|
79
|
+
"maxItems",
|
|
80
|
+
"maxPages",
|
|
81
|
+
"message",
|
|
82
|
+
"messages",
|
|
83
|
+
"metrics",
|
|
84
|
+
"model",
|
|
85
|
+
"modelName",
|
|
86
|
+
"modelOverride",
|
|
87
|
+
"ms",
|
|
88
|
+
"multipartFields",
|
|
89
|
+
"name",
|
|
90
|
+
"onConflict",
|
|
91
|
+
"onPartialFailure",
|
|
92
|
+
"operationName",
|
|
93
|
+
"options",
|
|
94
|
+
"output",
|
|
95
|
+
"page",
|
|
96
|
+
"pageSize",
|
|
97
|
+
"params",
|
|
98
|
+
"payload",
|
|
99
|
+
"perUser",
|
|
100
|
+
"plugins",
|
|
101
|
+
"prompt",
|
|
102
|
+
"promptKey",
|
|
103
|
+
"query",
|
|
104
|
+
"queryType",
|
|
105
|
+
"recordId",
|
|
106
|
+
"ref",
|
|
107
|
+
"request",
|
|
108
|
+
"route",
|
|
109
|
+
"runIf",
|
|
110
|
+
"saveAs",
|
|
111
|
+
"scope",
|
|
112
|
+
"selector",
|
|
113
|
+
"sort",
|
|
114
|
+
"source",
|
|
115
|
+
"step",
|
|
116
|
+
"strict",
|
|
117
|
+
"subject",
|
|
118
|
+
"successWhen",
|
|
119
|
+
"tags",
|
|
120
|
+
"temperature",
|
|
121
|
+
"templateType",
|
|
122
|
+
"textBody",
|
|
123
|
+
"thinkingLevel",
|
|
124
|
+
"timeout",
|
|
125
|
+
"to",
|
|
126
|
+
"toUserId",
|
|
127
|
+
"tool_choice",
|
|
128
|
+
"tools",
|
|
129
|
+
"top_p",
|
|
130
|
+
"type",
|
|
131
|
+
"user",
|
|
132
|
+
"userId",
|
|
133
|
+
"userUlid",
|
|
134
|
+
"variables",
|
|
135
|
+
"windowDays",
|
|
136
|
+
"with",
|
|
137
|
+
"workflowKey",
|
|
138
|
+
];
|
|
139
|
+
/** Step kinds the server registers (`defaultRegistry`). Unknown kinds skip the per-field check (#998). */
|
|
140
|
+
export const GENERATED_KNOWN_KINDS = [
|
|
141
|
+
"analytics.query",
|
|
142
|
+
"analytics.write",
|
|
143
|
+
"blob.download",
|
|
144
|
+
"blob.signedUrl",
|
|
145
|
+
"blob.upload",
|
|
146
|
+
"collect",
|
|
147
|
+
"database.aggregate",
|
|
148
|
+
"database.applyToQuery",
|
|
149
|
+
"database.count",
|
|
150
|
+
"database.mutate",
|
|
151
|
+
"database.pipeline",
|
|
152
|
+
"database.query",
|
|
153
|
+
"delay",
|
|
154
|
+
"document.count",
|
|
155
|
+
"document.delete",
|
|
156
|
+
"document.patch",
|
|
157
|
+
"document.query",
|
|
158
|
+
"document.queryOne",
|
|
159
|
+
"document.resolveAlias",
|
|
160
|
+
"document.save",
|
|
161
|
+
"email.send",
|
|
162
|
+
"event.wait",
|
|
163
|
+
"gemini.countTokens",
|
|
164
|
+
"gemini.generate",
|
|
165
|
+
"gemini.generateRaw",
|
|
166
|
+
"group.addMember",
|
|
167
|
+
"group.checkMembership",
|
|
168
|
+
"group.listMembers",
|
|
169
|
+
"group.listUserMemberships",
|
|
170
|
+
"group.removeMember",
|
|
171
|
+
"integration.call",
|
|
172
|
+
"iterate-users",
|
|
173
|
+
"llm.chat",
|
|
174
|
+
"noop",
|
|
175
|
+
"prompt.execute",
|
|
176
|
+
"script",
|
|
177
|
+
"switch",
|
|
178
|
+
"transform",
|
|
179
|
+
"workflow.call",
|
|
180
|
+
];
|
|
181
|
+
//# sourceMappingURL=generated-allowlist.js.map
|
|
@@ -0,0 +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,YAAY;IACZ,QAAQ;IACR,UAAU;IACV,OAAO;IACP,IAAI;IACJ,UAAU;IACV,aAAa;IAC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B,GAAsB;IACtD,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,SAAS;IACT,oBAAoB;IACpB,uBAAuB;IACvB,gBAAgB;IAChB,iBAAiB;IACjB,mBAAmB;IACnB,gBAAgB;IAChB,OAAO;IACP,gBAAgB;IAChB,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,mBAAmB;IACnB,uBAAuB;IACvB,eAAe;IACf,YAAY;IACZ,YAAY;IACZ,oBAAoB;IACpB,iBAAiB;IACjB,oBAAoB;IACpB,iBAAiB;IACjB,uBAAuB;IACvB,mBAAmB;IACnB,2BAA2B;IAC3B,oBAAoB;IACpB,kBAAkB;IAClB,eAAe;IACf,UAAU;IACV,MAAM;IACN,gBAAgB;IAChB,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,eAAe;CAChB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Push-time validator for workflow TOML files (issue #685).
|
|
2
|
+
* Push-time validator for workflow TOML files (issue #685, #998).
|
|
3
3
|
*
|
|
4
4
|
* Detects the common footgun where a user writes `[steps.<id>.<field>]` under
|
|
5
5
|
* an open `[[steps]]` array. TOML parses that as a sub-table on the
|
|
@@ -8,23 +8,27 @@
|
|
|
8
8
|
* unrecognized top-level field — the runtime silently ignores it, and the
|
|
9
9
|
* step then runs with an empty `request` block.
|
|
10
10
|
*
|
|
11
|
-
* The validator walks every step in `tomlData.steps[]
|
|
12
|
-
* top-level field not in the
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
11
|
+
* The validator walks every step in `tomlData.steps[]`. For a step whose
|
|
12
|
+
* `kind` the CLI KNOWS about, it reports any top-level field not in the
|
|
13
|
+
* generated allowlist. For an UNKNOWN kind (an old CLI run against a newer
|
|
14
|
+
* server that registered a step kind the CLI doesn't have), it SKIPS the
|
|
15
|
+
* per-field allowlist check — but still runs the kind-agnostic
|
|
16
|
+
* misnested-header footgun detector. This is the #998 fix: the recurring
|
|
17
|
+
* "newer server kind → false-reject of valid fields" failure (#685/#802/#971
|
|
18
|
+
* were all false rejections) becomes "unvalidated, not rejected."
|
|
18
19
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
20
|
+
* ── Source of truth (#998) ───────────────────────────────────────────────
|
|
21
|
+
* The allowlist field union and the known-kind set are GENERATED from the
|
|
22
|
+
* server step runners (`src/workflows/steps/*.ts`) and the universal
|
|
23
|
+
* `BaseStepDefinition` shape into the committed
|
|
24
|
+
* `cli/src/lib/generated-allowlist.ts` artifact (the CLI does NOT import
|
|
25
|
+
* server `src/` at runtime — only the build-time generator does). The union is
|
|
26
|
+
* derived from what each runner READS, not what the `*StepDefinition` TYPE
|
|
27
|
+
* declares — types over-declare and would weaken the footgun detector. A CI
|
|
28
|
+
* freshness guard (`gen-allowlist.mjs --check`, also asserted by the #985
|
|
29
|
+
* drift-guard test) keeps the committed artifact in sync with the runners, so
|
|
30
|
+
* the hand-edit drift class (#685/#802/#971) cannot recur for the same-version
|
|
31
|
+
* case. Regenerate with `node cli/scripts/gen-allowlist.mjs`.
|
|
28
32
|
*/
|
|
29
33
|
/**
|
|
30
34
|
* Read-only view of `ALLOWLISTED_FIELDS` for the drift-guard test (#985).
|
|
@@ -36,6 +40,11 @@
|
|
|
36
40
|
* the public validator API; consumed only by the guard.
|
|
37
41
|
*/
|
|
38
42
|
export declare const ALLOWLISTED_FIELDS_FOR_DRIFT_GUARD: ReadonlySet<string>;
|
|
43
|
+
/**
|
|
44
|
+
* Read-only view of `KNOWN_KINDS` for the drift-guard test (#998). Lets the
|
|
45
|
+
* guard assert the generated known-kind set matches a fresh scan.
|
|
46
|
+
*/
|
|
47
|
+
export declare const KNOWN_KINDS_FOR_DRIFT_GUARD: ReadonlySet<string>;
|
|
39
48
|
/**
|
|
40
49
|
* A single offending field on a step.
|
|
41
50
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Push-time validator for workflow TOML files (issue #685).
|
|
2
|
+
* Push-time validator for workflow TOML files (issue #685, #998).
|
|
3
3
|
*
|
|
4
4
|
* Detects the common footgun where a user writes `[steps.<id>.<field>]` under
|
|
5
5
|
* an open `[[steps]]` array. TOML parses that as a sub-table on the
|
|
@@ -8,149 +8,40 @@
|
|
|
8
8
|
* unrecognized top-level field — the runtime silently ignores it, and the
|
|
9
9
|
* step then runs with an empty `request` block.
|
|
10
10
|
*
|
|
11
|
-
* The validator walks every step in `tomlData.steps[]
|
|
12
|
-
* top-level field not in the
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
11
|
+
* The validator walks every step in `tomlData.steps[]`. For a step whose
|
|
12
|
+
* `kind` the CLI KNOWS about, it reports any top-level field not in the
|
|
13
|
+
* generated allowlist. For an UNKNOWN kind (an old CLI run against a newer
|
|
14
|
+
* server that registered a step kind the CLI doesn't have), it SKIPS the
|
|
15
|
+
* per-field allowlist check — but still runs the kind-agnostic
|
|
16
|
+
* misnested-header footgun detector. This is the #998 fix: the recurring
|
|
17
|
+
* "newer server kind → false-reject of valid fields" failure (#685/#802/#971
|
|
18
|
+
* were all false rejections) becomes "unvalidated, not rejected."
|
|
18
19
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
20
|
+
* ── Source of truth (#998) ───────────────────────────────────────────────
|
|
21
|
+
* The allowlist field union and the known-kind set are GENERATED from the
|
|
22
|
+
* server step runners (`src/workflows/steps/*.ts`) and the universal
|
|
23
|
+
* `BaseStepDefinition` shape into the committed
|
|
24
|
+
* `cli/src/lib/generated-allowlist.ts` artifact (the CLI does NOT import
|
|
25
|
+
* server `src/` at runtime — only the build-time generator does). The union is
|
|
26
|
+
* derived from what each runner READS, not what the `*StepDefinition` TYPE
|
|
27
|
+
* declares — types over-declare and would weaken the footgun detector. A CI
|
|
28
|
+
* freshness guard (`gen-allowlist.mjs --check`, also asserted by the #985
|
|
29
|
+
* drift-guard test) keeps the committed artifact in sync with the runners, so
|
|
30
|
+
* the hand-edit drift class (#685/#802/#971) cannot recur for the same-version
|
|
31
|
+
* case. Regenerate with `node cli/scripts/gen-allowlist.mjs`.
|
|
28
32
|
*/
|
|
33
|
+
import { GENERATED_ALLOWLISTED_FIELDS, GENERATED_KNOWN_KINDS, } from "./generated-allowlist.js";
|
|
29
34
|
/**
|
|
30
|
-
* Universal-
|
|
31
|
-
*
|
|
32
|
-
* Membership combines:
|
|
33
|
-
* 1) Universal fields on `BaseStepDefinition` in
|
|
34
|
-
* `src/workflows/runner/types.ts` and the runner engine's reads of
|
|
35
|
-
* `stepDef.*`.
|
|
36
|
-
* 2) The union of top-level fields actually consumed by step runners in
|
|
37
|
-
* `src/workflows/steps/` (audited 2026-05-15).
|
|
38
|
-
*
|
|
39
|
-
* Keep this sorted to make diffs reviewable.
|
|
35
|
+
* Universal-and-consumed allowlist of top-level fields permitted on a step
|
|
36
|
+
* (known kinds). Generated from the runners; see header.
|
|
40
37
|
*/
|
|
41
|
-
const ALLOWLISTED_FIELDS = new Set(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"id",
|
|
49
|
-
"kind",
|
|
50
|
-
"maxItems",
|
|
51
|
-
"name",
|
|
52
|
-
"runIf",
|
|
53
|
-
"saveAs",
|
|
54
|
-
"selector",
|
|
55
|
-
"strict",
|
|
56
|
-
"successWhen",
|
|
57
|
-
"timeout",
|
|
58
|
-
// Per-kind, union across runners.
|
|
59
|
-
"_testSteps", // workflow.call test-mode override
|
|
60
|
-
"action",
|
|
61
|
-
"appId",
|
|
62
|
-
"asBase64",
|
|
63
|
-
"attachments",
|
|
64
|
-
"blobId",
|
|
65
|
-
"bodyMode",
|
|
66
|
-
"bucketId",
|
|
67
|
-
"bucketKey",
|
|
68
|
-
"cacheTtlSeconds",
|
|
69
|
-
"cases", // switch: array of { when, output } (#802)
|
|
70
|
-
"configId",
|
|
71
|
-
"content",
|
|
72
|
-
"contentBase64",
|
|
73
|
-
"contentType",
|
|
74
|
-
"context",
|
|
75
|
-
"cursor",
|
|
76
|
-
"cursorField",
|
|
77
|
-
"data", // document.save/patch: record fields to write (#948 / #985)
|
|
78
|
-
"databaseId",
|
|
79
|
-
"default", // switch: { output } fallback branch (#802)
|
|
80
|
-
"direction",
|
|
81
|
-
"documentId", // document.*: target document id (#948 / #985)
|
|
82
|
-
"dryRun",
|
|
83
|
-
"durationMs",
|
|
84
|
-
"email",
|
|
85
|
-
"events",
|
|
86
|
-
"expiresInSeconds",
|
|
87
|
-
"feature",
|
|
88
|
-
"filename",
|
|
89
|
-
"filter", // document.query/queryOne/count: record filter (#948 / #985)
|
|
90
|
-
"filters",
|
|
91
|
-
"groupBy",
|
|
92
|
-
"groupId",
|
|
93
|
-
"groupType",
|
|
94
|
-
"htmlBody",
|
|
95
|
-
"includeUserDetails",
|
|
96
|
-
"input",
|
|
97
|
-
"integrationKey",
|
|
98
|
-
"iterationName", // iterate-users: required iteration name (#971)
|
|
99
|
-
"itemsField",
|
|
100
|
-
"limit",
|
|
101
|
-
"limits", // script: per-step runtime caps (lower-only-clamp; #783)
|
|
102
|
-
"maxPages",
|
|
103
|
-
"message",
|
|
104
|
-
"messages",
|
|
105
|
-
"metrics",
|
|
106
|
-
"model",
|
|
107
|
-
"modelName", // document.*: document model name to operate on (#948 / #985)
|
|
108
|
-
"modelOverride",
|
|
109
|
-
"ms",
|
|
110
|
-
"multipartFields",
|
|
111
|
-
"onConflict", // iterate-users: "skip" | "refuse" on singleton lock conflict (#971)
|
|
112
|
-
"onPartialFailure",
|
|
113
|
-
"operationName",
|
|
114
|
-
"options", // document.query/queryOne: query options (limit/sort/etc.) (#948 / #985)
|
|
115
|
-
"output",
|
|
116
|
-
"page",
|
|
117
|
-
"pageSize", // iterate-users: user-page size (#971)
|
|
118
|
-
"params",
|
|
119
|
-
"payload",
|
|
120
|
-
"perUser", // iterate-users: per-user child workflow descriptor (#971)
|
|
121
|
-
"plugins",
|
|
122
|
-
"prompt",
|
|
123
|
-
"promptKey",
|
|
124
|
-
"query",
|
|
125
|
-
"queryType",
|
|
126
|
-
"recordId", // document.save/patch/delete: target record id (#948 / #985)
|
|
127
|
-
"ref", // script: named reference to a Script (resolved at publish time; #783)
|
|
128
|
-
"request",
|
|
129
|
-
"route",
|
|
130
|
-
"runs",
|
|
131
|
-
"sort",
|
|
132
|
-
"source", // iterate-users: user-source descriptor ({ mode }) (#971)
|
|
133
|
-
"step", // collect: nested inner step definition
|
|
134
|
-
"subject",
|
|
135
|
-
"tags",
|
|
136
|
-
"temperature",
|
|
137
|
-
"templateType",
|
|
138
|
-
"textBody",
|
|
139
|
-
"thinkingLevel",
|
|
140
|
-
"to",
|
|
141
|
-
"tools",
|
|
142
|
-
"tool_choice",
|
|
143
|
-
"top_p",
|
|
144
|
-
"toUserId",
|
|
145
|
-
"type",
|
|
146
|
-
"user",
|
|
147
|
-
"userId",
|
|
148
|
-
"userUlid",
|
|
149
|
-
"variables",
|
|
150
|
-
"windowDays",
|
|
151
|
-
"with", // script: input context for the script (whole `with:` block; #783)
|
|
152
|
-
"workflowKey",
|
|
153
|
-
]);
|
|
38
|
+
const ALLOWLISTED_FIELDS = new Set(GENERATED_ALLOWLISTED_FIELDS);
|
|
39
|
+
/**
|
|
40
|
+
* The set of step kinds the CLI knows about (the server's registered kinds at
|
|
41
|
+
* generation time). A step whose `kind` is NOT in this set has its per-field
|
|
42
|
+
* allowlist check skipped — the kind-agnostic footgun detector still runs.
|
|
43
|
+
*/
|
|
44
|
+
const KNOWN_KINDS = new Set(GENERATED_KNOWN_KINDS);
|
|
154
45
|
/**
|
|
155
46
|
* Read-only view of `ALLOWLISTED_FIELDS` for the drift-guard test (#985).
|
|
156
47
|
*
|
|
@@ -161,6 +52,11 @@ const ALLOWLISTED_FIELDS = new Set([
|
|
|
161
52
|
* the public validator API; consumed only by the guard.
|
|
162
53
|
*/
|
|
163
54
|
export const ALLOWLISTED_FIELDS_FOR_DRIFT_GUARD = ALLOWLISTED_FIELDS;
|
|
55
|
+
/**
|
|
56
|
+
* Read-only view of `KNOWN_KINDS` for the drift-guard test (#998). Lets the
|
|
57
|
+
* guard assert the generated known-kind set matches a fresh scan.
|
|
58
|
+
*/
|
|
59
|
+
export const KNOWN_KINDS_FOR_DRIFT_GUARD = KNOWN_KINDS;
|
|
164
60
|
/**
|
|
165
61
|
* Walk a parsed workflow TOML document and return all unknown-field errors.
|
|
166
62
|
*
|
|
@@ -249,6 +145,17 @@ export function validateWorkflowToml(tomlData) {
|
|
|
249
145
|
*/
|
|
250
146
|
function validateStepObject(step, stepIndex, parentStepId, errors) {
|
|
251
147
|
const stepId = typeof step.id === "string" ? step.id : null;
|
|
148
|
+
// #998: kind-membership branch. The CLI ships independently and may run
|
|
149
|
+
// against a NEWER server that registered a step kind the CLI's generated
|
|
150
|
+
// known-kind set doesn't have. For such an UNKNOWN kind we skip the
|
|
151
|
+
// per-field allowlist check (so a valid new-kind field is never falsely
|
|
152
|
+
// rejected — the recurring #685/#802/#971 failure) while STILL running the
|
|
153
|
+
// kind-agnostic misnested-header footgun detector below. For a KNOWN kind
|
|
154
|
+
// the full allowlist check applies as before. A missing/non-string `kind`
|
|
155
|
+
// is treated as known so the legacy strict check still catches obviously
|
|
156
|
+
// malformed steps (the runtime would reject a kindless step anyway).
|
|
157
|
+
const kind = typeof step.kind === "string" ? step.kind : null;
|
|
158
|
+
const isKnownKind = kind === null || KNOWN_KINDS.has(kind);
|
|
252
159
|
for (const key of Object.keys(step)) {
|
|
253
160
|
const value = step[key];
|
|
254
161
|
// Codex finding 1 (PR #762, 2026-05-15): self-id misnesting must be
|
|
@@ -279,7 +186,11 @@ function validateStepObject(step, stepIndex, parentStepId, errors) {
|
|
|
279
186
|
typeof value === "object" &&
|
|
280
187
|
!Array.isArray(value) &&
|
|
281
188
|
!isSwitchFallbackField;
|
|
282
|
-
|
|
189
|
+
// Known kind → full allowlist check (an allowlisted field passes).
|
|
190
|
+
// Unknown kind → skip the per-field allowlist check entirely: only the
|
|
191
|
+
// structural footgun (self-id misnest) below can flag a field. The
|
|
192
|
+
// footgun check is kind-agnostic, so it fires on every step regardless.
|
|
193
|
+
if (!isSelfIdMisnest && (!isKnownKind || ALLOWLISTED_FIELDS.has(key)))
|
|
283
194
|
continue;
|
|
284
195
|
// Two failure modes are common enough to call out specifically in
|
|
285
196
|
// the hint:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-toml-validator.js","sourceRoot":"","sources":["../../../src/lib/workflow-toml-validator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"workflow-toml-validator.js","sourceRoot":"","sources":["../../../src/lib/workflow-toml-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAElC;;;GAGG;AACH,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAS,4BAA4B,CAAC,CAAC;AAEzE;;;;GAIG;AACH,MAAM,WAAW,GAAG,IAAI,GAAG,CAAS,qBAAqB,CAAC,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAC7C,kBAAkB,CAAC;AAErB;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAwB,WAAW,CAAC;AA4B5E;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAa;IAChD,MAAM,MAAM,GAAwB,EAAE,CAAC;IAEvC,IAAI,QA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6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "primitive-admin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.51",
|
|
4
4
|
"description": "CLI for administering Primitive applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"README.md"
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
|
+
"gen:allowlist": "node scripts/gen-allowlist.mjs",
|
|
22
|
+
"gen:allowlist:check": "node scripts/gen-allowlist.mjs --check",
|
|
23
|
+
"prebuild": "node scripts/gen-allowlist.mjs",
|
|
21
24
|
"build": "tsc",
|
|
22
25
|
"typecheck": "tsc --noEmit",
|
|
23
26
|
"prepublishOnly": "pnpm run build",
|