agent-director 0.4.0 → 0.4.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 CHANGED
@@ -10,6 +10,68 @@ bun add agent-director
10
10
 
11
11
  Requires Bun >=1.0.21. The package ships a prebuilt shared library for each supported platform via optional dependencies — they install automatically on `bun add`.
12
12
 
13
+ On install, a postinstall script copies the `install-agent-director` skill body into `~/.claude/skills/install-agent-director/` so `claude /install-agent-director` is immediately discoverable in Claude Code. The postinstall only writes under `~/.claude/skills/`; it does not touch PATH, `~/.agent-director/`, or your Claude Code settings.
14
+
15
+ Bun blocks dependency postinstalls by default. Trust this package so the skill copy can run:
16
+
17
+ ```sh
18
+ bun pm trust agent-director
19
+ ```
20
+
21
+ Or pre-declare it in your `package.json` before `bun add`:
22
+
23
+ ```json
24
+ {
25
+ "trustedDependencies": ["agent-director"]
26
+ }
27
+ ```
28
+
29
+ ### Verbose install logs
30
+
31
+ Set `AD_POSTINSTALL_VERBOSE=1` (also accepts `true` / `yes`, case-insensitive) before `bun add` to see what the postinstall resolved and decided. The default is quiet — five lines maximum.
32
+
33
+ ### Skipping the postinstall
34
+
35
+ `bun add --ignore-scripts agent-director` installs the library without running the postinstall. The skill is not copied. To get skill discoverability after the fact, either:
36
+
37
+ ```sh
38
+ cp -r node_modules/agent-director/skills/install-agent-director ~/.claude/skills/
39
+ ```
40
+
41
+ or, once the library is on disk, invoke `claude /install-agent-director` from any Claude Code session — the install skill copies itself into `~/.claude/skills/` as a side effect of running.
42
+
43
+ ### How the postinstall decides whether to overwrite
44
+
45
+ The skill body carries a `version:` field in its YAML frontmatter. On every install the postinstall reads the bundled version and the version already on disk:
46
+
47
+ - **Same version** — no filesystem changes, no output.
48
+ - **Older or missing on disk** — overwrite, leaving a timestamped `install-agent-director.bak.<unix-ts>` sibling under `~/.claude/skills/`.
49
+ - **Newer on disk** — leave it alone, single-line warning to stderr.
50
+
51
+ The authoritative behavior contract lives in Idea Bee `b.fg3`.
52
+
53
+ ## Supported platforms
54
+
55
+ **Supported** — install + library + skill all work:
56
+
57
+ - `linux/x64` (Linux on x86_64)
58
+ - `darwin/arm64` (Apple Silicon Mac)
59
+
60
+ **Refused at install time by npm/bun** — the umbrella's `os`/`cpu` fields fail resolution and no postinstall runs:
61
+
62
+ - Windows (any architecture)
63
+ - FreeBSD, OpenBSD, and other non-Linux/non-Darwin OSes
64
+ - any architecture not in `[x64, arm64]` (e.g. `ia32`, `mips`, `arm`)
65
+
66
+ **Refused by the postinstall after npm/bun admits the install** — the umbrella runs but the postinstall exits non-zero with an `agent-director: unsupported host` message before any filesystem write:
67
+
68
+ - `darwin/x64` (Intel Mac)
69
+ - `linux/arm64`
70
+
71
+ The refusal is two-layered because npm/bun's `os` and `cpu` fields are a cross-product, not a per-pair set: the coarse gate cannot distinguish "supported pair" from "supported OS plus supported arch in any combination." The postinstall's host-pair check catches the two cross-product members that should not actually install.
72
+
73
+ See Idea Bee `b.fg3` for cross-platform expansion status.
74
+
13
75
  ## Quick start
14
76
 
15
77
  `using` block (preferred):
package/package.json CHANGED
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "name": "agent-director",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
+ "os": [
6
+ "linux",
7
+ "darwin"
8
+ ],
9
+ "cpu": [
10
+ "x64",
11
+ "arm64"
12
+ ],
5
13
  "engines": {
6
14
  "bun": ">=1.0.21"
7
15
  },
@@ -9,7 +17,9 @@
9
17
  "dist/**/*.js",
10
18
  "dist/**/*.d.ts",
11
19
  "!dist/**/*.test.*",
12
- "README.md"
20
+ "README.md",
21
+ "scripts/postinstall.ts",
22
+ "skills/install-agent-director/**"
13
23
  ],
14
24
  "exports": {
15
25
  ".": {
@@ -25,12 +35,15 @@
25
35
  "smoke": "bun test test/smoke/ test/smoke-invariants.test.ts",
26
36
  "envelope-diff": "bun test test/envelope-diff.test.ts test/envelope-diff-invariants.test.ts",
27
37
  "prepare-platforms": "bun run scripts/prepare-platforms.ts",
38
+ "stage-skill": "bun run scripts/stage-skill.ts",
39
+ "prepack": "bun run scripts/stage-skill.ts",
40
+ "postinstall": "bun run scripts/postinstall.ts",
28
41
  "version-bump-publish": "bun run scripts/version-bump.ts",
29
- "prepublishOnly": "bun run scripts/check-not-placeholder.ts"
42
+ "prepublishOnly": "bun run scripts/prepublish-guards.ts"
30
43
  },
31
44
  "optionalDependencies": {
32
- "@agent-director/linux-x64": "^0.4.0",
33
- "@agent-director/darwin-arm64": "^0.4.0"
45
+ "@agent-director/linux-x64": "^0.4.1",
46
+ "@agent-director/darwin-arm64": "^0.4.1"
34
47
  },
35
48
  "devDependencies": {
36
49
  "typescript": ">=5.2.0",