@sensigo/realm-cli 0.41.0 → 0.43.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/agent/run-attach.d.ts.map +1 -1
- package/dist/agent/run-attach.js +8 -21
- package/dist/agent/run-attach.js.map +1 -1
- package/dist/commands/drain.d.ts.map +1 -1
- package/dist/commands/drain.js +23 -6
- package/dist/commands/drain.js.map +1 -1
- package/dist/commands/inspect.d.ts.map +1 -1
- package/dist/commands/inspect.js +6 -5
- package/dist/commands/inspect.js.map +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +4 -2
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/register.d.ts +1 -39
- package/dist/commands/register.d.ts.map +1 -1
- package/dist/commands/register.js +21 -89
- package/dist/commands/register.js.map +1 -1
- package/dist/commands/replay.d.ts.map +1 -1
- package/dist/commands/replay.js +4 -2
- package/dist/commands/replay.js.map +1 -1
- package/dist/commands/respond.d.ts.map +1 -1
- package/dist/commands/respond.js +8 -3
- package/dist/commands/respond.js.map +1 -1
- package/dist/commands/resume.d.ts.map +1 -1
- package/dist/commands/resume.js +3 -2
- package/dist/commands/resume.js.map +1 -1
- package/dist/commands/run.d.ts +4 -3
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +30 -10
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/test.d.ts.map +1 -1
- package/dist/commands/test.js +8 -5
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/validate.d.ts +12 -0
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +444 -170
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/watch.d.ts +14 -2
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +269 -72
- package/dist/commands/watch.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/admission-context.d.ts +58 -0
- package/dist/lib/admission-context.d.ts.map +1 -0
- package/dist/lib/admission-context.js +57 -0
- package/dist/lib/admission-context.js.map +1 -0
- package/dist/lib/load-workflow-for-admission.d.ts +69 -0
- package/dist/lib/load-workflow-for-admission.d.ts.map +1 -0
- package/dist/lib/load-workflow-for-admission.js +130 -0
- package/dist/lib/load-workflow-for-admission.js.map +1 -0
- package/dist/lib/loader-warnings.d.ts +26 -9
- package/dist/lib/loader-warnings.d.ts.map +1 -1
- package/dist/lib/loader-warnings.js +51 -31
- package/dist/lib/loader-warnings.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admission-context.d.ts","sourceRoot":"","sources":["../../src/lib/admission-context.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,wFAAwF;AACxF,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG,YAAY,CAAC;AAE/D,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAC;IACrC,2CAA2C;IAC3C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,oEAAoE;IACpE,QAAQ,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE,kBAAkB,KAAK,OAAO,CAAC;CAC/D;AAED,eAAO,MAAM,wBAAwB;;;;;0BAMpB,kBAAkB;;;;;;;EAckB,CAAC;AAEtD,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAEtF,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,uBAAuB,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,oBAAoB,EAC3B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,MAAM,CAMR;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,CAO7E"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export const CONTEXT_DEPENDENT_CHECKS = [
|
|
2
|
+
{
|
|
3
|
+
id: 'agent_profile_resolution',
|
|
4
|
+
needs: 'source_dir',
|
|
5
|
+
label: 'agent-profile file resolution',
|
|
6
|
+
witness: 'resolveAgentProfiles(definition, workflowDir)',
|
|
7
|
+
applies: (d) => Object.values(d.steps).some((s) => s.agent_profile !== undefined),
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
id: 'project_extensions',
|
|
11
|
+
needs: 'trust_root',
|
|
12
|
+
label: 'project extensions (modules, manifest, config_schema)',
|
|
13
|
+
witness: undefined,
|
|
14
|
+
// ALWAYS applies: register's extensions pass is unconditional, and an extension-free
|
|
15
|
+
// workflow IS refused by an invalid manifest at its trust root (executed). Whether a
|
|
16
|
+
// manifest governs the copy is unknowable once the tree is gone — exactly what "not run"
|
|
17
|
+
// says.
|
|
18
|
+
applies: () => true,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* The reason vocabulary — three shapes, keyed on the member's `needs` and, when the path was
|
|
23
|
+
* never recorded at all, on the record's `origin` (issue #524-class message-claim-truth
|
|
24
|
+
* correction — a #553 self-catch, not #524's own issue). "registered before v0.14" is true for
|
|
25
|
+
* a FILE-registered copy that predates `source_dir`/`trust_root` stamping — but a `create_workflow`
|
|
26
|
+
* copy (`origin: 'agent'`) never goes through the file loader and never records a source tree AT
|
|
27
|
+
* ALL, whatever version created it: `create-workflow.ts` stamps `origin: 'agent'` and nothing
|
|
28
|
+
* else path-shaped.
|
|
29
|
+
*/
|
|
30
|
+
export function notRunReason(needs, recorded, origin) {
|
|
31
|
+
if (recorded !== undefined)
|
|
32
|
+
return `${needs} ${recorded} no longer exists`;
|
|
33
|
+
if (origin === 'agent') {
|
|
34
|
+
return `no ${needs} recorded (created by create_workflow, which registers without a source tree)`;
|
|
35
|
+
}
|
|
36
|
+
return `no ${needs} recorded (registered before v0.14)`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The always-on disclosure line for `validate --registered`:
|
|
40
|
+
* `N check(s) not run: <label> (<reason>)[; <label> (<reason>)]`
|
|
41
|
+
* Each member renders beside its OWN reason, `; `-joined in member order — reasons are NEVER
|
|
42
|
+
* deduplicated (issue #553 correction C6): two members that happen to share a reason text (e.g.
|
|
43
|
+
* both "registered before v0.14") still each print their own label-and-reason pair, because
|
|
44
|
+
* collapsing them into one shared parenthetical reads as a single combined cause rather than two
|
|
45
|
+
* independent skips.
|
|
46
|
+
* Empty input → empty string (the caller prints nothing: every check ran).
|
|
47
|
+
*/
|
|
48
|
+
export function renderChecksNotRunLine(notRun) {
|
|
49
|
+
if (notRun.length === 0)
|
|
50
|
+
return '';
|
|
51
|
+
const parts = notRun.map((n) => {
|
|
52
|
+
const label = CONTEXT_DEPENDENT_CHECKS.find((c) => c.id === n.id)?.label ?? n.id;
|
|
53
|
+
return `${label} (${n.reason})`;
|
|
54
|
+
});
|
|
55
|
+
return `${notRun.length} ${notRun.length === 1 ? 'check' : 'checks'} not run: ${parts.join('; ')}`;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=admission-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admission-context.js","sourceRoot":"","sources":["../../src/lib/admission-context.ts"],"names":[],"mappings":"AAgCA,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC;QACE,EAAE,EAAE,0BAA0B;QAC9B,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,+BAA+B;QACtC,OAAO,EAAE,+CAA+C;QACxD,OAAO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CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,aAAa,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACrG,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type WorkflowDefinition, type LoaderWarning } from '@sensigo/realm';
|
|
2
|
+
import { type LoadedProjectExtensions } from '../extensions/load-project-extensions.js';
|
|
3
|
+
/**
|
|
4
|
+
* Tags a failure thrown by the extensions load inside `loadWorkflowForAdmission` so the
|
|
5
|
+
* callers' catches can say `Error loading extensions:` — the sentence run and validate already
|
|
6
|
+
* print for this class (issue #451) — without guessing from the message. The message is the
|
|
7
|
+
* original's, byte for byte (register-extensions.test.ts's broken-module cell matches on it
|
|
8
|
+
* THROUGH this wrapper), and the original rides along as `cause`.
|
|
9
|
+
*
|
|
10
|
+
* Minted at exactly the two throw paths out of the extensions block: the real-mode load's
|
|
11
|
+
* non-secrets failure, and the sentinel retry. The retry can never throw ManifestSecretsError
|
|
12
|
+
* itself (sentinel mode resolves every name without reading a source), so nothing is wrapped
|
|
13
|
+
* twice. A WorkflowError from the two-pass re-validation is thrown OUTSIDE the block and keeps
|
|
14
|
+
* the family split.
|
|
15
|
+
*
|
|
16
|
+
* Carries the workflow's own pass-1 loader warnings (issue #463 — the #424 carry shape on this
|
|
17
|
+
* vehicle) so the catch that renders the sentence can print them FIRST, instead of the author
|
|
18
|
+
* fixing the module, re-running, and only then learning about the typo. ABSENT, never `[]`: a
|
|
19
|
+
* construction that passes no warnings, or an empty list, leaves the field unset.
|
|
20
|
+
*
|
|
21
|
+
* Carries the pass-1 definition too (issue #553): validate's `--json` names `workflow_id` on
|
|
22
|
+
* this arm and computes the retry advisory from the definition before printing the sentence.
|
|
23
|
+
*
|
|
24
|
+
* @internal Exported for register.ts, watch.ts, validate.ts and for tests.
|
|
25
|
+
*/
|
|
26
|
+
export declare class ExtensionLoadError extends Error {
|
|
27
|
+
readonly warnings?: readonly LoaderWarning[];
|
|
28
|
+
readonly definition?: WorkflowDefinition;
|
|
29
|
+
constructor(original: unknown, warnings?: readonly LoaderWarning[], definition?: WorkflowDefinition);
|
|
30
|
+
}
|
|
31
|
+
/** @internal Exported for validate.ts. */
|
|
32
|
+
export declare function admittedDefinitionOf(err: unknown): WorkflowDefinition | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* The project-extensions pass ALONE (issue #553 correction C2) — the real load, degrading to
|
|
35
|
+
* SENTINEL credentials with a loud, surface-keyed WARN pair when a secret source is unavailable,
|
|
36
|
+
* and the RAW error on any other failure (the caller decides how to wrap/report it; this function
|
|
37
|
+
* throws nothing `ExtensionLoadError`-shaped itself). This is the ONE mint site for "⚠ …with
|
|
38
|
+
* SENTINEL credentials — execution paths still require real secret resolution." — before this
|
|
39
|
+
* extraction it was minted here AND hand-typed a second time in `validate --registered`'s own
|
|
40
|
+
* extensions arm (the #444/#508 two-mints-of-one-string class); both callers now share it.
|
|
41
|
+
* `overrideModule` is `--extensions-module`: it must travel into BOTH loads (the real attempt and
|
|
42
|
+
* the sentinel retry) or a repair flag dies in its own retry (the #353/#466 flag-travel class).
|
|
43
|
+
*/
|
|
44
|
+
export declare function admitProjectExtensions(definition: WorkflowDefinition, opts: {
|
|
45
|
+
surface: 'register' | 'watch' | 'validate';
|
|
46
|
+
overrideModule?: string;
|
|
47
|
+
}): Promise<LoadedProjectExtensions>;
|
|
48
|
+
/**
|
|
49
|
+
* Loads and validates a workflow for admission — register, watch and validate all take exactly
|
|
50
|
+
* this path (issue #553). The file loader (agent-profile resolution included), then the
|
|
51
|
+
* UNCONDITIONAL project-extensions load (modules, manifest, config_schema two-pass), degrading
|
|
52
|
+
* to SENTINEL credentials with a loud WARN when a secret source is unavailable.
|
|
53
|
+
* Returns the definition alongside every accumulated LoaderWarning (issue #169) — pass-1's
|
|
54
|
+
* structural warnings plus the sentinel-credential warnings, if any — and the resolved manifest
|
|
55
|
+
* (validate's `Extensions:` line reports its counts). Prints NOTHING itself beyond the two
|
|
56
|
+
* sentinel ⚠ lines; every caller decides how to surface/act on warnings (register supports
|
|
57
|
+
* `--strict` + the dormant #170 reject; watch just prints and continues; validate reports).
|
|
58
|
+
* @throws on any validation or extension-load failure — nothing is persisted on throw.
|
|
59
|
+
* Extension-load failures are tagged `ExtensionLoadError` (issue #451).
|
|
60
|
+
*/
|
|
61
|
+
export declare function loadWorkflowForAdmission(filePath: string, opts: {
|
|
62
|
+
overrideModule?: string;
|
|
63
|
+
surface: 'register' | 'watch' | 'validate';
|
|
64
|
+
}): Promise<{
|
|
65
|
+
definition: WorkflowDefinition;
|
|
66
|
+
warnings: LoaderWarning[];
|
|
67
|
+
manifest: LoadedProjectExtensions['manifest'];
|
|
68
|
+
}>;
|
|
69
|
+
//# sourceMappingURL=load-workflow-for-admission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-workflow-for-admission.d.ts","sourceRoot":"","sources":["../../src/lib/load-workflow-for-admission.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,0CAA0C,CAAC;AAIlD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAC7C,QAAQ,CAAC,UAAU,CAAC,EAAE,kBAAkB,CAAC;gBAGvC,QAAQ,EAAE,OAAO,EACjB,QAAQ,CAAC,EAAE,SAAS,aAAa,EAAE,EACnC,UAAU,CAAC,EAAE,kBAAkB;CASlC;AAUD,0CAA0C;AAC1C,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAEjF;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,kBAAkB,EAC9B,IAAI,EAAE;IAAE,OAAO,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5E,OAAO,CAAC,uBAAuB,CAAC,CAqBlC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE;IAAE,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,UAAU,GAAG,OAAO,GAAG,UAAU,CAAA;CAAE,GAC5E,OAAO,CAAC;IACT,UAAU,EAAE,kBAAkB,CAAC;IAC/B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,QAAQ,EAAE,uBAAuB,CAAC,UAAU,CAAC,CAAC;CAC/C,CAAC,CAwBD"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// The ONE admission path (issue #553): what `validate` blesses, `register` accepts, and what
|
|
2
|
+
// `register` refuses, `validate` refuses — by construction, because both (and `watch`) call
|
|
3
|
+
// this function and nothing else. Relocated from register.ts, where validate could not import
|
|
4
|
+
// it without a cycle.
|
|
5
|
+
import { loadWorkflowFromFileWithDiagnostics, } from '@sensigo/realm';
|
|
6
|
+
import { loadProjectExtensions, } from '../extensions/load-project-extensions.js';
|
|
7
|
+
import { ManifestSecretsError } from '../extensions/manifest-secrets.js';
|
|
8
|
+
import { wrapSentinelWarnings } from './loader-warnings.js';
|
|
9
|
+
/**
|
|
10
|
+
* Tags a failure thrown by the extensions load inside `loadWorkflowForAdmission` so the
|
|
11
|
+
* callers' catches can say `Error loading extensions:` — the sentence run and validate already
|
|
12
|
+
* print for this class (issue #451) — without guessing from the message. The message is the
|
|
13
|
+
* original's, byte for byte (register-extensions.test.ts's broken-module cell matches on it
|
|
14
|
+
* THROUGH this wrapper), and the original rides along as `cause`.
|
|
15
|
+
*
|
|
16
|
+
* Minted at exactly the two throw paths out of the extensions block: the real-mode load's
|
|
17
|
+
* non-secrets failure, and the sentinel retry. The retry can never throw ManifestSecretsError
|
|
18
|
+
* itself (sentinel mode resolves every name without reading a source), so nothing is wrapped
|
|
19
|
+
* twice. A WorkflowError from the two-pass re-validation is thrown OUTSIDE the block and keeps
|
|
20
|
+
* the family split.
|
|
21
|
+
*
|
|
22
|
+
* Carries the workflow's own pass-1 loader warnings (issue #463 — the #424 carry shape on this
|
|
23
|
+
* vehicle) so the catch that renders the sentence can print them FIRST, instead of the author
|
|
24
|
+
* fixing the module, re-running, and only then learning about the typo. ABSENT, never `[]`: a
|
|
25
|
+
* construction that passes no warnings, or an empty list, leaves the field unset.
|
|
26
|
+
*
|
|
27
|
+
* Carries the pass-1 definition too (issue #553): validate's `--json` names `workflow_id` on
|
|
28
|
+
* this arm and computes the retry advisory from the definition before printing the sentence.
|
|
29
|
+
*
|
|
30
|
+
* @internal Exported for register.ts, watch.ts, validate.ts and for tests.
|
|
31
|
+
*/
|
|
32
|
+
export class ExtensionLoadError extends Error {
|
|
33
|
+
warnings;
|
|
34
|
+
definition;
|
|
35
|
+
constructor(original, warnings, definition) {
|
|
36
|
+
super(original instanceof Error ? original.message : String(original), { cause: original });
|
|
37
|
+
this.name = 'ExtensionLoadError';
|
|
38
|
+
// The if-guard form on purpose: a ternary to `undefined` is a TS2412 under the repo's
|
|
39
|
+
// exactOptionalPropertyTypes (lane-executed, #463).
|
|
40
|
+
if (warnings !== undefined && warnings.length > 0)
|
|
41
|
+
this.warnings = [...warnings];
|
|
42
|
+
if (definition !== undefined)
|
|
43
|
+
this.definition = definition;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The pass-1 definition of a workflow whose pass-2 (config_schema) re-validation threw. The
|
|
48
|
+
* thrown WorkflowError is register's and watch's to render exactly as before — its identity,
|
|
49
|
+
* message and family are untouched — so the definition rides beside it rather than on it.
|
|
50
|
+
* validate's `--json` reads it back for `workflow_id` (issue #553, audit round 2 Q9).
|
|
51
|
+
*/
|
|
52
|
+
const admittedDefinitions = new WeakMap();
|
|
53
|
+
/** @internal Exported for validate.ts. */
|
|
54
|
+
export function admittedDefinitionOf(err) {
|
|
55
|
+
return typeof err === 'object' && err !== null ? admittedDefinitions.get(err) : undefined;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The project-extensions pass ALONE (issue #553 correction C2) — the real load, degrading to
|
|
59
|
+
* SENTINEL credentials with a loud, surface-keyed WARN pair when a secret source is unavailable,
|
|
60
|
+
* and the RAW error on any other failure (the caller decides how to wrap/report it; this function
|
|
61
|
+
* throws nothing `ExtensionLoadError`-shaped itself). This is the ONE mint site for "⚠ …with
|
|
62
|
+
* SENTINEL credentials — execution paths still require real secret resolution." — before this
|
|
63
|
+
* extraction it was minted here AND hand-typed a second time in `validate --registered`'s own
|
|
64
|
+
* extensions arm (the #444/#508 two-mints-of-one-string class); both callers now share it.
|
|
65
|
+
* `overrideModule` is `--extensions-module`: it must travel into BOTH loads (the real attempt and
|
|
66
|
+
* the sentinel retry) or a repair flag dies in its own retry (the #353/#466 flag-travel class).
|
|
67
|
+
*/
|
|
68
|
+
export async function admitProjectExtensions(definition, opts) {
|
|
69
|
+
const override = opts.overrideModule !== undefined ? { overrideModule: opts.overrideModule } : {};
|
|
70
|
+
// Full module load + duck validation + manifest construction BEFORE persisting. Secret sources
|
|
71
|
+
// may be unavailable at provisioning time: degrade to SENTINEL construction with a loud WARN
|
|
72
|
+
// (never silent, never a registration blocker); execution paths still require real resolution.
|
|
73
|
+
try {
|
|
74
|
+
return await loadProjectExtensions(definition, { ...override });
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
// The guard is the degradation itself: only a secrets failure degrades, everything else is
|
|
78
|
+
// the caller's to tag and report. Dropping the conditional kills degradation —
|
|
79
|
+
// register-extensions.test.ts's sentinel control is the cell in this command's own home that
|
|
80
|
+
// sees it (the manifest E2E in extensions/ does too, one substring deep).
|
|
81
|
+
if (!(err instanceof ManifestSecretsError))
|
|
82
|
+
throw err;
|
|
83
|
+
console.warn(`⚠ ${err.message}`);
|
|
84
|
+
// Surface-keyed (issue #553): validate registers nothing, so "Registering" there is a false
|
|
85
|
+
// claim; register and watch keep their text byte for byte.
|
|
86
|
+
console.warn(`⚠ ${opts.surface === 'validate' ? 'Validating' : 'Registering'} with SENTINEL credentials — execution paths still require real secret resolution.`);
|
|
87
|
+
return await loadProjectExtensions(definition, { ...override, secretMode: 'sentinel' });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Loads and validates a workflow for admission — register, watch and validate all take exactly
|
|
92
|
+
* this path (issue #553). The file loader (agent-profile resolution included), then the
|
|
93
|
+
* UNCONDITIONAL project-extensions load (modules, manifest, config_schema two-pass), degrading
|
|
94
|
+
* to SENTINEL credentials with a loud WARN when a secret source is unavailable.
|
|
95
|
+
* Returns the definition alongside every accumulated LoaderWarning (issue #169) — pass-1's
|
|
96
|
+
* structural warnings plus the sentinel-credential warnings, if any — and the resolved manifest
|
|
97
|
+
* (validate's `Extensions:` line reports its counts). Prints NOTHING itself beyond the two
|
|
98
|
+
* sentinel ⚠ lines; every caller decides how to surface/act on warnings (register supports
|
|
99
|
+
* `--strict` + the dormant #170 reject; watch just prints and continues; validate reports).
|
|
100
|
+
* @throws on any validation or extension-load failure — nothing is persisted on throw.
|
|
101
|
+
* Extension-load failures are tagged `ExtensionLoadError` (issue #451).
|
|
102
|
+
*/
|
|
103
|
+
export async function loadWorkflowForAdmission(filePath, opts) {
|
|
104
|
+
const { definition, warnings: pass1Warnings } = loadWorkflowFromFileWithDiagnostics(filePath);
|
|
105
|
+
let loaded;
|
|
106
|
+
try {
|
|
107
|
+
loaded = await admitProjectExtensions(definition, opts);
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
throw new ExtensionLoadError(err, pass1Warnings, definition);
|
|
111
|
+
}
|
|
112
|
+
// Two-pass: re-validate with the resolved registry so step config is checked against
|
|
113
|
+
// each adapter's config_schema before the definition is persisted. Its warnings are proven
|
|
114
|
+
// identical to pass-1's (same content, registry only adds config_schema checks) — discarded
|
|
115
|
+
// here to avoid double-counting the same unknown key twice.
|
|
116
|
+
try {
|
|
117
|
+
loadWorkflowFromFileWithDiagnostics(filePath, loaded.registry);
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
if (typeof err === 'object' && err !== null)
|
|
121
|
+
admittedDefinitions.set(err, definition);
|
|
122
|
+
throw err;
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
definition,
|
|
126
|
+
warnings: [...pass1Warnings, ...wrapSentinelWarnings(loaded.sentinelWarnings)],
|
|
127
|
+
manifest: loaded.manifest,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=load-workflow-for-admission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-workflow-for-admission.js","sourceRoot":"","sources":["../../src/lib/load-workflow-for-admission.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,4FAA4F;AAC5F,8FAA8F;AAC9F,sBAAsB;AACtB,OAAO,EACL,mCAAmC,GAGpC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,qBAAqB,GAEtB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,QAAQ,CAA4B;IACpC,UAAU,CAAsB;IAEzC,YACE,QAAiB,EACjB,QAAmC,EACnC,UAA+B;QAE/B,KAAK,CAAC,QAAQ,YAAY,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC5F,IAAI,CAAC,IAAI,G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1
|
-
import { type WorkflowError, type LoaderWarning, type WarningCode } from '@sensigo/realm';
|
|
1
|
+
import { type WorkflowError, type LoaderWarning, type WarningCode, type WorkflowDefinition } from '@sensigo/realm';
|
|
2
2
|
/**
|
|
3
|
-
* Prints every warning via the single renderLoaderWarning format source
|
|
4
|
-
* "— ignored"
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* that only fails under `--strict` still renders "— ignored" — see the report's design note; the
|
|
8
|
-
* `--strict` path prints its own "failing due to --strict" line, so the author is not left
|
|
9
|
-
* without an explanation.
|
|
3
|
+
* Prints every warning via the single renderLoaderWarning format source — no substitution (see
|
|
4
|
+
* the module header for why the former "— ignored" → "— REFUSED below" rewrite was deleted,
|
|
5
|
+
* issue #540). The `DEFAULT_POLICY` import above stays: `rejectOnErrorSeverity` and
|
|
6
|
+
* `failsStrict`, both exported from this module, still resolve against it.
|
|
10
7
|
*/
|
|
11
8
|
export declare function printLoaderWarnings(warnings: readonly LoaderWarning[]): void;
|
|
12
9
|
/**
|
|
@@ -27,7 +24,7 @@ export declare function failsStrict(warnings: LoaderWarning[]): boolean;
|
|
|
27
24
|
* and both baked a two-space `⚠ ` into the message. The prefix now belongs to
|
|
28
25
|
* `renderLoaderWarning` alone, so the message here is the input string verbatim.
|
|
29
26
|
*
|
|
30
|
-
* register's caller is `
|
|
27
|
+
* register's caller is `loadWorkflowForAdmission`, which `watch` and `validate` also use — so the strip
|
|
31
28
|
* reaches watch too, and there is no third caller.
|
|
32
29
|
*/
|
|
33
30
|
export declare function wrapSentinelWarnings(sentinelWarnings: string[] | undefined): LoaderWarning[];
|
|
@@ -54,4 +51,24 @@ export declare function renderLoadFailure(err: WorkflowError | string): string;
|
|
|
54
51
|
* the one-caller rule recorded on validate's exitOnLoadFailure.
|
|
55
52
|
*/
|
|
56
53
|
export declare function renderEscalationLine(warnings: readonly LoaderWarning[]): string;
|
|
54
|
+
/**
|
|
55
|
+
* The author-extension keys a definition carries, in authored order (issue #559).
|
|
56
|
+
*
|
|
57
|
+
* `x-` keys never mint a warning, so without this they would be the one thing realm accepts and
|
|
58
|
+
* says nothing about — silent acceptance is Docker Compose's contract and below realm's own
|
|
59
|
+
* disclosure ethos. The keys ARE in the definition (the loader's cast carries every top-level key
|
|
60
|
+
* through untouched), so this reads them straight off it.
|
|
61
|
+
*/
|
|
62
|
+
export declare function extensionKeysOf(definition: WorkflowDefinition): string[];
|
|
63
|
+
/**
|
|
64
|
+
* The ONE mint of the extension-keys disclosure clause (issue #559) — `undefined` when there is
|
|
65
|
+
* nothing to disclose, so a caller composes `?? nothing`. Every consumer (validate's verdict
|
|
66
|
+
* tail, register's own line) renders through this so the noun and the phrase cannot drift
|
|
67
|
+
* between them.
|
|
68
|
+
*
|
|
69
|
+
* The phrase `carried, never read by realm` is minted HERE and nowhere else — the literal-count
|
|
70
|
+
* cell anchors on it rather than the bare words `extension key`, which recur in comments and in
|
|
71
|
+
* the plural form.
|
|
72
|
+
*/
|
|
73
|
+
export declare function renderExtensionKeysClause(keys: readonly string[]): string | undefined;
|
|
57
74
|
//# sourceMappingURL=loader-warnings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader-warnings.d.ts","sourceRoot":"","sources":["../../src/lib/loader-warnings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loader-warnings.d.ts","sourceRoot":"","sources":["../../src/lib/loader-warnings.ts"],"names":[],"mappings":"AA2BA,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAExB;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,GAAG,IAAI,CAI5E;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,aAAa,EAAE,EACzB,MAAM,GAAE,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAkB,GAC7D,OAAO,CAET;AAWD,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,OAAO,CAE9D;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,gBAAgB,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,aAAa,EAAE,CAO5F;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,GAAG,MAAM,CAiBrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,GAAG,MAAM,CAW/E;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAExE;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAIrF"}
|
|
@@ -3,45 +3,38 @@
|
|
|
3
3
|
// printLoaderWarnings, and the dormant #170 boundary-reject is factored into ONE shared helper so
|
|
4
4
|
// they can't drift.
|
|
5
5
|
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
6
|
+
// issue #540: printLoaderWarnings used to rewrite the mint's "— ignored" clause to
|
|
7
|
+
// "— REFUSED below" for any warning the boundary resolves to 'error', on the theory that
|
|
8
|
+
// "ignored" is false once a boundary is about to refuse the workflow over it. That substitution
|
|
9
|
+
// is gone: "— ignored" is a true statement about what the PARSE did (the key was dropped) on
|
|
10
|
+
// EVERY surface, including this one — the refusal is a separate fact, already stated per-key by
|
|
11
|
+
// renderEscalationLine below. The substitution could also name the WRONG cause on any arm that
|
|
12
|
+
// bypasses renderEscalationLine's own gate (see the "hard-error carry"/orphan-manifest/extensions-
|
|
13
|
+
// failure comments in validate.ts and register.ts) and, being a first-occurrence unanchored
|
|
14
|
+
// string replace, could corrupt author-controlled text that happened to contain the clause
|
|
15
|
+
// (issue #525 item 1). See
|
|
16
|
+
// `plans/issue-540/design-d2.md` for the full adjudication between this and issue #170's
|
|
17
|
+
// (superseded) legibility argument for the substitution.
|
|
18
|
+
//
|
|
19
|
+
// One consequence, since `test` was never the exception any more (issue #450): with the
|
|
20
|
+
// substitution gone, printLoaderWarnings is now behaviorally identical to
|
|
21
|
+
// `renderLoaderWarning`'s plain-render loop that `realm workflow test` already used directly.
|
|
22
|
+
// Whether the two call shapes should unify is its own question — filed as #542, not answered here.
|
|
10
23
|
//
|
|
11
24
|
// Precise as of issue #444: no command hand-rolls a ⚠ prefix for a LOADER WARNING. A few
|
|
12
25
|
// adjacent one-off notices — register's sentinel lines, test's sentinel echo — still print their
|
|
13
26
|
// own `⚠ ` directly, because they are plain strings rather than LoaderWarnings; they were
|
|
14
27
|
// normalized to the same single-space grammar so a mixed block cannot recur.
|
|
15
|
-
import { renderLoaderWarning, resolveSeverity, DEFAULT_POLICY, } from '@sensigo/realm';
|
|
28
|
+
import { renderLoaderWarning, resolveSeverity, DEFAULT_POLICY, isExtensionKey, } from '@sensigo/realm';
|
|
16
29
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* the author the opposite of what is about to happen to them.
|
|
22
|
-
*
|
|
23
|
-
* Substituted at the RENDER, not the mint, precisely because the mint is shared with the lenient
|
|
24
|
-
* path — where the original wording is true and worth keeping. The did-you-mean fragment is
|
|
25
|
-
* untouched: it is the most useful half of the line and the reason the author can fix this in one
|
|
26
|
-
* edit.
|
|
27
|
-
*/
|
|
28
|
-
const IGNORED_CLAUSE = '— ignored';
|
|
29
|
-
const REFUSED_CLAUSE = '— REFUSED below';
|
|
30
|
-
/**
|
|
31
|
-
* Prints every warning via the single renderLoaderWarning format source, correcting the
|
|
32
|
-
* "— ignored" claim for any warning this boundary will actually refuse.
|
|
33
|
-
*
|
|
34
|
-
* Resolved against DEFAULT_POLICY, which is the policy the boundary-reject itself uses. A warning
|
|
35
|
-
* that only fails under `--strict` still renders "— ignored" — see the report's design note; the
|
|
36
|
-
* `--strict` path prints its own "failing due to --strict" line, so the author is not left
|
|
37
|
-
* without an explanation.
|
|
30
|
+
* Prints every warning via the single renderLoaderWarning format source — no substitution (see
|
|
31
|
+
* the module header for why the former "— ignored" → "— REFUSED below" rewrite was deleted,
|
|
32
|
+
* issue #540). The `DEFAULT_POLICY` import above stays: `rejectOnErrorSeverity` and
|
|
33
|
+
* `failsStrict`, both exported from this module, still resolve against it.
|
|
38
34
|
*/
|
|
39
35
|
export function printLoaderWarnings(warnings) {
|
|
40
36
|
for (const w of warnings) {
|
|
41
|
-
|
|
42
|
-
console.warn(resolveSeverity(w.code, DEFAULT_POLICY) === 'error'
|
|
43
|
-
? line.replace(IGNORED_CLAUSE, REFUSED_CLAUSE)
|
|
44
|
-
: line);
|
|
37
|
+
console.warn(renderLoaderWarning(w));
|
|
45
38
|
}
|
|
46
39
|
}
|
|
47
40
|
/**
|
|
@@ -72,7 +65,7 @@ export function failsStrict(warnings) {
|
|
|
72
65
|
* and both baked a two-space `⚠ ` into the message. The prefix now belongs to
|
|
73
66
|
* `renderLoaderWarning` alone, so the message here is the input string verbatim.
|
|
74
67
|
*
|
|
75
|
-
* register's caller is `
|
|
68
|
+
* register's caller is `loadWorkflowForAdmission`, which `watch` and `validate` also use — so the strip
|
|
76
69
|
* reaches watch too, and there is no third caller.
|
|
77
70
|
*/
|
|
78
71
|
export function wrapSentinelWarnings(sentinelWarnings) {
|
|
@@ -131,4 +124,31 @@ export function renderEscalationLine(warnings) {
|
|
|
131
124
|
return (`Invalid: ${warnings.length} ${warnings.length === 1 ? 'warning' : 'warnings'}, ` +
|
|
132
125
|
`${escalated.length} escalated to an error by policy: ${list}`);
|
|
133
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* The author-extension keys a definition carries, in authored order (issue #559).
|
|
129
|
+
*
|
|
130
|
+
* `x-` keys never mint a warning, so without this they would be the one thing realm accepts and
|
|
131
|
+
* says nothing about — silent acceptance is Docker Compose's contract and below realm's own
|
|
132
|
+
* disclosure ethos. The keys ARE in the definition (the loader's cast carries every top-level key
|
|
133
|
+
* through untouched), so this reads them straight off it.
|
|
134
|
+
*/
|
|
135
|
+
export function extensionKeysOf(definition) {
|
|
136
|
+
return Object.keys(definition).filter(isExtensionKey);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The ONE mint of the extension-keys disclosure clause (issue #559) — `undefined` when there is
|
|
140
|
+
* nothing to disclose, so a caller composes `?? nothing`. Every consumer (validate's verdict
|
|
141
|
+
* tail, register's own line) renders through this so the noun and the phrase cannot drift
|
|
142
|
+
* between them.
|
|
143
|
+
*
|
|
144
|
+
* The phrase `carried, never read by realm` is minted HERE and nowhere else — the literal-count
|
|
145
|
+
* cell anchors on it rather than the bare words `extension key`, which recur in comments and in
|
|
146
|
+
* the plural form.
|
|
147
|
+
*/
|
|
148
|
+
export function renderExtensionKeysClause(keys) {
|
|
149
|
+
if (keys.length === 0)
|
|
150
|
+
return undefined;
|
|
151
|
+
const noun = keys.length === 1 ? 'extension key' : 'extension keys';
|
|
152
|
+
return `${keys.length} ${noun} carried, never read by realm: ${keys.join(', ')}`;
|
|
153
|
+
}
|
|
134
154
|
//# sourceMappingURL=loader-warnings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader-warnings.js","sourceRoot":"","sources":["../../src/lib/loader-warnings.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,gGAAgG;AAChG,kGAAkG;AAClG,oBAAoB;AACpB,EAAE;AACF,6FAA6F;AAC7F,
|
|
1
|
+
{"version":3,"file":"loader-warnings.js","sourceRoot":"","sources":["../../src/lib/loader-warnings.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,gGAAgG;AAChG,kGAAkG;AAClG,oBAAoB;AACpB,EAAE;AACF,mFAAmF;AACnF,yFAAyF;AACzF,gGAAgG;AA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C,CAAC,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;SACnE,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,CACL,YAAY,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,IAAI;QACjF,GAAG,SAAS,CAAC,MAAM,qCAAqC,IAAI,EAAE,CAC/D,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,UAA8B;IAC5D,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AACxD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAAuB;IAC/D,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,CAAC;IACpE,OAAO,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,kCAAkC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACnF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sensigo/realm-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"vitest": "^4.1.0"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@sensigo/realm": "^0.
|
|
68
|
-
"@sensigo/realm-mcp": "^0.
|
|
69
|
-
"@sensigo/realm-testing": "^0.
|
|
67
|
+
"@sensigo/realm": "^0.43.0",
|
|
68
|
+
"@sensigo/realm-mcp": "^0.43.0",
|
|
69
|
+
"@sensigo/realm-testing": "^0.43.0",
|
|
70
70
|
"@modelcontextprotocol/sdk": "1.30.0",
|
|
71
71
|
"chalk": "^5.0.0",
|
|
72
72
|
"commander": "^15.0.0",
|