-
Notifications
You must be signed in to change notification settings - Fork 1
Typert
Edge adaptation of the upstream typed Remote call system.
Upstream reference: Typert
Typert is a type-safe RPC framework that auto-generates endpoint descriptors from TypeScript service method signatures. It has three layers:
-
TypertRegistry (
ctx.typert) — manages generated schemas, package reflection, lookup providers, and context providers. -
TypertGatewayService (
ctx.typertGateway) — host-side dispatcher. Resolves strict generated definitions or SRC (Source Reflection Convention) markers against current cordis Services, validates parameters, and invokes the business method. -
Client Remote (
ctx.remote) — browser-side consumer. Mounts generated descriptors as typed methods, sends RPC viaconnection.rpc.call('/api', endpoint, ...).
Services like GoalService inherit from TypertRemoteService and use @Remote decorators to mark methods. The gateway discovers them automatically via SRC reflection — no manual routing needed.
TypertRegistry and TypertGatewayService are installed as-is. SRC reflection, lookup resolution, parameter validation, and codec handling are entirely upstream code.
Upstream uses Connection.rpc.intercept('/api', ...) to register the gateway on the webserver's composite handler. Edge has no Connection service. Instead, handleTypertRpc() in instance.ts (~20 lines) intercepts /api/{namespace}/{method} URLs via regex, extracts args from the request body, calls gateway.invoke(), and wraps the result as a ServerResponse.
- SRC reflection and strict descriptor resolution
- Lookup and context provider registration
- Parameter validation and codec handling
- Error classification (
TypertGatewayErrorcodes) - Client-side
ctx.remotebehavior (all handled by upstream client plugins)
Request path: HTTP POST → regex match → JSON parse → gateway.invoke() → SRC reflection → method call → response. SRC scans all cordis services once per endpoint and caches the result. Subsequent calls to the same endpoint skip discovery. The business method itself (e.g., GoalService.edit()) is synchronous. Typical DO-internal round-trip: single-digit milliseconds.
Any cordis Service with @Remote-decorated methods is automatically routable — no per-service Edge code needed. Currently covers goals (6 methods). Future services (skills, message-feedback, etc.) get routing for free.
| Component | Category | Edge Code |
|---|---|---|
| TypertRegistry | Reuse | One ctx.plugin() call |
| TypertGatewayService | Reuse | One ctx.plugin() call |
| HTTP routing | Bridge |
handleTypertRpc() (~20 lines) |
| Client Remote | Reuse | Upstream client plugins |
Key observation: Edge's Typert adaptation is a ~20-line transport bridge that translates HTTP POST into
gateway.invoke(). Everything else — discovery, validation, dispatch, error handling — is upstream code. Adding a new@Remoteservice requires zero Edge changes.
- Home
- Architecture
- Core & Scope
- Session & Persistence
- Model & Context
-
Execution & Tools
- Tools
- Bash
- Subprocess 🚫
- PTY Session 🚫
- Background Jobs 🚫
- Filesystem
- LSP Navigation 🚫
- Code Runtime 🚫
-
Web Access
⚠️ -
Skills
⚠️ - Workflow 🚫
- Subagent 🚫
-
Policy & Interaction
- Goal
- Approval 🚫
- Permission Presets 🚫
-
Sandbox
⚠️ - Plan Mode 🚫
- User Interaction 🚫
- Commands 🚫
- Schedule 🚫
- Message Feedback 🚫
- Platform & Access
- Development
- 首页
- 架构
- 核心与作用域
- 会话与持久化
- 模型与上下文
- 执行与工具
- 策略与交互
- 平台与接入
- 开发