agentwheel 0.10.0 → 0.14.3

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
@@ -26,7 +26,7 @@ forward explicitly; installs make the current declaration true.
26
26
  ```bash
27
27
  npm i -g agentwheel
28
28
  agentwheel init
29
- agentwheel add github:your-org/agent-pack --adapter codex --mode tracking
29
+ agentwheel add github:your-org/agent-pack --adapter codex --installation-type local --mode tracking
30
30
  agentwheel plan
31
31
  agentwheel install
32
32
  ```
@@ -34,23 +34,33 @@ agentwheel install
34
34
  No lock-in. No central gatekeeper. Packages live in plain git repos or local folders, customizations
35
35
  live in your workspace, and runtimes stay generated output.
36
36
 
37
- > **Status: early (v0.9).** v0.9 switches the public CLI vocabulary to package-manager verbs:
38
- > `add`, `install`, `update`, and `uninstall`. A hidden `sync` shim remains for one release only
39
- > so old bootstrapped skills can self-update; use `install` in all new docs and scripts.
37
+ > **Status: early (v0.12).** The public CLI vocabulary is package-manager style:
38
+ > `add`, `install`, `update`, and `uninstall`. A hidden `sync` shim remains for old bootstrapped
39
+ > skills; use `install` in all new docs and scripts.
40
40
 
41
41
  ## Supported runtimes & resources
42
42
 
43
- agentwheel installs OpenPack resources into five built-in runtimes and into custom harnesses:
43
+ agentwheel installs OpenPack resources into five built-in runtimes and into custom harnesses.
44
+ Every built-in target is scoped by `--installation-type <type>`; built-ins currently use `local`
45
+ for project/workspace installs and `user` for documented user-level installs. If a package can be
46
+ installed in more than one type, agentwheel requires `--installation-type` instead of guessing.
44
47
 
45
- - **OpenClaw** — `.openclaw/`
46
- - **Claude Code** — `.claude/`
47
- - **Codex CLI** — `.codex/`
48
- - **GitHub Copilot** — `.github/`
49
- - **Hermes** — `.hermes/`
48
+ - **OpenClaw** — workspace `skills/`, user `~/.openclaw/skills`
49
+ - **Claude Code** — `CLAUDE.md`, `.claude/`, and user `~/.claude/`
50
+ - **Codex CLI** — `AGENTS.md`, `.agents/skills`, `.codex/`, and user equivalents
51
+ - **GitHub Copilot CLI** — `.github/`, user `~/.copilot/`, and documented `.agents` skill alternatives
52
+ - **Hermes** — local instructions via `AGENTS.md`; skills are user-only at `~/.hermes/skills`
50
53
  - **Bring your own** — JSONC config adapters with `--adapter-config`, or programmatic adapters with `--adapter-module`
51
54
 
52
55
  Supported resource types include instructions, rules, skills, commands, subagents, MCP, hooks,
53
- settings, plugins, and fragments; see the full per-runtime target table below.
56
+ settings, plugins, and fragments. Runtime compatibility is per artifact and per installation type;
57
+ see [`docs/design/artifact-harness-compatibility.md`](docs/design/artifact-harness-compatibility.md).
58
+ Fragments are Agentwheel composition inputs, not runtime file-drop targets.
59
+
60
+ > `rules` is an OpenPack artifact kind, not a portable runtime concept. Codex rules are command
61
+ > execution policy, Claude rules are behavioral/path-scoped instructions, and Copilot rule-like
62
+ > installs map to path-specific custom instructions. Unsupported rule targets require an explicit
63
+ > custom adapter instead of an inferred folder.
54
64
 
55
65
  ## Core Commands
56
66
 
@@ -60,10 +70,10 @@ settings, plugins, and fragments; see the full per-runtime target table below.
60
70
  | `agentwheel plan [name-or-source]` | Preview what `install` would reconcile without writing. |
61
71
  | `agentwheel install` | Reconcile configured packages into the current target or selected fleet. Uses the graph lock as input by default. |
62
72
  | `agentwheel install <name-or-source>` | Ensure semantics: configured name/source scopes the install; a new source is added and installed. |
63
- | `agentwheel update [name]` | Re-resolve tracking packages, then apply. Pinned packages stay locked. |
73
+ | `agentwheel update [name]` | Re-resolve tracking packages, then apply. Pinned packages stay locked. Use `--profile <name>` for profile-managed fleets. |
64
74
  | `agentwheel uninstall <name-or-source>` | Remove a configured package from runtimes and config. |
65
75
  | `agentwheel uninstall <name> --keep-files` | Remove from config/manifest while leaving runtime files unmanaged. |
66
- | `agentwheel status` | Show configured packages, manifest/lock presence, and install state. |
76
+ | `agentwheel status` | Show configured packages, manifest/lock presence, and install state. Use `--profile <name>` for profile-managed fleets; `status --all` uses profile `all` when present. |
67
77
 
68
78
  Mental model: **`install` = make what is declared true. `update` = move tracking declarations forward,
69
79
  then make them true.**
@@ -76,7 +86,7 @@ to reconcile those removals.
76
86
  npm i -g agentwheel
77
87
 
78
88
  agentwheel init
79
- agentwheel add github:your-org/agent-pack --adapter openclaw --mode tracking
89
+ agentwheel add github:your-org/agent-pack --adapter openclaw --installation-type local --mode tracking
80
90
  agentwheel plan
81
91
  agentwheel install
82
92
  ```
@@ -111,10 +121,20 @@ cd ~/.openclaw
111
121
  agentwheel install
112
122
  ```
113
123
 
114
- If the current directory is already the runtime directory (`~/.openclaw`), agentwheel uses its
115
- parent as the root so output lands in `~/.openclaw/skills`, not `~/.openclaw/.openclaw/skills`.
116
- If the current directory contains a runtime directory (`./.openclaw`), that directory is used as
117
- the target under the current project.
124
+ Explicit source installs with an explicit adapter default to user-level artifacts, so this works as
125
+ a global install:
126
+
127
+ ```bash
128
+ agentwheel install github:your-org/agent-pack --adapter codex,claude
129
+ ```
130
+
131
+ Use `--local` for the current directory or `-t/--target-root <project>` for another
132
+ project/workspace. Use `--user`, `--local`, or `-i/--installation-type <type>` when you want the
133
+ scope to be explicit. For example, Codex local skills install into `.agents/skills`, while Codex user
134
+ skills install into `~/.agents/skills`.
135
+
136
+ When adding a new source this way, Agentwheel saves one package entry per adapter so later installs
137
+ do not collapse Codex and Claude state into the same config entry.
118
138
 
119
139
  For a control-plane setup, define named agents in config. Global config lives at
120
140
  `~/.agentwheel/config.json`; project config lives at `.agentwheel/config.json`; project values win.
@@ -122,10 +142,11 @@ For a control-plane setup, define named agents in config. Global config lives at
122
142
  ```jsonc
123
143
  {
124
144
  "agents": {
125
- "lab-openclaw": { "adapter": "openclaw", "root": "/Users/me/.openclaw-home", "transport": "local" },
145
+ "lab-openclaw": { "adapter": "openclaw", "installationType": "local", "root": "$HOME/.openclaw-home", "transport": "local" },
126
146
  "remote-codex": {
127
147
  "adapter": "codex",
128
- "root": "/home/agent/project",
148
+ "installationType": "local",
149
+ "root": "/workspace/project",
129
150
  "transport": "ssh",
130
151
  "host": "agent-host.example",
131
152
  "user": "agent",
@@ -147,7 +168,9 @@ For a control-plane setup, define named agents in config. Global config lives at
147
168
  ```bash
148
169
  agentwheel install --agent lab-openclaw
149
170
  agentwheel install --all
171
+ agentwheel update --profile daily --dry-run
150
172
  agentwheel install --profile daily
173
+ agentwheel status --profile daily
151
174
  agentwheel install --all-detected
152
175
  ```
153
176
 
@@ -201,7 +224,7 @@ Install only part of a package with `--select <type>/<name>`. `--skill <name>` i
201
224
  `update` runs.
202
225
 
203
226
  ```bash
204
- agentwheel add github:NestDevLab/agent-mesh --skill codex-tmux --adapter codex
227
+ agentwheel add github:NestDevLab/agent-mesh --skill codex-tmux --adapter codex --installation-type local
205
228
  agentwheel plan
206
229
  agentwheel install
207
230
  ```
@@ -272,6 +295,60 @@ still owned by another configured package.
272
295
  }
273
296
  ```
274
297
 
298
+ ### Source Overrides
299
+
300
+ Use package-level `overrides` when a workspace intentionally wants one selected source to replace
301
+ an artifact that arrives from another package, such as a forked skill replacing the same skill
302
+ pulled in by a meta-package. Overrides are explicit; package array order never decides precedence.
303
+
304
+ ```jsonc
305
+ {
306
+ "schemaVersion": 1,
307
+ "packages": [
308
+ {
309
+ "name": "nestdev-must-have-core",
310
+ "source": "github:NestDevLab/agent-must-have#core",
311
+ "driver": "git",
312
+ "adapter": "codex",
313
+ "installationType": "local",
314
+ "mode": "tracking"
315
+ },
316
+ {
317
+ "name": "agent-toolkit-nestdev",
318
+ "source": "github:example-org/agent-toolkit#main",
319
+ "driver": "git",
320
+ "adapter": "codex",
321
+ "installationType": "local",
322
+ "mode": "tracking",
323
+ "select": [
324
+ "rules/self-improve-on-correction.md",
325
+ "skills/self-improve"
326
+ ],
327
+ "overrides": [
328
+ "github:example-upstream/agent-toolkit::rules/self-improve-on-correction.md",
329
+ "github:example-upstream/agent-toolkit::skills/self-improve"
330
+ ]
331
+ }
332
+ ]
333
+ }
334
+ ```
335
+
336
+ The `source::type/name` selector identifies the artifact to replace. `github:owner/repo` matches
337
+ that repository at any ref; add `#main` or another ref to narrow it. The replacing package must
338
+ select exactly one artifact with the same `type/name`, and the override must match exactly one
339
+ losing artifact. Otherwise planning fails instead of hiding a collision.
340
+
341
+ The same declaration can be created from the CLI:
342
+
343
+ ```bash
344
+ agentwheel add github:example-org/agent-toolkit#main \
345
+ --skill self-improve \
346
+ --override 'github:example-upstream/agent-toolkit::skills/self-improve'
347
+ ```
348
+
349
+ `agentwheel plan`, `agentwheel deps tree`, and `agentwheel deps why` print `OVERRIDE` lines for
350
+ these decisions, and graph locks store them for review.
351
+
275
352
  Migrating an existing legacy package takes one command:
276
353
 
277
354
  ```bash
@@ -285,7 +362,9 @@ Drift detection blocks accidental edits to generated runtime files. Intentional
285
362
 
286
363
  - **Layer** local instructions with `agentwheel remember`.
287
364
  - **Add** separate local artifacts under `.agentwheel/additions`.
288
- - **Override** an upstream item under `.agentwheel/overrides`.
365
+ - **Override content** for an upstream item under `.agentwheel/overrides`.
366
+ - **Override source precedence** with package `overrides` when a forked source should replace a
367
+ colliding artifact from another package.
289
368
  - **Eject** an item into `.agentwheel/ejected` when you want local ownership.
290
369
 
291
370
  ## Custom And Private Runtimes
@@ -297,9 +376,16 @@ published:
297
376
  {
298
377
  "name": "myco-internal",
299
378
  "targets": {
300
- "instructions": { "dest": ".myco/context/AGENTS.md" },
301
- "rules": { "dest": ".myco/policy/rules" },
302
- "skills": { "dest": ".myco/lib/skills" }
379
+ "instructions": {
380
+ "local": { "dest": ".myco/context/AGENTS.md" }
381
+ },
382
+ "rules": {
383
+ "local": { "dest": ".myco/policy/rules" }
384
+ },
385
+ "skills": {
386
+ "local": { "dest": ".myco/lib/skills" },
387
+ "user": { "root": "home", "dest": ".myco/skills" }
388
+ }
303
389
  }
304
390
  }
305
391
  ```
@@ -316,18 +402,19 @@ agentwheel install ./my-pack --adapter-module ./myco-adapter.js
316
402
 
317
403
  Built-in runtime targets:
318
404
 
319
- | Runtime | Main targets |
405
+ | Runtime | Native supported targets |
320
406
  |---|---|
321
- | **OpenClaw** | `.openclaw/AGENTS.md`, `.openclaw/skills`, `.openclaw/rules`, `.openclaw/commands`, `.openclaw/agents`, MCP/hooks/settings, semantic plugin planning |
322
- | **Claude Code** | `.claude/CLAUDE.md`, `.claude/skills`, `.claude/commands`, `.claude/agents`, `.claude/rules`, `.claude/.mcp.json`, `.claude/settings.json` |
323
- | **Codex CLI** | `.codex/AGENTS.md`, `.codex/skills`, `.codex/commands`, `.codex/agents`, `.codex/rules`, `.codex/config.toml`, `.codex/hooks.json` |
324
- | **Hermes** | `.hermes/AGENTS.md`, `.hermes/skills`, `.hermes/rules`, `.hermes/commands`, `.hermes/agents`, MCP/hooks/settings |
325
- | **GitHub Copilot** | `.github/copilot-instructions.md`, `.github/instructions`, `.github/prompts`, `.github/skills`, `.github/agents`, `.vscode/mcp.json` |
407
+ | **OpenClaw** | `local: skills/`; `user: ~/.openclaw/skills`; plugins require runtime-specific config |
408
+ | **Claude Code** | `local: CLAUDE.md, .claude/skills, .claude/rules, .claude/commands, .claude/agents, .mcp.json, .claude/settings.json`; `user: ~/.claude/...` except project MCP; rules are behavioral/path-scoped |
409
+ | **Codex CLI** | `local: AGENTS.md, .agents/skills, .codex/rules, .codex/agents, .codex/config.toml, .codex/hooks.json`; `user: ~/.agents/skills, ~/.codex/...`; rules are command execution policy; subagents are TOML custom agents |
410
+ | **Hermes** | `local: AGENTS.md`; `user: ~/.hermes/skills`; rules require explicit adapter config |
411
+ | **GitHub Copilot CLI** | `local: .github/copilot-instructions.md, .github/instructions, .github/prompts, .github/skills, .github/agents, .github/mcp.json, .github/hooks`; `user: ~/.copilot/copilot-instructions.md, ~/.copilot/instructions, ~/.copilot/skills, ~/.copilot/agents, ~/.copilot/mcp-config.json, ~/.copilot/hooks`; rule-like artifacts map to instructions |
326
412
 
327
413
  ## Docs
328
414
 
329
415
  - [`docs/spec/openpack.md`](docs/spec/openpack.md) — OpenPack package spec.
330
416
  - [`docs/fleet-config.md`](docs/fleet-config.md) — named agents, SSH targets, and profiles.
417
+ - [`docs/design/artifact-harness-compatibility.md`](docs/design/artifact-harness-compatibility.md) — artifact/harness compatibility matrix and rule semantics.
331
418
  - Resource catalogue: https://nestdevlab.github.io/agentwheel/catalogue.html.
332
419
  - [`DESIGN.md`](DESIGN.md) — architecture and module layout.
333
420
  - [`LIFECYCLE.md`](LIFECYCLE.md) — publish, install, update, and customization model.
@@ -18,6 +18,8 @@ import {
18
18
  writeFile
19
19
  } from "fs/promises";
20
20
  import { dirname, join, relative } from "path";
21
+ var IGNORED_ENTRY_NAMES = /* @__PURE__ */ new Set([".git", "node_modules", "__pycache__", ".DS_Store"]);
22
+ var IGNORED_SUFFIXES = [".pyc", ".pyo"];
21
23
  async function pathExists(path) {
22
24
  try {
23
25
  await stat(path);
@@ -48,7 +50,7 @@ async function listFiles(root) {
48
50
  async function walk(dir) {
49
51
  const entries = await readdir(dir, { withFileTypes: true });
50
52
  for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
51
- if (entry.name === ".git" || entry.name === "node_modules") continue;
53
+ if (isIgnoredGeneratedEntry(entry.name)) continue;
52
54
  const full = join(dir, entry.name);
53
55
  if (entry.isDirectory()) {
54
56
  await walk(full);
@@ -60,6 +62,9 @@ async function listFiles(root) {
60
62
  await walk(root);
61
63
  return out;
62
64
  }
65
+ function isIgnoredGeneratedEntry(name) {
66
+ return IGNORED_ENTRY_NAMES.has(name) || IGNORED_SUFFIXES.some((suffix) => name.endsWith(suffix));
67
+ }
63
68
  async function atomicCopy(source, dest, kind) {
64
69
  await mkdir(dirname(dest), { recursive: true });
65
70
  const temp = `${dest}.agentwheel-tmp-${process.pid}-${Date.now()}`;
@@ -67,7 +72,7 @@ async function atomicCopy(source, dest, kind) {
67
72
  if (kind === "file") {
68
73
  await copyFile(source, temp);
69
74
  } else {
70
- await cp(source, temp, { recursive: true, dereference: true });
75
+ await cp(source, temp, { recursive: true, dereference: true, filter: (path) => !isIgnoredGeneratedEntry(path.split(/[\\/]/).at(-1) ?? "") });
71
76
  }
72
77
  await rm(dest, { recursive: true, force: true });
73
78
  await rename(temp, dest);
@@ -104,6 +109,7 @@ function resolveLocalPath(source) {
104
109
  export {
105
110
  pathExists,
106
111
  hashPath,
112
+ isIgnoredGeneratedEntry,
107
113
  atomicCopy,
108
114
  writeJsonAtomic,
109
115
  inferSourceDriverName,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  inferSourceDriverName,
4
4
  isExplicitSource
5
- } from "./chunk-N2LZY7LO.js";
5
+ } from "./chunk-B3FMBTWC.js";
6
6
  export {
7
7
  inferSourceDriverName,
8
8
  isExplicitSource