@cardor/agent-harness-kit 2.1.0 → 2.1.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/README.md +20 -3
- package/dist/cli.js +309 -230
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,6 +34,7 @@ npx ahk init
|
|
|
34
34
|
- [Commands](#commands)
|
|
35
35
|
- [`ahk init`](#ahk-init)
|
|
36
36
|
- [`ahk build`](#ahk-build)
|
|
37
|
+
- [`ahk models`](#ahk-models)
|
|
37
38
|
- [`ahk dashboard`](#ahk-dashboard)
|
|
38
39
|
- [`ahk status`](#ahk-status)
|
|
39
40
|
- [`ahk health`](#ahk-health)
|
|
@@ -179,9 +180,9 @@ npx ahk init
|
|
|
179
180
|
|
|
180
181
|
Detection order: the `packageManager` field in your `package.json` (e.g. `"packageManager": "pnpm@8.15.0"`) takes priority when present; otherwise `ahk` falls back to lockfile heuristics; if nothing is detected, it defaults to npm.
|
|
181
182
|
|
|
182
|
-
**Global installs bypass the package manager entirely.** Every command in the table above asks your package manager to resolve a *locally installed* `ahk` binary — `npx --no` deliberately refuses to download one, and `pnpm exec`/`yarn run`/`bunx --no-install` have nothing to point at. If you installed the CLI globally and never added it to the project, all five of those commands fail. So `ahk` checks for
|
|
183
|
+
**Global installs bypass the package manager entirely.** Every command in the table above asks your package manager to resolve a *locally installed* `ahk` binary — `npx --no` deliberately refuses to download one, and `pnpm exec`/`yarn run`/`bunx --no-install` have nothing to point at. If you installed the CLI globally and never added it to the project, all five of those commands fail. So `ahk` checks for a *real* local install first and, when there is none, generates the bare `ahk serve --port <port>` — resolved from your `PATH` like any other global binary. The package-manager-specific commands are used only when a local install actually exists. If, on that global-install path, `ahk` is not resolvable on your `PATH` at generation time, `ahk` prints a non-blocking warning (the command still succeeds) pointing you at `npm i -g @cardor/agent-harness-kit` or a local install — moving the "binary not found" failure earlier instead of surfacing it later when the MCP server is spawned.
|
|
183
184
|
|
|
184
|
-
Working inside the `agent-harness-kit` repository itself
|
|
185
|
+
Working inside the `agent-harness-kit` repository itself does **not** count as a local install for this decision: there is no real `node_modules/@cardor/agent-harness-kit` entry for a package manager to resolve, so self-dev generates the bare global `ahk serve --port <port>` form, same as any other project with no local install. This is a narrower check than the one deciding your config file format, above (`ahk init`'s `.ts`/`.mjs`/`.cjs` vs. `.json` choice) — that check still treats self-dev as satisfied, since it only cares whether the package is resolvable for type-checking purposes, not whether a package manager can mediate a spawned command.
|
|
185
186
|
|
|
186
187
|
**Existing projects:** if you initialized your project before this change, your `.mcp.json`/`opencode.json`/`.codex/config.toml`/`.grok/config.toml` may still have a hardcoded `npx` command. No migration step is needed — `ahk build` always regenerates (merges) these files from scratch on every run, so the command self-corrects the next time you run `ahk build` (or `ahk build --sync`), including if you've since switched package managers.
|
|
187
188
|
|
|
@@ -193,7 +194,7 @@ Working inside the `agent-harness-kit` repository itself counts as a local insta
|
|
|
193
194
|
|
|
194
195
|
Interactive scaffold. Asks for your project name, description, AI provider, docs path, storage scope, task adapter, and an optional first task. Creates all harness files in the current directory.
|
|
195
196
|
|
|
196
|
-
Claude Code only, init asks you to pick a model for each of the 5 core roles (lead, explorer, consultant, builder, reviewer) one at a time: `inherit` (default), `haiku`, `sonnet`, `opus`, or `fable`. Each choice is written straight into that role's generated `.claude/agents/<role>.md` frontmatter as a `model:` line at scaffold time — it is never persisted to the config file. Picking `inherit` (the default) emits no `model:` line at all, leaving Claude Code to apply its own default.
|
|
197
|
+
Claude Code only, init asks you to pick a model for each of the 5 core roles (lead, explorer, consultant, builder, reviewer) one at a time: `inherit` (default), `haiku`, `sonnet`, `opus`, or `fable`. Each choice is written straight into that role's generated `.claude/agents/<role>.md` frontmatter as a `model:` line at scaffold time — it is never persisted to the config file. Picking `inherit` (the default) emits no `model:` line at all, leaving Claude Code to apply its own default. Agent files are user-owned once generated (see [Agent files are yours](#agent-files-are-yours) below), so after init the model can be changed three ways: hand-editing the `model:` frontmatter line directly, running [`ahk models`](#ahk-models) to re-prompt and regenerate just the 5 agent files, or running `ahk build --force` (which re-prompts too, then regenerates everything `--force` regenerates).
|
|
197
198
|
|
|
198
199
|
OpenCode, Codex CLI, and Grok Build are unaffected by this prompt — it never appears for those providers. OpenCode and Grok Build have no closed model enum to prompt against, and Codex's model is still set by hand-editing `model = "..."` in its TOML.
|
|
199
200
|
|
|
@@ -267,6 +268,7 @@ ahk build --force
|
|
|
267
268
|
- **It discards your customizations.** Every agent file is rewritten from the template. Prompt edits, `model:` lines, and restriction tweaks are all lost.
|
|
268
269
|
- **It backs up first.** Before overwriting anything, the current content of every affected file is copied under `.harness/backups/` — agent files to `agents-<timestamp>/`, hand-edited `AGENTS.md`/`CLAUDE.md` to `derived-<timestamp>/`. If that backup cannot be written, the command aborts and **no file is modified** — the same fail-safe as [`ahk migrate storage --force`](#storage-migration).
|
|
269
270
|
- **It names what it touched.** The command prints every file it overwrote and the backup location, so you can diff or restore.
|
|
271
|
+
- **Claude Code only, it also re-prompts for models.** Before regenerating, `ahk build --force` runs the same per-role model prompt as `ahk init` (see above) and injects the fresh choices into the regenerated frontmatter. Other providers are unaffected — no prompt appears for them.
|
|
270
272
|
|
|
271
273
|
`--force` also regenerates a hand-edited `AGENTS.md` or `CLAUDE.md` (backing it up first) — the only time you need it for those files, since an *unedited* one already re-generates on its own when config changes.
|
|
272
274
|
|
|
@@ -276,6 +278,21 @@ ahk build --force
|
|
|
276
278
|
|
|
277
279
|
---
|
|
278
280
|
|
|
281
|
+
### `ahk models`
|
|
282
|
+
|
|
283
|
+
Claude Code only. Re-runs `ahk init`'s per-role model prompt and regenerates ONLY the 5 `.claude/agents/*.md` files with the chosen models — nothing else (not `AGENTS.md`, `CLAUDE.md`, `.mcp.json`, `.claude/settings.json`, your config file, docs path, storage scope, or task adapter).
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
ahk models
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
- Prompts once per role (lead, explorer, consultant, builder, reviewer): `inherit` (default), `haiku`, `sonnet`, `opus`, or `fable` — same prompt as `ahk init`.
|
|
290
|
+
- Always regenerates all 5 agent files, backing up the previous content first under `.harness/backups/agents-<timestamp>/` — the same fail-safe [`--force`](#--force) uses.
|
|
291
|
+
- On a non-Claude-Code project, it prints a one-line no-op message and exits — no prompt.
|
|
292
|
+
- If no `agent-harness-kit.config` is found, it prints a message pointing at `ahk init` and exits — no prompt, no stack trace.
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
279
296
|
### `ahk dashboard`
|
|
280
297
|
|
|
281
298
|
Opens a local web dashboard to visualize everything stored in the harness database — tasks, agent actions, file operations, tool usage, and live timelines. Updates in real time via WebSocket as agents work.
|