agent.libx.js 0.93.15 → 0.93.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/dist/{mcp-wwgXyhbi.d.ts → mcp-DGWuuWJm.d.ts} +23 -1
- package/dist/mcp.client.d.ts +17 -2
- package/dist/mcp.client.js +131 -1
- package/dist/mcp.client.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { CommandExecutor, FileMetadata, IFilesystem, IndexedDbFilesystem, MemFil
|
|
|
5
5
|
import { BodDB } from '@bod.ee/db';
|
|
6
6
|
import { A as AgentTool, C as ChatLike, a as ChatOptions, b as ChatResponse, h as ToolCall, H as HostBridge, U as UserQuestion, e as MessageContent } from './tools-GPWp7oXq.js';
|
|
7
7
|
export { c as ContentPart, d as HostEvent, M as Message, R as Role, S as SandboxJobRegistry, f as StreamChunk, T as TodoItem, g as Tool, i as ToolContext, j as bashTool, k as contentText, l as defaultTools, m as editTool, n as exitSessionTool, o as imagePart, p as makeContext, q as makeJobTools, r as readTool, t as toWireTools, s as todoWriteTool, u as toolRegistry, v as toolsByName } from './tools-GPWp7oXq.js';
|
|
8
|
-
export { M as McpCall, a as McpImage, b as McpToolResult, c as McpToolSearchOptions, d as McpToolSpec, m as makeMcpToolSearch,
|
|
8
|
+
export { M as McpCall, a as McpImage, b as McpToolResult, c as McpToolSearchOptions, d as McpToolSpec, e as MountedMcpLike, m as makeMcpToolSearch, f as makeMcpToolSearchFromMounted, g as mcpToolToAgentTool, h as mcpToolsToAgentTools } from './mcp-DGWuuWJm.js';
|
|
9
9
|
import * as libx_js_src_modules_log from 'libx.js/src/modules/log';
|
|
10
10
|
export { log } from 'libx.js/src/modules/log';
|
|
11
11
|
|
package/dist/index.js
CHANGED
|
@@ -4214,6 +4214,25 @@ function makeMcpToolSearch(specs, callTool, options = {}) {
|
|
|
4214
4214
|
};
|
|
4215
4215
|
return [searchTool, callMcpTool];
|
|
4216
4216
|
}
|
|
4217
|
+
function makeMcpToolSearchFromMounted(mounted, options) {
|
|
4218
|
+
const specs = [];
|
|
4219
|
+
const callMap = /* @__PURE__ */ new Map();
|
|
4220
|
+
for (const m of mounted) {
|
|
4221
|
+
for (const s of m.specs) {
|
|
4222
|
+
const base = `mcp__${m.name}__${s.name}`.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 128);
|
|
4223
|
+
let display = base;
|
|
4224
|
+
for (let i = 2; callMap.has(display); i++) display = `${base.slice(0, 128 - String(i).length - 1)}_${i}`;
|
|
4225
|
+
specs.push({ name: display, description: s.description, inputSchema: s.inputSchema });
|
|
4226
|
+
callMap.set(display, (_n, args) => m.client.callTool(s.name, args));
|
|
4227
|
+
}
|
|
4228
|
+
}
|
|
4229
|
+
const tools = specs.length ? makeMcpToolSearch(specs, (name, args) => {
|
|
4230
|
+
const call = callMap.get(name);
|
|
4231
|
+
if (!call) throw new Error(`unknown MCP tool '${name}' \u2014 use ToolSearch to find valid names`);
|
|
4232
|
+
return call(name, args ?? {});
|
|
4233
|
+
}, options) : [];
|
|
4234
|
+
return { tools, serverNames: mounted.map((m) => m.name), toolCount: specs.length };
|
|
4235
|
+
}
|
|
4217
4236
|
|
|
4218
4237
|
// src/hooks.ts
|
|
4219
4238
|
var RecordingHooks = class {
|
|
@@ -5039,6 +5058,7 @@ export {
|
|
|
5039
5058
|
makeContext,
|
|
5040
5059
|
makeJobTools,
|
|
5041
5060
|
makeMcpToolSearch,
|
|
5061
|
+
makeMcpToolSearchFromMounted,
|
|
5042
5062
|
makeTaskBatchTool,
|
|
5043
5063
|
makeTaskTool,
|
|
5044
5064
|
makeWebFetchTool,
|