Repository navigation
Implement per-agent extension shims for all five PTY agents (#1123) - #1157
Conversation
…1123) - Add shim files for Claude Code (hooks), Codex (plugin), Gemini CLI (tools JSON + handler), OpenCode (plugin), and Pi (registerTool) in packages/agent-tools/shims/ - Update GraphContextAssembler to write shim files into the session temp directory and append NodeSpace tool activation instructions to the context file when a shim source directory is configured - Add NODESPACED_SHIM_DIR env var support to the daemon for wiring the shim dir at runtime - Add 10 tests for shim file mapping, copy logic, and TOOLS_SECTION content - Include shims directory in agent-tools package.json files field Co-Authored-By: Claude <[email protected]>
Code Review SummaryThis PR implements the per-agent extension shims as specified in issue #1123. The overall design is clean: each shim is minimal glue that only translates the agent's native registration API to FindingsCritical Issues[Critical/Blocker]
"handler": "./nodespace-handler.js"The shim source directory contains Either:
The same [Critical/Blocker] The PR body leaves these two test runs unchecked. The acceptance criteria include "All shims handle Suggested Improvements[Improvement] Shim files land flat in
Consider writing into a per-agent subdirectory: [Improvement]
[Improvement] The For Claude Code, the context file says "NodeSpace knowledge graph tools are available" but does not tell Claude Code where the hook file is (e.g., Verify that Claude Code's hooks runtime automatically discovers [Improvement] ContextError::WriteFailed(std::io::Error::new(
e.kind(),
format!("failed to copy shim file '{}' to session dir: {}", src.display(), e),
))
ContextError::WriteFailed(std::io::Error::other(
format!("failed to copy shim file '{}': {}", src.display(), e)
))Or use NitpicksNit: Nit: The Nit: |
Co-Authored-By: Claude <[email protected]>
- Validate NODESPACED_SHIM_DIR at daemon startup: log a warning when the path is missing rather than failing silently per session - Make tools_section() per-agent: Claude Code gets an explicit hook file path hint so hooks discovery can find nodespace-hook.ts in session dir - Simplify write_shim_files error message (no source chain regression) - Document Gemini handler stdio protocol (success/error shapes, exit code) - Expand tools_section tests: check all agents, Claude Code path hint, and verify non-Claude agents don't include hook file reference Skipped: flat session_dir collision (one-agent-per-session invariant holds); tsconfig shims include (declare globals cause false-positive tsc errors). Co-authored-by: Michael Libio <[email protected]> Co-authored-by: Claude <[email protected]>
…1157) * Implement per-agent extension shims for all five PTY agents (closes #1123) - Add shim files for Claude Code (hooks), Codex (plugin), Gemini CLI (tools JSON + handler), OpenCode (plugin), and Pi (registerTool) in packages/agent-tools/shims/ - Update GraphContextAssembler to write shim files into the session temp directory and append NodeSpace tool activation instructions to the context file when a shim source directory is configured - Add NODESPACED_SHIM_DIR env var support to the daemon for wiring the shim dir at runtime - Add 10 tests for shim file mapping, copy logic, and TOOLS_SECTION content - Include shims directory in agent-tools package.json files field Co-Authored-By: Claude <[email protected]> * Fix Gemini handler path: .js -> .ts in nodespace-tools.json Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Michael Libio <[email protected]> Co-authored-by: Claude <[email protected]>
- Validate NODESPACED_SHIM_DIR at daemon startup: log a warning when the path is missing rather than failing silently per session - Make tools_section() per-agent: Claude Code gets an explicit hook file path hint so hooks discovery can find nodespace-hook.ts in session dir - Simplify write_shim_files error message (no source chain regression) - Document Gemini handler stdio protocol (success/error shapes, exit code) - Expand tools_section tests: check all agents, Claude Code path hint, and verify non-Claude agents don't include hook file reference Skipped: flat session_dir collision (one-agent-per-session invariant holds); tsconfig shims include (declare globals cause false-positive tsc errors). Co-authored-by: Michael Libio <[email protected]> Co-authored-by: Claude <[email protected]>
Summary
packages/agent-tools/shims/: Claude Code (hooks-based), Codex (plugin), Gemini CLI (JSON tool definitions + stdin/stdout handler), OpenCode (plugin), and Pi (registerTool()adapter)GraphContextAssemblerwith optional shim directory support: whenNODESPACED_SHIM_DIRis set, the assembler copies per-agent shim files into the session temp dir and appends a NodeSpace Tools activation section to the context fileNODESPACED_SHIM_DIRenv var to the daemon for runtime wiringTest plan
@nodespace/agent-toolstests passpackages/agent-toolsandpackages/desktop-appcargo test -p nodespace-agent— new shim mapping and copy testsbun run test:all— no regressionsCloses #1123
🤖 Generated with Claude Code