Skip to content

Commit d72795a

Browse files
committed
chore(release): v0.4.0 — all packages at 0.4.0, fix codex/kimi peerDeps, document changeset quirk
Reset to the clean all-0.4.0 state (every published package at 0.4.0) and prepare the release. The prior versioning attempt (4ce6006) had let changeset escalate codex/kimi to 1.0.0 because their peerDependencies were stale (^0.3.0): changeset rewrote the range to ^0.4.0, detected the tightening as breaking, and bumped major. This pins both peerDeps to ^0.4.0 in lockstep with the released version. - adapter-codex/adapter-kimi: peerDependencies @agentplugins/core ^0.3.0 → ^0.4.0 - core CHANGELOG: fix stale @compile/@contract 0.5.0 refs → 0.4.0 - root CHANGELOG: restore the v0.4.0 section; drop the false @agentplugins/store line (store isolation is v0.5.0 scope) and note it as planned - .changeset/README.md: document the peerDep range-tightening quirk so it does not recur v0.4.0 is tagged but unpublished (no npm publish).
1 parent 3f2b801 commit d72795a

5 files changed

Lines changed: 77 additions & 4 deletions

File tree

.changeset/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,25 @@ find the full documentation for it [in our repository](https://github.com/change
66

77
We have a quick list of common questions to get you started engaging with this project in
88
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md).
9+
10+
## ⚠ peerDependency range quirk — read before `changeset version`
11+
12+
`updateInternalDependencies: "patch"` caps the *bump type* for internal dep
13+
updates, but changeset **also rewrites dep ranges** during `version`. When a
14+
`peerDependencies` range is *tightened* (e.g. `@agentplugins/core` going
15+
`^0.3.0``^0.4.0` — and on 0.x a caret pins the minor, so the old range
16+
allowed 0.3.x and the new one does not), changeset treats that as a
17+
**breaking change** and escalates the bump from minor → **major**. This is
18+
why `adapter-codex`/`adapter-kimi` jumped 0.4.0 → 1.0.0 on the first v0.4.0
19+
versioning attempt.
20+
21+
**Rule:** before running `changeset version`, make sure every package's
22+
`peerDependencies` range already matches the version you are releasing. A
23+
stale peerDep range (`^0.3.0` while the dep ships `0.4.0`) is what triggers
24+
the spurious major bump. Keep peerDeps in lockstep with versions — the
25+
adapters that use `dependencies: { "@agentplugins/core": "workspace:*" }` are
26+
unaffected; only the two that declare a literal `peerDependencies` range
27+
(codex, kimi) are at risk.
28+
29+
If you genuinely intend to tighten a peer range, declare it as a `major`
30+
changeset on purpose.

CHANGELOG.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,57 @@
22

33
All notable changes to this project are documented in this file.
44

5+
## v0.4.0 — Architecture Re-shape + Hardening
6+
7+
### Architecture
8+
- **`@agentplugins/contract`** — new package: zod schema as single source of truth for the plugin manifest; TS types derived via `z.infer`; `manifest.schema.json` generated at build time via `zod-to-json-schema`. Eliminates the 4-copy drift class (previously: `spec/v1/manifest.schema.json`, `packages/schema/src/types.ts`, `packages/core/src/types.ts`, and inline zod).
9+
- **`@agentplugins/compile`** — new shared codegen kernel with secure emit primitives (`emitCommandHandler`, `emitInlineHandler`, `sanitizeName`, `sanitizeJoin`, `mapHook`). All adapters route through this kernel — a capability now ships by editing one schema field + one kernel path, not 8 files.
10+
- **`core` facade**`@agentplugins/core/src/index.ts` re-exports from `contract`/`compile`; public API unchanged; sibling repos (`agentplugins-{goal,btw,flow,caveman,ponytail}`) unaffected. (Store isolation into its own `@agentplugins/store` package is planned for v0.5.0.)
11+
- `ARCHITECTURE.md` at repo root documents the ports-&-adapters hexagonal compiler pipeline with mermaid diagrams: package dependency graph, compile pipeline (manifest→validate→IR→emit→files), distribute pipeline (source→fetch→install→link), and the adapter port contract.
12+
13+
### Authoring primitives
14+
15+
- **`continueWith`** — chained prompt injection via the `stop` hook. OpenCode adapter uses `ctx.session.sendMessage`; PiMono adapter uses `pi.sendUserMessage`. Per-session iteration capped at 20 by default; lint rule (`continueWithSafetyRule`) inspects inline handler source at build time.
16+
- **`nativeEntry` / `nativeCopies`** — native artifact passthrough for non-JS plugin artifacts. Build command resolves and writes `nativeCopies` entries; adapters expose them in their output.
17+
- **`adapterOverrides`** — runtime adapter override via `manifest.adapterOverrides.opencode` / `manifest.adapterOverrides.pimono`. Paths are sanitized against the plugin root at compile time; a runtime trust warning is emitted.
18+
- **`capabilities: ['subprocess']`** — gates the child-process lint block. The `handlerSafetyRule` lint rule scans `command` handler strings for subprocess patterns; the gate only fires when the capability is absent.
19+
- Inline handlers auto-wrapped as command scripts for Codex and Kimi adapters.
20+
21+
### Multi-artifact linking
22+
- Multi-artifact `dist` linking for OpenCode: multiple compiled artifacts per plugin.
23+
- Per-skill flat linking for Pi / Skills.sh compatibility.
24+
25+
### Security hardening
26+
27+
| Class | Fix |
28+
|---|---|
29+
| **RCE (template-literal injection)** | `emitCommandHandler` uses plain string + arg-array `execSync`; no shell template literals, no `shell:true`. Structurally eliminated — not patched per adapter. |
30+
| **Path traversal — plugin name** | `sanitizeName()` rejects `..`/absolute/non-kebab at `addPluginFromSource` install time. |
31+
| **Path traversal — `nativeCopies` from/to** | `sanitizeJoin()` validates both src and dst paths resolve inside the plugin root in `build` command. |
32+
| **Path traversal — SKILL.md frontmatter** | `sanitizeName()` applied to `name:` field from `SKILL.md` frontmatter before any symlink/write. |
33+
| **Path traversal — `adapterOverrides` / handler `source`** | `sanitizeJoin(pluginRoot, path)` applied at compile time; runtime trust warning emitted. |
34+
| **SSRF bypass** | `safe-fetch` re-validates every redirect hop against allow-list + private-IP check. |
35+
| **Arbitrary script execution at install** | `evaluateScriptPolicy()` runs on `add` / `import --write`; denylisted lifecycle scripts block the install. |
36+
| **Integrity never verified** | `verifyIntegrity()` called on install when `manifest.integrity` is declared. |
37+
| **Git clone URL injection** | `cloneRepo` validates `https://github.com/...` before URL interpolation. |
38+
| **Symlink clobber** | `unlinkSync` only; `rmSync` never on user dirs; `lstatSync` guard. |
39+
| **Install idempotency** | `unlinkAll()` factors pre-delete for compiled + skills + native + symlink artifacts; stale links never left behind. |
40+
| **Silent partial installs** | Symlink failures collected, warned at summary, `process.exitCode=1`. |
41+
42+
### Bug fixes
43+
44+
- `subagentStop` collision fixed; dead `agentCommand`/`agentCwd` passthrough removed.
45+
- `sidecar` marked experimental (`x-experimental`) in schema and docs.
46+
- `recompile-installed` dogfood script moved from `cli/src/commands/``scripts/`.
47+
- Two OpenCode test failures (stale `Bun.$` assertions) corrected to `execSync (curl)`.
48+
- Example logger `package.json` no longer carries a version field in its internal manifest.
49+
- CLI version read from `package.json` instead of hardcoded string.
50+
51+
### Breaking changes
52+
53+
- **`spawnChild`** removed from `@agentplugins/compile` and `@agentplugins/core`. It had zero callers; no adapter used it. Any external consumer importing it directly will break — the replacement is to use `node:child_process.spawn` directly with sandboxing.
54+
- **`@agentplugins/contract`** is a new published package. Its API (`PluginManifest` zod schema, derived types, `manifest.schema.json`) is stable from this release. `core` re-exports remain the preferred consumer entry.
55+
556
## v0.3.0 — Tier-1 Parity Wins + Compat Ingestor + Security
657

758
### Tier-1 parity wins (3.1–3.6)

packages/adapter-codex/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"vitest": "^1.0.0"
2929
},
3030
"peerDependencies": {
31-
"@agentplugins/core": "^0.3.0"
31+
"@agentplugins/core": "^0.4.0"
3232
},
3333
"files": [
3434
"dist",

packages/adapter-kimi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"vitest": "^1.0.0"
3535
},
3636
"peerDependencies": {
37-
"@agentplugins/core": "^0.3.0"
37+
"@agentplugins/core": "^0.4.0"
3838
},
3939
"keywords": [
4040
"agentplugins",

packages/core/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
### Patch Changes
2828

2929
- Updated dependencies
30-
- @agentplugins/compile@0.5.0
31-
- @agentplugins/contract@0.5.0
30+
- @agentplugins/compile@0.4.0
31+
- @agentplugins/contract@0.4.0
3232

3333
## 0.3.0
3434

0 commit comments

Comments
 (0)