feat(tools): add @agentskit/tools + README for all npm packages#26
Merged
Conversation
…h streaming New package with reusable executable tools: - web_search: DuckDuckGo default, configurable (Serper, custom function) - filesystem: read_file, write_file, list_directory with mandatory basePath and path traversal protection - shell: streaming output via AsyncIterable (spawn), mandatory timeout, optional allow list, dispose kills running processes - listTools(): static discovery function returning tool metadata - 30 tests covering all tools, contract compliance, and security
Each package now has a focused README with install, quick example, and link to full docs. Shows on npmjs.com package pages.
…-then-yield Shell tool was hanging on CI (Linux) because SIGTERM didn't reliably terminate sleep commands. Changed to SIGKILL for timeouts/dispose, and simplified to collect-then-yield pattern instead of streaming promises that could hang if process close event raced.
1. Extract safeParseArgs to core/primitives — removes duplication from controller.ts and runner.ts 2. Extract createToolLifecycle() to core/primitives — shared lazy init and dispose-all logic for both ChatController and AgentRunner 3. Add tool lifecycle to ChatController — init() before first tool use, disposeAll() on clear() and updateConfig(). Fixes process leak when shell tool is used via useChat. 4. Runner now passes onPartialResult to executeToolCall — streaming tools (like shell) update toolCall.result incrementally instead of silently consuming the AsyncIterable. 5. discovery.ts now derives metadata from actual tool instances instead of a static registry. Metadata can never diverge from implementations. 6. Fix safePath dead branch in filesystem — the operator precedence bug made the second clause always false. Simplified to a single startsWith check against normalized base path. 7. Add retriever support to RuntimeConfig — runner now supports RAG context injection, matching ChatController's capability.
Replace spawn+SIGKILL with execSync which handles timeout natively and exits cleanly on all platforms. Simplifies the tool from AsyncIterable to a sync execute — the timeout and allow list guarantees remain identical.
11 tasks
This was referenced Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #7 and adds READMEs to all packages.
New package: @agentskit/tools
web_search — DuckDuckGo default, configurable (Serper, custom function)
filesystem — read_file, write_file, list_directory with mandatory basePath and path traversal protection
shell — streaming output via AsyncIterable (spawn), mandatory timeout, optional allow list
listTools() — static discovery of all built-in tools with metadata
READMEs for npm
Individual README.md for: core, react, ink, adapters, cli, runtime, tools. Each has install, quick example, and docs link.
30 new tests
Test plan