@telorun/analyzer 0.62.1 → 0.64.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 +24 -0
- package/dist/analysis-registry.d.ts.map +1 -1
- package/dist/analysis-registry.js +41 -0
- package/dist/analyzer.d.ts +3 -37
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +396 -476
- package/dist/call-graph.d.ts.map +1 -1
- package/dist/call-graph.js +2 -7
- package/dist/cel-scope-query.d.ts +109 -0
- package/dist/cel-scope-query.d.ts.map +1 -0
- package/dist/cel-scope-query.js +270 -0
- package/dist/cel-scope.d.ts +166 -0
- package/dist/cel-scope.d.ts.map +1 -0
- package/dist/cel-scope.js +377 -0
- package/dist/definition-registry.d.ts +15 -0
- package/dist/definition-registry.d.ts.map +1 -1
- package/dist/definition-registry.js +25 -9
- package/dist/find-manifest.d.ts +10 -0
- package/dist/find-manifest.d.ts.map +1 -0
- package/dist/find-manifest.js +12 -0
- package/dist/flatten-for-analyzer.js +1 -1
- package/dist/import-resolution-diagnostics.d.ts +9 -2
- package/dist/import-resolution-diagnostics.d.ts.map +1 -1
- package/dist/import-resolution-diagnostics.js +26 -7
- package/dist/index.d.ts +22 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -1
- package/dist/invocation-contract.d.ts +17 -1
- package/dist/invocation-contract.d.ts.map +1 -1
- package/dist/invocation-contract.js +42 -4
- package/dist/loaded-types.d.ts +12 -3
- package/dist/loaded-types.d.ts.map +1 -1
- package/dist/manifest-analysis.d.ts +73 -0
- package/dist/manifest-analysis.d.ts.map +1 -0
- package/dist/manifest-analysis.js +78 -0
- package/dist/manifest-loader.d.ts +0 -1
- package/dist/manifest-loader.d.ts.map +1 -1
- package/dist/manifest-loader.js +62 -41
- package/dist/manifest-path.d.ts +18 -0
- package/dist/manifest-path.d.ts.map +1 -0
- package/dist/manifest-path.js +37 -0
- package/dist/manifest-schemas.d.ts +699 -0
- package/dist/manifest-schemas.d.ts.map +1 -1
- package/dist/manifest-schemas.js +306 -14
- package/dist/module-compatibility.d.ts +40 -0
- package/dist/module-compatibility.d.ts.map +1 -0
- package/dist/module-compatibility.js +52 -0
- package/dist/ref-slot-reading.d.ts +30 -0
- package/dist/ref-slot-reading.d.ts.map +1 -0
- package/dist/ref-slot-reading.js +139 -0
- package/dist/referrer-rule.d.ts +67 -0
- package/dist/referrer-rule.d.ts.map +1 -0
- package/dist/referrer-rule.js +96 -0
- package/dist/release/index.d.ts +1 -1
- package/dist/release/index.d.ts.map +1 -1
- package/dist/release/index.js +1 -1
- package/dist/release/version-stamp.d.ts +16 -0
- package/dist/release/version-stamp.d.ts.map +1 -1
- package/dist/release/version-stamp.js +52 -0
- package/dist/release/workspace-config.d.ts +10 -6
- package/dist/release/workspace-config.d.ts.map +1 -1
- package/dist/release/workspace-config.js +10 -6
- package/dist/resolve-schema-ref-kinds.d.ts +4 -3
- package/dist/resolve-schema-ref-kinds.d.ts.map +1 -1
- package/dist/resolve-schema-ref-kinds.js +16 -0
- package/dist/resolve-throws-union.d.ts.map +1 -1
- package/dist/resolve-throws-union.js +4 -3
- package/dist/resolve-zone-containment.d.ts +99 -0
- package/dist/resolve-zone-containment.d.ts.map +1 -0
- package/dist/resolve-zone-containment.js +212 -0
- package/dist/resolve-zone-requirements.d.ts +5 -0
- package/dist/resolve-zone-requirements.d.ts.map +1 -1
- package/dist/resolve-zone-requirements.js +48 -7
- package/dist/resource-rule.d.ts +106 -0
- package/dist/resource-rule.d.ts.map +1 -0
- package/dist/resource-rule.js +236 -0
- package/dist/rule-condition.d.ts +50 -0
- package/dist/rule-condition.d.ts.map +1 -0
- package/dist/rule-condition.js +108 -0
- package/dist/schema-keywords.d.ts.map +1 -1
- package/dist/schema-keywords.js +20 -0
- package/dist/schema-projection.d.ts +171 -0
- package/dist/schema-projection.d.ts.map +1 -0
- package/dist/schema-projection.js +317 -0
- package/dist/schema-walk.d.ts +25 -0
- package/dist/schema-walk.d.ts.map +1 -0
- package/dist/schema-walk.js +126 -0
- package/dist/step-slot.d.ts +39 -0
- package/dist/step-slot.d.ts.map +1 -0
- package/dist/step-slot.js +49 -0
- package/dist/telo-version.d.ts +1 -1
- package/dist/telo-version.js +1 -1
- package/dist/validate-cel-context.d.ts.map +1 -1
- package/dist/validate-cel-context.js +17 -3
- package/dist/validate-durable-regions.d.ts +15 -0
- package/dist/validate-durable-regions.d.ts.map +1 -0
- package/dist/validate-durable-regions.js +336 -0
- package/dist/validate-references.d.ts.map +1 -1
- package/dist/validate-references.js +44 -2
- package/dist/validate-referrer-rules.d.ts +120 -0
- package/dist/validate-referrer-rules.d.ts.map +1 -0
- package/dist/validate-referrer-rules.js +255 -0
- package/dist/validate-resource-rules.d.ts +114 -0
- package/dist/validate-resource-rules.d.ts.map +1 -0
- package/dist/validate-resource-rules.js +283 -0
- package/dist/validate-schema-projection.d.ts +32 -0
- package/dist/validate-schema-projection.d.ts.map +1 -0
- package/dist/validate-schema-projection.js +110 -0
- package/dist/validate-step-inputs.d.ts +19 -1
- package/dist/validate-step-inputs.d.ts.map +1 -1
- package/dist/validate-step-inputs.js +102 -9
- package/dist/validate-throws-coverage.d.ts.map +1 -1
- package/dist/validate-throws-coverage.js +11 -5
- package/dist/validate-zone-slots.d.ts +2 -2
- package/dist/validate-zone-slots.d.ts.map +1 -1
- package/dist/validate-zone-slots.js +202 -6
- package/dist/validate-zone-violations.d.ts +12 -0
- package/dist/validate-zone-violations.d.ts.map +1 -0
- package/dist/validate-zone-violations.js +169 -0
- package/dist/value-type-keyword.d.ts +1 -1
- package/dist/value-type-keyword.d.ts.map +1 -1
- package/dist/value-type-keyword.js +4 -0
- package/dist/zone-slot.d.ts +61 -0
- package/dist/zone-slot.d.ts.map +1 -1
- package/dist/zone-slot.js +86 -5
- package/package.json +2 -2
- package/src/analysis-registry.ts +43 -0
- package/src/analyzer.ts +452 -595
- package/src/call-graph.ts +2 -8
- package/src/cel-scope-query.ts +337 -0
- package/src/cel-scope.ts +570 -0
- package/src/definition-registry.ts +31 -13
- package/src/find-manifest.ts +19 -0
- package/src/flatten-for-analyzer.ts +1 -1
- package/src/import-resolution-diagnostics.ts +25 -7
- package/src/index.ts +86 -0
- package/src/invocation-contract.ts +67 -2
- package/src/loaded-types.ts +12 -3
- package/src/manifest-analysis.ts +132 -0
- package/src/manifest-loader.ts +87 -55
- package/src/manifest-path.ts +34 -0
- package/src/manifest-schemas.ts +328 -14
- package/src/module-compatibility.ts +72 -0
- package/src/ref-slot-reading.ts +156 -0
- package/src/referrer-rule.ts +116 -0
- package/src/release/index.ts +1 -0
- package/src/release/version-stamp.ts +58 -0
- package/src/release/workspace-config.ts +10 -6
- package/src/resolve-schema-ref-kinds.ts +28 -4
- package/src/resolve-throws-union.ts +4 -3
- package/src/resolve-zone-containment.ts +329 -0
- package/src/resolve-zone-requirements.ts +67 -7
- package/src/resource-rule.ts +252 -0
- package/src/rule-condition.ts +126 -0
- package/src/schema-keywords.ts +24 -0
- package/src/schema-projection.ts +403 -0
- package/src/schema-walk.ts +144 -0
- package/src/step-slot.ts +64 -0
- package/src/telo-version.ts +1 -1
- package/src/validate-cel-context.ts +17 -3
- package/src/validate-durable-regions.ts +401 -0
- package/src/validate-references.ts +57 -2
- package/src/validate-referrer-rules.ts +373 -0
- package/src/validate-resource-rules.ts +401 -0
- package/src/validate-schema-projection.ts +184 -0
- package/src/validate-step-inputs.ts +148 -10
- package/src/validate-throws-coverage.ts +12 -5
- package/src/validate-zone-slots.ts +192 -8
- package/src/validate-zone-violations.ts +190 -0
- package/src/value-type-keyword.ts +4 -0
- package/src/zone-slot.ts +114 -5
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,wB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AAgB,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
|
@@ -13,15 +13,27 @@ export { hasIntermediateWildcard, parseRedactionPath, RedactionPathError, } from
|
|
|
13
13
|
export { buildCallGraph, projectToPairs, resourceId } from "./call-graph.js";
|
|
14
14
|
export { buildReferenceFieldMap, isRefEntry, isScopeEntry } from "./reference-field-map.js";
|
|
15
15
|
export { hasDeclaredUse, isRefSlot, isRefUse, possibleUses, readRefSlot, REF_USES, refSlotAnnotation, rewriteRefSlotKinds, transfersControl, } from "./ref-slot.js";
|
|
16
|
+
export { isStepSlot, readStepSlot, STEP_FRAGMENT } from "./step-slot.js";
|
|
16
17
|
export { ANNOTATION_KEYWORDS, registerTeloKeywords, valueTypeKeyword, } from "./value-type-keyword.js";
|
|
17
18
|
export { applyTextEdits, isPlainSafe, quoteStyleOf, renderFixReplacement, } from "./yaml-source-edit.js";
|
|
18
19
|
export { KNOWN_HOST_AXES, evaluateRequires, readRequires } from "./requires-block.js";
|
|
20
|
+
export { manifestCompatibility } from "./module-compatibility.js";
|
|
19
21
|
export { TELO_SURFACE_VERSION } from "./telo-version.js";
|
|
20
22
|
export { validateRequires } from "./validate-requires.js";
|
|
21
23
|
export { isUnsatisfiable, lowerBound, parseVersionRange, rangeAccepts, upperBound, } from "./version-range.js";
|
|
22
|
-
export { hasProvidesZone, hasRequiresZone, readProvidesZone, readRequiresZone, rewriteRequiresZoneKind, } from "./zone-slot.js";
|
|
24
|
+
export { hasProvidesZone, hasRequiresZone, providedZoneAttributes, readProvidesZone, readRequiresZone, readViolatesZone, rewriteRequiresZoneKind, } from "./zone-slot.js";
|
|
23
25
|
export { deriveLibraryExportRequirements, projectZoneRequirements, runZoneAnalysis, zoneDocumentsSignature, } from "./resolve-zone-requirements.js";
|
|
24
26
|
export { validateZoneSlotDeclarations } from "./validate-zone-slots.js";
|
|
27
|
+
export { RESOURCE_RULES_ANNOTATION, readResourceRules, readRawResourceRules, resolveRuleSubjects, findDynamicLeaf, } from "./resource-rule.js";
|
|
28
|
+
export { validateResourceRuleDeclarations, evaluateResourceRules, ruleExercised, RESOURCE_RULE_BUDGET_MS, } from "./validate-resource-rules.js";
|
|
29
|
+
export { REFERRER_RULES_ANNOTATION, readReferrerRules, readRawReferrerRules, hasReferrerRules, rewriteReferrerRuleKinds, } from "./referrer-rule.js";
|
|
30
|
+
export { validateReferrerRuleDeclarations, evaluateReferrerRules, referrerRuleExercised, reportReferrerRules, reportUnexercisedReferrerRule, } from "./validate-referrer-rules.js";
|
|
31
|
+
export { RULE_BUDGET_MS } from "./rule-condition.js";
|
|
32
|
+
export { readSchemaProjection, readSchemaMap, readProjectionFrom, readProjectionRef, manifestListScope, projectionKeyMap, projectEntries, resolveSchemaProjections, describeProjectionFailure, } from "./schema-projection.js";
|
|
33
|
+
export { validateSchemaProjection } from "./validate-schema-projection.js";
|
|
34
|
+
export { validateDurableRegions } from "./validate-durable-regions.js";
|
|
35
|
+
export { validateZoneViolations } from "./validate-zone-violations.js";
|
|
36
|
+
export { containmentIndex, findZoneRegions, regionManifests, } from "./resolve-zone-containment.js";
|
|
25
37
|
export { validateDynamicSelectors, validateRefSlotDeclarations } from "./validate-ref-slots.js";
|
|
26
38
|
export { validateValueTypeSlots } from "./validate-value-type-slots.js";
|
|
27
39
|
export { checkSchemaCompatibility, selectUnionBranch } from "./schema-compat.js";
|
|
@@ -56,6 +68,15 @@ export { PUBLISH_BLOCKING_CODES } from "./validate-module-metadata.js";
|
|
|
56
68
|
export { withSyntheticPositions } from "./with-synthetic-positions.js";
|
|
57
69
|
export { documentToAst, parseToAst } from "./yaml-ast.js";
|
|
58
70
|
export { CelParseError, buildCelSegments, wrapCelAst } from "./cel-ast.js";
|
|
71
|
+
// The CEL scope rule, and the way into it from outside the analysis pass. What
|
|
72
|
+
// completes, what hovers and what type-checks are one answer because they are
|
|
73
|
+
// one function.
|
|
74
|
+
export { CelScopeResolver } from "./cel-scope.js";
|
|
75
|
+
export { CelScopeQuery } from "./cel-scope-query.js";
|
|
76
|
+
// The pairing of a registry and the manifests it analyzed — the one seam a host
|
|
77
|
+
// threads for every question that needs both.
|
|
78
|
+
export { navigateConcretePath } from "./manifest-path.js";
|
|
79
|
+
export { ManifestAnalysis } from "./manifest-analysis.js";
|
|
59
80
|
export { DEFAULT_MANIFEST_FILENAME, DiagnosticSeverity, diagnosticFix } from "./types.js";
|
|
60
81
|
export * from "./manifest-schemas.js";
|
|
61
82
|
// The JSON Schema vocabulary a manifest may write, as data — the source both the
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { type ResourceDefinition } from "@telorun/sdk";
|
|
2
|
+
import { AliasResolver, type ModuleScopes } from "./alias-resolver.js";
|
|
3
|
+
import { DefinitionRegistry } from "./definition-registry.js";
|
|
2
4
|
import { type ContractDirection, type DefResolver } from "./extends-resolution.js";
|
|
5
|
+
import { type ProjectionFailure } from "./schema-projection.js";
|
|
3
6
|
export type { ContractDirection };
|
|
7
|
+
/** The {@link ContractScope} the analyzer resolves invocation contracts in: kinds
|
|
8
|
+
* resolve in the module that declared the definition they were read off (so an
|
|
9
|
+
* `extends` chain crossing module boundaries re-scopes at every hop), and named
|
|
10
|
+
* `telo#Type` references resolve against the flattened manifest list. `resolveIn`
|
|
11
|
+
* is the top-level entry point, where the kind was written by the READING
|
|
12
|
+
* module and there is no declaring definition yet. */
|
|
13
|
+
export declare function analyzerContractScope(defs: DefinitionRegistry, aliases: AliasResolver, scopes: ModuleScopes, allManifests: Record<string, any>[]): ContractScope & {
|
|
14
|
+
resolveIn(kind: string, module?: string): ResourceDefinition | undefined;
|
|
15
|
+
};
|
|
4
16
|
/**
|
|
5
17
|
* The one answer to "what is this target's input / output schema".
|
|
6
18
|
*
|
|
@@ -59,7 +71,11 @@ export declare const PERMISSIVE_CONTRACT: Record<string, any>;
|
|
|
59
71
|
* "declared nothing" from "declared anything", which the wiring rule and the
|
|
60
72
|
* `run()` guard both need.
|
|
61
73
|
*/
|
|
62
|
-
export declare function resolveContract(direction: ContractDirection, manifest: Record<string, any> | undefined, definition: ResourceDefinition | undefined, scope: ContractScope
|
|
74
|
+
export declare function resolveContract(direction: ContractDirection, manifest: Record<string, any> | undefined, definition: ResourceDefinition | undefined, scope: ContractScope,
|
|
75
|
+
/** Collects declaration-derived slots that could not be projected. Omitted by
|
|
76
|
+
* every caller that only wants the schema; the one pass that REPORTS them
|
|
77
|
+
* passes an array. */
|
|
78
|
+
projectionFailures?: ProjectionFailure[]): ResolvedContract | undefined;
|
|
63
79
|
/** {@link resolveContract}, falling back to {@link PERMISSIVE_CONTRACT}. For
|
|
64
80
|
* callers that need a schema unconditionally (CEL context typing), as opposed
|
|
65
81
|
* to needing to know whether one was declared. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invocation-contract.d.ts","sourceRoot":"","sources":["../src/invocation-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,kBAAkB,EAAe,MAAM,cAAc,CAAC;AAChF,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,WAAW,EAEjB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"invocation-contract.d.ts","sourceRoot":"","sources":["../src/invocation-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,kBAAkB,EAAe,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,aAAa,EAA2B,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,WAAW,EAEjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC;;;;;uDAKuD;AACvD,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,kBAAkB,EACxB,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAClC,aAAa,GAAG;IAAE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAAA;CAAE,CAO9F;AAED;;;;;;;;;;;;GAYG;AAEH;;oCAEoC;AACpC,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,MAAM,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GA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AAoFD;;;;;gEAKgE;AAChE,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;AAC3B;;iFAEiF;AACjF,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,GAC5D,MAAM,EAAE,EAAE,CA+BZ;AAED;;;;;;kCAMkC;AAClC,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEpD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;;;;;;+DAuB+D;AAC/D,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,GAC5D,kBAAkB,EAAE,CAoCtB"}
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { isLiveSlot, valueTypeOf } from "@telorun/sdk";
|
|
2
|
+
import { moduleScopedDefResolver } from "./alias-resolver.js";
|
|
2
3
|
import { contractDeclarer, effectiveContractField, } from "./extends-resolution.js";
|
|
3
4
|
import { resolveTypeFieldToSchema } from "./validate-cel-context.js";
|
|
5
|
+
import { manifestListScope, resolveSchemaProjections, } from "./schema-projection.js";
|
|
6
|
+
/** The {@link ContractScope} the analyzer resolves invocation contracts in: kinds
|
|
7
|
+
* resolve in the module that declared the definition they were read off (so an
|
|
8
|
+
* `extends` chain crossing module boundaries re-scopes at every hop), and named
|
|
9
|
+
* `telo#Type` references resolve against the flattened manifest list. `resolveIn`
|
|
10
|
+
* is the top-level entry point, where the kind was written by the READING
|
|
11
|
+
* module and there is no declaring definition yet. */
|
|
12
|
+
export function analyzerContractScope(defs, aliases, scopes, allManifests) {
|
|
13
|
+
const resolve = moduleScopedDefResolver(defs, aliases, scopes);
|
|
14
|
+
return {
|
|
15
|
+
resolveDefinition: resolve,
|
|
16
|
+
resolveIn: resolve.in,
|
|
17
|
+
typeManifestsFor: () => allManifests,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
4
20
|
/** The fallback for a target that declares no contract: anything goes. Not
|
|
5
21
|
* `additionalProperties: false` — an undeclared contract is an absence of a
|
|
6
22
|
* claim, not a claim of emptiness. */
|
|
@@ -20,12 +36,20 @@ export const PERMISSIVE_CONTRACT = {
|
|
|
20
36
|
* "declared nothing" from "declared anything", which the wiring rule and the
|
|
21
37
|
* `run()` guard both need.
|
|
22
38
|
*/
|
|
23
|
-
export function resolveContract(direction, manifest, definition, scope
|
|
39
|
+
export function resolveContract(direction, manifest, definition, scope,
|
|
40
|
+
/** Collects declaration-derived slots that could not be projected. Omitted by
|
|
41
|
+
* every caller that only wants the schema; the one pass that REPORTS them
|
|
42
|
+
* passes an array. */
|
|
43
|
+
projectionFailures) {
|
|
24
44
|
const own = manifest?.[direction];
|
|
25
45
|
if (own !== undefined && own !== null) {
|
|
26
46
|
const schema = resolveTypeFieldToSchema(own, scope.typeManifestsFor(definition));
|
|
27
|
-
if (schema)
|
|
28
|
-
return {
|
|
47
|
+
if (schema) {
|
|
48
|
+
return {
|
|
49
|
+
schema: projectionResolved(schema, manifest, scope, definition, projectionFailures),
|
|
50
|
+
origin: "instance",
|
|
51
|
+
};
|
|
52
|
+
}
|
|
29
53
|
}
|
|
30
54
|
const declared = effectiveContractField(definition, scope.resolveDefinition, direction);
|
|
31
55
|
if (declared === undefined || declared === null)
|
|
@@ -34,7 +58,21 @@ export function resolveContract(direction, manifest, definition, scope) {
|
|
|
34
58
|
const schema = resolveTypeFieldToSchema(declared, scope.typeManifestsFor(declarer));
|
|
35
59
|
if (!schema)
|
|
36
60
|
return undefined;
|
|
37
|
-
return {
|
|
61
|
+
return {
|
|
62
|
+
schema: projectionResolved(schema, manifest, scope, declarer, projectionFailures),
|
|
63
|
+
origin: "kind",
|
|
64
|
+
declaredBy: declarer,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A contract may be DECLARATION-derived: a kind whose `outputType` projects the
|
|
69
|
+
* declaration of a resource it references (a repository typing its rows from
|
|
70
|
+
* the table it reads). The manifest is in hand here and nowhere later, so this
|
|
71
|
+
* is where the projection is resolved — and it is resolved for a kind-declared
|
|
72
|
+
* contract and an instance-declared one alike, since either may carry one.
|
|
73
|
+
*/
|
|
74
|
+
function projectionResolved(schema, manifest, scope, declarer, failures) {
|
|
75
|
+
return resolveSchemaProjections(schema, manifest, manifestListScope(scope.typeManifestsFor(declarer), (kind) => scope.resolveDefinition(kind)), failures);
|
|
38
76
|
}
|
|
39
77
|
/** {@link resolveContract}, falling back to {@link PERMISSIVE_CONTRACT}. For
|
|
40
78
|
* callers that need a schema unconditionally (CEL context typing), as opposed
|
package/dist/loaded-types.d.ts
CHANGED
|
@@ -66,9 +66,11 @@ export interface ImportEdge {
|
|
|
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;
|
|
69
|
-
/** Target library's `metadata.name
|
|
70
|
-
*
|
|
71
|
-
|
|
69
|
+
/** Target library's `metadata.name`. Never absent: an import whose target
|
|
70
|
+
* names no library identity registers no edge at all and is reported in
|
|
71
|
+
* `LoadedGraph.errors`, so an edge that exists is one every consumer can
|
|
72
|
+
* resolve a kind through. */
|
|
73
|
+
targetModuleName: string;
|
|
72
74
|
/** DEPRECATED. Target library's `metadata.namespace`, or `null` when it
|
|
73
75
|
* declares none. Feeds only the legacy `<namespace>/<module>#<Kind>` form
|
|
74
76
|
* of `x-telo-ref`; nothing else reads it. */
|
|
@@ -131,6 +133,13 @@ export interface GraphLoadError {
|
|
|
131
133
|
alias?: string;
|
|
132
134
|
/** Line of the `Telo.Import` doc in `fromSource`, for position fallback. */
|
|
133
135
|
sourceLine?: number;
|
|
136
|
+
/** Why this import is unusable. `"unresolved"` (the default) means the target
|
|
137
|
+
* was never obtained — an unreachable or unrecognizable source, which the
|
|
138
|
+
* author fixes in their own file. `"unusable-target"` means it WAS obtained
|
|
139
|
+
* and is not an importable library, which is a defect in the target module.
|
|
140
|
+
* Kept apart because the two call for different actions; consumers phrase
|
|
141
|
+
* them differently rather than asserting one cause for both. */
|
|
142
|
+
reason?: "unresolved" | "unusable-target";
|
|
134
143
|
error: Error;
|
|
135
144
|
}
|
|
136
145
|
//# sourceMappingURL=loaded-types.d.ts.map
|
|
@@ -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;+DAC2D;IAC3D,MAAM,EAAE,MAAM,CAAC;IACf;gEAC4D;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb;;+EAE2E;IAC3E,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB;+EAC2E;IAC3E,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,6EAA6E;IAC7E,SAAS,EAAE,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAC1C,0EAA0E;I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C;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"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **One analyzed manifest set, and the questions asked of it.**
|
|
3
|
+
*
|
|
4
|
+
* Several answers a host needs require the SAME two things: the registry's
|
|
5
|
+
* definitions and aliases, and the manifest set they were resolved against. The
|
|
6
|
+
* registry deliberately holds no manifests — it is populated per analysis and
|
|
7
|
+
* reused across them — so each such answer would otherwise become another
|
|
8
|
+
* factory on the registry and another optional parameter on every IDE entry
|
|
9
|
+
* point. Four of those arrived in short order (CEL scope, step declarations,
|
|
10
|
+
* context-binding declarations, invocation contracts) and the next one is not
|
|
11
|
+
* hypothetical.
|
|
12
|
+
*
|
|
13
|
+
* So the pairing is named once and the questions hang off it. A host threads ONE
|
|
14
|
+
* object and gains later questions for free; each facet keeps its own honest
|
|
15
|
+
* name rather than accreting onto whichever one happened to exist first.
|
|
16
|
+
*
|
|
17
|
+
* Nothing here re-implements an answer. `contractFor` is the shared
|
|
18
|
+
* {@link resolveContract} — the one `telo check` runs and the kernel binds at
|
|
19
|
+
* dispatch — given the scope to run in; `celScope` is the same
|
|
20
|
+
* {@link CelScopeQuery} the analysis pass's rule is built from. That is the
|
|
21
|
+
* whole point: a completion list is a claim about what the checker accepts, and
|
|
22
|
+
* a second implementation of any of these could not be held to it.
|
|
23
|
+
*/
|
|
24
|
+
import type { ResourceManifest } from "@telorun/sdk";
|
|
25
|
+
import { AliasResolver } from "./alias-resolver.js";
|
|
26
|
+
import { CelScopeQuery, type CelScopeQueryContext } from "./cel-scope-query.js";
|
|
27
|
+
import { DefinitionRegistry } from "./definition-registry.js";
|
|
28
|
+
import type { ContractDirection } from "./extends-resolution.js";
|
|
29
|
+
/**
|
|
30
|
+
* A reference as the loader leaves it — the internal `{kind, name, alias?}`
|
|
31
|
+
* shape `resolveRefSentinels` rewrites `!ref` into.
|
|
32
|
+
*/
|
|
33
|
+
export interface ManifestRef {
|
|
34
|
+
kind?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
alias?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare class ManifestAnalysis {
|
|
39
|
+
readonly manifests: ResourceManifest[];
|
|
40
|
+
private readonly ctx;
|
|
41
|
+
private readonly scopes;
|
|
42
|
+
private celScopeQuery;
|
|
43
|
+
constructor(manifests: ResourceManifest[], ctx: CelScopeQueryContext);
|
|
44
|
+
/** What CEL sees, per site. Built on first use — its indices are a function of
|
|
45
|
+
* the whole set, and a host that never opens a CEL body should not pay for
|
|
46
|
+
* them. */
|
|
47
|
+
get celScope(): CelScopeQuery;
|
|
48
|
+
/** The manifest a `(kind, name)` pair addresses. */
|
|
49
|
+
resourceFor(kind: string | undefined, name: string | undefined): ResourceManifest | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* The invocation contract of the resource a reference names.
|
|
52
|
+
*
|
|
53
|
+
* The shared resolver, so an editor offering a target's input keys is offering
|
|
54
|
+
* exactly what `telo check` validates that call site against and what the
|
|
55
|
+
* kernel binds at dispatch. Layered instance-first: a resource declaring its
|
|
56
|
+
* own `inputType:` narrows the kind's, which is the common case for a
|
|
57
|
+
* `Run.Sequence` used as a handler.
|
|
58
|
+
*/
|
|
59
|
+
contractFor(ref: ManifestRef, direction: ContractDirection): Record<string, any> | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* The manifest a reference names.
|
|
62
|
+
*
|
|
63
|
+
* An ALIAS narrows before the name does: a flattened set carries every
|
|
64
|
+
* imported library's exported instances, so two libraries exporting a `store`
|
|
65
|
+
* are two manifests with one name. Matching the alias to its target module
|
|
66
|
+
* picks the right one; where the alias resolves to nothing the name alone is
|
|
67
|
+
* used, which is what a local reference needs anyway.
|
|
68
|
+
*/
|
|
69
|
+
private resolveRef;
|
|
70
|
+
private definitionFor;
|
|
71
|
+
}
|
|
72
|
+
export type { CelScopeQueryContext, AliasResolver, DefinitionRegistry };
|
|
73
|
+
//# sourceMappingURL=manifest-analysis.d.ts.map
|
|
@@ -0,0 +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,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAKjE;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,gBAAgB;IAKzB,QAAQ,CAAC,SAAS,EAAE,gBAAgB,EAAE;IACtC,OAAO,CAAC,QAAQ,CAAC,GAAG;IALtB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,aAAa,CAA4B;gBAGtC,SAAS,EAAE,gBAAgB,EAAE,EACrB,GAAG,EAAE,oBAAoB;IAS5C;;gBAEY;IACZ,IAAI,QAAQ,IAAI,aAAa,CAE5B;IAED,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"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { CelScopeQuery } from "./cel-scope-query.js";
|
|
2
|
+
import { analyzerContractScope, resolveContract } from "./invocation-contract.js";
|
|
3
|
+
import { findManifest } from "./find-manifest.js";
|
|
4
|
+
import { isModuleKind } from "./module-kinds.js";
|
|
5
|
+
export class ManifestAnalysis {
|
|
6
|
+
manifests;
|
|
7
|
+
ctx;
|
|
8
|
+
scopes;
|
|
9
|
+
celScopeQuery;
|
|
10
|
+
constructor(manifests, ctx) {
|
|
11
|
+
this.manifests = manifests;
|
|
12
|
+
this.ctx = ctx;
|
|
13
|
+
const rootModules = new Set();
|
|
14
|
+
for (const m of manifests) {
|
|
15
|
+
if (isModuleKind(m.kind) && m.metadata?.name)
|
|
16
|
+
rootModules.add(m.metadata.name);
|
|
17
|
+
}
|
|
18
|
+
this.scopes = { aliasesByModule: ctx.aliasesByModule, rootModules };
|
|
19
|
+
}
|
|
20
|
+
/** What CEL sees, per site. Built on first use — its indices are a function of
|
|
21
|
+
* the whole set, and a host that never opens a CEL body should not pay for
|
|
22
|
+
* them. */
|
|
23
|
+
get celScope() {
|
|
24
|
+
return (this.celScopeQuery ??= new CelScopeQuery(this.manifests, this.ctx));
|
|
25
|
+
}
|
|
26
|
+
/** The manifest a `(kind, name)` pair addresses. */
|
|
27
|
+
resourceFor(kind, name) {
|
|
28
|
+
return findManifest(this.manifests, kind, name);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The invocation contract of the resource a reference names.
|
|
32
|
+
*
|
|
33
|
+
* The shared resolver, so an editor offering a target's input keys is offering
|
|
34
|
+
* exactly what `telo check` validates that call site against and what the
|
|
35
|
+
* kernel binds at dispatch. Layered instance-first: a resource declaring its
|
|
36
|
+
* own `inputType:` narrows the kind's, which is the common case for a
|
|
37
|
+
* `Run.Sequence` used as a handler.
|
|
38
|
+
*/
|
|
39
|
+
contractFor(ref, direction) {
|
|
40
|
+
const target = this.resolveRef(ref);
|
|
41
|
+
const definition = ref.kind ? this.definitionFor(ref.kind) : undefined;
|
|
42
|
+
if (!target && !definition)
|
|
43
|
+
return undefined;
|
|
44
|
+
return resolveContract(direction, target, definition, analyzerContractScope(this.ctx.defs, this.ctx.aliases, this.scopes, this.manifests))?.schema;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The manifest a reference names.
|
|
48
|
+
*
|
|
49
|
+
* An ALIAS narrows before the name does: a flattened set carries every
|
|
50
|
+
* imported library's exported instances, so two libraries exporting a `store`
|
|
51
|
+
* are two manifests with one name. Matching the alias to its target module
|
|
52
|
+
* picks the right one; where the alias resolves to nothing the name alone is
|
|
53
|
+
* used, which is what a local reference needs anyway.
|
|
54
|
+
*/
|
|
55
|
+
resolveRef(ref) {
|
|
56
|
+
if (!ref.name)
|
|
57
|
+
return undefined;
|
|
58
|
+
const byName = this.manifests.filter((m) => m.metadata?.name === ref.name);
|
|
59
|
+
if (byName.length === 0)
|
|
60
|
+
return undefined;
|
|
61
|
+
if (byName.length === 1)
|
|
62
|
+
return byName[0];
|
|
63
|
+
const targetModule = ref.alias ? this.ctx.aliases.moduleForAlias?.(ref.alias) : undefined;
|
|
64
|
+
if (targetModule) {
|
|
65
|
+
const scoped = byName.find((m) => m.metadata?.module === targetModule);
|
|
66
|
+
if (scoped)
|
|
67
|
+
return scoped;
|
|
68
|
+
}
|
|
69
|
+
// Several candidates and nothing to choose between them: refusing is the
|
|
70
|
+
// honest answer, since typing a call site against the wrong resource's
|
|
71
|
+
// contract is worse than typing it against none.
|
|
72
|
+
return ref.kind ? byName.find((m) => m.kind === ref.kind) : undefined;
|
|
73
|
+
}
|
|
74
|
+
definitionFor(kind) {
|
|
75
|
+
const canonical = this.ctx.aliases.resolveKind(kind);
|
|
76
|
+
return this.ctx.defs.resolve(kind) ?? (canonical ? this.ctx.defs.resolve(canonical) : undefined);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -83,7 +83,6 @@ export declare class Loader {
|
|
|
83
83
|
resolveImportUrl(fromSource: string, importSource: string): string;
|
|
84
84
|
private assertSingleModuleDeclaration;
|
|
85
85
|
private assertNoSystemKindsInPartialContext;
|
|
86
|
-
private assertImportTargetIsLibrary;
|
|
87
86
|
private resolveIncludes;
|
|
88
87
|
/** Find the owning telo.yaml for `fileUrl` (or use it directly if it's an
|
|
89
88
|
* owner) and return the `LoadedGraph` rooted at that owner. Returns
|
|
@@ -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;
|
|
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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;;;;;;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
|
@@ -35,6 +35,40 @@ function collectMigrationDiagnostics(entry) {
|
|
|
35
35
|
}
|
|
36
36
|
return diagnostics;
|
|
37
37
|
}
|
|
38
|
+
function importTargetIdentity(target, importSource) {
|
|
39
|
+
const library = target.owner.manifests.find((m) => m?.kind === "Telo.Library");
|
|
40
|
+
const application = target.owner.manifests.find((m) => m?.kind === "Telo.Application");
|
|
41
|
+
if (!library && application) {
|
|
42
|
+
return {
|
|
43
|
+
unusable: `Telo.Import target '${importSource}' is a Telo.Application. ` +
|
|
44
|
+
`Only Telo.Library modules may be imported. Applications are run directly, not imported. ` +
|
|
45
|
+
`Point this import at a library, or drop it and run that application on its own.`,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (!library) {
|
|
49
|
+
const kinds = target.owner.manifests
|
|
50
|
+
.map((m) => m?.kind)
|
|
51
|
+
.filter((k) => typeof k === "string");
|
|
52
|
+
const detail = kinds.length
|
|
53
|
+
? `Fetched ${target.owner.manifests.length} document(s) with kinds [${kinds.join(", ")}].`
|
|
54
|
+
: `Fetched manifest contained no recognizable Telo documents — check that the source ` +
|
|
55
|
+
`serves a Telo.Library manifest and not an upstream error page.`;
|
|
56
|
+
return {
|
|
57
|
+
unusable: `Telo.Import target '${importSource}' did not resolve to a Telo.Library. ` +
|
|
58
|
+
`Fetched from: ${target.owner.source}. ${detail}`,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const name = library.metadata?.name;
|
|
62
|
+
if (typeof name !== "string" || name === "") {
|
|
63
|
+
return {
|
|
64
|
+
unusable: `Telo.Import target '${importSource}' resolved to a Telo.Library that declares no ` +
|
|
65
|
+
`'metadata.name'. Fetched from: ${target.owner.source}. A library's name is the kind ` +
|
|
66
|
+
`prefix its importers reference, so it cannot be imported until the target declares one.`,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const namespace = library.metadata?.namespace;
|
|
70
|
+
return { name, namespace: typeof namespace === "string" ? namespace : null };
|
|
71
|
+
}
|
|
38
72
|
const SYSTEM_KINDS = new Set([
|
|
39
73
|
"Telo.Application",
|
|
40
74
|
"Telo.Library",
|
|
@@ -303,30 +337,40 @@ export class Loader {
|
|
|
303
337
|
continue;
|
|
304
338
|
}
|
|
305
339
|
}
|
|
306
|
-
// Resolve target identity from its Telo.Library doc and stamp it
|
|
307
|
-
//
|
|
308
|
-
//
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
340
|
+
// Resolve target identity from its Telo.Library doc and stamp it on
|
|
341
|
+
// the edge — flattenForAnalyzer reads from the edge directly, never
|
|
342
|
+
// re-deriving from manifest.metadata.
|
|
343
|
+
//
|
|
344
|
+
// Checked per IMPORT rather than per distinct target: an import
|
|
345
|
+
// pointing at a module something else already reached (the entry
|
|
346
|
+
// application above all) would otherwise skip the check entirely and
|
|
347
|
+
// register a nameless edge. An unusable target is recorded exactly
|
|
348
|
+
// like an unfetchable one — an error against this import, no edge,
|
|
349
|
+
// and the rest of the graph still loads — so no consumer has to know
|
|
350
|
+
// the difference between the two ways an import can fail.
|
|
351
|
+
const identity = importTargetIdentity(targetModule, importSource);
|
|
352
|
+
if ("unusable" in identity) {
|
|
353
|
+
const e = new Error(identity.unusable);
|
|
354
|
+
e.sourceLine = sourceLine;
|
|
355
|
+
errors.push({
|
|
356
|
+
url: targetCanonical,
|
|
357
|
+
source: importSource,
|
|
358
|
+
fromSource: file.source,
|
|
359
|
+
alias,
|
|
360
|
+
sourceLine,
|
|
361
|
+
reason: "unusable-target",
|
|
362
|
+
error: e,
|
|
363
|
+
});
|
|
364
|
+
continue;
|
|
320
365
|
}
|
|
321
366
|
aliases.set(alias, {
|
|
322
367
|
targetSource: targetCanonical,
|
|
323
368
|
targetRef: importSource,
|
|
324
|
-
targetModuleName,
|
|
325
|
-
targetNamespace,
|
|
369
|
+
targetModuleName: identity.name,
|
|
370
|
+
targetNamespace: identity.namespace,
|
|
326
371
|
});
|
|
327
|
-
if (
|
|
372
|
+
if (!visited.has(targetCanonical)) {
|
|
328
373
|
visited.add(targetCanonical);
|
|
329
|
-
this.assertImportTargetIsLibrary(targetModule, importSource, sourceLine);
|
|
330
374
|
queue.push(targetModule);
|
|
331
375
|
}
|
|
332
376
|
}
|
|
@@ -386,29 +430,6 @@ export class Loader {
|
|
|
386
430
|
}
|
|
387
431
|
}
|
|
388
432
|
}
|
|
389
|
-
assertImportTargetIsLibrary(target, importSource, sourceLine) {
|
|
390
|
-
const importedLibrary = target.owner.manifests.find((m) => m?.kind === "Telo.Library");
|
|
391
|
-
const importedApplication = target.owner.manifests.find((m) => m?.kind === "Telo.Application");
|
|
392
|
-
if (importedApplication) {
|
|
393
|
-
const e = new Error(`Telo.Import target '${importSource}' is a Telo.Application. ` +
|
|
394
|
-
`Only Telo.Library modules may be imported. Applications are run directly, not imported.`);
|
|
395
|
-
e.sourceLine = sourceLine;
|
|
396
|
-
throw e;
|
|
397
|
-
}
|
|
398
|
-
if (!importedLibrary) {
|
|
399
|
-
const kinds = target.owner.manifests
|
|
400
|
-
.map((m) => m?.kind)
|
|
401
|
-
.filter((k) => typeof k === "string");
|
|
402
|
-
const detail = kinds.length
|
|
403
|
-
? `Fetched ${target.owner.manifests.length} document(s) with kinds [${kinds.join(", ")}].`
|
|
404
|
-
: `Fetched manifest contained no recognizable Telo documents — check that the source ` +
|
|
405
|
-
`serves a Telo.Library manifest and not an upstream error page.`;
|
|
406
|
-
const e = new Error(`Telo.Import target '${importSource}' did not resolve to a Telo.Library. ` +
|
|
407
|
-
`Fetched from: ${target.owner.source}. ${detail}`);
|
|
408
|
-
e.sourceLine = sourceLine;
|
|
409
|
-
throw e;
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
433
|
async resolveIncludes(ownerSource, patterns, source) {
|
|
413
434
|
const hasGlobs = patterns.some((p) => /[*?{}\[\]]/.test(p));
|
|
414
435
|
if (hasGlobs) {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navigating a MANIFEST by a concrete path (`routes[0].request.schema.query`).
|
|
3
|
+
*
|
|
4
|
+
* The counterpart to `schema-walk.ts`, which navigates a schema: this addresses
|
|
5
|
+
* the author's own document, indices and all. Its own module because three
|
|
6
|
+
* places needed it independently — the CEL scope query resolving a context
|
|
7
|
+
* binding's declaration, the call-site checker resolving an argument map, and
|
|
8
|
+
* the IDE resolving the same map for completion — and three copies of one
|
|
9
|
+
* traversal is exactly what the shared-answer rule exists to prevent.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* The value at `path`, or `undefined` when any segment is absent.
|
|
13
|
+
*
|
|
14
|
+
* Absence is what makes a candidate path a CHECK rather than a guess: a caller
|
|
15
|
+
* offering several possible shapes can try each and know a hit is a real node.
|
|
16
|
+
*/
|
|
17
|
+
export declare function navigateConcretePath(root: Record<string, any>, path: string): unknown;
|
|
18
|
+
//# sourceMappingURL=manifest-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-path.d.ts","sourceRoot":"","sources":["../src/manifest-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAgBrF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navigating a MANIFEST by a concrete path (`routes[0].request.schema.query`).
|
|
3
|
+
*
|
|
4
|
+
* The counterpart to `schema-walk.ts`, which navigates a schema: this addresses
|
|
5
|
+
* the author's own document, indices and all. Its own module because three
|
|
6
|
+
* places needed it independently — the CEL scope query resolving a context
|
|
7
|
+
* binding's declaration, the call-site checker resolving an argument map, and
|
|
8
|
+
* the IDE resolving the same map for completion — and three copies of one
|
|
9
|
+
* traversal is exactly what the shared-answer rule exists to prevent.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* The value at `path`, or `undefined` when any segment is absent.
|
|
13
|
+
*
|
|
14
|
+
* Absence is what makes a candidate path a CHECK rather than a guess: a caller
|
|
15
|
+
* offering several possible shapes can try each and know a hit is a real node.
|
|
16
|
+
*/
|
|
17
|
+
export function navigateConcretePath(root, path) {
|
|
18
|
+
let current = root;
|
|
19
|
+
for (const segment of path.split(".")) {
|
|
20
|
+
if (!segment)
|
|
21
|
+
continue;
|
|
22
|
+
const match = segment.match(/^([^[]*)((?:\[\d+\])*)$/);
|
|
23
|
+
if (!match)
|
|
24
|
+
return undefined;
|
|
25
|
+
if (match[1]) {
|
|
26
|
+
if (current === null || typeof current !== "object")
|
|
27
|
+
return undefined;
|
|
28
|
+
current = current[match[1]];
|
|
29
|
+
}
|
|
30
|
+
for (const index of match[2].matchAll(/\[(\d+)\]/g)) {
|
|
31
|
+
if (!Array.isArray(current))
|
|
32
|
+
return undefined;
|
|
33
|
+
current = current[Number(index[1])];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return current;
|
|
37
|
+
}
|