@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.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';
@@ -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,GACvB,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"}
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
- path: z.string().describe('Path to explore (e.g., "/", "/openapi/github", "/mcp/filesystem/read_file")')
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 "/", "/openapi", "/openapi/github", or "/openapi/github/repos/createRepo" to see functions.',
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
- try {
1326
- const result = await client.exploreAPI(input.path);
1327
- if (result.type === "directory") {
1328
- return JSON.stringify({
1329
- success: true,
1330
- type: "directory",
1331
- path: result.path,
1332
- items: result.items
1333
- }, null, 2);
1334
- } else {
1335
- return JSON.stringify({
1336
- success: true,
1337
- type: "function",
1338
- name: result.name,
1339
- description: result.description,
1340
- definition: result.definition,
1341
- group: result.group,
1342
- path: result.path
1343
- }, null, 2);
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
- } catch (error) {
1346
- return JSON.stringify({
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