@substrat-run/cli 0.26.5 → 0.30.1
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/cli.js +81 -3
- package/dist/cli.js.map +1 -1
- package/dist/model.d.ts +65 -0
- package/dist/model.d.ts.map +1 -0
- package/dist/model.js +87 -0
- package/dist/model.js.map +1 -0
- package/dist/preview.d.ts.map +1 -1
- package/dist/preview.js +16 -22
- package/dist/preview.js.map +1 -1
- package/dist/problem.d.ts.map +1 -1
- package/dist/problem.js +40 -4
- package/dist/problem.js.map +1 -1
- package/dist/push.d.ts +104 -8
- package/dist/push.d.ts.map +1 -1
- package/dist/push.js +396 -40
- package/dist/push.js.map +1 -1
- package/package.json +4 -3
package/dist/problem.js
CHANGED
|
@@ -14,13 +14,40 @@
|
|
|
14
14
|
*
|
|
15
15
|
* 1. a problem document — `detail` (else `title`), the `code`, and the field errors;
|
|
16
16
|
* 2. `{ error }` — the pre-#113 body, still what an older deployed control plane and
|
|
17
|
-
* several hand-rolled `onError`s answer with
|
|
17
|
+
* several hand-rolled `onError`s answer with, including its top-level `issues` array
|
|
18
|
+
* (the raw Zod refusal: `{ error: 'invalid request', issues }`, where the `error`
|
|
19
|
+
* alone names nothing a builder can fix);
|
|
18
20
|
* 3. anything else — a slice of the raw body, which is at least the truth.
|
|
19
21
|
*/
|
|
20
22
|
import { problem as problemSchema } from '@substrat-run/contracts';
|
|
21
23
|
import { explainPlatformFault } from './http.js';
|
|
22
24
|
/** How much of an unrecognised body is worth printing before it stops being a message. */
|
|
23
25
|
const RAW_BODY_LIMIT = 300;
|
|
26
|
+
/**
|
|
27
|
+
* The pre-#113 validation body's field complaints, in the shape a problem document uses.
|
|
28
|
+
*
|
|
29
|
+
* A control plane that has not adopted `toProblem` answers a Zod refusal with
|
|
30
|
+
* `{ error: 'invalid request', issues: [...] }` — the sentence says nothing and the array
|
|
31
|
+
* says everything. `issues` entries are Zod's own (`path: ['tag']`, `message`), so they
|
|
32
|
+
* map onto `errors` one for one; an entry in some other shape is kept as its own text
|
|
33
|
+
* rather than dropped, because a message nobody can read still beats one nobody sees.
|
|
34
|
+
*/
|
|
35
|
+
function legacyIssues(parsed) {
|
|
36
|
+
if (parsed === null || typeof parsed !== 'object')
|
|
37
|
+
return undefined;
|
|
38
|
+
const raw = parsed.issues;
|
|
39
|
+
if (!Array.isArray(raw) || raw.length === 0)
|
|
40
|
+
return undefined;
|
|
41
|
+
return raw.map((issue) => {
|
|
42
|
+
if (issue !== null && typeof issue === 'object') {
|
|
43
|
+
const o = issue;
|
|
44
|
+
const path = Array.isArray(o.path) ? o.path.join('.') : typeof o.path === 'string' ? o.path : '';
|
|
45
|
+
if (typeof o.message === 'string' && o.message)
|
|
46
|
+
return { path, message: o.message };
|
|
47
|
+
}
|
|
48
|
+
return { path: '', message: typeof issue === 'string' ? issue : JSON.stringify(issue) };
|
|
49
|
+
});
|
|
50
|
+
}
|
|
24
51
|
/**
|
|
25
52
|
* Parse a response body into what it actually says.
|
|
26
53
|
*
|
|
@@ -41,14 +68,18 @@ export function readProblem(body) {
|
|
|
41
68
|
catch {
|
|
42
69
|
return { detail: raw.slice(0, RAW_BODY_LIMIT) };
|
|
43
70
|
}
|
|
71
|
+
// The field complaints, wherever this body happens to carry them: `errors` is the
|
|
72
|
+
// contract's member, `issues` the pre-#113 one, and a body may carry either.
|
|
73
|
+
const issues = legacyIssues(parsed);
|
|
44
74
|
const strict = problemSchema.safeParse(parsed);
|
|
45
75
|
if (strict.success) {
|
|
46
76
|
const p = strict.data;
|
|
77
|
+
const errors = p.errors && p.errors.length > 0 ? p.errors : issues;
|
|
47
78
|
return {
|
|
48
79
|
detail: p.detail ?? p.error ?? p.title,
|
|
49
80
|
code: p.code,
|
|
50
81
|
title: p.title,
|
|
51
|
-
...(
|
|
82
|
+
...(errors ? { errors } : {}),
|
|
52
83
|
};
|
|
53
84
|
}
|
|
54
85
|
// Not a whole problem document. Read the members that ARE there, in the order of
|
|
@@ -58,8 +89,13 @@ export function readProblem(body) {
|
|
|
58
89
|
const o = parsed;
|
|
59
90
|
const str = (k) => (typeof o[k] === 'string' && o[k] ? o[k] : undefined);
|
|
60
91
|
const detail = str('detail') ?? str('error') ?? str('message') ?? str('title');
|
|
61
|
-
if (detail !== undefined) {
|
|
62
|
-
return {
|
|
92
|
+
if (detail !== undefined || issues) {
|
|
93
|
+
return {
|
|
94
|
+
detail: detail ?? '',
|
|
95
|
+
...(str('code') ? { code: str('code') } : {}),
|
|
96
|
+
...(str('title') ? { title: str('title') } : {}),
|
|
97
|
+
...(issues ? { errors: issues } : {}),
|
|
98
|
+
};
|
|
63
99
|
}
|
|
64
100
|
}
|
|
65
101
|
return { detail: raw.slice(0, RAW_BODY_LIMIT) };
|
package/dist/problem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"problem.js","sourceRoot":"","sources":["../src/problem.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"problem.js","sourceRoot":"","sources":["../src/problem.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD,0FAA0F;AAC1F,MAAM,cAAc,GAAG,GAAG,CAAC;AAc3B;;;;;;;;GAQG;AACH,SAAS,YAAY,CAAC,MAAe;IACnC,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACpE,MAAM,GAAG,GAAI,MAAkC,CAAC,MAAM,CAAC;IACvD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC9D,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACvB,IA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package/dist/push.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AssetEntry, type AssetsNeed, type PermissionRegistry, type RuntimeNeeds } from '@substrat-run/contracts';
|
|
1
|
+
import { type AssetEntry, type AssetsNeed, type EmittedModel, type EnvVarSpec, type PermissionRegistry, type PermissionsInput, type RuntimeNeeds, type VersionOrigin, type DeployManifest } from '@substrat-run/contracts';
|
|
2
2
|
/**
|
|
3
3
|
* Derive the vertical's permission registry (D-39/D-41) from its declared TypeScript surface —
|
|
4
4
|
* the single typed source. `package.json` `substrat.permissions` points at the module that
|
|
@@ -12,8 +12,50 @@ import { type AssetEntry, type AssetsNeed, type PermissionRegistry, type Runtime
|
|
|
12
12
|
* builder's own entry is not a new trust boundary. A missing pointer, a missing entry, or an
|
|
13
13
|
* entry that exports no `permissions` is a hard error: a deployable vertical must declare its
|
|
14
14
|
* surface — absence is never silently an empty surface (D-41).
|
|
15
|
+
*
|
|
16
|
+
* The same import also reads an optional `envSpec` export (#1206): the manifest's declared
|
|
17
|
+
* config surface, re-exported from the entry so `src/manifest.ts` is its single declaration.
|
|
18
|
+
* Optional because pre-#1206 verticals declare it in package.json `substrat.envSpec` instead —
|
|
19
|
+
* see `resolveDeclaredEnvSpec` for how the two are reconciled.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Every module's declared schedules, flattened with the owning module id (#1232) —
|
|
23
|
+
* what the deploy manifest carries so the dashboard can compute next-due off
|
|
24
|
+
* `everyMinutes`. Undefined when no module declares any, so the field stays absent.
|
|
15
25
|
*/
|
|
26
|
+
export declare function flattenDeclaredSchedules(permissions: PermissionsInput): DeployManifest['schedules'] | undefined;
|
|
27
|
+
/** The freshness twin of `flattenDeclaredSchedules` (#1232) — `within.hours` exists
|
|
28
|
+
* nowhere off the manifest, and the dashboard's declared-vs-observed read needs it. */
|
|
29
|
+
export declare function flattenDeclaredFreshness(permissions: PermissionsInput): DeployManifest['freshness'] | undefined;
|
|
30
|
+
export interface DeclaredSurface {
|
|
31
|
+
readonly registry: PermissionRegistry;
|
|
32
|
+
/** The entry's `envSpec` export, validated — undefined when the entry exports none. */
|
|
33
|
+
readonly envSpec: EnvVarSpec[] | undefined;
|
|
34
|
+
/** Every module's declared schedules, flattened with the owning module id (#1232) —
|
|
35
|
+
* undefined when no module declares any, so the manifest field stays absent. */
|
|
36
|
+
readonly schedules: DeployManifest['schedules'] | undefined;
|
|
37
|
+
/** Every module's freshness expectations, flattened the same way (#1232). */
|
|
38
|
+
readonly freshness: DeployManifest['freshness'] | undefined;
|
|
39
|
+
}
|
|
40
|
+
export declare function deriveDeclaredSurface(dir: string): Promise<DeclaredSurface>;
|
|
41
|
+
/** The declared permission surface alone — `deriveDeclaredSurface` for the callers that
|
|
42
|
+
* want only the registry (D-41). */
|
|
16
43
|
export declare function deriveRegistry(dir: string): Promise<PermissionRegistry>;
|
|
44
|
+
/**
|
|
45
|
+
* Which `envSpec` a push ships (#1206). The code-side declaration (the entry's `envSpec`
|
|
46
|
+
* export — `src/manifest.ts`, re-exported) is canonical when it exists: it is the copy the
|
|
47
|
+
* worker actually reads at runtime (`resolveEnvSpec(manifest.envSpec, env)`), so a key
|
|
48
|
+
* declared only there used to be a key nobody could ever set — the settings form is rendered
|
|
49
|
+
* from what the push uploads, and the push read only package.json. Deriving closes that.
|
|
50
|
+
*
|
|
51
|
+
* A vertical that has NOT adopted the export keeps the pre-#1206 behaviour: package.json
|
|
52
|
+
* `substrat.envSpec` ships, unchanged. One that has adopted it and still carries the
|
|
53
|
+
* package.json copy is refused on drift rather than warned: the duplicated copy silently
|
|
54
|
+
* losing a key is the exact defect, and a warning in CI logs is a diff surfaced nowhere.
|
|
55
|
+
* An identical leftover copy passes with a note, so adoption is a two-step that cannot
|
|
56
|
+
* wedge a release between its steps.
|
|
57
|
+
*/
|
|
58
|
+
export declare function resolveDeclaredEnvSpec(derived: EnvVarSpec[] | undefined, pkgCopy: readonly unknown[] | undefined, log?: (message: string) => void): readonly unknown[] | undefined;
|
|
17
59
|
/**
|
|
18
60
|
* The permission digest (D-39): a content hash of the vertical's declared permission surface —
|
|
19
61
|
* what the promotion checkpoint compares to fire "permissions changed". A pure function of the
|
|
@@ -21,6 +63,41 @@ export declare function deriveRegistry(dir: string): Promise<PermissionRegistry>
|
|
|
21
63
|
* shape moves.
|
|
22
64
|
*/
|
|
23
65
|
export declare function permissionDigest(registry: PermissionRegistry): Promise<string>;
|
|
66
|
+
/** The declared permission surface as `substrat push --check` reports it: the registry the
|
|
67
|
+
* push would ship, and the digest the promotion checkpoint would compare. */
|
|
68
|
+
export interface PermissionSurface {
|
|
69
|
+
readonly registry: PermissionRegistry;
|
|
70
|
+
/** `digests.permission` — moves iff a key, description, role or grant shape moves. */
|
|
71
|
+
readonly digest: string;
|
|
72
|
+
/** The code-side `envSpec` declaration, when the entry exports one (#1206) — already
|
|
73
|
+
* checked against any leftover package.json copy, so a drift threw before this existed. */
|
|
74
|
+
readonly envSpec?: readonly EnvVarSpec[];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The push's permission preflight, on its own (#1205).
|
|
78
|
+
*
|
|
79
|
+
* Everything a push does to the declared surface — resolve `package.json`
|
|
80
|
+
* `substrat.permissions`, bundle the entry, import it, derive the registry, hash it — happens
|
|
81
|
+
* before any credential is needed and touches no network. A vertical that wants that as a CI
|
|
82
|
+
* gate was reaching it by deep-importing `dist/push.js`, which is not a public surface: no
|
|
83
|
+
* `exports` map declares it, so any file move breaks a consumer nothing upstream knows about.
|
|
84
|
+
* The alternative — a second implementation of the derivation — is the two-descriptions defect
|
|
85
|
+
* this whole area exists to remove. So the gate is the CLI's own command, and the internals
|
|
86
|
+
* stay internal.
|
|
87
|
+
*
|
|
88
|
+
* Every failure is a throw carrying its own remedy (see `deriveRegistry`): a missing pointer,
|
|
89
|
+
* a pointer naming a file that has moved, an entry that stopped exporting `permissions`, and
|
|
90
|
+
* an entry that cannot be imported outside the vertical's runtime. The CLI's top-level handler
|
|
91
|
+
* turns each into a non-zero exit, which is what makes this usable as a gate.
|
|
92
|
+
*/
|
|
93
|
+
export declare function checkPermissionSurface(dir: string): Promise<PermissionSurface>;
|
|
94
|
+
/**
|
|
95
|
+
* Render a checked surface for a human reading CI output: every key with the module(s) that
|
|
96
|
+
* declare it and its description, every role with the keys it holds, every entity-grant shape,
|
|
97
|
+
* then the digest. Sorted throughout (`buildPermissionRegistry` guarantees it), so two runs of
|
|
98
|
+
* the same tree produce byte-identical text and a diff between them is a real surface change.
|
|
99
|
+
*/
|
|
100
|
+
export declare function formatPermissionSurface(surface: PermissionSurface, label?: string): string;
|
|
24
101
|
export declare function assetContentType(path: string): string;
|
|
25
102
|
/** A collected static file: its manifest row and the bytes that ride the upload. */
|
|
26
103
|
export interface CollectedAsset {
|
|
@@ -83,7 +160,7 @@ export declare function readRuntimeNeeds(dir: string): RuntimeNeeds | undefined;
|
|
|
83
160
|
* - no `assets` in EITHER vocabulary (runtimeNeeds or a hand-authored wrangler.jsonc),
|
|
84
161
|
* so nothing is uploaded to the runtime's asset store.
|
|
85
162
|
* - no inlined-assets module under `src/` — the pre-#340 base64 pattern serves its files
|
|
86
|
-
* from the worker and therefore declares nothing, correctly.
|
|
163
|
+
* from the worker and therefore declares nothing, correctly (`servesInlinedAssets`).
|
|
87
164
|
*
|
|
88
165
|
* `--allow-unserved-ui` is the deliberate override for the case this cannot see from the
|
|
89
166
|
* tree alone: an `app/` that is a mock, a fixture, or built and deployed by somebody else.
|
|
@@ -135,13 +212,21 @@ export interface LayerRulesChecked {
|
|
|
135
212
|
/** The absolute directory this check covered. */
|
|
136
213
|
readonly root: string;
|
|
137
214
|
/**
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
215
|
+
* What the check found — the value that rides the push as `origin.gate`, so the platform
|
|
216
|
+
* records it on the version (#955). `skipped` (`--skip-lint`) and `none` (no module code
|
|
217
|
+
* found) both mean nothing was checked, and are carried because a receipt that cannot say
|
|
218
|
+
* so is a receipt that launders the bypass: handed to a `push()` that did NOT ask to skip,
|
|
219
|
+
* it would stand in for a check that never ran, and without even the ungated notice.
|
|
141
220
|
*/
|
|
142
|
-
readonly
|
|
221
|
+
readonly gate: NonNullable<VersionOrigin['gate']>;
|
|
143
222
|
}
|
|
144
|
-
|
|
223
|
+
/**
|
|
224
|
+
* `log` is where the gate's own narration goes, and it is a parameter because one caller
|
|
225
|
+
* needs it off stdout: `substrat push --check --json` prints the registry as the ONLY thing
|
|
226
|
+
* on stdout, so a redirect into a file is a usable artifact. Everything else takes the
|
|
227
|
+
* default and reads exactly as before.
|
|
228
|
+
*/
|
|
229
|
+
export declare function assertLayerRules(dir: string, skipLint?: boolean, log?: (message: string) => void): LayerRulesChecked;
|
|
145
230
|
export interface PushOptions {
|
|
146
231
|
dir: string;
|
|
147
232
|
slug: string;
|
|
@@ -157,7 +242,9 @@ export interface PushOptions {
|
|
|
157
242
|
*/
|
|
158
243
|
tenant?: string;
|
|
159
244
|
/** The vertical's declared env-spec (from package.json `substrat.envSpec`), carried to the
|
|
160
|
-
* registry so the platform can render a config form for it. Validated control-plane-side.
|
|
245
|
+
* registry so the platform can render a config form for it. Validated control-plane-side.
|
|
246
|
+
* The FALLBACK copy only (#1206): when the permissions entry exports `envSpec`, that
|
|
247
|
+
* code-side declaration ships instead, and this copy drifting from it refuses the push. */
|
|
161
248
|
envSpec?: readonly unknown[];
|
|
162
249
|
/** Registry-driven install fields (marketplace-publish.md §3), from package.json `substrat.*`. */
|
|
163
250
|
ownerGrants?: readonly unknown[];
|
|
@@ -301,6 +388,15 @@ export interface VerticalMeta {
|
|
|
301
388
|
* Returns empty strings when there is no package.json — the caller then requires flags.
|
|
302
389
|
*/
|
|
303
390
|
export declare function readVerticalMeta(dir: string): VerticalMeta;
|
|
391
|
+
/**
|
|
392
|
+
* The vertical's emitted entity model (#1214), from the `model.json` beside its
|
|
393
|
+
* package.json — the artifact `pnpm lint:model` emits and gates (#697). `undefined` when
|
|
394
|
+
* there is none: a vertical that has not adopted the entity registry pushes exactly as it
|
|
395
|
+
* did before. A present-but-malformed file REFUSES the push with the artifact named — it
|
|
396
|
+
* means the file was hand-edited or emitted by an incompatible toolchain, and the control
|
|
397
|
+
* plane would bounce the manifest anyway; failing here costs no network round-trip.
|
|
398
|
+
*/
|
|
399
|
+
export declare function readDeclaredModel(dir: string): EmittedModel | undefined;
|
|
304
400
|
/**
|
|
305
401
|
* Pin the pushed-to workspace into the project's package.json (`substrat.tenant`) so every
|
|
306
402
|
* later push — any teammate, any machine, CI — lands in the same workspace without asking.
|
package/dist/push.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../src/push.ts"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../src/push.ts"],"names":[],"mappings":"AAOA,OAAO,EAUL,KAAK,UAAU,EACf,KAAK,UAAU,EAEf,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAgDjC;;;;;;;;;;;;;;;;;;GAkBG;AACH;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,gBAAgB,GAC5B,cAAc,CAAC,WAAW,CAAC,GAAG,SAAS,CAKzC;AAED;wFACwF;AACxF,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,gBAAgB,GAC5B,cAAc,CAAC,WAAW,CAAC,GAAG,SAAS,CAKzC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,uFAAuF;IACvF,QAAQ,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC;IAC3C;qFACiF;IACjF,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG,SAAS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