Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/worktrees/fix-ensure-thinking-latest-sequence
Submodule fix-ensure-thinking-latest-sequence added at e8a08e
137 changes: 95 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 21 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@librechat/agents",
"version": "3.1.77",
"version": "3.1.78",
"main": "./dist/cjs/main.cjs",
"module": "./dist/esm/main.mjs",
"types": "./dist/types/index.d.ts",
Expand Down Expand Up @@ -126,6 +126,14 @@
"subagent:tools": "node -r dotenv/config --loader ./tsconfig-paths-bootstrap.mjs --experimental-specifier-resolution=node ./src/scripts/subagent-tools-debug.ts",
"programmatic_exec": "node -r dotenv/config --loader ./tsconfig-paths-bootstrap.mjs --experimental-specifier-resolution=node ./src/scripts/programmatic_exec.ts",
"code_exec_ptc": "node -r dotenv/config --loader ./tsconfig-paths-bootstrap.mjs --experimental-specifier-resolution=node ./src/scripts/code_exec_ptc.ts --provider 'openAI' --name 'Jo' --location 'New York, NY'",
"local": "node -r dotenv/config --loader ./tsconfig-paths-bootstrap.mjs --experimental-specifier-resolution=node ./src/scripts/local_engine.ts --provider 'openAI' --name 'Jo' --location 'New York, NY'",
"local:ptc": "node -r dotenv/config --loader ./tsconfig-paths-bootstrap.mjs --experimental-specifier-resolution=node ./src/scripts/local_engine_ptc.ts --provider 'openAI' --name 'Jo' --location 'New York, NY'",
"local:hooks": "node -r dotenv/config --loader ./tsconfig-paths-bootstrap.mjs --experimental-specifier-resolution=node ./src/scripts/local_engine_hooks.ts --provider 'openAI' --name 'Jo' --location 'New York, NY'",
"local:checkpointer": "node -r dotenv/config --loader ./tsconfig-paths-bootstrap.mjs --experimental-specifier-resolution=node ./src/scripts/local_engine_checkpointer.ts --provider 'openAI' --name 'Jo' --location 'New York, NY'",
"local:image": "node -r dotenv/config --loader ./tsconfig-paths-bootstrap.mjs --experimental-specifier-resolution=node ./src/scripts/local_engine_image.ts --provider 'anthropic' --name 'Jo' --location 'New York, NY'",
"local:compile": "node -r dotenv/config --loader ./tsconfig-paths-bootstrap.mjs --experimental-specifier-resolution=node ./src/scripts/local_engine_compile.ts --provider 'anthropic' --name 'Jo' --location 'New York, NY'",
"compare:pi": "node -r dotenv/config --loader ./tsconfig-paths-bootstrap.mjs --experimental-specifier-resolution=node ./src/scripts/compare_pi_vs_ours.ts",
"local:workspace": "node -r dotenv/config --loader ./tsconfig-paths-bootstrap.mjs --experimental-specifier-resolution=node ./src/scripts/local_engine_workspace.ts --provider 'anthropic' --name 'Jo' --location 'New York, NY'",
"programmatic_exec_agent": "node -r dotenv/config --loader ./tsconfig-paths-bootstrap.mjs --experimental-specifier-resolution=node ./src/scripts/programmatic_exec_agent.ts --provider 'openAI' --name 'Jo' --location 'New York, NY'",
"ant_web_search": "node -r dotenv/config --loader ./tsconfig-paths-bootstrap.mjs --experimental-specifier-resolution=node ./src/scripts/ant_web_search.ts --name 'Jo' --location 'New York, NY'",
"ant_web_search_edge_case": "node -r dotenv/config --loader ./tsconfig-paths-bootstrap.mjs --experimental-specifier-resolution=node ./src/scripts/ant_web_search_edge_case.ts --name 'Jo' --location 'New York, NY'",
Expand Down Expand Up @@ -201,9 +209,11 @@
"@langfuse/tracing": "^4.3.0",
"@opentelemetry/sdk-node": "^0.207.0",
"@scarf/scarf": "^1.4.0",
"@types/diff": "^7.0.2",
"ai-tokenizer": "^1.0.6",
"axios": "^1.15.0",
"axios": "^1.16.0",
"cheerio": "^1.0.0",
"diff": "^9.0.0",
"dotenv": "^16.4.7",
"https-proxy-agent": "^7.0.6",
"mathjs": "^15.2.0",
Expand All @@ -212,11 +222,20 @@
"openai": "^6.35.0",
"uuid": "^11.1.1"
},
"peerDependencies": {
"@anthropic-ai/sandbox-runtime": "^0.0.49"
},
"peerDependenciesMeta": {
"@anthropic-ai/sandbox-runtime": {
"optional": true
}
},
"imports": {
"@/*": "./src/*",
"~/*": "./*"
},
"devDependencies": {
"@anthropic-ai/sandbox-runtime": "^0.0.49",
"@anthropic-ai/vertex-sdk": "^0.12.0",
"@eslint/compat": "^1.2.7",
"@rollup/plugin-alias": "^5.1.0",
Expand Down
54 changes: 54 additions & 0 deletions src/common/enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,22 @@ export enum Constants {
BASH_TOOL = 'bash_tool',
BASH_PROGRAMMATIC_TOOL_CALLING = 'run_tools_with_bash',
SUBAGENT = 'subagent',
/**
* Local-engine coding tool names. Promoted to `Constants.*` (rather
* than left as per-file `*ToolName` consts) so consumer UIs — most
* importantly LibreChat's `getToolIconType` map — can match against
* canonical strings instead of guessing. Existing matched names:
* `bash_tool`, `read_file`, `execute_code`, `run_tools_with_code`.
* The rest below are new and currently fall through to the generic
* tool icon; once LibreChat adds icons keyed on the same names, the
* wiring will work without an SDK change.
*/
WRITE_FILE = 'write_file',
EDIT_FILE = 'edit_file',
GREP_SEARCH = 'grep_search',
GLOB_SEARCH = 'glob_search',
LIST_DIRECTORY = 'list_directory',
COMPILE_CHECK = 'compile_check',
}

/** Tool names that use the code execution environment (shared session, file tracking). */
Expand All @@ -199,6 +215,44 @@ export const CODE_EXECUTION_TOOLS: ReadonlySet<string> = new Set([
Constants.BASH_PROGRAMMATIC_TOOL_CALLING,
]);

/**
* Canonical names of the local-engine-specific coding tools — the
* file/edit/search/typecheck surface that doesn't exist in the
* remote (sandbox-API) engine. Single source of truth; the per-tool
* factories, registry definitions, and `createWorkspacePolicyHook`
* default extractors all key off these.
*
* `read_file` is on this list (the existing ReadFile tool is
* remote-specific; the local engine's `read_file` is a parallel
* implementation that shares the canonical name so consumer UIs
* — most importantly LibreChat's `getToolIconType` — render both
* with the same icon).
*/
export const LOCAL_CODING_TOOL_NAMES: readonly string[] = [
Constants.READ_FILE,
Constants.WRITE_FILE,
Constants.EDIT_FILE,
Constants.GREP_SEARCH,
Constants.GLOB_SEARCH,
Constants.LIST_DIRECTORY,
Constants.COMPILE_CHECK,
];

/**
* Every tool name the local coding bundle (`createLocalCodingTools`)
* exposes — the local-specific tools above plus the bash/code/PTC
* pair that the local engine wraps around the existing factories.
* Tests pin against this so any addition/removal in the bundle is
* accompanied by a deliberate canonical-name update here.
*/
export const LOCAL_CODING_BUNDLE_NAMES: readonly string[] = [
...LOCAL_CODING_TOOL_NAMES,
Constants.BASH_TOOL,
Constants.EXECUTE_CODE,
Constants.PROGRAMMATIC_TOOL_CALLING,
Constants.BASH_PROGRAMMATIC_TOOL_CALLING,
];

export enum TitleMethod {
STRUCTURED = 'structured',
FUNCTIONS = 'functions',
Expand Down
Loading
Loading