diff --git a/dot_agents/shell/claude.zsh b/dot_agents/shell/claude.zsh index 975d4b7..86670a0 100644 --- a/dot_agents/shell/claude.zsh +++ b/dot_agents/shell/claude.zsh @@ -11,6 +11,26 @@ function _claude_nono() { "$@" } +function _claude_acp() { + local profile="$1" + shift + + # npm uses the uppercase form directly; lifecycle tooling may read the lowercase form. + local -x NPM_CONFIG_CACHE="$HOME/.claude/npm-cache" + local -x npm_config_cache="$NPM_CONFIG_CACHE" + mkdir -p "$NPM_CONFIG_CACHE" || return + + local NONO_AGENT_ACP=1 + + _nono_agent_run \ + "$profile" \ + npx \ + "${CLAUDE_SSH_SIGNING_PUBLIC_KEY:-$HOME/.ssh/id_ed25519.pub}" \ + "${CLAUDE_SSH_SIGNING_KEY:-$HOME/.ssh/id_ed25519}" \ + -y @agentclientprotocol/claude-agent-acp@latest \ + "$@" +} + function claude() { _claude_nono my-claude-code "$@" } function claude-chezmoi() { _claude_nono claude-code-chezmoi "$@" } @@ -22,3 +42,7 @@ function claude-node() { _claude_nono claude-code-node "$@" } function claude-python() { _claude_nono claude-code-python "$@" } function claude-rust() { _claude_nono claude-code-rust "$@" } + +function claude-acp() { _claude_acp my-claude-code "$@" } + +function claude-chezmoi-acp() { _claude_acp claude-code-chezmoi "$@" } diff --git a/dot_agents/shell/codex.zsh b/dot_agents/shell/codex.zsh index 942bfd1..e5edcc4 100644 --- a/dot_agents/shell/codex.zsh +++ b/dot_agents/shell/codex.zsh @@ -1,4 +1,5 @@ -function _codex_nono_run() { +function _codex_nono_with_npm_cache() { + # npm uses the uppercase form directly; lifecycle tooling may read the lowercase form. local -x NPM_CONFIG_CACHE="$HOME/.codex/npm-cache" local -x npm_config_cache="$NPM_CONFIG_CACHE" mkdir -p "$NPM_CONFIG_CACHE" || return @@ -6,11 +7,11 @@ function _codex_nono_run() { _nono_agent_run "$@" } -function _codex() { +function _codex_nono() { local profile="$1" shift - _codex_nono_run \ + _codex_nono_with_npm_cache \ "$profile" \ codex \ "${CODEX_SSH_SIGNING_PUBLIC_KEY:-$HOME/.ssh/id_ed25519.pub}" \ @@ -25,7 +26,7 @@ function _codex_acp() { local NONO_AGENT_ACP=1 local -x INITIAL_AGENT_MODE=agent-full-access - _codex_nono_run \ + _codex_nono_with_npm_cache \ "$profile" \ npx \ "${CODEX_SSH_SIGNING_PUBLIC_KEY:-$HOME/.ssh/id_ed25519.pub}" \ @@ -34,9 +35,9 @@ function _codex_acp() { "$@" } -function codex() { _codex my-codex "$@" } +function codex() { _codex_nono my-codex "$@" } -function codex-chezmoi() { _codex codex-chezmoi "$@" } +function codex-chezmoi() { _codex_nono codex-chezmoi "$@" } function codex-acp() { _codex_acp my-codex "$@" } diff --git a/private_dot_local/bin/executable_zed-agent-acp b/private_dot_local/bin/executable_nono-agent-acp similarity index 53% rename from private_dot_local/bin/executable_zed-agent-acp rename to private_dot_local/bin/executable_nono-agent-acp index 920ce4a..70684f3 100644 --- a/private_dot_local/bin/executable_zed-agent-acp +++ b/private_dot_local/bin/executable_nono-agent-acp @@ -5,20 +5,27 @@ export PATH profile="${1:-}" case "$profile" in - codex|my-codex|codex-*) + claude|my-claude-code|claude-code-*|work-*-claude-code|work-*-claude-code-*) + [[ "$profile" == claude ]] && profile=my-claude-code + source "$HOME/.nvm/nvm.sh" || exit + nvm use --silent default || exit + agent_shell_config="$HOME/.agents/shell/claude.zsh" + runtime=claude + ;; + codex|my-codex|codex-*|work-*-codex|work-*-codex-*) [[ "$profile" == codex ]] && profile=my-codex source "$HOME/.nvm/nvm.sh" || exit nvm use --silent default || exit agent_shell_config="$HOME/.agents/shell/codex.zsh" runtime=codex ;; - opencode|my-opencode|opencode-*) + opencode|my-opencode|opencode-*|work-*-opencode|work-*-opencode-*) [[ "$profile" == opencode ]] && profile=my-opencode agent_shell_config="$HOME/.agents/shell/opencode.zsh" runtime=opencode ;; *) - print -u2 'Usage: zed-agent-acp {codex|my-codex|codex-*|opencode|my-opencode|opencode-*} [args...]' + print -u2 'Usage: nono-agent-acp {claude|my-claude-code|claude-code-*|codex|my-codex|codex-*|opencode|my-opencode|opencode-*|work-*-[-*]} [args...]' exit 2 ;; esac @@ -28,6 +35,7 @@ source "$HOME/.agents/shell/nono.zsh" || exit source "$agent_shell_config" || exit case "$runtime" in + claude) _claude_acp "$profile" "$@" ;; codex) _codex_acp "$profile" "$@" ;; opencode) _opencode_nono "$profile" acp "$@" ;; esac