@easynet/agent-tool 1.0.13 → 1.0.14
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-2UJDLDU3.js → chunk-32KGW2ZC.js} +3 -3
- package/dist/{chunk-2UJDLDU3.js.map → chunk-32KGW2ZC.js.map} +1 -1
- package/dist/{chunk-MGAOAX7Y.cjs → chunk-DAXCPVEJ.cjs} +12 -12
- package/dist/{chunk-MGAOAX7Y.cjs.map → chunk-DAXCPVEJ.cjs.map} +1 -1
- package/dist/{chunk-LOCHVF6S.cjs → chunk-FBEUWFEP.cjs} +9 -9
- package/dist/{chunk-LOCHVF6S.cjs.map → chunk-FBEUWFEP.cjs.map} +1 -1
- package/dist/{chunk-LQMJXB4F.js → chunk-FL6UMT6P.js} +24 -3
- package/dist/chunk-FL6UMT6P.js.map +1 -0
- package/dist/{chunk-6PQULCKV.js → chunk-TYMFMSUF.js} +3 -3
- package/dist/{chunk-6PQULCKV.js.map → chunk-TYMFMSUF.js.map} +1 -1
- package/dist/{chunk-UKCEKY5S.cjs → chunk-UVGIML54.cjs} +7 -7
- package/dist/{chunk-UKCEKY5S.cjs.map → chunk-UVGIML54.cjs.map} +1 -1
- package/dist/{chunk-MZDJLMRP.js → chunk-WI3KURGA.js} +3 -3
- package/dist/{chunk-MZDJLMRP.js.map → chunk-WI3KURGA.js.map} +1 -1
- package/dist/{chunk-C6MLWDQR.cjs → chunk-Z3GHHXSM.cjs} +25 -4
- package/dist/chunk-Z3GHHXSM.cjs.map +1 -0
- package/dist/core/runtime/PTCRuntime.d.ts.map +1 -1
- package/dist/core/runtime/PTCRuntimePipeline.d.ts +6 -0
- package/dist/core/runtime/PTCRuntimePipeline.d.ts.map +1 -1
- package/dist/index.cjs +47 -47
- package/dist/index.js +5 -5
- package/dist/utils/cli/index.cjs +17 -17
- package/dist/utils/cli/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-C6MLWDQR.cjs.map +0 -1
- package/dist/chunk-LQMJXB4F.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkDAXCPVEJ_cjs = require('./chunk-DAXCPVEJ.cjs');
|
|
4
|
+
var chunkFBEUWFEP_cjs = require('./chunk-FBEUWFEP.cjs');
|
|
5
|
+
var chunkZ3GHHXSM_cjs = require('./chunk-Z3GHHXSM.cjs');
|
|
6
6
|
var chunkSOFUWEZ6_cjs = require('./chunk-SOFUWEZ6.cjs');
|
|
7
7
|
var chunkZNJBRLKN_cjs = require('./chunk-ZNJBRLKN.cjs');
|
|
8
8
|
require('./chunk-6F5JHLZ7.cjs');
|
|
@@ -21,7 +21,7 @@ var MCPClientAdapter = class {
|
|
|
21
21
|
constructor(client) {
|
|
22
22
|
this.client = client;
|
|
23
23
|
}
|
|
24
|
-
kind =
|
|
24
|
+
kind = chunkZ3GHHXSM_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: chunkZ3GHHXSM_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 ?? chunkZ3GHHXSM_cjs.MCP_KIND;
|
|
106
|
+
const loaded = await chunkFBEUWFEP_cjs.loadMCPTool(dirPath, { kind: chunkZ3GHHXSM_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,163 +119,163 @@ 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 chunkDAXCPVEJ_cjs.LangChainToolsHub; }
|
|
123
123
|
});
|
|
124
124
|
Object.defineProperty(exports, "createAgentTools", {
|
|
125
125
|
enumerable: true,
|
|
126
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunkDAXCPVEJ_cjs.createAgentTools; }
|
|
127
127
|
});
|
|
128
128
|
Object.defineProperty(exports, "DirectoryScanner", {
|
|
129
129
|
enumerable: true,
|
|
130
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunkFBEUWFEP_cjs.DirectoryScanner; }
|
|
131
131
|
});
|
|
132
132
|
Object.defineProperty(exports, "DiscoveryError", {
|
|
133
133
|
enumerable: true,
|
|
134
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunkFBEUWFEP_cjs.DiscoveryError; }
|
|
135
135
|
});
|
|
136
136
|
Object.defineProperty(exports, "SkillManifestError", {
|
|
137
137
|
enumerable: true,
|
|
138
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunkFBEUWFEP_cjs.SkillManifestError; }
|
|
139
139
|
});
|
|
140
140
|
Object.defineProperty(exports, "buildFunctionToTool", {
|
|
141
141
|
enumerable: true,
|
|
142
|
-
get: function () { return
|
|
142
|
+
get: function () { return chunkFBEUWFEP_cjs.buildFunctionToTool; }
|
|
143
143
|
});
|
|
144
144
|
Object.defineProperty(exports, "buildMcpPackage", {
|
|
145
145
|
enumerable: true,
|
|
146
|
-
get: function () { return
|
|
146
|
+
get: function () { return chunkFBEUWFEP_cjs.buildMcpPackage; }
|
|
147
147
|
});
|
|
148
148
|
Object.defineProperty(exports, "initProject", {
|
|
149
149
|
enumerable: true,
|
|
150
|
-
get: function () { return
|
|
150
|
+
get: function () { return chunkFBEUWFEP_cjs.initProject; }
|
|
151
151
|
});
|
|
152
152
|
Object.defineProperty(exports, "loadMCPTool", {
|
|
153
153
|
enumerable: true,
|
|
154
|
-
get: function () { return
|
|
154
|
+
get: function () { return chunkFBEUWFEP_cjs.loadMCPTool; }
|
|
155
155
|
});
|
|
156
156
|
Object.defineProperty(exports, "loadSkillDefinition", {
|
|
157
157
|
enumerable: true,
|
|
158
|
-
get: function () { return
|
|
158
|
+
get: function () { return chunkFBEUWFEP_cjs.loadSkillDefinition; }
|
|
159
159
|
});
|
|
160
160
|
Object.defineProperty(exports, "parseSkillMd", {
|
|
161
161
|
enumerable: true,
|
|
162
|
-
get: function () { return
|
|
162
|
+
get: function () { return chunkFBEUWFEP_cjs.parseSkillMd; }
|
|
163
163
|
});
|
|
164
164
|
Object.defineProperty(exports, "runGeneratedMCP", {
|
|
165
165
|
enumerable: true,
|
|
166
|
-
get: function () { return
|
|
166
|
+
get: function () { return chunkFBEUWFEP_cjs.runGeneratedMCP; }
|
|
167
167
|
});
|
|
168
168
|
Object.defineProperty(exports, "runMcpServer", {
|
|
169
169
|
enumerable: true,
|
|
170
|
-
get: function () { return
|
|
170
|
+
get: function () { return chunkFBEUWFEP_cjs.runMcpServer; }
|
|
171
171
|
});
|
|
172
172
|
Object.defineProperty(exports, "scan", {
|
|
173
173
|
enumerable: true,
|
|
174
|
-
get: function () { return
|
|
174
|
+
get: function () { return chunkFBEUWFEP_cjs.scan; }
|
|
175
175
|
});
|
|
176
176
|
Object.defineProperty(exports, "scanForTools", {
|
|
177
177
|
enumerable: true,
|
|
178
|
-
get: function () { return
|
|
178
|
+
get: function () { return chunkFBEUWFEP_cjs.scanForTools; }
|
|
179
179
|
});
|
|
180
180
|
Object.defineProperty(exports, "scanSkillResources", {
|
|
181
181
|
enumerable: true,
|
|
182
|
-
get: function () { return
|
|
182
|
+
get: function () { return chunkFBEUWFEP_cjs.scanSkillResources; }
|
|
183
183
|
});
|
|
184
184
|
Object.defineProperty(exports, "validateFrontmatter", {
|
|
185
185
|
enumerable: true,
|
|
186
|
-
get: function () { return
|
|
186
|
+
get: function () { return chunkFBEUWFEP_cjs.validateFrontmatter; }
|
|
187
187
|
});
|
|
188
188
|
Object.defineProperty(exports, "BudgetManager", {
|
|
189
189
|
enumerable: true,
|
|
190
|
-
get: function () { return
|
|
190
|
+
get: function () { return chunkZ3GHHXSM_cjs.BudgetManager; }
|
|
191
191
|
});
|
|
192
192
|
Object.defineProperty(exports, "EventLog", {
|
|
193
193
|
enumerable: true,
|
|
194
|
-
get: function () { return
|
|
194
|
+
get: function () { return chunkZ3GHHXSM_cjs.EventLog; }
|
|
195
195
|
});
|
|
196
196
|
Object.defineProperty(exports, "Metrics", {
|
|
197
197
|
enumerable: true,
|
|
198
|
-
get: function () { return
|
|
198
|
+
get: function () { return chunkZ3GHHXSM_cjs.Metrics; }
|
|
199
199
|
});
|
|
200
200
|
Object.defineProperty(exports, "PTCRuntime", {
|
|
201
201
|
enumerable: true,
|
|
202
|
-
get: function () { return
|
|
202
|
+
get: function () { return chunkZ3GHHXSM_cjs.PTCRuntime; }
|
|
203
203
|
});
|
|
204
204
|
Object.defineProperty(exports, "PolicyDeniedError", {
|
|
205
205
|
enumerable: true,
|
|
206
|
-
get: function () { return
|
|
206
|
+
get: function () { return chunkZ3GHHXSM_cjs.PolicyDeniedError; }
|
|
207
207
|
});
|
|
208
208
|
Object.defineProperty(exports, "PolicyEngine", {
|
|
209
209
|
enumerable: true,
|
|
210
|
-
get: function () { return
|
|
210
|
+
get: function () { return chunkZ3GHHXSM_cjs.PolicyEngine; }
|
|
211
211
|
});
|
|
212
212
|
Object.defineProperty(exports, "SchemaValidationError", {
|
|
213
213
|
enumerable: true,
|
|
214
|
-
get: function () { return
|
|
214
|
+
get: function () { return chunkZ3GHHXSM_cjs.SchemaValidationError; }
|
|
215
215
|
});
|
|
216
216
|
Object.defineProperty(exports, "SchemaValidator", {
|
|
217
217
|
enumerable: true,
|
|
218
|
-
get: function () { return
|
|
218
|
+
get: function () { return chunkZ3GHHXSM_cjs.SchemaValidator; }
|
|
219
219
|
});
|
|
220
220
|
Object.defineProperty(exports, "Tracing", {
|
|
221
221
|
enumerable: true,
|
|
222
|
-
get: function () { return
|
|
222
|
+
get: function () { return chunkZ3GHHXSM_cjs.Tracing; }
|
|
223
223
|
});
|
|
224
224
|
Object.defineProperty(exports, "buildEvidence", {
|
|
225
225
|
enumerable: true,
|
|
226
|
-
get: function () { return
|
|
226
|
+
get: function () { return chunkZ3GHHXSM_cjs.buildEvidence; }
|
|
227
227
|
});
|
|
228
228
|
Object.defineProperty(exports, "createLogger", {
|
|
229
229
|
enumerable: true,
|
|
230
|
-
get: function () { return
|
|
230
|
+
get: function () { return chunkZ3GHHXSM_cjs.createLogger; }
|
|
231
231
|
});
|
|
232
232
|
Object.defineProperty(exports, "ensurePackageInCache", {
|
|
233
233
|
enumerable: true,
|
|
234
|
-
get: function () { return
|
|
234
|
+
get: function () { return chunkZ3GHHXSM_cjs.ensurePackageInCache; }
|
|
235
235
|
});
|
|
236
236
|
Object.defineProperty(exports, "expandToolDescriptorsToRegistryNames", {
|
|
237
237
|
enumerable: true,
|
|
238
|
-
get: function () { return
|
|
238
|
+
get: function () { return chunkZ3GHHXSM_cjs.expandToolDescriptorsToRegistryNames; }
|
|
239
239
|
});
|
|
240
240
|
Object.defineProperty(exports, "getPackageEntryPath", {
|
|
241
241
|
enumerable: true,
|
|
242
|
-
get: function () { return
|
|
242
|
+
get: function () { return chunkZ3GHHXSM_cjs.getPackageEntryPath; }
|
|
243
243
|
});
|
|
244
244
|
Object.defineProperty(exports, "importFromCache", {
|
|
245
245
|
enumerable: true,
|
|
246
|
-
get: function () { return
|
|
246
|
+
get: function () { return chunkZ3GHHXSM_cjs.importFromCache; }
|
|
247
247
|
});
|
|
248
248
|
Object.defineProperty(exports, "isNpmToolDescriptor", {
|
|
249
249
|
enumerable: true,
|
|
250
|
-
get: function () { return
|
|
250
|
+
get: function () { return chunkZ3GHHXSM_cjs.isNpmToolDescriptor; }
|
|
251
251
|
});
|
|
252
252
|
Object.defineProperty(exports, "loadToolConfig", {
|
|
253
253
|
enumerable: true,
|
|
254
|
-
get: function () { return
|
|
254
|
+
get: function () { return chunkZ3GHHXSM_cjs.loadToolConfig; }
|
|
255
255
|
});
|
|
256
256
|
Object.defineProperty(exports, "normalizeToolList", {
|
|
257
257
|
enumerable: true,
|
|
258
|
-
get: function () { return
|
|
258
|
+
get: function () { return chunkZ3GHHXSM_cjs.normalizeToolList; }
|
|
259
259
|
});
|
|
260
260
|
Object.defineProperty(exports, "parseNpmToolDescriptor", {
|
|
261
261
|
enumerable: true,
|
|
262
|
-
get: function () { return
|
|
262
|
+
get: function () { return chunkZ3GHHXSM_cjs.parseNpmToolDescriptor; }
|
|
263
263
|
});
|
|
264
264
|
Object.defineProperty(exports, "resolveNpmToolDescriptor", {
|
|
265
265
|
enumerable: true,
|
|
266
|
-
get: function () { return
|
|
266
|
+
get: function () { return chunkZ3GHHXSM_cjs.resolveNpmToolDescriptor; }
|
|
267
267
|
});
|
|
268
268
|
Object.defineProperty(exports, "resolveToolDescriptor", {
|
|
269
269
|
enumerable: true,
|
|
270
|
-
get: function () { return
|
|
270
|
+
get: function () { return chunkZ3GHHXSM_cjs.resolveToolDescriptor; }
|
|
271
271
|
});
|
|
272
272
|
Object.defineProperty(exports, "sanitizeForLog", {
|
|
273
273
|
enumerable: true,
|
|
274
|
-
get: function () { return
|
|
274
|
+
get: function () { return chunkZ3GHHXSM_cjs.sanitizeForLog; }
|
|
275
275
|
});
|
|
276
276
|
Object.defineProperty(exports, "summarizeForLog", {
|
|
277
277
|
enumerable: true,
|
|
278
|
-
get: function () { return
|
|
278
|
+
get: function () { return chunkZ3GHHXSM_cjs.summarizeForLog; }
|
|
279
279
|
});
|
|
280
280
|
Object.defineProperty(exports, "DEFAULT_INPUT_SCHEMA", {
|
|
281
281
|
enumerable: true,
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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-
|
|
4
|
-
import { MCP_KIND } from './chunk-
|
|
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-
|
|
1
|
+
export { LangChainToolsHub, createAgentTools } from './chunk-WI3KURGA.js';
|
|
2
|
+
import { loadMCPTool } from './chunk-32KGW2ZC.js';
|
|
3
|
+
export { DirectoryScanner, DiscoveryError, SkillManifestError, buildFunctionToTool, buildMcpPackage, initProject, loadMCPTool, loadSkillDefinition, parseSkillMd, runGeneratedMCP, runMcpServer, scan, scanForTools, scanSkillResources, validateFrontmatter } from './chunk-32KGW2ZC.js';
|
|
4
|
+
import { MCP_KIND } from './chunk-FL6UMT6P.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-FL6UMT6P.js';
|
|
6
6
|
import { DEFAULT_OUTPUT_SCHEMA, DEFAULT_INPUT_SCHEMA } from './chunk-5SWSNVMI.js';
|
|
7
7
|
export { DEFAULT_INPUT_SCHEMA, DEFAULT_OUTPUT_SCHEMA, createToolSpec } from './chunk-5SWSNVMI.js';
|
|
8
8
|
export { ToolRegistry, createTaggedError, isRetryable, withRetry } from './chunk-AE6FSNGY.js';
|
package/dist/utils/cli/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
4
|
+
var chunkFBEUWFEP_cjs = require('../../chunk-FBEUWFEP.cjs');
|
|
5
|
+
var chunkUVGIML54_cjs = require('../../chunk-UVGIML54.cjs');
|
|
6
|
+
var chunkZ3GHHXSM_cjs = require('../../chunk-Z3GHHXSM.cjs');
|
|
7
7
|
require('../../chunk-SOFUWEZ6.cjs');
|
|
8
8
|
require('../../chunk-ZNJBRLKN.cjs');
|
|
9
9
|
var chunk6F5JHLZ7_cjs = require('../../chunk-6F5JHLZ7.cjs');
|
|
@@ -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 = chunkZ3GHHXSM_cjs.findAndLoadToolConfig(searchDir);
|
|
28
28
|
let sandboxRoot = cwd;
|
|
29
29
|
if (config.sandboxedPath && typeof config.sandboxedPath === "string" && config.configPath) {
|
|
30
|
-
sandboxRoot =
|
|
30
|
+
sandboxRoot = chunkZ3GHHXSM_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 chunkZ3GHHXSM_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 chunkFBEUWFEP_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 chunkFBEUWFEP_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 chunkFBEUWFEP_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 = chunkZ3GHHXSM_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 = chunkZ3GHHXSM_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 = chunkZ3GHHXSM_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 = chunkZ3GHHXSM_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 = chunkZ3GHHXSM_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 chunkUVGIML54_cjs.runMCPServerOverStdio(runtime);
|
|
385
385
|
return 0;
|
|
386
386
|
}
|
|
387
|
-
const streamable = await
|
|
387
|
+
const streamable = await chunkUVGIML54_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 chunkUVGIML54_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,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { initProject, buildMcpPackage, runMcpServer } from '../../chunk-
|
|
3
|
-
import { runMCPServerOverStdio, createMCPServerStreamableHttp, createHttpService } from '../../chunk-
|
|
4
|
-
import { findAndLoadToolConfig, resolveToolDescriptor, resolveSandboxedPath, createRuntimeFromConfig, getDisplayScope } from '../../chunk-
|
|
2
|
+
import { initProject, buildMcpPackage, runMcpServer } from '../../chunk-32KGW2ZC.js';
|
|
3
|
+
import { runMCPServerOverStdio, createMCPServerStreamableHttp, createHttpService } from '../../chunk-TYMFMSUF.js';
|
|
4
|
+
import { findAndLoadToolConfig, resolveToolDescriptor, resolveSandboxedPath, createRuntimeFromConfig, getDisplayScope } from '../../chunk-FL6UMT6P.js';
|
|
5
5
|
import '../../chunk-5SWSNVMI.js';
|
|
6
6
|
import '../../chunk-AE6FSNGY.js';
|
|
7
7
|
import { enrichSpecWithCanonicalSchema } from '../../chunk-FR2CXERF.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easynet/agent-tool",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
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",
|