@useavalon/caelence-agent 0.1.1-canary.0 → 0.1.1-canary.2

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 (46) hide show
  1. package/README.md +122 -35
  2. package/brand/logo/favicon-agent-bg-16.svg +7 -0
  3. package/brand/logo/favicon-agent-bg-32.svg +7 -0
  4. package/brand/previews/desktop-chat.png +0 -0
  5. package/brand/previews/desktop-commands.png +0 -0
  6. package/brand/previews/desktop-integrations.png +0 -0
  7. package/brand/previews/desktop-skills.png +0 -0
  8. package/package.json +3 -1
  9. package/skills/impeccable/LICENSE +13 -0
  10. package/skills/impeccable/NOTICE +14 -0
  11. package/skills/impeccable/SKILL.md +2 -1
  12. package/src/agent-cwd.ts +51 -0
  13. package/src/cli/agent-cwd.test.ts +65 -0
  14. package/src/cli/main.test.ts +5 -0
  15. package/src/cli/main.ts +295 -204
  16. package/src/cli/picker.test.ts +59 -1
  17. package/src/cli/picker.ts +46 -0
  18. package/src/cli/slash-dispatch.test.ts +116 -7
  19. package/src/cli/slash-dispatch.ts +359 -174
  20. package/src/cli/slash.test.ts +25 -2
  21. package/src/cli/slash.ts +37 -8
  22. package/src/cli/theme.test.ts +7 -0
  23. package/src/cli/theme.ts +6 -6
  24. package/src/cli/tui.tsx +385 -217
  25. package/src/config.ts +1 -1
  26. package/src/desktop/bridge.test.ts +24 -0
  27. package/src/desktop/bridge.ts +527 -395
  28. package/src/index.ts +29 -2
  29. package/src/init.test.ts +19 -2
  30. package/src/init.ts +25 -17
  31. package/src/integrations/loopback.test.ts +17 -0
  32. package/src/integrations/loopback.ts +91 -0
  33. package/src/observability/prompts.ts +1 -1
  34. package/src/product.ts +3 -1
  35. package/src/runtime.ts +60 -7
  36. package/src/skills/catalog.test.ts +237 -0
  37. package/src/skills/catalog.ts +298 -0
  38. package/src/skills/disabled.test.ts +27 -0
  39. package/src/skills/disabled.ts +59 -0
  40. package/src/skills/loader.test.ts +63 -0
  41. package/src/skills/loader.ts +89 -31
  42. package/src/skills/registry.test.ts +483 -6
  43. package/src/skills/registry.ts +762 -118
  44. package/src/skills/skill-command.ts +2 -0
  45. package/src/tools/read-skill.ts +35 -11
  46. package/src/tools/subagent.test.ts +29 -0
package/README.md CHANGED
@@ -1,39 +1,45 @@
1
+ <p align="center">
2
+ <img src="brand/logo/favicon-agent-bg-32.svg" alt="Caelence agent" width="96" height="96" />
3
+ </p>
4
+
1
5
  # Caelence agent
2
6
 
3
- A coding agent you run in a project. Terminal UI, local tools, and skills you can add or remove.
7
+ A coding agent that runs on this machine, as a desktop app or as a terminal UI.
4
8
 
5
- [`@useavalon/caelence-agent`](https://www.npmjs.com/package/@useavalon/caelence-agent) on npm. Needs [Bun](https://bun.sh) 1.2 or later.
9
+ The package is [`@useavalon/caelence-agent`](https://www.npmjs.com/package/@useavalon/caelence-agent) on npm and needs [Bun](https://bun.sh) 1.2 or later.
6
10
 
7
- ## Get started
11
+ ## Install
8
12
 
9
13
  ```bash
10
14
  bun add -g @useavalon/caelence-agent
11
- cd your-project
12
- bunx harness init
13
- export OPENROUTER_API_KEY=…
14
- harness
15
+ caelence desktop
15
16
  ```
16
17
 
17
- `bunx harness init` writes `harness.config.ts`, `AGENTS.md`, a sample skill, and a smoke eval. `harness` opens the terminal UI. `caelence-agent` is the same CLI.
18
+ `caelence desktop` starts the desktop app, and you paste an OpenRouter key in Settings. The window build needs [Rust](https://rustup.rs) on the machine.
19
+
20
+ <p align="center">
21
+ <img src="brand/previews/desktop-chat.png" alt="Desktop chat" width="720" />
22
+ </p>
18
23
 
19
- As a library:
24
+ For the terminal UI:
20
25
 
21
26
  ```bash
22
- bun add @useavalon/caelence-agent
27
+ export OPENROUTER_API_KEY=…
28
+ caelence
23
29
  ```
24
30
 
25
- ```ts
26
- import { createHarness } from "@useavalon/caelence-agent";
27
- ```
31
+ `caelence` starts the terminal UI. Run it from a git repository and that repo is the project; otherwise files are kept under `~/.harness/workspace`. `--cwd` overrides both. `caelence-agent` and `harness` are the same command.
28
32
 
29
33
  ## Config
30
34
 
35
+ You can run with no config file, in which case the defaults below apply. To change them, add `harness.config.ts` at the project root:
36
+
31
37
  ```ts
32
38
  import type { HarnessConfig } from "@useavalon/caelence-agent";
33
39
 
34
40
  export default {
35
41
  name: "my-agent",
36
- model: "~x-ai/grok-latest",
42
+ model: "openrouter/auto",
37
43
  instructionsFile: "AGENTS.md",
38
44
  skillsDir: "skills",
39
45
  evalsDir: "evals",
@@ -51,44 +57,94 @@ export default {
51
57
  | `evals/<suite>/eval.ts` | Eval suites |
52
58
  | `AGENTS.md` | Project instructions |
53
59
  | `~/.harness/AGENTS.md` | User instructions for every project |
54
- | `.harness/sessions/` | Session logs (gitignored) |
60
+ | `.harness/sessions/` | Session logs |
61
+ | `~/.harness/integrations.json` | Connected hosted MCP servers |
55
62
 
56
- Set `OPENROUTER_API_KEY`. Optional: `OPENROUTER_MODEL`, `OPENROUTER_BASE_URL`. `/settings key <token>` stores a key in `~/.harness`.
63
+ The desktop stores the OpenRouter key in `~/.harness`. The terminal UI reads `OPENROUTER_API_KEY`, and optionally `OPENROUTER_MODEL` and `OPENROUTER_BASE_URL`.
57
64
 
58
65
  ## Commands
59
66
 
60
67
  ```
61
- harness Terminal UI
62
- harness --mode plan Start in plan mode
63
- harness chat -m "…" One-shot turn
64
- harness eval [name] Run or list evals
65
- harness init Scaffold host files
66
- harness desktop Optional OS window (needs Rust)
68
+ caelence desktop Desktop window (needs Rust)
69
+ caelence Terminal UI
70
+ caelence chat -m "…" One turn, then exit (no TUI)
71
+ caelence --mode plan Start the TUI in plan mode
72
+ caelence eval [name] Run an eval suite, or list suites
73
+ caelence experiment Local website-generation regression (no Langfuse)
74
+ caelence init Add .harness/ to .gitignore
75
+ caelence skill find [query] Bundled skills and popular skills.sh
76
+ caelence skill add <src> Install into ~/.harness/skills
77
+ caelence skill remove <name> Uninstall a user skill, or disable a project skill
78
+ caelence help This list
67
79
  ```
68
80
 
69
- Type `/` in the terminal for the command list. Tab completes.
81
+ Flags: `--mode ask|plan|agent`, `--cwd <path>`, `-m` / `--message <text>`.
82
+
83
+ `caelence chat -m` is the non-interactive path for scripts and CI: it sends one message, prints the reply and any tool lines, then exits without opening the desktop or the terminal UI. `--mode` still applies, and if stdin is not a TTY, tool approval is deny.
84
+
85
+ `caelence init` only appends `.harness/` to `.gitignore` so session logs are not committed. If you want a starter host project, `caelence init --examples` writes a sample `harness.config.ts`, `AGENTS.md`, a skill, and an eval, with `--name` setting the config name.
86
+
87
+ In the desktop and the terminal UI, `/` opens slash commands, and Tab completes them in the terminal.
88
+
89
+ <p align="center">
90
+ <img src="brand/previews/desktop-commands.png" alt="Desktop slash commands" width="720" />
91
+ </p>
70
92
 
71
93
  ```
72
- /skill find
73
- /skill add copywriting
74
- /skill add impeccable
75
- /skill add anthropics/skills@frontend-design
76
- /skill remove copywriting
94
+ /help this list
95
+ /skills loaded skills
96
+ /skill find [q] browse bundled and skills.sh
97
+ /skill add install a bundled or skills.sh skill
98
+ /skill new author a project skill
99
+ /skill remove remove a user skill
100
+ /integrations connect MCP servers
101
+ /eval [name] run an eval suite
102
+ /clear new session
103
+ /resume pick a session by title
104
+ /model pick a model
105
+ /mode ask, plan, or agent
106
+ /compact summarize earlier turns
107
+ /image [prompt] generate an image
108
+ /video [prompt] generate a clip
109
+ /transcribe speech to text model
110
+ /settings OpenRouter API key
111
+ /exit quit
77
112
  ```
78
113
 
79
- `/skill add --project <name>` writes into the project `skillsDir`. `/skill new <name> <what it should do>` authors a project skill from a brief.
114
+ `/skill add --project` installs into the project's `skillsDir` rather than the user store. `/skill new` takes a name and a short brief and authors a project skill from that.
80
115
 
81
116
  ## Skills
82
117
 
83
- Skills are `SKILL.md` files with YAML `name` and `description`. Load order: user store (`~/.harness/skills`), then the project (project wins). The package catalog is off until you add a skill. The agent also reads `skills/`, `.cursor/skills`, and `.claude/skills` when those folders exist.
118
+ A skill is a `SKILL.md` file whose YAML front matter has `name` and `description`. Anything you add from the catalog is copied into `~/.harness/skills`; skills that already live in the current project load as well, and the project copy wins when the names collide.
119
+
120
+ The package also ships a catalog of bundled skills and popular listings from skills.sh, but those are not injected into the prompt until you add them. Once added they behave like any other skill. Existing `skills/`, `.cursor/skills`, and `.claude/skills` folders in the repo are picked up automatically. If you want a project skill on disk but out of the prompt, disable it from `/skill find` instead of deleting the file.
121
+
122
+ <p align="center">
123
+ <img src="brand/previews/desktop-skills.png" alt="Desktop skills" width="720" />
124
+ </p>
84
125
 
85
126
  | Add | What you get |
86
127
  |------|------|
87
- | `copywriting` | Writing pipeline: RMBC, Harry Dry, copy-editor |
88
- | `copy-editor` | That step only |
89
- | `impeccable` | Visual QA against the host `design.md` |
128
+ | `copywriting` | One writing pipeline: RMBC, Harry Dry, then copy-editor. No invented metrics or testimonials. |
129
+ | `impeccable` | Visual QA against the host `design.md` (Apache 2.0 adaptation) |
130
+
131
+ ## Integrations
132
+
133
+ Hosted MCP servers show up as extra tools the agent can call. You connect them from the desktop sidebar or with `/integrations` in the terminal; the browser handles sign-in, and the tools are available on the following turn.
134
+
135
+ <p align="center">
136
+ <img src="brand/previews/desktop-integrations.png" alt="Desktop integrations" width="720" />
137
+ </p>
138
+
139
+ | Connect | Needs |
140
+ |------|------|
141
+ | Hosted server | Browser sign-in |
142
+ | Google or Microsoft | Desktop OAuth client in Settings |
143
+ | Figma | Dev Mode MCP in Figma desktop |
144
+
145
+ Most catalog servers only need that browser sign-in. Google Workspace and Microsoft 365 need a desktop OAuth client pasted in Settings first, and Figma talks to the Dev Mode MCP server running in Figma desktop.
90
146
 
91
- Invented metrics and testimonials stay illegal.
147
+ Each connection is stored in `~/.harness/integrations.json`, and disconnecting removes that row. Local stdio servers are configured separately through `mcp` in `harness.config.ts` (`command`, `args`, `env`).
92
148
 
93
149
  ## Modes
94
150
 
@@ -98,7 +154,38 @@ Invented metrics and testimonials stay illegal.
98
154
  | `plan` | Ask plus `todo_write` |
99
155
  | `agent` | Writes, `exec`, `git_commit`, and `task` |
100
156
 
101
- `/mode ask`, `/mode plan`, or `/mode agent`. `exec` and `git_commit` ask for approval by default (`prompt`). `auto` still denies destructive commands. Local exec is the host machine, not a sandbox.
157
+ Start in `ask`, `plan`, or `agent` with `/mode`, which changes which tools are available. `exec` and `git_commit` prompt for approval by default (`prompt`), and `auto` still refuses destructive commands. Local exec is the host machine rather than a sandbox.
158
+
159
+ ## Library
160
+
161
+ The desktop, the terminal UI, and `caelence chat -m` all call `createHarness`, so you can drive the same runtime from a bot, a script, or another host UI.
162
+
163
+ ```bash
164
+ bun add @useavalon/caelence-agent
165
+ ```
166
+
167
+ ```ts
168
+ import { createHarness } from "@useavalon/caelence-agent";
169
+
170
+ const harness = await createHarness({ cwd: process.cwd() });
171
+ await harness.runTurn("fix the failing test", (event) => {
172
+ if (event.kind === "text_delta") process.stdout.write(event.text);
173
+ if (event.kind === "tool_call_start") process.stderr.write(`› ${event.toolName}\n`);
174
+ });
175
+ harness.close();
176
+ ```
177
+
178
+ `runTurn` streams `AgentEvent`s (text, tools, usage, errors) while it writes the session under `.harness/sessions`. Optional arguments include `config`, `mode`, `provider`, `extraTools`, `approvalPolicy`, and `observability`: pass a fake provider in tests, add MCP tools of your own through `extraTools`, and implement `approvalAsk` when a host UI needs to prompt for `exec` and `git_commit`.
179
+
180
+ If you only need types or tracing, `HarnessConfig` / `loadConfig` and the observability entry do not require constructing a harness at all.
181
+
182
+ | Import | Use |
183
+ |------|------|
184
+ | `HarnessConfig`, `loadConfig` | Typed `harness.config.ts` |
185
+ | `createOpenRouterChat` | OpenRouter chat without the full agent |
186
+ | `EvalSuite`, `runNamedEval` | Eval suites under `evals/` |
187
+ | `initHost` | Add `.harness/` to `.gitignore`. `examples: true` writes a host scaffold |
188
+ | `@useavalon/caelence-agent/observability` | Langfuse, gates, `runLocalExperiment` |
102
189
 
103
190
  ## License
104
191
 
@@ -0,0 +1,7 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="16" height="16" rx="3" fill="#212227"/>
3
+ <path d="M3.25098 7.43878C3.23691 7.64059 3.40228 7.80519 3.60458 7.80519H8.00032V3C5.39648 3 3.42625 4.92544 3.25098 7.43878Z" fill="#FDFCF8"/>
4
+ <path d="M12.7474 3.36627C12.7637 3.16463 12.5982 2.99999 12.3959 2.99999H8.00017V7.80518C10.2723 7.80518 12.5439 5.87967 12.7474 3.36627Z" fill="#FDFCF8"/>
5
+ <path d="M3.25098 9.06122C3.23691 8.85941 3.40228 8.69481 3.60458 8.69481H8.00032V13.5C5.39648 13.5 3.42625 11.5746 3.25098 9.06122Z" fill="#FDFCF8"/>
6
+ <path d="M12.7474 13.1337C12.7637 13.3354 12.5982 13.5 12.3959 13.5H8.00017V8.69482C10.2723 8.69482 12.5439 10.6203 12.7474 13.1337Z" fill="#FDFCF8"/>
7
+ </svg>
@@ -0,0 +1,7 @@
1
+ <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="32" height="32" rx="5" fill="#212227"/>
3
+ <path d="M6.50197 14.8776C6.47382 15.2812 6.80456 15.6104 7.20916 15.6104H16.0006V6C10.793 6 6.85251 9.85089 6.50197 14.8776Z" fill="#FDFCF8"/>
4
+ <path d="M25.4948 6.73255C25.5275 6.32926 25.1964 5.99998 24.7918 5.99998H16.0003V15.6104C20.5445 15.6104 25.0877 11.7593 25.4948 6.73255Z" fill="#FDFCF8"/>
5
+ <path d="M6.50197 18.1224C6.47382 17.7188 6.80456 17.3896 7.20916 17.3896H16.0006V27C10.793 27 6.85251 23.1491 6.50197 18.1224Z" fill="#FDFCF8"/>
6
+ <path d="M25.4948 26.2675C25.5275 26.6707 25.1964 27 24.7918 27H16.0003V17.3896C20.5445 17.3896 25.0877 21.2407 25.4948 26.2675Z" fill="#FDFCF8"/>
7
+ </svg>
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useavalon/caelence-agent",
3
- "version": "0.1.1-canary.0",
3
+ "version": "0.1.1-canary.2",
4
4
  "description": "Caelence agent: Strands turn loop, local tools, skills, evals, and a themable terminal UI.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -21,6 +21,7 @@
21
21
  },
22
22
  "bin": {
23
23
  "harness": "./bin/harness.ts",
24
+ "caelence": "./bin/harness.ts",
24
25
  "caelence-agent": "./bin/harness.ts"
25
26
  },
26
27
  "exports": {
@@ -32,6 +33,7 @@
32
33
  "bin",
33
34
  "src",
34
35
  "skills",
36
+ "brand",
35
37
  "README.md"
36
38
  ],
37
39
  "scripts": {
@@ -0,0 +1,13 @@
1
+ Copyright 2025 Paul Bakaus
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
@@ -0,0 +1,14 @@
1
+ Impeccable
2
+ Copyright 2025 Paul Bakaus
3
+
4
+ This folder is a derivative of https://github.com/pbakaus/impeccable
5
+ licensed under the Apache License, Version 2.0. See LICENSE.
6
+
7
+ Trademark: the name Impeccable is used only to describe the origin of
8
+ the work. This is not an official Impeccable distribution.
9
+
10
+ Modifications for Caelence agent:
11
+ - Rewritten as SKILL.md for this agent (no npm installer, no /impeccable binary)
12
+ - Host design.md is visual authority
13
+ - Copy pipeline (copywriting) is out of scope here
14
+ - Visual-slop list kept as references/visual-slop.md
@@ -12,7 +12,8 @@ description: >-
12
12
  # Impeccable checks
13
13
 
14
14
  Adapted from [Impeccable](https://github.com/pbakaus/impeccable) (Apache 2.0,
15
- Copyright 2025 Paul Bakaus). This skill is **not** a vendor of that repository.
15
+ Copyright 2025 Paul Bakaus). Modified for this agent. See `NOTICE` and
16
+ `LICENSE` in this folder. This skill is **not** a vendor of that repository.
16
17
 
17
18
  **Visual authority:** the host project's `docs/design.md` or `design.md` if
18
19
  either exists. Read it before changing UI. Do not dump a whole tokens file
@@ -0,0 +1,51 @@
1
+ import { existsSync, mkdirSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { dirname, resolve } from "node:path";
4
+ import { resolveConfigPath } from "./config.ts";
5
+ import { harnessHome } from "./desktop/secrets.ts";
6
+
7
+ export function standaloneWorkspaceDir(
8
+ env: Record<string, string | undefined> = process.env,
9
+ ): string {
10
+ return resolve(harnessHome(env), "workspace");
11
+ }
12
+
13
+ export function ensureStandaloneWorkspace(
14
+ env: Record<string, string | undefined> = process.env,
15
+ ): string {
16
+ const dir = standaloneWorkspaceDir(env);
17
+ mkdirSync(dir, { recursive: true });
18
+ return dir;
19
+ }
20
+
21
+ function isProjectRoot(dir: string): boolean {
22
+ if (resolveConfigPath(dir)) return true;
23
+ return existsSync(resolve(dir, ".git"));
24
+ }
25
+
26
+ /** Nearest git repo or harness.config, not the home directory. */
27
+ export function findProjectRoot(
28
+ start: string,
29
+ env: Record<string, string | undefined> = process.env,
30
+ ): string | undefined {
31
+ const home = resolve(env.HOME?.trim() || homedir());
32
+ let dir = resolve(start);
33
+ while (true) {
34
+ if (dir !== home && isProjectRoot(dir)) return dir;
35
+ const parent = dirname(dir);
36
+ if (parent === dir) return undefined;
37
+ dir = parent;
38
+ }
39
+ }
40
+
41
+ /** `--cwd` wins. Else a project root from `start`. Else `~/.harness/workspace`. */
42
+ export function resolveAgentCwd(input: {
43
+ start: string;
44
+ explicit?: string;
45
+ env?: Record<string, string | undefined>;
46
+ }): string {
47
+ const env = input.env ?? process.env;
48
+ const explicit = input.explicit?.trim();
49
+ if (explicit) return resolve(explicit);
50
+ return findProjectRoot(input.start, env) ?? ensureStandaloneWorkspace(env);
51
+ }
@@ -0,0 +1,65 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import { mkdir, rm, writeFile } from "node:fs/promises";
3
+ import { tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+ import {
6
+ ensureStandaloneWorkspace,
7
+ findProjectRoot,
8
+ resolveAgentCwd,
9
+ standaloneWorkspaceDir,
10
+ } from "../agent-cwd.ts";
11
+
12
+ async function tempDir(prefix: string): Promise<string> {
13
+ const dir = join(tmpdir(), `${prefix}${Date.now()}-${Math.random().toString(16).slice(2)}`);
14
+ await mkdir(dir, { recursive: true });
15
+ return dir;
16
+ }
17
+
18
+ describe("resolveAgentCwd", () => {
19
+ test("explicit --cwd wins", async () => {
20
+ const cwd = await tempDir("agent-cwd-explicit-");
21
+ try {
22
+ expect(resolveAgentCwd({ start: tmpdir(), explicit: cwd })).toBe(cwd);
23
+ } finally {
24
+ await rm(cwd, { recursive: true, force: true });
25
+ }
26
+ });
27
+
28
+ test("walks up to a git root", async () => {
29
+ const root = await tempDir("agent-cwd-git-");
30
+ const nested = join(root, "src", "cli");
31
+ try {
32
+ await mkdir(join(root, ".git"));
33
+ await mkdir(nested, { recursive: true });
34
+ expect(findProjectRoot(nested)).toBe(root);
35
+ expect(resolveAgentCwd({ start: nested })).toBe(root);
36
+ } finally {
37
+ await rm(root, { recursive: true, force: true });
38
+ }
39
+ });
40
+
41
+ test("uses harness.config.ts as a project root", async () => {
42
+ const root = await tempDir("agent-cwd-config-");
43
+ try {
44
+ await writeFile(join(root, "harness.config.ts"), "export default {}\n");
45
+ expect(findProjectRoot(root)).toBe(root);
46
+ } finally {
47
+ await rm(root, { recursive: true, force: true });
48
+ }
49
+ });
50
+
51
+ test("home is not a project even with .git", async () => {
52
+ const home = await tempDir("agent-cwd-home-");
53
+ const harnessHome = await tempDir("agent-cwd-home-harness-");
54
+ try {
55
+ await mkdir(join(home, ".git"));
56
+ const env = { HOME: home, HARNESS_HOME: harnessHome };
57
+ expect(findProjectRoot(home, env)).toBeUndefined();
58
+ expect(resolveAgentCwd({ start: home, env })).toBe(standaloneWorkspaceDir(env));
59
+ expect(ensureStandaloneWorkspace(env)).toBe(join(harnessHome, "workspace"));
60
+ } finally {
61
+ await rm(home, { recursive: true, force: true });
62
+ await rm(harnessHome, { recursive: true, force: true });
63
+ }
64
+ });
65
+ });
@@ -33,4 +33,9 @@ describe("parseCliArgs", () => {
33
33
  expect(parsed.mode).toBe("ask");
34
34
  expect(parsed.message).toBe("hello");
35
35
  });
36
+
37
+ test("marks --cwd as explicit", () => {
38
+ expect(parseCliArgs(["eval"]).cwdExplicit).toBe(false);
39
+ expect(parseCliArgs(["--cwd", "/tmp/proj", "eval"]).cwdExplicit).toBe(true);
40
+ });
36
41
  });