primitive-admin 1.1.0-alpha.87 → 1.1.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/dist/src/commands/database-types.js +313 -13
- package/dist/src/commands/database-types.js.map +1 -1
- package/dist/src/commands/llm.js +6 -9
- package/dist/src/commands/llm.js.map +1 -1
- package/dist/src/lib/migration-nag.d.ts +2 -2
- package/dist/src/lib/migration-nag.js +3 -4
- package/dist/src/lib/migration-nag.js.map +1 -1
- package/dist/src/lib/sync-dir-selector.d.ts +1 -1
- package/dist/src/lib/sync-dir-selector.js +1 -1
- package/package.json +2 -2
- package/dist/src/commands/settings.d.ts +0 -18
- package/dist/src/commands/settings.js +0 -54
- package/dist/src/commands/settings.js.map +0 -1
- package/dist/src/lib/app-match-guard.d.ts +0 -44
- package/dist/src/lib/app-match-guard.js +0 -72
- package/dist/src/lib/app-match-guard.js.map +0 -1
- package/dist/src/lib/function-triggers.d.ts +0 -66
- package/dist/src/lib/function-triggers.js +0 -285
- package/dist/src/lib/function-triggers.js.map +0 -1
- package/dist/src/lib/generated-workflow-model-fields.d.ts +0 -20
- package/dist/src/lib/generated-workflow-model-fields.js +0 -53
- package/dist/src/lib/generated-workflow-model-fields.js.map +0 -1
- package/dist/src/lib/google-client-secret-status.d.ts +0 -35
- package/dist/src/lib/google-client-secret-status.js +0 -56
- package/dist/src/lib/google-client-secret-status.js.map +0 -1
- package/dist/src/lib/workflow-field-descriptor.d.ts +0 -91
- package/dist/src/lib/workflow-field-descriptor.js +0 -153
- package/dist/src/lib/workflow-field-descriptor.js.map +0 -1
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The operator-facing warning for an app whose stored `googleClientSecret` is
|
|
3
|
-
* not a `{{secrets.KEY}}` reference (#2256, #2307).
|
|
4
|
-
*
|
|
5
|
-
* The server never sends such a value back: `GET /settings` omits the key and
|
|
6
|
-
* reports `googleClientSecretStatus` in its place, so the only way an operator
|
|
7
|
-
* learns the field is still unmigrated is a command that reads the status and
|
|
8
|
-
* says so. Two do — `apps get` and `config pull` — and
|
|
9
|
-
* each has two statuses to describe, so the wording lives here once and the
|
|
10
|
-
* call sites supply only what genuinely differs: how the field is named in that
|
|
11
|
-
* context, where the value is missing from, and what the un-migrated value
|
|
12
|
-
* blocks.
|
|
13
|
-
*
|
|
14
|
-
* Modelled on `signingSecretStatusWarning` (the same problem for
|
|
15
|
-
* `webhook.signingSecret`), deliberately kept as a separate function: the
|
|
16
|
-
* remediation names a different TOML key, and a `legacy-literal` blocks
|
|
17
|
-
* different things on the two fields.
|
|
18
|
-
*
|
|
19
|
-
* Returns `null` for a status that needs no warning (`reference`, `unset`, or
|
|
20
|
-
* anything a newer server adds), so a call site is one `if` rather than two.
|
|
21
|
-
*/
|
|
22
|
-
export declare function googleClientSecretStatusWarning(status: string | null | undefined, context: {
|
|
23
|
-
/** How to name the field, e.g. `"googleClientSecret"`. Starts the sentence. */
|
|
24
|
-
subject: string;
|
|
25
|
-
/** Where the value is missing from, e.g. `"this output"`. */
|
|
26
|
-
withheldFrom: string;
|
|
27
|
-
/**
|
|
28
|
-
* What an un-migrated value blocks, e.g. `"the next settings write will be
|
|
29
|
-
* rejected"`. Every settings write on such an app fails unless it carries a
|
|
30
|
-
* `googleClientSecret` that migrates the field
|
|
31
|
-
* (`validateGoogleClientSecretMigration`), and a pulled `app.toml` never
|
|
32
|
-
* carries one — so for the pull paths this is the concrete consequence.
|
|
33
|
-
*/
|
|
34
|
-
blocks: string;
|
|
35
|
-
}): string | null;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The operator-facing warning for an app whose stored `googleClientSecret` is
|
|
3
|
-
* not a `{{secrets.KEY}}` reference (#2256, #2307).
|
|
4
|
-
*
|
|
5
|
-
* The server never sends such a value back: `GET /settings` omits the key and
|
|
6
|
-
* reports `googleClientSecretStatus` in its place, so the only way an operator
|
|
7
|
-
* learns the field is still unmigrated is a command that reads the status and
|
|
8
|
-
* says so. Two do — `apps get` and `config pull` — and
|
|
9
|
-
* each has two statuses to describe, so the wording lives here once and the
|
|
10
|
-
* call sites supply only what genuinely differs: how the field is named in that
|
|
11
|
-
* context, where the value is missing from, and what the un-migrated value
|
|
12
|
-
* blocks.
|
|
13
|
-
*
|
|
14
|
-
* Modelled on `signingSecretStatusWarning` (the same problem for
|
|
15
|
-
* `webhook.signingSecret`), deliberately kept as a separate function: the
|
|
16
|
-
* remediation names a different TOML key, and a `legacy-literal` blocks
|
|
17
|
-
* different things on the two fields.
|
|
18
|
-
*
|
|
19
|
-
* Returns `null` for a status that needs no warning (`reference`, `unset`, or
|
|
20
|
-
* anything a newer server adds), so a call site is one `if` rather than two.
|
|
21
|
-
*/
|
|
22
|
-
export function googleClientSecretStatusWarning(status, context) {
|
|
23
|
-
const remediation = "Store the value with `primitive secrets set KEY --value <value>` and set " +
|
|
24
|
-
'googleClientSecret = "{{secrets.KEY}}".';
|
|
25
|
-
if (status === "legacy-literal") {
|
|
26
|
-
return (`${context.subject} still holds a raw value rather than a {{secrets.KEY}} reference, ` +
|
|
27
|
-
`so it is withheld from ${context.withheldFrom}. Google sign-in keeps working, but the ` +
|
|
28
|
-
`value is deprecated and ${context.blocks} until it is migrated. ${remediation}`);
|
|
29
|
-
}
|
|
30
|
-
// Not a working legacy literal: the stored value carries reference syntax
|
|
31
|
-
// that resolves to nothing, so Google sign-in is already failing (#2332).
|
|
32
|
-
//
|
|
33
|
-
// Two deliberate differences from the branch above, both to keep the
|
|
34
|
-
// rendered settings output byte-identical to what PR #2293 shipped:
|
|
35
|
-
//
|
|
36
|
-
// - `context.blocks` is unused. A push of the pulled file is rejected for
|
|
37
|
-
// this status too (`validateGoogleClientSecretMigration` gates on
|
|
38
|
-
// `isWithheldSecretStatus`, which covers both), but the sign-in outage is
|
|
39
|
-
// the louder problem and the remediation below already fixes both. The
|
|
40
|
-
// sibling `signingSecretStatusWarning` drops `blocks` in its malformed
|
|
41
|
-
// branch the same way.
|
|
42
|
-
// - The remediation sentence is written out rather than interpolating the
|
|
43
|
-
// `remediation` constant above: this one says "the real client secret",
|
|
44
|
-
// which the shared sentence does not.
|
|
45
|
-
//
|
|
46
|
-
// Both are worth revisiting together if `apps get`'s wording is ever
|
|
47
|
-
// allowed to change.
|
|
48
|
-
if (status === "malformed-reference") {
|
|
49
|
-
return (`${context.subject} is neither a {{secrets.KEY}} reference nor a plain stored value — it ` +
|
|
50
|
-
`carries reference syntax that does not resolve, so it is withheld from ${context.withheldFrom} ` +
|
|
51
|
-
"and Google sign-in is already FAILING. Store the real client secret with " +
|
|
52
|
-
'`primitive secrets set KEY --value <value>` and set googleClientSecret = "{{secrets.KEY}}".');
|
|
53
|
-
}
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=google-client-secret-status.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"google-client-secret-status.js","sourceRoot":"","sources":["../../../src/lib/google-client-secret-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,+BAA+B,CAC7C,MAAiC,EACjC,OAaC;IAED,MAAM,WAAW,GACf,2EAA2E;QAC3E,yCAAyC,CAAC;IAC5C,IAAI,MAAM,KAAK,gBAAgB,EAAE,CAAC;QAChC,OAAO,CACL,GAAG,OAAO,CAAC,OAAO,oEAAoE;YACtF,0BAA0B,OAAO,CAAC,YAAY,0CAA0C;YACxF,2BAA2B,OAAO,CAAC,MAAM,0BAA0B,WAAW,EAAE,CACjF,CAAC;IACJ,CAAC;IACD,0EAA0E;IAC1E,0EAA0E;IAC1E,EAAE;IACF,qEAAqE;IACrE,oEAAoE;IACpE,EAAE;IACF,4EAA4E;IAC5E,sEAAsE;IACtE,8EAA8E;IAC9E,2EAA2E;IAC3E,2EAA2E;IAC3E,2BAA2B;IAC3B,4EAA4E;IAC5E,4EAA4E;IAC5E,0CAA0C;IAC1C,EAAE;IACF,qEAAqE;IACrE,qBAAqB;IACrB,IAAI,MAAM,KAAK,qBAAqB,EAAE,CAAC;QACrC,OAAO,CACL,GAAG,OAAO,CAAC,OAAO,wEAAwE;YAC1F,0EAA0E,OAAO,CAAC,YAAY,GAAG;YACjG,2EAA2E;YAC3E,6FAA6F,CAC9F,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Classification of the `WorkflowDefinition` field surface (issue #2326,
|
|
3
|
-
* Phase 1 of #1976).
|
|
4
|
-
*
|
|
5
|
-
* Purpose: give the CLI a mechanical trip-wire for the drift that keeps
|
|
6
|
-
* happening — the server grows a `[workflow]`-level config field (`syncCallable`
|
|
7
|
-
* #807, `accessRule` #571, `runAs` #1081, `capabilities` #1172, `lock` #1518)
|
|
8
|
-
* and the CLI silently drops it on `sync push` / `sync pull`. Every field of the
|
|
9
|
-
* `WorkflowDefinition` model must appear in exactly one of the three groups
|
|
10
|
-
* below. The generated artifact `generated-workflow-model-fields.ts` carries the
|
|
11
|
-
* model's real field list (parsed from `models.yaml` at build time), and
|
|
12
|
-
* `cli/tests/unit/workflow-field-descriptor-drift-guard.test.ts` asserts
|
|
13
|
-
*
|
|
14
|
-
* synced ∪ structural ∪ internal === the model's fields
|
|
15
|
-
*
|
|
16
|
-
* so a new field hard-fails the guard until someone classifies it.
|
|
17
|
-
*
|
|
18
|
-
* ── Scope: declarative classification and coverage ONLY ──────────────────
|
|
19
|
-
* Decision of record (#1976, 2026-07-23): this table records WHICH fields
|
|
20
|
-
* exist, whether each is synced / structural / internal, and its `[workflow]`
|
|
21
|
-
* TOML key. Anything with real BEHAVIOR gets an explicit per-field handler or
|
|
22
|
-
* stays outside the table. In particular this file deliberately does NOT encode
|
|
23
|
-
* as boolean knobs:
|
|
24
|
-
* - the schema fields' native-TOML-table-vs-JSON-string parsing
|
|
25
|
-
* (`buildWorkflowPayloadFromToml` / `safeJsonParse` own that),
|
|
26
|
-
* - `syncCallable`'s deferred second PATCH on update (#807 — `applyWorkflowBody`
|
|
27
|
-
* owns that),
|
|
28
|
-
* - the `metadataManifest` (#1304) and `expr.cel` (#1614) structural side
|
|
29
|
-
* channels, which are attached alongside the steps write and are not
|
|
30
|
-
* `[workflow]`-table keys at all.
|
|
31
|
-
* `cli/src/lib/app-settings-descriptor.ts` is the shape being matched:
|
|
32
|
-
* deliberately narrow.
|
|
33
|
-
*
|
|
34
|
-
* ── What Phase 1 does and does not do ───────────────────────────────────
|
|
35
|
-
* Phase 1 (this file) is the guard only. Making the push builder
|
|
36
|
-
* (`workflow-payload.ts`) and the pull serializer (`serializeWorkflow` in
|
|
37
|
-
* `commands/sync.ts`) *consume* this table is Phase 2 (#2327).
|
|
38
|
-
* `synced` therefore means "belongs in the `[workflow]` TOML table", NOT
|
|
39
|
-
* "already round-trips" — see `SYNCED_NOT_YET_WIRED` below.
|
|
40
|
-
*/
|
|
41
|
-
/** Value shape of a synced `[workflow]` key. Descriptive; behavior lives in the handlers. */
|
|
42
|
-
export type WorkflowFieldType = "string" | "number" | "boolean" | "string[]" | "json";
|
|
43
|
-
export interface WorkflowFieldDescriptor {
|
|
44
|
-
/** `WorkflowDefinition` model field name === the server payload key. */
|
|
45
|
-
field: string;
|
|
46
|
-
/** Key under the `[workflow]` table in workflow TOML (usually === `field`). */
|
|
47
|
-
tomlKey: string;
|
|
48
|
-
/** Value shape, for the Phase 2 handlers and for documentation. */
|
|
49
|
-
type: WorkflowFieldType;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* The author-facing `[workflow]`-table config fields — the ones a workflow
|
|
53
|
-
* author manages as code and the CLI must round-trip.
|
|
54
|
-
*/
|
|
55
|
-
export declare const WORKFLOW_FIELD_DESCRIPTOR: readonly WorkflowFieldDescriptor[];
|
|
56
|
-
/**
|
|
57
|
-
* Fields that ARE author-controlled but do not live in the `[workflow]` table —
|
|
58
|
-
* they travel through their own structural channel. Kept distinct from
|
|
59
|
-
* `WORKFLOW_FIELDS_INTERNAL` so "internal" keeps meaning "not author-facing".
|
|
60
|
-
*/
|
|
61
|
-
export declare const WORKFLOW_FIELDS_STRUCTURAL: ReadonlySet<string>;
|
|
62
|
-
/**
|
|
63
|
-
* Fields the server owns: identity, ownership, timestamps, computed pointers,
|
|
64
|
-
* and the deprecated draft/revision slot. None of these are ever sent by the
|
|
65
|
-
* CLI, and none belong in workflow TOML.
|
|
66
|
-
*/
|
|
67
|
-
export declare const WORKFLOW_FIELDS_INTERNAL: ReadonlySet<string>;
|
|
68
|
-
/**
|
|
69
|
-
* Synced fields the CLI does NOT round-trip yet — Phase 2 (#2327) wires them.
|
|
70
|
-
* Recorded explicitly so "classified" is never mistaken for "implemented".
|
|
71
|
-
* `lock` was wired by #1972; `templateMissingMarker` was removed from the
|
|
72
|
-
* platform by #2643, so the set is now empty.
|
|
73
|
-
*/
|
|
74
|
-
export declare const SYNCED_NOT_YET_WIRED: ReadonlySet<string>;
|
|
75
|
-
/** Descriptor `field` names, for coverage/parity checks. */
|
|
76
|
-
export declare const WORKFLOW_SYNCED_FIELDS: ReadonlySet<string>;
|
|
77
|
-
/** Look up a synced field's descriptor by model field name. */
|
|
78
|
-
export declare function getWorkflowFieldDescriptor(field: string): WorkflowFieldDescriptor | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* Model fields that are classified in NONE of synced / structural / internal —
|
|
81
|
-
* i.e. a field someone added to `models.yaml` without deciding how the CLI
|
|
82
|
-
* treats it. Non-empty is a hard failure in the drift guard.
|
|
83
|
-
*/
|
|
84
|
-
export declare function findUnclassifiedWorkflowFields(modelFields: readonly string[]): string[];
|
|
85
|
-
/**
|
|
86
|
-
* Classifications that no longer correspond to a model field — i.e. a field
|
|
87
|
-
* removed from `models.yaml` while the CLI still classifies it. Also a hard
|
|
88
|
-
* failure: a stale classification must not silently pass, or the coverage
|
|
89
|
-
* claim quietly stops meaning anything.
|
|
90
|
-
*/
|
|
91
|
-
export declare function findStaleWorkflowClassifications(modelFields: readonly string[]): string[];
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Classification of the `WorkflowDefinition` field surface (issue #2326,
|
|
3
|
-
* Phase 1 of #1976).
|
|
4
|
-
*
|
|
5
|
-
* Purpose: give the CLI a mechanical trip-wire for the drift that keeps
|
|
6
|
-
* happening — the server grows a `[workflow]`-level config field (`syncCallable`
|
|
7
|
-
* #807, `accessRule` #571, `runAs` #1081, `capabilities` #1172, `lock` #1518)
|
|
8
|
-
* and the CLI silently drops it on `sync push` / `sync pull`. Every field of the
|
|
9
|
-
* `WorkflowDefinition` model must appear in exactly one of the three groups
|
|
10
|
-
* below. The generated artifact `generated-workflow-model-fields.ts` carries the
|
|
11
|
-
* model's real field list (parsed from `models.yaml` at build time), and
|
|
12
|
-
* `cli/tests/unit/workflow-field-descriptor-drift-guard.test.ts` asserts
|
|
13
|
-
*
|
|
14
|
-
* synced ∪ structural ∪ internal === the model's fields
|
|
15
|
-
*
|
|
16
|
-
* so a new field hard-fails the guard until someone classifies it.
|
|
17
|
-
*
|
|
18
|
-
* ── Scope: declarative classification and coverage ONLY ──────────────────
|
|
19
|
-
* Decision of record (#1976, 2026-07-23): this table records WHICH fields
|
|
20
|
-
* exist, whether each is synced / structural / internal, and its `[workflow]`
|
|
21
|
-
* TOML key. Anything with real BEHAVIOR gets an explicit per-field handler or
|
|
22
|
-
* stays outside the table. In particular this file deliberately does NOT encode
|
|
23
|
-
* as boolean knobs:
|
|
24
|
-
* - the schema fields' native-TOML-table-vs-JSON-string parsing
|
|
25
|
-
* (`buildWorkflowPayloadFromToml` / `safeJsonParse` own that),
|
|
26
|
-
* - `syncCallable`'s deferred second PATCH on update (#807 — `applyWorkflowBody`
|
|
27
|
-
* owns that),
|
|
28
|
-
* - the `metadataManifest` (#1304) and `expr.cel` (#1614) structural side
|
|
29
|
-
* channels, which are attached alongside the steps write and are not
|
|
30
|
-
* `[workflow]`-table keys at all.
|
|
31
|
-
* `cli/src/lib/app-settings-descriptor.ts` is the shape being matched:
|
|
32
|
-
* deliberately narrow.
|
|
33
|
-
*
|
|
34
|
-
* ── What Phase 1 does and does not do ───────────────────────────────────
|
|
35
|
-
* Phase 1 (this file) is the guard only. Making the push builder
|
|
36
|
-
* (`workflow-payload.ts`) and the pull serializer (`serializeWorkflow` in
|
|
37
|
-
* `commands/sync.ts`) *consume* this table is Phase 2 (#2327).
|
|
38
|
-
* `synced` therefore means "belongs in the `[workflow]` TOML table", NOT
|
|
39
|
-
* "already round-trips" — see `SYNCED_NOT_YET_WIRED` below.
|
|
40
|
-
*/
|
|
41
|
-
/**
|
|
42
|
-
* The author-facing `[workflow]`-table config fields — the ones a workflow
|
|
43
|
-
* author manages as code and the CLI must round-trip.
|
|
44
|
-
*/
|
|
45
|
-
export const WORKFLOW_FIELD_DESCRIPTOR = [
|
|
46
|
-
{ field: "name", tomlKey: "name", type: "string" },
|
|
47
|
-
{ field: "status", tomlKey: "status", type: "string" },
|
|
48
|
-
{ field: "description", tomlKey: "description", type: "string" },
|
|
49
|
-
// JSON Schema objects. TOML may present them as an inline table OR as a
|
|
50
|
-
// JSON string; the push builder owns that parse (not a knob here).
|
|
51
|
-
{ field: "inputSchema", tomlKey: "inputSchema", type: "json" },
|
|
52
|
-
{ field: "outputSchema", tomlKey: "outputSchema", type: "json" },
|
|
53
|
-
{ field: "perUserMaxRunning", tomlKey: "perUserMaxRunning", type: "number" },
|
|
54
|
-
{ field: "perUserMaxQueued", tomlKey: "perUserMaxQueued", type: "number" },
|
|
55
|
-
{ field: "perAppMaxRunning", tomlKey: "perAppMaxRunning", type: "number" },
|
|
56
|
-
{ field: "perAppMaxQueued", tomlKey: "perAppMaxQueued", type: "number" },
|
|
57
|
-
{ field: "queueTtlSeconds", tomlKey: "queueTtlSeconds", type: "number" },
|
|
58
|
-
{ field: "dequeueOrder", tomlKey: "dequeueOrder", type: "string" },
|
|
59
|
-
{
|
|
60
|
-
field: "requiresClientApply",
|
|
61
|
-
tomlKey: "requiresClientApply",
|
|
62
|
-
type: "boolean",
|
|
63
|
-
},
|
|
64
|
-
// Create-only on the wire (#807: update sends it as a deferred second PATCH
|
|
65
|
-
// once the new steps are live). That sequencing is the payload builder's job.
|
|
66
|
-
{ field: "syncCallable", tomlKey: "syncCallable", type: "boolean" },
|
|
67
|
-
{ field: "accessRule", tomlKey: "accessRule", type: "string" },
|
|
68
|
-
{ field: "runAs", tomlKey: "runAs", type: "string" },
|
|
69
|
-
// #1518/#1972 — declarative run-scoped lock. `[workflow.lock]` inline table
|
|
70
|
-
// on the TOML side, JSON on the wire; validated server-side by
|
|
71
|
-
// `parseWorkflowLock` (decision of record #6: no client-side mirror validator).
|
|
72
|
-
{ field: "lock", tomlKey: "lock", type: "json" },
|
|
73
|
-
// #1078 Tier 1b — StringSetField on the model, string array in TOML/JSON.
|
|
74
|
-
{ field: "capabilities", tomlKey: "capabilities", type: "string[]" },
|
|
75
|
-
];
|
|
76
|
-
/**
|
|
77
|
-
* Fields that ARE author-controlled but do not live in the `[workflow]` table —
|
|
78
|
-
* they travel through their own structural channel. Kept distinct from
|
|
79
|
-
* `WORKFLOW_FIELDS_INTERNAL` so "internal" keeps meaning "not author-facing".
|
|
80
|
-
*/
|
|
81
|
-
export const WORKFLOW_FIELDS_STRUCTURAL = new Set([
|
|
82
|
-
// The workflow's identity. Comes from the TOML file name / `--key`, and is
|
|
83
|
-
// attached by the caller rather than spread from the `[workflow]` table.
|
|
84
|
-
"workflowKey",
|
|
85
|
-
// #1304 — JSON declared-access manifest, derived from the workflow's CEL
|
|
86
|
-
// fields and attached alongside the steps write, not typed by the author.
|
|
87
|
-
"metadataManifest",
|
|
88
|
-
]);
|
|
89
|
-
/**
|
|
90
|
-
* Fields the server owns: identity, ownership, timestamps, computed pointers,
|
|
91
|
-
* and the deprecated draft/revision slot. None of these are ever sent by the
|
|
92
|
-
* CLI, and none belong in workflow TOML.
|
|
93
|
-
*/
|
|
94
|
-
export const WORKFLOW_FIELDS_INTERNAL = new Set([
|
|
95
|
-
// Identity / ownership / timestamps — assigned by the server.
|
|
96
|
-
"workflowId",
|
|
97
|
-
"appId",
|
|
98
|
-
"createdBy",
|
|
99
|
-
"createdAt",
|
|
100
|
-
"modifiedAt",
|
|
101
|
-
// Pointer to the active WorkflowConfiguration — server-computed on publish.
|
|
102
|
-
"activeConfigId",
|
|
103
|
-
// DEPRECATED in models.yaml: the legacy revision + draft slot, kept for
|
|
104
|
-
// migration/backward compatibility. Server-managed; never author-authored.
|
|
105
|
-
"latestRevision",
|
|
106
|
-
"stepsR2Key",
|
|
107
|
-
"draftStepsR2Key",
|
|
108
|
-
"draftInputSchema",
|
|
109
|
-
"draftOutputSchema",
|
|
110
|
-
"draftModifiedAt",
|
|
111
|
-
]);
|
|
112
|
-
/**
|
|
113
|
-
* Synced fields the CLI does NOT round-trip yet — Phase 2 (#2327) wires them.
|
|
114
|
-
* Recorded explicitly so "classified" is never mistaken for "implemented".
|
|
115
|
-
* `lock` was wired by #1972; `templateMissingMarker` was removed from the
|
|
116
|
-
* platform by #2643, so the set is now empty.
|
|
117
|
-
*/
|
|
118
|
-
export const SYNCED_NOT_YET_WIRED = new Set([]);
|
|
119
|
-
/** Descriptor `field` names, for coverage/parity checks. */
|
|
120
|
-
export const WORKFLOW_SYNCED_FIELDS = new Set(WORKFLOW_FIELD_DESCRIPTOR.map((d) => d.field));
|
|
121
|
-
/** Look up a synced field's descriptor by model field name. */
|
|
122
|
-
export function getWorkflowFieldDescriptor(field) {
|
|
123
|
-
return WORKFLOW_FIELD_DESCRIPTOR.find((d) => d.field === field);
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Model fields that are classified in NONE of synced / structural / internal —
|
|
127
|
-
* i.e. a field someone added to `models.yaml` without deciding how the CLI
|
|
128
|
-
* treats it. Non-empty is a hard failure in the drift guard.
|
|
129
|
-
*/
|
|
130
|
-
export function findUnclassifiedWorkflowFields(modelFields) {
|
|
131
|
-
return modelFields
|
|
132
|
-
.filter((f) => !WORKFLOW_SYNCED_FIELDS.has(f) &&
|
|
133
|
-
!WORKFLOW_FIELDS_STRUCTURAL.has(f) &&
|
|
134
|
-
!WORKFLOW_FIELDS_INTERNAL.has(f))
|
|
135
|
-
.sort();
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Classifications that no longer correspond to a model field — i.e. a field
|
|
139
|
-
* removed from `models.yaml` while the CLI still classifies it. Also a hard
|
|
140
|
-
* failure: a stale classification must not silently pass, or the coverage
|
|
141
|
-
* claim quietly stops meaning anything.
|
|
142
|
-
*/
|
|
143
|
-
export function findStaleWorkflowClassifications(modelFields) {
|
|
144
|
-
const known = new Set(modelFields);
|
|
145
|
-
return [
|
|
146
|
-
...WORKFLOW_SYNCED_FIELDS,
|
|
147
|
-
...WORKFLOW_FIELDS_STRUCTURAL,
|
|
148
|
-
...WORKFLOW_FIELDS_INTERNAL,
|
|
149
|
-
]
|
|
150
|
-
.filter((f) => !known.has(f))
|
|
151
|
-
.sort();
|
|
152
|
-
}
|
|
153
|
-
//# sourceMappingURL=workflow-field-descriptor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-field-descriptor.js","sourceRoot":"","sources":["../../../src/lib/workflow-field-descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAmBH;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAuC;IAC3E,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;IAClD,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;IACtD,EAAE,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE;IAChE,wEAAwE;IACxE,mEAAmE;IACnE,EAAE,KAAK,EAAE,aAAa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