@oneciel-ai/ciel-runtime 0.2.22 → 0.2.23

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 (86) hide show
  1. package/CHANGELOG.md +108 -0
  2. package/README.md +150 -57
  3. package/ciel-runtime-stop.cmd +1 -0
  4. package/ciel-runtime.cmd +1 -0
  5. package/ciel-runtimectl.cmd +1 -0
  6. package/ciel_runtime.py +56 -53
  7. package/ciel_runtime_support/anthropic_tool_turns.py +81 -0
  8. package/ciel_runtime_support/architecture.py +17 -0
  9. package/ciel_runtime_support/channel_injection.py +113 -3
  10. package/ciel_runtime_support/channel_message_prompt.py +15 -0
  11. package/ciel_runtime_support/channel_pending_injection.py +28 -4
  12. package/ciel_runtime_support/channel_pending_poll.py +2 -0
  13. package/ciel_runtime_support/channel_terminal_context.py +6 -0
  14. package/ciel_runtime_support/channel_terminal_dispatch.py +2 -0
  15. package/ciel_runtime_support/channel_terminal_proxy.py +8 -2
  16. package/ciel_runtime_support/channel_wake_claim_repository.py +7 -0
  17. package/ciel_runtime_support/channel_wake_context.py +7 -3
  18. package/ciel_runtime_support/cli_parser.py +6 -0
  19. package/ciel_runtime_support/codex_backend_context.py +4 -0
  20. package/ciel_runtime_support/codex_turn_recovery.py +75 -12
  21. package/ciel_runtime_support/config_migrations.py +102 -10
  22. package/ciel_runtime_support/config_repository.py +9 -0
  23. package/ciel_runtime_support/event_settings_cli.py +284 -2
  24. package/ciel_runtime_support/openai_chat_passthrough.py +2 -0
  25. package/ciel_runtime_support/protocols/openai_responses.py +22 -18
  26. package/ciel_runtime_support/provider_adapters.py +7 -0
  27. package/ciel_runtime_support/provider_policy.py +10 -1
  28. package/ciel_runtime_support/provider_request_builder.py +9 -2
  29. package/ciel_runtime_support/provider_responses_passthrough.py +4 -0
  30. package/ciel_runtime_support/providers/__init__.py +2 -0
  31. package/ciel_runtime_support/providers/alibaba.py +33 -10
  32. package/ciel_runtime_support/providers/constants.py +1 -0
  33. package/ciel_runtime_support/providers/opencode.py +25 -5
  34. package/ciel_runtime_support/providers/opencode_go.py +3 -3
  35. package/ciel_runtime_support/providers/openrouter.py +76 -3
  36. package/ciel_runtime_support/providers/tabitoken.py +130 -0
  37. package/ciel_runtime_support/remote_instructions.py +20 -6
  38. package/ciel_runtime_support/remote_memory.py +515 -55
  39. package/ciel_runtime_support/responses_input_compatibility.py +14 -0
  40. package/ciel_runtime_support/router_http.py +5 -0
  41. package/ciel_runtime_support/runtime_constants.py +1 -1
  42. package/ciel_runtime_support/runtime_launch.py +9 -2
  43. package/ciel_runtime_support/runtime_paths.py +2 -0
  44. package/ciel_runtime_support/tool_side_effect_dedupe.py +7 -4
  45. package/ciel_runtime_support/transcript_delta_delivery.py +333 -0
  46. package/ciel_runtime_support/usage_events.py +45 -3
  47. package/ciel_runtime_support/usage_service.py +871 -0
  48. package/ciel_runtime_support/windows_conpty.py +108 -2
  49. package/ciel_runtime_support/workspace_mcp.py +4 -0
  50. package/docs/CLI-Reference.md +11 -0
  51. package/docs/Configuration.md +7 -2
  52. package/docs/MCP-Channels.md +7 -3
  53. package/docs/Module-Map.md +4 -0
  54. package/docs/Providers.md +32 -0
  55. package/docs/Remote-Memory.md +29 -10
  56. package/docs/Test-Suite.md +1 -0
  57. package/docs/journal/2026/08/20/kevin-wake-orphan-tool-repair.md +161 -0
  58. package/docs/journal/2026/08/20/nightly-push-local-deployment.md +59 -2
  59. package/docs/journal/2026/08/20/wing-remote-memory-replication-verification.md +107 -0
  60. package/docs/journal/2026/08/21/alibaba-singapore-qwen38-official-alignment.md +64 -0
  61. package/docs/journal/2026/08/21/codex-visible-sse-wake-submit-regression.md +85 -0
  62. package/docs/journal/2026/08/21/external-sse-wake-only-change-analysis.md +131 -0
  63. package/docs/journal/2026/08/21/hyundai-invalid-replayed-tool-name-repair.okf +88 -0
  64. package/docs/journal/2026/08/21/local-stale-temporary-runtime-pin-repair.okf +118 -0
  65. package/docs/journal/2026/08/21/transcript-compaction-external-events.okf +131 -0
  66. package/docs/journal/2026/08/21/wing-ai-net-mcp-boundary-diagnosis.okf +129 -0
  67. package/docs/journal/2026/08/21/wing-cold-start-wake-submit-repair.okf +161 -0
  68. package/docs/journal/2026/08/21/wing-powershell-memory-runaway.okf +101 -0
  69. package/docs/journal/2026/08/21/wing-repeated-reasoning-tool-turn-repair.okf +112 -0
  70. package/docs/journal/2026/08/21/wing-repeated-tool-guard-finalization.okf +81 -0
  71. package/docs/journal/2026/08/21/wing-working-directory-memory-deployment.md +110 -0
  72. package/docs/journal/2026/08/21/wing-workspace-state-memory-prompt-injection.md +88 -0
  73. package/docs/journal/2026/08/22/alibaba-singapore-dual-endpoint-wire-alignment.okf +142 -0
  74. package/docs/journal/2026/08/22/delluhiold-claude-compaction-empty-tool-name.okf +168 -0
  75. package/docs/journal/2026/08/22/remote-memory-relative-prompt-paths.okf +79 -0
  76. package/docs/journal/2026/08/22/remote-memory-root-system-prompt.okf +121 -0
  77. package/docs/journal/2026/08/23/claude-web-chat-stateless-mcp-repair.okf +97 -0
  78. package/docs/journal/2026/08/23/cross-runtime-token-usage-interfaces-research.okf +378 -0
  79. package/docs/journal/2026/08/23/main-0.2.23-readme-release.okf +81 -0
  80. package/docs/journal/2026/08/23/mia-openrouter-ox-alpha-latency-diagnosis.okf +146 -0
  81. package/docs/journal/2026/08/23/openrouter-opencode-ox-alpha-support.okf +114 -0
  82. package/docs/journal/2026/08/23/tabitoken-provider-model-catalog.okf +97 -0
  83. package/docs/journal/2026/08/23/usage-stream-snapshot-implementation.okf +134 -0
  84. package/docs/usage-observability.md +141 -0
  85. package/install.ps1 +24 -3
  86. package/package.json +2 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,108 @@
1
+ # Changelog
2
+
3
+ This file records stable Ciel Runtime releases. Changes are grouped by user-visible
4
+ capability, followed by the complete commit ledger merged into each release.
5
+
6
+ ## 0.2.23 — 2026-08-23
7
+
8
+ This release promotes 41 commits developed and validated after `0.2.22`. The
9
+ range changes 110 files with 9,990 insertions and 256 deletions.
10
+
11
+ ### Workspace memory and remote context
12
+
13
+ - Isolated downloaded memory by launch workspace instead of sharing one global tree.
14
+ - Synchronized manifest-defined memory into the actual runtime working directory.
15
+ - Added atomic download/overwrite support for OKF, Markdown, JSON, YAML, TOML, and text files.
16
+ - Appended verified memory-root/index guidance to native instructions and routed system context.
17
+ - Kept the memory pointer last through instruction refresh and wire-level prompt truncation.
18
+ - Projected memory paths relative to the workspace so replicated projects remain portable.
19
+
20
+ ### External messages and terminal delivery
21
+
22
+ - Restored complete routed SSE message bodies in Codex wake prompts.
23
+ - Added prompt-render detection and bounded retry for cold-start and deferred Windows ConPTY submissions.
24
+ - Preserved Unicode, whitespace, prompt offsets, and submitted-turn evidence across retries.
25
+ - Isolated Windows installer state and repaired stale temporary runtime pins.
26
+ - Preserved parallel tool results and rejected invalid replayed tool names before upstream submission.
27
+ - Recovered turns stopped by the repeated-tool guard without repeating the completed side effect.
28
+ - Restored Claude's stateless internal Ciel MCP launch configuration and `/ca/mcp` POST tool endpoint.
29
+
30
+ ### Transcripts and compaction
31
+
32
+ - Added incremental transcript-delta webhooks with CloudEvents, durable cursors, retry, and compaction-boundary events.
33
+ - Sanitized legacy Anthropic history containing empty `tool_use.name` values so affected sessions can compact and continue.
34
+
35
+ ### Providers and models
36
+
37
+ - Aligned Alibaba Model Studio Singapore `qwen3.8-max` context limits and workspace endpoint migration.
38
+ - Kept Alibaba OpenAI-compatible and Anthropic-compatible request wires distinct.
39
+ - Added OpenRouter and OpenCode Zen/Go routes for Ox Alpha/free catalog aliases.
40
+ - Forwarded supported OpenRouter reasoning-effort values instead of dropping them.
41
+ - Added the TaBiAI/Tabitoken provider with separate Anthropic Messages and OpenAI Chat endpoints and its verified model catalog.
42
+
43
+ ### Usage observability
44
+
45
+ - Added a workspace-scoped SQLite usage ledger for routed requests.
46
+ - Added authenticated event, resumable SSE stream, and time-range snapshot endpoints.
47
+ - Added per-consumer API keys with scopes, expiry, digest-only storage, and revocation.
48
+ - Added outbound CloudEvent delivery with per-endpoint durable cursors, stable idempotency keys, and retry after failed delivery.
49
+ - Added interval audit snapshots, including a daily default, grouped by provider, model, and runtime.
50
+ - Added rotation-safe backfill from earlier workspace JSONL usage logs and explicit legacy paths.
51
+ - Added equivalent startup environment variables and persistent `ciel-runtimectl` configuration commands.
52
+
53
+ ### Documentation and verification
54
+
55
+ - Added evidence journals for WING, delluhiold, Hyundai, Alibaba, OpenRouter,
56
+ TaBiAI, remote memory, transcript delivery, and usage observability incidents.
57
+ - Made usage backfill tests platform-native so the same contract passes on Windows and Linux CI.
58
+
59
+ ### Complete commit ledger
60
+
61
+ Every audited pre-release commit between `0.2.22` (`b7ea382`) and the release
62
+ preparation commit is listed below in chronological order.
63
+
64
+ - `60866dc` docs: trace external SSE wake-only delivery
65
+ - `13f5d91` fix: isolate remote memory to project workspaces
66
+ - `5e5bdec` fix: load remote memory from workspace state
67
+ - `6648365` fix: sync remote memory into launch workspace
68
+ - `21872ed` fix: keep memory pointer last in system prompt
69
+ - `c4071ef` fix: restore memory pointer after wire truncation
70
+ - `72a2474` fix: show routed SSE bodies in Codex wakes
71
+ - `98665f2` docs: record WING SSE wake verification
72
+ - `fc290a0` fix: retry Codex wake submission on ConPTY
73
+ - `b410b4c` fix: wait for Codex prompt render before submit
74
+ - `e4b86e6` docs: record Codex wake submit verification
75
+ - `fe7c4b0` feat: align Alibaba Singapore Qwen3.8
76
+ - `c8d920e` docs: record Qwen3.8 nightly verification
77
+ - `4eab5fb` docs: record runtime deployment diagnostics
78
+ - `5d24d79` fix: preserve parallel tool turns in routed sessions
79
+ - `5a43567` fix: repair stale Windows runtime pins
80
+ - `f6f7a27` fix: isolate Windows installer state
81
+ - `511148d` fix: drop invalid replayed tool names
82
+ - `87525c6` fix: wait for cold-start wake render
83
+ - `fad60f5` fix: track ConPTY prompt render offsets
84
+ - `f357b91` fix: retry deferred wake submissions
85
+ - `39f1119` fix: preserve wake render whitespace
86
+ - `46d0e4e` docs: record WING wake submission verification
87
+ - `bbf2181` fix: recover repeated tool guard turns
88
+ - `b70a228` feat: stream transcript deltas to webhooks
89
+ - `d7d9369` fix: sanitize invalid Anthropic tool history
90
+ - `5223153` docs: record delluhiold compaction verification
91
+ - `f62a72c` docs: record live compaction recovery
92
+ - `ce72ccc` fix: align Alibaba dual endpoint request wires
93
+ - `28ef138` feat: append remote memory guidance to system context
94
+ - `22a3006` fix: project remote memory paths relative to workspace
95
+ - `849814b` feat: add Ox Alpha provider routes
96
+ - `70c5d32` fix: sync OpenCode model endpoint catalog
97
+ - `65e69f1` docs: record Ox Alpha deployment evidence
98
+ - `c243e75` fix: forward OpenRouter reasoning effort
99
+ - `c37d0e4` docs: record OpenRouter effort deployment
100
+ - `d81eb00` feat: add Tabitoken provider
101
+ - `f98310b` docs: record Tabitoken deployment
102
+ - `4d1b68d` feat: add durable usage observability
103
+ - `45a9456` test: use platform-native backfill paths
104
+ - `549e6a6` docs: record usage observability deployment
105
+
106
+ ## 0.2.22 — 2026-08-20
107
+
108
+ - Published the previous stable runtime baseline. See commit `b7ea382`.
package/README.md CHANGED
@@ -1,24 +1,38 @@
1
+ <div align="center">
2
+
1
3
  # Ciel Runtime
2
4
 
3
- Ciel Runtime is a cross-platform launcher and local model-routing layer for AI coding agents. It can launch Claude Code, Codex, Codex App Server, or AGY and connect them to native or OpenAI-compatible model providers through one configuration.
5
+ **Run the coding agent you want on the model provider you choose.**
6
+
7
+ Ciel Runtime is a cross-platform launcher, local protocol router, and workspace
8
+ control plane for Claude Code, Codex, Codex App Server, AGY, Grok Build, and
9
+ compatible AI coding-agent CLIs.
10
+
11
+ [![npm](https://img.shields.io/npm/v/@oneciel-ai/ciel-runtime?label=npm)](https://www.npmjs.com/package/@oneciel-ai/ciel-runtime)
12
+ [![CI](https://github.com/OneCielAI/ciel-runtime/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/OneCielAI/ciel-runtime/actions/workflows/ci.yml)
13
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
14
+ [![Node.js 18+](https://img.shields.io/badge/node-%3E%3D18-339933?logo=node.js&logoColor=white)](package.json)
15
+ [![Python 3.10+](https://img.shields.io/badge/python-%3E%3D3.10-3776AB?logo=python&logoColor=white)](docs/Installation.md)
4
16
 
5
- ## Features
17
+ [Install](#install) · [Quickstart](#quickstart) · [Capabilities](#what-ciel-runtime-does) · [Providers](docs/Providers.md) · [CLI reference](docs/CLI-Reference.md) · [Changelog](CHANGELOG.md)
6
18
 
7
- - Launch Claude Code, Codex, Codex App Server, and AGY from one CLI.
8
- - Route Anthropic Messages, OpenAI Chat/Responses, and Ollama-compatible traffic.
9
- - Select models and providers without rewriting each agent's configuration.
10
- - Rotate API keys and observe provider rate limits.
11
- - Normalize tool calls, thinking blocks, streaming events, and context limits.
12
- - Deliver Web Chat and explicit Ciel messages to active agent sessions.
13
- - Run on Windows, macOS, and Linux.
19
+ </div>
14
20
 
15
- ## Requirements
21
+ ## Why Ciel Runtime
16
22
 
17
- - Node.js 18 or newer when installed from npm.
18
- - Python 3.10 or newer.
19
- - At least one supported coding-agent CLI or the credentials for the provider you intend to use.
23
+ Coding-agent CLIs and model APIs do not all speak the same protocol. Ciel
24
+ Runtime keeps the native CLI experience while handling provider selection,
25
+ protocol translation, model metadata, workspace context, message delivery, and
26
+ operational telemetry in one local runtime.
20
27
 
21
- The npm launcher searches for `py -3`, `python`, or `python3`. Set `CIEL_RUNTIME_PYTHON` to use a specific Python executable.
28
+ Use it when you need to:
29
+
30
+ - run multiple coding-agent CLIs without maintaining separate provider setups;
31
+ - connect Anthropic, OpenAI-compatible, Ollama, and provider-specific APIs;
32
+ - keep tools, thinking, streaming, and context behavior intact across protocol boundaries;
33
+ - synchronize project-scoped instructions and memory before every launch;
34
+ - deliver external messages to active sessions and export transcript deltas;
35
+ - audit routed token usage without storing prompts or provider credentials.
22
36
 
23
37
  ## Install
24
38
 
@@ -26,40 +40,46 @@ The npm launcher searches for `py -3`, `python`, or `python3`. Set `CIEL_RUNTIME
26
40
  npm install -g @oneciel-ai/ciel-runtime
27
41
  ```
28
42
 
29
- The package installs these commands:
43
+ The package installs three commands:
30
44
 
31
- - `ciel-runtime` and `cielrt`: configure and launch an agent.
32
- - `ciel-runtimectl`: inspect or change runtime configuration.
33
- - `ciel-runtime-stop`: stop the managed local router.
45
+ | Command | Purpose |
46
+ |---|---|
47
+ | `ciel-runtime` / `cielrt` | Configure and launch an agent runtime |
48
+ | `ciel-runtimectl` | Inspect and change providers, models, memory, events, and router settings |
49
+ | `ciel-runtime-stop` | Stop the managed local router |
34
50
 
35
- Manual installation instructions are available in [docs/Installation.md](docs/Installation.md).
51
+ Requirements: Node.js 18 or newer, Python 3.10 or newer, and at least one
52
+ supported coding-agent CLI or provider credential. Set `CIEL_RUNTIME_PYTHON` to
53
+ select a specific Python executable. See the [installation guide](docs/Installation.md)
54
+ for shell installers, unattended setup, and diagnostics.
36
55
 
37
- ## Quick start
56
+ ## Quickstart
38
57
 
39
- Select a provider and model interactively:
58
+ Start the interactive setup and launch Claude Code:
40
59
 
41
60
  ```sh
42
61
  ciel-runtime
43
62
  ```
44
63
 
45
- Or configure them explicitly:
64
+ Or configure a provider explicitly:
46
65
 
47
66
  ```sh
48
67
  ciel-runtimectl provider openrouter
49
68
  ciel-runtimectl set-api-key openrouter YOUR_API_KEY
50
69
  ciel-runtimectl model MODEL_ID
70
+ ciel-runtime
51
71
  ```
52
72
 
53
- Launch a specific runtime:
73
+ Launch another runtime while preserving its remaining CLI arguments:
54
74
 
55
75
  ```sh
56
- ciel-runtime # Claude Code by default
57
76
  ciel-runtime codex
58
77
  ciel-runtime agy
59
- ciel-runtime codex-app-server
78
+ ciel-runtime grok
79
+ ciel-runtime --ca-runtime codex-app-server
60
80
  ```
61
81
 
62
- Inspect the active configuration and router status:
82
+ Check the effective configuration and upstream compatibility:
63
83
 
64
84
  ```sh
65
85
  ciel-runtimectl status
@@ -67,70 +87,143 @@ ciel-runtimectl models
67
87
  ciel-runtimectl test
68
88
  ```
69
89
 
70
- See [docs/CLI-Reference.md](docs/CLI-Reference.md) for the complete command reference and [docs/Providers.md](docs/Providers.md) for provider-specific options.
90
+ ## What Ciel Runtime does
91
+
92
+ | Capability | What it provides |
93
+ |---|---|
94
+ | Runtime launch | Claude Code, Codex, Codex App Server, AGY, and Grok Build from one entrypoint |
95
+ | Provider routing | Native connections where supported; otherwise a loopback HTTP router with provider-owned endpoint and authentication rules |
96
+ | Protocol adaptation | Anthropic Messages, OpenAI Chat, OpenAI Responses, Ollama Chat, tool calls, thinking blocks, and SSE streams |
97
+ | Model control | Provider catalogs, context/output limits, reasoning effort, sampling options, API-key rotation, and rate-limit handling |
98
+ | Workspace context | Remote instructions plus atomic, workspace-scoped OKF/Markdown/JSON/YAML/TOML/text memory trees |
99
+ | External channels | Web Chat and explicit event delivery to live terminal sessions with runtime-specific submission policies |
100
+ | Transcript delivery | Incremental CloudEvent webhooks with durable cursors around normal turns and compaction boundaries |
101
+ | Usage observability | Workspace SQLite ledger, authenticated events/SSE/snapshots, outbound delivery, daily audits, and legacy JSONL backfill |
102
+ | Recovery | Invalid replay repair, repeated-tool protection, context compaction, Windows ConPTY Unicode handling, and launch-state isolation |
103
+
104
+ ## Runtimes and providers
105
+
106
+ Ciel separates the **runtime** (the coding-agent CLI) from the **provider** (the
107
+ model API). A runtime/provider pair can use one of three launch modes:
108
+
109
+ ```text
110
+ native -> the CLI connects directly to its supported provider endpoint
111
+ routed -> the CLI connects to Ciel's loopback router, which adapts the wire protocol
112
+ router -> Ciel runs only the local router for an external client
113
+ ```
71
114
 
72
- ## Native and routed modes
115
+ Dedicated adapters cover Anthropic, Ollama and Ollama Cloud, DeepSeek, OpenCode
116
+ Zen/Go, Kimi, Z.AI, Alibaba Model Studio, xAI, OpenRouter, TaBiAI, Fireworks,
117
+ NVIDIA NIM, vLLM, and LM Studio. A declarative catalog adds other
118
+ OpenAI-compatible services and private gateways. The authoritative list,
119
+ endpoint rules, and model constraints are in [Providers](docs/Providers.md).
73
120
 
74
- Ciel Runtime uses a provider's native endpoint when the selected agent and provider support a direct connection. Other combinations use a local HTTP router that translates request, response, streaming, thinking, and tool-call formats.
121
+ The router binds to `127.0.0.1` by default. External access is an explicit
122
+ debugging/operations feature and requires the configured administration token.
75
123
 
76
- The router binds to `127.0.0.1` by default. External router access is a debugging feature and should only be enabled on a trusted network with the external access token configured. Never expose an unauthenticated development router to the public internet.
124
+ ## Workspace context and memory
77
125
 
78
- Configuration is stored under `~/.config/ciel-runtime/` on macOS and Linux or `%APPDATA%\ciel-runtime\` on Windows. Override the location with `CIEL_RUNTIME_CONFIG_DIR`. Files containing credentials are written with restricted permissions where the platform supports them.
126
+ Remote Instructions can download the native instruction file used by the
127
+ selected CLI. Remote Memory can independently download a manifest-defined tree
128
+ into `<workspace>/.ciel/memory` before launch.
79
129
 
80
- ## Web Chat and MCP ownership
130
+ - Every file is staged and validated before the prior tree is replaced.
131
+ - Paths are constrained to the active workspace.
132
+ - Memory pointers are projected as workspace-relative paths so projects remain portable.
133
+ - The memory index guidance stays at the end of native and routed system context.
81
134
 
82
- Ciel Runtime delivers its own Web Chat and explicit wake messages. External MCP configuration, transports, subscriptions, reconnects, and lifecycle are owned by Claude Code, Codex, AGY, or the active CLI; Ciel does not discover or proxy external MCP servers.
135
+ See [Remote Memory](docs/Remote-Memory.md) and [Configuration](docs/Configuration.md).
83
136
 
84
- See [docs/MCP-Channels.md](docs/MCP-Channels.md) for the ownership boundary and the stateless internal tool endpoint.
137
+ ## Events, transcripts, and usage
85
138
 
86
- Workspace memory trees can be synchronized from a separate HTTP manifest at
87
- runtime launch. Ciel downloads the declared OKF, Markdown, JSON, YAML, TOML, or
88
- text files atomically and appends only the local index address to the native
89
- runtime instruction file. See [Remote Memory](docs/Remote-Memory.md).
139
+ Ciel's router exposes separate interfaces for inbound work and outbound
140
+ observability:
90
141
 
91
- ## Stable and nightly releases
142
+ - external events and Web Chat messages can wake an active routed session;
143
+ - transcript webhooks emit only new deltas and retain a retry cursor;
144
+ - routed token usage is stored per workspace without prompt or credential bodies;
145
+ - authenticated consumers can read immutable usage events, resume an SSE stream,
146
+ or request a time-range snapshot;
147
+ - outbound usage delivery retries with stable event IDs and emits periodic audit snapshots.
92
148
 
93
- Install the stable npm release:
149
+ Native/direct CLI traffic that bypasses the Ciel router is outside the usage
150
+ collector's visibility. See [Usage observability](docs/usage-observability.md),
151
+ [MCP and channels](docs/MCP-Channels.md), and the [CLI reference](docs/CLI-Reference.md).
152
+
153
+ ## Configuration
154
+
155
+ Configuration is stored under `~/.config/ciel-runtime/` on macOS/Linux and
156
+ `%APPDATA%\ciel-runtime\` on Windows. Workspace-owned state is isolated by the
157
+ resolved launch workspace. Override the global configuration directory with
158
+ `CIEL_RUNTIME_CONFIG_DIR`.
159
+
160
+ Common commands:
161
+
162
+ ```sh
163
+ ciel-runtimectl provider [NAME]
164
+ ciel-runtimectl models [PROVIDER]
165
+ ciel-runtimectl model MODEL_ID
166
+ ciel-runtimectl status
167
+ ciel-runtimectl remote-memory
168
+ ciel-runtimectl transcript-events
169
+ ciel-runtimectl usage-events
170
+ ```
171
+
172
+ Use the [CLI reference](docs/CLI-Reference.md) for every command and
173
+ [Configuration](docs/Configuration.md) for files, environment variables, and
174
+ security boundaries.
175
+
176
+ ## Releases
177
+
178
+ Stable releases are published from `main`:
94
179
 
95
180
  ```sh
96
181
  npm install -g @oneciel-ai/ciel-runtime@latest
97
182
  ```
98
183
 
99
- Install the latest nightly build:
184
+ Nightly builds are published from `nightly` for pre-release validation:
100
185
 
101
186
  ```sh
102
187
  npm install -g @oneciel-ai/ciel-runtime@nightly
103
188
  ```
104
189
 
105
- Nightly builds are intended for early validation and may change behavior before the next stable release.
190
+ See [CHANGELOG.md](CHANGELOG.md) for grouped release notes and the complete
191
+ commit ledger included in each stable release.
192
+
193
+ ## Documentation
194
+
195
+ | Topic | Guide |
196
+ |---|---|
197
+ | Install and unattended setup | [Installation](docs/Installation.md) · [Setup modes](docs/install.md) |
198
+ | Commands and settings | [CLI reference](docs/CLI-Reference.md) · [Configuration](docs/Configuration.md) |
199
+ | Providers and model routing | [Providers](docs/Providers.md) · [Router](docs/Router.md) |
200
+ | Runtime design | [Architecture](docs/Architecture.md) · [Module map](docs/Module-Map.md) |
201
+ | Memory and messaging | [Remote Memory](docs/Remote-Memory.md) · [MCP and channels](docs/MCP-Channels.md) |
202
+ | Operations | [Observability](docs/Observability.md) · [Usage observability](docs/usage-observability.md) |
203
+ | Verification | [Test suite](docs/Test-Suite.md) |
106
204
 
107
205
  ## Development
108
206
 
109
207
  ```sh
110
208
  npm test
111
209
  npm run lint
210
+ npm run check:docs
112
211
  npm pack --dry-run
113
212
  ```
114
213
 
115
- `npm test` compiles the Python entry points and runs the complete unittest suite. The full suite includes subprocess and channel integration tests and can take several minutes.
116
-
117
- Architecture and maintenance references:
118
-
119
- - [Architecture](docs/Architecture.md)
120
- - [Module map](docs/Module-Map.md)
121
- - [Router](docs/Router.md)
122
- - [Configuration](docs/Configuration.md)
123
- - [Observability](docs/Observability.md)
124
- - [Test suite](docs/Test-Suite.md)
214
+ `npm test` compiles the Python entrypoints and runs the unit, router, channel,
215
+ and runtime test groups. CI additionally checks Python 3.10 compatibility,
216
+ documentation links and release metadata, lint, and the npm package contents.
125
217
 
126
218
  ## Security
127
219
 
128
- - Keep provider API keys out of source control and shell history.
129
- - Keep the router bound to loopback unless remote debugging is explicitly required.
130
- - Treat request traces, response traces, transcripts, and event logs as potentially sensitive.
131
- - Review Tool Guard configuration before granting agents access to destructive tools.
220
+ - Keep provider and consumer API keys out of source control and shell history.
221
+ - Keep the router on loopback unless authenticated external access is required.
222
+ - Treat traces, transcripts, event payloads, and usage metadata as sensitive.
223
+ - Review Tool Guard policy before granting an agent destructive capabilities.
132
224
 
133
- Report security issues privately to the project maintainers rather than opening a public issue with credentials or request traces.
225
+ Report security issues privately to the maintainers; do not open a public issue
226
+ containing credentials, private prompts, or request traces.
134
227
 
135
228
  ## License
136
229
 
@@ -3,6 +3,7 @@ setlocal
3
3
 
4
4
  set "CIEL_RUNTIME_REGISTERED_HOME="
5
5
  for /f "tokens=2,*" %%A in ('reg query HKCU\Environment /v CIEL_RUNTIME_HOME 2^>nul') do if /i "%%A"=="REG_SZ" set "CIEL_RUNTIME_REGISTERED_HOME=%%B"
6
+ if defined CIEL_RUNTIME_REGISTERED_HOME if not exist "%CIEL_RUNTIME_REGISTERED_HOME%\ciel_runtime.py" set "CIEL_RUNTIME_REGISTERED_HOME="
6
7
  if defined CIEL_RUNTIME_HOME_OVERRIDE (
7
8
  set "CIEL_RUNTIME_SELECTED_HOME=%CIEL_RUNTIME_HOME_OVERRIDE%"
8
9
  ) else if defined CIEL_RUNTIME_REGISTERED_HOME (
package/ciel-runtime.cmd CHANGED
@@ -3,6 +3,7 @@ setlocal
3
3
 
4
4
  set "CIEL_RUNTIME_REGISTERED_HOME="
5
5
  for /f "tokens=2,*" %%A in ('reg query HKCU\Environment /v CIEL_RUNTIME_HOME 2^>nul') do if /i "%%A"=="REG_SZ" set "CIEL_RUNTIME_REGISTERED_HOME=%%B"
6
+ if defined CIEL_RUNTIME_REGISTERED_HOME if not exist "%CIEL_RUNTIME_REGISTERED_HOME%\ciel_runtime.py" set "CIEL_RUNTIME_REGISTERED_HOME="
6
7
  if defined CIEL_RUNTIME_HOME_OVERRIDE (
7
8
  set "CIEL_RUNTIME_SELECTED_HOME=%CIEL_RUNTIME_HOME_OVERRIDE%"
8
9
  ) else if defined CIEL_RUNTIME_REGISTERED_HOME (
@@ -3,6 +3,7 @@ setlocal
3
3
 
4
4
  set "CIEL_RUNTIME_REGISTERED_HOME="
5
5
  for /f "tokens=2,*" %%A in ('reg query HKCU\Environment /v CIEL_RUNTIME_HOME 2^>nul') do if /i "%%A"=="REG_SZ" set "CIEL_RUNTIME_REGISTERED_HOME=%%B"
6
+ if defined CIEL_RUNTIME_REGISTERED_HOME if not exist "%CIEL_RUNTIME_REGISTERED_HOME%\ciel_runtime.py" set "CIEL_RUNTIME_REGISTERED_HOME="
6
7
  if defined CIEL_RUNTIME_HOME_OVERRIDE (
7
8
  set "CIEL_RUNTIME_SELECTED_HOME=%CIEL_RUNTIME_HOME_OVERRIDE%"
8
9
  ) else if defined CIEL_RUNTIME_REGISTERED_HOME (