@telorun/analyzer 0.1.2 → 0.1.3

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 (44) hide show
  1. package/README.md +233 -0
  2. package/dist/adapters/http-adapter.d.ts +1 -1
  3. package/dist/adapters/http-adapter.d.ts.map +1 -1
  4. package/dist/adapters/http-adapter.js +2 -1
  5. package/dist/adapters/node-adapter.d.ts +1 -1
  6. package/dist/adapters/node-adapter.d.ts.map +1 -1
  7. package/dist/adapters/node-adapter.js +2 -1
  8. package/dist/adapters/registry-adapter.d.ts +1 -1
  9. package/dist/adapters/registry-adapter.d.ts.map +1 -1
  10. package/dist/adapters/registry-adapter.js +2 -1
  11. package/dist/analyzer.d.ts.map +1 -1
  12. package/dist/analyzer.js +6 -1
  13. package/dist/cel-environment.d.ts +5 -2
  14. package/dist/cel-environment.d.ts.map +1 -1
  15. package/dist/cel-environment.js +5 -3
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/kernel-globals.d.ts +34 -0
  20. package/dist/kernel-globals.d.ts.map +1 -0
  21. package/dist/kernel-globals.js +94 -0
  22. package/dist/manifest-loader.d.ts +2 -1
  23. package/dist/manifest-loader.d.ts.map +1 -1
  24. package/dist/manifest-loader.js +33 -1
  25. package/dist/schema-compat.d.ts +1 -1
  26. package/dist/schema-compat.d.ts.map +1 -1
  27. package/dist/schema-compat.js +43 -14
  28. package/dist/types.d.ts +2 -0
  29. package/dist/types.d.ts.map +1 -1
  30. package/dist/types.js +2 -0
  31. package/dist/validate-references.d.ts.map +1 -1
  32. package/dist/validate-references.js +13 -1
  33. package/package.json +21 -2
  34. package/src/adapters/http-adapter.ts +2 -2
  35. package/src/adapters/node-adapter.ts +2 -2
  36. package/src/adapters/registry-adapter.ts +2 -2
  37. package/src/analyzer.ts +7 -1
  38. package/src/cel-environment.ts +5 -3
  39. package/src/index.ts +1 -1
  40. package/src/kernel-globals.ts +110 -0
  41. package/src/manifest-loader.ts +40 -2
  42. package/src/schema-compat.ts +47 -13
  43. package/src/types.ts +3 -0
  44. package/src/validate-references.ts +13 -1
package/README.md ADDED
@@ -0,0 +1,233 @@
1
+ # ⚡ Telo
2
+
3
+ Runtime for declarative backends.
4
+
5
+ Telo is an execution engine (Micro-Kernel) that runs logic defined entirely in YAML manifests. Instead of writing imperative backend code, you define your routes, databases, schemas, and AI workflows as atomic, interconnected YAML documents. Telo takes those manifests and runs them.
6
+
7
+ Built to be language-agnostic and infinitely extensible.
8
+
9
+ ```bash
10
+ # Reconcile your manifest into a running backend
11
+ $ telo ./examples/hello-api.yaml
12
+
13
+ {"level":30,"time":1771610393008,"pid":1310178,"hostname":"dev","msg":"Server listening at http://127.0.0.1:8844"}
14
+ ```
15
+
16
+ ## Why use Telo?
17
+
18
+ - **Open Standards:** Built on YAML, JSON Schema, and CEL — no proprietary DSL.
19
+ - **Static Analysis:** CEL type checking, reference validation, and IDE diagnostics catch errors before runtime.
20
+ - **Micro-Kernel Architecture:** Telo itself knows nothing about HTTP or SQL. Everything is a module you import, scope, and compose with typed variable and secret contracts.
21
+ - **Language Agnostic:** Available as a Node.js runtime today, with a shared YAML runtime contract that allows for future Rust or Go implementations without changing your manifests.
22
+
23
+ ## What It Does
24
+
25
+ - **Loads** YAML resources and compiles CEL expressions (`${{ }}`) into an in-memory registry.
26
+ - **Resolves** resource dependencies via a multi-pass init loop, handling ordering automatically.
27
+ - **Indexes** resources by Kind and Name for constant-time lookup.
28
+ - **Dispatches** execution to the controller that owns each Kind.
29
+
30
+ Manifests also support directives for dynamic generation: `$let`, `$if`, `$for`, `$eval`, and `$include`. See [CEL-YAML Templating](./yaml-cel-templating/README.md) for documentation.
31
+
32
+ ## Example manifest
33
+
34
+ Here is an example Telo application that defines a simple HTTP API:
35
+
36
+ ```yaml
37
+ kind: Kernel.Module
38
+ metadata:
39
+ name: feedback
40
+ version: 1.0.0
41
+ description: |
42
+ A complete feedback collection REST API — no code, pure YAML.
43
+ Persists entries to SQLite and serves them over HTTP.
44
+ targets:
45
+ - Migrations
46
+ - Server
47
+ ---
48
+ kind: Kernel.Import
49
+ metadata:
50
+ name: Http
51
+ source: ../modules/http-server
52
+ ---
53
+ kind: Kernel.Import
54
+ metadata:
55
+ name: Sql
56
+ source: ../modules/sql
57
+ ---
58
+ # SQLite database — swap driver/host/database for PostgreSQL with zero YAML changes
59
+ kind: Sql.Connection
60
+ metadata:
61
+ name: Db
62
+ driver: sqlite
63
+ file: ./tmp/feedback.db
64
+ ---
65
+ # Migrations: applied automatically before the server starts
66
+ kind: Sql.Migrations
67
+ metadata:
68
+ name: Migrations
69
+ connection:
70
+ kind: Sql.Connection
71
+ name: Db
72
+ ---
73
+ kind: Sql.Migration
74
+ metadata:
75
+ name: Migration_20260413_182154_CreateFeedback
76
+ sql: |
77
+ CREATE TABLE IF NOT EXISTS feedback (
78
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
79
+ text TEXT NOT NULL,
80
+ source TEXT,
81
+ score INTEGER NOT NULL DEFAULT 0,
82
+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP
83
+ )
84
+ ---
85
+ kind: Http.Server
86
+ metadata:
87
+ name: Server
88
+ baseUrl: http://localhost:8844
89
+ port: 8844
90
+ logger: true
91
+ openapi:
92
+ info:
93
+ title: Feedback API
94
+ version: 1.0.0
95
+ mounts:
96
+ - path: /v1
97
+ type: Http.Api.FeedbackRoutes
98
+ ---
99
+ kind: Http.Api
100
+ metadata:
101
+ name: FeedbackRoutes
102
+ routes:
103
+ # POST /v1/feedback — insert a new entry, score derived from body length heuristic
104
+ - request:
105
+ path: /feedback
106
+ method: POST
107
+ schema:
108
+ body:
109
+ type: object
110
+ properties:
111
+ text:
112
+ type: string
113
+ minLength: 1
114
+ source:
115
+ type: string
116
+ required: [text]
117
+ handler:
118
+ kind: Sql.Exec
119
+ connection:
120
+ kind: Sql.Connection
121
+ name: Db
122
+ inputs:
123
+ sql: "INSERT INTO feedback (text, source, score) VALUES (?, ?, ?)"
124
+ bindings:
125
+ - "${{ request.body.text }}"
126
+ - "${{ request.body.source }}"
127
+ - "${{ size(request.body.text) }}"
128
+ response:
129
+ - status: 201
130
+ headers:
131
+ Content-Type: application/json
132
+ body:
133
+ ok: true
134
+ message: Feedback received
135
+
136
+ # GET /v1/feedback — list all entries, newest first
137
+ - request:
138
+ path: /feedback
139
+ method: GET
140
+ handler:
141
+ kind: Sql.Select
142
+ connection:
143
+ kind: Sql.Connection
144
+ name: Db
145
+ from: feedback
146
+ columns: [id, text, source, score, created_at]
147
+ orderBy:
148
+ - { column: created_at, direction: desc }
149
+ response:
150
+ - status: 200
151
+ headers:
152
+ Content-Type: application/json
153
+ body: "${{ result.rows }}"
154
+
155
+ # GET /v1/feedback/{id} — fetch a single entry
156
+ - request:
157
+ path: /feedback/{id}
158
+ method: GET
159
+ schema:
160
+ params:
161
+ type: object
162
+ properties:
163
+ id:
164
+ type: integer
165
+ required: [id]
166
+ handler:
167
+ kind: Sql.Select
168
+ connection:
169
+ kind: Sql.Connection
170
+ name: Db
171
+ from: feedback
172
+ columns: [id, text, source, score, created_at]
173
+ where:
174
+ - { column: id, op: "=", value: "${{ request.params.id }}" }
175
+ response:
176
+ - status: 200
177
+ when: "size(result.rows) > 0"
178
+ headers:
179
+ Content-Type: application/json
180
+ body: "${{ result.rows[0] }}"
181
+ - status: 404
182
+ headers:
183
+ Content-Type: application/json
184
+ body:
185
+ ok: false
186
+ message: Not found
187
+ ```
188
+
189
+ ## Status
190
+
191
+ Telo is under **active development**. The core runtime, module system, and standard library are functional, but the API surface — including YAML shapes — may change without notice. Not yet recommended for production use.
192
+
193
+ ## The Meaning of Telo
194
+
195
+ The name Telo is derived from the Greek root Telos - meaning the "end goal", "purpose", or "final state". That is exactly the philosophy behind this runtime. In standard imperative programming, you have to write thousands of lines of code to tell a server exactly how to start. With Telo, you simply declare your desired final state.
196
+
197
+ You define the end state. Telo makes it real.
198
+
199
+ ## Philosophy
200
+
201
+ Modern platforms often spend disproportionate effort on technical mechanics-wiring frameworks, managing infrastructure, and negotiating toolchains-while the original business problem gets delayed or diluted. Telo pushes in the opposite direction: it treats kernel execution as a stable, predictable host so teams can concentrate on the **business logic and outcomes** instead of the plumbing.
202
+
203
+ By separating "what the system should do" from "how it is hosted", the runtime reduces friction for domain‑level changes. Teams can move faster on product requirements, experiment more safely, and keep conversations centered on value delivered rather than implementation trivia.
204
+
205
+ Telo also aims to **join forces across all programming language communities**, so the best ideas, patterns, and implementations can converge into a shared kernel truth without forcing everyone into a single stack.
206
+
207
+ YAML also makes the system more **AI‑friendly** than traditional programming languages: it is explicit, structured, and easier for tools to generate, review, and transform without losing intent.
208
+
209
+ ## Modularity
210
+
211
+ Telo is built around **modules** that own specific resource kinds. A module is loaded from a manifest, declares which kinds it implements, and then receives only the resources of those kinds. This keeps concerns isolated and lets teams compose systems from focused building blocks rather than monolithic services.
212
+
213
+ At kernel execution time, execution is always routed by **Kind.Name**. The kernel resolves the Kind to its owning module and hands off execution. Modules can call back into the kernel to execute other resources, enabling composition without tight coupling.
214
+
215
+ ## Architecture
216
+
217
+ The architecture is inspired by Kubernetes-style manifests: declarative resources, explicit kinds, and a control plane that routes work based on those definitions.
218
+ Those manifests were taken to the next level by allowing them to run inside a standalone runtime host.
219
+
220
+ ## See more at
221
+
222
+ - [Telo Kernel](./kernel/README.md)
223
+ - [CEL-YAML Templating](./yaml-cel-templating/README.md)
224
+ - [Telo SDK for module authors](sdk/README.md)
225
+ - [Modules](modules/README.md)
226
+
227
+ ## License
228
+
229
+ See [LICENSE](https://github.com/telorun/telo/blob/main/LICENSE).
230
+
231
+ ## Contribution Note
232
+
233
+ By contributing, you agree that code and examples in this repository may be translated or re‑implemented in other programming languages (including by AI systems) to support the project’s polyglot goals.
@@ -1,4 +1,4 @@
1
- import type { ManifestAdapter } from "../types.js";
1
+ import { type ManifestAdapter } from "../types.js";
2
2
  export declare class HttpAdapter implements ManifestAdapter {
3
3
  supports(url: string): boolean;
4
4
  read(url: string): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"http-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/http-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,qBAAa,WAAY,YAAW,eAAe;IACjD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIxB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAWlE,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;CAIxD"}
1
+ {"version":3,"file":"http-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/http-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9E,qBAAa,WAAY,YAAW,eAAe;IACjD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIxB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAWlE,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;CAIxD"}
@@ -1,9 +1,10 @@
1
+ import { DEFAULT_MANIFEST_FILENAME } from "../types.js";
1
2
  export class HttpAdapter {
2
3
  supports(url) {
3
4
  return url.startsWith("http://") || url.startsWith("https://");
4
5
  }
5
6
  async read(url) {
6
- const fetchUrl = url.includes(".yaml") ? url : `${url}/module.yaml`;
7
+ const fetchUrl = url.includes(".yaml") ? url : `${url}/${DEFAULT_MANIFEST_FILENAME}`;
7
8
  const response = await fetch(fetchUrl);
8
9
  if (!response.ok) {
9
10
  throw new Error(`Failed to fetch manifest from ${fetchUrl}: ${response.status} ${response.statusText}`);
@@ -1,4 +1,4 @@
1
- import type { ManifestAdapter } from "../types.js";
1
+ import { type ManifestAdapter } from "../types.js";
2
2
  /** Node.js fs-based ManifestAdapter for local files. Not browser-compatible. */
3
3
  export declare class NodeAdapter implements ManifestAdapter {
4
4
  private readonly cwd;
@@ -1 +1 @@
1
- {"version":3,"file":"node-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/node-adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,gFAAgF;AAChF,qBAAa,WAAY,YAAW,eAAe;IACrC,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,GAAE,MAAsB;IAExD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAUxB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IASlE,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;CAKxD;AAED,qDAAqD;AACrD,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAsB,GAAG,eAAe,CAE9E"}
1
+ {"version":3,"file":"node-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/node-adapter.ts"],"names":[],"mappings":"AAEA,OAAO,EAA6B,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9E,gFAAgF;AAChF,qBAAa,WAAY,YAAW,eAAe;IACrC,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,GAAE,MAAsB;IAExD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAUxB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IASlE,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;CAKxD;AAED,qDAAqD;AACrD,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAsB,GAAG,eAAe,CAE9E"}
@@ -1,5 +1,6 @@
1
1
  import * as fs from "fs/promises";
2
2
  import * as path from "path";
3
+ import { DEFAULT_MANIFEST_FILENAME } from "../types.js";
3
4
  /** Node.js fs-based ManifestAdapter for local files. Not browser-compatible. */
4
5
  export class NodeAdapter {
5
6
  cwd;
@@ -16,7 +17,7 @@ export class NodeAdapter {
16
17
  async read(url) {
17
18
  const filePath = url.startsWith("file://") ? new URL(url).pathname : url;
18
19
  const stat = await fs.stat(filePath).catch(() => null);
19
- const resolvedPath = stat?.isDirectory() ? path.join(filePath, "module.yaml") : filePath;
20
+ const resolvedPath = stat?.isDirectory() ? path.join(filePath, DEFAULT_MANIFEST_FILENAME) : filePath;
20
21
  const text = await fs.readFile(resolvedPath, "utf8");
21
22
  return { text, source: resolvedPath };
22
23
  }
@@ -1,4 +1,4 @@
1
- import type { ManifestAdapter } from "../types.js";
1
+ import { type ManifestAdapter } from "../types.js";
2
2
  export declare class RegistryAdapter implements ManifestAdapter {
3
3
  private registryUrl;
4
4
  constructor(registryUrl?: string);
@@ -1 +1 @@
1
- {"version":3,"file":"registry-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/registry-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAInD,qBAAa,eAAgB,YAAW,eAAe;IACzC,OAAO,CAAC,WAAW;gBAAX,WAAW,SAAuB;IAEtD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAWxB,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAWxE,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAMvD,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,cAAc;CAmBvB"}
1
+ {"version":3,"file":"registry-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/registry-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAI9E,qBAAa,eAAgB,YAAW,eAAe;IACzC,OAAO,CAAC,WAAW;gBAAX,WAAW,SAAuB;IAEtD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAWxB,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAWxE,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAMvD,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,cAAc;CAmBvB"}
@@ -1,3 +1,4 @@
1
+ import { DEFAULT_MANIFEST_FILENAME } from "../types.js";
1
2
  const DEFAULT_REGISTRY_URL = "https://registry.telo.run";
2
3
  export class RegistryAdapter {
3
4
  registryUrl;
@@ -31,7 +32,7 @@ export class RegistryAdapter {
31
32
  return `${normalizedBase}/${parsed.modulePath}/${parsed.version}`;
32
33
  }
33
34
  toRegistryUrl(moduleRef) {
34
- return `${this.toRegistryModuleBase(moduleRef)}/module.yaml`;
35
+ return `${this.toRegistryModuleBase(moduleRef)}/${DEFAULT_MANIFEST_FILENAME}`;
35
36
  }
36
37
  parseModuleRef(moduleRef) {
37
38
  const atIdx = moduleRef.lastIndexOf("@");
@@ -1 +1 @@
1
- {"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../src/analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsB,gBA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O,CAAC,EAAE,eAAe,EACzB,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,kBAAkB,EAAE;IAMvB,SAAS,CAAC,SAAS,EAAE,gBAAgB,EAAE,EAAE,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,EAAE;IAKxF,OAAO,CACL,SAAS,EAAE,gBAAgB,EAAE,EAC7B,QAAQ,EAAE,gBAAgB,GACzB;QAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE;CAiB5F"}
package/dist/analyzer.js CHANGED
@@ -2,6 +2,7 @@ import { AliasResolver } from "./alias-resolver.js";
2
2
  import { buildTypedCelEnvironment, celEnvironment } from "./cel-environment.js";
3
3
  import { DefinitionRegistry } from "./definition-registry.js";
4
4
  import { buildDependencyGraph, formatCycle } from "./dependency-graph.js";
5
+ import { buildKernelGlobalsSchema, mergeKernelGlobalsIntoContext } from "./kernel-globals.js";
5
6
  import { normalizeInlineResources } from "./normalize-inline-resources.js";
6
7
  import { celTypeSatisfiesJsonSchema, substituteCelFields, validateAgainstSchema, } from "./schema-compat.js";
7
8
  import { DiagnosticSeverity } from "./types.js";
@@ -238,6 +239,9 @@ export class StaticAnalyzer {
238
239
  byName.set(m.metadata.name, m);
239
240
  }
240
241
  }
242
+ // Build typed kernel globals schema so x-telo-context chain validation
243
+ // recognises variables, secrets, resources, env automatically
244
+ const kernelGlobals = buildKernelGlobalsSchema(allManifests);
241
245
  // Validate each non-definition, non-system resource
242
246
  for (const m of allManifests) {
243
247
  if (!m.kind || !m.metadata?.name) {
@@ -366,7 +370,8 @@ export class StaticAnalyzer {
366
370
  const manifestItem = matchedScope
367
371
  ? getManifestItem(path, matchedScope, m)
368
372
  : m;
369
- const effectiveContext = resolveContextAnnotations(matchedContext, manifestItem, allManifests);
373
+ const resolvedContext = resolveContextAnnotations(matchedContext, manifestItem, allManifests);
374
+ const effectiveContext = mergeKernelGlobalsIntoContext(resolvedContext, kernelGlobals);
370
375
  for (const chain of accessChains) {
371
376
  const err = validateChainAgainstSchema(chain, effectiveContext);
372
377
  if (!err)
@@ -6,7 +6,10 @@ export declare const celEnvironment: Environment;
6
6
  *
7
7
  * - `variables`: typed from the manifest's `variables` field if it is a schema map
8
8
  * (only `Kernel.Module` resources carry this); otherwise registered as `map` (dyn).
9
- * - `secrets`, `resources`, `imports`, `env`: always `map` (dyn — output schemas unknown).
10
- * - `extraContextSchema`: additional variables from an `x-telo-context` annotation. */
9
+ * - `secrets`, `resources`, `env`: always `map` (dyn — output schemas unknown).
10
+ * - `extraContextSchema`: additional variables from an `x-telo-context` annotation.
11
+ *
12
+ * NOTE: The set of kernel globals registered here must match `KERNEL_GLOBAL_NAMES`
13
+ * in kernel-globals.ts, which is used for chain-access validation. */
11
14
  export declare function buildTypedCelEnvironment(manifest: ResourceManifest, extraContextSchema?: Record<string, any> | null): Environment;
12
15
  //# sourceMappingURL=cel-environment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cel-environment.d.ts","sourceRoot":"","sources":["../src/cel-environment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,eAAO,MAAM,cAAc,aAWvB,CAAC;AAEL;;;;;;wFAMwF;AACxF,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,gBAAgB,EAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAC9C,WAAW,CA0Cb"}
1
+ {"version":3,"file":"cel-environment.d.ts","sourceRoot":"","sources":["../src/cel-environment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,eAAO,MAAM,cAAc,aAWvB,CAAC;AAEL;;;;;;;;;uEASuE;AACvE,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,gBAAgB,EAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAC9C,WAAW,CAyCb"}
@@ -17,8 +17,11 @@ export const celEnvironment = new Environment({ unlistedVariablesAreDyn: true })
17
17
  *
18
18
  * - `variables`: typed from the manifest's `variables` field if it is a schema map
19
19
  * (only `Kernel.Module` resources carry this); otherwise registered as `map` (dyn).
20
- * - `secrets`, `resources`, `imports`, `env`: always `map` (dyn — output schemas unknown).
21
- * - `extraContextSchema`: additional variables from an `x-telo-context` annotation. */
20
+ * - `secrets`, `resources`, `env`: always `map` (dyn — output schemas unknown).
21
+ * - `extraContextSchema`: additional variables from an `x-telo-context` annotation.
22
+ *
23
+ * NOTE: The set of kernel globals registered here must match `KERNEL_GLOBAL_NAMES`
24
+ * in kernel-globals.ts, which is used for chain-access validation. */
22
25
  export function buildTypedCelEnvironment(manifest, extraContextSchema) {
23
26
  try {
24
27
  const env = celEnvironment.clone();
@@ -42,7 +45,6 @@ export function buildTypedCelEnvironment(manifest, extraContextSchema) {
42
45
  }
43
46
  env.registerVariable("secrets", "map");
44
47
  env.registerVariable("resources", "map");
45
- env.registerVariable("imports", "map");
46
48
  env.registerVariable("env", "map");
47
49
  if (extraContextSchema?.properties) {
48
50
  for (const [name, propSchema] of Object.entries(extraContextSchema.properties)) {
package/dist/index.d.ts CHANGED
@@ -4,6 +4,6 @@ export { RegistryAdapter } from "./adapters/registry-adapter.js";
4
4
  export { AnalysisRegistry } from "./analysis-registry.js";
5
5
  export { StaticAnalyzer } from "./analyzer.js";
6
6
  export { Loader } from "./manifest-loader.js";
7
- export { DiagnosticSeverity } from "./types.js";
7
+ export { DEFAULT_MANIFEST_FILENAME, DiagnosticSeverity } from "./types.js";
8
8
  export type { AnalysisDiagnostic, AnalysisOptions, LoaderInitOptions, LoadOptions, ManifestAdapter, Position, PositionIndex, Range } from "./types.js";
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,YAAY,EACR,kBAAkB,EAClB,eAAe,EAAE,iBAAiB,EAAE,WAAW,EAAE,eAAe,EAChE,QAAQ,EACR,aAAa,EACb,KAAK,EACR,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC3E,YAAY,EACR,kBAAkB,EAClB,eAAe,EAAE,iBAAiB,EAAE,WAAW,EAAE,eAAe,EAChE,QAAQ,EACR,aAAa,EACb,KAAK,EACR,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -4,4 +4,4 @@ export { RegistryAdapter } from "./adapters/registry-adapter.js";
4
4
  export { AnalysisRegistry } from "./analysis-registry.js";
5
5
  export { StaticAnalyzer } from "./analyzer.js";
6
6
  export { Loader } from "./manifest-loader.js";
7
- export { DiagnosticSeverity } from "./types.js";
7
+ export { DEFAULT_MANIFEST_FILENAME, DiagnosticSeverity } from "./types.js";
@@ -0,0 +1,34 @@
1
+ import type { ResourceManifest } from "@telorun/sdk";
2
+ /**
3
+ * Kernel global names available in every CEL evaluation context at runtime.
4
+ * Both `buildKernelGlobalsSchema` (chain-access validation) and
5
+ * `buildTypedCelEnvironment` in cel-environment.ts (CEL type-checking)
6
+ * must stay in sync with this list.
7
+ *
8
+ * Note: `env` is only available in the root module context. Child modules
9
+ * loaded via Kernel.Import do not receive host environment variables.
10
+ * There is no `imports` namespace at runtime — import snapshots are stored
11
+ * under `resources.<alias>`.
12
+ */
13
+ export declare const KERNEL_GLOBAL_NAMES: readonly ["variables", "secrets", "resources", "env"];
14
+ /**
15
+ * Build a typed JSON Schema describing the kernel globals available in the
16
+ * given manifest set. Used to merge into `x-telo-context` schemas so that
17
+ * chain-access validation recognises kernel globals without module authors
18
+ * having to re-declare them.
19
+ *
20
+ * - `variables` / `secrets`: typed from the `Kernel.Module` declaration
21
+ * - `resources`: enumerates all non-system resource names
22
+ * - `env`: dynamic (runtime env vars, root module only)
23
+ */
24
+ export declare function buildKernelGlobalsSchema(manifests: ResourceManifest[]): Record<string, any>;
25
+ /**
26
+ * Merge kernel globals into an `x-telo-context` schema so chain-access
27
+ * validation recognises `variables`, `secrets`, `resources`, `env`
28
+ * without module authors having to re-declare them.
29
+ *
30
+ * Context-specific properties take precedence over globals (spread order).
31
+ * The original `additionalProperties` setting is preserved.
32
+ */
33
+ export declare function mergeKernelGlobalsIntoContext(contextSchema: Record<string, any>, globalsSchema: Record<string, any>): Record<string, any>;
34
+ //# sourceMappingURL=kernel-globals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kernel-globals.d.ts","sourceRoot":"","sources":["../src/kernel-globals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,uDAAwD,CAAC;AAQzF;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,gBAAgB,EAAE,GAC5B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CA6BrB;AA2BD;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAClC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACjC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CASrB"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Kernel global names available in every CEL evaluation context at runtime.
3
+ * Both `buildKernelGlobalsSchema` (chain-access validation) and
4
+ * `buildTypedCelEnvironment` in cel-environment.ts (CEL type-checking)
5
+ * must stay in sync with this list.
6
+ *
7
+ * Note: `env` is only available in the root module context. Child modules
8
+ * loaded via Kernel.Import do not receive host environment variables.
9
+ * There is no `imports` namespace at runtime — import snapshots are stored
10
+ * under `resources.<alias>`.
11
+ */
12
+ export const KERNEL_GLOBAL_NAMES = ["variables", "secrets", "resources", "env"];
13
+ const SYSTEM_KINDS = new Set([
14
+ "Kernel.Definition",
15
+ "Kernel.Module",
16
+ "Kernel.Abstract",
17
+ ]);
18
+ /**
19
+ * Build a typed JSON Schema describing the kernel globals available in the
20
+ * given manifest set. Used to merge into `x-telo-context` schemas so that
21
+ * chain-access validation recognises kernel globals without module authors
22
+ * having to re-declare them.
23
+ *
24
+ * - `variables` / `secrets`: typed from the `Kernel.Module` declaration
25
+ * - `resources`: enumerates all non-system resource names
26
+ * - `env`: dynamic (runtime env vars, root module only)
27
+ */
28
+ export function buildKernelGlobalsSchema(manifests) {
29
+ const moduleManifest = manifests.find((m) => m.kind === "Kernel.Module");
30
+ const resourceProps = {};
31
+ for (const m of manifests) {
32
+ const name = m.metadata?.name;
33
+ if (!name || !m.kind)
34
+ continue;
35
+ // Kernel.Import snapshots are stored under resources.<alias> at runtime,
36
+ // so they appear here alongside regular resources.
37
+ if (!SYSTEM_KINDS.has(m.kind)) {
38
+ resourceProps[name] = { type: "object", additionalProperties: true };
39
+ }
40
+ }
41
+ return {
42
+ type: "object",
43
+ properties: {
44
+ variables: buildSchemaMapSchema(moduleManifest?.variables),
45
+ secrets: buildSchemaMapSchema(moduleManifest?.secrets),
46
+ resources: {
47
+ type: "object",
48
+ properties: resourceProps,
49
+ additionalProperties: false,
50
+ },
51
+ env: { type: "object", additionalProperties: true },
52
+ },
53
+ };
54
+ }
55
+ /** Wrap a JSON Schema property map (like `Kernel.Module.variables`) into a
56
+ * closed object schema suitable for chain-access validation. Falls back to
57
+ * an open map when the module declares no variables/secrets. */
58
+ function buildSchemaMapSchema(schemaMap) {
59
+ if (!schemaMap || typeof schemaMap !== "object" || Array.isArray(schemaMap)) {
60
+ return { type: "object", additionalProperties: true };
61
+ }
62
+ const props = {};
63
+ for (const [key, value] of Object.entries(schemaMap)) {
64
+ if (value !== null && typeof value === "object" && !Array.isArray(value)) {
65
+ props[key] = value;
66
+ }
67
+ }
68
+ if (Object.keys(props).length === 0) {
69
+ return { type: "object", additionalProperties: true };
70
+ }
71
+ return {
72
+ type: "object",
73
+ properties: props,
74
+ additionalProperties: false,
75
+ };
76
+ }
77
+ /**
78
+ * Merge kernel globals into an `x-telo-context` schema so chain-access
79
+ * validation recognises `variables`, `secrets`, `resources`, `env`
80
+ * without module authors having to re-declare them.
81
+ *
82
+ * Context-specific properties take precedence over globals (spread order).
83
+ * The original `additionalProperties` setting is preserved.
84
+ */
85
+ export function mergeKernelGlobalsIntoContext(contextSchema, globalsSchema) {
86
+ return {
87
+ ...contextSchema,
88
+ properties: {
89
+ ...globalsSchema.properties,
90
+ ...(contextSchema.properties ?? {}),
91
+ },
92
+ additionalProperties: contextSchema.additionalProperties ?? false,
93
+ };
94
+ }
@@ -1,6 +1,7 @@
1
- import type { ResourceManifest } from "@telorun/sdk";
1
+ import { type ResourceManifest } from "@telorun/sdk";
2
2
  import type { LoadOptions, LoaderInitOptions, ManifestAdapter } from "./types.js";
3
3
  export declare class Loader {
4
+ private static readonly moduleCache;
4
5
  protected adapters: ManifestAdapter[];
5
6
  constructor(extraAdaptersOrOptions?: ManifestAdapter[] | LoaderInitOptions);
6
7
  register(adapter: ManifestAdapter): this;
@@ -1 +1 @@
1
- {"version":3,"file":"manifest-loader.d.ts","sourceRoot":"","sources":["../src/manifest-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKrD,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,eAAe,EAGhB,MAAM,YAAY,CAAC;AAEpB,qBAAa,MAAM;IACjB,SAAS,CAAC,QAAQ,EAAE,eAAe,EAAE,CAAC;gBAE1B,sBAAsB,GAAE,eAAe,EAAE,GAAG,iBAAsB;IAiB9E,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAKxC,OAAO,CAAC,IAAI;IAMN,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAK/C,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAyE3E,eAAe,CACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,GAC5C,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAsCrC,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;CAoDnE"}
1
+ {"version":3,"file":"manifest-loader.d.ts","sourceRoot":"","sources":["../src/manifest-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKtE,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,eAAe,EAGhB,MAAM,YAAY,CAAC;AAEpB,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAG/B;IAEJ,SAAS,CAAC,QAAQ,EAAE,eAAe,EAAE,CAAC;gBAE1B,sBAAsB,GAAE,eAAe,EAAE,GAAG,iBAAsB;IAiB9E,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAKxC,OAAO,CAAC,IAAI;IAMN,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAK/C,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAgF3E,eAAe,CACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,GAC5C,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAsCrC,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;CAoDnE"}
@@ -1,8 +1,10 @@
1
+ import { isCompiledValue } from "@telorun/sdk";
1
2
  import { isMap, isPair, isScalar, isSeq, parseAllDocuments } from "yaml";
2
3
  import { HttpAdapter } from "./adapters/http-adapter.js";
3
4
  import { RegistryAdapter } from "./adapters/registry-adapter.js";
4
5
  import { precompileDoc } from "./precompile.js";
5
6
  export class Loader {
7
+ static moduleCache = new Map();
6
8
  adapters;
7
9
  constructor(extraAdaptersOrOptions = []) {
8
10
  const options = Array.isArray(extraAdaptersOrOptions)
@@ -35,6 +37,11 @@ export class Loader {
35
37
  }
36
38
  async loadModule(url, options) {
37
39
  const { text, source } = await this.pick(url).read(url);
40
+ const cacheKey = `${options?.compile ? "compiled" : "raw"}:${source}`;
41
+ const cached = Loader.moduleCache.get(cacheKey);
42
+ if (cached && cached.text === text) {
43
+ return cloneManifestArray(cached.manifests);
44
+ }
38
45
  const parsedDocuments = parseAllDocuments(text);
39
46
  const rawDocs = parsedDocuments.map((d) => d.toJSON());
40
47
  const offsets = documentLineOffsets(text);
@@ -98,7 +105,8 @@ export class Loader {
98
105
  }
99
106
  }
100
107
  }
101
- return resolved;
108
+ Loader.moduleCache.set(cacheKey, { text, manifests: resolved });
109
+ return cloneManifestArray(resolved);
102
110
  }
103
111
  async loadModuleGraph(entryUrl, onError) {
104
112
  const visited = new Set([entryUrl]);
@@ -192,6 +200,30 @@ export class Loader {
192
200
  return [...entry, ...importedDefs];
193
201
  }
194
202
  }
203
+ function cloneManifestArray(manifests) {
204
+ return manifests.map((manifest) => cloneManifestValue(manifest));
205
+ }
206
+ function cloneManifestValue(value) {
207
+ if (Array.isArray(value)) {
208
+ return value.map((entry) => cloneManifestValue(entry));
209
+ }
210
+ if (isCompiledValue(value)) {
211
+ return value;
212
+ }
213
+ if (value !== null && typeof value === "object") {
214
+ const source = value;
215
+ const clone = {};
216
+ for (const [key, entry] of Object.entries(source)) {
217
+ clone[key] = cloneManifestValue(entry);
218
+ }
219
+ const positionIndex = Object.getOwnPropertyDescriptor(source, "positionIndex");
220
+ if (positionIndex) {
221
+ Object.defineProperty(clone, "positionIndex", positionIndex);
222
+ }
223
+ return clone;
224
+ }
225
+ return value;
226
+ }
195
227
  function documentLineOffsets(text) {
196
228
  const offsets = [0];
197
229
  const lines = text.split("\n");
@@ -37,6 +37,6 @@ export declare function celTypeSatisfiesJsonSchema(celType: string, schema: Reco
37
37
  export declare function celPlaceholderForSchema(schema: Record<string, any>): unknown;
38
38
  /** Deep-clone `data`, replacing every pure CEL template string (`${{ expr }}`) with a
39
39
  * schema-appropriate placeholder so AJV can validate non-CEL fields without false positives. */
40
- export declare function substituteCelFields(data: unknown, schema: Record<string, any>): unknown;
40
+ export declare function substituteCelFields(data: unknown, schema: Record<string, any>, rootSchema?: Record<string, any>): unknown;
41
41
  export {};
42
42
  //# sourceMappingURL=schema-compat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema-compat.d.ts","sourceRoot":"","sources":["../src/schema-compat.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,GAAG,KAA0C,CAAC;AAEpD;0FAC0F;AAC1F,wBAAgB,SAAS,IAAI,YAAY,CAAC,OAAO,GAAG,CAAC,CAMpD;AAID,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;oEAEoE;AACpE,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC1B,mBAAmB,CAIrB;AAiDD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAelD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAGxE;AAuBD,mFAAmF;AACnF,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;CACd;AAED,0GAA0G;AAC1G,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,WAAW,EAAE,CAY/F;AAED;qFACqF;AACrF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,G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