@telorun/analyzer 0.53.0 → 0.55.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.
Files changed (76) hide show
  1. package/dist/analysis-registry.d.ts +20 -0
  2. package/dist/analysis-registry.d.ts.map +1 -1
  3. package/dist/analysis-registry.js +36 -3
  4. package/dist/analyzer.d.ts +3 -2
  5. package/dist/analyzer.d.ts.map +1 -1
  6. package/dist/analyzer.js +188 -26
  7. package/dist/builtins.d.ts.map +1 -1
  8. package/dist/builtins.js +32 -12
  9. package/dist/call-graph.d.ts +189 -0
  10. package/dist/call-graph.d.ts.map +1 -0
  11. package/dist/call-graph.js +617 -0
  12. package/dist/dependency-graph.d.ts +17 -7
  13. package/dist/dependency-graph.d.ts.map +1 -1
  14. package/dist/dependency-graph.js +36 -65
  15. package/dist/flatten-for-analyzer.d.ts +8 -0
  16. package/dist/flatten-for-analyzer.d.ts.map +1 -1
  17. package/dist/flatten-for-analyzer.js +32 -0
  18. package/dist/index.d.ts +14 -1
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +7 -1
  21. package/dist/manifest-navigation.d.ts +32 -0
  22. package/dist/manifest-navigation.d.ts.map +1 -0
  23. package/dist/manifest-navigation.js +91 -0
  24. package/dist/manifest-visitor.js +1 -1
  25. package/dist/ref-slot.d.ts +125 -0
  26. package/dist/ref-slot.d.ts.map +1 -0
  27. package/dist/ref-slot.js +226 -0
  28. package/dist/reference-field-map.d.ts +15 -1
  29. package/dist/reference-field-map.d.ts.map +1 -1
  30. package/dist/reference-field-map.js +29 -35
  31. package/dist/resolve-schema-ref-kinds.d.ts +4 -0
  32. package/dist/resolve-schema-ref-kinds.d.ts.map +1 -1
  33. package/dist/resolve-schema-ref-kinds.js +31 -8
  34. package/dist/resolve-zone-requirements.d.ts +110 -0
  35. package/dist/resolve-zone-requirements.d.ts.map +1 -0
  36. package/dist/resolve-zone-requirements.js +541 -0
  37. package/dist/types.d.ts +8 -0
  38. package/dist/types.d.ts.map +1 -1
  39. package/dist/validate-observed-state.d.ts +14 -13
  40. package/dist/validate-observed-state.d.ts.map +1 -1
  41. package/dist/validate-observed-state.js +21 -88
  42. package/dist/validate-ref-slots.d.ts +48 -0
  43. package/dist/validate-ref-slots.d.ts.map +1 -0
  44. package/dist/validate-ref-slots.js +219 -0
  45. package/dist/validate-references.d.ts.map +1 -1
  46. package/dist/validate-references.js +8 -1
  47. package/dist/validate-zone-slots.d.ts +39 -0
  48. package/dist/validate-zone-slots.d.ts.map +1 -0
  49. package/dist/validate-zone-slots.js +114 -0
  50. package/dist/zone-module-documents.d.ts +27 -0
  51. package/dist/zone-module-documents.d.ts.map +1 -0
  52. package/dist/zone-module-documents.js +1 -0
  53. package/dist/zone-slot.d.ts +61 -0
  54. package/dist/zone-slot.d.ts.map +1 -0
  55. package/dist/zone-slot.js +91 -0
  56. package/package.json +3 -3
  57. package/src/analysis-registry.ts +36 -2
  58. package/src/analyzer.ts +206 -24
  59. package/src/builtins.ts +32 -12
  60. package/src/call-graph.ts +827 -0
  61. package/src/dependency-graph.ts +34 -68
  62. package/src/flatten-for-analyzer.ts +32 -0
  63. package/src/index.ts +47 -0
  64. package/src/manifest-navigation.ts +91 -0
  65. package/src/manifest-visitor.ts +1 -1
  66. package/src/ref-slot.ts +273 -0
  67. package/src/reference-field-map.ts +39 -36
  68. package/src/resolve-schema-ref-kinds.ts +34 -7
  69. package/src/resolve-zone-requirements.ts +781 -0
  70. package/src/types.ts +8 -0
  71. package/src/validate-observed-state.ts +26 -92
  72. package/src/validate-ref-slots.ts +293 -0
  73. package/src/validate-references.ts +8 -1
  74. package/src/validate-zone-slots.ts +175 -0
  75. package/src/zone-module-documents.ts +27 -0
  76. package/src/zone-slot.ts +116 -0
@@ -1,79 +1,50 @@
1
- import { isRefSentinel } from "@telorun/templating";
2
- import { visitManifest } from "./manifest-visitor.js";
3
- import { DEPENDENCY_GRAPH_SKIP_KINDS as SYSTEM_KINDS } from "./system-kinds.js";
1
+ import { buildCallGraph, projectToPairs } from "./call-graph.js";
4
2
  const nodeKey = (kind, name) => `${kind}\0${name}`;
5
3
  /**
6
- * Builds a directed acyclic graph (DAG) of runtime resource dependencies and
4
+ * Builds a directed acyclic graph (DAG) of boot-time resource dependencies and
7
5
  * returns either a topological initialization order or the cycle path.
8
6
  *
9
- * Edges represent boot-time dependencies only:
10
- * - x-telo-ref fields that fall within a scope visibility path are excluded
11
- * (scoped resources are initialized on demand at runtime, not at boot).
12
- * - x-telo-scope fields themselves are excluded from the graph.
7
+ * A projection of the typed reference graph, not a second walk of the manifest.
8
+ * What this consumer keeps of the full graph:
13
9
  *
14
- * The registry is queried for each resource's field map by kind — callers do
15
- * not pre-compute or pass field maps separately.
10
+ * - **Injection sites only.** A site the reference field map reaches is a
11
+ * Phase-5 injection site, so its target must be constructed first — including
12
+ * `Telo.Application`'s inline `targets[].invoke`, which is step-declared but
13
+ * injected. A step slot behind a local `$ref` and a value-tree-discovered ref
14
+ * resolve at dispatch, so their targets need only exist by the time the step
15
+ * runs. All can be `use: call` — the difference is the site, never the node
16
+ * kind or the use.
17
+ * - **Every use but `schema`.** A `Telo.Type` slot names a shape; no runtime
18
+ * instance is constructed, so there is nothing to order against.
19
+ * - **No edge into the source's own scope.** A scoped resource is created when
20
+ * the scope opens, not at boot.
21
+ * - **Pairs, not parallel edges.** This is the one consumer for which two slots
22
+ * naming the same target genuinely mean the same thing, so it collapses the
23
+ * multigraph itself instead of the graph erasing the distinction for everyone.
16
24
  */
17
25
  export function buildDependencyGraph(resources, registry, aliases, aliasesByModule) {
18
- // --- Build node set + name index ---
26
+ const graph = buildCallGraph(resources, registry, { aliases, aliasesByModule });
19
27
  const nodes = new Map();
20
- // Sentinel lookup (`!ref <name>`) needs to resolve a bare name to its
21
- // declared kind. Names are unique within a manifest scope, so a flat
22
- // map suffices and lets the sentinel branch below avoid a full
23
- // O(N) scan of the node set on every reference.
24
- const nodesByName = new Map();
25
- for (const r of resources) {
26
- if (!r.metadata?.name || !r.kind || SYSTEM_KINDS.has(r.kind))
28
+ for (const node of graph.nodes.values()) {
29
+ if (node.type !== "resource")
27
30
  continue;
28
- const node = { kind: r.kind, name: r.metadata.name };
29
- nodes.set(nodeKey(node.kind, node.name), node);
30
- nodesByName.set(node.name, node);
31
+ const resource = node;
32
+ // A scope-declared resource is created when its scope opens, never at boot.
33
+ if (resource.scoped)
34
+ continue;
35
+ nodes.set(resource.id, { kind: resource.kind, name: resource.name });
36
+ }
37
+ const deps = projectToPairs(graph, {
38
+ keepUse: (use) => use.length === 0 || use.some((u) => u !== "schema"),
39
+ });
40
+ for (const edge of graph.edges) {
41
+ if (!edge.scoped || !edge.to)
42
+ continue;
43
+ deps.get(edge.from)?.delete(edge.to);
31
44
  }
32
- // --- Build adjacency: from → deps (from depends on dep) ---
33
- const deps = new Map();
34
45
  for (const key of nodes.keys())
35
- deps.set(key, new Set());
36
- // Names of resources declared inside the *current* resource's scope fields —
37
- // initialized on-demand at runtime, not at boot, so edges pointing to them
38
- // are excluded. Scoping is per-source-resource: an edge A → B is dropped only
39
- // when B is declared inside A's own scope (the visitor's ScopeBoundary fires
40
- // before that resource's RefSites, so this is set before any edge is added).
41
- let scopedNames = new Set();
42
- // Expanded map so refs nested behind x-telo-schema-from contribute edges to
43
- // the DAG. Without these, a parent (e.g. Http.Server) can init before its
44
- // extracted encoder and Phase 5 injection fires against a not-yet-created
45
- // dependency.
46
- visitManifest(resources, registry, {
47
- onScope: (e) => {
48
- scopedNames = e.enclosedNames;
49
- },
50
- onRef: (e) => {
51
- const sourceKey = nodeKey(e.source.kind, e.source.metadata.name);
52
- const val = e.value;
53
- // `!ref <name>` sentinel — look up the target's kind from the name
54
- // (resources are unique by name) so the edge carries the concrete kind,
55
- // matching the {kind, name} edge shape below.
56
- if (isRefSentinel(val)) {
57
- const refName = val.source;
58
- if (scopedNames.has(refName))
59
- return;
60
- const node = nodesByName.get(refName);
61
- if (node)
62
- deps.get(sourceKey).add(nodeKey(node.kind, node.name));
63
- return;
64
- }
65
- if (typeof val !== "object")
66
- return;
67
- const ref = val;
68
- if (!ref.kind || !ref.name)
69
- return;
70
- if (scopedNames.has(ref.name))
71
- return;
72
- const targetKey = nodeKey(ref.kind, ref.name);
73
- if (nodes.has(targetKey))
74
- deps.get(sourceKey).add(targetKey);
75
- },
76
- }, { aliases, aliasesByModule, skipKinds: SYSTEM_KINDS, expand: true });
46
+ if (!deps.has(key))
47
+ deps.set(key, new Set());
77
48
  // --- Kahn's topological sort ---
78
49
  // in-degree[X] = number of X's dependencies (size of deps[X])
79
50
  // reverse[dep] = set of nodes that depend on dep (for degree decrement)
@@ -1,5 +1,6 @@
1
1
  import type { ResourceManifest } from "@telorun/sdk";
2
2
  import type { LoadedGraph, LoadedModule } from "./loaded-types.js";
3
+ import type { ZoneModuleDocuments } from "./zone-module-documents.js";
3
4
  /** One parsed `exports.resources` / `exports.kinds` entry. `name` is the exported
4
5
  * instance name or kind suffix (the part after the dot, or the whole entry); `alias`
5
6
  * (when set) is this library's own import the entry RE-EXPORTS from. */
@@ -113,6 +114,13 @@ export declare function stampExportedKinds(imports: ReadonlyArray<{
113
114
  manifest: ResourceManifest;
114
115
  targetModule: string;
115
116
  }>, declaredKinds: ReadonlyMap<string, readonly string[]>): void;
117
+ /** Collect every imported library's FULL document set for the zone stage's
118
+ * per-library export derivation (`AnalysisOptions.moduleDocuments`) — the
119
+ * flat list above deliberately drops library internals, and the zone
120
+ * projection needs the internal dispatch chain to derive an export's open
121
+ * requirements. Only libraries that actually export instances are included:
122
+ * a library exporting nothing has no export contract to derive. */
123
+ export declare function collectZoneModuleDocuments(graph: LoadedGraph): ZoneModuleDocuments[];
116
124
  /** Project a LoadedModule (owner + partials) to a flat ResourceManifest[]
117
125
  * with `metadata.module` stamped on non-module docs. The kernel's runtime
118
126
  * entry load uses this to convert a `Loader.loadModule` result into the
@@ -1 +1 @@
1
- {"version":3,"file":"flatten-for-analyzer.d.ts","sourceRoot":"","sources":["../src/flatten-for-analyz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AAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,EAC5E,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC9C,IAAI,CAWN;AAED;;;;;;;;;;;;;;iGAciG;AACjG,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,aAAa,CAAC;IAAE,QAAQ,EAAE,gBAAgB,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,EAC5E,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,GACpD,IAAI,CAMN;AAgDD;;;;;oEAKoE;AACpE,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,WAAW,GAAG,mBAAmB,EAAE,CAuBpF;AAED;;;;;6BAK6B;AAC7B,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,YAAY,GAAG,gBAAgB,EAAE,CAEzE"}
@@ -338,6 +338,38 @@ function forwardReExports(graph, result) {
338
338
  stampReExportedKinds(imports, exportedKinds);
339
339
  stampExportedKinds(imports, declaredKinds);
340
340
  }
341
+ /** Collect every imported library's FULL document set for the zone stage's
342
+ * per-library export derivation (`AnalysisOptions.moduleDocuments`) — the
343
+ * flat list above deliberately drops library internals, and the zone
344
+ * projection needs the internal dispatch chain to derive an export's open
345
+ * requirements. Only libraries that actually export instances are included:
346
+ * a library exporting nothing has no export contract to derive. */
347
+ export function collectZoneModuleDocuments(graph) {
348
+ const out = [];
349
+ for (const [source, mod] of graph.modules) {
350
+ if (source === graph.rootSource)
351
+ continue;
352
+ const libDoc = mod.owner.manifests.find((m) => m && isModuleKind(m.kind));
353
+ const moduleName = libDoc?.metadata?.name;
354
+ if (!libDoc || !moduleName)
355
+ continue;
356
+ const exportedNames = [];
357
+ for (const entry of libDoc.exports?.resources ?? []) {
358
+ if (typeof entry !== "string")
359
+ continue;
360
+ exportedNames.push(parseExportEntry(entry).name);
361
+ }
362
+ if (exportedNames.length === 0)
363
+ continue;
364
+ out.push({
365
+ module: moduleName,
366
+ sourceId: mod.owner.source,
367
+ manifests: collectModuleManifests(mod),
368
+ exportedNames,
369
+ });
370
+ }
371
+ return out;
372
+ }
341
373
  /** Project a LoadedModule (owner + partials) to a flat ResourceManifest[]
342
374
  * with `metadata.module` stamped on non-module docs. The kernel's runtime
343
375
  * entry load uses this to convert a `Loader.loadModule` result into the
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export type { RefFieldInfo } from "./analysis-registry.js";
3
3
  export { StaticAnalyzer } from "./analyzer.js";
4
4
  export { importResolutionDiagnostics } from "./import-resolution-diagnostics.js";
5
5
  export type { GraphLoadError, ImportEdge, LoadedFile, LoadedGraph, LoadedModule, ParseError, } from "./loaded-types.js";
6
- export { flattenForAnalyzer, flattenLoadedModule, forwardReExportManifests, parseExportEntry, reExportSpecsFromExports, resolveExportedKinds, selectModuleManifestsForAnalysis, stampExportedKinds, stampReExportedKinds, type ParsedExportEntry, type ReExportSpec, } from "./flatten-for-analyzer.js";
6
+ export { collectZoneModuleDocuments, flattenForAnalyzer, flattenLoadedModule, forwardReExportManifests, parseExportEntry, reExportSpecsFromExports, resolveExportedKinds, selectModuleManifestsForAnalysis, stampExportedKinds, stampReExportedKinds, type ParsedExportEntry, type ReExportSpec, } from "./flatten-for-analyzer.js";
7
7
  export { buildEvalPaths, evalPathCovers } from "./eval-paths.js";
8
8
  export { BINDINGS_ANNOTATION, bindingContextProperties, bindingDependencies, findBindingSites, resolveBindingOrder, } from "./cel-bindings.js";
9
9
  export type { BindingSites } from "./cel-bindings.js";
@@ -17,8 +17,21 @@ export { defaultBearingPaths, PERMISSIVE_CONTRACT, resolveContract, resolveContr
17
17
  export type { ContractOrigin, ContractScope, ResolvedContract } from "./invocation-contract.js";
18
18
  export { hasIntermediateWildcard, parseRedactionPath, RedactionPathError, } from "./redaction-path.js";
19
19
  export type { RedactionSegment } from "./redaction-path.js";
20
+ export { buildCallGraph, projectToPairs, resourceId } from "./call-graph.js";
21
+ export type { BuildCallGraphOptions, CallGraph, CallGraphEdge, CallGraphNode, ResourceGraphNode, StepGraphNode, } from "./call-graph.js";
20
22
  export { buildReferenceFieldMap, isRefEntry, isScopeEntry } from "./reference-field-map.js";
21
23
  export type { ReferenceFieldMap, RefFieldEntry } from "./reference-field-map.js";
24
+ export { hasDeclaredUse, isRefSlot, isRefUse, possibleUses, readRefSlot, REF_USES, refSlotAnnotation, rewriteRefSlotKinds, transfersControl, } from "./ref-slot.js";
25
+ export type { RefSlot, RefUse, RefUseCases } from "./ref-slot.js";
26
+ export { hasProvidesZone, hasRequiresZone, readProvidesZone, readRequiresZone, rewriteRequiresZoneKind, } from "./zone-slot.js";
27
+ export type { ProvidesZoneSlot, RequiresZoneSlot } from "./zone-slot.js";
28
+ export { deriveLibraryExportRequirements, projectZoneRequirements, runZoneAnalysis, zoneDocumentsSignature, } from "./resolve-zone-requirements.js";
29
+ export type { ZoneExportCache, ZoneExportCacheEntry, ZoneExportRequirements, ZoneRequirementSpec, } from "./resolve-zone-requirements.js";
30
+ export type { ZoneModuleDocuments } from "./zone-module-documents.js";
31
+ export { validateZoneSlotDeclarations } from "./validate-zone-slots.js";
32
+ export type { ZoneSlotIssue } from "./validate-zone-slots.js";
33
+ export { validateDynamicSelectors, validateRefSlotDeclarations } from "./validate-ref-slots.js";
34
+ export type { RefSlotIssue } from "./validate-ref-slots.js";
22
35
  export { visitManifest } from "./manifest-visitor.js";
23
36
  export type { CelSiteEvent, ManifestVisitor, RefSiteEvent, ResourceEnterEvent, ResourceExitEvent, ScopeBoundaryEvent, SchemaFromSiteEvent, VisitOptions, } from "./manifest-visitor.js";
24
37
  export { Loader } from "./manifest-loader.js";
@@ -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;AAC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B,eAAe,EACf,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAIvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,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;AACxD,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC3E,YAAY,EACR,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,cAAc,EACd,QAAQ,EACR,aAAa,EACb,KAAK,EACR,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { AnalysisRegistry } from "./analysis-registry.js";
2
2
  export { StaticAnalyzer } from "./analyzer.js";
3
3
  export { importResolutionDiagnostics } from "./import-resolution-diagnostics.js";
4
- export { flattenForAnalyzer, flattenLoadedModule, forwardReExportManifests, parseExportEntry, reExportSpecsFromExports, resolveExportedKinds, selectModuleManifestsForAnalysis, stampExportedKinds, stampReExportedKinds, } from "./flatten-for-analyzer.js";
4
+ export { collectZoneModuleDocuments, flattenForAnalyzer, flattenLoadedModule, forwardReExportManifests, parseExportEntry, reExportSpecsFromExports, resolveExportedKinds, selectModuleManifestsForAnalysis, stampExportedKinds, stampReExportedKinds, } from "./flatten-for-analyzer.js";
5
5
  export { buildEvalPaths, evalPathCovers } from "./eval-paths.js";
6
6
  export { BINDINGS_ANNOTATION, bindingContextProperties, bindingDependencies, findBindingSites, resolveBindingOrder, } from "./cel-bindings.js";
7
7
  export { applyObservedStateNode, buildObservedStateIndex, buildObservedStateResourcesSchema, collectRunReachableNames, observedStateRead, validateObservedStateDeclarations, OBSERVED_STATE_SCHEMA, } from "./validate-observed-state.js";
@@ -9,7 +9,13 @@ export { moduleScopedDefResolver, scopeResolverForModule } from "./alias-resolve
9
9
  export { ancestorChain, contractDeclarer, controllerBearingAncestor, effectiveAuthorSchema, effectiveContractField, effectiveStatusSchema, hasOwnControllerOrTemplate, inheritedCapability, isInheritedDelegation, mappingFieldFor, needsContractMapping, resolveParent, } from "./extends-resolution.js";
10
10
  export { defaultBearingPaths, PERMISSIVE_CONTRACT, resolveContract, resolveContractSchema, withStreamPropertiesSkipped, } from "./invocation-contract.js";
11
11
  export { hasIntermediateWildcard, parseRedactionPath, RedactionPathError, } from "./redaction-path.js";
12
+ export { buildCallGraph, projectToPairs, resourceId } from "./call-graph.js";
12
13
  export { buildReferenceFieldMap, isRefEntry, isScopeEntry } from "./reference-field-map.js";
14
+ export { hasDeclaredUse, isRefSlot, isRefUse, possibleUses, readRefSlot, REF_USES, refSlotAnnotation, rewriteRefSlotKinds, transfersControl, } from "./ref-slot.js";
15
+ export { hasProvidesZone, hasRequiresZone, readProvidesZone, readRequiresZone, rewriteRequiresZoneKind, } from "./zone-slot.js";
16
+ export { deriveLibraryExportRequirements, projectZoneRequirements, runZoneAnalysis, zoneDocumentsSignature, } from "./resolve-zone-requirements.js";
17
+ export { validateZoneSlotDeclarations } from "./validate-zone-slots.js";
18
+ export { validateDynamicSelectors, validateRefSlotDeclarations } from "./validate-ref-slots.js";
13
19
  export { visitManifest } from "./manifest-visitor.js";
14
20
  export { Loader } from "./manifest-loader.js";
15
21
  export { isModuleKind, MODULE_KINDS } from "./module-kinds.js";
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Navigating a manifest value and a definition schema by path — the primitives
3
+ * the call graph and the zone projection both need.
4
+ *
5
+ * They live here rather than in either consumer because they encode *rules*,
6
+ * not conveniences: which object a JSON Pointer anchors at, and when a path
7
+ * refuses to resolve. Two copies of a rule drift, and the drift is invisible —
8
+ * a second `enclosingOf` that returned the resource root where the first
9
+ * returned `undefined` would silently anchor a correlation pointer at the wrong
10
+ * object rather than failing.
11
+ *
12
+ * Browser-safe: no Node built-ins.
13
+ */
14
+ /**
15
+ * The object ENCLOSING a concrete site — its path with the last segment
16
+ * dropped. `routes[2].handler` → the value at `routes[2]`.
17
+ *
18
+ * A slot that IS an array element (`targets[0]`) has no enclosing object: its
19
+ * siblings are other elements, and a pointer must not cross an array boundary —
20
+ * returning the root here would silently do exactly that. The bracket test runs
21
+ * BEFORE the no-dot early return, so a top-level array path refuses too.
22
+ */
23
+ export declare function enclosingOf(root: unknown, concretePath: string): unknown;
24
+ /** Navigate a concrete dotted path (`routes[2].handler`, `content.a/b.encoder`). */
25
+ export declare function navigateConcrete(root: unknown, path: string): unknown;
26
+ /** Resolve a local `#/$defs/<name>` ref against the root schema; any other
27
+ * schema (including one with no `$ref`) is returned unchanged. */
28
+ export declare function resolveLocalRef(schema: Record<string, any> | undefined, root: Record<string, any>): Record<string, any> | undefined;
29
+ /** Property schemas of a possibly variant-bearing object schema — `properties`
30
+ * plus every `oneOf` / `anyOf` / `allOf` branch's. */
31
+ export declare function propertySchemas(schema: Record<string, any>): Array<[string, Record<string, any>]>;
32
+ //# sourceMappingURL=manifest-navigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-navigation.d.ts","sourceRoot":"","sources":["../src/manifest-navigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAMxE;AAED,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAoBrE;AAED;mEACmE;AACnE,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,EACvC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAQjC;AAED;uDACuD;AACvD,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC1B,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAiBtC"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Navigating a manifest value and a definition schema by path — the primitives
3
+ * the call graph and the zone projection both need.
4
+ *
5
+ * They live here rather than in either consumer because they encode *rules*,
6
+ * not conveniences: which object a JSON Pointer anchors at, and when a path
7
+ * refuses to resolve. Two copies of a rule drift, and the drift is invisible —
8
+ * a second `enclosingOf` that returned the resource root where the first
9
+ * returned `undefined` would silently anchor a correlation pointer at the wrong
10
+ * object rather than failing.
11
+ *
12
+ * Browser-safe: no Node built-ins.
13
+ */
14
+ /**
15
+ * The object ENCLOSING a concrete site — its path with the last segment
16
+ * dropped. `routes[2].handler` → the value at `routes[2]`.
17
+ *
18
+ * A slot that IS an array element (`targets[0]`) has no enclosing object: its
19
+ * siblings are other elements, and a pointer must not cross an array boundary —
20
+ * returning the root here would silently do exactly that. The bracket test runs
21
+ * BEFORE the no-dot early return, so a top-level array path refuses too.
22
+ */
23
+ export function enclosingOf(root, concretePath) {
24
+ const lastDot = concretePath.lastIndexOf(".");
25
+ const lastSegment = concretePath.slice(lastDot + 1);
26
+ if (lastSegment.includes("["))
27
+ return undefined;
28
+ if (lastDot < 0)
29
+ return root;
30
+ return navigateConcrete(root, concretePath.slice(0, lastDot));
31
+ }
32
+ /** Navigate a concrete dotted path (`routes[2].handler`, `content.a/b.encoder`). */
33
+ export function navigateConcrete(root, path) {
34
+ let current = root;
35
+ for (const rawSegment of path.split(".")) {
36
+ if (current == null || typeof current !== "object")
37
+ return undefined;
38
+ let segment = rawSegment;
39
+ const indices = [];
40
+ const bracket = segment.indexOf("[");
41
+ if (bracket >= 0) {
42
+ for (const m of segment.slice(bracket).matchAll(/\[(\d+)\]/g)) {
43
+ indices.push(Number(m[1]));
44
+ }
45
+ segment = segment.slice(0, bracket);
46
+ }
47
+ if (segment)
48
+ current = current[segment];
49
+ for (const index of indices) {
50
+ if (!Array.isArray(current))
51
+ return undefined;
52
+ current = current[index];
53
+ }
54
+ }
55
+ return current;
56
+ }
57
+ /** Resolve a local `#/$defs/<name>` ref against the root schema; any other
58
+ * schema (including one with no `$ref`) is returned unchanged. */
59
+ export function resolveLocalRef(schema, root) {
60
+ if (!schema)
61
+ return undefined;
62
+ const ref = schema.$ref;
63
+ if (typeof ref === "string" && ref.startsWith("#/$defs/")) {
64
+ const resolved = root.$defs?.[ref.slice("#/$defs/".length)];
65
+ if (resolved && typeof resolved === "object")
66
+ return resolved;
67
+ }
68
+ return schema;
69
+ }
70
+ /** Property schemas of a possibly variant-bearing object schema — `properties`
71
+ * plus every `oneOf` / `anyOf` / `allOf` branch's. */
72
+ export function propertySchemas(schema) {
73
+ const out = [];
74
+ if (schema.properties && typeof schema.properties === "object") {
75
+ for (const [k, v] of Object.entries(schema.properties))
76
+ out.push([k, v]);
77
+ }
78
+ for (const key of ["oneOf", "anyOf", "allOf"]) {
79
+ const variants = schema[key];
80
+ if (!Array.isArray(variants))
81
+ continue;
82
+ for (const variant of variants) {
83
+ if (variant?.properties && typeof variant.properties === "object") {
84
+ for (const [k, v] of Object.entries(variant.properties)) {
85
+ out.push([k, v]);
86
+ }
87
+ }
88
+ }
89
+ }
90
+ return out;
91
+ }
@@ -3,7 +3,7 @@ import { isRefEntry, isSchemaFromEntry, isScopeEntry, resolveFieldEntries, } fro
3
3
  import { extractContextsFromSchema, pathMatchesScope } from "./validate-cel-context.js";
4
4
  /** Synthetic entry for a value-tree-discovered ref — these carry no declared
5
5
  * x-telo-ref constraint. */
6
- const NESTED_REF_ENTRY = { refs: [], isArray: false };
6
+ const NESTED_REF_ENTRY = { refs: [], uses: [], isArray: false };
7
7
  /** Scans a value tree for ref-shaped values, emitting each with its concrete
8
8
  * path. Recognizes `!ref <name>` sentinels and named `{kind, name}` reference
9
9
  * objects. Other tagged sentinels (`!cel`, `!literal`) and precompiled nodes
@@ -0,0 +1,125 @@
1
+ /**
2
+ * The single reader of the `x-telo-ref` annotation.
3
+ *
4
+ * A reference slot is *recognised* here and nowhere else. Four surfaces ask what
5
+ * a slot accepts — the analyzer's reference checks, the kernel's Phase-5
6
+ * injection, the GUI editor's reference picker, and `ide-support`'s completions
7
+ * / hover / go-to-definition — and before this module each recognised the
8
+ * annotation by pattern-matching its shape (`typeof node["x-telo-ref"] ===
9
+ * "string"`, plus a hand-rolled `anyOf` peel in three of them, and no peel at all
10
+ * in hover). That is why the shape could not change without silently turning
11
+ * every ref slot in the GUI into a free-text field.
12
+ *
13
+ * Browser-safe by construction: no Node built-ins, so the editor and
14
+ * `ide-support` import it directly and the kernel re-imports it rather than
15
+ * carrying a second reader — the split already used for the invocation-contract
16
+ * resolver, the eval-path matcher and the redaction path parser.
17
+ *
18
+ * Two annotation shapes are accepted during the migration:
19
+ *
20
+ * x-telo-ref: Telo.Invocable # bare string, no declared use
21
+ * x-telo-ref: # structured
22
+ * kind: [Telo.Invocable, Telo.Runnable]
23
+ * use: call
24
+ * inputs: /inputs
25
+ */
26
+ /** How control reaches a slot's target, relative to the declaring resource's own
27
+ * invocation. The one primitive fact every consumer derives its own semantics
28
+ * from — see `plans/typed-reference-graph.md`. */
29
+ export type RefUse =
30
+ /** Names a shape; no runtime instance exists. No edge of any kind. */
31
+ "schema"
32
+ /** Held and read; control never transfers. Init-order edge only. */
33
+ | "dependency"
34
+ /** Control transfers during my invocation and returns to me. */
35
+ | "call"
36
+ /** Control transfers during my invocation through the kernel's detach
37
+ * primitive; I do not await it. */
38
+ | "detached"
39
+ /** I register the target; control reaches it after my invocation, driven by a
40
+ * request or a timer, and the runtime guarantees a fresh ambient context. */
41
+ | "trigger.inbound"
42
+ /** I register the target; control reaches it when someone drains a value I
43
+ * returned, so no guarantee holds either way. */
44
+ | "trigger.consumer";
45
+ export declare const REF_USES: readonly RefUse[];
46
+ export declare function isRefUse(value: unknown): value is RefUse;
47
+ /** True for a use that transfers control to the target at some point. Everything
48
+ * but `schema` and `dependency`. */
49
+ export declare function transfersControl(use: RefUse): boolean;
50
+ /** A slot whose use is selected by a sibling config field. The selector must be
51
+ * statically resolvable — a literal or a schema default — because a call graph
52
+ * known only at runtime is not statically analyzable. */
53
+ export interface RefUseCases {
54
+ /** JSON Pointer relative to the object ENCLOSING the annotated slot: the
55
+ * resource root for a resource-level slot, the array item for a slot inside
56
+ * one. No pointer can reach across an array boundary. */
57
+ by: string;
58
+ /** Selector value (stringified as written in YAML) → the uses that hold. */
59
+ cases: Record<string, RefUse[]>;
60
+ }
61
+ /** A reference slot's declaration, normalized from every accepted shape. */
62
+ export interface RefSlot {
63
+ /** Accepted kinds, unioned across a `kind:` list and across `anyOf` branches.
64
+ * Canonical `<module>.<Kind>` keys once `resolveSchemaRefKinds` has run;
65
+ * alias-qualified as authored before that, or the legacy `<ns>/<mod>#<Kind>`
66
+ * identity form for an already-published module. */
67
+ kinds: string[];
68
+ /** The relations the declaring resource has with the target. A set, because a
69
+ * slot may dispatch its target more than one way within a single invocation
70
+ * (`Cache.View` calls inline on a miss and detached on a background
71
+ * revalidation). Empty when the slot declares no use — the bare-string form,
72
+ * or a slot that defers to {@link RefSlot.useCases}. */
73
+ uses: RefUse[];
74
+ /** Present when the use is chosen by configuration rather than fixed. */
75
+ useCases?: RefUseCases;
76
+ /** JSON Pointer (same anchoring as {@link RefUseCases.by}) naming the field
77
+ * that carries this call's arguments. Replaces
78
+ * `x-telo-topology-role: inputs`. */
79
+ inputs?: string;
80
+ /** `x-telo-inline: true` on the slot or any `anyOf` branch — accepts an inline
81
+ * `{kind, ...config}` definition, not only a `!ref`. */
82
+ inline: boolean;
83
+ }
84
+ /** Every use a slot can take, flattening a case map. The conservative reading
85
+ * for a consumer that does not resolve the selector. */
86
+ export declare function possibleUses(slot: RefSlot): RefUse[];
87
+ /** True when the slot states what the declaring resource does with the target.
88
+ * False only for the legacy bare-string form. */
89
+ export declare function hasDeclaredUse(slot: RefSlot): boolean;
90
+ /**
91
+ * Reads a schema node as a reference slot, or `undefined` when it declares none.
92
+ *
93
+ * Unions the accepted kinds across the `kind:` list and across `anyOf` branches,
94
+ * which is the model the analyzer has always had internally — `RefFieldEntry`
95
+ * has carried a flat `refs: string[]` since before the structured form existed.
96
+ * A `use` declared on more than one branch is taken once; a *disagreement*
97
+ * between branches is left visible in the returned set rather than silently
98
+ * resolved here, so `validate-ref-slots.ts` reports it against the authored
99
+ * node (`X_TELO_REF_USE_CONFLICT`) — the same split that keeps this reader
100
+ * lenient about unrecognized `use` tokens while that pass rejects them.
101
+ */
102
+ export declare function readRefSlot(node: Record<string, any> | undefined): RefSlot | undefined;
103
+ /** True when the node declares a reference slot in any accepted shape. The
104
+ * recognition test every surface used to spell for itself. */
105
+ export declare function isRefSlot(node: Record<string, any> | undefined): boolean;
106
+ /**
107
+ * Re-emits a slot as a canonical structured annotation value.
108
+ *
109
+ * For a consumer that has to *synthesize* a schema node and keep its reference
110
+ * slot intact — `ide-support` merges `anyOf` branches into one node for
111
+ * completion, and the merged node would otherwise carry no constraint at all,
112
+ * because the branches that held it are gone.
113
+ */
114
+ export declare function refSlotAnnotation(slot: RefSlot): Record<string, unknown>;
115
+ /**
116
+ * Rewrites every kind name an annotation declares, in place, in whichever shape
117
+ * it is written. `map` returns the replacement, or `undefined` to leave the name
118
+ * untouched (which is what keeps `resolveSchemaRefKinds` idempotent and lets it
119
+ * report an unresolvable constraint while quoting what the author wrote).
120
+ *
121
+ * Lives here rather than in the caller so that adding an annotation shape is a
122
+ * one-file change on the write side as well as the read side.
123
+ */
124
+ export declare function rewriteRefSlotKinds(annotationHolder: Record<string, any>, map: (kind: string) => string | undefined): void;
125
+ //# sourceMappingURL=ref-slot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ref-slot.d.ts","sourceRoot":"","sources":["../src/ref-slot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;mDAEmD;AACnD,MAAM,MAAM,MAAM;AAChB,sEAAsE;AACpE,QAAQ;AACV,oEAAoE;GAClE,YAAY;AACd,gEAAgE;GAC9D,MAAM;AACR;oCACoC;GAClC,UAAU;AACZ;8EAC8E;GAC5E,iBAAiB;AACnB;kDACkD;GAChD,kBAAkB,CAAC;AAEvB,eAAO,MAAM,QAAQ,EAAE,SAAS,MAAM,EAOrC,CAAC;AAEF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExD;AAED;qCACqC;AACrC,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;0DAE0D;AAC1D,MAAM,WAAW,WAAW;IAC1B;;8DAE0D;IAC1D,EAAE,EAAE,MAAM,CAAC;IACX,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACjC;AAED,4EAA4E;AAC5E,MAAM,WAAW,OAAO;IACtB;;;yDAGqD;IACrD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;;;6DAIyD;IACzD,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,yEAAyE;IACzE,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;0CAEsC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;6DACyD;IACzD,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;yDACyD;AACzD,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,G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