1 Commits

Author SHA1 Message Date
Miguel Palhas 89664d8f17 feat: package the claude ACP adapter for aoe
aoe's structured view spawns `claude-agent-acp` off $PATH. npm's global
prefix here is the read-only nodejs store path, so `npm install -g` cannot
provide it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-18 21:40:34 +01:00
3 changed files with 1573 additions and 0 deletions
File diff suppressed because it is too large Load Diff
+8
View File
@@ -0,0 +1,8 @@
{
"name": "claude-agent-acp-env",
"version": "0.70.0",
"private": true,
"dependencies": {
"@agentclientprotocol/claude-agent-acp": "0.70.0"
}
}
+51
View File
@@ -0,0 +1,51 @@
{
lib,
buildNpmPackage,
makeWrapper,
nodejs_26,
}:
# The ACP adapter aoe spawns for its structured view (`aoe acp doctor` calls it
# "claude"). Upstream only publishes it to npm, and `npm install -g` cannot work
# here: npm's prefix is the read-only nodejs derivation in the store.
#
# The sources here are a one-dependency wrapper project, not upstream's repo.
# To bump: set the version in package.json, run
# npm install --package-lock-only --ignore-scripts
# nix run nixpkgs#prefetch-npm-deps -- package-lock.json
# and paste the hash into npmDepsHash.
buildNpmPackage {
pname = "claude-agent-acp";
version = "0.70.0";
src = lib.cleanSource ./.;
npmDepsHash = "sha256-+q0Va1VvyImKqyWyOBYVmSFDC8TpKViikdYhE1VwGAE=";
nodejs = nodejs_26;
dontNpmBuild = true;
npmFlags = [ "--ignore-scripts" ];
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/lib/claude-agent-acp
cp -r node_modules $out/lib/claude-agent-acp/
# The adapter's shebang is `env node`; aoe spawns it from a systemd unit
# whose PATH need not carry one.
makeWrapper ${nodejs_26}/bin/node $out/bin/claude-agent-acp \
--add-flags $out/lib/claude-agent-acp/node_modules/@agentclientprotocol/claude-agent-acp/dist/index.js
runHook postInstall
'';
meta = {
description = "Agent Client Protocol adapter for Claude Code, spawned by aoe's structured view";
homepage = "https://www.npmjs.com/package/@agentclientprotocol/claude-agent-acp";
license = lib.licenses.asl20;
mainProgram = "claude-agent-acp";
};
}