zelari-code 1.34.0 → 1.35.1

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/LICENSE CHANGED
@@ -1,22 +1,55 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Anathema Studio
4
- https://anathema-studio.com/
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy
7
- of this software and associated documentation files (the "Software"), to deal
8
- in the Software without restriction, including without limitation the rights
9
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the Software is
11
- furnished to do so, subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in all
14
- copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- SOFTWARE.
1
+ Apache License
2
+
3
+ Version 2.0, January 2004
4
+
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
16
+
17
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
18
+
19
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
20
+
21
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
22
+
23
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
24
+
25
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
26
+
27
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
28
+
29
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
30
+
31
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
32
+
33
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
34
+
35
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
36
+
37
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and
38
+
39
+ You must cause any modified files to carry prominent notices stating that You changed the files; and
40
+
41
+ You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
42
+
43
+ If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
package/README.md CHANGED
@@ -26,7 +26,7 @@
26
26
  > AI Council coding agent CLI — multi-agent orchestration with slash commands, provider-agnostic LLM streaming, and self-update.
27
27
 
28
28
  ![Version](https://img.shields.io/npm/v/zelari-code)
29
- ![License](https://img.shields.io/badge/license-MIT-green)
29
+ ![License](https://img.shields.io/badge/license-Apache--2.0-blue)
30
30
  ![Node](https://img.shields.io/node/v/zelari-code)
31
31
 
32
32
  By **[Anathema Studio](https://anathema-studio.com/)** ·
@@ -42,7 +42,7 @@ By **[Anathema Studio](https://anathema-studio.com/)** ·
42
42
 
43
43
  📖 **[Full user guide (IT)](./docs/GUIDA.md)** — install, TUI, slash commands, council, skills, workspace, headless, MCP, Desktop.
44
44
 
45
- **Zelari Code** is an open-source **AI council coding agent** for the terminal: a multi-agent pipeline (Caronte, Nettuno, Gerione, Plutone, Minosse, Lucifero), a single-agent mode for focused work, and optional **zelari** missions that loop until a deliverable is done. It ships a rich TUI (Ink + React), slash commands, plan/build phases, and provider-agnostic LLM streaming (OpenAI-compatible, xAI Grok with OAuth, GLM/Z.AI, MiniMax, DeepSeek). The reusable runtime is published as **[`@zelari/core`](https://www.npmjs.com/package/@zelari/core)** (MIT).
45
+ **Zelari Code** is an open-source **AI council coding agent** for the terminal: a multi-agent pipeline (Caronte, Nettuno, Gerione, Plutone, Minosse, Lucifero), a **kraken** super-agent (default; aliases `agent`/`single`) that can spawn explore/general/verify tentacles, and optional **zelari** missions that loop until a deliverable is done. It ships a rich TUI (Ink + React), slash commands, plan/build phases, and provider-agnostic LLM streaming (OpenAI-compatible, xAI Grok, ChatGPT, Anthropic, GLM/Z.AI, MiniMax, DeepSeek). OAuth via `/login grok`, `/login chatgpt`, `/login anthropic`. The reusable runtime is published as **[`@zelari/core`](https://www.npmjs.com/package/@zelari/core)** (Apache-2.0). Current line: **1.35.1**.
46
46
 
47
47
  ```bash
48
48
  npm install -g zelari-code
@@ -205,11 +205,11 @@ Full reference: **[docs/GUIDA.md](./docs/GUIDA.md#comandi-slash)** (all flags, e
205
205
  | `/provider`, `/provider <id>` | Show / switch LLM provider |
206
206
  | `/provider custom <url>` | Self-hosted endpoint (Ollama, LM Studio, …) |
207
207
  | `/model <name>`, `/models` | Set model / list discovered models |
208
- | `/skill <id> [input]` | Invoke a coding skill (23 built-in + SKILL.md) |
208
+ | `/skill <id> [input]` | Invoke a coding skill (26 built-in + SKILL.md) |
209
209
  | `/skill-stats [id]` | Skill invocation stats |
210
210
  | `/skill-compare <id1> <id2>` | Compare two skills' stats |
211
211
  | `/council <input>` | Run the 6-member council pipeline |
212
- | `/zelari <input>` | Run an autonomous mission — multi-run council until the MVP slice is complete |
212
+ | `/zelari <input>` | Run an autonomous mission — design@council then build@kraken until the MVP slice is complete |
213
213
  | `/council-feedback <id> <1-5>` | Rate a council member |
214
214
  | `/promote-member <id>` | Promote a council member to a skill |
215
215
  | `/sessions`, `/resume <id>`, `/new` | Session management |
@@ -219,13 +219,16 @@ Full reference: **[docs/GUIDA.md](./docs/GUIDA.md#comandi-slash)** (all flags, e
219
219
  | `/steer <text>`, `/steer --interrupt <text>` | Queue follow-up during a run |
220
220
  | `/workspace …` | `.zelari/` artifacts + `AGENTS.MD` |
221
221
  | `/update`, `/update --yes` | Check / install CLI updates |
222
- | `/mode [agent\|council\|zelari]` | Switch dispatch mode (shift+tab fallback) |
222
+ | `/mode [kraken\|council\|zelari]` | Switch dispatch mode (`agent`/`single` = kraken aliases) |
223
+ | `/kraken [sessionId]` | Tentacle radio; `/kraken graph <goal>` runs a parallel DAG |
223
224
  | `/plan [goal]`, `/build [goal]` | Work phase: explore/design only vs implement (orthogonal to mode) |
225
+ | `/trust [path]`, `/trust remove [path]` | Folder trust for project MCP + lifecycle hooks |
226
+ | `/integrations` | MCP presets (`composio`, `qwen-mm-plugins`, `cua`) |
224
227
  | `/checkpoint [label]` | Snapshot the working tree (rollback target) |
225
228
  | `/rollback [id\|latest]` | Restore a checkpoint (revert / restore files atomically) |
226
229
  | `/index` | Build / refresh the semantic search index |
227
230
 
228
- **TUI:** `shift+tab` cycles **kraken** → **council** → **zelari** mode for free-form prompts. Use `/mode` when the terminal captures shift+tab. Work **phase** is orthogonal: `/plan` (no project writes) vs `/build` (full tools) — same axes as Desktop Mode / Phase bars.
231
+ **TUI:** `shift+tab` cycles **kraken** → **council** → **zelari** for free-form prompts (`agent` is a kraken alias). Use `/mode` when the terminal captures shift+tab. Work **phase** is orthogonal: `/plan` (no project writes) vs `/build` (full tools) — same axes as Desktop Mode / Phase bars.
229
232
 
230
233
  ## Headless Mode
231
234
 
@@ -256,13 +259,14 @@ Disable auto-check: `ANATHEMA_DEV=1 zelari-code`
256
259
  ## Features
257
260
 
258
261
  - 🤖 **Multi-agent council** — 6 roles (Caronte, Nettuno, Gerione, Plutone, Minosse, Lucifero) with feedback loops and member promotion
259
- - **Zelari-mode** — autonomous multi-run missions: a free-form prompt is turned into a structured mission brief, then the council loops (design implementation) until the MVP slice's `completion.ok` is green or the iteration budget runs out
262
+ - 🐙 **Kraken super-agent** — default mode (aliases `agent`/`single`): lead that spawns `task` tentacles (`explore` / `general` / `verify`), optional git worktrees, and **Kraken Graph** (`/kraken graph`) for a parallel DAG
263
+ - ⚡ **Zelari-mode** — autonomous multi-run missions: a free-form prompt becomes a mission brief, then **design@council → build@kraken** until the MVP slice's `completion.ok` is green or the iteration budget runs out
260
264
  - 🧠 **Project memory** — zero-dependency file-based recall (`.zelari/memory/`), fed into the council as RAG context between mission slices (opt-out with `ZELARI_MEMORY=0`)
261
- - ⇧⇥ **Agent/council/zelari mode switch** — `shift+tab` cycles free-form prompts between the single agent, the full council pipeline, and an autonomous mission (mode shown in the status line)
265
+ - ⇧⇥ **Kraken/council/zelari mode switch** — `shift+tab` cycles free-form prompts between the kraken lead, the full council pipeline, and an autonomous mission (mode shown in the status line)
262
266
  - 🎨 **Rich TUI** — Ink + React: native-scrollback chat stream, input bar with status line below it (mode · provider · model · session · cwd · execution timer)
263
267
  - 🗂️ **Live git sidebar** — right-hand panel with working-tree changes (`+added`/`-removed` per file, refreshed every 4s; auto-hidden on narrow terminals)
264
268
  - ⏱️ **Execution timer** — elapsed time of the in-flight turn in the status line (`⏱ 12s`), frozen as `last 34s` when the run completes
265
- - 🧠 **Provider-agnostic** — OpenAI-compatible APIs (OpenAI, Together, Groq, custom), xAI Grok with OAuth refresh, GLM/Z.AI
269
+ - 🧠 **Provider-agnostic** — OpenAI-compatible APIs (OpenAI, Together, Groq, custom), xAI Grok / ChatGPT / Anthropic OAuth, GLM/Z.AI, MiniMax, DeepSeek; optional `ZELARI_LOCAL_CLI=claude`
266
270
  - 🛠️ **Built-in tools** — filesystem (read/write/edit), shell (bash), search (grep), web fetch/search
267
271
  - 🧠 **LSP code intelligence** (`lsp_*` tools) — go-to-definition, find references, hover type, document symbols, rename symbol via real language servers (tsserver, pyright, …)
268
272
  - 🌲 **AST structural tools** (`ast_*` tools) — symbol outline + find-by-name via the TypeScript compiler API, no language server needed
@@ -271,35 +275,37 @@ Disable auto-check: `ANATHEMA_DEV=1 zelari-code`
271
275
  - 🔁 **Post-edit diagnostics loop** — after every `edit_file`/`write_file` the harness runs project lint/compile (`eslint`, `ruff`, LSP-pluggable) and surfaces the errors to the model in the same turn (opt out: `ZELARI_DIAGNOSTICS=0`)
272
276
  - 💾 **Prompt-cache accounting** — tracks prompt-cache hit rate per provider/model and surfaces it in the status bar (`cache 73%`) so you can see when a session is amortizing its prefix
273
277
  - 🧷 **Workspace checkpoints** — `/checkpoint [label]` + `/rollback [id|latest]` use git plumbing to snapshot the working tree (tracked + untracked) and restore it atomically; every zelari-mode mission takes one before starting
274
- - 🤝 **Sub-agent delegation** (`task` tool) — delegate a focused read-only research sub-task to an isolated sub-agent with its own fresh context, max 12 tool turns, no write/bash/recursion
275
- - 📚 **23 coding skills** (+ user `SKILL.md` from `.zelari/skills/`, `.claude/skills/`, …)
278
+ - 🤝 **Sub-agent delegation** (`task` tool) — isolated tentacles: `explore` (read-only), `general` (bounded writes), `verify` (tests/checks); optional `scope[]` + `acceptance[]`; no nested `task`
279
+ - 📚 **26 coding skills** (+ user `SKILL.md` from `.zelari/skills/`, `.claude/skills/`, …) including `schema-loop`, `computer-use-cua`, `qwen-mm-plugins-install-setup`
276
280
  - 🔄 **Cross-provider failover** — automatic retry with provider swap on transient errors
277
281
  - 📊 **Metrics + skill history** — fire-and-forget logging to `~/.tmp/zelari-code/`
278
282
  - 🗜️ **Session management** — JSONL transcripts, resume across restarts, compaction
279
283
  - 🌿 **Branch isolation** — session snapshots per branch
280
284
  - 🔌 **MCP** — external MCP servers via `.zelari/mcp.json` or `~/.zelari-code/mcp.json`; Desktop **Extensions** store for one-click install
281
285
  - 🔐 **SSH targets** — configure hosts for deploy/monitor (password, agent, or key); tools `ssh_status` / `ssh_run` with allowlist; `ZELARI_SSH=0` kill switch
282
- - 🖥️ **Zelari Desktop** — Tauri shell with chat UI, project tree, Settings, dual updates (app vs npm CLI), multi-turn history, optional overlay HUD
286
+ - 🖥️ **Zelari Desktop** — Tauri 2 shell with chat UI, project tree, Settings (OAuth Sign in/Refresh/Sign out), Workbench Plan/Tasks, dual updates (app vs npm CLI), multi-turn history, optional overlay HUD
283
287
  - 📱 **Companion host + Android** — `zelari-code serve` (SSE over Tailscale/LAN) + Settings → Start companion serve; MVP app in `apps/companion-android/`
284
288
  - 🧩 **Skills store (Desktop)** — create/remove user & project `SKILL.md`; import skill from URL with the selected model; `/skills` picker in TUI
285
289
  - 📎 **@-tag paths** — tag workspace files/folders in Desktop composer and CLI prompts
286
- - ◇◆ **Plan / build phase** — `/plan` explores without project writes; `/build` implements with full tools (independent of agent/council/zelari mode)
290
+ - ◇◆ **Plan / build phase** — `/plan` explores without project writes; `/build` implements with full tools (independent of kraken/council/zelari mode)
291
+ - 🛡️ **Folder trust + lifecycle hooks** — project MCP/hooks load only for trusted folders (`/trust`, `zelari-code --inspect`); hooks are fail-open
292
+ - 👁️ **Native vision** — `@image.jpg` (and Desktop drop-to-attach) inlines pixels to vision-capable models; no third-party vision API
287
293
  - 🆕 **Self-update** — `/update` slash command + silent registry check on startup
288
294
 
289
295
  ## Architecture
290
296
 
291
297
  ```
292
- zelari-code (CLI, MIT)
293
- ├── src/cli/ # Ink TUI, provider config, workspace, wizard, MCP
298
+ zelari-code (CLI, Apache-2.0) — v1.35.1
299
+ ├── src/cli/ # Ink TUI, providers, workspace, wizard, MCP, SSH, serve
294
300
  │ ├── components/ # ChatStream, InputBar, Sidebar, StatusBar, …
295
- │ ├── slashHandlers/ # /provider, /workspace, /update, …
301
+ │ ├── slashHandlers/ # /provider, /workspace, /kraken, /trust,
296
302
  │ └── workspace/ # .zelari/ persistence + AGENTS.MD curation
297
- └── packages/core/ # @zelari/core (MIT, npm)
298
- ├── core/ # AgentHarness — provider-neutral agent loop
299
- ├── agents/ # Council API, roles, 23 skills, tool schemas
300
- ├── harness/tools/ # Tool registry + filesystem/shell/search/web
301
- ├── events/ # BrainEvent contract
302
- └── council/ # Run mode, tier banners
303
+ ├── packages/core/ # @zelari/core (Apache-2.0, npm)
304
+ ├── core/ # AgentHarness — provider-neutral agent loop
305
+ ├── agents/ # Council API, roles, 26 skills, tool schemas
306
+ │ └── council/ # Run mode, tier banners
307
+ ├── apps/desktop/ # Optional Tauri 2 shell (spawns CLI --headless)
308
+ └── apps/companion-android/ # Thin client for `zelari-code serve`
303
309
  ```
304
310
 
305
311
  `AgentHarness` takes (model, provider, messages, tools) + a streaming function and yields `AsyncIterable<BrainEvent>`. Mixed tool batches run **segmented**: contiguous read-only calls in parallel, write/execute tools as serial barriers (opt out: `ZELARI_PARALLEL_TOOLS=0`). See [MIGRATION.md](./MIGRATION.md) for the package boundary.
@@ -313,6 +319,9 @@ zelari-code (CLI, MIT)
313
319
  | `OPENAI_BASE_URL` | Custom OpenAI-compatible endpoint |
314
320
  | `GLM_API_KEY` | GLM/Z.AI API key |
315
321
  | `GROK_API_KEY` | xAI Grok API key (alternative to OAuth) |
322
+ | `CHATGPT_API_KEY` | ChatGPT API key (optional if using `/login chatgpt` OAuth) |
323
+ | `ANTHROPIC_API_KEY` | Anthropic API key (optional if using `/login anthropic` OAuth) |
324
+ | `ZELARI_LOCAL_CLI` | Drive the harness via an external CLI (`claude` stream-json) |
316
325
  | `DEEPSEEK_API_KEY` | DeepSeek API key (models auto-discovered; default `deepseek-v4-pro`) |
317
326
  | `MINIMAX_API_KEY` | MiniMax API key |
318
327
  | `ANATHEMA_DEV=1` | Disable silent update check on startup |
@@ -346,6 +355,11 @@ zelari-code (CLI, MIT)
346
355
  | `ZELARI_MAX_TOOL_LOOP_HARD` | Hard ceiling on tool-loop iterations |
347
356
  | `ZELARI_PROVIDER_TIMEOUT_MS` | Hard timeout on provider HTTP (default 5 min) |
348
357
  | `ZELARI_MISSION_MAX_STALL` | Zelari-mode: consecutive zero-write impl slices before stall |
358
+ | `ZELARI_KRAKEN_WORKTREE=1` | Isolate `task` general tentacles in git worktrees |
359
+ | `ZELARI_KRAKEN_GRAPH=0` | Disable Kraken Graph engine |
360
+ | `ZELARI_FOLDER_TRUST` | `1` trust all / `0` lockdown / `<path>` trust one folder |
361
+ | `ZELARI_VISION=0` | Disable native image inlining |
362
+ | `ZELARI_SCHEMA_LOOP=0` | Disable world-model tools (`run_backtest`, …) |
349
363
 
350
364
  See **[docs/GUIDA.md](./docs/GUIDA.md#variabili-dambiente)** for the full list.
351
365
 
@@ -357,11 +371,16 @@ The CLI persists council output (decisions, risks, docs, plan, reviews) into a *
357
371
 
358
372
  ```
359
373
  .zelari/ # auto-gitignored, per-project
360
- ├── plan.md # phases / tasks / milestones (Markdown + YAML frontmatter)
374
+ ├── plan.md / plan.json # phases / tasks / milestones
361
375
  ├── risks.md # risk register (live, ordered by severity)
362
- ├── decisions/ # ADRs (Architecture Decision Records) — 001-<slug>.md
376
+ ├── decisions/ # ADRs — 001-<slug>.md
363
377
  ├── reviews/ # Minosse verdict per council run
364
- └── docs/ # doc drafts produced by the council
378
+ ├── docs/ # doc drafts produced by the council
379
+ ├── memory/ # file-based project memory (zelari missions)
380
+ ├── radio/ # Kraken tentacle progress bus
381
+ ├── kraken/ # last-graph.json (DAG resume)
382
+ ├── world/ # schema-loop hypothesis / checks / timeline
383
+ └── hooks/ # project lifecycle hooks (trusted folders only)
365
384
  AGENTS.MD # committed at project root, auto-curated from .zelari/
366
385
  ```
367
386
 
@@ -406,6 +425,7 @@ See [`docs/plans/2026-07-01-council-workspace-cli-stubs.md`](./docs/plans/2026-0
406
425
 
407
426
  | Doc | Description |
408
427
  |---|---|
428
+ | [PRINCIPLES.md](./PRINCIPLES.md) | First principles (P1–P6) + enforcement map |
409
429
  | [docs/GUIDA.md](./docs/GUIDA.md) | **Full user guide** (Italian) |
410
430
  | [docs/TOOLS.md](./docs/TOOLS.md) | Tool map (builtin, workspace, MCP, SSH, plan phase) |
411
431
  | [docs/media/](./docs/media/) | English marketing stills + trailer |
@@ -443,9 +463,9 @@ npm run typecheck
443
463
  - [Product page](https://anathema-studio.com/zelari-code) (IT: [zelari-codice](https://anathema-studio.com/zelari-codice)) — Anathema Studio
444
464
  - [GitHub repository](https://github.com/N-THEM-Studio/zelari-code)
445
465
  - [npm: zelari-code](https://www.npmjs.com/package/zelari-code) — CLI
446
- - [npm: @zelari/core](https://www.npmjs.com/package/@zelari/core) — reusable runtime (MIT)
466
+ - [npm: @zelari/core](https://www.npmjs.com/package/@zelari/core) — reusable runtime (Apache-2.0)
447
467
  - [Site docs](https://anathema-studio.com/zelari-code/docs) (IT: [documentazione](https://anathema-studio.com/zelari-codice/documentazione))
448
468
 
449
469
  ## License
450
470
 
451
- [MIT](./LICENSE) © 2026 [Anathema Studio](https://anathema-studio.com/).
471
+ [Apache-2.0](./LICENSE) © 2026 [Anathema Studio](https://anathema-studio.com/).
@@ -319,7 +319,8 @@ export async function runCompanionServe(opts = {}) {
319
319
  ` Auth Authorization: Bearer <token>\n` +
320
320
  ` ${tokenHint}\n` +
321
321
  ` Projects (${projects.length}): ${projects.map((p) => p.id).join(', ')}\n` +
322
- ` Phone use http://<PC-LAN-or-Tailscale-IP>:${port} (not 127.0.0.1 on the phone)\n` +
322
+ ` Phone scan the QR in Zelari Desktop → Connections → Mobile connection\n` +
323
+ ` or open http://<PC-Tailscale-IP>:${port} (never 127.0.0.1 on the phone)\n` +
323
324
  ` Stop Ctrl+C (keep this window open)\n\n`);
324
325
  if (created) {
325
326
  process.stderr.write(` Token (copy now): ${token}\n\n`);
@@ -1 +1 @@
1
- {"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../src/cli/companion/serve.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,YAAY,EAA6C,MAAM,WAAW,CA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CAAC,CAAE,CAAC,CAAC;YAC5B,CAAC,EAAE,CAAC;QACN,CAAC;IACH,CAAC;IACD,MAAM,OAAO,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC9B,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAChE,OAAO;QACL,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;QAC9C,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC;QACrB,QAAQ;QACR,eAAe,EAAE,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;KAClD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * streamScrub — throttle cleanAgentContent to the TUI commit cadence.
3
+ *
4
+ * cleanAgentContent runs ~35 regexes over the full accumulated buffer.
5
+ * Streaming at 50–200 deltas/sec made that quadratic. The render path is
6
+ * already capped at 16ms, so scrubbing faster than that cannot be seen.
7
+ *
8
+ * Callers accumulate raw text and pass it here; `next()` re-scrubs at most
9
+ * once per interval. `finalize()` always scrubs the current buffer so the
10
+ * last tokens of a message are not dropped when the last deltas fell inside
11
+ * the throttle window.
12
+ */
13
+ import { cleanAgentContent } from '@zelari/core';
14
+ export const STREAM_SCRUB_INTERVAL_MS = 16;
15
+ export function createStreamScrubber(intervalMs = STREAM_SCRUB_INTERVAL_MS) {
16
+ let lastAt = 0;
17
+ let lastScrubbed = null;
18
+ return {
19
+ next(raw, now = Date.now()) {
20
+ if (lastScrubbed === null || now - lastAt >= intervalMs) {
21
+ lastAt = now;
22
+ lastScrubbed = cleanAgentContent(raw);
23
+ }
24
+ return lastScrubbed;
25
+ },
26
+ finalize(raw) {
27
+ lastScrubbed = cleanAgentContent(raw);
28
+ lastAt = Date.now();
29
+ return lastScrubbed;
30
+ },
31
+ reset() {
32
+ lastScrubbed = null;
33
+ lastAt = 0;
34
+ },
35
+ };
36
+ }
37
+ //# sourceMappingURL=streamScrub.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streamScrub.js","sourceRoot":"","sources":["../../../src/cli/hooks/streamScrub.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAQ3C,MAAM,UAAU,oBAAoB,CAClC,aAAqB,wBAAwB;IAE7C,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,YAAY,GAAkB,IAAI,CAAC;IAEvC,OAAO;QACL,IAAI,CAAC,GAAW,EAAE,MAAc,IAAI,CAAC,GAAG,EAAE;YACxC,IAAI,YAAY,KAAK,IAAI,IAAI,GAAG,GAAG,MAAM,IAAI,UAAU,EAAE,CAAC;gBACxD,MAAM,GAAG,GAAG,CAAC;gBACb,YAAY,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;YACxC,CAAC;YACD,OAAO,YAAY,CAAC;QACtB,CAAC;QACD,QAAQ,CAAC,GAAW;YAClB,YAAY,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;YACtC,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YACpB,OAAO,YAAY,CAAC;QACtB,CAAC;QACD,KAAK;YACH,YAAY,GAAG,IAAI,CAAC;YACpB,MAAM,GAAG,CAAC,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC"}