@alexwkleung/reika 0.13.0 → 0.15.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 CHANGED
@@ -22,41 +22,34 @@
22
22
 
23
23
  <sup>A real local run of Qwen3.6 35B A3B (Unsloth UD-IQ2_M) via llama.cpp, sped up 3×. The model fixes its own indentation, adds a test for the delays, and the tests pass on the first run.</sup>
24
24
 
25
- Reika is a coding agent CLI for local and hosted models. It was designed around small local models first (8B–35B, often at Q2–Q4, on a 16–32k context window), so it is careful with context, fails more gracefully, and says when it's stuck.
25
+ Reika is a coding agent CLI for local and hosted models. It was designed around small local models first (8B–35B, often at Q2–Q4, on a 16–32k context window), so it is careful with context, fails gracefully, and tells you when it's stuck. It doesn't make a small model smarter, but it makes working with one less frustrating.
26
26
 
27
- It doesn't make a small model smarter. It makes working with one less frustrating: less of the window wasted, fewer loops on the same read, and less chance of the task quietly getting lost.
27
+ It gets used and tested on both small local models and large hosted ones. In testing, 14–35B models handled multi-file tasks most reliably, 8–9B models managed simple, well-scoped ones, and 4B-class models rarely got past short tasks. Reika is pre-1.0, so commands, settings and behavior can still change between releases.
28
28
 
29
- Day to day it runs on large hosted models, and small local ones are where it gets tested. At the small end, expect a better experience rather than frontier results. In testing, 14–35B models handled multi-file tasks most reliably, 8–9B models managed simple, well-scoped ones, and 4B-class models ran end to end but rarely got past short tasks.
29
+ ## Highlights
30
30
 
31
- Reika is pre-1.0, so commands, settings and behavior can still change between releases.
31
+ - **Context discipline.** Old tool output collapses to one-line summaries, the engine's prompt cache is kept valid, and before older turns are folded away the model writes down what it found.
32
+ - **Loop breaking.** Repeated reads and runaway reasoning are caught and answered in escalating steps, ending in an honest stop instead of a 30-minute spiral.
33
+ - **Checks on the model's work.** Edits to unread files go back for a read first, TypeScript edits are typechecked, and plan progress is tracked from what actually happened.
34
+ - **A mode for the job.** Agent mode does the work by default; plan, grind, minimal and chat are there when a task calls for them (see [Modes](#modes)).
35
+ - **Safe by default.** Dangerous commands still prompt, and on macOS shell commands run in a kernel sandbox. No telemetry.
36
+ - **Extensible.** Stdio MCP servers add tools, and Markdown skills become slash commands, with `/issue` and `/review` built in.
37
+ - **Built for slow local engines.** It waits out long prefills, handles models without a native tool-call template, and shows decode speed, context fill and cache hits in the status bar.
32
38
 
33
39
  ## What the measurements say
34
40
 
35
- The harness's design choices were measured rather than assumed, and the record is published. It measures what a harness can and can't do about the problems small models run into, not how good the models become. The short version, with the runs and the numbers behind it in [docs/findings.md](docs/findings.md):
36
-
37
- - **The harness's own context management cost more than the model did.** One mid-context rewrite re-processed 8,453 tokens of prompt — 7.9 minutes of prefill — where an append in the same session cost 25 tokens and 3.5 seconds.
38
- - **Ask the model for its findings before a fold drops them.** In the A/B behind this, the arm whose findings were dropped folded five times, re-read files it had already read, and never answered; the arm that was asked answered from the digest.
39
- - **A small model takes tool output literally.** A grep that said "0 matches" for a call it couldn't serve sent a model rewording a correct pattern for five rounds; a loop blamed on a 35B at Q2 was reika feeding the model its own tool-call markup back.
40
- - **Prompt wording is the weakest lever.** On a vague task at Q2 a model converges or spirals about 50/50, and the harness cannot move that rate — only what the failing half costs.
41
- - **The loop detectors separate cleanly.** Healthy reasoning rounds measure 0.2–0.3 on cross-round similarity; locked loops sit at 1.00, and a 38-round productive turn never fired the detector.
41
+ Reika's design choices were measured rather than assumed, and the results are published in [docs/findings.md](docs/findings.md). A few of them:
42
42
 
43
- ## Highlights
44
-
45
- - **Context discipline.** Old tool output collapses to one-line summaries, requests stay append-only between shrink events so the engine's prompt cache survives, and when the window fills the model writes its own findings note before older turns fold into a recap.
46
- - **Loop and spiral breaking.** Repeated reads, re-derived reasoning, and runaway thinking blocks are detected and answered with an escalating ladder (nudge, pinned ledger, tool withdrawal, honest stop) rather than a 30-minute spiral.
47
- - **Checks on what the model does.** Blind edits are bounced to a read first, TypeScript edits are typechecked against a pre-edit baseline, and a written plan is tracked step by step from what the harness observes, not what the model claims.
48
- - **Plan → implement.** A read-only plan mode that ends in a numbered, file-specific plan — refine it over as many turns as you like before executing — and a vibe mode that chains plan and implementation on every prompt.
49
- - **Safe by default.** Ordinary edits run, dangerous commands still prompt, and on macOS model-chosen shell commands run under a kernel sandbox (writes confined to the project, network denied).
50
- - **Extensible.** Stdio MCP servers add tools, and each tool also becomes a slash command. Markdown skills become slash commands too; `/issue` and `/review` ship with Reika and appear wherever `gh` and a GitHub remote are.
51
- - **No telemetry.** Your code goes to the model server you configure and nowhere else: with a local server it never leaves your machine, and with a cloud API it goes to that provider. The only other requests are the web tools, when a web tool is used or you paste a link, a download of the public models.dev catalog to look up context limits (only for hosted endpoints, and never with your data), and whatever the MCP servers you configure do on their own.
52
- - **Built for slow local engines.** Tolerates long prefills, handles tool-call dialects from models without a native template, and shows decode speed, context fill, and cache hit rate in the status bar.
43
+ - **The harness's own context management cost more than the model did.** One rewrite mid-context re-processed 8,453 tokens (7.9 minutes of prefill); an append cost 25 tokens and 3.5 seconds.
44
+ - **A small model takes tool output literally.** A loop blamed on a 35B at Q2 turned out to be Reika feeding the model its own tool-call markup.
45
+ - **Prompt wording is the weakest lever.** On a vague task at Q2 a model spirals about half the time. The harness can't change that rate, only what the failing half costs.
53
46
 
54
47
  ## Requirements
55
48
 
56
49
  - Node.js 22 or newer (macOS 11+ or glibc 2.28+ Linux — see [Platforms](docs/platforms.md)).
57
50
  - An OpenAI-compatible model server: llama.cpp, MLX, vLLM, or a cloud API.
58
51
  - macOS is the primary platform. Linux works, but without the shell sandbox or image-paste OCR (set `REIKA_VISION_MODEL` to read pasted images with a vision model instead). Windows may work under WSL2.
59
- - A modern terminal (iTerm2, Ghostty, Kitty, etc). Recommended for proper TUI rendering.
52
+ - A modern terminal such as iTerm2, Ghostty or Kitty, so the TUI renders properly.
60
53
 
61
54
  ## Quick start
62
55
 
@@ -68,26 +61,17 @@ pnpm add -g @alexwkleung/reika
68
61
  brew install alexwkleung/tap/reika
69
62
  ```
70
63
 
71
- Serve a model. Example below with llama.cpp:
64
+ Serve a model, for example with llama.cpp, then point Reika at it:
72
65
 
73
66
  ```sh
74
67
  llama-server -m <model.gguf> -c 24576 --jinja <other-launch-args>
75
- ```
76
-
77
- Then point Reika at it:
78
-
79
- ```sh
80
68
  export REIKA_MODEL=model # or put it in ~/.config/reika/.env
81
69
  cd your-project && reika
82
70
  ```
83
71
 
84
- Using a hosted API instead? Skip the server and set `REIKA_BASE_URL`, `REIKA_API_KEY` and `REIKA_MODEL` to the provider's endpoint, your key and its model id; [Install and first run](docs/getting-started.md#hosted) has the details.
85
-
86
- `REIKA_BASE_URL` defaults to `http://localhost:9931/v1`, llama-server's default since llama.cpp v0.7.0 (older builds and its Docker images use 8080). The context window is read from the server when it reports one, and for hosted endpoints from the models.dev catalog; set `REIKA_CONTEXT_WINDOW` when neither has it. Reika sends no sampling parameters of its own, so your server's flags are what apply.
87
-
88
- To run from a checkout instead — `git clone https://github.com/alexwkleung/reika.git && cd reika`, then `pnpm install` (npm users: `npm i -g pnpm`) and `pnpm run install:global` to build and install the `reika` binary, or `cp .env.example .env` and `pnpm run dev` to run without installing. `pnpm run uninstall:global` removes the global binary.
72
+ [Install and first run](docs/getting-started.md) covers hosted APIs, the default port, the context window and running from a checkout.
89
73
 
90
- Prefer a window to a terminal? `reika web` serves the same agent to a browser tab on this machine, and `reika web --window` opens it in its own app window. It is experimental; [docs/web.md](docs/web.md) covers what it does and what it doesn't yet.
74
+ Prefer a window to a terminal? `reika web` serves the same agent to a browser tab on this machine, and `reika web --window` opens it in its own app window. It's experimental; [docs/web.md](docs/web.md) covers what it does and what it doesn't do yet.
91
75
 
92
76
  ![Reika's web front end in its own window: the history pane, a diff from an edit, and the input box](docs/web.png)
93
77
 
@@ -106,7 +90,7 @@ Set these in your shell, a project `.env`, or `~/.config/reika/.env` (in that or
106
90
 
107
91
  ## Modes
108
92
 
109
- `Shift+Tab` cycles modes, or switch with a slash command. The mode and model you end a session in are the ones the next session opens in.
93
+ `Shift+Tab` cycles through the modes, or switch with a slash command. The next session opens in the mode and model you ended the last one in.
110
94
 
111
95
  | Mode | What it does |
112
96
  | --------- | ---------------------------------------------------------------------------- |
@@ -120,10 +104,11 @@ Set these in your shell, a project `.env`, or `~/.config/reika/.env` (in that or
120
104
 
121
105
  `reika -p "<prompt>"` runs a single turn headless and prints the reply, for scripts and other harnesses. See [docs/usage.md](docs/usage.md) for modes in detail, headless flags, and every slash command.
122
106
 
123
- ## Safety
107
+ ## Safety and privacy
124
108
 
125
- - **Approvals** default to `safe`: ordinary edits and commands run on their own, but anything matching a dangerous pattern (`rm -rf`, force pushes, package installs, `curl`, …) and any write outside the project still asks you first. `bypass` can only be set at launch, never mid-session.
109
+ - **Approvals** default to `safe`: ordinary edits and commands run on their own, but a dangerous command (`rm -rf`, a force push, a package install, `curl`) or a write outside the project still asks you first. `bypass` can only be set at launch, never mid-session.
126
110
  - **Sandbox** (macOS, on by default): model-chosen shell commands can write only inside the project, temp, and cache directories, and have no network apart from loopback and read-only `git`/`gh`. A command you explicitly approve runs unsandboxed. `REIKA_SANDBOX=0` turns it off.
111
+ - **No telemetry.** Your code goes to the model server you configure and nowhere else: with a local server it never leaves your machine, and with a cloud API it goes to that provider. The only other requests are the web tools (when the model uses one or you paste a link), a download of the public models.dev catalog to look up context limits (hosted endpoints only, and never with your data), and whatever the MCP servers you configure do on their own. [Privacy and data](docs/privacy.md) lists every request and every file Reika writes.
127
112
 
128
113
  Found a way around one of these? Report it privately; see [SECURITY.md](SECURITY.md).
129
114
 
@@ -143,6 +128,7 @@ The same pages are on the website, [reikacode.com](https://reikacode.com).
143
128
  | [Findings](docs/findings.md) | The measured record: what broke, what held, and how each number was obtained |
144
129
  | [Platforms](docs/platforms.md) | Requirements, running on a weak machine, what differs on Linux and Windows |
145
130
  | [Architecture and caveats](docs/architecture.md) | How the harness works, and known limitations |
131
+ | [Privacy and data](docs/privacy.md) | Every network request Reika makes, every file it writes, and how to turn each one off |
146
132
  | [Contributing](CONTRIBUTING.md) | Scripts, design philosophy, a pointer to `AGENTS.md`, and external contributor guidelines |
147
133
  | [Changelog](CHANGELOG.md) | What changed in each release |
148
134
 
package/README.zh-CN.md CHANGED
@@ -22,41 +22,34 @@
22
22
 
23
23
  <sup>一次真实的本地运行:Qwen3.6 35B A3B(Unsloth UD-IQ2_M)经 llama.cpp,加速 3×。模型修正了自己的缩进,为延迟添加了一个测试,第一次运行就全部通过。</sup>
24
24
 
25
- Reika 是一个适用于本地与托管模型的编码代理 CLI。它首先围绕小型本地模型设计(8B–35B,通常处于 Q2–Q4,16–32k 上下文窗口),因此对上下文很节制,失败时更体面,卡住时会直说。
25
+ Reika 是一个适用于本地与托管模型的编码代理 CLI。它首先围绕小型本地模型设计(8B–35B,通常处于 Q2–Q4,16–32k 上下文窗口),因此对上下文很节制,失败时更体面,卡住时会直说。它不会让小模型变得更聪明,只是让使用小模型的体验少一些挫败。
26
26
 
27
- 它不会让小模型变得更聪明,只是让使用小模型的体验少一些挫败:浪费的窗口更少,在同一个读取上打转更少,任务也更不容易被悄悄弄丢。
27
+ 它在小型本地模型和大型托管模型上都有日常使用和测试。测试中,14–35B 模型处理多文件任务最可靠,8–9B 模型能完成简单、范围明确的任务,4B 级别的模型很少能完成简短任务以外的工作。Reika 还处于 1.0 之前,命令、设置和行为在不同版本之间仍可能变化。
28
28
 
29
- 日常使用跑在大型托管模型上,小型本地模型是测试它的地方。在小模型这一端,能期待的是更好的体验,而不是前沿模型的效果。测试中,14–35B 模型处理多文件任务最可靠,8–9B 模型能完成简单、范围明确的任务,4B 级别的模型可以完整运行,但很少能完成简短任务以外的工作。
29
+ ## 亮点
30
30
 
31
- Reika 还处于 1.0 之前,命令、设置和行为在不同版本之间仍可能变化。
31
+ - **上下文纪律。** 旧的工具输出折叠成一行摘要,引擎的 prompt 缓存保持有效;较早的轮次被折叠之前,模型会先写下自己的发现。
32
+ - **循环中断。** 重复读取和失控的推理会被检测到,并逐级升级地回应,最后以坦诚终止收场,而不是打转半小时。
33
+ - **对模型工作的检查。** 对未读文件的编辑会被退回,要求先读;TypeScript 编辑会做类型检查;计划进度按实际发生的事情追踪。
34
+ - **按任务选择模式。** 默认的 agent 模式直接完成工作;plan、grind、minimal 和 chat 在任务需要时使用(见[模式](#模式))。
35
+ - **默认安全。** 危险命令仍会询问;在 macOS 上,shell 命令运行在内核沙箱里。无遥测。
36
+ - **可扩展。** Stdio MCP 服务器可以添加工具,Markdown 技能会变成斜杠命令,并内置 `/issue` 和 `/review`。
37
+ - **为慢速本地引擎而做。** 容忍长预填充,能处理没有原生工具调用模板的模型,并在状态栏显示解码速度、上下文占用和缓存命中率。
32
38
 
33
39
  ## 测量结果
34
40
 
35
- 框架的设计取舍是测量出来的,而不是假设的,记录也都公开。测量的是框架对小模型遇到的问题能做什么、不能做什么,而不是模型会变得多好。简短版本如下,完整的运行记录与数字见 [docs/findings.md](docs/findings.md):
36
-
37
- - **框架自己的上下文管理,代价比模型本身更大。** 一次发生在上下文中段的改写重新预填充了 8,453 个 token —— 7.9 分钟;而同一会话里的一次追加只花 25 个 token、3.5 秒。
38
- - **折叠之前先向模型要它的发现。** 支撑这一点的 A/B 中,发现被丢弃的那一臂折叠了五次,反复重读已经读过的文件,始终没有作答;被问过的那一臂直接从笔记里给出了答案。
39
- - **小模型会照字面理解工具输出。** grep 对一个它根本无法执行的调用也回答"0 matches",结果模型花了五轮去改写一个本来正确的模式;一个被归咎于 Q2 下 35B 模型的循环,其实是 Reika 把模型自己的工具调用标记又喂了回去。
40
- - **提示词措辞是最弱的杠杆。** 在 Q2 下面对含糊任务,模型收敛与打转大约各占一半,框架改变不了这个比例 —— 只能改变失败那一半的代价。
41
- - **循环检测器的区分度很干净。** 健康的推理轮次在跨轮相似度上测得 0.2–0.3;锁死的循环停在 1.00,而一个跑了 38 轮的有效轮次从未触发检测。
41
+ Reika 的设计取舍是测量出来的,而不是假设的,结果公开在 [docs/findings.md](docs/findings.md)。举几个例子:
42
42
 
43
- ## 亮点
44
-
45
- - **上下文纪律。** 旧的工具输出折叠成一行摘要;在两次压缩事件之间请求保持只追加,让引擎的 prompt 缓存得以存活;窗口填满时,模型先写下自己的发现笔记,之后较早的轮次才折叠成回顾。
46
- - **循环与打转中断。** 重复读取、反复重推的推理、以及失控的思考块都会被检测到,并用一套逐级升级的手段回应(轻推、固定台账、收回工具、坦诚终止),而不是让它打转半小时。
47
- - **对模型行为的检查。** 盲改会被退回,要求先读;TypeScript 编辑会对照编辑前的基线做类型检查;写下的计划按框架观察到的事实逐步追踪,而不是按模型自己声称的进度。
48
- - **计划 → 实现。** 只读的计划模式最终产出一份带编号、落到具体文件的计划 —— 你可以在执行之前用任意多轮来打磨它 —— 而 vibe 模式会在每次提示时把计划和实现串起来。
49
- - **默认安全。** 普通编辑直接执行,危险命令仍会询问;在 macOS 上,由模型选择的 shell 命令运行在内核沙箱里(写入限制在项目内,网络被禁止)。
50
- - **可扩展。** Stdio MCP 服务器可以添加工具,每个工具同时也会变成一个斜杠命令。Markdown 技能同样会变成斜杠命令;`/issue` 和 `/review` 随 Reika 一起发布,只要有 `gh` 和 GitHub 远程仓库就会出现。
51
- - **无遥测。** 你的代码只会发往你自己配置的模型服务器,别处不去:用本地服务器时它从不离开你的机器,用云端 API 时它只发给该提供商。除此之外的请求只有:使用网络工具或粘贴链接时发起的请求;为查询上下文上限而下载公开的 models.dev 目录(仅针对托管端点,且从不携带你的数据);以及你配置的 MCP 服务器各自的行为。
52
- - **为慢速本地引擎而做。** 容忍长预填充,能处理没有原生模板的模型发出的工具调用方言,并在状态栏显示解码速度、上下文占用和缓存命中率。
43
+ - **框架自己的上下文管理,代价比模型本身更大。** 一次发生在上下文中段的改写重新预填充了 8,453 个 token(7.9 分钟);一次追加只花 25 个 token、3.5 秒。
44
+ - **小模型会照字面理解工具输出。** 一个被归咎于 Q2 下 35B 模型的循环,其实是 Reika 把模型自己的工具调用标记又喂了回去。
45
+ - **提示词措辞是最弱的杠杆。** 在 Q2 下面对含糊任务,模型大约有一半时间会打转。框架改变不了这个比例,只能改变失败那一半的代价。
53
46
 
54
47
  ## 要求
55
48
 
56
49
  - Node.js 22 或更新版本(macOS 11+,或 glibc 2.28+ 的 Linux —— 见[平台](docs/zh/platforms.md))。
57
50
  - 一个 OpenAI 兼容的模型服务器:llama.cpp、MLX、vLLM 或云端 API。
58
51
  - macOS 是主要平台。Linux 可用,但没有 shell 沙箱和图片粘贴 OCR(可以设置 `REIKA_VISION_MODEL`,改用视觉模型读取粘贴的图片)。Windows 或许能在 WSL2 下运行。
59
- - 现代终端(iTerm2、Ghostty、Kitty 等)。想要正确的 TUI 渲染,建议使用它们。
52
+ - 现代终端,例如 iTerm2、Ghostty 或 Kitty,以便 TUI 正确渲染。
60
53
 
61
54
  ## 快速开始
62
55
 
@@ -68,24 +61,19 @@ pnpm add -g @alexwkleung/reika
68
61
  brew install alexwkleung/tap/reika
69
62
  ```
70
63
 
71
- 启动一个模型。下面以 llama.cpp 为例:
64
+ 启动一个模型(下面以 llama.cpp 为例),然后把 Reika 指向它:
72
65
 
73
66
  ```sh
74
67
  llama-server -m <model.gguf> -c 24576 --jinja <other-launch-args>
75
- ```
76
-
77
- 然后把 Reika 指向它:
78
-
79
- ```sh
80
68
  export REIKA_MODEL=model # 或写进 ~/.config/reika/.env
81
69
  cd your-project && reika
82
70
  ```
83
71
 
84
- 改用托管 API?跳过启动服务器这一步,把 `REIKA_BASE_URL`、`REIKA_API_KEY` 和 `REIKA_MODEL` 设为服务商的端点、你的密钥和它的模型 ID;详见 [安装与首次运行](docs/getting-started.md#hosted)。
72
+ 托管 API、默认端口、上下文窗口以及从检出目录运行,见[安装与首次运行](docs/zh/getting-started.md)。
85
73
 
86
- `REIKA_BASE_URL` 默认是 `http://localhost:9931/v1`,即 llama.cpp v0.7.0 起 llama-server 的默认地址(更早的版本及其 Docker 镜像使用 8080)。上下文窗口在服务器上报时从中读取,托管端点则从 models.dev 目录中读取;两者都没有时,请设置 `REIKA_CONTEXT_WINDOW`。Reika 不发送任何自己的采样参数,所以生效的就是你服务器的启动参数。
74
+ 更喜欢窗口而不是终端?`reika web` 把同一个代理提供给本机的浏览器标签页,`reika web --window` 则在独立的应用窗口中打开它。这一功能仍是实验性的;它能做什么、暂时还做不到什么,见 [docs/web.md](docs/zh/web.md)。
87
75
 
88
- 想改从检出目录运行:`git clone https://github.com/alexwkleung/reika.git && cd reika`,然后 `pnpm install`(npm 用户先 `npm i -g pnpm`)并用 `pnpm run install:global` 构建安装 `reika` 可执行文件;或者 `cp .env.example .env`、编辑它,再 `pnpm run dev` 直接运行而不安装。`pnpm run uninstall:global` 会移除全局可执行文件。
76
+ ![Reika 的网页前端运行在独立窗口中:历史面板、一次编辑的 diff,以及输入框](docs/web.png)
89
77
 
90
78
  ## 常用配置
91
79
 
@@ -116,10 +104,11 @@ cd your-project && reika
116
104
 
117
105
  `reika -p "<prompt>"` 无头运行单个轮次并打印回复,用于脚本和其他框架。模式细节、无头参数以及全部斜杠命令见[用法文档](docs/usage.md)。
118
106
 
119
- ## 安全
107
+ ## 安全与隐私
120
108
 
121
109
  - **审批**默认是 `safe`:普通编辑和命令自行执行,但任何匹配危险模式的命令(`rm -rf`、强制推送、安装软件包、`curl`……)以及项目之外的任何写入,仍会先问你。`bypass` 只能在启动时设置,会话中无法切换。
122
110
  - **沙箱**(macOS,默认开启):由模型选择的 shell 命令只能写入项目、临时和缓存目录内,且除回环地址和只读的 `git`/`gh` 之外没有网络。你明确批准的命令不做沙箱隔离运行。`REIKA_SANDBOX=0` 可将其关闭。
111
+ - **无遥测。** 你的代码只会发往你自己配置的模型服务器,别处不去:用本地服务器时它从不离开你的机器,用云端 API 时它只发给该提供商。除此之外的请求只有:使用网络工具或粘贴链接时发起的请求;为查询上下文上限而下载公开的 models.dev 目录(仅针对托管端点,且从不携带你的数据);以及你配置的 MCP 服务器各自的行为。
123
112
 
124
113
  发现了绕过其中某一道的方式?请私下报告,见 [SECURITY.md](SECURITY.md)。
125
114
 
@@ -4,14 +4,14 @@ import {
4
4
  modeSwitchProfile,
5
5
  resolveDefaultMode,
6
6
  setAtLaunch
7
- } from "./chunk-KS3VH2ZV.js";
7
+ } from "./chunk-B5UA4G44.js";
8
8
 
9
9
  // src/laststate.ts
10
10
  import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
11
11
  import { homedir } from "node:os";
12
12
  import { dirname, join } from "node:path";
13
13
  var LAST_STATE_PATH = join(homedir(), ".config", "reika", "state.json");
14
- var DEFAULT_MODES = ["agent", "plan", "vibe", "minimal", "grind"];
14
+ var DEFAULT_MODES = ["agent", "plan", "vibe", "minimal", "grind", "chat"];
15
15
  function persistableMode(mode) {
16
16
  return DEFAULT_MODES.includes(mode) ? mode : null;
17
17
  }
@@ -3,7 +3,7 @@ const require = __reikaCreateRequire(import.meta.url);
3
3
  import {
4
4
  API_USER_AGENT,
5
5
  debugLog
6
- } from "./chunk-OSLX5BGM.js";
6
+ } from "./chunk-VM3LKHIQ.js";
7
7
  import {
8
8
  __commonJS,
9
9
  __require,
@@ -833,7 +833,11 @@ var PROJECT_ENV_DENIED = /* @__PURE__ */ new Set([
833
833
  "REIKA_URL_GROUNDING",
834
834
  "REIKA_CDP_SEARCH",
835
835
  "REIKA_CDP_PORT",
836
- "REIKA_DEBUG_FILE"
836
+ "REIKA_DEBUG_FILE",
837
+ // A program reika runs, a profile (so a server) a mode's turns go to, and a file path to write.
838
+ "REIKA_CHROME_PATH",
839
+ "REIKA_MODE_MODELS",
840
+ "REIKA_SPILL_STATS_FILE"
837
841
  ]);
838
842
  function isDeniedFromProjectEnv(key) {
839
843
  return PROJECT_ENV_DENIED.has(key) || /_(URL|API_KEY)$/.test(key);
@@ -949,6 +953,7 @@ function loadConfig() {
949
953
  // Per-project session auto-save for /resume (#1). Default on; `0` stops reika writing
950
954
  // conversations to disk at all, which is the one reason to want it off.
951
955
  autosave: process.env.REIKA_AUTOSAVE !== "0",
956
+ prBadge: process.env.REIKA_PR_BADGE !== "0",
952
957
  // #827: REIKA_NOTE_SLOT=tool|user forces the slot instead, checked where the probe would run.
953
958
  noteSlotProbe: true,
954
959
  // Rotating garden words on the busy indicator (#500). Default on; `0` keeps the plain
@@ -1132,6 +1137,8 @@ function resolveDefaultMode() {
1132
1137
  return "minimal";
1133
1138
  case "grind":
1134
1139
  return "grind";
1140
+ case "chat":
1141
+ return "chat";
1135
1142
  default:
1136
1143
  return process.env.REIKA_PLAN_EXPERIMENT === "1" ? "plan" : "agent";
1137
1144
  }