@respan/cli 0.16.0 → 0.17.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.
@@ -2,6 +2,8 @@ import { BaseCommand } from '../../lib/base-command.js';
2
2
  export default class ToolsList extends BaseCommand {
3
3
  static description: string;
4
4
  static flags: {
5
+ category: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
+ categories: import("@oclif/core/interfaces").BooleanFlag<boolean>;
5
7
  'mcp-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
8
  'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
9
  'base-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -6,8 +6,26 @@ class ToolsList extends BaseCommand {
6
6
  const { flags } = await this.parse(ToolsList);
7
7
  this.globalFlags = flags;
8
8
  try {
9
- const tools = await withMcpClient(this.getAuth(), flags['mcp-url'], listMcpTools);
10
- this.outputResult(tools, ['name', 'description']);
9
+ let tools = await withMcpClient(this.getAuth(), flags['mcp-url'], listMcpTools);
10
+ const categoryOf = (tool) => typeof tool._meta?.['respan/category'] === 'string' ? tool._meta['respan/category'] : 'uncategorized';
11
+ const counts = new Map();
12
+ for (const tool of tools) {
13
+ const category = categoryOf(tool);
14
+ counts.set(category, (counts.get(category) ?? 0) + 1);
15
+ }
16
+ if (flags.category) {
17
+ if (!counts.has(flags.category))
18
+ throw new Error(`Unknown category '${flags.category}'. Available: ${[...counts.keys()].sort().join(', ')}`);
19
+ tools = tools.filter((tool) => categoryOf(tool) === flags.category);
20
+ }
21
+ if (flags.categories) {
22
+ const rows = [...counts].filter(([category]) => !flags.category || category === flags.category)
23
+ .sort(([a], [b]) => a.localeCompare(b)).map(([category, tool_count]) => ({ category, tool_count }));
24
+ this.outputResult(rows, ['category', 'tool_count']);
25
+ }
26
+ else {
27
+ this.outputResult(flags.json ? tools : tools.map((tool) => ({ ...tool, category: categoryOf(tool) })), ['category', 'name', 'description']);
28
+ }
11
29
  }
12
30
  catch (error) {
13
31
  this.handleError(error);
@@ -17,6 +35,8 @@ class ToolsList extends BaseCommand {
17
35
  ToolsList.description = 'List the current Respan MCP tools, their input schemas, and annotations.';
18
36
  ToolsList.flags = {
19
37
  ...BaseCommand.baseFlags,
38
+ category: Flags.string({ description: 'Filter by a category returned by the MCP server' }),
39
+ categories: Flags.boolean({ description: 'List available categories and tool counts instead of tools' }),
20
40
  'mcp-url': Flags.string({ description: 'Custom MCP server URL (defaults to the active Platform or Enterprise server)' }),
21
41
  };
22
42
  export default ToolsList;
@@ -3640,6 +3640,19 @@
3640
3640
  "allowNo": false,
3641
3641
  "type": "boolean"
3642
3642
  },
3643
+ "category": {
3644
+ "description": "Filter by a category returned by the MCP server",
3645
+ "name": "category",
3646
+ "hasDynamicHelp": false,
3647
+ "multiple": false,
3648
+ "type": "option"
3649
+ },
3650
+ "categories": {
3651
+ "description": "List available categories and tool counts instead of tools",
3652
+ "name": "categories",
3653
+ "allowNo": false,
3654
+ "type": "boolean"
3655
+ },
3643
3656
  "mcp-url": {
3644
3657
  "description": "Custom MCP server URL (defaults to the active Platform or Enterprise server)",
3645
3658
  "name": "mcp-url",
@@ -4272,5 +4285,5 @@
4272
4285
  ]
4273
4286
  }
4274
4287
  },
4275
- "version": "0.16.0"
4288
+ "version": "0.17.0"
4276
4289
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@respan/cli",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "Respan CLI - manage your LLM observability from the command line",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",