@telorun/templating 0.12.0 → 0.14.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 (55) hide show
  1. package/README.md +2 -2
  2. package/dist/builtins.d.ts +11 -0
  3. package/dist/builtins.d.ts.map +1 -1
  4. package/dist/builtins.js +16 -0
  5. package/dist/cel/analyze.d.ts +2 -1
  6. package/dist/cel/analyze.d.ts.map +1 -1
  7. package/dist/cel/analyze.js +4 -5
  8. package/dist/cel/catalog.d.ts.map +1 -1
  9. package/dist/cel/catalog.js +27 -0
  10. package/dist/cel/diagnose.d.ts +50 -0
  11. package/dist/cel/diagnose.d.ts.map +1 -0
  12. package/dist/cel/diagnose.js +223 -0
  13. package/dist/cel/environment.d.ts +7 -0
  14. package/dist/cel/environment.d.ts.map +1 -1
  15. package/dist/cel/environment.js +19 -5
  16. package/dist/cel/walk.d.ts +17 -1
  17. package/dist/cel/walk.d.ts.map +1 -1
  18. package/dist/cel/walk.js +21 -3
  19. package/dist/engine.d.ts +110 -3
  20. package/dist/engine.d.ts.map +1 -1
  21. package/dist/engines/cel.d.ts +13 -9
  22. package/dist/engines/cel.d.ts.map +1 -1
  23. package/dist/engines/cel.js +86 -28
  24. package/dist/engines/include.d.ts +28 -0
  25. package/dist/engines/include.d.ts.map +1 -0
  26. package/dist/engines/include.js +142 -0
  27. package/dist/engines/literal.js +1 -1
  28. package/dist/engines/ref.js +1 -1
  29. package/dist/engines/sql.d.ts.map +1 -1
  30. package/dist/engines/sql.js +32 -5
  31. package/dist/index.d.ts +8 -6
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +6 -4
  34. package/dist/manifest-schemas.d.ts +0 -16
  35. package/dist/manifest-schemas.d.ts.map +1 -1
  36. package/dist/manifest-schemas.js +0 -95
  37. package/dist/sentinel.d.ts +37 -0
  38. package/dist/sentinel.d.ts.map +1 -1
  39. package/dist/sentinel.js +54 -0
  40. package/package.json +2 -2
  41. package/src/builtins.ts +17 -0
  42. package/src/cel/analyze.ts +4 -7
  43. package/src/cel/catalog.ts +27 -0
  44. package/src/cel/diagnose.ts +293 -0
  45. package/src/cel/environment.ts +21 -5
  46. package/src/cel/walk.ts +37 -4
  47. package/src/engine.ts +116 -3
  48. package/src/engines/cel.ts +91 -31
  49. package/src/engines/include.ts +164 -0
  50. package/src/engines/literal.ts +1 -1
  51. package/src/engines/ref.ts +1 -1
  52. package/src/engines/sql.ts +41 -7
  53. package/src/index.ts +36 -5
  54. package/src/manifest-schemas.ts +0 -98
  55. package/src/sentinel.ts +62 -0
package/dist/engine.d.ts CHANGED
@@ -10,17 +10,90 @@ export interface CompileEnv {
10
10
  * the path-specific effective context (kernel globals merged in, x-telo-context
11
11
  * applied) and hands the engine a single closed schema. The engine validates
12
12
  * member-access chains against it. `null` means "open context" — no chain
13
- * validation possible. */
13
+ * validation possible.
14
+ *
15
+ * `celEnv` is the environment **typed for this path**, not the bare base one:
16
+ * the engine type-checks against it, so the caller must not check the same
17
+ * expression again against a different environment. One expression, one
18
+ * verdict. */
14
19
  export interface AnalyzeEnv {
15
20
  readonly celEnv: Environment;
16
21
  readonly contextSchema: Record<string, unknown> | null;
17
22
  }
23
+ /** A mechanically applicable repair for a diagnostic. `replacement` is the
24
+ * **whole analyzed source**, corrected — never a fragment — so a consumer can
25
+ * apply it by replacing the scalar node without knowing anything about the
26
+ * language inside it.
27
+ *
28
+ * There is deliberately no sub-range narrowing "what changed". Carrying one
29
+ * beside a whole-value replacement offers two readings of the same field, and
30
+ * the minimal-edit reading — splice `replacement` at `range` — produces
31
+ * garbage, since the two measure different strings. No consumer needed it, so
32
+ * the ambiguity bought nothing.
33
+ *
34
+ * Producers emit a fix only when the repair is decidable. A fix that might not
35
+ * compile is worse than none: the field exists so an IDE can apply it without
36
+ * asking, and an agent can take it without re-deriving it from prose. */
37
+ export interface DiagnosticFix {
38
+ readonly replacement: string;
39
+ }
18
40
  /** A single static-analysis finding produced by an engine. Stable codes match
19
41
  * the analyzer's existing diagnostic codes so downstream filtering keeps
20
42
  * working unchanged across the engine boundary. */
21
43
  export interface EngineDiagnostic {
22
44
  readonly message: string;
23
45
  readonly code?: string;
46
+ readonly fix?: DiagnosticFix;
47
+ }
48
+ /** One function call an engine found in the source it analyzed. Reported
49
+ * regardless of whether the call is valid: consumers apply policy the engine
50
+ * cannot know (an `x-telo-eval: compile` field rejecting a non-deterministic
51
+ * call), and policy that depends on manifest context does not belong in a
52
+ * templating engine. */
53
+ export interface CallSite {
54
+ readonly name: string;
55
+ /** How it was written — `f(x)` vs `x.f()`. */
56
+ readonly form: "global" | "receiver";
57
+ /** Argument count as written; excludes the receiver. */
58
+ readonly arity: number;
59
+ /** Offsets of the whole call within the analyzed source. */
60
+ readonly start: number;
61
+ readonly end: number;
62
+ /** Whether the resolved function re-evaluates per call. `undefined` when the
63
+ * name resolves to nothing, or to a function carrying no determinism
64
+ * metadata — absent is not "deterministic". */
65
+ readonly deterministic?: boolean;
66
+ }
67
+ /** What one `analyze` call establishes about one source. Everything derivable
68
+ * from the expression alone is derived here, once; everything that needs
69
+ * manifest context (the field's declared type, its eval mode, which verdict
70
+ * outranks which) is left to the caller, which is the only side that has it. */
71
+ export interface AnalyzeResult {
72
+ readonly diagnostics: readonly EngineDiagnostic[];
73
+ /** Type the engine's checker resolved, when it type-checks and succeeded. */
74
+ readonly type?: string;
75
+ /** Every function call in the source, in source order. */
76
+ readonly calls: readonly CallSite[];
77
+ }
78
+ /** One module-relative file a tagged node embeds, reported by the engine that
79
+ * owns the tag.
80
+ *
81
+ * `path` is relative to the module root — the directory holding `telo.yaml` —
82
+ * never to the file the tag was written in. That is the rule every other file
83
+ * reference in a manifest already follows (a controller's `path=` qualifier,
84
+ * `files:` / `assets:` patterns), and it is what makes a claim survive publish:
85
+ * publish deletes `include:` and inlines every partial as an extra document
86
+ * into the single published `telo.yaml`, so the declaring file does not exist
87
+ * in the artifact and a per-file-relative path would change meaning there.
88
+ *
89
+ * The path is ALL an engine reports. Which artifact layer the file belongs in
90
+ * is packaging's vocabulary, from a spec this package otherwise knows nothing
91
+ * about, and the analyzer already owns that assignment for controller
92
+ * candidates — so a new layer role stays a change to one package rather than
93
+ * two. An object rather than a bare string so a future hint (eager/lazy, say)
94
+ * costs no consumer a signature change. */
95
+ export interface EngineFileClaim {
96
+ readonly path: string;
24
97
  }
25
98
  /** Per-property templating engine. Matches a YAML tag (`!<name>`); the kernel
26
99
  * and analyzer dispatch through the registry rather than knowing about
@@ -41,7 +114,41 @@ export interface TemplatingEngine {
41
114
  * `literal` that resolve fully at compile time). */
42
115
  compile(source: string, env: CompileEnv): CompiledValue | unknown;
43
116
  /** Static analysis hook. Engines that can't statically check (e.g. `literal`)
44
- * return []. The walker accumulates diagnostics across all values. */
45
- analyze(source: string, env: AnalyzeEnv): readonly EngineDiagnostic[];
117
+ * return an empty result. The walker accumulates diagnostics across all
118
+ * values and applies its own policy to `calls` / `type`. */
119
+ analyze(source: string, env: AnalyzeEnv): AnalyzeResult;
120
+ /** Module-relative files this tagged node embeds, if any.
121
+ *
122
+ * The single seam through which payload membership is discovered: publish
123
+ * asks the registry what each tag claims rather than recognising tags by
124
+ * name, so a future tag that embeds files is a one-file change and no
125
+ * consumer downstream grows a second vocabulary for reading a manifest.
126
+ * This is the `ref-slot.ts` / `zone-slot.ts` precedent applied to tags.
127
+ *
128
+ * Optional, and absent on every engine that embeds nothing (`cel`, `ref`,
129
+ * `literal`, `sql`). Pure string work over the source — it must never read
130
+ * the filesystem, because the analyzer that calls it runs in the browser.
131
+ * A source the engine considers malformed claims nothing; `analyze` is what
132
+ * reports why. */
133
+ fileClaims?(source: string): readonly EngineFileClaim[];
134
+ /** The type this tag ALWAYS produces, as a JSON Schema fragment.
135
+ *
136
+ * Declared by the engine, never recognised by a consumer — the `fileClaims`
137
+ * precedent applied to the one fact it left behind. Before this, the analyzer
138
+ * hardcoded two tag names to hand an `!include-bytes` a byte placeholder and
139
+ * an `!include-text` a string one; the only place a tag's produced type was
140
+ * written down was in its consumer, so a future tag producing bytes had to be
141
+ * added to a set rather than declaring it.
142
+ *
143
+ * Absent for an engine whose produced type is a function of the SLOT rather
144
+ * than of the tag — `!cel`, whose type is only derivable from the expression,
145
+ * and `!ref`, which is an identity marker. Their values keep taking a
146
+ * slot-shaped placeholder.
147
+ *
148
+ * What falls out is the property this preserves exactly: because an embed's
149
+ * type is a constant of the tag, a byte embed at a string slot and text at a
150
+ * byte slot both fail statically, through the ordinary schema check and with
151
+ * no diagnostic code of their own. */
152
+ producedType?(): Record<string, unknown>;
46
153
  }
47
154
  //# sourceMappingURL=engine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;wEAEwE;AACxE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B;AAED;;;;2BAI2B;AAC3B,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CACxD;AAED;;oDAEoD;AACpD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;wBAEwB;AACxB,MAAM,WAAW,gBAAgB;IAC/B,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;2EAKuE;IACvE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE3B;;;yDAGqD;IACrD,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,aAAa,GAAG,OAAO,CAAC;IAElE;2EACuE;IACvE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,SAAS,gBAAgB,EAAE,CAAC;CACvE"}
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;wEAEwE;AACxE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B;AAED;;;;;;;;;eASe;AACf,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CACxD;AAED;;;;;;;;;;;;;0EAa0E;AAC1E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;oDAEoD;AACpD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC;CAC9B;AAED;;;;yBAIyB;AACzB,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,CAAC;IACrC,wDAAwD;IACxD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;oDAEgD;IAChD,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;;iFAGiF;AACjF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAClD,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;CACrC;AAED;;;;;;;;;;;;;;;;4CAgB4C;AAC5C,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;wBAEwB;AACxB,MAAM,WAAW,gBAAgB;IAC/B,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;2EAKuE;IACvE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE3B;;;yDAGqD;IACrD,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,aAAa,GAAG,OAAO,CAAC;IAElE;;iEAE6D;IAC7D,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,aAAa,CAAC;IAExD;;;;;;;;;;;;uBAYmB;IACnB,UAAU,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,eAAe,EAAE,CAAC;IAExD;;;;;;;;;;;;;;;;;2CAiBuC;IACvC,YAAY,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C"}
@@ -1,13 +1,17 @@
1
- import type { AnalyzeEnv, EngineDiagnostic, TemplatingEngine } from "../engine.js";
1
+ import type { AnalyzeEnv, AnalyzeResult, TemplatingEngine } from "../engine.js";
2
2
  /** Statically analyze one CEL expression against the effective context schema:
3
- * parse → extract member-access chains → validate each chain flag nullable
4
- * access. Single source of truth shared by the `!cel` engine (one expression)
5
- * and the `!sql` engine (one per `${{ }}` interpolation), so diagnostic wording
6
- * can't drift between them. */
7
- export declare function analyzeCelExpression(source: string, env: AnalyzeEnv): EngineDiagnostic[];
3
+ * parse → classify every calltype-check → validate member-access chains
4
+ * flag nullable access. Single source of truth shared by the `!cel` engine
5
+ * (one expression) and the `!sql` engine (one per `${{ }}` interpolation), so
6
+ * diagnostic wording can't drift between them.
7
+ *
8
+ * The type-check lives here, not in the analyzer, so one expression produces
9
+ * one verdict against one environment. Splitting them let an opaque
10
+ * "no matching overload" survive next to the diagnostic that actually
11
+ * explained it, and left `${{ }}` interpolations chain-validated but never
12
+ * type-checked at all. */
13
+ export declare function analyzeCelExpression(source: string, env: AnalyzeEnv): AnalyzeResult;
8
14
  /** The `!cel` engine. Treats the entire tagged scalar as a single CEL
9
- * expression — no `${{ }}` wrapping. Analysis runs the same chain validator
10
- * as the untagged path: parse → extract member-access chains → validate each
11
- * chain against the effective context schema. */
15
+ * expression — no `${{ }}` wrapping. */
12
16
  export declare const celEngine: TemplatingEngine;
13
17
  //# sourceMappingURL=cel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cel.d.ts","sourceRoot":"","sources":["../../src/engines/cel.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEnF;;;;gCAIgC;AAChC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,gBAAgB,EAAE,CAmCxF;AAED;;;kDAGkD;AAClD,eAAO,MAAM,SAAS,EAAE,gBAWvB,CAAC"}
1
+ {"version":3,"file":"cel.d.ts","sourceRoot":"","sources":["../../src/engines/cel.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAoB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAElG;;;;;;;;;;2BAU2B;AAC3B,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,aAAa,CAgFnF;AAYD;yCACyC;AACzC,eAAO,MAAM,SAAS,EAAE,gBAWvB,CAAC"}
@@ -1,10 +1,17 @@
1
1
  import { extractAccessChains, findNullableAccessIssues, validateChainAgainstSchema, } from "../cel/analyze.js";
2
2
  import { compileExpression } from "../cel/compile.js";
3
+ import { auditCalls, explainUnresolved } from "../cel/diagnose.js";
3
4
  /** Statically analyze one CEL expression against the effective context schema:
4
- * parse → extract member-access chains → validate each chain flag nullable
5
- * access. Single source of truth shared by the `!cel` engine (one expression)
6
- * and the `!sql` engine (one per `${{ }}` interpolation), so diagnostic wording
7
- * can't drift between them. */
5
+ * parse → classify every calltype-check → validate member-access chains
6
+ * flag nullable access. Single source of truth shared by the `!cel` engine
7
+ * (one expression) and the `!sql` engine (one per `${{ }}` interpolation), so
8
+ * diagnostic wording can't drift between them.
9
+ *
10
+ * The type-check lives here, not in the analyzer, so one expression produces
11
+ * one verdict against one environment. Splitting them let an opaque
12
+ * "no matching overload" survive next to the diagnostic that actually
13
+ * explained it, and left `${{ }}` interpolations chain-validated but never
14
+ * type-checked at all. */
8
15
  export function analyzeCelExpression(source, env) {
9
16
  const out = [];
10
17
  let parsed;
@@ -12,35 +19,86 @@ export function analyzeCelExpression(source, env) {
12
19
  parsed = env.celEnv.parse(source);
13
20
  }
14
21
  catch (e) {
15
- out.push({
16
- code: "CEL_SYNTAX_ERROR",
17
- message: e instanceof Error ? e.message : String(e),
18
- });
19
- return out;
22
+ return {
23
+ diagnostics: [{ code: "CEL_SYNTAX_ERROR", message: e instanceof Error ? e.message : String(e) }],
24
+ calls: [],
25
+ };
20
26
  }
21
- if (!env.contextSchema)
22
- return out;
23
- const chains = extractAccessChains(parsed.ast);
24
- for (const chain of chains) {
25
- const err = validateChainAgainstSchema(chain, env.contextSchema);
26
- if (err)
27
- out.push({ code: "CEL_UNKNOWN_FIELD", message: err });
27
+ const audit = auditCalls(source, parsed.ast, env.celEnv);
28
+ let type;
29
+ let checkError;
30
+ try {
31
+ const result = env.celEnv.check(source);
32
+ if (result.valid)
33
+ type = result.type;
34
+ else if (result.error) {
35
+ checkError = String(result.error.message ?? result.error)
36
+ .split("\n")[0]
37
+ .trim();
38
+ }
39
+ }
40
+ catch (e) {
41
+ // The checker is now the ONLY type verdict for every CEL expression, so a
42
+ // crash here silently retires static typing for that expression. Report it
43
+ // instead: degrading is acceptable, degrading invisibly is not.
44
+ return {
45
+ diagnostics: [
46
+ {
47
+ code: "CEL_TYPE_ERROR",
48
+ message: `the CEL type-checker failed on this expression: ${e instanceof Error ? e.message : String(e)}`,
49
+ },
50
+ ],
51
+ calls: audit.calls,
52
+ };
53
+ }
54
+ // The audit only ever EXPLAINS a rejection — it never overrules acceptance.
55
+ // Its classification is decided from the registry, so a call cel-js accepts
56
+ // but the registry cannot account for (a macro the parser expands and the
57
+ // registry never sees, which a cel-js upgrade can introduce at any time) must
58
+ // not become a hard error on valid CEL. Reporting nothing where cel-js is
59
+ // happy makes an unknown future macro a silent no-op rather than a manifest
60
+ // this analyzer refuses and the kernel would run fine.
61
+ if (checkError !== undefined) {
62
+ // `check()` stops at its first problem; the audit enumerates every bad call,
63
+ // which is the whole reason it exists as more than a message rewriter.
64
+ out.push(...audit.diagnostics);
65
+ if (audit.diagnostics.length === 0) {
66
+ out.push({
67
+ code: "CEL_TYPE_ERROR",
68
+ message: checkError + explainUnresolved(audit.unresolved, env.celEnv) + DYN_HINT(checkError),
69
+ });
70
+ }
28
71
  }
29
- for (const issue of findNullableAccessIssues(parsed.ast, env.contextSchema)) {
30
- // Index access (member "[index]") attaches without a dot; a named field
31
- // attaches with one so the suggested CEL stays valid either way.
32
- const access = issue.member === "[index]" ? issue.member : `.${issue.member}`;
33
- out.push({
34
- code: "CEL_NULLABLE_ACCESS",
35
- message: `'${issue.path}' may be null — guard it (e.g. '${issue.path} != null && …' or '${issue.path} == null ? … : ${issue.path}${access}') before accessing '${access}'`,
36
- });
72
+ if (env.contextSchema) {
73
+ const contextSchema = env.contextSchema;
74
+ for (const chain of extractAccessChains(parsed.ast)) {
75
+ const err = validateChainAgainstSchema(chain, contextSchema);
76
+ if (err)
77
+ out.push({ code: "CEL_UNKNOWN_FIELD", message: err });
78
+ }
79
+ for (const issue of findNullableAccessIssues(parsed.ast, contextSchema)) {
80
+ // Index access (member "[index]") attaches without a dot; a named field
81
+ // attaches with one — so the suggested CEL stays valid either way.
82
+ const access = issue.member === "[index]" ? issue.member : `.${issue.member}`;
83
+ out.push({
84
+ code: "CEL_NULLABLE_ACCESS",
85
+ message: `'${issue.path}' may be null — guard it (e.g. '${issue.path} != null && …' or '${issue.path} == null ? … : ${issue.path}${access}') before accessing '${access}'`,
86
+ });
87
+ }
37
88
  }
38
- return out;
89
+ return { diagnostics: out, calls: audit.calls, ...(type === undefined ? {} : { type }) };
39
90
  }
91
+ /** `dyn` in a checker message means an operand whose type is unknown here —
92
+ * almost always a step result whose invoked resource declares no
93
+ * `outputType:`. Without this, the reader takes `dyn` for a cast problem. */
94
+ const DYN_HINT = (message) =>
95
+ // Word-bounded: "dynamic" appears in unrelated checker messages, and the
96
+ // hint is wrong for those.
97
+ /\bdyn\b/.test(message)
98
+ ? " (`dyn` is a value with no static type here — declare `outputType:` on the resource producing it, or convert at the call site.)"
99
+ : "";
40
100
  /** The `!cel` engine. Treats the entire tagged scalar as a single CEL
41
- * expression — no `${{ }}` wrapping. Analysis runs the same chain validator
42
- * as the untagged path: parse → extract member-access chains → validate each
43
- * chain against the effective context schema. */
101
+ * expression — no `${{ }}` wrapping. */
44
102
  export const celEngine = {
45
103
  name: "cel",
46
104
  language: "cel",
@@ -0,0 +1,28 @@
1
+ import type { EngineDiagnostic, TemplatingEngine } from "../engine.js";
2
+ export interface NormalizedIncludePath {
3
+ /** Module-root-relative path with `./` and `.` segments folded out, `/`
4
+ * separated. Absent when the source is not a usable path. */
5
+ readonly path?: string;
6
+ readonly diagnostic?: EngineDiagnostic;
7
+ }
8
+ /**
9
+ * Normalize an `!include-*` source to a module-root-relative path, or explain
10
+ * why it is not one.
11
+ *
12
+ * Pure string work, deliberately: this runs in the analyzer, which must load in
13
+ * a browser, so confinement is decided from the written path alone and never by
14
+ * asking a filesystem where it lands. That is possible because the path is
15
+ * root-relative by definition — the module root is the one directory every path
16
+ * is measured from, so `..` below depth zero is an escape regardless of where
17
+ * the module happens to sit on disk.
18
+ */
19
+ export declare function normalizeIncludePath(source: string): NormalizedIncludePath;
20
+ /** Embeds a file's contents as a UTF-8 string. */
21
+ export declare const includeTextEngine: TemplatingEngine;
22
+ /** Embeds a file's contents as raw bytes — the shape every `Telo.Bytes` slot
23
+ * accepts. The name is written as a literal rather than imported from the SDK:
24
+ * templating is the lower package, and a produced type is a schema fragment,
25
+ * which is data. What checks it is the registry the analyzer and the kernel both
26
+ * read. */
27
+ export declare const includeBytesEngine: TemplatingEngine;
28
+ //# sourceMappingURL=include.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"include.d.ts","sourceRoot":"","sources":["../../src/engines/include.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAaxF,MAAM,WAAW,qBAAqB;IACpC;kEAC8D;IAC9D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACxC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,qBAAqB,CA0E1E;AA8CD,kDAAkD;AAClD,eAAO,MAAM,iBAAiB,EAAE,gBAE9B,CAAC;AAEH;;;;YAIY;AACZ,eAAO,MAAM,kBAAkB,EAAE,gBAE/B,CAAC"}
@@ -0,0 +1,142 @@
1
+ import { INCLUDE_BYTES_ENGINE, INCLUDE_TEXT_ENGINE, makeTaggedSentinel } from "../sentinel.js";
2
+ /** Characters that would make a path a pattern rather than a name. Globs are
3
+ * excluded deliberately: a claim has to name one file for publish to place it
4
+ * in a layer, and a pattern that matches nothing on the publishing machine
5
+ * would ship an artifact missing a file the manifest reads. */
6
+ const GLOB_CHARS = /[*?[\]{}]/;
7
+ /** `scheme:` prefix — a URL, or a Windows drive letter. Either way not a
8
+ * module-relative path. */
9
+ const URI_SCHEME = /^[a-z][a-z0-9+.-]*:/i;
10
+ /**
11
+ * Normalize an `!include-*` source to a module-root-relative path, or explain
12
+ * why it is not one.
13
+ *
14
+ * Pure string work, deliberately: this runs in the analyzer, which must load in
15
+ * a browser, so confinement is decided from the written path alone and never by
16
+ * asking a filesystem where it lands. That is possible because the path is
17
+ * root-relative by definition — the module root is the one directory every path
18
+ * is measured from, so `..` below depth zero is an escape regardless of where
19
+ * the module happens to sit on disk.
20
+ */
21
+ export function normalizeIncludePath(source) {
22
+ const raw = source.trim();
23
+ if (raw === "") {
24
+ return {
25
+ diagnostic: {
26
+ code: "INCLUDE_PATH_INVALID",
27
+ message: "the path is empty — name a file relative to the module root.",
28
+ },
29
+ };
30
+ }
31
+ if (URI_SCHEME.test(raw)) {
32
+ return {
33
+ diagnostic: {
34
+ code: "INCLUDE_PATH_INVALID",
35
+ message: `'${raw}' names a location outside the module. An include path is a file that ships ` +
36
+ `inside the module artifact, written relative to the module root. To read a file at ` +
37
+ `runtime from somewhere else, use Fs.File.`,
38
+ },
39
+ };
40
+ }
41
+ if (GLOB_CHARS.test(raw)) {
42
+ return {
43
+ diagnostic: {
44
+ code: "INCLUDE_PATH_INVALID",
45
+ message: `'${raw}' looks like a pattern. An include path names exactly one file, because ` +
46
+ `publish places each claimed file into a layer by name.`,
47
+ },
48
+ };
49
+ }
50
+ if (raw.startsWith("/") || raw.startsWith("\\")) {
51
+ return {
52
+ diagnostic: {
53
+ code: "INCLUDE_PATH_ESCAPES_MODULE",
54
+ message: `'${raw}' is an absolute path. An include path is written relative to the module ` +
55
+ `root, so the same manifest resolves identically from a checkout and from a ` +
56
+ `published artifact.`,
57
+ },
58
+ };
59
+ }
60
+ const out = [];
61
+ for (const segment of raw.split(/[/\\]+/)) {
62
+ if (segment === "" || segment === ".")
63
+ continue;
64
+ if (segment !== "..") {
65
+ out.push(segment);
66
+ continue;
67
+ }
68
+ // Depth zero is the module root. Popping past it would read a file the
69
+ // artifact cannot contain, so it is an escape rather than a path to
70
+ // normalize — and catching it here is what keeps the check static.
71
+ if (out.length === 0) {
72
+ return {
73
+ diagnostic: {
74
+ code: "INCLUDE_PATH_ESCAPES_MODULE",
75
+ message: `'${raw}' points above the module root. An include path may only name a file ` +
76
+ `inside the module, since that is the only thing its artifact can carry.`,
77
+ },
78
+ };
79
+ }
80
+ out.pop();
81
+ }
82
+ if (out.length === 0) {
83
+ return {
84
+ diagnostic: {
85
+ code: "INCLUDE_PATH_INVALID",
86
+ message: `'${raw}' resolves to the module root, not to a file.`,
87
+ },
88
+ };
89
+ }
90
+ return { path: out.join("/") };
91
+ }
92
+ /**
93
+ * The `!include-text` / `!include-bytes` engines — a file that ships inside the
94
+ * module artifact, embedded as a manifest value.
95
+ *
96
+ * `compile` returns the sentinel unchanged rather than a value. Two things
97
+ * follow, and both are the point. The read is deferred to resource creation, so
98
+ * loading a manifest does not pull payload layers — the artifact spec makes
99
+ * `telo.yaml` its own layer precisely so that reading a manifest cannot drag the
100
+ * whole artifact in, and an app loads every imported library's manifest. And
101
+ * because the marker survives precompile the way a `!ref` does, the analyzer can
102
+ * type the slot without opening the file, which is what keeps it browser-safe.
103
+ * Unlike `!ref`, no special case is needed in `precompileDoc`: an engine whose
104
+ * `compile` is identity on its own marker passes through the generic path.
105
+ *
106
+ * `analyze` reports why a path is unusable; `fileClaims` reports the path itself
107
+ * so publish can place the file in a layer without recognising the tag by name.
108
+ */
109
+ function includeEngine(name, produced) {
110
+ return {
111
+ name,
112
+ compile(source) {
113
+ return makeTaggedSentinel(name, source);
114
+ },
115
+ producedType() {
116
+ return produced;
117
+ },
118
+ analyze(source) {
119
+ const { diagnostic } = normalizeIncludePath(source);
120
+ return { diagnostics: diagnostic ? [diagnostic] : [], calls: [] };
121
+ },
122
+ fileClaims(source) {
123
+ const { path } = normalizeIncludePath(source);
124
+ // A malformed path claims nothing. `analyze` is what says why, so
125
+ // claiming a half-understood path here would produce a second, worse
126
+ // report from publish about the same mistake.
127
+ return path ? [{ path }] : [];
128
+ },
129
+ };
130
+ }
131
+ /** Embeds a file's contents as a UTF-8 string. */
132
+ export const includeTextEngine = includeEngine(INCLUDE_TEXT_ENGINE, {
133
+ type: "string",
134
+ });
135
+ /** Embeds a file's contents as raw bytes — the shape every `Telo.Bytes` slot
136
+ * accepts. The name is written as a literal rather than imported from the SDK:
137
+ * templating is the lower package, and a produced type is a schema fragment,
138
+ * which is data. What checks it is the registry the analyzer and the kernel both
139
+ * read. */
140
+ export const includeBytesEngine = includeEngine(INCLUDE_BYTES_ENGINE, {
141
+ "x-telo-type": "Telo.Bytes",
142
+ });
@@ -7,6 +7,6 @@ export const literalEngine = {
7
7
  return source;
8
8
  },
9
9
  analyze() {
10
- return [];
10
+ return { diagnostics: [], calls: [] };
11
11
  },
12
12
  };
@@ -13,6 +13,6 @@ export const refEngine = {
13
13
  return source;
14
14
  },
15
15
  analyze() {
16
- return [];
16
+ return { diagnostics: [], calls: [] };
17
17
  },
18
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sql.d.ts","sourceRoot":"","sources":["../../src/engines/sql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAsB,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,CAAC;AAErD;;;;;kFAKkF;AAClF,eAAO,MAAM,SAAS,EAAE,gBAqBvB,CAAC"}
1
+ {"version":3,"file":"sql.d.ts","sourceRoot":"","sources":["../../src/engines/sql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAsB,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG7F,OAAO,KAAK,EAIV,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,CAAC;AAErD;;;;;kFAKkF;AAClF,eAAO,MAAM,SAAS,EAAE,gBAqCvB,CAAC"}
@@ -25,14 +25,41 @@ export const sqlEngine = {
25
25
  analyze(source, env) {
26
26
  // Each `${{ }}` interpolation is its own CEL expression; reuse the shared
27
27
  // per-expression analyzer so diagnostics match the `!cel` engine exactly.
28
- return expressionsOf(source).flatMap((expr) => analyzeCelExpression(expr, env));
28
+ // Each interpolation's offset is kept so a fix computed against the bare
29
+ // expression is re-anchored to the whole SQL scalar — the only thing that
30
+ // ever made `!sql` fix-less was dropping it here.
31
+ const diagnostics = [];
32
+ const calls = [];
33
+ for (const { expr, start } of expressionsOf(source)) {
34
+ const result = analyzeCelExpression(expr, env);
35
+ for (const d of result.diagnostics) {
36
+ diagnostics.push(d.fix ? { ...d, fix: reanchor(source, expr, start, d.fix) } : d);
37
+ }
38
+ for (const c of result.calls) {
39
+ calls.push({ ...c, start: start + c.start, end: start + c.end });
40
+ }
41
+ }
42
+ // No `type`: a SQL template is a string built from many expressions, so
43
+ // there is no single checked type to report.
44
+ return { diagnostics, calls };
29
45
  },
30
46
  };
31
- /** Extract each `${{ expr }}` body from a `!sql` template source. */
47
+ /** Re-anchor a fix computed against one interpolation onto the full source. */
48
+ function reanchor(source, expr, start, fix) {
49
+ return {
50
+ replacement: source.slice(0, start) + fix.replacement + source.slice(start + expr.length),
51
+ };
52
+ }
53
+ /** Each `${{ expr }}` body in a `!sql` template, with the body's offset in the
54
+ * source. The offset is derived from the opening delimiter and the leading
55
+ * whitespace the capture group already trims, never by searching for the
56
+ * body text — which a body appearing twice would defeat. */
32
57
  function expressionsOf(source) {
33
- const exprs = [];
58
+ const out = [];
34
59
  for (const m of source.matchAll(TEMPLATE_REGEX)) {
35
- exprs.push(m[1].trim());
60
+ const lead = /^\s*/.exec(m[0].slice(OPEN.length))[0].length;
61
+ out.push({ expr: m[1], start: m.index + OPEN.length + lead });
36
62
  }
37
- return exprs;
63
+ return out;
38
64
  }
65
+ const OPEN = "${{";
package/dist/index.d.ts CHANGED
@@ -1,16 +1,18 @@
1
- export { buildCelEnvironment, type CelHandlers } from "./cel/environment.js";
1
+ export { buildCelEnvironment, celBuiltinFunctions, deriveSignatures, type CelHandlers, } from "./cel/environment.js";
2
2
  export { celFunctionCatalog, CEL_FUNCTIONS, type CelFunctionInfo, type CelFunctionDoc, type CelFunctionCategory, } from "./cel/catalog.js";
3
3
  export { compileExpression, compileString, toParameterized, TEMPLATE_REGEX, EXACT_TEMPLATE_REGEX, } from "./cel/compile.js";
4
4
  export { extractAccessChains, findNullableAccessIssues, INDEX_SEGMENT, validateChainAgainstSchema, } from "./cel/analyze.js";
5
- export { walkCelExpressions } from "./cel/walk.js";
5
+ export { auditCalls, explainUnresolved, functionIndex, type CallAudit } from "./cel/diagnose.js";
6
+ export { walkCelExpressions, type CelSurface } from "./cel/walk.js";
6
7
  export { celEngine } from "./engines/cel.js";
8
+ export { includeBytesEngine, includeTextEngine, normalizeIncludePath, type NormalizedIncludePath, } from "./engines/include.js";
7
9
  export { literalEngine } from "./engines/literal.js";
8
10
  export { refEngine } from "./engines/ref.js";
9
11
  export { sqlEngine, isParameterizedSql, type ParameterizedSql } from "./engines/sql.js";
10
12
  export { TemplatingEngineRegistry } from "./registry.js";
11
- export { builtinEngines, createDefaultRegistry, defaultRegistry } from "./builtins.js";
12
- export type { AnalyzeEnv, CompileEnv, EngineDiagnostic, TemplatingEngine, } from "./engine.js";
13
- export { isRefSentinel, isTaggedSentinel, makeTaggedSentinel, type TaggedSentinel } from "./sentinel.js";
13
+ export { builtinEngines, createDefaultRegistry, defaultRegistry, producedTypeOf, } from "./builtins.js";
14
+ export type { AnalyzeEnv, AnalyzeResult, CallSite, CompileEnv, DiagnosticFix, EngineDiagnostic, EngineFileClaim, TemplatingEngine, } from "./engine.js";
15
+ export { CEL_ENGINE, INCLUDE_BYTES_ENGINE, INCLUDE_ENGINE_NAMES, INCLUDE_TEXT_ENGINE, isIncludeSentinel, isRefSentinel, isTaggedSentinel, makeTaggedSentinel, plainChainOf, type TaggedSentinel, } from "./sentinel.js";
14
16
  export { buildCustomTags, defaultCustomTags } from "./yaml-tags.js";
15
- export { MANIFEST_SCHEMA_URI, ManifestRootSchema, ResourceRefSchema, normalizeRefSlots, } from "./manifest-schemas.js";
17
+ export { MANIFEST_SCHEMA_URI, ManifestRootSchema, ResourceRefSchema, } from "./manifest-schemas.js";
16
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,cAAc,EACd,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,aAAa,EACb,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAExF,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACvF,YAAY,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AACzG,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,WAAW,GACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,cAAc,EACd,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,aAAa,EACb,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAE,kBAAkB,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAExF,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,UAAU,EACV,aAAa,EACb,QAAQ,EACR,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,KAAK,cAAc,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC"}
package/dist/index.js CHANGED
@@ -1,14 +1,16 @@
1
- export { buildCelEnvironment } from "./cel/environment.js";
1
+ export { buildCelEnvironment, celBuiltinFunctions, deriveSignatures, } from "./cel/environment.js";
2
2
  export { celFunctionCatalog, CEL_FUNCTIONS, } from "./cel/catalog.js";
3
3
  export { compileExpression, compileString, toParameterized, TEMPLATE_REGEX, EXACT_TEMPLATE_REGEX, } from "./cel/compile.js";
4
4
  export { extractAccessChains, findNullableAccessIssues, INDEX_SEGMENT, validateChainAgainstSchema, } from "./cel/analyze.js";
5
+ export { auditCalls, explainUnresolved, functionIndex } from "./cel/diagnose.js";
5
6
  export { walkCelExpressions } from "./cel/walk.js";
6
7
  export { celEngine } from "./engines/cel.js";
8
+ export { includeBytesEngine, includeTextEngine, normalizeIncludePath, } from "./engines/include.js";
7
9
  export { literalEngine } from "./engines/literal.js";
8
10
  export { refEngine } from "./engines/ref.js";
9
11
  export { sqlEngine, isParameterizedSql } from "./engines/sql.js";
10
12
  export { TemplatingEngineRegistry } from "./registry.js";
11
- export { builtinEngines, createDefaultRegistry, defaultRegistry } from "./builtins.js";
12
- export { isRefSentinel, isTaggedSentinel, makeTaggedSentinel } from "./sentinel.js";
13
+ export { builtinEngines, createDefaultRegistry, defaultRegistry, producedTypeOf, } from "./builtins.js";
14
+ export { CEL_ENGINE, INCLUDE_BYTES_ENGINE, INCLUDE_ENGINE_NAMES, INCLUDE_TEXT_ENGINE, isIncludeSentinel, isRefSentinel, isTaggedSentinel, makeTaggedSentinel, plainChainOf, } from "./sentinel.js";
13
15
  export { buildCustomTags, defaultCustomTags } from "./yaml-tags.js";
14
- export { MANIFEST_SCHEMA_URI, ManifestRootSchema, ResourceRefSchema, normalizeRefSlots, } from "./manifest-schemas.js";
16
+ export { MANIFEST_SCHEMA_URI, ManifestRootSchema, ResourceRefSchema, } from "./manifest-schemas.js";
@@ -70,22 +70,6 @@ export declare const ResourceRefSchema: {
70
70
  additionalProperties: boolean;
71
71
  })[];
72
72
  };
73
- /** Deep-clone `schema`, dropping the stale scalar `type` constraint from every
74
- * reference-slot node — one carrying an `x-telo-ref` string annotation.
75
- *
76
- * A reference slot's value is always a `!ref` sentinel or its resolved
77
- * `{kind, name, alias?}` object (never a bare string, post-migration). Older
78
- * published modules still pin `type: "string"` on these slots — the encoding
79
- * references took when they were written as plain strings — which now rejects
80
- * the resolved object. Removing only the scalar `type` lets the analyzer and
81
- * kernel accept references uniformly across module versions during the
82
- * migration away from `{kind, name}` / string references, without disturbing
83
- * slots that legitimately accept an inline object (e.g. `inputType` /
84
- * `outputType`, which take a Telo.Type reference *or* an inline JSON schema).
85
- * The `x-telo-ref` constraint itself (which kind the reference must satisfy) is
86
- * checked separately by the analyzer's reference walker, which reads the
87
- * original schema — not this validation-only copy. */
88
- export declare function normalizeRefSlots(schema: unknown): unknown;
89
73
  /** Stable URI under which the shared manifest root schema is registered
90
74
  * with module-side AJV instances. Module YAMLs reach the fragments via
91
75
  * `$ref: "telo://manifest#/$defs/<Name>"`. The URI is the contract;