@easynet/agent-tool 1.0.9 → 1.0.10
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/api/main.cjs +14 -14
- package/dist/api/main.js +3 -3
- package/dist/{chunk-B6SSO5XB.cjs → chunk-2SH6IOCF.cjs} +9 -9
- package/dist/{chunk-B6SSO5XB.cjs.map → chunk-2SH6IOCF.cjs.map} +1 -1
- package/dist/{chunk-ARR3IVQD.cjs → chunk-5BO3RL5R.cjs} +12 -12
- package/dist/{chunk-ARR3IVQD.cjs.map → chunk-5BO3RL5R.cjs.map} +1 -1
- package/dist/{chunk-VKKHBEGO.cjs → chunk-5NOAYHLP.cjs} +7 -7
- package/dist/{chunk-VKKHBEGO.cjs.map → chunk-5NOAYHLP.cjs.map} +1 -1
- package/dist/{chunk-YFBVRPH7.js → chunk-CM5YKSRS.js} +3 -3
- package/dist/{chunk-YFBVRPH7.js.map → chunk-CM5YKSRS.js.map} +1 -1
- package/dist/{chunk-DNXPWEYT.js → chunk-FQQDPJ7Z.js} +13 -3
- package/dist/chunk-FQQDPJ7Z.js.map +1 -0
- package/dist/{chunk-JEZMEC3G.js → chunk-FQS77UEY.js} +3 -3
- package/dist/{chunk-JEZMEC3G.js.map → chunk-FQS77UEY.js.map} +1 -1
- package/dist/{chunk-3DIK7TDW.cjs → chunk-ORKC2PK2.cjs} +14 -4
- package/dist/chunk-ORKC2PK2.cjs.map +1 -0
- package/dist/{chunk-HBVXK6SJ.js → chunk-UTRTRLZW.js} +3 -3
- package/dist/{chunk-HBVXK6SJ.js.map → chunk-UTRTRLZW.js.map} +1 -1
- package/dist/index.cjs +47 -47
- package/dist/index.js +5 -5
- package/dist/tools/util/toolConfig.d.ts +8 -4
- package/dist/tools/util/toolConfig.d.ts.map +1 -1
- package/dist/utils/cli/index.cjs +16 -16
- package/dist/utils/cli/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-3DIK7TDW.cjs.map +0 -1
- package/dist/chunk-DNXPWEYT.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk5BO3RL5R_cjs = require('./chunk-5BO3RL5R.cjs');
|
|
4
|
+
var chunk2SH6IOCF_cjs = require('./chunk-2SH6IOCF.cjs');
|
|
5
5
|
var chunkSOFUWEZ6_cjs = require('./chunk-SOFUWEZ6.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkORKC2PK2_cjs = require('./chunk-ORKC2PK2.cjs');
|
|
7
7
|
var chunkZNJBRLKN_cjs = require('./chunk-ZNJBRLKN.cjs');
|
|
8
8
|
require('./chunk-6F5JHLZ7.cjs');
|
|
9
9
|
var path = require('path');
|
|
@@ -21,7 +21,7 @@ var MCPClientAdapter = class {
|
|
|
21
21
|
constructor(client) {
|
|
22
22
|
this.client = client;
|
|
23
23
|
}
|
|
24
|
-
kind =
|
|
24
|
+
kind = chunkORKC2PK2_cjs.MCP_KIND;
|
|
25
25
|
async invoke(spec, args, _ctx) {
|
|
26
26
|
const params = args != null && typeof args === "object" && !Array.isArray(args) ? args : {};
|
|
27
27
|
const result = await this.client.callTool({ name: spec.name, arguments: params });
|
|
@@ -62,7 +62,7 @@ function mcpToolsToSpecs(tools) {
|
|
|
62
62
|
return tools.map((t) => ({
|
|
63
63
|
name: t.name,
|
|
64
64
|
version: "1.0.0",
|
|
65
|
-
kind:
|
|
65
|
+
kind: chunkORKC2PK2_cjs.MCP_KIND,
|
|
66
66
|
description: t.description ?? `MCP tool: ${t.name}`,
|
|
67
67
|
inputSchema: t.inputSchema ?? chunkSOFUWEZ6_cjs.DEFAULT_INPUT_SCHEMA,
|
|
68
68
|
outputSchema: chunkSOFUWEZ6_cjs.DEFAULT_OUTPUT_SCHEMA,
|
|
@@ -102,8 +102,8 @@ async function registerMCPToolsFromConfig(runtime, registry, options = {}) {
|
|
|
102
102
|
const configPath = options.configPath ?? process.env.MCP_CONFIG_PATH ?? path.join(process.cwd(), "mcp.json");
|
|
103
103
|
const dirPath = path.dirname(configPath);
|
|
104
104
|
const entryPoint = path.basename(configPath);
|
|
105
|
-
const toolName = options.toolName ??
|
|
106
|
-
const loaded = await
|
|
105
|
+
const toolName = options.toolName ?? chunkORKC2PK2_cjs.MCP_KIND;
|
|
106
|
+
const loaded = await chunk2SH6IOCF_cjs.loadMCPTool(dirPath, { kind: chunkORKC2PK2_cjs.MCP_KIND, name: toolName, entryPoint });
|
|
107
107
|
if (!loaded.mcpConfig) {
|
|
108
108
|
throw new Error("mcp.json must have command or url");
|
|
109
109
|
}
|
|
@@ -119,71 +119,71 @@ async function registerMCPToolsFromConfig(runtime, registry, options = {}) {
|
|
|
119
119
|
|
|
120
120
|
Object.defineProperty(exports, "LangChainToolsHub", {
|
|
121
121
|
enumerable: true,
|
|
122
|
-
get: function () { return
|
|
122
|
+
get: function () { return chunk5BO3RL5R_cjs.LangChainToolsHub; }
|
|
123
123
|
});
|
|
124
124
|
Object.defineProperty(exports, "createAgentTools", {
|
|
125
125
|
enumerable: true,
|
|
126
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunk5BO3RL5R_cjs.createAgentTools; }
|
|
127
127
|
});
|
|
128
128
|
Object.defineProperty(exports, "DirectoryScanner", {
|
|
129
129
|
enumerable: true,
|
|
130
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunk2SH6IOCF_cjs.DirectoryScanner; }
|
|
131
131
|
});
|
|
132
132
|
Object.defineProperty(exports, "DiscoveryError", {
|
|
133
133
|
enumerable: true,
|
|
134
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunk2SH6IOCF_cjs.DiscoveryError; }
|
|
135
135
|
});
|
|
136
136
|
Object.defineProperty(exports, "SkillManifestError", {
|
|
137
137
|
enumerable: true,
|
|
138
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunk2SH6IOCF_cjs.SkillManifestError; }
|
|
139
139
|
});
|
|
140
140
|
Object.defineProperty(exports, "buildFunctionToTool", {
|
|
141
141
|
enumerable: true,
|
|
142
|
-
get: function () { return
|
|
142
|
+
get: function () { return chunk2SH6IOCF_cjs.buildFunctionToTool; }
|
|
143
143
|
});
|
|
144
144
|
Object.defineProperty(exports, "buildMcpPackage", {
|
|
145
145
|
enumerable: true,
|
|
146
|
-
get: function () { return
|
|
146
|
+
get: function () { return chunk2SH6IOCF_cjs.buildMcpPackage; }
|
|
147
147
|
});
|
|
148
148
|
Object.defineProperty(exports, "initProject", {
|
|
149
149
|
enumerable: true,
|
|
150
|
-
get: function () { return
|
|
150
|
+
get: function () { return chunk2SH6IOCF_cjs.initProject; }
|
|
151
151
|
});
|
|
152
152
|
Object.defineProperty(exports, "loadMCPTool", {
|
|
153
153
|
enumerable: true,
|
|
154
|
-
get: function () { return
|
|
154
|
+
get: function () { return chunk2SH6IOCF_cjs.loadMCPTool; }
|
|
155
155
|
});
|
|
156
156
|
Object.defineProperty(exports, "loadSkillDefinition", {
|
|
157
157
|
enumerable: true,
|
|
158
|
-
get: function () { return
|
|
158
|
+
get: function () { return chunk2SH6IOCF_cjs.loadSkillDefinition; }
|
|
159
159
|
});
|
|
160
160
|
Object.defineProperty(exports, "parseSkillMd", {
|
|
161
161
|
enumerable: true,
|
|
162
|
-
get: function () { return
|
|
162
|
+
get: function () { return chunk2SH6IOCF_cjs.parseSkillMd; }
|
|
163
163
|
});
|
|
164
164
|
Object.defineProperty(exports, "runGeneratedMCP", {
|
|
165
165
|
enumerable: true,
|
|
166
|
-
get: function () { return
|
|
166
|
+
get: function () { return chunk2SH6IOCF_cjs.runGeneratedMCP; }
|
|
167
167
|
});
|
|
168
168
|
Object.defineProperty(exports, "runMcpServer", {
|
|
169
169
|
enumerable: true,
|
|
170
|
-
get: function () { return
|
|
170
|
+
get: function () { return chunk2SH6IOCF_cjs.runMcpServer; }
|
|
171
171
|
});
|
|
172
172
|
Object.defineProperty(exports, "scan", {
|
|
173
173
|
enumerable: true,
|
|
174
|
-
get: function () { return
|
|
174
|
+
get: function () { return chunk2SH6IOCF_cjs.scan; }
|
|
175
175
|
});
|
|
176
176
|
Object.defineProperty(exports, "scanForTools", {
|
|
177
177
|
enumerable: true,
|
|
178
|
-
get: function () { return
|
|
178
|
+
get: function () { return chunk2SH6IOCF_cjs.scanForTools; }
|
|
179
179
|
});
|
|
180
180
|
Object.defineProperty(exports, "scanSkillResources", {
|
|
181
181
|
enumerable: true,
|
|
182
|
-
get: function () { return
|
|
182
|
+
get: function () { return chunk2SH6IOCF_cjs.scanSkillResources; }
|
|
183
183
|
});
|
|
184
184
|
Object.defineProperty(exports, "validateFrontmatter", {
|
|
185
185
|
enumerable: true,
|
|
186
|
-
get: function () { return
|
|
186
|
+
get: function () { return chunk2SH6IOCF_cjs.validateFrontmatter; }
|
|
187
187
|
});
|
|
188
188
|
Object.defineProperty(exports, "DEFAULT_INPUT_SCHEMA", {
|
|
189
189
|
enumerable: true,
|
|
@@ -199,95 +199,95 @@ Object.defineProperty(exports, "createToolSpec", {
|
|
|
199
199
|
});
|
|
200
200
|
Object.defineProperty(exports, "BudgetManager", {
|
|
201
201
|
enumerable: true,
|
|
202
|
-
get: function () { return
|
|
202
|
+
get: function () { return chunkORKC2PK2_cjs.BudgetManager; }
|
|
203
203
|
});
|
|
204
204
|
Object.defineProperty(exports, "EventLog", {
|
|
205
205
|
enumerable: true,
|
|
206
|
-
get: function () { return
|
|
206
|
+
get: function () { return chunkORKC2PK2_cjs.EventLog; }
|
|
207
207
|
});
|
|
208
208
|
Object.defineProperty(exports, "Metrics", {
|
|
209
209
|
enumerable: true,
|
|
210
|
-
get: function () { return
|
|
210
|
+
get: function () { return chunkORKC2PK2_cjs.Metrics; }
|
|
211
211
|
});
|
|
212
212
|
Object.defineProperty(exports, "PTCRuntime", {
|
|
213
213
|
enumerable: true,
|
|
214
|
-
get: function () { return
|
|
214
|
+
get: function () { return chunkORKC2PK2_cjs.PTCRuntime; }
|
|
215
215
|
});
|
|
216
216
|
Object.defineProperty(exports, "PolicyDeniedError", {
|
|
217
217
|
enumerable: true,
|
|
218
|
-
get: function () { return
|
|
218
|
+
get: function () { return chunkORKC2PK2_cjs.PolicyDeniedError; }
|
|
219
219
|
});
|
|
220
220
|
Object.defineProperty(exports, "PolicyEngine", {
|
|
221
221
|
enumerable: true,
|
|
222
|
-
get: function () { return
|
|
222
|
+
get: function () { return chunkORKC2PK2_cjs.PolicyEngine; }
|
|
223
223
|
});
|
|
224
224
|
Object.defineProperty(exports, "SchemaValidationError", {
|
|
225
225
|
enumerable: true,
|
|
226
|
-
get: function () { return
|
|
226
|
+
get: function () { return chunkORKC2PK2_cjs.SchemaValidationError; }
|
|
227
227
|
});
|
|
228
228
|
Object.defineProperty(exports, "SchemaValidator", {
|
|
229
229
|
enumerable: true,
|
|
230
|
-
get: function () { return
|
|
230
|
+
get: function () { return chunkORKC2PK2_cjs.SchemaValidator; }
|
|
231
231
|
});
|
|
232
232
|
Object.defineProperty(exports, "Tracing", {
|
|
233
233
|
enumerable: true,
|
|
234
|
-
get: function () { return
|
|
234
|
+
get: function () { return chunkORKC2PK2_cjs.Tracing; }
|
|
235
235
|
});
|
|
236
236
|
Object.defineProperty(exports, "buildEvidence", {
|
|
237
237
|
enumerable: true,
|
|
238
|
-
get: function () { return
|
|
238
|
+
get: function () { return chunkORKC2PK2_cjs.buildEvidence; }
|
|
239
239
|
});
|
|
240
240
|
Object.defineProperty(exports, "createLogger", {
|
|
241
241
|
enumerable: true,
|
|
242
|
-
get: function () { return
|
|
242
|
+
get: function () { return chunkORKC2PK2_cjs.createLogger; }
|
|
243
243
|
});
|
|
244
244
|
Object.defineProperty(exports, "ensurePackageInCache", {
|
|
245
245
|
enumerable: true,
|
|
246
|
-
get: function () { return
|
|
246
|
+
get: function () { return chunkORKC2PK2_cjs.ensurePackageInCache; }
|
|
247
247
|
});
|
|
248
248
|
Object.defineProperty(exports, "expandToolDescriptorsToRegistryNames", {
|
|
249
249
|
enumerable: true,
|
|
250
|
-
get: function () { return
|
|
250
|
+
get: function () { return chunkORKC2PK2_cjs.expandToolDescriptorsToRegistryNames; }
|
|
251
251
|
});
|
|
252
252
|
Object.defineProperty(exports, "getPackageEntryPath", {
|
|
253
253
|
enumerable: true,
|
|
254
|
-
get: function () { return
|
|
254
|
+
get: function () { return chunkORKC2PK2_cjs.getPackageEntryPath; }
|
|
255
255
|
});
|
|
256
256
|
Object.defineProperty(exports, "importFromCache", {
|
|
257
257
|
enumerable: true,
|
|
258
|
-
get: function () { return
|
|
258
|
+
get: function () { return chunkORKC2PK2_cjs.importFromCache; }
|
|
259
259
|
});
|
|
260
260
|
Object.defineProperty(exports, "isNpmToolDescriptor", {
|
|
261
261
|
enumerable: true,
|
|
262
|
-
get: function () { return
|
|
262
|
+
get: function () { return chunkORKC2PK2_cjs.isNpmToolDescriptor; }
|
|
263
263
|
});
|
|
264
264
|
Object.defineProperty(exports, "loadToolConfig", {
|
|
265
265
|
enumerable: true,
|
|
266
|
-
get: function () { return
|
|
266
|
+
get: function () { return chunkORKC2PK2_cjs.loadToolConfig; }
|
|
267
267
|
});
|
|
268
268
|
Object.defineProperty(exports, "normalizeToolList", {
|
|
269
269
|
enumerable: true,
|
|
270
|
-
get: function () { return
|
|
270
|
+
get: function () { return chunkORKC2PK2_cjs.normalizeToolList; }
|
|
271
271
|
});
|
|
272
272
|
Object.defineProperty(exports, "parseNpmToolDescriptor", {
|
|
273
273
|
enumerable: true,
|
|
274
|
-
get: function () { return
|
|
274
|
+
get: function () { return chunkORKC2PK2_cjs.parseNpmToolDescriptor; }
|
|
275
275
|
});
|
|
276
276
|
Object.defineProperty(exports, "resolveNpmToolDescriptor", {
|
|
277
277
|
enumerable: true,
|
|
278
|
-
get: function () { return
|
|
278
|
+
get: function () { return chunkORKC2PK2_cjs.resolveNpmToolDescriptor; }
|
|
279
279
|
});
|
|
280
280
|
Object.defineProperty(exports, "resolveToolDescriptor", {
|
|
281
281
|
enumerable: true,
|
|
282
|
-
get: function () { return
|
|
282
|
+
get: function () { return chunkORKC2PK2_cjs.resolveToolDescriptor; }
|
|
283
283
|
});
|
|
284
284
|
Object.defineProperty(exports, "sanitizeForLog", {
|
|
285
285
|
enumerable: true,
|
|
286
|
-
get: function () { return
|
|
286
|
+
get: function () { return chunkORKC2PK2_cjs.sanitizeForLog; }
|
|
287
287
|
});
|
|
288
288
|
Object.defineProperty(exports, "summarizeForLog", {
|
|
289
289
|
enumerable: true,
|
|
290
|
-
get: function () { return
|
|
290
|
+
get: function () { return chunkORKC2PK2_cjs.summarizeForLog; }
|
|
291
291
|
});
|
|
292
292
|
Object.defineProperty(exports, "ToolRegistry", {
|
|
293
293
|
enumerable: true,
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { LangChainToolsHub, createAgentTools } from './chunk-
|
|
2
|
-
import { loadMCPTool } from './chunk-
|
|
3
|
-
export { DirectoryScanner, DiscoveryError, SkillManifestError, buildFunctionToTool, buildMcpPackage, initProject, loadMCPTool, loadSkillDefinition, parseSkillMd, runGeneratedMCP, runMcpServer, scan, scanForTools, scanSkillResources, validateFrontmatter } from './chunk-
|
|
1
|
+
export { LangChainToolsHub, createAgentTools } from './chunk-UTRTRLZW.js';
|
|
2
|
+
import { loadMCPTool } from './chunk-CM5YKSRS.js';
|
|
3
|
+
export { DirectoryScanner, DiscoveryError, SkillManifestError, buildFunctionToTool, buildMcpPackage, initProject, loadMCPTool, loadSkillDefinition, parseSkillMd, runGeneratedMCP, runMcpServer, scan, scanForTools, scanSkillResources, validateFrontmatter } from './chunk-CM5YKSRS.js';
|
|
4
4
|
import { DEFAULT_OUTPUT_SCHEMA, DEFAULT_INPUT_SCHEMA } from './chunk-5SWSNVMI.js';
|
|
5
5
|
export { DEFAULT_INPUT_SCHEMA, DEFAULT_OUTPUT_SCHEMA, createToolSpec } from './chunk-5SWSNVMI.js';
|
|
6
|
-
import { MCP_KIND } from './chunk-
|
|
7
|
-
export { BudgetManager, EventLog, Metrics, PTCRuntime, PolicyDeniedError, PolicyEngine, SchemaValidationError, SchemaValidator, Tracing, buildEvidence, createLogger, ensurePackageInCache, expandToolDescriptorsToRegistryNames, getPackageEntryPath, importFromCache, isNpmToolDescriptor, loadToolConfig, normalizeToolList, parseNpmToolDescriptor, resolveNpmToolDescriptor, resolveToolDescriptor, sanitizeForLog, summarizeForLog } from './chunk-
|
|
6
|
+
import { MCP_KIND } from './chunk-FQQDPJ7Z.js';
|
|
7
|
+
export { BudgetManager, EventLog, Metrics, PTCRuntime, PolicyDeniedError, PolicyEngine, SchemaValidationError, SchemaValidator, Tracing, buildEvidence, createLogger, ensurePackageInCache, expandToolDescriptorsToRegistryNames, getPackageEntryPath, importFromCache, isNpmToolDescriptor, loadToolConfig, normalizeToolList, parseNpmToolDescriptor, resolveNpmToolDescriptor, resolveToolDescriptor, sanitizeForLog, summarizeForLog } from './chunk-FQQDPJ7Z.js';
|
|
8
8
|
export { ToolRegistry, createTaggedError, isRetryable, withRetry } from './chunk-AE6FSNGY.js';
|
|
9
9
|
import './chunk-FR2CXERF.js';
|
|
10
10
|
import { join, dirname, basename } from 'path';
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Load tool.yaml:
|
|
3
|
-
*
|
|
2
|
+
* Load tool.yaml: tools config (sandboxedPath + list) or legacy top-level tools + sandboxedPath.
|
|
3
|
+
* Normalized shape: tools (array of descriptors) and sandboxedPath.
|
|
4
4
|
*/
|
|
5
|
-
/**
|
|
5
|
+
/** Normalized shape returned by loadToolConfig: tools list and optional sandboxedPath. */
|
|
6
6
|
export interface ToolYamlShape {
|
|
7
|
+
/** List of tool descriptors (npm:@scope/pkg#path or plain names). */
|
|
7
8
|
tools?: string[];
|
|
8
9
|
/** Root path for fs sandbox; tools can only access under this path. Resolved relative to tool.yaml dir. */
|
|
9
10
|
sandboxedPath?: string;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
|
-
* Load tool.yaml and return tools
|
|
13
|
+
* Load tool.yaml and return normalized shape (tools array + sandboxedPath).
|
|
14
|
+
* Supports:
|
|
15
|
+
* - New format: tools: { sandboxedPath: "...", list: [...] }
|
|
16
|
+
* - Legacy format: tools: [...], sandboxedPath: "..." (top-level)
|
|
13
17
|
*/
|
|
14
18
|
export declare function loadToolConfig(toolYamlPath: string): ToolYamlShape;
|
|
15
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolConfig.d.ts","sourceRoot":"","sources":["../../../src/tools/util/toolConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,
|
|
1
|
+
{"version":3,"file":"toolConfig.d.ts","sourceRoot":"","sources":["../../../src/tools/util/toolConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,0FAA0F;AAC1F,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,2GAA2G;IAC3G,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAcD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,CAiBlE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CASxF;AAED,oEAAoE;AACpE,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKnF;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAU1F"}
|
package/dist/utils/cli/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunk2SH6IOCF_cjs = require('../../chunk-2SH6IOCF.cjs');
|
|
5
5
|
require('../../chunk-SOFUWEZ6.cjs');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
6
|
+
var chunk5NOAYHLP_cjs = require('../../chunk-5NOAYHLP.cjs');
|
|
7
|
+
var chunkORKC2PK2_cjs = require('../../chunk-ORKC2PK2.cjs');
|
|
8
8
|
require('../../chunk-ZNJBRLKN.cjs');
|
|
9
9
|
var chunk6F5JHLZ7_cjs = require('../../chunk-6F5JHLZ7.cjs');
|
|
10
10
|
var path = require('path');
|
|
@@ -24,10 +24,10 @@ async function getRuntimeWithTools(pathOpt, verbose = false) {
|
|
|
24
24
|
const stepLog = verbose ? (msg) => process.stderr.write(`[agent-tool] ${msg}
|
|
25
25
|
`) : void 0;
|
|
26
26
|
if (stepLog) stepLog(`Loading tool config from ${searchDir}`);
|
|
27
|
-
const config =
|
|
27
|
+
const config = chunkORKC2PK2_cjs.findAndLoadToolConfig(searchDir);
|
|
28
28
|
let sandboxRoot = cwd;
|
|
29
29
|
if (config.sandboxedPath && typeof config.sandboxedPath === "string" && config.configPath) {
|
|
30
|
-
sandboxRoot =
|
|
30
|
+
sandboxRoot = chunkORKC2PK2_cjs.resolveSandboxedPath(config.configPath, config.sandboxedPath);
|
|
31
31
|
}
|
|
32
32
|
if (stepLog) {
|
|
33
33
|
if (config.configPath) {
|
|
@@ -38,7 +38,7 @@ async function getRuntimeWithTools(pathOpt, verbose = false) {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
const coreConfig = { sandboxRoot, allowedHosts: [] };
|
|
41
|
-
const result = await
|
|
41
|
+
const result = await chunkORKC2PK2_cjs.createRuntimeFromConfig({
|
|
42
42
|
coreTools: coreConfig,
|
|
43
43
|
configFilePath: config.configPath,
|
|
44
44
|
stepLog
|
|
@@ -160,7 +160,7 @@ For agent run (ReAct + agent.yaml): npx @easynet/agent-orchestra run "task" -c a
|
|
|
160
160
|
}
|
|
161
161
|
async function cmdInit(pathOpt) {
|
|
162
162
|
try {
|
|
163
|
-
const { targetPath, filesCreated } = await
|
|
163
|
+
const { targetPath, filesCreated } = await chunk2SH6IOCF_cjs.initProject({ targetPath: pathOpt || void 0 });
|
|
164
164
|
process.stdout.write(`Initialized project at ${targetPath}
|
|
165
165
|
Created: ${filesCreated.join(", ")}
|
|
166
166
|
Next: npm install && npm run build
|
|
@@ -174,7 +174,7 @@ Next: npm install && npm run build
|
|
|
174
174
|
}
|
|
175
175
|
async function cmdBuild(pathOpt, outDir, include, includeN8n) {
|
|
176
176
|
try {
|
|
177
|
-
const result = await
|
|
177
|
+
const result = await chunk2SH6IOCF_cjs.buildMcpPackage({
|
|
178
178
|
projectPath: pathOpt || void 0,
|
|
179
179
|
outDir: outDir || void 0,
|
|
180
180
|
include: include.length > 0 ? include : void 0,
|
|
@@ -195,7 +195,7 @@ mcp.json: ${result.mcpJsonPath}
|
|
|
195
195
|
}
|
|
196
196
|
async function cmdServe(pathOpt) {
|
|
197
197
|
try {
|
|
198
|
-
const { process: child } = await
|
|
198
|
+
const { process: child } = await chunk2SH6IOCF_cjs.runMcpServer({ path: pathOpt || void 0 });
|
|
199
199
|
child.stdin?.pipe(process.stdin);
|
|
200
200
|
child.stdout?.pipe(process.stdout);
|
|
201
201
|
process.stdin?.unref();
|
|
@@ -213,7 +213,7 @@ var LS_DESC_MAX = 72;
|
|
|
213
213
|
function formatLsOutput(specs) {
|
|
214
214
|
const rows = specs.map((spec) => {
|
|
215
215
|
const { name } = parseToolName(spec.name);
|
|
216
|
-
const scope =
|
|
216
|
+
const scope = chunkORKC2PK2_cjs.getDisplayScope(spec.name, spec.kind, spec.version);
|
|
217
217
|
const desc = (spec.description ?? "").replace(/\n/g, " ").trim().slice(0, LS_DESC_MAX);
|
|
218
218
|
return { scope, name, description: desc || "(no description)" };
|
|
219
219
|
});
|
|
@@ -240,7 +240,7 @@ function formatLsOutput(specs) {
|
|
|
240
240
|
}
|
|
241
241
|
function formatDescribeOutput(spec) {
|
|
242
242
|
const { name: localName } = parseToolName(spec.name);
|
|
243
|
-
const scope =
|
|
243
|
+
const scope = chunkORKC2PK2_cjs.getDisplayScope(spec.name, spec.kind, spec.version);
|
|
244
244
|
const sections = [];
|
|
245
245
|
sections.push("\u250C\u2500 Tool");
|
|
246
246
|
sections.push(`\u2502 name: ${spec.name}`);
|
|
@@ -276,7 +276,7 @@ async function cmdLs(pathOpt, verbose = false) {
|
|
|
276
276
|
process.stdout.write("No tools registered.\n");
|
|
277
277
|
const cwd = process.cwd();
|
|
278
278
|
const searchDir = path__default.default.resolve(cwd, pathOpt ?? ".");
|
|
279
|
-
const config =
|
|
279
|
+
const config = chunkORKC2PK2_cjs.findAndLoadToolConfig(searchDir);
|
|
280
280
|
const hasNpmTools = Array.isArray(config.tools) && config.tools.some((t) => typeof t === "string" && t.startsWith("npm:"));
|
|
281
281
|
if (hasNpmTools) {
|
|
282
282
|
process.stdout.write("Tip: Install builtin tools in this directory: npm init -y && npm install @easynet/agent-tool-buildin\n");
|
|
@@ -299,7 +299,7 @@ async function cmdDescribe(toolName, pathOpt, verbose = false) {
|
|
|
299
299
|
}
|
|
300
300
|
try {
|
|
301
301
|
const { registry } = await getRuntimeWithTools(pathOpt, verbose);
|
|
302
|
-
const registryName =
|
|
302
|
+
const registryName = chunkORKC2PK2_cjs.resolveToolDescriptor(toolName.trim());
|
|
303
303
|
const spec = registry.get(registryName);
|
|
304
304
|
if (!spec) {
|
|
305
305
|
process.stderr.write(`Tool not found: ${toolName}
|
|
@@ -348,7 +348,7 @@ async function cmdRun(toolName, toolArgsJson, pathOpt, verbose = false) {
|
|
|
348
348
|
}
|
|
349
349
|
try {
|
|
350
350
|
const { runtime, registry } = await getRuntimeWithTools(pathOpt, verbose);
|
|
351
|
-
const registryName =
|
|
351
|
+
const registryName = chunkORKC2PK2_cjs.resolveToolDescriptor(toolName.trim());
|
|
352
352
|
if (!registry.get(registryName)) {
|
|
353
353
|
process.stderr.write(`Tool not found: ${toolName}
|
|
354
354
|
`);
|
|
@@ -375,7 +375,7 @@ async function cmdRun(toolName, toolArgsJson, pathOpt, verbose = false) {
|
|
|
375
375
|
async function cmdStartMcp(pathOpt, verbose = false) {
|
|
376
376
|
try {
|
|
377
377
|
const { runtime } = await getRuntimeWithTools(pathOpt, verbose);
|
|
378
|
-
await
|
|
378
|
+
await chunk5NOAYHLP_cjs.runMCPServerOverStdio(runtime);
|
|
379
379
|
return 0;
|
|
380
380
|
} catch (err) {
|
|
381
381
|
process.stderr.write(`start mcp failed: ${err instanceof Error ? err.message : String(err)}
|
|
@@ -386,7 +386,7 @@ async function cmdStartMcp(pathOpt, verbose = false) {
|
|
|
386
386
|
async function cmdStartHttp(port, host, pathOpt, verbose = false) {
|
|
387
387
|
try {
|
|
388
388
|
const { runtime } = await getRuntimeWithTools(pathOpt, verbose);
|
|
389
|
-
const http = await
|
|
389
|
+
const http = await chunk5NOAYHLP_cjs.createHttpService(runtime);
|
|
390
390
|
const { port: actualPort, host: actualHost } = await http.listen({ port, host });
|
|
391
391
|
const base = `http://${actualHost}:${actualPort}`;
|
|
392
392
|
process.stdout.write(`API: ${base}/invoke (POST), ${base}/tools (GET)
|
package/dist/utils/cli/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { initProject, buildMcpPackage, runMcpServer } from '../../chunk-
|
|
2
|
+
import { initProject, buildMcpPackage, runMcpServer } from '../../chunk-CM5YKSRS.js';
|
|
3
3
|
import '../../chunk-5SWSNVMI.js';
|
|
4
|
-
import { runMCPServerOverStdio, createHttpService } from '../../chunk-
|
|
5
|
-
import { findAndLoadToolConfig, resolveToolDescriptor, resolveSandboxedPath, createRuntimeFromConfig, getDisplayScope } from '../../chunk-
|
|
4
|
+
import { runMCPServerOverStdio, createHttpService } from '../../chunk-FQS77UEY.js';
|
|
5
|
+
import { findAndLoadToolConfig, resolveToolDescriptor, resolveSandboxedPath, createRuntimeFromConfig, getDisplayScope } from '../../chunk-FQQDPJ7Z.js';
|
|
6
6
|
import '../../chunk-AE6FSNGY.js';
|
|
7
7
|
import { enrichSpecWithCanonicalSchema } from '../../chunk-FR2CXERF.js';
|
|
8
8
|
import path from 'path';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easynet/agent-tool",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "MCP build: init → build → run. Turn your project (@tool, SKILL, n8n) into a standalone MCP npm server (no framework embedding, no package conflict).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|