📐 feat: Add @librechat/dev-tools Package for Coding Tool Definitions - #262
Open
lia-by-librechat[bot] wants to merge 1 commit into
Open
lia-by-librechat[bot] wants to merge 1 commit into
lia-by-librechat[bot] wants to merge 1 commit into
Conversation
Port the LLM-visible surface of the harness-native coding tools from @librechat/agents into packages/dev-tools, published as @librechat/dev-tools: canonical tool names, the JSON schemas and descriptions for the remote-engine tools (execute_code, bash_tool, run_tools_with_code, run_tools_with_bash, read_file) and the local-engine tools (read_file, write_file, edit_file, grep_search, glob_search, list_directory, compile_check), the intent-label contract embedded in every schema, the /mnt/data and bash guidance, and the timeout schema with its environment-resolved defaults. The package has zero runtime dependencies: everything is plain data and pure functions, so the agent harness and BYOM provisioning consume the definitions without the harness owning them. Execution stays harness-native in @librechat/agents; the definitions describe the execution environments this service provides. Ported with export-name parity so the agents-side swap is mechanical; every ported string was verified byte-for-byte against the harness source. Tests pin the canonical names, intent-first property ordering, required properties, and the stateful/attached description builders. CI runs the package tests on Node 22.21.0.
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
Port the LLM-visible surface of the harness-native coding tools from
@librechat/agentsinto this repository as a new package,@librechat/dev-tools— the code-interpreter side of moving the coding tool definitions next to the Code API that provides their execution environments.The package holds exactly what the LLM sees:
ToolNames) and theCODE_EXECUTION_TOOLS/LOCAL_CODING_TOOL_NAMES/LOCAL_CODING_BUNDLE_NAMESsetsexecute_code,bash_tool,run_tools_with_code,run_tools_with_bash,read_file— including the stateful, attached-workspace, and tool-output-reference description/schema buildersread_file,write_file,edit_file,grep_search,glob_search,list_directory,compile_checkINTENT_PROPERTY,withIntent/withoutIntent, arg readers/strippers, and outcome resolution/mnt/dataand bash guidancetimeoutschema with environment-resolved defaults and clampingWhy
The schemas describe the execution environments this service provides, so they live here rather than inside the agent harness:
@librechat/agentsand LibreChat (BYOM provisioning) consume the definitions without the harness owning them. Zero runtime dependencies — everything is plain data and pure functions.Execution stays harness-native in
@librechat/agents(Code API client,ToolNodeevent dispatch, the local engine, result replay, and output shaping). The sibling@librechat/codepackage covers the worker side of provisioning.Provenance and fidelity
Ported from
@librechat/agentssrc/tools/with export-name parity so the agents-side swap is mechanical. Intentional differences:Constantstool-name members becameToolNames(the harness enum mixes orchestration constants; only the coding-tool members moved)CompileCheckSchema, the local programmatic tool calling schema builders) are exported here — sharing them is the package's purposeLocal*ToolDescriptionconstantsJsonSchemaTypeis widened with the JSON-Schema keywords these schemas use (minLength,minimum,maximum,default,uniqueItems)Every ported string was verified byte-for-byte against the harness source at port time — full-file diffs for the intent and timeout modules, block diffs for the schema builders, extraction-and-compare for every description constant. Descriptions are prompt surface, so drift is behavior change.
Verification
npm testinpackages/dev-tools: 42 tests pass — canonical names and sets, intent-first property ordering, required properties, timeout bounds and env resolution, and the stateful/attached description and schema buildersnpx tsc --noEmitcleandev-tools-package-testsjob on Node 22.21.0 — pure TypeScript with zero runtime deps, so no matrix and no native toolingNot in this PR
The agents-side swap (importing
@librechat/dev-toolsfrom the harness) comes in a follow-up against the agents repository.