@telorun/analyzer 0.68.0 → 0.70.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/analysis-registry.d.ts +12 -0
- package/dist/analysis-registry.d.ts.map +1 -1
- package/dist/analysis-registry.js +26 -0
- package/dist/call-graph.d.ts +80 -1
- package/dist/call-graph.d.ts.map +1 -1
- package/dist/call-graph.js +145 -12
- package/dist/canonical-json.d.ts +18 -0
- package/dist/canonical-json.d.ts.map +1 -0
- package/dist/canonical-json.js +26 -0
- package/dist/cel-access-chains.d.ts +14 -0
- package/dist/cel-access-chains.d.ts.map +1 -0
- package/dist/cel-access-chains.js +45 -0
- package/dist/import-resolution-diagnostics.d.ts.map +1 -1
- package/dist/import-resolution-diagnostics.js +22 -8
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -4
- package/dist/loaded-types.d.ts +4 -4
- package/dist/loaded-types.d.ts.map +1 -1
- package/dist/manifest-analysis.d.ts +19 -0
- package/dist/manifest-analysis.d.ts.map +1 -1
- package/dist/manifest-analysis.js +27 -0
- package/dist/manifest-diff.d.ts +111 -0
- package/dist/manifest-diff.d.ts.map +1 -0
- package/dist/manifest-diff.js +130 -0
- package/dist/manifest-loader.d.ts +3 -4
- package/dist/manifest-loader.d.ts.map +1 -1
- package/dist/manifest-loader.js +4 -5
- package/dist/manifest-schemas.d.ts +2 -0
- package/dist/manifest-schemas.d.ts.map +1 -1
- package/dist/manifest-schemas.js +4 -0
- package/dist/module-graph.d.ts +500 -0
- package/dist/module-graph.d.ts.map +1 -0
- package/dist/module-graph.js +1389 -0
- package/dist/reconcile-module-versions.d.ts.map +1 -1
- package/dist/reconcile-module-versions.js +10 -11
- package/dist/release/release-plan.d.ts +1 -1
- package/dist/resolve-zone-containment.d.ts +9 -1
- package/dist/resolve-zone-containment.d.ts.map +1 -1
- package/dist/resolve-zone-containment.js +34 -6
- package/dist/resolve-zone-requirements.d.ts.map +1 -1
- package/dist/resolve-zone-requirements.js +4 -2
- package/dist/sources/default-sources.d.ts +6 -6
- package/dist/sources/default-sources.d.ts.map +1 -1
- package/dist/sources/default-sources.js +7 -8
- package/dist/sources/integrity.d.ts +3 -2
- package/dist/sources/integrity.d.ts.map +1 -1
- package/dist/sources/integrity.js +26 -3
- package/dist/sources/versioned-ref.d.ts +17 -12
- package/dist/sources/versioned-ref.d.ts.map +1 -1
- package/dist/sources/versioned-ref.js +22 -24
- package/dist/telo-version.d.ts +1 -1
- package/dist/telo-version.js +1 -1
- package/package.json +2 -2
- package/src/analysis-registry.ts +37 -0
- package/src/call-graph.ts +207 -14
- package/src/canonical-json.ts +24 -0
- package/src/cel-access-chains.ts +47 -0
- package/src/import-resolution-diagnostics.ts +24 -7
- package/src/index.ts +46 -5
- package/src/loaded-types.ts +4 -4
- package/src/manifest-analysis.ts +39 -0
- package/src/manifest-diff.ts +219 -0
- package/src/manifest-loader.ts +4 -5
- package/src/manifest-schemas.ts +4 -0
- package/src/module-graph.ts +1983 -0
- package/src/reconcile-module-versions.ts +10 -11
- package/src/release/release-plan.ts +1 -1
- package/src/resolve-zone-containment.ts +49 -9
- package/src/resolve-zone-requirements.ts +7 -2
- package/src/sources/default-sources.ts +7 -8
- package/src/sources/integrity.ts +28 -3
- package/src/sources/versioned-ref.ts +26 -28
- package/src/telo-version.ts +1 -1
- package/dist/sources/module-ref.d.ts +0 -21
- package/dist/sources/module-ref.d.ts.map +0 -1
- package/dist/sources/module-ref.js +0 -36
- package/dist/sources/registry-source.d.ts +0 -14
- package/dist/sources/registry-source.d.ts.map +0 -1
- package/dist/sources/registry-source.js +0 -45
- package/src/sources/module-ref.ts +0 -49
- package/src/sources/registry-source.ts +0 -52
package/dist/index.d.ts
CHANGED
|
@@ -24,8 +24,13 @@ export { defaultBearingPaths, declaredScalarPaths, PERMISSIVE_CONTRACT, resolveC
|
|
|
24
24
|
export type { ContractOrigin, ContractScope, DeclaredScalarForm, DeclaredScalarPath, ResolvedContract, } from "./invocation-contract.js";
|
|
25
25
|
export { hasIntermediateWildcard, parseRedactionPath, RedactionPathError, } from "./redaction-path.js";
|
|
26
26
|
export type { RedactionSegment } from "./redaction-path.js";
|
|
27
|
-
export { buildCallGraph, projectToPairs, resourceId } from "./call-graph.js";
|
|
27
|
+
export { buildCallGraph, nodeIdFor, projectToPairs, resolveScopedName, resourceId, } from "./call-graph.js";
|
|
28
28
|
export type { BuildCallGraphOptions, CallGraph, CallGraphEdge, CallGraphNode, ResourceGraphNode, StepGraphNode, } from "./call-graph.js";
|
|
29
|
+
export { celResourceReads } from "./cel-access-chains.js";
|
|
30
|
+
export { declarationSignature, diffManifests } from "./manifest-diff.js";
|
|
31
|
+
export type { DiffEntry, ManifestDiff, ManifestDiffOptions, ResourceChangeKind, } from "./manifest-diff.js";
|
|
32
|
+
export { AMBIENT_CAPABILITIES, buildModuleGraph, contentKey, edgeClassOf, isAmbientCapability, isAmbientHold, isOrderedRow, isUnwired, } from "./module-graph.js";
|
|
33
|
+
export type { BuildModuleGraphOptions, EdgeClass, GraphEdge, GraphKind, GraphNode, GraphPort, GraphRegion, GraphRow, ModuleGraph, ModuleGraphDeps, NodeOwnership, PortSlot, RowKind, } from "./module-graph.js";
|
|
29
34
|
export { buildReferenceFieldMap, isRefEntry, isScopeEntry, satisfiesValueBranch, } from "./reference-field-map.js";
|
|
30
35
|
export type { ReferenceFieldMap, RefFieldEntry, ValueBranchValidator, } from "./reference-field-map.js";
|
|
31
36
|
export { hasDeclaredUse, isRefSlot, isRefUse, possibleUses, readRefSlot, REF_USES, refSlotAnnotation, rewriteRefSlotKinds, transfersControl, } from "./ref-slot.js";
|
|
@@ -66,7 +71,7 @@ export { validateDynamicSelectors, validateRefSlotDeclarations } from "./validat
|
|
|
66
71
|
export type { RefSlotIssue } from "./validate-ref-slots.js";
|
|
67
72
|
export { validateValueTypeSlots } from "./validate-value-type-slots.js";
|
|
68
73
|
export type { ValueTypeSlotIssue } from "./validate-value-type-slots.js";
|
|
69
|
-
export { checkSchemaCompatibility, resolveRefIn, selectUnionBranch } from "./schema-compat.js";
|
|
74
|
+
export { checkSchemaCompatibility, collectProperties, resolveRefIn, selectUnionBranch, } from "./schema-compat.js";
|
|
70
75
|
export type { CompatibilityResult, ExternalSchemaResolver } from "./schema-compat.js";
|
|
71
76
|
export { ajvErrorToPath, formatAjvErrors, formatSingleError, reduceSchemaErrors, schemaIssues, } from "./schema-error-report.js";
|
|
72
77
|
export type { AjvErrorLike, SchemaIssue } from "./schema-error-report.js";
|
|
@@ -89,11 +94,8 @@ export { residualEntrySchema, residualEntrySchemaMap } from "./residual-schema.j
|
|
|
89
94
|
export { buildDocumentPositions, buildLineOffsets, buildPositionIndex, documentLineOffsets, offsetToPosition, } from "./position-metadata.js";
|
|
90
95
|
export type { DocumentPosition } from "./position-metadata.js";
|
|
91
96
|
export { HttpSource } from "./sources/http-source.js";
|
|
92
|
-
export { RegistrySource } from "./sources/registry-source.js";
|
|
93
97
|
export { defaultSources } from "./sources/default-sources.js";
|
|
94
98
|
export { splitIntegrity, foldIntegrity, isCanonicalIntegrity, verifyIntegrity, verifiedFetch, sha256Base64Url, IntegrityError, } from "./sources/integrity.js";
|
|
95
|
-
export { parseModuleRef, isRegistryRef } from "./sources/module-ref.js";
|
|
96
|
-
export type { ParsedModuleRef } from "./sources/module-ref.js";
|
|
97
99
|
export { OCI_SCHEME, isOciRef, parseOciRef } from "./sources/oci-ref.js";
|
|
98
100
|
export type { ParsedOciRef } from "./sources/oci-ref.js";
|
|
99
101
|
export { parseVersionedRef, withRefVersion } from "./sources/versioned-ref.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,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EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC1D,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3E,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAKxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAGzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1F,YAAY,EACR,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,QAAQ,EACR,aAAa,EACb,KAAK,EACR,MAAM,YAAY,CAAC;AACpB,cAAc,uBAAuB,CAAC;AAGtC,cAAc,sBAAsB,CAAC;AAIrC,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,4BAA4B,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,10 @@ export { ancestorChain, contractDeclarer, controllerBearingAncestor, effectiveAu
|
|
|
12
12
|
export { validateSensitiveSlots } from "./validate-sensitive-slots.js";
|
|
13
13
|
export { defaultBearingPaths, declaredScalarPaths, PERMISSIVE_CONTRACT, resolveContract, resolveContractSchema, sensitivePaths, withLiveValuesSkipped, } from "./invocation-contract.js";
|
|
14
14
|
export { hasIntermediateWildcard, parseRedactionPath, RedactionPathError, } from "./redaction-path.js";
|
|
15
|
-
export { buildCallGraph, projectToPairs, resourceId } from "./call-graph.js";
|
|
15
|
+
export { buildCallGraph, nodeIdFor, projectToPairs, resolveScopedName, resourceId, } from "./call-graph.js";
|
|
16
|
+
export { celResourceReads } from "./cel-access-chains.js";
|
|
17
|
+
export { declarationSignature, diffManifests } from "./manifest-diff.js";
|
|
18
|
+
export { AMBIENT_CAPABILITIES, buildModuleGraph, contentKey, edgeClassOf, isAmbientCapability, isAmbientHold, isOrderedRow, isUnwired, } from "./module-graph.js";
|
|
16
19
|
export { buildReferenceFieldMap, isRefEntry, isScopeEntry, satisfiesValueBranch, } from "./reference-field-map.js";
|
|
17
20
|
export { hasDeclaredUse, isRefSlot, isRefUse, possibleUses, readRefSlot, REF_USES, refSlotAnnotation, rewriteRefSlotKinds, transfersControl, } from "./ref-slot.js";
|
|
18
21
|
export { isStepSlot, readStepSlot, STEP_FRAGMENT } from "./step-slot.js";
|
|
@@ -39,7 +42,7 @@ export { validateZoneViolations } from "./validate-zone-violations.js";
|
|
|
39
42
|
export { containmentIndex, findZoneRegions, regionManifests, } from "./resolve-zone-containment.js";
|
|
40
43
|
export { validateDynamicSelectors, validateRefSlotDeclarations } from "./validate-ref-slots.js";
|
|
41
44
|
export { validateValueTypeSlots } from "./validate-value-type-slots.js";
|
|
42
|
-
export { checkSchemaCompatibility, resolveRefIn, selectUnionBranch } from "./schema-compat.js";
|
|
45
|
+
export { checkSchemaCompatibility, collectProperties, resolveRefIn, selectUnionBranch, } from "./schema-compat.js";
|
|
43
46
|
export { ajvErrorToPath, formatAjvErrors, formatSingleError, reduceSchemaErrors, schemaIssues, } from "./schema-error-report.js";
|
|
44
47
|
export { visitManifest } from "./manifest-visitor.js";
|
|
45
48
|
export { Loader } from "./manifest-loader.js";
|
|
@@ -52,10 +55,8 @@ export { reconcileModuleVersions } from "./reconcile-module-versions.js";
|
|
|
52
55
|
export { residualEntrySchema, residualEntrySchemaMap } from "./residual-schema.js";
|
|
53
56
|
export { buildDocumentPositions, buildLineOffsets, buildPositionIndex, documentLineOffsets, offsetToPosition, } from "./position-metadata.js";
|
|
54
57
|
export { HttpSource } from "./sources/http-source.js";
|
|
55
|
-
export { RegistrySource } from "./sources/registry-source.js";
|
|
56
58
|
export { defaultSources } from "./sources/default-sources.js";
|
|
57
59
|
export { splitIntegrity, foldIntegrity, isCanonicalIntegrity, verifyIntegrity, verifiedFetch, sha256Base64Url, IntegrityError, } from "./sources/integrity.js";
|
|
58
|
-
export { parseModuleRef, isRegistryRef } from "./sources/module-ref.js";
|
|
59
60
|
export { OCI_SCHEME, isOciRef, parseOciRef } from "./sources/oci-ref.js";
|
|
60
61
|
export { parseVersionedRef, withRefVersion } from "./sources/versioned-ref.js";
|
|
61
62
|
export { isLocalPathSource } from "./sources/local-path-ref.js";
|
package/dist/loaded-types.d.ts
CHANGED
|
@@ -11,9 +11,9 @@ import type { AstDocument } from "./yaml-ast.js";
|
|
|
11
11
|
* cache uses `source` — the URL the source adapter's `read()` returned. */
|
|
12
12
|
export interface LoadedFile {
|
|
13
13
|
/** Canonical identity. The URL the source adapter's `read()` returned —
|
|
14
|
-
* HTTPS for
|
|
14
|
+
* HTTPS for a remote module, an absolute path for local. */
|
|
15
15
|
source: string;
|
|
16
|
-
/** The URL the caller supplied (e.g.
|
|
16
|
+
/** The URL the caller supplied (e.g. `oci://ghcr.io/telorun/javascript@0.3.0`).
|
|
17
17
|
* Differs from `source` only for adapter-resolved URLs. */
|
|
18
18
|
requestedUrl: string;
|
|
19
19
|
/** Raw text exactly as `read()` returned it. */
|
|
@@ -61,8 +61,8 @@ export interface LoadedModule {
|
|
|
61
61
|
export interface ImportEdge {
|
|
62
62
|
/** Canonical resolved URL of the target — a key into `modules`. */
|
|
63
63
|
targetSource: string;
|
|
64
|
-
/** The import's `source` exactly as authored —
|
|
65
|
-
*
|
|
64
|
+
/** The import's `source` exactly as authored — an `oci://` or `https://`
|
|
65
|
+
* ref, or a relative path. Version reconciliation keys on
|
|
66
66
|
* this (minus its version), since it names the module's location
|
|
67
67
|
* independently of what the module declares about itself. */
|
|
68
68
|
targetRef: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loaded-types.d.ts","sourceRoot":"","sources":["../src/loaded-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;4EAI4E;AAC5E,MAAM,WAAW,UAAU;IACzB
|
|
1
|
+
{"version":3,"file":"loaded-types.d.ts","sourceRoot":"","sources":["../src/loaded-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;4EAI4E;AAC5E,MAAM,WAAW,UAAU;IACzB;iEAC6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AE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;IAClD;;;iFAG6E;IAC7E,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B;;;;sDAIkD;IAClD,oBAAoB,EAAE,kBAAkB,EAAE,CAAC;IAC3C;;;iDAG6C;IAC7C,kBAAkB,EAAE,kBAAkB,EAAE,CAAC;IACzC;;;8EAG0E;IAC1E,gBAAgB,EAAE,kBAAkB,EAAE,CAAC;IACvC;yCACqC;IACrC,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B;8BAC0B;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ;;qEAEiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;gFAE4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;qEAKiE;IACjE,MAAM,CAAC,EAAE,YAAY,GAAG,iBAAiB,CAAC;IAC1C,KAAK,EAAE,KAAK,CAAC;CACd"}
|
|
@@ -26,6 +26,7 @@ import { AliasResolver } from "./alias-resolver.js";
|
|
|
26
26
|
import { CelScopeQuery, type CelScopeQueryContext } from "./cel-scope-query.js";
|
|
27
27
|
import { DefinitionRegistry } from "./definition-registry.js";
|
|
28
28
|
import type { ContractDirection } from "./extends-resolution.js";
|
|
29
|
+
import { type BuildModuleGraphOptions, type ModuleGraph, type ModuleGraphDeps } from "./module-graph.js";
|
|
29
30
|
/**
|
|
30
31
|
* A reference as the loader leaves it — the internal `{kind, name, alias?}`
|
|
31
32
|
* shape `resolveRefSentinels` rewrites `!ref` into.
|
|
@@ -40,11 +41,29 @@ export declare class ManifestAnalysis {
|
|
|
40
41
|
private readonly ctx;
|
|
41
42
|
private readonly scopes;
|
|
42
43
|
private celScopeQuery;
|
|
44
|
+
private callGraphMemo;
|
|
45
|
+
private moduleGraphMemo;
|
|
43
46
|
constructor(manifests: ResourceManifest[], ctx: CelScopeQueryContext);
|
|
44
47
|
/** What CEL sees, per site. Built on first use — its indices are a function of
|
|
45
48
|
* the whole set, and a host that never opens a CEL body should not pay for
|
|
46
49
|
* them. */
|
|
47
50
|
get celScope(): CelScopeQuery;
|
|
51
|
+
/** What calls what. Built on first use and kept, so the projection and any
|
|
52
|
+
* other consumer over this set share one. */
|
|
53
|
+
private get callGraph();
|
|
54
|
+
/**
|
|
55
|
+
* The module graph: boxes, ordered rows and classed edges — the projection an
|
|
56
|
+
* editor draws.
|
|
57
|
+
*
|
|
58
|
+
* Here rather than on the registry because it is the registry AND a manifest
|
|
59
|
+
* set, which is the pairing this class exists to name; a fifth
|
|
60
|
+
* `registry.x(manifests, …)` factory is the accretion naming it stopped. It
|
|
61
|
+
* shares this analysis's call graph rather than building one of its own.
|
|
62
|
+
*
|
|
63
|
+
* `deps` is supplied by the registry, which owns capability resolution — this
|
|
64
|
+
* class holds the manifests, not the rules for reading a kind.
|
|
65
|
+
*/
|
|
66
|
+
moduleGraph(deps: ModuleGraphDeps, options?: BuildModuleGraphOptions): ModuleGraph;
|
|
48
67
|
/** The manifest a `(kind, name)` pair addresses. */
|
|
49
68
|
resourceFor(kind: string | undefined, name: string | undefined): ResourceManifest | undefined;
|
|
50
69
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-analysis.d.ts","sourceRoot":"","sources":["../src/manifest-analysis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAsB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAE,aAAa,EAAqB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE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BAA4B,GAAG,WAAW;IAStF,oDAAoD;IACpD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,gBAAgB,GAAG,SAAS;IAI7F;;;;;;;;OAQG;IACH,WAAW,CAAC,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS;IAiB5F;;;;;;;;OAQG;IACH,OAAO,CAAC,UAAU;IAqBlB,OAAO,CAAC,aAAa;CAItB;AAED,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { CelScopeQuery } from "./cel-scope-query.js";
|
|
2
2
|
import { analyzerContractScope, resolveContract } from "./invocation-contract.js";
|
|
3
|
+
import { buildCallGraph } from "./call-graph.js";
|
|
3
4
|
import { findManifest } from "./find-manifest.js";
|
|
5
|
+
import { buildModuleGraph, } from "./module-graph.js";
|
|
4
6
|
import { isModuleKind } from "./module-kinds.js";
|
|
5
7
|
export class ManifestAnalysis {
|
|
6
8
|
manifests;
|
|
7
9
|
ctx;
|
|
8
10
|
scopes;
|
|
9
11
|
celScopeQuery;
|
|
12
|
+
callGraphMemo;
|
|
13
|
+
moduleGraphMemo;
|
|
10
14
|
constructor(manifests, ctx) {
|
|
11
15
|
this.manifests = manifests;
|
|
12
16
|
this.ctx = ctx;
|
|
@@ -23,6 +27,29 @@ export class ManifestAnalysis {
|
|
|
23
27
|
get celScope() {
|
|
24
28
|
return (this.celScopeQuery ??= new CelScopeQuery(this.manifests, this.ctx));
|
|
25
29
|
}
|
|
30
|
+
/** What calls what. Built on first use and kept, so the projection and any
|
|
31
|
+
* other consumer over this set share one. */
|
|
32
|
+
get callGraph() {
|
|
33
|
+
return (this.callGraphMemo ??= buildCallGraph(this.manifests, this.ctx.defs, {
|
|
34
|
+
aliases: this.ctx.aliases,
|
|
35
|
+
aliasesByModule: this.ctx.aliasesByModule,
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The module graph: boxes, ordered rows and classed edges — the projection an
|
|
40
|
+
* editor draws.
|
|
41
|
+
*
|
|
42
|
+
* Here rather than on the registry because it is the registry AND a manifest
|
|
43
|
+
* set, which is the pairing this class exists to name; a fifth
|
|
44
|
+
* `registry.x(manifests, …)` factory is the accretion naming it stopped. It
|
|
45
|
+
* shares this analysis's call graph rather than building one of its own.
|
|
46
|
+
*
|
|
47
|
+
* `deps` is supplied by the registry, which owns capability resolution — this
|
|
48
|
+
* class holds the manifests, not the rules for reading a kind.
|
|
49
|
+
*/
|
|
50
|
+
moduleGraph(deps, options = {}) {
|
|
51
|
+
return (this.moduleGraphMemo ??= buildModuleGraph(this.manifests, this.callGraph, deps, options));
|
|
52
|
+
}
|
|
26
53
|
/** The manifest a `(kind, name)` pair addresses. */
|
|
27
54
|
resourceFor(kind, name) {
|
|
28
55
|
return findManifest(this.manifests, kind, name);
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What changed between two loads of one manifest set.
|
|
3
|
+
*
|
|
4
|
+
* The question a reconciling host asks before it touches anything: which
|
|
5
|
+
* resources survive an edit untouched, which have to be rebuilt, which are new,
|
|
6
|
+
* and which are gone. It is here rather than in the kernel because it is pure
|
|
7
|
+
* data in and data out and the editor wants the same answer — to show which
|
|
8
|
+
* resources a save would restart, in a browser, where no kernel runs.
|
|
9
|
+
*
|
|
10
|
+
* **This is the DECLARATION half of the question and only that half.** A field
|
|
11
|
+
* written `!cel "variables.port"` has the same declaration whatever the
|
|
12
|
+
* environment says, so a host that resolves configuration outside the manifest
|
|
13
|
+
* has to supply what moved there (`modulesWithChangedConfig`). Keeping the two
|
|
14
|
+
* apart is what lets this run in a browser at all.
|
|
15
|
+
*/
|
|
16
|
+
import type { ResourceManifest } from "@telorun/sdk";
|
|
17
|
+
/** How one resource differs between the two sets. `unchanged` is reported as a
|
|
18
|
+
* bare id rather than an entry, since there is nothing to say about it. */
|
|
19
|
+
export type ResourceChangeKind = "added" | "removed" | "changed";
|
|
20
|
+
export interface DiffEntry {
|
|
21
|
+
/** {@link nodeIdFor} — module-scoped, so two libraries each declaring a
|
|
22
|
+
* resource named `store` are two entries rather than one. */
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly change: ResourceChangeKind;
|
|
25
|
+
/** The declaration as it stood. Absent for an addition. */
|
|
26
|
+
readonly previous?: ResourceManifest;
|
|
27
|
+
/** The declaration as it now stands. Absent for a removal. */
|
|
28
|
+
readonly next?: ResourceManifest;
|
|
29
|
+
}
|
|
30
|
+
export interface ManifestDiff {
|
|
31
|
+
/** Additions, removals and changes. Order follows the next set, then the
|
|
32
|
+
* previous set for removals, so a caller rendering this reads it in
|
|
33
|
+
* declaration order rather than in hash order. */
|
|
34
|
+
readonly entries: readonly DiffEntry[];
|
|
35
|
+
/** Ids present in both sets with an identical declaration. */
|
|
36
|
+
readonly unchanged: readonly string[];
|
|
37
|
+
/** Ids whose current instance is no longer valid: every removal and every
|
|
38
|
+
* change. What a reconciling host unwinds, once it has closed this set under
|
|
39
|
+
* the resources that HOLD them — which is the call graph's answer, not this
|
|
40
|
+
* one's. */
|
|
41
|
+
readonly stale: readonly string[];
|
|
42
|
+
/** Declarations that have to be created: every addition and every change.
|
|
43
|
+
* Named for the kernel's own `pendingResources`, which is where they go. */
|
|
44
|
+
readonly pending: readonly ResourceManifest[];
|
|
45
|
+
}
|
|
46
|
+
export interface ManifestDiffOptions {
|
|
47
|
+
/**
|
|
48
|
+
* Modules whose resolved configuration moved between the two loads, by
|
|
49
|
+
* `metadata.module`.
|
|
50
|
+
*
|
|
51
|
+
* Every resource of such a module is reported `changed` even where its
|
|
52
|
+
* declaration is identical, because a declaration is not the whole of what a
|
|
53
|
+
* resource is built from: `!cel "variables.port"` reads the same and means
|
|
54
|
+
* something else once the environment behind it moves. Only the host that
|
|
55
|
+
* resolved that environment can know, so it is an input rather than something
|
|
56
|
+
* derived here.
|
|
57
|
+
*/
|
|
58
|
+
readonly modulesWithChangedConfig?: ReadonlySet<string>;
|
|
59
|
+
/**
|
|
60
|
+
* Signatures of the previous set, by node id, taken while those manifests
|
|
61
|
+
* were still declarations.
|
|
62
|
+
*
|
|
63
|
+
* A host that INSTALLS manifests does not keep declarations: the kernel
|
|
64
|
+
* registers the very objects it loaded, and resolving references writes live
|
|
65
|
+
* instances into them — a boot target's `!ref`, or a slot nested past the
|
|
66
|
+
* create-time shallow copy. Signing such an object afterwards renders those
|
|
67
|
+
* slots opaque and reports a change that never happened, which on a module
|
|
68
|
+
* document means escalating every reconciliation there is.
|
|
69
|
+
*
|
|
70
|
+
* An id absent from the map is signed from its manifest, so a caller that
|
|
71
|
+
* really is holding declarations passes nothing.
|
|
72
|
+
*/
|
|
73
|
+
readonly previousSignatures?: ReadonlyMap<string, string>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A resource's declaration, rendered so that two equal declarations render
|
|
77
|
+
* identically.
|
|
78
|
+
*
|
|
79
|
+
* Three things are normalized away, and each would otherwise report a change
|
|
80
|
+
* that is not one:
|
|
81
|
+
*
|
|
82
|
+
* - **Loader stamps** (`DERIVED_METADATA_FIELDS`). `metadata.sourceLine` is the
|
|
83
|
+
* load-bearing one: inserting a line anywhere in a file shifts it for every
|
|
84
|
+
* resource below, so leaving it in would mark a whole file changed on any
|
|
85
|
+
* edit and defeat the mechanism entirely.
|
|
86
|
+
* - **A compiled expression** renders as its source text. What the author wrote
|
|
87
|
+
* is the declaration; what it evaluates to depends on configuration, which
|
|
88
|
+
* `modulesWithChangedConfig` carries instead.
|
|
89
|
+
* - **Anything that is not plain data** renders as a constant. A host that has
|
|
90
|
+
* injected live instances over its reference slots has manifests that are no
|
|
91
|
+
* longer declarations, and walking one reaches a controller's object graph,
|
|
92
|
+
* which is cyclic. Both sides must be declarations as loaded.
|
|
93
|
+
*
|
|
94
|
+
* The result is compared as a string rather than hashed: there is no collision
|
|
95
|
+
* to reason about, and a missed change here is a resource that silently keeps
|
|
96
|
+
* running against a declaration it no longer matches.
|
|
97
|
+
*/
|
|
98
|
+
export declare function declarationSignature(manifest: ResourceManifest): string;
|
|
99
|
+
/**
|
|
100
|
+
* Classify every resource of two loads against each other.
|
|
101
|
+
*
|
|
102
|
+
* **Identity is `nodeIdFor`**, which is module-scoped, so a name is compared
|
|
103
|
+
* only against the same name in the same module. One consequence is worth
|
|
104
|
+
* stating because it is visible: an INLINE resource's name is synthesized from
|
|
105
|
+
* its position (`api_routes_0_handler`), so inserting a route above one renames
|
|
106
|
+
* every inline below it and this reports those as a removal plus an addition.
|
|
107
|
+
* That costs a restart it did not have to cost; it never misses a change, which
|
|
108
|
+
* is the direction that matters.
|
|
109
|
+
*/
|
|
110
|
+
export declare function diffManifests(previous: readonly ResourceManifest[], next: readonly ResourceManifest[], options?: ManifestDiffOptions): ManifestDiff;
|
|
111
|
+
//# sourceMappingURL=manifest-diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-diff.d.ts","sourceRoot":"","sources":["../src/manifest-diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAMrD;4EAC4E;AAC5E,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAEjE,MAAM,WAAW,SAAS;IACxB;kEAC8D;IAC9D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IACrC,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;CAClC;AAED,MAAM,WAAW,YAAY;IAC3B;;uDAEmD;IACnD,QAAQ,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;IACvC,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC;;;iBAGa;IACb,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC;iFAC6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAExD;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3D;AAcD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAqCvE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EACrC,IAAI,EAAE,SAAS,gBAAgB,EAAE,EACjC,OAAO,GAAE,mBAAwB,GAChC,YAAY,CA6Cd"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { isCompiledValue } from "@telorun/sdk";
|
|
2
|
+
import { nodeIdFor } from "./call-graph.js";
|
|
3
|
+
import { canonicalJson } from "./canonical-json.js";
|
|
4
|
+
import { DERIVED_METADATA_FIELDS } from "./module-metadata-scope.js";
|
|
5
|
+
/** A value that is not part of the declaration and must not be walked into:
|
|
6
|
+
* a live instance a host injected over a reference slot, a function, a class
|
|
7
|
+
* instance of any kind. Rendering one as a constant keeps the walk finite and
|
|
8
|
+
* acyclic; comparing two sets across the injection boundary is not supported
|
|
9
|
+
* and is what {@link declarationSignature} documents against. */
|
|
10
|
+
const OPAQUE = '"\\u0000opaque"';
|
|
11
|
+
const isPlainObject = (value) => {
|
|
12
|
+
const proto = Object.getPrototypeOf(value);
|
|
13
|
+
return proto === Object.prototype || proto === null;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A resource's declaration, rendered so that two equal declarations render
|
|
17
|
+
* identically.
|
|
18
|
+
*
|
|
19
|
+
* Three things are normalized away, and each would otherwise report a change
|
|
20
|
+
* that is not one:
|
|
21
|
+
*
|
|
22
|
+
* - **Loader stamps** (`DERIVED_METADATA_FIELDS`). `metadata.sourceLine` is the
|
|
23
|
+
* load-bearing one: inserting a line anywhere in a file shifts it for every
|
|
24
|
+
* resource below, so leaving it in would mark a whole file changed on any
|
|
25
|
+
* edit and defeat the mechanism entirely.
|
|
26
|
+
* - **A compiled expression** renders as its source text. What the author wrote
|
|
27
|
+
* is the declaration; what it evaluates to depends on configuration, which
|
|
28
|
+
* `modulesWithChangedConfig` carries instead.
|
|
29
|
+
* - **Anything that is not plain data** renders as a constant. A host that has
|
|
30
|
+
* injected live instances over its reference slots has manifests that are no
|
|
31
|
+
* longer declarations, and walking one reaches a controller's object graph,
|
|
32
|
+
* which is cyclic. Both sides must be declarations as loaded.
|
|
33
|
+
*
|
|
34
|
+
* The result is compared as a string rather than hashed: there is no collision
|
|
35
|
+
* to reason about, and a missed change here is a resource that silently keeps
|
|
36
|
+
* running against a declaration it no longer matches.
|
|
37
|
+
*/
|
|
38
|
+
export function declarationSignature(manifest) {
|
|
39
|
+
const seen = new WeakSet();
|
|
40
|
+
const render = (value) => {
|
|
41
|
+
if (isCompiledValue(value)) {
|
|
42
|
+
const source = value.source;
|
|
43
|
+
return { "\u0000cel": typeof source === "string" ? source : null };
|
|
44
|
+
}
|
|
45
|
+
if (!value || typeof value !== "object")
|
|
46
|
+
return value;
|
|
47
|
+
if (seen.has(value))
|
|
48
|
+
return "\u0000cycle";
|
|
49
|
+
if (Array.isArray(value)) {
|
|
50
|
+
seen.add(value);
|
|
51
|
+
return value.map(render);
|
|
52
|
+
}
|
|
53
|
+
if (!isPlainObject(value))
|
|
54
|
+
return OPAQUE;
|
|
55
|
+
seen.add(value);
|
|
56
|
+
const out = {};
|
|
57
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
58
|
+
out[key] = render(entry);
|
|
59
|
+
}
|
|
60
|
+
return out;
|
|
61
|
+
};
|
|
62
|
+
const authoredMetadata = {};
|
|
63
|
+
const metadata = manifest.metadata;
|
|
64
|
+
for (const [key, value] of Object.entries(metadata ?? {})) {
|
|
65
|
+
if (DERIVED_METADATA_FIELDS.has(key))
|
|
66
|
+
continue;
|
|
67
|
+
authoredMetadata[key] = render(value);
|
|
68
|
+
}
|
|
69
|
+
const body = {};
|
|
70
|
+
for (const [key, value] of Object.entries(manifest)) {
|
|
71
|
+
if (key === "metadata")
|
|
72
|
+
continue;
|
|
73
|
+
body[key] = render(value);
|
|
74
|
+
}
|
|
75
|
+
return canonicalJson({ ...body, metadata: authoredMetadata });
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Classify every resource of two loads against each other.
|
|
79
|
+
*
|
|
80
|
+
* **Identity is `nodeIdFor`**, which is module-scoped, so a name is compared
|
|
81
|
+
* only against the same name in the same module. One consequence is worth
|
|
82
|
+
* stating because it is visible: an INLINE resource's name is synthesized from
|
|
83
|
+
* its position (`api_routes_0_handler`), so inserting a route above one renames
|
|
84
|
+
* every inline below it and this reports those as a removal plus an addition.
|
|
85
|
+
* That costs a restart it did not have to cost; it never misses a change, which
|
|
86
|
+
* is the direction that matters.
|
|
87
|
+
*/
|
|
88
|
+
export function diffManifests(previous, next, options = {}) {
|
|
89
|
+
const before = new Map();
|
|
90
|
+
for (const manifest of previous)
|
|
91
|
+
before.set(nodeIdFor(manifest), manifest);
|
|
92
|
+
const changedConfig = options.modulesWithChangedConfig;
|
|
93
|
+
const configMoved = (manifest) => {
|
|
94
|
+
if (!changedConfig || changedConfig.size === 0)
|
|
95
|
+
return false;
|
|
96
|
+
const module = manifest.metadata?.module;
|
|
97
|
+
return module !== undefined && changedConfig.has(module);
|
|
98
|
+
};
|
|
99
|
+
const entries = [];
|
|
100
|
+
const unchanged = [];
|
|
101
|
+
const stale = [];
|
|
102
|
+
const pending = [];
|
|
103
|
+
const survived = new Set();
|
|
104
|
+
for (const manifest of next) {
|
|
105
|
+
const id = nodeIdFor(manifest);
|
|
106
|
+
const prior = before.get(id);
|
|
107
|
+
if (!prior) {
|
|
108
|
+
entries.push({ id, change: "added", next: manifest });
|
|
109
|
+
pending.push(manifest);
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
survived.add(id);
|
|
113
|
+
const priorSignature = options.previousSignatures?.get(id) ?? declarationSignature(prior);
|
|
114
|
+
const same = !configMoved(manifest) && priorSignature === declarationSignature(manifest);
|
|
115
|
+
if (same) {
|
|
116
|
+
unchanged.push(id);
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
entries.push({ id, change: "changed", previous: prior, next: manifest });
|
|
120
|
+
stale.push(id);
|
|
121
|
+
pending.push(manifest);
|
|
122
|
+
}
|
|
123
|
+
for (const [id, manifest] of before) {
|
|
124
|
+
if (survived.has(id))
|
|
125
|
+
continue;
|
|
126
|
+
entries.push({ id, change: "removed", previous: manifest });
|
|
127
|
+
stale.push(id);
|
|
128
|
+
}
|
|
129
|
+
return { entries, unchanged, stale, pending };
|
|
130
|
+
}
|
|
@@ -10,7 +10,7 @@ export declare class Loader {
|
|
|
10
10
|
* when a URL it has already canonicalised is requested again — kernel
|
|
11
11
|
* load → boot and the import-controller each ask the loader for the same
|
|
12
12
|
* modules. Without this fast path every duplicate request re-runs the
|
|
13
|
-
* source's `read()` (a `fetch` for `
|
|
13
|
+
* source's `read()` (a `fetch` for `HttpSource`, a disk read for
|
|
14
14
|
* `LocalFileSource`). */
|
|
15
15
|
private readonly urlToSource;
|
|
16
16
|
protected sources: ManifestSource[];
|
|
@@ -19,8 +19,7 @@ export declare class Loader {
|
|
|
19
19
|
/** Sources are resolved in order — the first whose `supports(url)` matches
|
|
20
20
|
* wins. The caller (composition root) decides which concrete sources exist
|
|
21
21
|
* and supplies them; `defaultSources()` bundles the browser-safe built-ins
|
|
22
|
-
* (HTTP
|
|
23
|
-
* runtime. */
|
|
22
|
+
* (HTTP) for the common case. `register()` prepends a source at runtime. */
|
|
24
23
|
constructor(sources?: ManifestSource[], options?: LoaderInitOptions);
|
|
25
24
|
register(source: ManifestSource): this;
|
|
26
25
|
private pick;
|
|
@@ -73,7 +72,7 @@ export declare class Loader {
|
|
|
73
72
|
loadGraph(entryUrl: string, options?: LoadOptions): Promise<LoadedGraph>;
|
|
74
73
|
/** Resolve an `import` URL against the file it appears in. Relative /
|
|
75
74
|
* absolute-path forms run through the owning `ManifestSource`'s
|
|
76
|
-
* `resolveRelative`;
|
|
75
|
+
* `resolveRelative`; scheme-qualified refs and full URLs pass through
|
|
77
76
|
* unchanged. Exposed so the import-controller (and any other
|
|
78
77
|
* caller-side resolver) lands on the *exact same* canonical URL the
|
|
79
78
|
* loader used when walking the entry graph — divergent resolution
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-loader.d.ts","sourceRoot":"","sources":["../src/manifest-loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,UAAU,EACV,WAAW,EACX,YAAY,EACb,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AAmHpB,qBAAa,MAAM;IACjB;;;yEAGqE;IACrE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAiC;IAE3D;;;;;8BAK0B;IAC1B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA6B;IAEzD,SAAS,CAAC,OAAO,EAAE,cAAc,EAAE,CAAC;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAA4B;IAExD
|
|
1
|
+
{"version":3,"file":"manifest-loader.d.ts","sourceRoot":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AAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IA4I9E;;;;;;;;sBAQkB;IAClB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM;IAOlE,OAAO,CAAC,6BAA6B;IAarC,OAAO,CAAC,mCAAmC;YAc7B,eAAe;IAmB7B;;;0CAGsC;IAChC,gBAAgB,CACpB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC;QAAE,KAAK,EAAE,WAAW,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CA0B5D"}
|
package/dist/manifest-loader.js
CHANGED
|
@@ -97,7 +97,7 @@ export class Loader {
|
|
|
97
97
|
* when a URL it has already canonicalised is requested again — kernel
|
|
98
98
|
* load → boot and the import-controller each ask the loader for the same
|
|
99
99
|
* modules. Without this fast path every duplicate request re-runs the
|
|
100
|
-
* source's `read()` (a `fetch` for `
|
|
100
|
+
* source's `read()` (a `fetch` for `HttpSource`, a disk read for
|
|
101
101
|
* `LocalFileSource`). */
|
|
102
102
|
urlToSource = new Map();
|
|
103
103
|
sources;
|
|
@@ -106,8 +106,7 @@ export class Loader {
|
|
|
106
106
|
/** Sources are resolved in order — the first whose `supports(url)` matches
|
|
107
107
|
* wins. The caller (composition root) decides which concrete sources exist
|
|
108
108
|
* and supplies them; `defaultSources()` bundles the browser-safe built-ins
|
|
109
|
-
* (HTTP
|
|
110
|
-
* runtime. */
|
|
109
|
+
* (HTTP) for the common case. `register()` prepends a source at runtime. */
|
|
111
110
|
constructor(sources = [], options = {}) {
|
|
112
111
|
this.sources = [...sources];
|
|
113
112
|
this.celEnv = buildCelEnvironment(options.celHandlers);
|
|
@@ -128,7 +127,7 @@ export class Loader {
|
|
|
128
127
|
// entry are populated in `urlToSource` + `fileCache` in one read.
|
|
129
128
|
// Callers (kernel.load) immediately call `loadGraph(entryUrl)`
|
|
130
129
|
// afterwards — without this priming, the entry file would be read
|
|
131
|
-
// twice (twice over the network for `
|
|
130
|
+
// twice (twice over the network for `HttpSource`).
|
|
132
131
|
const file = await this.loadFile(url);
|
|
133
132
|
return file.source;
|
|
134
133
|
}
|
|
@@ -396,7 +395,7 @@ export class Loader {
|
|
|
396
395
|
}
|
|
397
396
|
/** Resolve an `import` URL against the file it appears in. Relative /
|
|
398
397
|
* absolute-path forms run through the owning `ManifestSource`'s
|
|
399
|
-
* `resolveRelative`;
|
|
398
|
+
* `resolveRelative`; scheme-qualified refs and full URLs pass through
|
|
400
399
|
* unchanged. Exposed so the import-controller (and any other
|
|
401
400
|
* caller-side resolver) lands on the *exact same* canonical URL the
|
|
402
401
|
* loader used when walking the entry graph — divergent resolution
|
|
@@ -228,6 +228,7 @@ export declare const InvokeStepSchema: {
|
|
|
228
228
|
when: {
|
|
229
229
|
title: string;
|
|
230
230
|
description: string;
|
|
231
|
+
"x-telo-topology-role": string;
|
|
231
232
|
type: string;
|
|
232
233
|
};
|
|
233
234
|
retry: {
|
|
@@ -781,6 +782,7 @@ export declare const ManifestRootSchema: {
|
|
|
781
782
|
when: {
|
|
782
783
|
title: string;
|
|
783
784
|
description: string;
|
|
785
|
+
"x-telo-topology-role": string;
|
|
784
786
|
type: string;
|
|
785
787
|
};
|
|
786
788
|
retry: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-schemas.d.ts","sourceRoot":"","sources":["../src/manifest-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAKH,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AAErD,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yEA8ByE;AACzE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;GAkBG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,cAAoB,GAAG,IAAI,CAGrF;AAiID;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAGnF;AA8DD;iEACiE;AACjE,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAEjD;uDACuD;AACvD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAItE"}
|
package/dist/manifest-schemas.js
CHANGED
|
@@ -230,6 +230,10 @@ export const InvokeStepSchema = {
|
|
|
230
230
|
when: {
|
|
231
231
|
title: "When",
|
|
232
232
|
description: "CEL guard — the dispatch is skipped when it evaluates false.",
|
|
233
|
+
// The same role `if:` and `while:` carry: it is the expression that
|
|
234
|
+
// decides whether the statement runs, and a surface showing what a step
|
|
235
|
+
// is conditional on should not have to know which keyword spelled it.
|
|
236
|
+
"x-telo-topology-role": "predicate",
|
|
233
237
|
type: "string",
|
|
234
238
|
},
|
|
235
239
|
retry: {
|