@telorun/templating 0.120.0 → 0.121.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/README.md CHANGED
@@ -91,7 +91,7 @@ Two licenses, split by directory. Each MIT directory carries its own `LICENSE`;
91
91
 
92
92
  | MIT | Sustainable Use |
93
93
  | --- | --- |
94
- | `cel/`, `sdk/`, `templating/`, `packages/glob/`, `packages/editor-protocol/` — the expression engine, the SDK and what a controller links against | `analyzer/`, `kernel/`, `cli/` — what loads, checks and runs a manifest |
94
+ | `cel/`, `message-format/`, `sdk/`, `templating/`, `packages/glob/`, `packages/editor-protocol/` — the expression engine, the message core, the SDK and what a controller links against | `analyzer/`, `kernel/`, `cli/` — what loads, checks and runs a manifest |
95
95
  | `modules/`, `blueprints/` — the standard library | `packages/ide-support/`, `packages/language-server/`, `packages/language-host/`, `ide/` — the editor tooling |
96
96
  | `starters/`, `examples/`, `docs/`, `benchmarks/` | `packages/runner-core/`, `packages/debug-wire/`, `packages/debug-ui/`, `apps/docker-runner/`, `apps/k8s-runner/` — the runners |
97
97
  | `apps/hub/`, `apps/hub-web/`, `apps/plan-approval*/` | `apps/studio/`, `apps/authoring-agent/`, `pages/` and everything not listed |
@@ -1 +1 @@
1
- {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/cel/compile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,aAAa,EAElB,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC7B,MAAM,cAAc,CAAC;AACtB,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAwC1B;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,GAAG,OAAO,CAIvF;AAED;;;GAGG;AACH,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AE,MAAM,EAAE,WAAW,EAAE,cAAc,GAAG,OAAO,CAIvF;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,cAAc,CAAC;IACrC,GAAG,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;CAChC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,cAAc,EAC3B,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAChC,cAAc,CAchB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,cAAc,EAC3B,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,EACjC,YAAY,CAAC,EAAE,cAAc,EAAE,GAC9B,aAAa,CAGf;AAED,kFAAkF;AAClF,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,aAAa,EACrB,WAAW,EAAE,cAAc,EAC3B,YAAY,CAAC,EAAE,cAAc,EAAE,GAC9B,aAAa,CAiCf;AAiCD;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,kBAAkB,GAAG,SAAS,GACpC,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,uBAAuB,GAAG,SAAS,CAAC,GAAG,SAAS,CAMxF"}
@@ -12,6 +12,7 @@
12
12
  */
13
13
  import { hostValueOf } from "@telorun/sdk";
14
14
  import { functionCatalog, qualifiedCalls, rootReferences, walkTree, } from "@telorun/cel";
15
+ import { writtenCalls } from "./literal-argument.js";
15
16
  import { celNamespaceNames, MODULE_CALL_DISPATCH_KEY, } from "./module-call.js";
16
17
  const NO_NAMESPACES = new Set();
17
18
  /** Catalog functions whose result differs per call, by name. */
@@ -117,6 +118,7 @@ export function compiledValueOf(expr, parsed, environment, programSites) {
117
118
  source: expr,
118
119
  refs: rootReferences(parsed.root),
119
120
  calls,
121
+ callArguments: writtenCalls(parsed.root),
120
122
  ...(callsNonDeterministic(parsed.root) ? { volatile: true } : {}),
121
123
  // **A module call is dispatched through the engine's namespace seam**, reading the table
122
124
  // the owning scope bound on the activation. Evaluating without it reaches no function at
@@ -1 +1 @@
1
- {"version":3,"file":"diagnose.d.ts","sourceRoot":"","sources":["../../src/cel/diagnose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEzE,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAClD,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC,oEAAoE;IACpE,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,+EAA+E;IAC/E,QAAQ,CAAC,cAAc,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACtD;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,SAAS,EAAE,MAAM,KACd;IAAE,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAAC;AAEnF;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,cAAc,EAC3B,eAAe,CAAC,EAAE,eAAe,EACjC,OAAO,CAAC,EAAE,WAAW,GACpB,YAAY,CAoDd;AAED;;;GA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
@@ -1,4 +1,6 @@
1
1
  import { moduleCallArgumentChains } from "./analyze.js";
2
+ import { literalTypeOf, literalValueOf, mapLiteralEntries } from "./literal-argument.js";
3
+ import { moduleCallNodes } from "./module-call.js";
2
4
  /**
3
5
  * Every call the expression makes, with what the checker resolved about it.
4
6
  *
@@ -10,6 +12,7 @@ export function auditCalls(source, root, environment, moduleCallFlags, checked)
10
12
  const result = checked ?? environment.check({ source, root, namespaces: environment.namespaces(), diagnostics: [] });
11
13
  const argumentChains = moduleCallArgumentChains(root);
12
14
  const byNode = new Map([...argumentChains].map(([node, chains]) => [`${node.range[0]}:${node.range[1]}`, chains]));
15
+ const argumentNodes = new Map(moduleCallNodes(root).map(({ node, call }) => [`${node.range[0]}:${node.range[1]}`, call.args]));
13
16
  // **One entry per call.** The checker already lists a qualified call — with `namespace`
14
17
  // set and `form: "receiver"`, which is how it was written — so appending a second entry
15
18
  // per `qualifiedCalls` showed every module call twice, with two contradictory forms, to
@@ -19,6 +22,7 @@ export function auditCalls(source, root, environment, moduleCallFlags, checked)
19
22
  const qualified = call.namespace !== undefined;
20
23
  const flags = qualified ? moduleCallFlags?.(call.name) : undefined;
21
24
  const chains = qualified ? byNode.get(`${call.range[0]}:${call.range[1]}`) : undefined;
25
+ const nodes = qualified ? argumentNodes.get(`${call.range[0]}:${call.range[1]}`) : undefined;
22
26
  calls.push({
23
27
  name: call.name,
24
28
  form: call.form,
@@ -33,9 +37,21 @@ export function auditCalls(source, root, environment, moduleCallFlags, checked)
33
37
  ? {
34
38
  arguments: call.argumentTypes.map((type, at) => {
35
39
  const chain = chains?.[at] ?? null;
40
+ const node = nodes?.[at];
41
+ const literal = node ? literalValueOf(node) : undefined;
42
+ const entries = node ? mapLiteralEntries(node) : undefined;
36
43
  return {
37
44
  ...(type === "dyn" ? {} : { type }),
38
45
  ...(chain ? { chain } : {}),
46
+ ...(literal ? { literal } : {}),
47
+ ...(entries
48
+ ? {
49
+ entries: entries.map((entry) => {
50
+ const entryType = literalTypeOf(entry.value) ?? mapValueType(type);
51
+ return { key: entry.key, ...(entryType ? { type: entryType } : {}) };
52
+ }),
53
+ }
54
+ : {}),
39
55
  };
40
56
  }),
41
57
  }
@@ -71,3 +87,21 @@ export function explainUnresolved(names, environment) {
71
87
  const last = listed.pop();
72
88
  return ` Registered: ${listed.length > 0 ? `${listed.join(", ")} and ${last}` : last}.`;
73
89
  }
90
+ /** The value type a `map(K, V)` type names, unless it is `dyn`. */
91
+ function mapValueType(type) {
92
+ if (!type.startsWith("map(") || !type.endsWith(")"))
93
+ return undefined;
94
+ let depth = 0;
95
+ for (let at = 4; at < type.length - 1; at++) {
96
+ const char = type[at];
97
+ if (char === "(")
98
+ depth++;
99
+ else if (char === ")")
100
+ depth--;
101
+ else if (char === "," && depth === 0) {
102
+ const value = type.slice(at + 1, -1).trim();
103
+ return value === "dyn" ? undefined : value;
104
+ }
105
+ }
106
+ return undefined;
107
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * What a module call's argument is when it is WRITTEN AS LITERALS ALONE — read off
3
+ * the tree, never evaluated.
4
+ *
5
+ * A host asks because some parameters accept only a value fixed where the call is
6
+ * written: a `Text` parameter is a text a catalog can look up, which an
7
+ * expression's result never is (`TEXT_ARGUMENT_COMPUTED`). The same reading gives
8
+ * the keys of a map literal and what each holds, which is how a message's values
9
+ * are judged where they are written.
10
+ */
11
+ import { type CelNode } from "@telorun/cel";
12
+ /** A literal argument's value: a string, a bigint (an `int` or `uint`), a number
13
+ * (a `double`), a boolean, null, bytes, or a list or string-keyed map of them. */
14
+ export interface LiteralValue {
15
+ readonly value: unknown;
16
+ }
17
+ /** The value `node` is written as, when it is literals alone. */
18
+ export declare function literalValueOf(node: CelNode): LiteralValue | undefined;
19
+ /** The CEL type a literal node is written as, or undefined for anything else. */
20
+ export declare function literalTypeOf(node: CelNode): string | undefined;
21
+ /** One entry of a map literal whose key is a string literal. */
22
+ export interface MapLiteralEntry {
23
+ readonly key: string;
24
+ readonly value: CelNode;
25
+ }
26
+ /** The entries of a map literal keyed by string literals, or undefined for any
27
+ * other node. */
28
+ export declare function mapLiteralEntries(node: CelNode): readonly MapLiteralEntry[] | undefined;
29
+ /** One argument of a module call as written: its value when it is literals alone. */
30
+ export type WrittenArgument = {
31
+ readonly literal: true;
32
+ readonly value: unknown;
33
+ } | {
34
+ readonly literal: false;
35
+ };
36
+ /** The arguments every qualified call in a tree is written with, per call. */
37
+ export interface WrittenCall {
38
+ readonly qualified: string;
39
+ readonly arguments: readonly WrittenArgument[];
40
+ }
41
+ /** Every qualified call in `root` with how each argument is written. */
42
+ export declare function writtenCalls(root: CelNode): WrittenCall[];
43
+ //# sourceMappingURL=literal-argument.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"literal-argument.d.ts","sourceRoot":"","sources":["../../src/cel/literal-argument.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5D;mFACmF;AACnF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,iEAAiE;AACjE,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS,CAoCtE;AAED,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAM/D;AAED,gEAAgE;AAChE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;kBACkB;AAClB,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,eAAe,EAAE,GAAG,SAAS,CAQvF;AAED,qFAAqF;AACrF,MAAM,MAAM,eAAe,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAA;CAAE,CAAC;AAEhH,8EAA8E;AAC9E,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;CAChD;AAED,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,EAAE,CASzD"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * What a module call's argument is when it is WRITTEN AS LITERALS ALONE — read off
3
+ * the tree, never evaluated.
4
+ *
5
+ * A host asks because some parameters accept only a value fixed where the call is
6
+ * written: a `Text` parameter is a text a catalog can look up, which an
7
+ * expression's result never is (`TEXT_ARGUMENT_COMPUTED`). The same reading gives
8
+ * the keys of a map literal and what each holds, which is how a message's values
9
+ * are judged where they are written.
10
+ */
11
+ import { qualifiedCalls } from "@telorun/cel";
12
+ import { moduleCallNodes } from "./module-call.js";
13
+ /** The value `node` is written as, when it is literals alone. */
14
+ export function literalValueOf(node) {
15
+ switch (node.kind) {
16
+ case "literal": {
17
+ const literal = node.literal;
18
+ return { value: literal.type === "null" ? null : literal.value };
19
+ }
20
+ case "unary": {
21
+ if (node.operator !== "-" || node.operand.kind !== "literal")
22
+ return undefined;
23
+ const literal = node.operand.literal;
24
+ if (literal.type === "int")
25
+ return { value: -literal.value };
26
+ if (literal.type === "double")
27
+ return { value: -literal.value };
28
+ return undefined;
29
+ }
30
+ case "list": {
31
+ const out = [];
32
+ for (const element of node.elements) {
33
+ if (element.optional)
34
+ return undefined;
35
+ const value = literalValueOf(element.value);
36
+ if (!value)
37
+ return undefined;
38
+ out.push(value.value);
39
+ }
40
+ return { value: out };
41
+ }
42
+ case "map": {
43
+ const out = {};
44
+ for (const entry of node.entries) {
45
+ if (entry.optional || entry.key.kind !== "literal" || entry.key.literal.type !== "string")
46
+ return undefined;
47
+ const value = literalValueOf(entry.value);
48
+ if (!value)
49
+ return undefined;
50
+ out[entry.key.literal.value] = value.value;
51
+ }
52
+ return { value: out };
53
+ }
54
+ default:
55
+ return undefined;
56
+ }
57
+ }
58
+ /** The CEL type a literal node is written as, or undefined for anything else. */
59
+ export function literalTypeOf(node) {
60
+ if (node.kind === "literal")
61
+ return node.literal.type === "null" ? "null_type" : node.literal.type;
62
+ if (node.kind === "unary" && node.operator === "-" && node.operand.kind === "literal") {
63
+ return node.operand.literal.type;
64
+ }
65
+ return undefined;
66
+ }
67
+ /** The entries of a map literal keyed by string literals, or undefined for any
68
+ * other node. */
69
+ export function mapLiteralEntries(node) {
70
+ if (node.kind !== "map")
71
+ return undefined;
72
+ const out = [];
73
+ for (const entry of node.entries) {
74
+ if (entry.optional || entry.key.kind !== "literal" || entry.key.literal.type !== "string")
75
+ return undefined;
76
+ out.push({ key: entry.key.literal.value, value: entry.value });
77
+ }
78
+ return out;
79
+ }
80
+ /** Every qualified call in `root` with how each argument is written. */
81
+ export function writtenCalls(root) {
82
+ if (qualifiedCalls(root).length === 0)
83
+ return [];
84
+ return moduleCallNodes(root).map(({ call }) => ({
85
+ qualified: call.qualified,
86
+ arguments: call.args.map((arg) => {
87
+ const literal = literalValueOf(arg);
88
+ return literal ? { literal: true, value: literal.value } : { literal: false };
89
+ }),
90
+ }));
91
+ }
package/dist/engine.d.ts CHANGED
@@ -154,6 +154,18 @@ export interface CallSite {
154
154
  export interface CallArgument {
155
155
  readonly type?: string;
156
156
  readonly chain?: readonly string[];
157
+ /** The argument's value when it is written as literals alone — a string, an
158
+ * integer (bigint), a double, a boolean, null, or a list or string-keyed map of
159
+ * them — so a caller can judge a parameter that takes only a fixed value. */
160
+ readonly literal?: {
161
+ readonly value: unknown;
162
+ };
163
+ /** For an argument written as a map literal keyed by string literals: each key
164
+ * and the CEL type of what it holds, absent where that is not known. */
165
+ readonly entries?: readonly {
166
+ readonly key: string;
167
+ readonly type?: string;
168
+ }[];
157
169
  }
158
170
  /** What one `analyze` call establishes about one source. Everything derivable
159
171
  * from the expression alone is derived here, once; everything that needs
@@ -1 +1 @@
1
- {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE;;wEAEwE;AACxE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3C;mDAC+C;IAC/C,QAAQ,CAAC,YAAY,CAAC,EAAE,cAAc,EAAE,CAAC;CAC1C;AAED;;;;;;;;;eASe;AACf,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACvD;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IAEjC;;;2DAGuD;IACvD,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAE3C;;qEAEiE;IACjE,QAAQ,CAAC,cAAc,CAAC,EAAE,sBAAsB,CAAC;IAEjD;;gEAE4D;IAC5D,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAEvF;;4EAEwE;IACxE,QAAQ,CAAC,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SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B;;qCAEiC;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;cACc;AACd,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;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;IAEzC;;;;;;qDAMiD;IACjD,iBAAiB,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,gBAAgB,EAAE,CAAC;IAEhE;;;;;;;;;iEAS6D;IAC7D,UAAU,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC;CAC9D"}
@@ -1,5 +1,5 @@
1
1
  import type { CelEnvironment, CelNode } from "@telorun/cel";
2
- import type { CompiledValue } from "@telorun/sdk";
2
+ import type { CompiledCall, CompiledValue } from "@telorun/sdk";
3
3
  import { type InterpolationHole } from "../cel/interpolation-holes.js";
4
4
  import type { CelAnalyzeResult, CelDiagnostic } from "../cel/verdict-codes.js";
5
5
  import type { AnalyzeEnv, CompileEnv, ExpressionRegion } from "../engine.js";
@@ -12,6 +12,7 @@ export declare function compileHoles(holes: readonly InterpolationHole[], env: C
12
12
  readonly compiled: readonly CompiledValue[];
13
13
  readonly refs: readonly string[];
14
14
  readonly calls: readonly string[];
15
+ readonly callArguments: readonly CompiledCall[];
15
16
  readonly volatile: boolean;
16
17
  };
17
18
  /** Analyze each hole with the shared CEL analysis, so diagnostics read exactly
@@ -1 +1 @@
1
- {"version":3,"file":"hole-analysis.d.ts","sourceRoot":"","sources":["../../src/engines/hole-analysis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAY,UAAU,EAAiB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGtG;oFACoF;AACpF,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,iBAAiB,EAAE,CAItF;AAED;sDACsD;AACtD,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,iBAAiB,EAAE,EACnC,GAAG,EAAE,UAAU,GACd;IACD,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;IAC5C,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B,CAWA;AAED;;;wEAGwE;AACxE,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,GAAG,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AAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B,CAYA;AAED;;;wEAGwE;AACxE,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,UAAU,EACf,OAAO,CAAC,EAAE,CACR,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,gBAAgB,EACxB,GAAG,EAAE,OAAO,GAAG,SAAS,KACrB,SAAS,aAAa,EAAE,GAC5B,gBAAgB,CAkBlB;AAED,+DAA+D;AAC/D,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,gBAAgB,EAAE,CAIvE;AAED;8BAC8B;AAC9B,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAG/E"}
@@ -24,7 +24,8 @@ export function compileHoles(holes, env) {
24
24
  if (c.volatile)
25
25
  volatile = true;
26
26
  }
27
- return { compiled, refs: [...refs], calls: [...calls], volatile };
27
+ const callArguments = compiled.flatMap((c) => c.callArguments ?? []);
28
+ return { compiled, refs: [...refs], calls: [...calls], callArguments, volatile };
28
29
  }
29
30
  /** Analyze each hole with the shared CEL analysis, so diagnostics read exactly
30
31
  * as they do under `!cel`; a fix computed against one hole's expression is
@@ -1 +1 @@
1
- {"version":3,"file":"interpolate.d.ts","sourceRoot":"","sources":["../../src/engines/interpolate.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAc,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAWjE;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,gBAwC/B,CAAC"}
1
+ {"version":3,"file":"interpolate.d.ts","sourceRoot":"","sources":["../../src/engines/interpolate.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAc,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAWjE;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,gBAyC/B,CAAC"}
@@ -20,13 +20,14 @@ export const interpolateEngine = {
20
20
  compile(source, env) {
21
21
  const holes = requireHoles(INTERPOLATE_ENGINE, source);
22
22
  const fragments = literalFragments(source, holes);
23
- const { compiled, refs, calls, volatile } = compileHoles(holes, env);
23
+ const { compiled, refs, calls, callArguments, volatile } = compileHoles(holes, env);
24
24
  const convert = stringConversion(env.celEnv);
25
25
  return {
26
26
  __compiled: true,
27
27
  source,
28
28
  refs,
29
29
  calls,
30
+ callArguments,
30
31
  ...(volatile ? { volatile: true } : {}),
31
32
  call: (ctx) => {
32
33
  let out = fragments[0];
@@ -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;AAE7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AASrD,OAAO,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,CAAC;AAErD;;;;;kFAKkF;AAClF,eAAO,MAAM,SAAS,EAAE,gBAsCvB,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;AAE7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AASrD,OAAO,EAAE,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,CAAC;AAErD;;;;;kFAKkF;AAClF,eAAO,MAAM,SAAS,EAAE,gBAuCvB,CAAC"}
@@ -14,7 +14,7 @@ export const sqlEngine = {
14
14
  compile(source, env) {
15
15
  const holes = requireHoles("sql", source);
16
16
  const fragments = literalFragments(source, holes);
17
- const { compiled, refs, calls, volatile } = compileHoles(holes, env);
17
+ const { compiled, refs, calls, callArguments, volatile } = compileHoles(holes, env);
18
18
  return {
19
19
  __compiled: true,
20
20
  source,
@@ -23,6 +23,7 @@ export const sqlEngine = {
23
23
  // cannot tell an identifier from a word inside a string literal.
24
24
  refs,
25
25
  calls,
26
+ callArguments,
26
27
  ...(volatile ? { volatile: true } : {}),
27
28
  call: (ctx) => ({
28
29
  __teloParameterized: true,
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export { EACH_SEGMENT, PRESENCE_SEGMENT, extractAccessChains, extractReadChains,
5
5
  export { auditCalls, explainUnresolved, type CallAudit, type ModuleCallFlags, } from "./cel/diagnose.js";
6
6
  export { celNamespaceNames, MODULE_CALL_DISPATCH_KEY, moduleCallNames, moduleCallOf, type ModuleCallDispatch, type ModuleCallTypeResolver, } from "./cel/module-call.js";
7
7
  export { walkCelExpressions } from "./cel/walk.js";
8
+ export { literalValueOf, writtenCalls, type LiteralValue, type WrittenArgument, type WrittenCall, } from "./cel/literal-argument.js";
8
9
  export { celEngine } from "./engines/cel.js";
9
10
  export { includeBytesEngine, includeTextEngine, normalizeIncludePath, normalizeModulePath, type NormalizedIncludePath, } from "./engines/include.js";
10
11
  export { interpolateEngine } from "./engines/interpolate.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,WAAW,GACjB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,KAAK,cAAc,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,EACxB,aAAa,EACb,0BAA0B,GAC3B,MAAM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AAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,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,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,UAAU,EACV,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,YAAY,EACZ,KAAK,cAAc,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ export { auditCalls, explainUnresolved, } from "./cel/diagnose.js";
14
14
  // interface whose field type cannot be named is not usable from outside.
15
15
  export { celNamespaceNames, MODULE_CALL_DISPATCH_KEY, moduleCallNames, moduleCallOf, } from "./cel/module-call.js";
16
16
  export { walkCelExpressions } from "./cel/walk.js";
17
+ export { literalValueOf, writtenCalls, } from "./cel/literal-argument.js";
17
18
  export { celEngine } from "./engines/cel.js";
18
19
  export { includeBytesEngine, includeTextEngine, normalizeIncludePath, normalizeModulePath, } from "./engines/include.js";
19
20
  export { interpolateEngine } from "./engines/interpolate.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telorun/templating",
3
- "version": "0.120.0",
3
+ "version": "0.121.0",
4
4
  "description": "Telo Templating - Engine registry and shared CEL core for Telo manifests.",
5
5
  "keywords": [
6
6
  "telo",
@@ -39,14 +39,14 @@
39
39
  "re2js": "2.8.3",
40
40
  "uuid": "14.0.1",
41
41
  "yaml": "^2.8.3",
42
- "@telorun/cel": "0.120.0"
42
+ "@telorun/cel": "0.121.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/d3-format": "^3.0.4",
46
46
  "@types/node": "^20.0.0",
47
47
  "typescript": "^5.0.0",
48
48
  "vitest": "^2.1.8",
49
- "@telorun/sdk": "0.120.0"
49
+ "@telorun/sdk": "0.121.0"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@telorun/sdk": "*"
@@ -22,6 +22,7 @@ import {
22
22
  type CelProgram,
23
23
  type NamespaceImplementation,
24
24
  } from "@telorun/cel";
25
+ import { writtenCalls } from "./literal-argument.js";
25
26
  import {
26
27
  celNamespaceNames,
27
28
  MODULE_CALL_DISPATCH_KEY,
@@ -160,6 +161,7 @@ export function compiledValueOf(
160
161
  source: expr,
161
162
  refs: rootReferences(parsed.root),
162
163
  calls,
164
+ callArguments: writtenCalls(parsed.root),
163
165
  ...(callsNonDeterministic(parsed.root) ? { volatile: true as const } : {}),
164
166
  // **A module call is dispatched through the engine's namespace seam**, reading the table
165
167
  // the owning scope bound on the activation. Evaluating without it reaches no function at
@@ -20,6 +20,8 @@
20
20
  */
21
21
  import type { CelEnvironment, CelNode, CheckResult } from "@telorun/cel";
22
22
  import { moduleCallArgumentChains } from "./analyze.js";
23
+ import { literalTypeOf, literalValueOf, mapLiteralEntries } from "./literal-argument.js";
24
+ import { moduleCallNodes } from "./module-call.js";
23
25
  import type { CallSite, EngineDiagnostic } from "../engine.js";
24
26
  import type { CelCallAudit } from "./verdict-codes.js";
25
27
 
@@ -66,6 +68,9 @@ export function auditCalls(
66
68
  const byNode = new Map(
67
69
  [...argumentChains].map(([node, chains]) => [`${node.range[0]}:${node.range[1]}`, chains]),
68
70
  );
71
+ const argumentNodes = new Map(
72
+ moduleCallNodes(root).map(({ node, call }) => [`${node.range[0]}:${node.range[1]}`, call.args]),
73
+ );
69
74
 
70
75
  // **One entry per call.** The checker already lists a qualified call — with `namespace`
71
76
  // set and `form: "receiver"`, which is how it was written — so appending a second entry
@@ -76,6 +81,7 @@ export function auditCalls(
76
81
  const qualified = call.namespace !== undefined;
77
82
  const flags = qualified ? moduleCallFlags?.(call.name) : undefined;
78
83
  const chains = qualified ? byNode.get(`${call.range[0]}:${call.range[1]}`) : undefined;
84
+ const nodes = qualified ? argumentNodes.get(`${call.range[0]}:${call.range[1]}`) : undefined;
79
85
  calls.push({
80
86
  name: call.name,
81
87
  form: call.form,
@@ -90,9 +96,21 @@ export function auditCalls(
90
96
  ? {
91
97
  arguments: call.argumentTypes.map((type, at) => {
92
98
  const chain = chains?.[at] ?? null;
99
+ const node = nodes?.[at];
100
+ const literal = node ? literalValueOf(node) : undefined;
101
+ const entries = node ? mapLiteralEntries(node) : undefined;
93
102
  return {
94
103
  ...(type === "dyn" ? {} : { type }),
95
104
  ...(chain ? { chain } : {}),
105
+ ...(literal ? { literal } : {}),
106
+ ...(entries
107
+ ? {
108
+ entries: entries.map((entry) => {
109
+ const entryType = literalTypeOf(entry.value) ?? mapValueType(type);
110
+ return { key: entry.key, ...(entryType ? { type: entryType } : {}) };
111
+ }),
112
+ }
113
+ : {}),
96
114
  };
97
115
  }),
98
116
  }
@@ -129,3 +147,19 @@ export function explainUnresolved(names: readonly string[], environment: CelEnvi
129
147
  const last = listed.pop()!;
130
148
  return ` Registered: ${listed.length > 0 ? `${listed.join(", ")} and ${last}` : last}.`;
131
149
  }
150
+
151
+ /** The value type a `map(K, V)` type names, unless it is `dyn`. */
152
+ function mapValueType(type: string): string | undefined {
153
+ if (!type.startsWith("map(") || !type.endsWith(")")) return undefined;
154
+ let depth = 0;
155
+ for (let at = 4; at < type.length - 1; at++) {
156
+ const char = type[at];
157
+ if (char === "(") depth++;
158
+ else if (char === ")") depth--;
159
+ else if (char === "," && depth === 0) {
160
+ const value = type.slice(at + 1, -1).trim();
161
+ return value === "dyn" ? undefined : value;
162
+ }
163
+ }
164
+ return undefined;
165
+ }
@@ -0,0 +1,105 @@
1
+ /**
2
+ * What a module call's argument is when it is WRITTEN AS LITERALS ALONE — read off
3
+ * the tree, never evaluated.
4
+ *
5
+ * A host asks because some parameters accept only a value fixed where the call is
6
+ * written: a `Text` parameter is a text a catalog can look up, which an
7
+ * expression's result never is (`TEXT_ARGUMENT_COMPUTED`). The same reading gives
8
+ * the keys of a map literal and what each holds, which is how a message's values
9
+ * are judged where they are written.
10
+ */
11
+ import { qualifiedCalls, type CelNode } from "@telorun/cel";
12
+ import { moduleCallNodes } from "./module-call.js";
13
+
14
+ /** A literal argument's value: a string, a bigint (an `int` or `uint`), a number
15
+ * (a `double`), a boolean, null, bytes, or a list or string-keyed map of them. */
16
+ export interface LiteralValue {
17
+ readonly value: unknown;
18
+ }
19
+
20
+ /** The value `node` is written as, when it is literals alone. */
21
+ export function literalValueOf(node: CelNode): LiteralValue | undefined {
22
+ switch (node.kind) {
23
+ case "literal": {
24
+ const literal = node.literal;
25
+ return { value: literal.type === "null" ? null : literal.value };
26
+ }
27
+ case "unary": {
28
+ if (node.operator !== "-" || node.operand.kind !== "literal") return undefined;
29
+ const literal = node.operand.literal;
30
+ if (literal.type === "int") return { value: -literal.value };
31
+ if (literal.type === "double") return { value: -literal.value };
32
+ return undefined;
33
+ }
34
+ case "list": {
35
+ const out: unknown[] = [];
36
+ for (const element of node.elements) {
37
+ if (element.optional) return undefined;
38
+ const value = literalValueOf(element.value);
39
+ if (!value) return undefined;
40
+ out.push(value.value);
41
+ }
42
+ return { value: out };
43
+ }
44
+ case "map": {
45
+ const out: Record<string, unknown> = {};
46
+ for (const entry of node.entries) {
47
+ if (entry.optional || entry.key.kind !== "literal" || entry.key.literal.type !== "string") return undefined;
48
+ const value = literalValueOf(entry.value);
49
+ if (!value) return undefined;
50
+ out[entry.key.literal.value] = value.value;
51
+ }
52
+ return { value: out };
53
+ }
54
+ default:
55
+ return undefined;
56
+ }
57
+ }
58
+
59
+ /** The CEL type a literal node is written as, or undefined for anything else. */
60
+ export function literalTypeOf(node: CelNode): string | undefined {
61
+ if (node.kind === "literal") return node.literal.type === "null" ? "null_type" : node.literal.type;
62
+ if (node.kind === "unary" && node.operator === "-" && node.operand.kind === "literal") {
63
+ return node.operand.literal.type;
64
+ }
65
+ return undefined;
66
+ }
67
+
68
+ /** One entry of a map literal whose key is a string literal. */
69
+ export interface MapLiteralEntry {
70
+ readonly key: string;
71
+ readonly value: CelNode;
72
+ }
73
+
74
+ /** The entries of a map literal keyed by string literals, or undefined for any
75
+ * other node. */
76
+ export function mapLiteralEntries(node: CelNode): readonly MapLiteralEntry[] | undefined {
77
+ if (node.kind !== "map") return undefined;
78
+ const out: MapLiteralEntry[] = [];
79
+ for (const entry of node.entries) {
80
+ if (entry.optional || entry.key.kind !== "literal" || entry.key.literal.type !== "string") return undefined;
81
+ out.push({ key: entry.key.literal.value, value: entry.value });
82
+ }
83
+ return out;
84
+ }
85
+
86
+ /** One argument of a module call as written: its value when it is literals alone. */
87
+ export type WrittenArgument = { readonly literal: true; readonly value: unknown } | { readonly literal: false };
88
+
89
+ /** The arguments every qualified call in a tree is written with, per call. */
90
+ export interface WrittenCall {
91
+ readonly qualified: string;
92
+ readonly arguments: readonly WrittenArgument[];
93
+ }
94
+
95
+ /** Every qualified call in `root` with how each argument is written. */
96
+ export function writtenCalls(root: CelNode): WrittenCall[] {
97
+ if (qualifiedCalls(root).length === 0) return [];
98
+ return moduleCallNodes(root).map(({ call }) => ({
99
+ qualified: call.qualified,
100
+ arguments: call.args.map((arg): WrittenArgument => {
101
+ const literal = literalValueOf(arg);
102
+ return literal ? { literal: true, value: literal.value } : { literal: false };
103
+ }),
104
+ }));
105
+ }
package/src/engine.ts CHANGED
@@ -166,6 +166,13 @@ export interface CallSite {
166
166
  export interface CallArgument {
167
167
  readonly type?: string;
168
168
  readonly chain?: readonly string[];
169
+ /** The argument's value when it is written as literals alone — a string, an
170
+ * integer (bigint), a double, a boolean, null, or a list or string-keyed map of
171
+ * them — so a caller can judge a parameter that takes only a fixed value. */
172
+ readonly literal?: { readonly value: unknown };
173
+ /** For an argument written as a map literal keyed by string literals: each key
174
+ * and the CEL type of what it holds, absent where that is not known. */
175
+ readonly entries?: readonly { readonly key: string; readonly type?: string }[];
169
176
  }
170
177
 
171
178
  /** What one `analyze` call establishes about one source. Everything derivable
@@ -1,5 +1,5 @@
1
1
  import type { CelEnvironment, CelNode } from "@telorun/cel";
2
- import type { CompiledValue } from "@telorun/sdk";
2
+ import type { CompiledCall, CompiledValue } from "@telorun/sdk";
3
3
  import { compileExpression, repeatableExpression } from "../cel/compile.js";
4
4
  import {
5
5
  readInterpolationHoles,
@@ -26,6 +26,7 @@ export function compileHoles(
26
26
  readonly compiled: readonly CompiledValue[];
27
27
  readonly refs: readonly string[];
28
28
  readonly calls: readonly string[];
29
+ readonly callArguments: readonly CompiledCall[];
29
30
  readonly volatile: boolean;
30
31
  } {
31
32
  const compiled = holes.map((h) => compileExpression(h.expr, env.celEnv, env.moduleNames, env.programSites));
@@ -37,7 +38,8 @@ export function compileHoles(
37
38
  for (const q of c.calls ?? []) calls.add(q);
38
39
  if (c.volatile) volatile = true;
39
40
  }
40
- return { compiled, refs: [...refs], calls: [...calls], volatile };
41
+ const callArguments = compiled.flatMap((c) => c.callArguments ?? []);
42
+ return { compiled, refs: [...refs], calls: [...calls], callArguments, volatile };
41
43
  }
42
44
 
43
45
  /** Analyze each hole with the shared CEL analysis, so diagnostics read exactly
@@ -31,13 +31,14 @@ export const interpolateEngine: TemplatingEngine = {
31
31
  compile(source, env) {
32
32
  const holes = requireHoles(INTERPOLATE_ENGINE, source);
33
33
  const fragments = literalFragments(source, holes);
34
- const { compiled, refs, calls, volatile } = compileHoles(holes, env);
34
+ const { compiled, refs, calls, callArguments, volatile } = compileHoles(holes, env);
35
35
  const convert = stringConversion(env.celEnv);
36
36
  return {
37
37
  __compiled: true,
38
38
  source,
39
39
  refs,
40
40
  calls,
41
+ callArguments,
41
42
  ...(volatile ? { volatile: true as const } : {}),
42
43
  call: (ctx: Record<string, unknown>): string => {
43
44
  let out = fragments[0]!;
@@ -24,7 +24,7 @@ export const sqlEngine: TemplatingEngine = {
24
24
  compile(source, env) {
25
25
  const holes = requireHoles("sql", source);
26
26
  const fragments = literalFragments(source, holes);
27
- const { compiled, refs, calls, volatile } = compileHoles(holes, env);
27
+ const { compiled, refs, calls, callArguments, volatile } = compileHoles(holes, env);
28
28
  return {
29
29
  __compiled: true,
30
30
  source,
@@ -33,6 +33,7 @@ export const sqlEngine: TemplatingEngine = {
33
33
  // cannot tell an identifier from a word inside a string literal.
34
34
  refs,
35
35
  calls,
36
+ callArguments,
36
37
  ...(volatile ? { volatile: true as const } : {}),
37
38
  call: (ctx: Record<string, unknown>): ParameterizedSql => ({
38
39
  __teloParameterized: true,
package/src/index.ts CHANGED
@@ -52,6 +52,13 @@ export {
52
52
  type ModuleCallTypeResolver,
53
53
  } from "./cel/module-call.js";
54
54
  export { walkCelExpressions } from "./cel/walk.js";
55
+ export {
56
+ literalValueOf,
57
+ writtenCalls,
58
+ type LiteralValue,
59
+ type WrittenArgument,
60
+ type WrittenCall,
61
+ } from "./cel/literal-argument.js";
55
62
 
56
63
  export { celEngine } from "./engines/cel.js";
57
64
  export {