Repository navigation
feat(agent-tools): the built-in agent tools - the Node twin of the Python extension (RFC-0013 step 3) - #130
Merged
Merged
Conversation
…thon extension (RFC-0013 step 3) extensions/agent-tools/agent-tools.mjs serves the twelve composable functions an agent loop names in its tool catalog, in lockstep with mercury-python #63 and #64: the file tools inside tools.file.root (with file.extract through pdfjs-dist and mammoth), the web tools inside tools.web.allow over node:http with a pinned lookup, every redirect re-checked and an in-house HTML reader and robots.txt parser, the knowledge-graph tools over neo4j-driver in managed transactions with the clause scan, the idempotent ingest and the endpoint check, and time.now. A tool whose sandbox is not configured does not register; every refusal is a 400 naming the rule. The catalog files are byte for byte the Python pack's, pinned by a test; describe prints the rows and what registers. 55 tests mirroring the Python suite and a live round trip on Neo4j. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
CI ran the Node 20 floor, where node:fs/promises has no glob (Node 22+). The directory walk of file.list and file.search is in-house now: a pattern read as the Python pack's Path.glob reads it, a bounded walk that never descends into a symbolic link. On Eric's ruling the CI tooling runs Node 26, the current line; the published package's floor stays node >= 20. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… the current LTS, Node 26 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
acn-ericlaw
added a commit
that referenced
this pull request
Nov 17, 2026
…ilt-in agent tools is on main Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
What
extensions/agent-tools/agent-tools.mjs, the Node.js twin of mercury-python'sextensions/agent-tools(RFC-0013 build plan step 3): the twelve composable functions an agent loop names in its tool catalog, with the same routes, rows, limits, statuses and messages as the Python pack.tools.file.root):file.read,file.write(write: true),file.list,file.search, andfile.extract(PDF through pdfjs-dist, Word through mammoth, HTML and text, with page markers) when the two libraries are installed. Every path is relative to the root, resolved with symbolic links followed and refused outside it; hidden entries are invisible unlesstools.file.hidden=true.tools.web.allow):web.fetchandweb.crawlovernode:http/node:httpswith a pinnedlookup(the request goes to the checked address, the TLS server name from the URL), every redirect re-checked, the body cut attools.web.max.bytes, an in-house HTML tokenizer and reader (text or Markdown), an in-houserobots.txtparser, a bounded same-host crawl.tools.graph.uri,neo4j-driver):graph.schema(Neo4j's or Memgraph's procedures with counts),graph.query(read transaction, write clauses refused before sending, rows capped),graph.write(counters, the delete gate) andgraph.ingest(a model's extraction merged idempotently, every value a parameter, the endpoints checked inside the transaction); managed transactions with the configured timeout server-side; the driver's failures mapped by code.time.nowonIntl.The catalog files under
extensions/agent-tools/catalog/are byte for byte the Python pack's (one shared digest), the rows in the module are generated from them, and a test pins the two.describeprints every row and what registers;tools.healthreports the routes, the workspace, the allowed sites and the graph's address.resources/application.yml(port 8090),dev/graph-up.sh/graph-down.sh, README, CHANGELOG, the root README's extension bullets;neo4j-driver,mammothandpdfjs-distas dev dependencies (pdf-parsev2 pulls a native canvas binding, so pdfjs-dist is used directly for text).Why
RFC-0013 (Eric's rulings R1-R16, 2026-11-17) builds the essential tools in both packs in lockstep, so a graph's catalog row works whichever pack serves the route and the engines' documentation describes one contract. The Python build set the defaults (the spec's sections 13 and 14); this twin follows them. Three visible differences, recorded in the pack's memory: the HTML reader decodes the common named character references and every numeric one, a Word table renders through mammoth's HTML, and integers come back as JavaScript numbers.
Verification
npm test: 554 tests, 488 passed, 66 skipped (the gated live tests), 0 failed.test/agent-tools.test.mjs: 55 tests mirroring the Python suite, plus the live graph round trip against Neo4j 5 on Colima (ingest twice leaves one node; node, relationship and path rendering; the schema with counts; a syntax error by code; a missing endpoint refused; the delete gate): PASSED.🤖 Generated with Claude Code
Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com