smithue-cli 0.11.0 → 0.11.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/client.d.ts CHANGED
@@ -20,7 +20,7 @@ export declare class SmithUEClient {
20
20
  ping(): Promise<{
21
21
  message: string;
22
22
  }>;
23
- listTools(domain?: string): Promise<SmithUEToolSchema[]>;
23
+ listTools(category?: string): Promise<SmithUEToolSchema[]>;
24
24
  getReady(): Promise<{
25
25
  ready: boolean;
26
26
  version?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE5E,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,OAAO,CAAS;gBAEZ,MAAM,EAAE,mBAAmB;IAMvC,OAAO,KAAK,OAAO,GAElB;IAED,OAAO,CAAC,OAAO;YAID,SAAS;YAwBT,QAAQ;YAQR,OAAO;IAOrB,OAAO,CAAC,qBAAqB;IAyBvB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAa/F,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAItG,IAAI,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAKpC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,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C;IAItG,IAAI,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAKpC,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAM1D,QAAQ,IAAI,OAAO,CAAC;QAAE,KAAK,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAI/E,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAS/B,mBAAmB,CACvB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACnC,OAAO,CAAC,sBAAsB,CAAC;IA6ClC,OAAO,CAAC,0BAA0B;YAmBpB,cAAc;IAe5B,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,QAAQ;YAIF,KAAK;CAGpB"}
package/dist/client.js CHANGED
@@ -84,14 +84,10 @@ export class SmithUEClient {
84
84
  const res = await this.execute('ping', {});
85
85
  return res.data;
86
86
  }
87
- async listTools(domain) {
88
- const res = await this.execute('list_tools', domain ? { domain } : {});
89
- if (domain) {
90
- const data = res.data;
91
- return data.tools;
92
- }
93
- // no domain filter - server returns {domains: [...]} not tools
94
- return [];
87
+ async listTools(category) {
88
+ const res = await this.execute('list_tools', category ? { category } : {});
89
+ const data = res.data;
90
+ return data.tools ?? [];
95
91
  }
96
92
  async getReady() {
97
93
  return this.getJson('/ready');
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/commands/search.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBpF"}
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/commands/search.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBpF"}
@@ -5,18 +5,14 @@ export async function searchCommand(keyword, opts) {
5
5
  try {
6
6
  const { port } = await discoverPort(opts);
7
7
  const client = new SmithUEClient({ host: '127.0.0.1', port });
8
- const domains = await client.listTools();
8
+ const tools = await client.listTools();
9
9
  const kw = keyword.toLowerCase();
10
10
  const matches = [];
11
- for (const domainTool of domains) {
12
- const domainName = domainTool.name;
13
- const tools = await client.listTools(domainName);
14
- for (const tool of tools) {
15
- const name = tool.name ?? '';
16
- const description = tool.description ?? '';
17
- if (name.toLowerCase().includes(kw) || description.toLowerCase().includes(kw)) {
18
- matches.push({ domain: domainName, name, description });
19
- }
11
+ for (const tool of tools) {
12
+ const name = tool.name ?? '';
13
+ const description = tool.description ?? '';
14
+ if (name.toLowerCase().includes(kw) || description.toLowerCase().includes(kw)) {
15
+ matches.push({ domain: tool.category ?? '', name, description });
20
16
  }
21
17
  }
22
18
  printResult(matches);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smithue-cli",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "type": "module",
5
5
  "main": "dist/cli.js",
6
6
  "scripts": {