@telorun/cli 0.68.0 → 0.70.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 +99 -22
- package/dist/commands/cel.d.ts.map +1 -1
- package/dist/commands/cel.js +8 -4
- package/dist/commands/cel.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -283,13 +283,13 @@ Upgrading apps/my-app/telo.yaml
|
|
|
283
283
|
|
|
284
284
|
---
|
|
285
285
|
|
|
286
|
-
### `telo
|
|
286
|
+
### `telo run <path>` (default)
|
|
287
287
|
|
|
288
|
-
Load and run a Telo manifest.
|
|
288
|
+
Load and run a Telo manifest. `run` is the default command, so `telo ./manifest.yaml` and `telo run ./manifest.yaml` are the same thing.
|
|
289
289
|
|
|
290
290
|
**Arguments:**
|
|
291
291
|
|
|
292
|
-
- `
|
|
292
|
+
- `path` - Path to a YAML manifest file, a directory containing `telo.yaml`, or an HTTP(S) URL.
|
|
293
293
|
|
|
294
294
|
**Options:**
|
|
295
295
|
|
|
@@ -301,6 +301,73 @@ Load and run a Telo manifest.
|
|
|
301
301
|
|
|
302
302
|
The cache root defaults to `<manifest-dir>/.telo`; set `TELO_CACHE_DIR` to relocate it (resolved once and used for the manifest cache, compiled validators, analysis stamp, and npm install root alike).
|
|
303
303
|
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
### `telo search <query>`
|
|
307
|
+
|
|
308
|
+
Search resource kinds across every module the [hub](https://hub.telo.run) tracks, matched on name and description. This is how you find a kind before you know which module owns it.
|
|
309
|
+
|
|
310
|
+
**Arguments:**
|
|
311
|
+
|
|
312
|
+
- `query` - What the resource should do, in plain words.
|
|
313
|
+
|
|
314
|
+
**Options:**
|
|
315
|
+
|
|
316
|
+
- `--kinds` - Flat kind hits, one line per resource kind, instead of grouping by module
|
|
317
|
+
- `--json` - Emit the hub response as JSON
|
|
318
|
+
- `--hub-url <url>` - Base URL of the hub. Overrides `TELO_HUB_URL`.
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
telo search "key value store"
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
```
|
|
325
|
+
oci://ghcr.io/telorun/kv-store@0.4.0 — Durable key/value storage with atomic conditional writes…
|
|
326
|
+
Store (Provider) A configured durable key/value store: read a value with its version token…
|
|
327
|
+
oci://ghcr.io/telorun/cache@0.11.0 — Caching of computed or fetched values under a key…
|
|
328
|
+
Store (Provider) A configured cache backend that holds values under a key…
|
|
329
|
+
Lookup (Invocable) Reads a cached key and reports the outcome as a miss, a fresh hit or a stale hit…
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
Each hit prints the exact ref to paste into your `imports:` map, and the kinds that ref makes available.
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
### `telo module <subcommand> <ref>`
|
|
337
|
+
|
|
338
|
+
Inspect a module without importing it. `<ref>` is any form the runtime resolves: a local path, an `oci://` ref, a registry ref, or a direct URL.
|
|
339
|
+
|
|
340
|
+
| Subcommand | What it prints |
|
|
341
|
+
| --- | --- |
|
|
342
|
+
| `versions` | The module's published versions, newest first (one entry for a local path or direct URL) |
|
|
343
|
+
| `manifest` | The module's `telo.yaml`, verified against the inline hash when the ref is pinned |
|
|
344
|
+
| `digest` | The version's content-identity digest — a cheap read that downloads no payload |
|
|
345
|
+
| `resources` | The resource instances the module declares |
|
|
346
|
+
| `kinds` | The resource kinds the module defines, with capability and whether each is exported |
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
telo module versions oci://ghcr.io/telorun/console
|
|
350
|
+
telo module kinds oci://ghcr.io/telorun/console@0.16.0
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
### `telo cel <subcommand>`
|
|
356
|
+
|
|
357
|
+
Inspect and evaluate Telo's CEL environment — useful for checking an expression's syntax and result without wiring it into a manifest first.
|
|
358
|
+
|
|
359
|
+
| Subcommand | What it does |
|
|
360
|
+
| --- | --- |
|
|
361
|
+
| `functions` | Lists the CEL standard-library functions available in manifests |
|
|
362
|
+
| `eval <expression>` | Evaluates an expression — the body of a `!cel` scalar |
|
|
363
|
+
|
|
364
|
+
```bash
|
|
365
|
+
telo cel eval "'a-' + string(1+2)"
|
|
366
|
+
# a-3
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
`eval` runs with no manifest loaded, so `variables`, `resources`, `steps` and the rest of the manifest scope are not available; it is for the pure-expression half of CEL.
|
|
370
|
+
|
|
304
371
|
## Examples
|
|
305
372
|
|
|
306
373
|
### Simple HTTP Server
|
|
@@ -311,42 +378,52 @@ Create a file `server.yaml`:
|
|
|
311
378
|
kind: Telo.Application
|
|
312
379
|
metadata:
|
|
313
380
|
name: Example
|
|
381
|
+
version: 1.0.0
|
|
314
382
|
imports:
|
|
315
|
-
|
|
316
|
-
|
|
383
|
+
Http: oci://ghcr.io/telorun/http-server@<version>
|
|
384
|
+
Run: oci://ghcr.io/telorun/run@<version>
|
|
317
385
|
targets:
|
|
318
|
-
- Server
|
|
386
|
+
- !ref Server
|
|
387
|
+
ports:
|
|
388
|
+
http:
|
|
389
|
+
env: PORT
|
|
390
|
+
default: 8080
|
|
391
|
+
variables:
|
|
392
|
+
audience:
|
|
393
|
+
env: AUDIENCE
|
|
394
|
+
type: string
|
|
395
|
+
default: World
|
|
319
396
|
---
|
|
320
397
|
kind: Http.Server
|
|
321
398
|
metadata:
|
|
322
399
|
name: Server
|
|
323
|
-
|
|
324
|
-
baseUrl: http://localhost:8080
|
|
325
|
-
port: 8080
|
|
400
|
+
port: !cel "ports.http"
|
|
326
401
|
mounts:
|
|
327
402
|
- path: /api
|
|
328
|
-
|
|
403
|
+
mount: !ref HelloApi
|
|
329
404
|
---
|
|
330
405
|
kind: Http.Api
|
|
331
406
|
metadata:
|
|
332
407
|
name: HelloApi
|
|
333
|
-
module: Example
|
|
334
408
|
routes:
|
|
335
409
|
- request:
|
|
336
410
|
path: /hello
|
|
337
411
|
method: GET
|
|
338
412
|
handler:
|
|
339
|
-
kind:
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
413
|
+
kind: Run.Value
|
|
414
|
+
# `bindings:` names a temporary value: computed once, read by bare name
|
|
415
|
+
# wherever this resource's expressions need it.
|
|
416
|
+
bindings:
|
|
417
|
+
who: !cel "variables.audience"
|
|
418
|
+
value:
|
|
419
|
+
message: !cel "'Hello, ' + who + '!'"
|
|
420
|
+
greeted: !cel "who"
|
|
421
|
+
returns:
|
|
422
|
+
- status: 200
|
|
423
|
+
content:
|
|
424
|
+
application/json:
|
|
425
|
+
body:
|
|
426
|
+
message: !cel "result.message"
|
|
350
427
|
```
|
|
351
428
|
|
|
352
429
|
Run it:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cel.d.ts","sourceRoot":"","sources":["../../src/commands/cel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"cel.d.ts","sourceRoot":"","sources":["../../src/commands/cel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAiElC,wBAAgB,UAAU,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CAkC5C"}
|
package/dist/commands/cel.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { buildCelEnvironment, celFunctionCatalog } from "@telorun/templating";
|
|
2
|
-
import { nodeCelHandlers } from "@telorun/kernel";
|
|
3
|
-
/** JSON.stringify replacer: cel-js ints are BigInt, which JSON can't serialize. */
|
|
4
|
-
const bigintReplacer = (_k, v) => (typeof v === "bigint" ? Number(v) : v);
|
|
2
|
+
import { enableBigIntJson, nodeCelHandlers } from "@telorun/kernel";
|
|
5
3
|
function printFunctions(asJson) {
|
|
6
4
|
const catalog = celFunctionCatalog();
|
|
7
5
|
if (asJson) {
|
|
@@ -29,6 +27,12 @@ function printFunctions(asJson) {
|
|
|
29
27
|
console.log();
|
|
30
28
|
}
|
|
31
29
|
function evalExpression(expr, contextJson, asJson) {
|
|
30
|
+
// The one command that evaluates CEL without a kernel, so it installs the
|
|
31
|
+
// int64 JSON encoding itself — `telo cel eval --json 'size([1,2,3])'` has to
|
|
32
|
+
// print what the same expression produces in a run. Every other path reaches
|
|
33
|
+
// it through `boot()`, which is what keeps the CLI and an embedding Node app
|
|
34
|
+
// identical: hosting a kernel is the only thing that installs it.
|
|
35
|
+
enableBigIntJson();
|
|
32
36
|
let context;
|
|
33
37
|
try {
|
|
34
38
|
context = contextJson ? JSON.parse(contextJson) : {};
|
|
@@ -49,7 +53,7 @@ function evalExpression(expr, contextJson, asJson) {
|
|
|
49
53
|
process.exit(1);
|
|
50
54
|
}
|
|
51
55
|
if (asJson) {
|
|
52
|
-
console.log(JSON.stringify(result,
|
|
56
|
+
console.log(JSON.stringify(result, null, 2));
|
|
53
57
|
}
|
|
54
58
|
else {
|
|
55
59
|
console.log(typeof result === "bigint" ? result.toString() : result);
|
package/dist/commands/cel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cel.js","sourceRoot":"","sources":["../../src/commands/cel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAwB,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cel.js","sourceRoot":"","sources":["../../src/commands/cel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAwB,MAAM,qBAAqB,CAAC;AACpG,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGpE,SAAS,cAAc,CAAC,MAAe;IACrC,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IACrC,IAAI,MAAM,E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3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.0",
|
|
4
4
|
"description": "Telo CLI - Command-line interface for the Telo runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"telo",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@telorun/analyzer": "0.
|
|
37
|
+
"@telorun/analyzer": "0.56.1",
|
|
38
38
|
"@telorun/glob": "0.2.0",
|
|
39
|
-
"@telorun/ide-support": "0.11.
|
|
40
|
-
"@telorun/kernel": "0.
|
|
41
|
-
"@telorun/sdk": "0.
|
|
39
|
+
"@telorun/ide-support": "0.11.3",
|
|
40
|
+
"@telorun/kernel": "0.70.0",
|
|
41
|
+
"@telorun/sdk": "0.70.0",
|
|
42
42
|
"@telorun/templating": "0.12.0",
|
|
43
43
|
"dotenv": "^17.4.0",
|
|
44
44
|
"packageurl-js": "^2.0.1",
|