@easynet/agent-tool 1.0.11 → 1.0.13
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-CM5YKSRS.js → chunk-2UJDLDU3.js} +3 -3
- package/dist/{chunk-CM5YKSRS.js.map → chunk-2UJDLDU3.js.map} +1 -1
- package/dist/{chunk-FQS77UEY.js → chunk-6PQULCKV.js} +3 -3
- package/dist/{chunk-FQS77UEY.js.map → chunk-6PQULCKV.js.map} +1 -1
- package/dist/{chunk-ORKC2PK2.cjs → chunk-C6MLWDQR.cjs} +46 -50
- package/dist/chunk-C6MLWDQR.cjs.map +1 -0
- package/dist/{chunk-2SH6IOCF.cjs → chunk-LOCHVF6S.cjs} +9 -9
- package/dist/{chunk-2SH6IOCF.cjs.map → chunk-LOCHVF6S.cjs.map} +1 -1
- package/dist/{chunk-FQQDPJ7Z.js → chunk-LQMJXB4F.js} +45 -49
- package/dist/chunk-LQMJXB4F.js.map +1 -0
- package/dist/{chunk-5BO3RL5R.cjs → chunk-MGAOAX7Y.cjs} +12 -12
- package/dist/{chunk-5BO3RL5R.cjs.map → chunk-MGAOAX7Y.cjs.map} +1 -1
- package/dist/{chunk-UTRTRLZW.js → chunk-MZDJLMRP.js} +3 -3
- package/dist/{chunk-UTRTRLZW.js.map → chunk-MZDJLMRP.js.map} +1 -1
- package/dist/{chunk-5NOAYHLP.cjs → chunk-UKCEKY5S.cjs} +7 -7
- package/dist/{chunk-5NOAYHLP.cjs.map → chunk-UKCEKY5S.cjs.map} +1 -1
- package/dist/core/runtime/PTCRuntime.d.ts.map +1 -1
- package/dist/core/runtime/PTCRuntimePipeline.d.ts.map +1 -1
- package/dist/index.cjs +59 -59
- package/dist/index.js +5 -5
- package/dist/tools/util/toolDescriptor.d.ts +9 -12
- package/dist/tools/util/toolDescriptor.d.ts.map +1 -1
- package/dist/utils/cli/index.cjs +17 -17
- package/dist/utils/cli/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-FQQDPJ7Z.js.map +0 -1
- package/dist/chunk-ORKC2PK2.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkMGAOAX7Y_cjs = require('./chunk-MGAOAX7Y.cjs');
|
|
4
|
+
var chunkLOCHVF6S_cjs = require('./chunk-LOCHVF6S.cjs');
|
|
5
|
+
var chunkC6MLWDQR_cjs = require('./chunk-C6MLWDQR.cjs');
|
|
5
6
|
var chunkSOFUWEZ6_cjs = require('./chunk-SOFUWEZ6.cjs');
|
|
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 = chunkC6MLWDQR_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: chunkC6MLWDQR_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 ?? chunkC6MLWDQR_cjs.MCP_KIND;
|
|
106
|
+
const loaded = await chunkLOCHVF6S_cjs.loadMCPTool(dirPath, { kind: chunkC6MLWDQR_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,175 +119,175 @@ 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 chunkMGAOAX7Y_cjs.LangChainToolsHub; }
|
|
123
123
|
});
|
|
124
124
|
Object.defineProperty(exports, "createAgentTools", {
|
|
125
125
|
enumerable: true,
|
|
126
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunkMGAOAX7Y_cjs.createAgentTools; }
|
|
127
127
|
});
|
|
128
128
|
Object.defineProperty(exports, "DirectoryScanner", {
|
|
129
129
|
enumerable: true,
|
|
130
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunkLOCHVF6S_cjs.DirectoryScanner; }
|
|
131
131
|
});
|
|
132
132
|
Object.defineProperty(exports, "DiscoveryError", {
|
|
133
133
|
enumerable: true,
|
|
134
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunkLOCHVF6S_cjs.DiscoveryError; }
|
|
135
135
|
});
|
|
136
136
|
Object.defineProperty(exports, "SkillManifestError", {
|
|
137
137
|
enumerable: true,
|
|
138
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunkLOCHVF6S_cjs.SkillManifestError; }
|
|
139
139
|
});
|
|
140
140
|
Object.defineProperty(exports, "buildFunctionToTool", {
|
|
141
141
|
enumerable: true,
|
|
142
|
-
get: function () { return
|
|
142
|
+
get: function () { return chunkLOCHVF6S_cjs.buildFunctionToTool; }
|
|
143
143
|
});
|
|
144
144
|
Object.defineProperty(exports, "buildMcpPackage", {
|
|
145
145
|
enumerable: true,
|
|
146
|
-
get: function () { return
|
|
146
|
+
get: function () { return chunkLOCHVF6S_cjs.buildMcpPackage; }
|
|
147
147
|
});
|
|
148
148
|
Object.defineProperty(exports, "initProject", {
|
|
149
149
|
enumerable: true,
|
|
150
|
-
get: function () { return
|
|
150
|
+
get: function () { return chunkLOCHVF6S_cjs.initProject; }
|
|
151
151
|
});
|
|
152
152
|
Object.defineProperty(exports, "loadMCPTool", {
|
|
153
153
|
enumerable: true,
|
|
154
|
-
get: function () { return
|
|
154
|
+
get: function () { return chunkLOCHVF6S_cjs.loadMCPTool; }
|
|
155
155
|
});
|
|
156
156
|
Object.defineProperty(exports, "loadSkillDefinition", {
|
|
157
157
|
enumerable: true,
|
|
158
|
-
get: function () { return
|
|
158
|
+
get: function () { return chunkLOCHVF6S_cjs.loadSkillDefinition; }
|
|
159
159
|
});
|
|
160
160
|
Object.defineProperty(exports, "parseSkillMd", {
|
|
161
161
|
enumerable: true,
|
|
162
|
-
get: function () { return
|
|
162
|
+
get: function () { return chunkLOCHVF6S_cjs.parseSkillMd; }
|
|
163
163
|
});
|
|
164
164
|
Object.defineProperty(exports, "runGeneratedMCP", {
|
|
165
165
|
enumerable: true,
|
|
166
|
-
get: function () { return
|
|
166
|
+
get: function () { return chunkLOCHVF6S_cjs.runGeneratedMCP; }
|
|
167
167
|
});
|
|
168
168
|
Object.defineProperty(exports, "runMcpServer", {
|
|
169
169
|
enumerable: true,
|
|
170
|
-
get: function () { return
|
|
170
|
+
get: function () { return chunkLOCHVF6S_cjs.runMcpServer; }
|
|
171
171
|
});
|
|
172
172
|
Object.defineProperty(exports, "scan", {
|
|
173
173
|
enumerable: true,
|
|
174
|
-
get: function () { return
|
|
174
|
+
get: function () { return chunkLOCHVF6S_cjs.scan; }
|
|
175
175
|
});
|
|
176
176
|
Object.defineProperty(exports, "scanForTools", {
|
|
177
177
|
enumerable: true,
|
|
178
|
-
get: function () { return
|
|
178
|
+
get: function () { return chunkLOCHVF6S_cjs.scanForTools; }
|
|
179
179
|
});
|
|
180
180
|
Object.defineProperty(exports, "scanSkillResources", {
|
|
181
181
|
enumerable: true,
|
|
182
|
-
get: function () { return
|
|
182
|
+
get: function () { return chunkLOCHVF6S_cjs.scanSkillResources; }
|
|
183
183
|
});
|
|
184
184
|
Object.defineProperty(exports, "validateFrontmatter", {
|
|
185
185
|
enumerable: true,
|
|
186
|
-
get: function () { return
|
|
187
|
-
});
|
|
188
|
-
Object.defineProperty(exports, "DEFAULT_INPUT_SCHEMA", {
|
|
189
|
-
enumerable: true,
|
|
190
|
-
get: function () { return chunkSOFUWEZ6_cjs.DEFAULT_INPUT_SCHEMA; }
|
|
191
|
-
});
|
|
192
|
-
Object.defineProperty(exports, "DEFAULT_OUTPUT_SCHEMA", {
|
|
193
|
-
enumerable: true,
|
|
194
|
-
get: function () { return chunkSOFUWEZ6_cjs.DEFAULT_OUTPUT_SCHEMA; }
|
|
195
|
-
});
|
|
196
|
-
Object.defineProperty(exports, "createToolSpec", {
|
|
197
|
-
enumerable: true,
|
|
198
|
-
get: function () { return chunkSOFUWEZ6_cjs.createToolSpec; }
|
|
186
|
+
get: function () { return chunkLOCHVF6S_cjs.validateFrontmatter; }
|
|
199
187
|
});
|
|
200
188
|
Object.defineProperty(exports, "BudgetManager", {
|
|
201
189
|
enumerable: true,
|
|
202
|
-
get: function () { return
|
|
190
|
+
get: function () { return chunkC6MLWDQR_cjs.BudgetManager; }
|
|
203
191
|
});
|
|
204
192
|
Object.defineProperty(exports, "EventLog", {
|
|
205
193
|
enumerable: true,
|
|
206
|
-
get: function () { return
|
|
194
|
+
get: function () { return chunkC6MLWDQR_cjs.EventLog; }
|
|
207
195
|
});
|
|
208
196
|
Object.defineProperty(exports, "Metrics", {
|
|
209
197
|
enumerable: true,
|
|
210
|
-
get: function () { return
|
|
198
|
+
get: function () { return chunkC6MLWDQR_cjs.Metrics; }
|
|
211
199
|
});
|
|
212
200
|
Object.defineProperty(exports, "PTCRuntime", {
|
|
213
201
|
enumerable: true,
|
|
214
|
-
get: function () { return
|
|
202
|
+
get: function () { return chunkC6MLWDQR_cjs.PTCRuntime; }
|
|
215
203
|
});
|
|
216
204
|
Object.defineProperty(exports, "PolicyDeniedError", {
|
|
217
205
|
enumerable: true,
|
|
218
|
-
get: function () { return
|
|
206
|
+
get: function () { return chunkC6MLWDQR_cjs.PolicyDeniedError; }
|
|
219
207
|
});
|
|
220
208
|
Object.defineProperty(exports, "PolicyEngine", {
|
|
221
209
|
enumerable: true,
|
|
222
|
-
get: function () { return
|
|
210
|
+
get: function () { return chunkC6MLWDQR_cjs.PolicyEngine; }
|
|
223
211
|
});
|
|
224
212
|
Object.defineProperty(exports, "SchemaValidationError", {
|
|
225
213
|
enumerable: true,
|
|
226
|
-
get: function () { return
|
|
214
|
+
get: function () { return chunkC6MLWDQR_cjs.SchemaValidationError; }
|
|
227
215
|
});
|
|
228
216
|
Object.defineProperty(exports, "SchemaValidator", {
|
|
229
217
|
enumerable: true,
|
|
230
|
-
get: function () { return
|
|
218
|
+
get: function () { return chunkC6MLWDQR_cjs.SchemaValidator; }
|
|
231
219
|
});
|
|
232
220
|
Object.defineProperty(exports, "Tracing", {
|
|
233
221
|
enumerable: true,
|
|
234
|
-
get: function () { return
|
|
222
|
+
get: function () { return chunkC6MLWDQR_cjs.Tracing; }
|
|
235
223
|
});
|
|
236
224
|
Object.defineProperty(exports, "buildEvidence", {
|
|
237
225
|
enumerable: true,
|
|
238
|
-
get: function () { return
|
|
226
|
+
get: function () { return chunkC6MLWDQR_cjs.buildEvidence; }
|
|
239
227
|
});
|
|
240
228
|
Object.defineProperty(exports, "createLogger", {
|
|
241
229
|
enumerable: true,
|
|
242
|
-
get: function () { return
|
|
230
|
+
get: function () { return chunkC6MLWDQR_cjs.createLogger; }
|
|
243
231
|
});
|
|
244
232
|
Object.defineProperty(exports, "ensurePackageInCache", {
|
|
245
233
|
enumerable: true,
|
|
246
|
-
get: function () { return
|
|
234
|
+
get: function () { return chunkC6MLWDQR_cjs.ensurePackageInCache; }
|
|
247
235
|
});
|
|
248
236
|
Object.defineProperty(exports, "expandToolDescriptorsToRegistryNames", {
|
|
249
237
|
enumerable: true,
|
|
250
|
-
get: function () { return
|
|
238
|
+
get: function () { return chunkC6MLWDQR_cjs.expandToolDescriptorsToRegistryNames; }
|
|
251
239
|
});
|
|
252
240
|
Object.defineProperty(exports, "getPackageEntryPath", {
|
|
253
241
|
enumerable: true,
|
|
254
|
-
get: function () { return
|
|
242
|
+
get: function () { return chunkC6MLWDQR_cjs.getPackageEntryPath; }
|
|
255
243
|
});
|
|
256
244
|
Object.defineProperty(exports, "importFromCache", {
|
|
257
245
|
enumerable: true,
|
|
258
|
-
get: function () { return
|
|
246
|
+
get: function () { return chunkC6MLWDQR_cjs.importFromCache; }
|
|
259
247
|
});
|
|
260
248
|
Object.defineProperty(exports, "isNpmToolDescriptor", {
|
|
261
249
|
enumerable: true,
|
|
262
|
-
get: function () { return
|
|
250
|
+
get: function () { return chunkC6MLWDQR_cjs.isNpmToolDescriptor; }
|
|
263
251
|
});
|
|
264
252
|
Object.defineProperty(exports, "loadToolConfig", {
|
|
265
253
|
enumerable: true,
|
|
266
|
-
get: function () { return
|
|
254
|
+
get: function () { return chunkC6MLWDQR_cjs.loadToolConfig; }
|
|
267
255
|
});
|
|
268
256
|
Object.defineProperty(exports, "normalizeToolList", {
|
|
269
257
|
enumerable: true,
|
|
270
|
-
get: function () { return
|
|
258
|
+
get: function () { return chunkC6MLWDQR_cjs.normalizeToolList; }
|
|
271
259
|
});
|
|
272
260
|
Object.defineProperty(exports, "parseNpmToolDescriptor", {
|
|
273
261
|
enumerable: true,
|
|
274
|
-
get: function () { return
|
|
262
|
+
get: function () { return chunkC6MLWDQR_cjs.parseNpmToolDescriptor; }
|
|
275
263
|
});
|
|
276
264
|
Object.defineProperty(exports, "resolveNpmToolDescriptor", {
|
|
277
265
|
enumerable: true,
|
|
278
|
-
get: function () { return
|
|
266
|
+
get: function () { return chunkC6MLWDQR_cjs.resolveNpmToolDescriptor; }
|
|
279
267
|
});
|
|
280
268
|
Object.defineProperty(exports, "resolveToolDescriptor", {
|
|
281
269
|
enumerable: true,
|
|
282
|
-
get: function () { return
|
|
270
|
+
get: function () { return chunkC6MLWDQR_cjs.resolveToolDescriptor; }
|
|
283
271
|
});
|
|
284
272
|
Object.defineProperty(exports, "sanitizeForLog", {
|
|
285
273
|
enumerable: true,
|
|
286
|
-
get: function () { return
|
|
274
|
+
get: function () { return chunkC6MLWDQR_cjs.sanitizeForLog; }
|
|
287
275
|
});
|
|
288
276
|
Object.defineProperty(exports, "summarizeForLog", {
|
|
289
277
|
enumerable: true,
|
|
290
|
-
get: function () { return
|
|
278
|
+
get: function () { return chunkC6MLWDQR_cjs.summarizeForLog; }
|
|
279
|
+
});
|
|
280
|
+
Object.defineProperty(exports, "DEFAULT_INPUT_SCHEMA", {
|
|
281
|
+
enumerable: true,
|
|
282
|
+
get: function () { return chunkSOFUWEZ6_cjs.DEFAULT_INPUT_SCHEMA; }
|
|
283
|
+
});
|
|
284
|
+
Object.defineProperty(exports, "DEFAULT_OUTPUT_SCHEMA", {
|
|
285
|
+
enumerable: true,
|
|
286
|
+
get: function () { return chunkSOFUWEZ6_cjs.DEFAULT_OUTPUT_SCHEMA; }
|
|
287
|
+
});
|
|
288
|
+
Object.defineProperty(exports, "createToolSpec", {
|
|
289
|
+
enumerable: true,
|
|
290
|
+
get: function () { return chunkSOFUWEZ6_cjs.createToolSpec; }
|
|
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-MZDJLMRP.js';
|
|
2
|
+
import { loadMCPTool } from './chunk-2UJDLDU3.js';
|
|
3
|
+
export { DirectoryScanner, DiscoveryError, SkillManifestError, buildFunctionToTool, buildMcpPackage, initProject, loadMCPTool, loadSkillDefinition, parseSkillMd, runGeneratedMCP, runMcpServer, scan, scanForTools, scanSkillResources, validateFrontmatter } from './chunk-2UJDLDU3.js';
|
|
4
|
+
import { MCP_KIND } from './chunk-LQMJXB4F.js';
|
|
5
|
+
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-LQMJXB4F.js';
|
|
4
6
|
import { DEFAULT_OUTPUT_SCHEMA, DEFAULT_INPUT_SCHEMA } from './chunk-5SWSNVMI.js';
|
|
5
7
|
export { DEFAULT_INPUT_SCHEMA, DEFAULT_OUTPUT_SCHEMA, createToolSpec } from './chunk-5SWSNVMI.js';
|
|
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';
|
|
@@ -54,24 +54,21 @@ export declare function isNpmToolDescriptor(descriptor: string): boolean;
|
|
|
54
54
|
* @deprecated Prefer parseToolPath(descriptor) for protocol:scope/package#toolName
|
|
55
55
|
*/
|
|
56
56
|
export declare function parseNpmToolDescriptor(descriptor: string): NpmToolDescriptor | null;
|
|
57
|
-
/** Full package descriptor for builtin tools (display scope). Use with optional @version. */
|
|
58
|
-
export declare const BUILTIN_DISPLAY_SCOPE_PREFIX = "npm:@easynet/agent-tool-builtin";
|
|
59
57
|
/**
|
|
60
|
-
* Return the display scope
|
|
61
|
-
*
|
|
58
|
+
* Return the display scope for a tool: the first segment of the registry name (before the first "/"),
|
|
59
|
+
* or the full name if there is no "/".
|
|
62
60
|
*/
|
|
63
|
-
export declare function getDisplayScope(registryName: string,
|
|
61
|
+
export declare function getDisplayScope(registryName: string, _kind?: string, _toolVersion?: string): string;
|
|
64
62
|
/**
|
|
65
|
-
* Resolve a single npm tool descriptor to
|
|
66
|
-
*
|
|
63
|
+
* Resolve a single npm tool descriptor to a registry name.
|
|
64
|
+
* This package does not resolve npm descriptors to registry names; resolution is done by the runtime/loader.
|
|
65
|
+
* Returns null so that resolveToolDescriptor returns the descriptor as-is.
|
|
67
66
|
*/
|
|
68
67
|
export declare function resolveNpmToolDescriptor(descriptor: string): string | null;
|
|
69
68
|
/**
|
|
70
|
-
* Expand a list of tool descriptors
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* - npm:@easynet/agent-tool-builtin -> all core/* names from registry
|
|
74
|
-
* - Plain names and already-resolved names are kept as-is (exact match).
|
|
69
|
+
* Expand a list of tool descriptors to registry tool names.
|
|
70
|
+
* Only descriptors that are already registry names (exact match in registryNames) are included.
|
|
71
|
+
* npm:... descriptors are not resolved here; use registry names in the list or resolve elsewhere.
|
|
75
72
|
*/
|
|
76
73
|
export declare function expandToolDescriptorsToRegistryNames(descriptors: string[], registryNames: string[]): string[];
|
|
77
74
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolDescriptor.d.ts","sourceRoot":"","sources":["../../../src/tools/util/toolDescriptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,MAAM,WAAW,QAAQ;IACvB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,6HAA6H;AAC7H,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAUjE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,kBAAkB,EAAE,MAAM,GAAG,cAAc,CAO9E;AAOD,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAOnF;
|
|
1
|
+
{"version":3,"file":"toolDescriptor.d.ts","sourceRoot":"","sources":["../../../src/tools/util/toolDescriptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,MAAM,WAAW,QAAQ;IACvB,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,kBAAkB,EAAE,MAAM,CAAC;IAC3B,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,6HAA6H;AAC7H,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAUjE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,kBAAkB,EAAE,MAAM,GAAG,cAAc,CAO9E;AAOD,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAOnF;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,MAAM,GACpB,MAAM,CAGR;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE1E;AAED;;;;GAIG;AACH,wBAAgB,oCAAoC,CAClD,WAAW,EAAE,MAAM,EAAE,EACrB,aAAa,EAAE,MAAM,EAAE,GACtB,MAAM,EAAE,CAiBV;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAKhE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAYjE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAErD"}
|
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 chunkLOCHVF6S_cjs = require('../../chunk-LOCHVF6S.cjs');
|
|
5
|
+
var chunkUKCEKY5S_cjs = require('../../chunk-UKCEKY5S.cjs');
|
|
6
|
+
var chunkC6MLWDQR_cjs = require('../../chunk-C6MLWDQR.cjs');
|
|
5
7
|
require('../../chunk-SOFUWEZ6.cjs');
|
|
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 = chunkC6MLWDQR_cjs.findAndLoadToolConfig(searchDir);
|
|
28
28
|
let sandboxRoot = cwd;
|
|
29
29
|
if (config.sandboxedPath && typeof config.sandboxedPath === "string" && config.configPath) {
|
|
30
|
-
sandboxRoot =
|
|
30
|
+
sandboxRoot = chunkC6MLWDQR_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 chunkC6MLWDQR_cjs.createRuntimeFromConfig({
|
|
42
42
|
coreTools: coreConfig,
|
|
43
43
|
configFilePath: config.configPath,
|
|
44
44
|
stepLog
|
|
@@ -165,7 +165,7 @@ For agent run (ReAct + agent.yaml): npx @easynet/agent-orchestra run "task" -c a
|
|
|
165
165
|
}
|
|
166
166
|
async function cmdInit(pathOpt) {
|
|
167
167
|
try {
|
|
168
|
-
const { targetPath, filesCreated } = await
|
|
168
|
+
const { targetPath, filesCreated } = await chunkLOCHVF6S_cjs.initProject({ targetPath: pathOpt || void 0 });
|
|
169
169
|
process.stdout.write(`Initialized project at ${targetPath}
|
|
170
170
|
Created: ${filesCreated.join(", ")}
|
|
171
171
|
Next: npm install && npm run build
|
|
@@ -179,7 +179,7 @@ Next: npm install && npm run build
|
|
|
179
179
|
}
|
|
180
180
|
async function cmdBuild(pathOpt, outDir, include, includeN8n) {
|
|
181
181
|
try {
|
|
182
|
-
const result = await
|
|
182
|
+
const result = await chunkLOCHVF6S_cjs.buildMcpPackage({
|
|
183
183
|
projectPath: pathOpt || void 0,
|
|
184
184
|
outDir: outDir || void 0,
|
|
185
185
|
include: include.length > 0 ? include : void 0,
|
|
@@ -200,7 +200,7 @@ mcp.json: ${result.mcpJsonPath}
|
|
|
200
200
|
}
|
|
201
201
|
async function cmdServe(pathOpt) {
|
|
202
202
|
try {
|
|
203
|
-
const { process: child } = await
|
|
203
|
+
const { process: child } = await chunkLOCHVF6S_cjs.runMcpServer({ path: pathOpt || void 0 });
|
|
204
204
|
child.stdin?.pipe(process.stdin);
|
|
205
205
|
child.stdout?.pipe(process.stdout);
|
|
206
206
|
process.stdin?.unref();
|
|
@@ -218,7 +218,7 @@ var LS_DESC_MAX = 72;
|
|
|
218
218
|
function formatLsOutput(specs) {
|
|
219
219
|
const rows = specs.map((spec) => {
|
|
220
220
|
const { name } = parseToolName(spec.name);
|
|
221
|
-
const scope =
|
|
221
|
+
const scope = chunkC6MLWDQR_cjs.getDisplayScope(spec.name, spec.kind, spec.version);
|
|
222
222
|
const desc = (spec.description ?? "").replace(/\n/g, " ").trim().slice(0, LS_DESC_MAX);
|
|
223
223
|
return { scope, name, description: desc || "(no description)" };
|
|
224
224
|
});
|
|
@@ -245,7 +245,7 @@ function formatLsOutput(specs) {
|
|
|
245
245
|
}
|
|
246
246
|
function formatDescribeOutput(spec) {
|
|
247
247
|
const { name: localName } = parseToolName(spec.name);
|
|
248
|
-
const scope =
|
|
248
|
+
const scope = chunkC6MLWDQR_cjs.getDisplayScope(spec.name, spec.kind, spec.version);
|
|
249
249
|
const sections = [];
|
|
250
250
|
sections.push("\u250C\u2500 Tool");
|
|
251
251
|
sections.push(`\u2502 name: ${spec.name}`);
|
|
@@ -281,7 +281,7 @@ async function cmdLs(pathOpt, verbose = false) {
|
|
|
281
281
|
process.stdout.write("No tools registered.\n");
|
|
282
282
|
const cwd = process.cwd();
|
|
283
283
|
const searchDir = path__default.default.resolve(cwd, pathOpt ?? ".");
|
|
284
|
-
const config =
|
|
284
|
+
const config = chunkC6MLWDQR_cjs.findAndLoadToolConfig(searchDir);
|
|
285
285
|
const hasNpmTools = Array.isArray(config.tools) && config.tools.some((t) => typeof t === "string" && t.startsWith("npm:"));
|
|
286
286
|
if (hasNpmTools) {
|
|
287
287
|
process.stdout.write("Tip: Install builtin tools in this directory: npm init -y && npm install @easynet/agent-tool-buildin\n");
|
|
@@ -304,7 +304,7 @@ async function cmdDescribe(toolName, pathOpt, verbose = false) {
|
|
|
304
304
|
}
|
|
305
305
|
try {
|
|
306
306
|
const { registry } = await getRuntimeWithTools(pathOpt, verbose);
|
|
307
|
-
const registryName =
|
|
307
|
+
const registryName = chunkC6MLWDQR_cjs.resolveToolDescriptor(toolName.trim());
|
|
308
308
|
const spec = registry.get(registryName);
|
|
309
309
|
if (!spec) {
|
|
310
310
|
process.stderr.write(`Tool not found: ${toolName}
|
|
@@ -353,7 +353,7 @@ async function cmdRun(toolName, toolArgsJson, pathOpt, verbose = false) {
|
|
|
353
353
|
}
|
|
354
354
|
try {
|
|
355
355
|
const { runtime, registry } = await getRuntimeWithTools(pathOpt, verbose);
|
|
356
|
-
const registryName =
|
|
356
|
+
const registryName = chunkC6MLWDQR_cjs.resolveToolDescriptor(toolName.trim());
|
|
357
357
|
if (!registry.get(registryName)) {
|
|
358
358
|
process.stderr.write(`Tool not found: ${toolName}
|
|
359
359
|
`);
|
|
@@ -381,10 +381,10 @@ async function cmdStartMcp(pathOpt, verbose = false, stdio = false, port = 3e3,
|
|
|
381
381
|
try {
|
|
382
382
|
const { runtime } = await getRuntimeWithTools(pathOpt, verbose);
|
|
383
383
|
if (stdio) {
|
|
384
|
-
await
|
|
384
|
+
await chunkUKCEKY5S_cjs.runMCPServerOverStdio(runtime);
|
|
385
385
|
return 0;
|
|
386
386
|
}
|
|
387
|
-
const streamable = await
|
|
387
|
+
const streamable = await chunkUKCEKY5S_cjs.createMCPServerStreamableHttp(runtime, { port, host, path: "/mcp" });
|
|
388
388
|
const { url, port: actualPort } = await streamable.listen(port, host);
|
|
389
389
|
process.stdout.write(`MCP Streamable HTTP: ${url}
|
|
390
390
|
`);
|
|
@@ -400,7 +400,7 @@ async function cmdStartMcp(pathOpt, verbose = false, stdio = false, port = 3e3,
|
|
|
400
400
|
async function cmdStartHttp(port, host, pathOpt, verbose = false) {
|
|
401
401
|
try {
|
|
402
402
|
const { runtime } = await getRuntimeWithTools(pathOpt, verbose);
|
|
403
|
-
const http = await
|
|
403
|
+
const http = await chunkUKCEKY5S_cjs.createHttpService(runtime);
|
|
404
404
|
const { port: actualPort, host: actualHost } = await http.listen({ port, host });
|
|
405
405
|
const base = `http://${actualHost}:${actualPort}`;
|
|
406
406
|
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-2UJDLDU3.js';
|
|
3
|
+
import { runMCPServerOverStdio, createMCPServerStreamableHttp, createHttpService } from '../../chunk-6PQULCKV.js';
|
|
4
|
+
import { findAndLoadToolConfig, resolveToolDescriptor, resolveSandboxedPath, createRuntimeFromConfig, getDisplayScope } from '../../chunk-LQMJXB4F.js';
|
|
3
5
|
import '../../chunk-5SWSNVMI.js';
|
|
4
|
-
import { runMCPServerOverStdio, createMCPServerStreamableHttp, 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.13",
|
|
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",
|