Repository navigation
Add the remote tool types tool-mcp, tool-rest and tool-cli (inert core types) - #4302
Merged
Merged
Conversation
Three core subtypes of tool, inert: registry entries, seeded schemas with their binding fields, binding readers and a credential-reference parser in nodespace-types, behaviours that validate the binding (closed parameter_schema root, https URLs, no templated host, whole-element argv placeholders, complete binding before enabled), and a binding fingerprint in core. tool.enabled becomes local_only and tool gains a local_only approved_binding field. Shape record, change log and generated TypeScript follow. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…t-owner sign-off needed) The exhaustive match on CoreNodeType lists the three new variants with the other types that have no plain-language names. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
URL templates are parsed with every placeholder filled two ways and must keep one scheme, host and port, behind a literal http(s):// prefix with no backslash. A program is a bare name or an absolute path without .., headers share one reserved list, env names that change loading are refused, and a remote tool placeholder name is hyphenated in the +New flow. Descriptions, change-log entries and tests say only what the fields are and that an absent enabled means off. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Env names under the GIT_, PYTHON, NODE_, JAVA and BASH_FUNC_ prefixes, any *_PROXY name, and HOME, TMPDIR, shell option and certificate variables are refused, while ordinary names such as GITHUB_TOKEN stay allowed. Keep-Alive and Forwarded join the reserved headers, and a program may not start with // or two backslashes. The enabled and approved_binding descriptions say they are declared local-only. Tests hold an invalid binding on every batch write path. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
mstomar125
force-pushed
the
issue-4291-remote-tools-core
branch
from
November 19, 2026 05:59
e2a588e to
8ba5fb2
Compare
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.
DO NOT MERGE until the agent owner agrees. This PR includes one mechanical, behaviour-neutral line under
packages/agent(one commit,agent_loop: handle the remote tool types in the type-name match): the exhaustive match onCoreNodeTypeinagent_loop.rsmust list the three new variants or the workspace does not compile. Nothing else underpackages/agentis touched.Conflicts with the ACP type PR: that PR (#4300) has already merged; this branch is rebased onto it and resolved. The conflicts were in
core_type.rs(variant list,ALLlength,info(), test matches),convert.rs,core_schemas.rs(the sorted-ids test),agent_loop.rs(the same match arm), the shape record snapshot and change log, the generated TypeScript, the plugin registry test and the node-types sheet. Each is a list or a count; keep both sides.Known limits (read before building on this)
local_onlyis not yet delivered for tool nodes. (The schema, descriptions and the sheet say only that the fields are declared local-only.) The sync service builds its local-only map from each core schema keyed by exactnode_type, with only that schema's own fields and noextendschain, soenabledandapproved_binding(stored inproperties["tool"]) are not stripped on push or ignored on pull fortool-*nodes. The classification is declared in the schema, nothing more, until the sync fix lands (sync issue: nodespace-sync#1047; the real-core-type test is sync Prompt node type with PromptAssembler service and graph-override layering #1049). The agent-lane gate must not rely on it until then.enabledABSENT (sync drops the foreign value), not false. Absent means off: the schema description and the sheet say so, and tests (an_absent_enabled_means_off,an_absent_enabled_is_a_draft) assert an absentenabledis treated as disabled by the behaviours and the offering rule.approved_bindingis only a field here: nothing compares or writes it yet. A description edit after approval does not change the fingerprint, by design (the text the model reads is outside the hash).allOf,patternPropertiesor$ref: a residual risk for the agent-lane executor or validator.secretis checked as a name only; a token-shaped name passes. An interpreter program (sh,env) passes: the confirmation and the fingerprint are the guards, and an executor must insert--before model-supplied values and percent-encode placeholder values.toolgains a core field (approved_binding), so a database created by 0.3.11 or by main today holds atoolschema without it: the core-type comparison reports a missing field (schema mismatch) and the database is refused at open until reset. Accepted: no users, no compatibility code.Refs #4291. Inert core types for remote tools: no execution, no offering code, no credential store.
Classification
core_subtype(three of them, each extends the abstract basetool)structured(inherited object-valuedparameter_schema)Generic; fields stay inproperties. Structure none/any, embedded as name and description only.What is added
Registry (
nodespace-types):ToolMcp,ToolRest,ToolCli(tool-mcp,tool-rest,tool-cli).Seeded schemas (
core_schemas.rs), all snake_case, closed, schema defaults the only defaults:tool-mcp:transport(enumstdio,http),command,args,url,remote_tool_name,env({name, secret}[]),auth({scheme: none|bearer|header, header_name, secret}),timeout_seconds(default 30).tool-rest:method(enumGET..DELETE),url_template,query_params,body(enumnone,json; defaultnone),headers({name, value}[]),auth(scheme alsobasic),timeout_seconds(30),max_response_bytes(1048576).tool-cli:program,args,env,timeout_seconds(30),max_output_bytes(1048576).toolbase:enabledbecomeslocal_only; newapproved_binding(local_only, optional text: the fingerprint written when a tool is enabled on this device).Readers (
nodespace-types/src/tool_binding.rs):ToolMcpFields,ToolRestFields,ToolCliFields,CredentialRef(keychain:<name>/env:<NAME>, never a value),is_tool_name,check_closed_root, and the limits (300 s, 10 MiB maxima; 30 s, 1 MiB defaults). They are serde types, so the generator also emits TypeScript for the six binding structs; the tool family's wire shape stays generic.Binding fingerprint (
behaviors::tool_binding_hash, in core, which already hassha2): SHA-256 over every non-toolbucket of the chain plusparameter_schema, canonical key order. Name,description,enabled,approved_bindingare outside it. Nothing compares it yet; the offering gate is agent-lane work.Behaviours (
ToolMcpNodeBehavior,ToolRestNodeBehavior,ToolCliNodeBehavior, registered afterToolNodeBehavior): name is[A-Za-z][A-Za-z0-9_-]{0,63};parameter_schema, when set, has a closed root (type: "object",additionalProperties: false; the base rule is unchanged); every set binding field is well formed;enabled: truerequires a complete binding (required fields, every{placeholder}and query name a property ofparameter_schema); URLs arehttps(httponly for a loopback host, no embedded credentials); the URL template must start with a literalhttp:///https://and its scheme, host and port must be identical when every placeholder is filled withxand withy(sohttps:{h}/p,https:/{h}/p,https:///{a}and a backslash are refused); argv items are literals or one whole{name}; asecretmust be a well-formed reference;approved_bindingis a fingerprint or unset. Embedding is the base's (name and description).Shape record
bun run shape:genregeneratedcurrent.json. Change-log entries (class chosen fromcore_type_shape.rs, which compares fields and reads neitherlocal_onlynor relationships):remote-tool-types-added:additive(a core type the database lacks is seeded).tool-approved-binding-field:refuse(an oldertoolschema lacks a core field; the database is refused at open until reset).tool-enabled-kept-on-device:migrate(the storedtool.enabledkeepslocal_only: false; the comparison does not read the flag, but the database is refused at open anyway for the missing field, so a reset is the fix). The reference page'sstaleclass does not exist in the code's enum, somigrateis the closest.The
refuseandmigrateentries need a release-time decision (accepted_reset_required); not added here.Docs
Sheet and tool registry page: nodespace-docs #163 (rebased onto the ACP sheet change) (separate PR; the gate reads the docs
mainonce, so it lands just before this one is queued).Tests
nodespace-types: 233 pass (new: reader and reference rules, registry subtype test).nodespace-coreunit: behaviours, binding hash, schemas, embedding list.tool_subtypes_test.rs(through the node service): subtypes returned by a query fortool; binding stored in own bucket with defaults; undeclared keys refused; invalid bindings refused naming the rule; incomplete enable refused, draft allowed; literal credential refused at create and update; closed root; name rule; embedded text is name and description only; a user subtype oftool-restkeeps the rules; retyping applies the new kind's rules; trust fieldslocal_only;approved_bindingform.bun run test:changedpasses (rerun after review fixes) (frontend, scripts, Chromium, types, shape, node-types, Rust workspace). Frontend: plugin registry, node types and schema authoring lists.bun run types:check,shape:check,node-types:checkpass.Verified differently from the spec
nodespace-types(that crate has no hash dependency).seed-updates.svelte.tsis not changed: the remote kinds are user-created, not seeded, so no review-screen label is needed.untitled-tool-cli) for the remote kinds so it passes the name rule.🤖 Generated with Claude Code
Deny-lists as they now stand
LD_,DYLD_,GIT_,PYTHON,NODE_,JAVA,BASH_FUNC_, any*_PROXY, andPATH,HOME,TMPDIR,IFS,SHELL*,BASHOPTS,PS4,PROMPT_COMMAND, SSL/CA variables and similar (case-insensitive). A deny-list:GITHUB_TOKENstays allowed (tested).Keep-AliveandForwarded; a program may not start with//or\\(UNC).For the executor PR
Url, not the template string: theurlcrate strips tab and newline from input...(or any path segment value) must be rejected or percent-encoded by the executor; encode every value placed in a placeholder.--before any model-supplied argv value; an interpreter program (sh,env) is accepted by design, with the confirmation and the fingerprint as guards.create_node,bulk_create,bulk_create_hierarchy,bulk_create_hierarchy_trustedandbulk_update(tested).