@telorun/kernel

中文文档
0.127.0发布于 2026/11/02SEE LICENSE IN LICENSETypeScriptES Module

Telo Runtime - A lightweight, polyglot execution host.

原始使用文档
文档目录8 节
  1. 1. Core Concepts
  2. 2. Resource Definitions
  3. Capability
  4. Topology
  5. Inheritance
  6. 3. CEL Interpolation
  7. Interpolation
  8. 4. Telo.Definition

Telo Kernel

The Telo Kernel is the declarative execution host for Telo manifests. It loads YAML, compiles CEL expressions, resolves and registers controllers, indexes resource instances, and orchestrates the boot/teardown lifecycle of every kind it knows about.

Target: Node.js (Rust/Go ports planned)

Input: A module manifest YAML file or a directory of YAML files

1. Core Concepts

The Telo Kernel is a declarative execution host. You describe resources in YAML; the kernel loads them, wires up controllers, and keeps the process alive until all work is done.

The kernel performs three functions:

  • Loader: Reads YAML files, compiles CEL (!cel values, !interpolate holes), and resolves controller entrypoints.
  • Registry: Indexes resource instances by a composite key of module.Kind.name.
  • Kernel: Orchestrates the boot sequence, manages the event bus, and routes invocations.

Module loading and resource discovery happen during the load phase, before any resource is initialized.


2. Resource Definitions

Every resource in a manifest is an instance of a Telo.Definition. A definition declares several orthogonal facets:

FacetFieldPurpose
capabilityLifecycle roleOne of Runnable, Service, Invocable, Mount, Provider — mutually exclusive
topologyCompositionHow the kind is structured internally: Sequence, Router, Workflow
extendsInheritanceAbstract interface this kind fulfills (cross-module plugin pattern)
controllersExecutionPURL-referenced controller implementations

Capability

capability assigns a single lifecycle role. The kernel uses it to determine when to call init(), run(), or invoke() on the controller. A definition declares exactly one capability.

→ docs/capabilities.md

Topology

topology names the structural composition pattern of a kind — how it is assembled internally from steps, routes, or nodes. It drives built-in execution when no controller is declared, structural validation in the analyzer, and canvas rendering in the editor.

→ docs/topology.md (design proposal — not yet implemented)

Inheritance

extends declares that a definition fulfills an abstract interface (Telo.Abstract) declared by another module. This is the plugin pattern for subsystems like workflow backends.

→ docs/inheritance.md

For the complete Telo.Definition field reference, see docs/resource-definition.md.


3. CEL Interpolation

Before a manifest object is processed, every CEL expression — a !cel value, each hole of an !interpolate or !sql — is compiled. This runs as part of loading — any compilation error halts the boot sequence immediately.

Host environment variables reach CEL only through typed root entries: declare a variables:/secrets:/ports: entry with an env: key and read it as !cel "variables.X" / !cel "secrets.X" / !cel "ports.X".

variables:
  manifestPath:
    env: MY_MANIFEST_PATH
    type: string
resources:
  - !cel "variables.manifestPath"

Interpolation

  • !cel "expr" — one expression; the value keeps its CEL type (integer, boolean, …).
  • !interpolate "text ${{ expr }} text" — text with holes, always a string; each hole converts through CEL's string().

A plain string holding ${{ is never compiled: it is the deprecated untagged spelling, rewritten at load by the untagged-interpolation migration and refused (ERR_UNTAGGED_INTERPOLATION) where it survives.


4. Telo.Definition

Modules declare the resource kinds they handle using Telo.Definition:

kind: Telo.Definition
metadata:
  name: Server # fully-qualified kind: Http.Server
  module: Http
capability: Service # one of: Runnable, Service, Invocable, Mount, Provider, Template
schema: # JSON Schema — validated against each resource before create()
  type: object
  properties:
    port: { type: integer }
    host: { type: string }
  required: [port]
controllers:
  # Ordered list of Package URL (PURL) candidates — first match for the current runtime is used
  - pkg:npm/@telorun/run@>=1.0.0?local_path=./nodejs#sequence
  - pkg:cargo/telorun-run@>=1.0.0?local_path=./rust#sequence

When a Telo.Definition instance initializes, it resolves and loads the controller module and registers it with the kernel. For the full resolution algorithm (local path, host node_modules, registry cache) and PURL format, see controllers.md.

版本与发布记录

@telorun/kernel 共发布 169 个版本,首次发布于 2026/02/28;过去 12 个月发布了 169 个版本。

版本发布日期距今
0.127.0latest2026/11/02今天
0.126.02026/11/021 天前
0.125.12026/10/313 天前
0.125.02026/10/304 天前
0.124.02026/10/295 天前
0.123.12026/10/268 天前

关于 @telorun/kernel 的常见问题

@telorun/kernel 是什么?

Telo运行时-一个轻量级的多语言执行主机。

如何安装 @telorun/kernel?

在项目目录运行 npm install @telorun/kernel,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@telorun/sdk(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@telorun/kernel 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@telorun/kernel 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@telorun/kernel 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@telorun/kernel 可以商用吗?

@telorun/kernel 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@telorun/kernel 还在维护吗?

最新版本 0.127.0 发布于 2026/11/02(今天);至今共发布 169 个版本,其中过去 12 个月发布了 169 个;首次发布于 2026/02/28。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。