@mondaydotcomorg/atp-client 0.19.19 → 0.20.0
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/index.cjs +46 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -28
- package/dist/index.js.map +1 -1
- package/dist/tools/explore-api.d.ts +3 -3
- package/dist/tools/explore-api.d.ts.map +1 -1
- package/dist/tools/explore-api.js +39 -30
- package/dist/tools/explore-api.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +4 -0
- package/src/tools/explore-api.ts +59 -43
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { ExecutionStatus } from '@mondaydotcomorg/atp-protocol';
|
|
|
7
7
|
export type { RuntimeAPIName } from '@mondaydotcomorg/atp-runtime';
|
|
8
8
|
export type { Tool, ToolName } from './tools/types.js';
|
|
9
9
|
export { ToolNames } from './tools/types.js';
|
|
10
|
-
export { searchApiInputSchema, executeCodeInputSchema, exploreApiInputSchema, fetchAllApisInputSchema, } from './tools/index.js';
|
|
10
|
+
export { searchApiInputSchema, executeCodeInputSchema, exploreApiInputSchema, fetchAllApisInputSchema, createExploreApiTool, createSearchApiTool, createFetchAllApisTool, createExecuteCodeTool, } from './tools/index.js';
|
|
11
11
|
export type { AgentToolProtocolClientOptions } from './client.js';
|
|
12
12
|
export { InProcessSession } from './core/in-process-session.js';
|
|
13
13
|
export type { ISession } from './core/session.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAE5B,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,YAAY,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACN,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAE5B,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,YAAY,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACN,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1313,41 +1313,56 @@ function createExecuteCodeTool(client) {
|
|
|
1313
1313
|
}
|
|
1314
1314
|
__name(createExecuteCodeTool, "createExecuteCodeTool");
|
|
1315
1315
|
var exploreApiInputSchema = z.object({
|
|
1316
|
-
|
|
1316
|
+
paths: z.union([
|
|
1317
|
+
z.string(),
|
|
1318
|
+
z.array(z.string()).min(1)
|
|
1319
|
+
]).describe('Path(s) to explore. Can be a single string like "/" or an array like ["/openapi/github", "/mcp/filesystem"]')
|
|
1317
1320
|
});
|
|
1321
|
+
function normalizePaths(paths) {
|
|
1322
|
+
return Array.isArray(paths) ? paths : [
|
|
1323
|
+
paths
|
|
1324
|
+
];
|
|
1325
|
+
}
|
|
1326
|
+
__name(normalizePaths, "normalizePaths");
|
|
1318
1327
|
function createExploreApiTool(client) {
|
|
1319
1328
|
return {
|
|
1320
1329
|
name: ToolNames.EXPLORE_API,
|
|
1321
|
-
description: 'Explore APIs using filesystem-like navigation. Navigate through directories to discover available functions. Provide path as string like "/"
|
|
1330
|
+
description: 'Explore APIs using filesystem-like navigation. Navigate through directories to discover available functions. Provide path as a string like "/" or paths as an array like ["/openapi", "/mcp"] to explore multiple at once.',
|
|
1322
1331
|
inputSchema: zodToJsonSchema(exploreApiInputSchema),
|
|
1323
1332
|
zodSchema: exploreApiInputSchema,
|
|
1324
1333
|
func: /* @__PURE__ */ __name(async (input) => {
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1334
|
+
const pathsToExplore = normalizePaths(input.paths);
|
|
1335
|
+
const results = await Promise.all(pathsToExplore.map(async (path) => {
|
|
1336
|
+
try {
|
|
1337
|
+
const result = await client.exploreAPI(path);
|
|
1338
|
+
if (result.type === "directory") {
|
|
1339
|
+
return {
|
|
1340
|
+
success: true,
|
|
1341
|
+
type: "directory",
|
|
1342
|
+
path: result.path,
|
|
1343
|
+
items: result.items
|
|
1344
|
+
};
|
|
1345
|
+
} else {
|
|
1346
|
+
return {
|
|
1347
|
+
success: true,
|
|
1348
|
+
type: "function",
|
|
1349
|
+
name: result.name,
|
|
1350
|
+
description: result.description,
|
|
1351
|
+
definition: result.definition,
|
|
1352
|
+
group: result.group,
|
|
1353
|
+
path: result.path
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
} catch (error) {
|
|
1357
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1358
|
+
return {
|
|
1359
|
+
success: false,
|
|
1360
|
+
path,
|
|
1361
|
+
error: message
|
|
1362
|
+
};
|
|
1344
1363
|
}
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
success: false,
|
|
1348
|
-
error: error.message
|
|
1349
|
-
}, null, 2);
|
|
1350
|
-
}
|
|
1364
|
+
}));
|
|
1365
|
+
return JSON.stringify(results, null, 2);
|
|
1351
1366
|
}, "func")
|
|
1352
1367
|
};
|
|
1353
1368
|
}
|
|
@@ -1607,6 +1622,6 @@ function createToolsFromATPClient(client) {
|
|
|
1607
1622
|
}
|
|
1608
1623
|
__name(createToolsFromATPClient, "createToolsFromATPClient");
|
|
1609
1624
|
|
|
1610
|
-
export { AgentToolProtocolClient, ClientCallbackError, CodeGenerator, InProcessSession, ToolNames, createToolsFromATPClient, executeCodeInputSchema, exploreApiInputSchema, fetchAllApisInputSchema, searchApiInputSchema };
|
|
1625
|
+
export { AgentToolProtocolClient, ClientCallbackError, CodeGenerator, InProcessSession, ToolNames, createExecuteCodeTool, createExploreApiTool, createFetchAllApisTool, createSearchApiTool, createToolsFromATPClient, executeCodeInputSchema, exploreApiInputSchema, fetchAllApisInputSchema, searchApiInputSchema };
|
|
1611
1626
|
//# sourceMappingURL=index.js.map
|
|
1612
1627
|
//# sourceMappingURL=index.js.map
|