@ekravo/cli 0.1.107 → 0.1.115

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
@@ -2,11 +2,11 @@
2
2
 
3
3
  Ekravo is a coding agent CLI for the terminal. It's a fork of the open-source `ache` CLI ([getache/ache](https://github.com/getache/ache), Apache 2.0), built on the same [pi-mono](https://github.com/badlogic/pi-mono) coding agent SDK, adapted to run against [ekravo.com](https://ekravo.com) as its LLM provider and extended with:
4
4
 
5
- - A **Read / Plan / Edit / Auto** permission model (`Shift+Tab` cycles between them)
5
+ - A **Read / Plan / Edit / Auto / YOLO** permission model (`Shift+Tab` cycles between them)
6
6
  - **Persistent, cross-session project memory** in `ekravo.md` + `.ekravo/` (`/init` to scaffold, `/memory` to inspect)
7
7
  - An Ekravo LLM provider alongside the upstream provider, so both can be configured at once during the transition
8
8
 
9
- Everything the upstream CLI already does well — the terminal UI, sessions, MCP support, skills, subagents, LSP integration, Ferment project workflows — is unchanged and reused as-is. See [NOTICE](NOTICE) for full attribution; Ekravo does not claim the upstream project's original code as its own and is not affiliated with CAST AI Group, Inc.
9
+ Everything the upstream CLI already does well — the terminal UI, sessions, MCP support, skills, subagents, LSP integration — is unchanged and reused as-is. See [NOTICE](NOTICE) for full attribution; Ekravo does not claim the upstream project's original code as its own and is not affiliated with CAST AI Group, Inc.
10
10
 
11
11
  ## Quick start
12
12
 
@@ -144,20 +144,21 @@ Subagents inherit the current phase from the orchestrator but cannot change it.
144
144
 
145
145
  ## Permission modes
146
146
 
147
- `Shift+Tab` cycles through four modes:
147
+ `Shift+Tab` cycles through five modes:
148
148
 
149
149
  | Mode | Behavior |
150
150
  |------|----------|
151
151
  | **Read** | Inspect and explain only -- no file modifications, no writes |
152
- | **Plan** | Plan and ask questions -- no implementation, same read-only tool restriction as Read plus the structured planning workflow (`<!-- PLAN_COMPLETE -->` menu, optional hand-off to a Ferment) |
152
+ | **Plan** | Plan and ask questions -- no implementation, same read-only tool restriction as Read plus the structured planning workflow (`<!-- PLAN_COMPLETE -->` menu) |
153
153
  | **Edit** | Modify files, asks for approval before each change (this is the `default` mode internally) |
154
154
  | **Auto** | Runs freely; a classifier still gates high-risk actions |
155
+ | **YOLO** | Skips every permission check with no classifier -- see the warning below |
155
156
 
156
- A fifth mode, **YOLO**, skips every permission check with no classifier. It's deliberately excluded from the `Shift+Tab` cycle -- select it explicitly via `/permissions mode yolo`, `--yolo`, or `--dangerously-skip-permissions` when you actually want it.
157
+ **YOLO** is last in the cycle, one `Shift+Tab` past Auto, and landing on it shows a persistent warning in the status line. It disables *all* permission checks, so it is intended for sandboxed environments only. You can also enter it directly via `/permissions mode yolo`, `--yolo`, or `--dangerously-skip-permissions`.
157
158
 
158
159
  ## Project memory
159
160
 
160
- Ekravo adds persistent, cross-session project memory on top of the upstream CLI's existing session/Ferment persistence:
161
+ Ekravo adds persistent, cross-session project memory on top of the upstream CLI's existing session persistence:
161
162
 
162
163
  ```
163
164
  ekravo.md -- concise, always-visible project overview
@@ -219,101 +220,6 @@ Two tags are added automatically to every request and do not count toward the 10
219
220
 
220
221
  User-defined tags (added via `/tags add`) are persisted to `~/.config/ekravo/tags.json` and survive across sessions. Static tags from `EKRAVO_TAGS` must be set each session.
221
222
 
222
- ## Ferment -- cross-session project management
223
-
224
- Ferment is Ekravo's progressive-refinement project mode for multi-session work. Instead of starting from scratch each chat, Ferment persists a structured plan (goal, phases, steps) as a JSON state file.
225
-
226
- ### Quick start
227
-
228
- ```bash
229
- ekravo --ferment "Build Tetris"
230
- ```
231
-
232
- Or inside an active session:
233
-
234
- ```
235
- /ferment new "Build Tetris" # create a ferment
236
- /ferment auto # keep going until done or blocked
237
- ```
238
-
239
- ### Concepts
240
-
241
- - **Ferment** -- the top-level project (e.g. "Build Tetris", "Auth rewrite")
242
- - **Phase** -- a milestone within the project (e.g. "Canvas & Grid", "Movement")
243
- - **Step** -- a single executable task within a phase (e.g. "Create index.html")
244
- - **Decision** -- an architectural choice recorded for posterity
245
- - **Memory** -- a gotcha, convention, or pattern encountered during work
246
-
247
- ### State machine
248
-
249
- All lifecycle transitions are validated by a deterministic finite state machine that enforces valid state changes and prevents illegal operations (e.g. completing a step before it starts, skipping an already-completed phase).
250
-
251
- ```
252
- draft -> planned -> running -> [paused] -> complete
253
- ```
254
-
255
- 1. **draft** -- created via `/ferment new`, agent collects goal and phases conversationally
256
- 2. **planned** -- `scope_ferment` sets goal, criteria, constraints, phase breakdown
257
- 3. **running** -- `activate_ferment_phase` starts a phase, agent executes steps
258
- 4. **paused** -- user intervention required, or paused with `/ferment pause`
259
- 5. **complete** -- all phases terminal
260
-
261
- ### Continuation policy
262
-
263
- Controls whether the active ferment advances across phase boundaries.
264
-
265
- | Policy | Behavior | Command |
266
- |--------|----------|---------|
267
- | **manual** | Ask before moving to the next phase | `/ferment manual` |
268
- | **automated** | Keep going until complete, blocked, paused, or user input is needed | `/ferment auto` |
269
-
270
- Pause/resume is separate: `/ferment pause` stops the ferment, `/ferment resume` continues it using the current policy. `/ferment exit` leaves Ferment mode without deleting or abandoning the ferment; planned/running work is paused first, active Ferment UI/tools are cleared, and you can later select it from `/ferment list` or `/ferment switch`.
271
-
272
- ### Commands
273
-
274
- | Command | Description |
275
- |---------|-------------|
276
- | `/ferment` | Start a new ferment via prompt |
277
- | `/ferment new "Name"` | Create new ferment |
278
- | `/ferment switch <id>` | Resume by ID prefix or name |
279
- | `/ferment delete <id>` | Delete permanently |
280
- | `/ferment export` | Export stats to JSON |
281
- | `/ferment progress` | Open phase/step navigator overlay |
282
- | `/ferment manual` | Set manual continuation policy |
283
- | `/ferment auto` | Set automated continuation policy |
284
- | `/ferment pause` | Pause the active ferment lifecycle |
285
- | `/ferment resume` | Resume the active ferment lifecycle |
286
- | `/ferment exit` | Leave Ferment mode without deleting the ferment |
287
-
288
- ### Recovery
289
-
290
- Every session writes a `ferment_reference` entry in the session log. On next start, the harness reads this entry and resumes from the exact state.
291
-
292
- ```bash
293
- # Day 1
294
- $ ekravo --ferment "Build Tetris"
295
- # ... agent works, crashes, terminal closes ...
296
-
297
- # Day 2
298
- $ ekravo --ferment "Build Tetris"
299
- # -> Rehydrates state, continues Phase 2 exactly where it left off
300
- ```
301
-
302
- ### Where state lives
303
-
304
- ```
305
- .ekravo/
306
- ferments/
307
- <uuid>.json -- snapshot (machine-readable plan state)
308
- <uuid>.events.jsonl -- append-only audit log of every transition
309
- sessions/
310
- <timestamp>.jsonl -- chat history + tool calls
311
- ```
312
-
313
- Every mutation is persisted as an append-only event with pre/post state hashes, enabling full auditability. Stats (phase/step counts, timing, model usage, grade distributions) are computed on demand from the snapshot and exported via `/ferment export`.
314
-
315
- For full documentation see `docs/ferment.md` and `docs/ferment-storage-schema.md`.
316
-
317
223
  ## LSP Integration
318
224
 
319
225
  ekravo ships with built-in Language Server Protocol (LSP) support, giving the agent type-aware code intelligence. The extension loads by default — no configuration required.
@@ -386,15 +292,17 @@ For full documentation see [docs.ekravo.com/docs/coding-remote-sessions](https:/
386
292
  The Ekravo API key is resolved in this order:
387
293
 
388
294
  1. `EKRAVO_API_KEY` environment variable (takes precedence)
389
- 2. `~/.config/ekravo/config.json` field `api_key`
295
+ 2. `~/.config/ekravo/config.json` field `ekravoApiKey`
390
296
 
391
297
  The upstream provider key is resolved independently, so both can be configured at once:
392
298
 
393
299
  1. `EKRAVO_API_KEY` environment variable (takes precedence)
394
- 2. `~/.config/ekravo/config.json` field `ekravoApiKey`
300
+ 2. `~/.config/ekravo/config.json` field `api_key` (or `apiKey`)
395
301
 
396
302
  Run `ekravo setup` for an interactive first-time configuration, which now offers an optional upstream-key step alongside the Ekravo one.
397
303
 
304
+ **Legacy environment variables:** installs that predate the rename can keep using `ACHE_*` names — at startup every inherited `ACHE_*` variable is mirrored onto its `EKRAVO_*` equivalent, so `ACHE_API_KEY` still works as `EKRAVO_API_KEY`. Explicit `EKRAVO_*` values always win over a stale `ACHE_*` one. Set `EKRAVO_QUIET_LEGACY=1` to silence the rename warning. <!-- brand-boundary-allow: documents the compatibility layer --> The same compatibility layer migrates the old config directory and `.ache/` project memory in place, so an existing install keeps its settings, sessions and memory.
305
+
398
306
  **Usage and cost:** The CLI preserves model IDs exactly as returned by the catalog; it does not rewrite provider IDs or infer transport slugs. Requests authenticated with an Ekravo subscription/API key are billed according to the associated Ekravo account and plan. ACHECLI does not add a separate per-token markup or determine plan entitlements; consult the account's current billing terms for subscription limits, credits, and API usage charges.
399
307
 
400
308
  ### Agent config
@@ -596,7 +504,6 @@ src/
596
504
  extensions/ -- Agent extensions
597
505
  agents/ -- Subagent system (personas, manager, memory)
598
506
  orchestration/ -- Task classification, model registry, delegation
599
- ferment/ -- Ferment lifecycle tools & UI
600
507
  mcp-adapter/ -- MCP server integration
601
508
  permissions/ -- Tool auth flows
602
509
  behaviours/ -- Contextual prompt behaviours
@@ -605,7 +512,6 @@ src/
605
512
  lsp/ -- Language Server Protocol
606
513
  login/ -- OAuth flows
607
514
  onboarding/ -- Session mode startup wizard
608
- ferment/ -- Ferment state machine, event store, stats
609
515
  modes/
610
516
  interactive/ -- TUI harness
611
517
  acp/ -- JSON-RPC over stdio (IDE integration)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekravo/cli",
3
- "version": "0.1.107",
3
+ "version": "0.1.115",
4
4
  "description": "ekravo — a coding agent CLI powered by Cast AI, built on Ekravo",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -116,6 +116,9 @@
116
116
  },
117
117
  "packageManager": "pnpm@10.8.1",
118
118
  "pnpm": {
119
+ "overrides": {
120
+ "cross-spawn": "7.1.2"
121
+ },
119
122
  "onlyBuiltDependencies": [
120
123
  "@biomejs/biome",
121
124
  "esbuild",
@@ -9,8 +9,23 @@
9
9
  // export-html templates → dist/share/ekravo/export-html/
10
10
  // plus package.json → dist/share/ekravo/
11
11
  // so the compiled binary resolves assets from the shared data directory
12
+ //
13
+ // --test (used by vitest's globalSetup): the default layout, minus the artifacts other
14
+ // build steps produce (tools/proxy-helper/bin/*), and it
15
+ // no-ops when dist/share/ekravo is already newer than the
16
+ // sources. Tests read dist/share/ekravo directly, so a
17
+ // fresh checkout must regenerate it before the suite runs.
12
18
 
13
- import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs"
19
+ import {
20
+ cpSync,
21
+ existsSync,
22
+ mkdirSync,
23
+ readdirSync,
24
+ readFileSync,
25
+ realpathSync,
26
+ statSync,
27
+ writeFileSync,
28
+ } from "node:fs"
14
29
  import { createRequire } from "node:module"
15
30
  import { platform } from "node:os"
16
31
  import { dirname, join } from "node:path"
@@ -28,14 +43,63 @@ const exportHtmlSkipSuffixes = [".d.ts", ".d.ts.map", ".js.map"]
28
43
  const exportHtmlSrc = join(piAgentDist, "core", "export-html")
29
44
 
30
45
  const isDev = process.argv.includes("--dev")
31
- const themeDest = isDev
32
- ? join(projectRoot, "src", "modes", "interactive", "theme")
33
- : join(projectRoot, "dist", "share", "ekravo", "theme")
34
- const exportHtmlDest = isDev
35
- ? join(projectRoot, "src", "core", "export-html")
36
- : join(projectRoot, "dist", "share", "ekravo", "export-html")
46
+ // Test mode stages the dist layout tests read, but skips artifacts produced by other build
47
+ // steps (the Go proxy-helper binary), and no-ops when the staged copy is already up to date.
48
+ const isTest = !isDev && process.argv.includes("--test")
49
+ const shareDir = join(projectRoot, "dist", "share", "ekravo")
50
+ const stampPath = join(projectRoot, "dist", ".copy-resources.stamp")
51
+ const themeDest = isDev ? join(projectRoot, "src", "modes", "interactive", "theme") : join(shareDir, "theme")
52
+ const exportHtmlDest = isDev ? join(projectRoot, "src", "core", "export-html") : join(shareDir, "export-html")
53
+
54
+ // Everything the non-dev copy reads. Used by --test to decide whether the staged copy is stale.
55
+ const ekravoThemesSrc = join(projectRoot, "themes")
56
+ const oauthSrc = join(projectRoot, "resources", "oauth")
57
+ const resourceSources = [
58
+ themeSrc,
59
+ exportHtmlSrc,
60
+ ekravoThemesSrc,
61
+ oauthSrc,
62
+ join(projectRoot, "package.json"),
63
+ join(projectRoot, "UpdateCLI.md"),
64
+ join(projectRoot, "docs", "images.md"),
65
+ ]
66
+
67
+ function newestMtimeMs(path) {
68
+ let newest = statSync(path).mtimeMs
69
+ if (!statSync(path).isDirectory()) return newest
70
+ for (const entry of readdirSync(path, { withFileTypes: true })) {
71
+ if (entry.isDirectory()) {
72
+ newest = Math.max(newest, newestMtimeMs(join(path, entry.name)))
73
+ } else if (!exportHtmlSkipSuffixes.some((suffix) => entry.name.endsWith(suffix))) {
74
+ newest = Math.max(newest, statSync(join(path, entry.name)).mtimeMs)
75
+ }
76
+ }
77
+ return newest
78
+ }
79
+
80
+ function isUpToDate() {
81
+ if (!existsSync(stampPath) || !existsSync(shareDir)) return false
82
+ const stagedAt = statSync(stampPath).mtimeMs
83
+ // package.json lands in the share dir; if it went missing the copy has to run again.
84
+ if (!existsSync(join(shareDir, "package.json"))) return false
85
+ // A missing source is stale, not up to date — let the copy report it by name.
86
+ if (!resourceSources.every((source) => existsSync(source))) return false
87
+ return resourceSources.every((source) => newestMtimeMs(source) <= stagedAt)
88
+ }
89
+
90
+ if (isTest && isUpToDate()) {
91
+ console.log("copy-resources: dist/share/ekravo is newer than its sources, skipping")
92
+ process.exit(0)
93
+ }
94
+
95
+ // Fail with the missing path rather than an ENOENT from deep inside cpSync.
96
+ const missingSources = resourceSources.filter((source) => !existsSync(source))
97
+ if (missingSources.length > 0) {
98
+ throw new Error(`resource source(s) missing: ${missingSources.join(", ")}`)
99
+ }
37
100
 
38
101
  mkdirSync(themeDest, { recursive: true })
102
+
39
103
  for (const file of themeFiles) {
40
104
  cpSync(join(themeSrc, file), join(themeDest, file))
41
105
  }
@@ -72,7 +136,6 @@ templateHtml = templateHtml.replace(
72
136
  writeFileSync(templateHtmlPath, templateHtml, "utf-8")
73
137
 
74
138
  // ekravo's own themes live outside node_modules — copy them alongside the upstream themes
75
- const ekravoThemesSrc = join(projectRoot, "themes")
76
139
  const ekravoThemeFiles = readdirSync(ekravoThemesSrc).filter((f) => f.endsWith(".json"))
77
140
  for (const file of ekravoThemeFiles) {
78
141
  cpSync(join(ekravoThemesSrc, file), join(themeDest, file))
@@ -81,29 +144,40 @@ for (const file of ekravoThemeFiles) {
81
144
  if (!isDev) {
82
145
  const resourceRequire = createRequire(import.meta.url)
83
146
  const photonEntry = resourceRequire.resolve("@silvia-odwyer/photon-node", { paths: [realpathSync(piAgentDist)] })
84
- cpSync(join(dirname(photonEntry), "photon_rs_bg.wasm"), join(projectRoot, "dist", "bin", "photon_rs_bg.wasm"))
85
- cpSync(
86
- join(dirname(photonEntry), "photon_rs_bg.wasm"),
87
- join(projectRoot, "dist", "share", "ekravo", "photon_rs_bg.wasm"),
88
- )
89
- cpSync(join(projectRoot, "package.json"), join(projectRoot, "dist", "share", "ekravo", "package.json"))
90
- cpSync(join(projectRoot, "UpdateCLI.md"), join(projectRoot, "dist", "share", "ekravo", "UpdateCLI.md"))
91
- cpSync(join(projectRoot, "docs", "images.md"), join(projectRoot, "dist", "share", "ekravo", "images.md"))
147
+ const photonWasmSrc = join(dirname(photonEntry), "photon_rs_bg.wasm")
148
+ // dist/bin only exists once a binary build has run; unit-test runs must not need one.
149
+ const distBinDir = join(projectRoot, "dist", "bin")
150
+ if (existsSync(distBinDir)) {
151
+ cpSync(photonWasmSrc, join(distBinDir, "photon_rs_bg.wasm"))
152
+ }
153
+ cpSync(photonWasmSrc, join(shareDir, "photon_rs_bg.wasm"))
154
+ cpSync(join(projectRoot, "package.json"), join(shareDir, "package.json"))
155
+ cpSync(join(projectRoot, "UpdateCLI.md"), join(shareDir, "UpdateCLI.md"))
156
+ cpSync(join(projectRoot, "docs", "images.md"), join(shareDir, "images.md"))
92
157
 
93
158
  // Copy custom OAuth page templates
94
- const oauthSrc = join(projectRoot, "resources", "oauth")
95
- const oauthDest = join(projectRoot, "dist", "share", "ekravo", "oauth")
159
+ const oauthDest = join(shareDir, "oauth")
96
160
  mkdirSync(oauthDest, { recursive: true })
97
161
  cpSync(oauthSrc, oauthDest, { recursive: true })
98
162
 
99
- // Copy proxy-helper binary built by scripts/build-proxy-helper.js.
100
- const buildTargetOS = process.env.EKRAVO_BUILD_TARGET_OS || platform()
101
- const proxyHelperName = buildTargetOS === "win32" || buildTargetOS === "windows" ? "proxy-helper.exe" : "proxy-helper"
102
- const proxyHelperSrc = join(projectRoot, "tools", "proxy-helper", "bin", proxyHelperName)
103
- const proxyHelperBinDest = join(projectRoot, "dist", "share", "ekravo", "bin")
104
- if (!existsSync(proxyHelperSrc)) {
105
- throw new Error(`proxy-helper binary not found: ${proxyHelperSrc}`)
163
+ // Copy proxy-helper binary built by scripts/build-proxy-helper.js. Test runs skip it:
164
+ // the binary comes from `build:proxy-helper`, not from this script, and no test reads it.
165
+ if (!isTest) {
166
+ const buildTargetOS = process.env.EKRAVO_BUILD_TARGET_OS || platform()
167
+ const proxyHelperName =
168
+ buildTargetOS === "win32" || buildTargetOS === "windows" ? "proxy-helper.exe" : "proxy-helper"
169
+ const proxyHelperSrc = join(projectRoot, "tools", "proxy-helper", "bin", proxyHelperName)
170
+ const proxyHelperBinDest = join(shareDir, "bin")
171
+ if (!existsSync(proxyHelperSrc)) {
172
+ throw new Error(`proxy-helper binary not found: ${proxyHelperSrc}`)
173
+ }
174
+ mkdirSync(proxyHelperBinDest, { recursive: true })
175
+ cpSync(proxyHelperSrc, join(proxyHelperBinDest, proxyHelperName))
176
+ }
177
+
178
+ // Only write the up-to-date stamp once the whole copy succeeded, so a failed or
179
+ // interrupted run can never make a later --test run skip the regeneration.
180
+ if (isTest) {
181
+ writeFileSync(stampPath, `${new Date().toISOString()}\n`, "utf-8")
106
182
  }
107
- mkdirSync(proxyHelperBinDest, { recursive: true })
108
- cpSync(proxyHelperSrc, join(proxyHelperBinDest, proxyHelperName))
109
183
  }