@mondaydotcomorg/atp-client 0.19.20 → 0.20.1
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.cjs
CHANGED
|
@@ -1314,41 +1314,56 @@ function createExecuteCodeTool(client) {
|
|
|
1314
1314
|
}
|
|
1315
1315
|
__name(createExecuteCodeTool, "createExecuteCodeTool");
|
|
1316
1316
|
var exploreApiInputSchema = zod.z.object({
|
|
1317
|
-
|
|
1317
|
+
paths: zod.z.union([
|
|
1318
|
+
zod.z.string(),
|
|
1319
|
+
zod.z.array(zod.z.string()).min(1)
|
|
1320
|
+
]).describe('Path(s) to explore. Can be a single string like "/" or an array like ["/openapi/github", "/mcp/filesystem"]')
|
|
1318
1321
|
});
|
|
1322
|
+
function normalizePaths(paths) {
|
|
1323
|
+
return Array.isArray(paths) ? paths : [
|
|
1324
|
+
paths
|
|
1325
|
+
];
|
|
1326
|
+
}
|
|
1327
|
+
__name(normalizePaths, "normalizePaths");
|
|
1319
1328
|
function createExploreApiTool(client) {
|
|
1320
1329
|
return {
|
|
1321
1330
|
name: ToolNames.EXPLORE_API,
|
|
1322
|
-
description: 'Explore APIs using filesystem-like navigation. Navigate through directories to discover available functions. Provide path as string like "/"
|
|
1331
|
+
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.',
|
|
1323
1332
|
inputSchema: zodToJsonSchema.zodToJsonSchema(exploreApiInputSchema),
|
|
1324
1333
|
zodSchema: exploreApiInputSchema,
|
|
1325
1334
|
func: /* @__PURE__ */ __name(async (input) => {
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1335
|
+
const pathsToExplore = normalizePaths(input.paths);
|
|
1336
|
+
const results = await Promise.all(pathsToExplore.map(async (path) => {
|
|
1337
|
+
try {
|
|
1338
|
+
const result = await client.exploreAPI(path);
|
|
1339
|
+
if (result.type === "directory") {
|
|
1340
|
+
return {
|
|
1341
|
+
success: true,
|
|
1342
|
+
type: "directory",
|
|
1343
|
+
path: result.path,
|
|
1344
|
+
items: result.items
|
|
1345
|
+
};
|
|
1346
|
+
} else {
|
|
1347
|
+
return {
|
|
1348
|
+
success: true,
|
|
1349
|
+
type: "function",
|
|
1350
|
+
name: result.name,
|
|
1351
|
+
description: result.description,
|
|
1352
|
+
definition: result.definition,
|
|
1353
|
+
group: result.group,
|
|
1354
|
+
path: result.path
|
|
1355
|
+
};
|
|
1356
|
+
}
|
|
1357
|
+
} catch (error) {
|
|
1358
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1359
|
+
return {
|
|
1360
|
+
success: false,
|
|
1361
|
+
path,
|
|
1362
|
+
error: message
|
|
1363
|
+
};
|
|
1345
1364
|
}
|
|
1346
|
-
}
|
|
1347
|
-
|
|
1348
|
-
success: false,
|
|
1349
|
-
error: error.message
|
|
1350
|
-
}, null, 2);
|
|
1351
|
-
}
|
|
1365
|
+
}));
|
|
1366
|
+
return JSON.stringify(results, null, 2);
|
|
1352
1367
|
}, "func")
|
|
1353
1368
|
};
|
|
1354
1369
|
}
|
|
@@ -1617,6 +1632,10 @@ exports.ClientCallbackError = ClientCallbackError;
|
|
|
1617
1632
|
exports.CodeGenerator = CodeGenerator;
|
|
1618
1633
|
exports.InProcessSession = InProcessSession;
|
|
1619
1634
|
exports.ToolNames = ToolNames;
|
|
1635
|
+
exports.createExecuteCodeTool = createExecuteCodeTool;
|
|
1636
|
+
exports.createExploreApiTool = createExploreApiTool;
|
|
1637
|
+
exports.createFetchAllApisTool = createFetchAllApisTool;
|
|
1638
|
+
exports.createSearchApiTool = createSearchApiTool;
|
|
1620
1639
|
exports.createToolsFromATPClient = createToolsFromATPClient;
|
|
1621
1640
|
exports.executeCodeInputSchema = executeCodeInputSchema;
|
|
1622
1641
|
exports.exploreApiInputSchema = exploreApiInputSchema;
|