@telorun/analyzer 0.65.0 → 0.67.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/analyzer.d.ts +1 -1
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +194 -65
- package/dist/builtins.d.ts.map +1 -1
- package/dist/builtins.js +67 -16
- package/dist/call-graph.d.ts.map +1 -1
- package/dist/call-graph.js +7 -1
- package/dist/cel-environment.d.ts +12 -0
- package/dist/cel-environment.d.ts.map +1 -1
- package/dist/cel-environment.js +35 -19
- package/dist/cel-scope.d.ts +8 -0
- package/dist/cel-scope.d.ts.map +1 -1
- package/dist/cel-scope.js +89 -11
- package/dist/definition-registry.d.ts +41 -0
- package/dist/definition-registry.d.ts.map +1 -1
- package/dist/definition-registry.js +76 -0
- package/dist/dependency-graph.d.ts.map +1 -1
- package/dist/dependency-graph.js +65 -0
- package/dist/eval-paths.d.ts +68 -0
- package/dist/eval-paths.d.ts.map +1 -1
- package/dist/eval-paths.js +138 -0
- package/dist/flatten-for-analyzer.d.ts +37 -1
- package/dist/flatten-for-analyzer.d.ts.map +1 -1
- package/dist/flatten-for-analyzer.js +104 -5
- package/dist/import-resolution-diagnostics.d.ts +1 -1
- package/dist/import-resolution-diagnostics.js +1 -1
- package/dist/index.d.ts +12 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -6
- package/dist/inline-imports.d.ts.map +1 -1
- package/dist/inline-imports.js +1 -0
- package/dist/manifest-visitor.d.ts +4 -0
- package/dist/manifest-visitor.d.ts.map +1 -1
- package/dist/manifest-visitor.js +36 -1
- package/dist/migrations/entries/index.d.ts.map +1 -1
- package/dist/migrations/entries/index.js +2 -0
- package/dist/migrations/entries/schema-prepare-bucket.json +27 -0
- package/dist/peer-binding.d.ts +232 -0
- package/dist/peer-binding.d.ts.map +1 -0
- package/dist/peer-binding.js +418 -0
- package/dist/precompile.d.ts.map +1 -1
- package/dist/precompile.js +8 -0
- package/dist/ref-slot.d.ts +13 -0
- package/dist/ref-slot.d.ts.map +1 -1
- package/dist/ref-slot.js +26 -0
- package/dist/reference-field-map.d.ts +28 -0
- package/dist/reference-field-map.d.ts.map +1 -1
- package/dist/reference-field-map.js +25 -0
- package/dist/referrer-rule.d.ts +17 -0
- package/dist/referrer-rule.d.ts.map +1 -1
- package/dist/referrer-rule.js +4 -1
- package/dist/release/index.d.ts +1 -1
- package/dist/release/index.js +1 -1
- package/dist/resolve-ref-sentinels.d.ts.map +1 -1
- package/dist/resolve-ref-sentinels.js +14 -1
- package/dist/resource-input.d.ts +75 -0
- package/dist/resource-input.d.ts.map +1 -0
- package/dist/resource-input.js +90 -0
- package/dist/resource-rule.d.ts +40 -27
- package/dist/resource-rule.d.ts.map +1 -1
- package/dist/resource-rule.js +61 -7
- package/dist/rule-condition.d.ts +11 -0
- package/dist/rule-condition.d.ts.map +1 -1
- package/dist/rule-condition.js +13 -0
- package/dist/schema-projection.d.ts +119 -4
- package/dist/schema-projection.d.ts.map +1 -1
- package/dist/schema-projection.js +213 -18
- package/dist/system-kinds.d.ts +7 -2
- package/dist/system-kinds.d.ts.map +1 -1
- package/dist/system-kinds.js +7 -2
- package/dist/telo-version.d.ts +1 -1
- package/dist/telo-version.js +1 -1
- package/dist/template-body.d.ts +50 -0
- package/dist/template-body.d.ts.map +1 -0
- package/dist/template-body.js +58 -0
- package/dist/validate-cel-context.d.ts +1 -17
- package/dist/validate-cel-context.d.ts.map +1 -1
- package/dist/validate-cel-context.js +73 -78
- package/dist/validate-identifier-names.d.ts.map +1 -1
- package/dist/validate-identifier-names.js +17 -2
- package/dist/validate-reference-forms.d.ts +10 -0
- package/dist/validate-reference-forms.d.ts.map +1 -1
- package/dist/validate-reference-forms.js +23 -0
- package/dist/validate-references.d.ts +17 -0
- package/dist/validate-references.d.ts.map +1 -1
- package/dist/validate-references.js +77 -18
- package/dist/validate-referrer-rules.d.ts +38 -4
- package/dist/validate-referrer-rules.d.ts.map +1 -1
- package/dist/validate-referrer-rules.js +139 -31
- package/dist/validate-resource-inputs.d.ts +35 -0
- package/dist/validate-resource-inputs.d.ts.map +1 -0
- package/dist/validate-resource-inputs.js +319 -0
- package/dist/validate-resource-rules.d.ts +11 -2
- package/dist/validate-resource-rules.d.ts.map +1 -1
- package/dist/validate-resource-rules.js +18 -12
- package/dist/validate-schema-projection.d.ts.map +1 -1
- package/dist/validate-schema-projection.js +33 -2
- package/dist/validate-template-dispatch.d.ts +27 -0
- package/dist/validate-template-dispatch.d.ts.map +1 -0
- package/dist/validate-template-dispatch.js +95 -0
- package/dist/with-synthetic-positions.d.ts +1 -1
- package/dist/with-synthetic-positions.js +1 -1
- package/package.json +3 -3
- package/src/analyzer.ts +236 -70
- package/src/builtins.ts +69 -16
- package/src/call-graph.ts +7 -1
- package/src/cel-environment.ts +48 -19
- package/src/cel-scope.ts +113 -19
- package/src/definition-registry.ts +78 -0
- package/src/dependency-graph.ts +66 -0
- package/src/eval-paths.ts +152 -0
- package/src/flatten-for-analyzer.ts +117 -4
- package/src/import-resolution-diagnostics.ts +1 -1
- package/src/index.ts +57 -4
- package/src/inline-imports.ts +1 -0
- package/src/manifest-visitor.ts +41 -1
- package/src/migrations/entries/index.ts +2 -0
- package/src/migrations/entries/schema-prepare-bucket.json +27 -0
- package/src/peer-binding.ts +641 -0
- package/src/precompile.ts +8 -0
- package/src/ref-slot.ts +36 -0
- package/src/reference-field-map.ts +42 -0
- package/src/referrer-rule.ts +20 -1
- package/src/release/index.ts +1 -1
- package/src/resolve-ref-sentinels.ts +12 -1
- package/src/resource-input.ts +132 -0
- package/src/resource-rule.ts +69 -7
- package/src/rule-condition.ts +15 -0
- package/src/schema-projection.ts +302 -20
- package/src/system-kinds.ts +7 -2
- package/src/telo-version.ts +1 -1
- package/src/template-body.ts +104 -0
- package/src/validate-cel-context.ts +73 -78
- package/src/validate-identifier-names.ts +18 -3
- package/src/validate-reference-forms.ts +22 -0
- package/src/validate-references.ts +85 -16
- package/src/validate-referrer-rules.ts +215 -28
- package/src/validate-resource-inputs.ts +367 -0
- package/src/validate-resource-rules.ts +26 -12
- package/src/validate-schema-projection.ts +50 -1
- package/src/validate-template-dispatch.ts +99 -0
- package/src/with-synthetic-positions.ts +1 -1
package/dist/eval-paths.d.ts
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WHERE IS CEL EVALUATED — the one reader, and the one decision built on it.
|
|
3
|
+
*
|
|
4
|
+
* Two independent ways a value is evaluated, and every consumer needs both:
|
|
5
|
+
* `x-telo-eval` names a field directly, while a REGION annotation
|
|
6
|
+
* (`x-telo-context` / `x-telo-step-context` / `x-telo-error-context`, or a step
|
|
7
|
+
* body) covers everything beneath it — which is how `Run.Choice`'s rows and an
|
|
8
|
+
* `Http.Api` route's `returns:` entries hold expressions while declaring no
|
|
9
|
+
* annotation of their own.
|
|
10
|
+
*
|
|
11
|
+
* The consumers are on both sides of the runtime: `telo check` decides whether a
|
|
12
|
+
* `!cel` here is live (`CEL_IN_NON_EVAL_FIELD`) or resolved at startup
|
|
13
|
+
* (`OBSERVED_STATE_IN_STARTUP_FIELD`), the kernel decides what to expand, and
|
|
14
|
+
* the editor decides whether to offer an expression at all. The editor's answer
|
|
15
|
+
* is a CLAIM that `telo check` will accept what it writes, so a second
|
|
16
|
+
* implementation there is a promise nothing keeps — it read `x-telo-eval` alone
|
|
17
|
+
* and left every predicate inside a region as a bare checkbox, with no way to
|
|
18
|
+
* write the expression the field exists to hold.
|
|
19
|
+
*
|
|
20
|
+
* Browser-safe: no Node built-ins.
|
|
21
|
+
*/
|
|
1
22
|
/**
|
|
2
23
|
* The single containment rule for `x-telo-eval` paths, shared by every matcher so
|
|
3
24
|
* the analyzer's coverage decision and the kernel's expansion/exclusion can't
|
|
@@ -22,4 +43,51 @@ export declare function buildEvalPaths(schema: Record<string, any>): {
|
|
|
22
43
|
compile: string[];
|
|
23
44
|
runtime: string[];
|
|
24
45
|
};
|
|
46
|
+
/** True when this schema node declares a CEL-bearing region. Node-level, so a
|
|
47
|
+
* consumer holding one schema (an editor rendering one field) asks it directly
|
|
48
|
+
* rather than deriving scopes it would then have to match against. */
|
|
49
|
+
export declare function declaresCelRegion(schema: unknown): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Walk a JSON Schema tree and collect the JSONPath scopes of every field that
|
|
52
|
+
* declares a CEL-bearing region (`x-telo-context` / `x-telo-step-context` /
|
|
53
|
+
* `x-telo-error-context`). Used — alongside `x-telo-eval` paths — to decide
|
|
54
|
+
* whether a `!cel` expression sits in a slot the runtime actually evaluates.
|
|
55
|
+
* Scopes use the same `$.a.b[*]` form as `extractContextsFromSchema`, matched
|
|
56
|
+
* against expression paths with `pathMatchesScope`.
|
|
57
|
+
*/
|
|
58
|
+
export declare function extractCelRegionScopes(schema: Record<string, any>, path?: string): string[];
|
|
59
|
+
/**
|
|
60
|
+
* Returns true when a CEL expression path (from walkCelExpressions, e.g. "routes[0].inputs.q")
|
|
61
|
+
* falls within the scope of a context (e.g. "$.routes[*].inputs").
|
|
62
|
+
*
|
|
63
|
+
* The scope is matched directly (no sibling sharing): a context at "$.routes[*].inputs" only
|
|
64
|
+
* applies to expressions whose path starts with "routes[N].inputs", not to other sibling fields.
|
|
65
|
+
*/
|
|
66
|
+
export declare function pathMatchesScope(exprPath: string, scope: string): boolean;
|
|
67
|
+
/** Every place a schema says its values are evaluated: the `x-telo-eval` paths,
|
|
68
|
+
* by mode, plus the scopes of the regions that cover their contents. */
|
|
69
|
+
export interface CelEvalSites {
|
|
70
|
+
compile: readonly string[];
|
|
71
|
+
runtime: readonly string[];
|
|
72
|
+
regions: readonly string[];
|
|
73
|
+
}
|
|
74
|
+
export declare const NO_CEL_EVAL_SITES: CelEvalSites;
|
|
75
|
+
export declare function celEvalSites(schema: Record<string, any> | undefined): CelEvalSites;
|
|
76
|
+
/** The union of several schemas' sites — a kind's own and its capability
|
|
77
|
+
* abstract's, which is how a `Telo.Provider`'s implicit compile-eval reaches
|
|
78
|
+
* fields the provider never annotated. */
|
|
79
|
+
export declare function mergeCelEvalSites(...sites: CelEvalSites[]): CelEvalSites;
|
|
80
|
+
/**
|
|
81
|
+
* Whether the value at `path` is evaluated, and when — null for a field whose
|
|
82
|
+
* value is read as a literal.
|
|
83
|
+
*
|
|
84
|
+
* `compile` wins over `runtime`, and both win over a region: a field's own
|
|
85
|
+
* annotation is more specific than the region it sits in, which is the same
|
|
86
|
+
* precedence a nested annotation has over an enclosing one. A region resolves to
|
|
87
|
+
* `runtime` because that is what a region IS — a per-invocation scope naming
|
|
88
|
+
* what its expressions can read.
|
|
89
|
+
*
|
|
90
|
+
* `path` is the `walkCelExpressions` spelling (`routes[0].returns[1].when`).
|
|
91
|
+
*/
|
|
92
|
+
export declare function celEvalModeAt(sites: CelEvalSites, path: string): "compile" | "runtime" | null;
|
|
25
93
|
//# sourceMappingURL=eval-paths.d.ts.map
|
package/dist/eval-paths.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eval-paths.d.ts","sourceRoot":"","sources":["../src/eval-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAKxE;AAED;+BAC+B;AAC/B,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEtF;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IAC3D,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAcA"}
|
|
1
|
+
{"version":3,"file":"eval-paths.d.ts","sourceRoot":"","sources":["../src/eval-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH;;;;;;;;;;G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SAAS,GAAG,SAAS,GAAG,IAAI,CAK9B"}
|
package/dist/eval-paths.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WHERE IS CEL EVALUATED — the one reader, and the one decision built on it.
|
|
3
|
+
*
|
|
4
|
+
* Two independent ways a value is evaluated, and every consumer needs both:
|
|
5
|
+
* `x-telo-eval` names a field directly, while a REGION annotation
|
|
6
|
+
* (`x-telo-context` / `x-telo-step-context` / `x-telo-error-context`, or a step
|
|
7
|
+
* body) covers everything beneath it — which is how `Run.Choice`'s rows and an
|
|
8
|
+
* `Http.Api` route's `returns:` entries hold expressions while declaring no
|
|
9
|
+
* annotation of their own.
|
|
10
|
+
*
|
|
11
|
+
* The consumers are on both sides of the runtime: `telo check` decides whether a
|
|
12
|
+
* `!cel` here is live (`CEL_IN_NON_EVAL_FIELD`) or resolved at startup
|
|
13
|
+
* (`OBSERVED_STATE_IN_STARTUP_FIELD`), the kernel decides what to expand, and
|
|
14
|
+
* the editor decides whether to offer an expression at all. The editor's answer
|
|
15
|
+
* is a CLAIM that `telo check` will accept what it writes, so a second
|
|
16
|
+
* implementation there is a promise nothing keeps — it read `x-telo-eval` alone
|
|
17
|
+
* and left every predicate inside a region as a bare checkbox, with no way to
|
|
18
|
+
* write the expression the field exists to hold.
|
|
19
|
+
*
|
|
20
|
+
* Browser-safe: no Node built-ins.
|
|
21
|
+
*/
|
|
22
|
+
import { isStepSlot } from "./step-slot.js";
|
|
1
23
|
/**
|
|
2
24
|
* The single containment rule for `x-telo-eval` paths, shared by every matcher so
|
|
3
25
|
* the analyzer's coverage decision and the kernel's expansion/exclusion can't
|
|
@@ -53,3 +75,119 @@ function collectEvalPathsNode(node, path, compile, runtime) {
|
|
|
53
75
|
}
|
|
54
76
|
}
|
|
55
77
|
}
|
|
78
|
+
/** Schema keys that declare a CEL-bearing region: a field carrying any of these
|
|
79
|
+
* is evaluated at runtime, so a `!cel` inside it (or a descendant) is live. A
|
|
80
|
+
* STEP BODY is one too, and says so through the grammar its items point at
|
|
81
|
+
* rather than through a key — {@link isStepSlot} reads either spelling. */
|
|
82
|
+
const CEL_REGION_KEYS = [
|
|
83
|
+
"x-telo-context",
|
|
84
|
+
"x-telo-step-context",
|
|
85
|
+
"x-telo-error-context",
|
|
86
|
+
];
|
|
87
|
+
/** True when this schema node declares a CEL-bearing region. Node-level, so a
|
|
88
|
+
* consumer holding one schema (an editor rendering one field) asks it directly
|
|
89
|
+
* rather than deriving scopes it would then have to match against. */
|
|
90
|
+
export function declaresCelRegion(schema) {
|
|
91
|
+
if (!schema || typeof schema !== "object")
|
|
92
|
+
return false;
|
|
93
|
+
const node = schema;
|
|
94
|
+
return CEL_REGION_KEYS.some((key) => node[key] !== undefined) || isStepSlot(node);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Walk a JSON Schema tree and collect the JSONPath scopes of every field that
|
|
98
|
+
* declares a CEL-bearing region (`x-telo-context` / `x-telo-step-context` /
|
|
99
|
+
* `x-telo-error-context`). Used — alongside `x-telo-eval` paths — to decide
|
|
100
|
+
* whether a `!cel` expression sits in a slot the runtime actually evaluates.
|
|
101
|
+
* Scopes use the same `$.a.b[*]` form as `extractContextsFromSchema`, matched
|
|
102
|
+
* against expression paths with `pathMatchesScope`.
|
|
103
|
+
*/
|
|
104
|
+
export function extractCelRegionScopes(schema, path = "$") {
|
|
105
|
+
if (!schema || typeof schema !== "object")
|
|
106
|
+
return [];
|
|
107
|
+
const out = [];
|
|
108
|
+
if (declaresCelRegion(schema))
|
|
109
|
+
out.push(path);
|
|
110
|
+
if (schema.properties) {
|
|
111
|
+
for (const [key, value] of Object.entries(schema.properties)) {
|
|
112
|
+
out.push(...extractCelRegionScopes(value, `${path}.${key}`));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (schema.items && typeof schema.items === "object") {
|
|
116
|
+
out.push(...extractCelRegionScopes(schema.items, `${path}[*]`));
|
|
117
|
+
}
|
|
118
|
+
for (const key of ["oneOf", "anyOf", "allOf"]) {
|
|
119
|
+
if (Array.isArray(schema[key])) {
|
|
120
|
+
for (const subschema of schema[key])
|
|
121
|
+
out.push(...extractCelRegionScopes(subschema, path));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return out;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Returns true when a CEL expression path (from walkCelExpressions, e.g. "routes[0].inputs.q")
|
|
128
|
+
* falls within the scope of a context (e.g. "$.routes[*].inputs").
|
|
129
|
+
*
|
|
130
|
+
* The scope is matched directly (no sibling sharing): a context at "$.routes[*].inputs" only
|
|
131
|
+
* applies to expressions whose path starts with "routes[N].inputs", not to other sibling fields.
|
|
132
|
+
*/
|
|
133
|
+
export function pathMatchesScope(exprPath, scope) {
|
|
134
|
+
const stripped = scope.startsWith("$.") ? scope.slice(2) : scope;
|
|
135
|
+
if (!stripped)
|
|
136
|
+
return false;
|
|
137
|
+
// Split on wildcard array segments; each [*] must match a concrete [N] in exprPath
|
|
138
|
+
const parts = stripped.split("[*]");
|
|
139
|
+
let remaining = exprPath;
|
|
140
|
+
for (let i = 0; i < parts.length; i++) {
|
|
141
|
+
const part = parts[i];
|
|
142
|
+
if (!remaining.startsWith(part))
|
|
143
|
+
return false;
|
|
144
|
+
remaining = remaining.slice(part.length);
|
|
145
|
+
if (i < parts.length - 1) {
|
|
146
|
+
// Expect a concrete array index like [0], [12], ...
|
|
147
|
+
const m = remaining.match(/^\[\d+\]/);
|
|
148
|
+
if (!m)
|
|
149
|
+
return false;
|
|
150
|
+
remaining = remaining.slice(m[0].length);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// Expression must end here or continue into a child path
|
|
154
|
+
return remaining === "" || remaining[0] === "." || remaining[0] === "[";
|
|
155
|
+
}
|
|
156
|
+
export const NO_CEL_EVAL_SITES = { compile: [], runtime: [], regions: [] };
|
|
157
|
+
export function celEvalSites(schema) {
|
|
158
|
+
if (!schema)
|
|
159
|
+
return NO_CEL_EVAL_SITES;
|
|
160
|
+
const { compile, runtime } = buildEvalPaths(schema);
|
|
161
|
+
return { compile, runtime, regions: extractCelRegionScopes(schema) };
|
|
162
|
+
}
|
|
163
|
+
/** The union of several schemas' sites — a kind's own and its capability
|
|
164
|
+
* abstract's, which is how a `Telo.Provider`'s implicit compile-eval reaches
|
|
165
|
+
* fields the provider never annotated. */
|
|
166
|
+
export function mergeCelEvalSites(...sites) {
|
|
167
|
+
return {
|
|
168
|
+
compile: sites.flatMap((s) => s.compile),
|
|
169
|
+
runtime: sites.flatMap((s) => s.runtime),
|
|
170
|
+
regions: sites.flatMap((s) => s.regions),
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Whether the value at `path` is evaluated, and when — null for a field whose
|
|
175
|
+
* value is read as a literal.
|
|
176
|
+
*
|
|
177
|
+
* `compile` wins over `runtime`, and both win over a region: a field's own
|
|
178
|
+
* annotation is more specific than the region it sits in, which is the same
|
|
179
|
+
* precedence a nested annotation has over an enclosing one. A region resolves to
|
|
180
|
+
* `runtime` because that is what a region IS — a per-invocation scope naming
|
|
181
|
+
* what its expressions can read.
|
|
182
|
+
*
|
|
183
|
+
* `path` is the `walkCelExpressions` spelling (`routes[0].returns[1].when`).
|
|
184
|
+
*/
|
|
185
|
+
export function celEvalModeAt(sites, path) {
|
|
186
|
+
if (evalPathsCover(sites.compile, path))
|
|
187
|
+
return "compile";
|
|
188
|
+
if (evalPathsCover(sites.runtime, path))
|
|
189
|
+
return "runtime";
|
|
190
|
+
if (sites.regions.some((scope) => pathMatchesScope(path, scope)))
|
|
191
|
+
return "runtime";
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
@@ -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 ResourceInput } from "./resource-input.js";
|
|
3
4
|
import type { ZoneModuleDocuments } from "./zone-module-documents.js";
|
|
4
5
|
/** One parsed `exports.resources` / `exports.kinds` entry. `name` is the exported
|
|
5
6
|
* instance name or kind suffix (the part after the dot, or the whole entry); `alias`
|
|
@@ -15,7 +16,7 @@ export interface ParsedExportEntry {
|
|
|
15
16
|
* the empty prefix isn't a valid alias. */
|
|
16
17
|
export declare function parseExportEntry(entry: string): ParsedExportEntry;
|
|
17
18
|
/** The import-boundary forwarding rule, shared by `flattenForAnalyzer` (the
|
|
18
|
-
* CLI / kernel loader path) and
|
|
19
|
+
* CLI / kernel loader path) and telo studio's workspace projection so the
|
|
19
20
|
* two cannot drift. Given one module's stamped manifests and whether that
|
|
20
21
|
* module is the analysis entry (root), returns the manifests that cross into
|
|
21
22
|
* the consumer's flat analysis list:
|
|
@@ -137,6 +138,41 @@ export declare function stampExportedKinds(imports: ReadonlyArray<{
|
|
|
137
138
|
manifest: ResourceManifest;
|
|
138
139
|
targetModule: string;
|
|
139
140
|
}>, declaredKinds: ReadonlyMap<string, readonly string[]>): void;
|
|
141
|
+
/** Stamp `metadata.resolvedSource` — the canonical resolved URL of an import's
|
|
142
|
+
* target — onto every `Telo.Import`. It is the identity the kernel keys a
|
|
143
|
+
* singleton's registry on, so a check that has to decide whether two imports
|
|
144
|
+
* reach the SAME library has to key on it too: `resolvedModuleName` is the
|
|
145
|
+
* module's own name, which two versions of it share. */
|
|
146
|
+
export declare function stampResolvedSource(imports: ReadonlyArray<{
|
|
147
|
+
manifest: ResourceManifest;
|
|
148
|
+
targetSource: string;
|
|
149
|
+
}>): void;
|
|
150
|
+
/** Stamp `metadata.sharedLibrary` onto every `Telo.Import` whose target declares
|
|
151
|
+
* `lifecycle: shared`, so the consumer's pass can reject the per-import
|
|
152
|
+
* overrides a singleton has no room for. Stamped on `metadata` for the same
|
|
153
|
+
* reason `exportedKinds` is — the `Telo.Import` schema forbids extra top-level
|
|
154
|
+
* fields. */
|
|
155
|
+
export declare function stampSharedLifecycle(imports: ReadonlyArray<{
|
|
156
|
+
manifest: ResourceManifest;
|
|
157
|
+
targetModule: string;
|
|
158
|
+
}>, shared: ReadonlySet<string>): void;
|
|
159
|
+
/** Stamp `metadata.requiredResources` — the target library's declared
|
|
160
|
+
* `resources:` block, with each kind constraint CANONICALIZED in the library's
|
|
161
|
+
* own alias scope — onto every `Telo.Import` whose target declares one.
|
|
162
|
+
*
|
|
163
|
+
* Canonicalized here because this is the only point where the target's own
|
|
164
|
+
* import edges are in hand: the consumer's pass sees the flattened list, from
|
|
165
|
+
* which the library doc and its alias scope are both gone, so an entry written
|
|
166
|
+
* `Sql.Connection` would otherwise be read against whatever the CONSUMER
|
|
167
|
+
* happens to alias `Sql` to. Stamped on `metadata` for the same reason
|
|
168
|
+
* `exportedKinds` is — the `Telo.Import` schema forbids extra top-level
|
|
169
|
+
* fields. An entry whose alias resolves to nothing is stamped with its kind
|
|
170
|
+
* unchanged; `validate-resource-inputs.ts` reports that against the library
|
|
171
|
+
* that wrote it. */
|
|
172
|
+
export declare function stampRequiredResources(imports: ReadonlyArray<{
|
|
173
|
+
manifest: ResourceManifest;
|
|
174
|
+
targetModule: string;
|
|
175
|
+
}>, declared: ReadonlyMap<string, readonly ResourceInput[]>, aliasToModule: (module: string, alias: string) => string | undefined): void;
|
|
140
176
|
/** Collect every imported library's FULL document set for the zone stage's
|
|
141
177
|
* per-library export derivation (`AnalysisOptions.moduleDocuments`) — the
|
|
142
178
|
* flat list above deliberately drops library internals, and the zone
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatten-for-analyzer.d.ts","sourceRoot":"","sources":["../src/flatten-for-analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;yEAEyE;AACzE,MAAM,WAAW,iBAAiB;IAChC,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;;;;qBAYqB;AACrB,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,aAAa,CAAC;IAAE,QAAQ,EAAE,gBAAgB,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,EAC5E,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC,EACvD,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GACnE,IAAI,CAeN;AAoBD;;;;;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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isModuleKind } from "./module-kinds.js";
|
|
2
|
+
import { injectedDeclarations, readLibraryLifecycle, readResourceInputs, } from "./resource-input.js";
|
|
2
3
|
/** Parse a single dotted export entry: `Alias.Name` → `{name: "Name", alias: "Alias"}`,
|
|
3
4
|
* bare `Name` → `{name: "Name"}`. The single grammar for `exports.resources` and
|
|
4
5
|
* `exports.kinds`, shared by the kernel's import controller and the analyzer/editor so
|
|
@@ -9,7 +10,7 @@ export function parseExportEntry(entry) {
|
|
|
9
10
|
return dot > 0 ? { name: entry.slice(dot + 1), alias: entry.slice(0, dot) } : { name: entry };
|
|
10
11
|
}
|
|
11
12
|
/** The import-boundary forwarding rule, shared by `flattenForAnalyzer` (the
|
|
12
|
-
* CLI / kernel loader path) and
|
|
13
|
+
* CLI / kernel loader path) and telo studio's workspace projection so the
|
|
13
14
|
* two cannot drift. Given one module's stamped manifests and whether that
|
|
14
15
|
* module is the analysis entry (root), returns the manifests that cross into
|
|
15
16
|
* the consumer's flat analysis list:
|
|
@@ -354,6 +355,12 @@ function forwardReExports(graph, result) {
|
|
|
354
355
|
// the kernel parses them. A module that declares none is absent, leaving importers ungated
|
|
355
356
|
// (see stampExportedKinds).
|
|
356
357
|
const declaredKinds = new Map();
|
|
358
|
+
/** Each library's declared `resources:` block, by module name — the inward
|
|
359
|
+
* half, stamped onto its importers below. */
|
|
360
|
+
const requiredResources = new Map();
|
|
361
|
+
/** Libraries declaring `lifecycle: shared` — a singleton every import
|
|
362
|
+
* resolves to, so a per-import override of it is a contradiction. */
|
|
363
|
+
const sharedModules = new Set();
|
|
357
364
|
for (const [source, mod] of graph.modules) {
|
|
358
365
|
if (source === graph.rootSource)
|
|
359
366
|
continue; // root is an Application — no exports
|
|
@@ -364,6 +371,11 @@ function forwardReExports(graph, result) {
|
|
|
364
371
|
ownerSourceOf.set(moduleName, mod.owner.source);
|
|
365
372
|
specs.push(...reExportSpecsFromExports(moduleName, libDoc.exports?.resources));
|
|
366
373
|
kindModules.push({ module: moduleName, exportsKinds: libDoc.exports?.kinds });
|
|
374
|
+
const inputs = readResourceInputs(libDoc);
|
|
375
|
+
if (inputs.length > 0)
|
|
376
|
+
requiredResources.set(moduleName, inputs);
|
|
377
|
+
if (readLibraryLifecycle(libDoc) === "shared")
|
|
378
|
+
sharedModules.add(moduleName);
|
|
367
379
|
if (libDoc.exports?.kinds !== undefined) {
|
|
368
380
|
declaredKinds.set(moduleName, libDoc.exports.kinds.map((e) => parseExportEntry(e).name));
|
|
369
381
|
}
|
|
@@ -379,17 +391,91 @@ function forwardReExports(graph, result) {
|
|
|
379
391
|
// Telo.Import manifests so the analyzer can register the re-export mappings.
|
|
380
392
|
const exportedKinds = resolveExportedKinds(kindModules, aliasToModule);
|
|
381
393
|
const imports = [];
|
|
394
|
+
const sources = [];
|
|
382
395
|
for (const m of result) {
|
|
383
396
|
if (m.kind !== "Telo.Import")
|
|
384
397
|
continue;
|
|
385
398
|
const owner = m.metadata?.source;
|
|
386
399
|
const alias = m.metadata?.name;
|
|
387
|
-
const
|
|
388
|
-
if (
|
|
389
|
-
imports.push({ manifest: m, targetModule:
|
|
400
|
+
const edge = owner && alias ? graph.importEdges.get(owner)?.get(alias) : undefined;
|
|
401
|
+
if (edge?.targetModuleName)
|
|
402
|
+
imports.push({ manifest: m, targetModule: edge.targetModuleName });
|
|
403
|
+
if (edge?.targetSource)
|
|
404
|
+
sources.push({ manifest: m, targetSource: edge.targetSource });
|
|
390
405
|
}
|
|
406
|
+
stampResolvedSource(sources);
|
|
391
407
|
stampReExportedKinds(imports, exportedKinds);
|
|
392
408
|
stampExportedKinds(imports, declaredKinds);
|
|
409
|
+
stampRequiredResources(imports, requiredResources, aliasToModule);
|
|
410
|
+
stampSharedLifecycle(imports, sharedModules);
|
|
411
|
+
}
|
|
412
|
+
/** Stamp `metadata.resolvedSource` — the canonical resolved URL of an import's
|
|
413
|
+
* target — onto every `Telo.Import`. It is the identity the kernel keys a
|
|
414
|
+
* singleton's registry on, so a check that has to decide whether two imports
|
|
415
|
+
* reach the SAME library has to key on it too: `resolvedModuleName` is the
|
|
416
|
+
* module's own name, which two versions of it share. */
|
|
417
|
+
export function stampResolvedSource(imports) {
|
|
418
|
+
for (const { manifest, targetSource } of imports) {
|
|
419
|
+
manifest.metadata.resolvedSource = targetSource;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
/** Stamp `metadata.sharedLibrary` onto every `Telo.Import` whose target declares
|
|
423
|
+
* `lifecycle: shared`, so the consumer's pass can reject the per-import
|
|
424
|
+
* overrides a singleton has no room for. Stamped on `metadata` for the same
|
|
425
|
+
* reason `exportedKinds` is — the `Telo.Import` schema forbids extra top-level
|
|
426
|
+
* fields. */
|
|
427
|
+
export function stampSharedLifecycle(imports, shared) {
|
|
428
|
+
for (const { manifest, targetModule } of imports) {
|
|
429
|
+
if (!shared.has(targetModule))
|
|
430
|
+
continue;
|
|
431
|
+
manifest.metadata.sharedLibrary = true;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
/** Stamp `metadata.requiredResources` — the target library's declared
|
|
435
|
+
* `resources:` block, with each kind constraint CANONICALIZED in the library's
|
|
436
|
+
* own alias scope — onto every `Telo.Import` whose target declares one.
|
|
437
|
+
*
|
|
438
|
+
* Canonicalized here because this is the only point where the target's own
|
|
439
|
+
* import edges are in hand: the consumer's pass sees the flattened list, from
|
|
440
|
+
* which the library doc and its alias scope are both gone, so an entry written
|
|
441
|
+
* `Sql.Connection` would otherwise be read against whatever the CONSUMER
|
|
442
|
+
* happens to alias `Sql` to. Stamped on `metadata` for the same reason
|
|
443
|
+
* `exportedKinds` is — the `Telo.Import` schema forbids extra top-level
|
|
444
|
+
* fields. An entry whose alias resolves to nothing is stamped with its kind
|
|
445
|
+
* unchanged; `validate-resource-inputs.ts` reports that against the library
|
|
446
|
+
* that wrote it. */
|
|
447
|
+
export function stampRequiredResources(imports, declared, aliasToModule) {
|
|
448
|
+
for (const { manifest, targetModule } of imports) {
|
|
449
|
+
const inputs = declared.get(targetModule);
|
|
450
|
+
if (!inputs?.length)
|
|
451
|
+
continue;
|
|
452
|
+
// A plain name → canonical-kind MAP, deliberately not a list of
|
|
453
|
+
// `{name, kind}` objects: that shape is character-identical to a resolved
|
|
454
|
+
// `!ref`, and every reference walk in the analyzer recognises a reference by
|
|
455
|
+
// exactly those two keys — so the stamp would be read as a malformed
|
|
456
|
+
// reference sitting in `metadata`.
|
|
457
|
+
const table = {};
|
|
458
|
+
for (const input of inputs) {
|
|
459
|
+
table[input.name] = canonicalizeInputKind(input.kind, targetModule, aliasToModule);
|
|
460
|
+
}
|
|
461
|
+
manifest.metadata.requiredResources = table;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
/** `Alias.Kind` → `<owning module>.Kind` in the DECLARING library's scope.
|
|
465
|
+
* `Self.` names the library itself and `Telo.` the kernel built-ins, both of
|
|
466
|
+
* which cross no import edge. An unresolvable prefix is returned unchanged. */
|
|
467
|
+
function canonicalizeInputKind(kind, ownModule, aliasToModule) {
|
|
468
|
+
const dot = kind.indexOf(".");
|
|
469
|
+
if (dot <= 0)
|
|
470
|
+
return kind;
|
|
471
|
+
const alias = kind.slice(0, dot);
|
|
472
|
+
const suffix = kind.slice(dot + 1);
|
|
473
|
+
if (alias === "Self")
|
|
474
|
+
return `${ownModule}.${suffix}`;
|
|
475
|
+
if (alias === "Telo")
|
|
476
|
+
return kind;
|
|
477
|
+
const module = aliasToModule(ownModule, alias);
|
|
478
|
+
return module ? `${module}.${suffix}` : kind;
|
|
393
479
|
}
|
|
394
480
|
/** Collect every imported library's FULL document set for the zone stage's
|
|
395
481
|
* per-library export derivation (`AnalysisOptions.moduleDocuments`) — the
|
|
@@ -438,7 +524,20 @@ function collectModuleManifests(mod) {
|
|
|
438
524
|
for (const p of mod.partials) {
|
|
439
525
|
partials.push(...stampFile(p, ownerModuleName(mod.owner)));
|
|
440
526
|
}
|
|
441
|
-
|
|
527
|
+
const all = [...owner, ...partials];
|
|
528
|
+
// A library's `resources:` block declares the instances it requires from
|
|
529
|
+
// whoever imports it. Standing a kind-only declaration behind each entry is
|
|
530
|
+
// what makes `!ref connection` resolve and `resources.connection.<field>` type
|
|
531
|
+
// in the library's OWN pass — the only pass that sees its internals, since a
|
|
532
|
+
// consumer's flattened analysis drops the library doc. `selectModuleManifests-
|
|
533
|
+
// ForAnalysis` drops them again for a non-root module (they are not exported),
|
|
534
|
+
// and the kernel's import controller filters them out in favour of the
|
|
535
|
+
// borrowed instance itself.
|
|
536
|
+
const moduleDoc = all.find((m) => isModuleKind(m.kind));
|
|
537
|
+
if (moduleDoc) {
|
|
538
|
+
all.push(...injectedDeclarations(moduleDoc, moduleDoc.metadata?.name));
|
|
539
|
+
}
|
|
540
|
+
return all;
|
|
442
541
|
}
|
|
443
542
|
function ownerModuleName(file) {
|
|
444
543
|
for (const m of file.manifests) {
|
|
@@ -3,7 +3,7 @@ import { type AnalysisDiagnostic } from "./types.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Convert a graph's import failures (`graph.errors`) into structured, coded
|
|
5
5
|
* diagnostics. This is the single source of truth for surfacing a broken
|
|
6
|
-
* import — every host (CLI, VS Code, telo
|
|
6
|
+
* import — every host (CLI, VS Code, telo studio) routes these instead of each
|
|
7
7
|
* re-deriving the channel and drifting (the VS Code extension used to drop it
|
|
8
8
|
* entirely, showing nothing for a broken import).
|
|
9
9
|
*
|
|
@@ -38,7 +38,7 @@ function messageFor(e, code) {
|
|
|
38
38
|
/**
|
|
39
39
|
* Convert a graph's import failures (`graph.errors`) into structured, coded
|
|
40
40
|
* diagnostics. This is the single source of truth for surfacing a broken
|
|
41
|
-
* import — every host (CLI, VS Code, telo
|
|
41
|
+
* import — every host (CLI, VS Code, telo studio) routes these instead of each
|
|
42
42
|
* re-deriving the channel and drifting (the VS Code extension used to drop it
|
|
43
43
|
* entirely, showing nothing for a broken import).
|
|
44
44
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,11 @@ 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 { collectZoneModuleDocuments, flattenForAnalyzer, flattenLoadedModule, forwardReExportManifests, parseExportEntry, reExportSpecsFromExports, resolveExportedKinds, selectModuleManifestsForAnalysis, stampExportedKinds, stampReExportedKinds, type ParsedExportEntry, type ReExportSpec, } from "./flatten-for-analyzer.js";
|
|
7
|
-
export { buildEvalPaths, evalPathCovers } from "./eval-paths.js";
|
|
6
|
+
export { collectZoneModuleDocuments, flattenForAnalyzer, flattenLoadedModule, forwardReExportManifests, parseExportEntry, reExportSpecsFromExports, resolveExportedKinds, selectModuleManifestsForAnalysis, stampExportedKinds, stampReExportedKinds, stampRequiredResources, stampResolvedSource, stampSharedLifecycle, type ParsedExportEntry, type ReExportSpec, } from "./flatten-for-analyzer.js";
|
|
7
|
+
export { buildEvalPaths, celEvalModeAt, celEvalSites, declaresCelRegion, evalPathCovers, mergeCelEvalSites, pathMatchesScope, NO_CEL_EVAL_SITES, } from "./eval-paths.js";
|
|
8
|
+
export type { CelEvalSites } from "./eval-paths.js";
|
|
9
|
+
export { injectedDeclarations, isInjectedDeclaration, readLibraryLifecycle, readResourceInputs, readSuppliedResources, } from "./resource-input.js";
|
|
10
|
+
export type { LibraryLifecycle, ResourceInput } from "./resource-input.js";
|
|
8
11
|
export { BINDINGS_ANNOTATION, bindingContextProperties, bindingDependencies, findBindingSites, resolveBindingOrder, } from "./cel-bindings.js";
|
|
9
12
|
export type { BindingSites } from "./cel-bindings.js";
|
|
10
13
|
export { CEL_RESERVED_WORDS, TYPE_LEVEL_DOC_KINDS, checkName, } from "./identifier-name.js";
|
|
@@ -21,8 +24,8 @@ export { hasIntermediateWildcard, parseRedactionPath, RedactionPathError, } from
|
|
|
21
24
|
export type { RedactionSegment } from "./redaction-path.js";
|
|
22
25
|
export { buildCallGraph, projectToPairs, resourceId } from "./call-graph.js";
|
|
23
26
|
export type { BuildCallGraphOptions, CallGraph, CallGraphEdge, CallGraphNode, ResourceGraphNode, StepGraphNode, } from "./call-graph.js";
|
|
24
|
-
export { buildReferenceFieldMap, isRefEntry, isScopeEntry } from "./reference-field-map.js";
|
|
25
|
-
export type { ReferenceFieldMap, RefFieldEntry } from "./reference-field-map.js";
|
|
27
|
+
export { buildReferenceFieldMap, isRefEntry, isScopeEntry, satisfiesValueBranch, } from "./reference-field-map.js";
|
|
28
|
+
export type { ReferenceFieldMap, RefFieldEntry, ValueBranchValidator, } from "./reference-field-map.js";
|
|
26
29
|
export { hasDeclaredUse, isRefSlot, isRefUse, possibleUses, readRefSlot, REF_USES, refSlotAnnotation, rewriteRefSlotKinds, transfersControl, } from "./ref-slot.js";
|
|
27
30
|
export type { RefSlot, RefUse, RefUseCases } from "./ref-slot.js";
|
|
28
31
|
export { isStepSlot, readStepSlot, STEP_FRAGMENT } from "./step-slot.js";
|
|
@@ -45,12 +48,13 @@ export { deriveLibraryExportRequirements, projectZoneRequirements, runZoneAnalys
|
|
|
45
48
|
export type { ZoneExportCache, ZoneExportCacheEntry, ZoneExportRequirements, ZoneRequirementSpec, } from "./resolve-zone-requirements.js";
|
|
46
49
|
export type { ZoneModuleDocuments } from "./zone-module-documents.js";
|
|
47
50
|
export { validateZoneSlotDeclarations } from "./validate-zone-slots.js";
|
|
48
|
-
export { RESOURCE_RULES_ANNOTATION, readResourceRules, readRawResourceRules, resolveRuleSubjects, findDynamicLeaf, type ResourceRule, type ResourceRuleSeverity, type RuleSubject, } from "./resource-rule.js";
|
|
51
|
+
export { RESOURCE_RULES_ANNOTATION, readResourceRules, readRawResourceRules, resolveRuleSubjects, findDynamicLeaf, dynamicNode, type DynamicLeaf, type ResourceRule, type ResourceRuleSeverity, type RuleSubject, } from "./resource-rule.js";
|
|
49
52
|
export { validateResourceRuleDeclarations, evaluateResourceRules, ruleExercised, RESOURCE_RULE_BUDGET_MS, type ResourceRuleIssue, type ResourceRuleFinding, } from "./validate-resource-rules.js";
|
|
50
53
|
export { REFERRER_RULES_ANNOTATION, readReferrerRules, readRawReferrerRules, hasReferrerRules, rewriteReferrerRuleKinds, type ReferrerRule, } from "./referrer-rule.js";
|
|
51
|
-
export { validateReferrerRuleDeclarations, evaluateReferrerRules, referrerRuleExercised, reportReferrerRules, reportUnexercisedReferrerRule, type Referrer, type ReferrerRuleIssue, type ReferrerRuleFinding, type ReferrerRuleDiagnostic, } from "./validate-referrer-rules.js";
|
|
52
|
-
export {
|
|
53
|
-
export {
|
|
54
|
+
export { validateReferrerRuleDeclarations, evaluateReferrerRules, referrerRuleExercised, reportReferrerRules, reportUnexercisedReferrerRule, type Referrer, type ReferrerRuleIssue, type ReferrerRuleFinding, type ReferrerRuleDiagnostic, type ReferrerRuleContext, type ReferrerRuleDeclarationContext, } from "./validate-referrer-rules.js";
|
|
55
|
+
export { PeerBinder, analyzerPeerBinder, analyzerPeersTarget, entryBoundary, navigatePath, referenceValueOf, shapeMatches, type DeclarationLookup, type PeerAliasScope, type PeerBinderEnv, type PeerBinderRegistry, type PeerBinding, type PeerBindingFailure, type PeerBindingResult, type PeersTarget, } from "./peer-binding.js";
|
|
56
|
+
export { RULE_BUDGET_MS, UNTAGGED_CONDITION } from "./rule-condition.js";
|
|
57
|
+
export { readSchemaProjection, type ProjectionReference, readSchemaMap, schemaMapBranch, readProjectionFrom, readProjectionRef, manifestListScope, projectionKeyMap, projectEntries, resolveSchemaProjections, describeProjectionFailure, type SchemaProjection, type SchemaMap, type ProjectionRef, type ProjectionLookup, type ProjectionScope, type ProjectionFailure, } from "./schema-projection.js";
|
|
54
58
|
export { validateSchemaProjection, type SchemaProjectionIssue } from "./validate-schema-projection.js";
|
|
55
59
|
export { validateDurableRegions } from "./validate-durable-regions.js";
|
|
56
60
|
export { validateZoneViolations } from "./validate-zone-violations.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,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,YAAY,EACR,cAAc,EACd,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,UAAU,GACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACH,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,gCAAgC,EAChC,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,KAAK,YAAY,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceR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AE,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
|
@@ -1,8 +1,9 @@
|
|
|
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 { collectZoneModuleDocuments, flattenForAnalyzer, flattenLoadedModule, forwardReExportManifests, parseExportEntry, reExportSpecsFromExports, resolveExportedKinds, selectModuleManifestsForAnalysis, stampExportedKinds, stampReExportedKinds, } from "./flatten-for-analyzer.js";
|
|
5
|
-
export { buildEvalPaths, evalPathCovers } from "./eval-paths.js";
|
|
4
|
+
export { collectZoneModuleDocuments, flattenForAnalyzer, flattenLoadedModule, forwardReExportManifests, parseExportEntry, reExportSpecsFromExports, resolveExportedKinds, selectModuleManifestsForAnalysis, stampExportedKinds, stampReExportedKinds, stampRequiredResources, stampResolvedSource, stampSharedLifecycle, } from "./flatten-for-analyzer.js";
|
|
5
|
+
export { buildEvalPaths, celEvalModeAt, celEvalSites, declaresCelRegion, evalPathCovers, mergeCelEvalSites, pathMatchesScope, NO_CEL_EVAL_SITES, } from "./eval-paths.js";
|
|
6
|
+
export { injectedDeclarations, isInjectedDeclaration, readLibraryLifecycle, readResourceInputs, readSuppliedResources, } from "./resource-input.js";
|
|
6
7
|
export { BINDINGS_ANNOTATION, bindingContextProperties, bindingDependencies, findBindingSites, resolveBindingOrder, } from "./cel-bindings.js";
|
|
7
8
|
export { CEL_RESERVED_WORDS, TYPE_LEVEL_DOC_KINDS, checkName, } from "./identifier-name.js";
|
|
8
9
|
export { applyObservedStateNode, buildObservedStateIndex, buildObservedStateResourcesSchema, collectRunReachableNames, observedStateRead, validateObservedStateDeclarations, OBSERVED_STATE_SCHEMA, } from "./validate-observed-state.js";
|
|
@@ -11,7 +12,7 @@ export { ancestorChain, contractDeclarer, controllerBearingAncestor, effectiveAu
|
|
|
11
12
|
export { defaultBearingPaths, declaredScalarPaths, PERMISSIVE_CONTRACT, resolveContract, resolveContractSchema, withLiveValuesSkipped, } from "./invocation-contract.js";
|
|
12
13
|
export { hasIntermediateWildcard, parseRedactionPath, RedactionPathError, } from "./redaction-path.js";
|
|
13
14
|
export { buildCallGraph, projectToPairs, resourceId } from "./call-graph.js";
|
|
14
|
-
export { buildReferenceFieldMap, isRefEntry, isScopeEntry } from "./reference-field-map.js";
|
|
15
|
+
export { buildReferenceFieldMap, isRefEntry, isScopeEntry, satisfiesValueBranch, } from "./reference-field-map.js";
|
|
15
16
|
export { hasDeclaredUse, isRefSlot, isRefUse, possibleUses, readRefSlot, REF_USES, refSlotAnnotation, rewriteRefSlotKinds, transfersControl, } from "./ref-slot.js";
|
|
16
17
|
export { isStepSlot, readStepSlot, STEP_FRAGMENT } from "./step-slot.js";
|
|
17
18
|
export { ANNOTATION_KEYWORDS, registerTeloKeywords, valueTypeKeyword, } from "./value-type-keyword.js";
|
|
@@ -24,12 +25,13 @@ export { isUnsatisfiable, lowerBound, parseVersionRange, rangeAccepts, upperBoun
|
|
|
24
25
|
export { hasProvidesZone, hasRequiresZone, providedZoneAttributes, readProvidesZone, readRequiresZone, readViolatesZone, rewriteRequiresZoneKind, } from "./zone-slot.js";
|
|
25
26
|
export { deriveLibraryExportRequirements, projectZoneRequirements, runZoneAnalysis, zoneDocumentsSignature, } from "./resolve-zone-requirements.js";
|
|
26
27
|
export { validateZoneSlotDeclarations } from "./validate-zone-slots.js";
|
|
27
|
-
export { RESOURCE_RULES_ANNOTATION, readResourceRules, readRawResourceRules, resolveRuleSubjects, findDynamicLeaf, } from "./resource-rule.js";
|
|
28
|
+
export { RESOURCE_RULES_ANNOTATION, readResourceRules, readRawResourceRules, resolveRuleSubjects, findDynamicLeaf, dynamicNode, } from "./resource-rule.js";
|
|
28
29
|
export { validateResourceRuleDeclarations, evaluateResourceRules, ruleExercised, RESOURCE_RULE_BUDGET_MS, } from "./validate-resource-rules.js";
|
|
29
30
|
export { REFERRER_RULES_ANNOTATION, readReferrerRules, readRawReferrerRules, hasReferrerRules, rewriteReferrerRuleKinds, } from "./referrer-rule.js";
|
|
30
31
|
export { validateReferrerRuleDeclarations, evaluateReferrerRules, referrerRuleExercised, reportReferrerRules, reportUnexercisedReferrerRule, } from "./validate-referrer-rules.js";
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
32
|
+
export { PeerBinder, analyzerPeerBinder, analyzerPeersTarget, entryBoundary, navigatePath, referenceValueOf, shapeMatches, } from "./peer-binding.js";
|
|
33
|
+
export { RULE_BUDGET_MS, UNTAGGED_CONDITION } from "./rule-condition.js";
|
|
34
|
+
export { readSchemaProjection, readSchemaMap, schemaMapBranch, readProjectionFrom, readProjectionRef, manifestListScope, projectionKeyMap, projectEntries, resolveSchemaProjections, describeProjectionFailure, } from "./schema-projection.js";
|
|
33
35
|
export { validateSchemaProjection } from "./validate-schema-projection.js";
|
|
34
36
|
export { validateDurableRegions } from "./validate-durable-regions.js";
|
|
35
37
|
export { validateZoneViolations } from "./validate-zone-violations.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-imports.d.ts","sourceRoot":"","sources":["../src/inline-imports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG/D;;6CAE6C;AAC7C,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,gBAAgB,EAChC,cAAc,EAAE,gBAAgB,GAAG,SAAS,GAC3C,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"inline-imports.d.ts","sourceRoot":"","sources":["../src/inline-imports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG/D;;6CAE6C;AAC7C,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,gBAAgB,EAChC,cAAc,EAAE,gBAAgB,GAAG,SAAS,GAC3C,eAAe,EAAE,CAiCnB;AAED;;;;;;;iFAOiF;AACjF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAmB9D"}
|
package/dist/inline-imports.js
CHANGED
|
@@ -37,6 +37,7 @@ export function inlineImportManifests(moduleManifest, modulePosition) {
|
|
|
37
37
|
source,
|
|
38
38
|
...(entry.variables !== undefined ? { variables: entry.variables } : {}),
|
|
39
39
|
...(entry.secrets !== undefined ? { secrets: entry.secrets } : {}),
|
|
40
|
+
...(entry.resources !== undefined ? { resources: entry.resources } : {}),
|
|
40
41
|
...(entry.runtime !== undefined ? { runtime: entry.runtime } : {}),
|
|
41
42
|
...(entry.logging !== undefined ? { logging: entry.logging } : {}),
|
|
42
43
|
};
|