smithue-cli 0.10.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/cli.js +4 -4
- package/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -8
- package/dist/commands/exec.d.ts +1 -3
- package/dist/commands/exec.d.ts.map +1 -1
- package/dist/commands/exec.js +1 -5
- package/dist/commands/list.d.ts +0 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +1 -5
- package/dist/commands/search.d.ts +0 -1
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +7 -15
- package/dist/commands/status.d.ts +0 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +0 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -52,7 +52,7 @@ program
|
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
await execCommand(command, parsedParams, { ...globals
|
|
55
|
+
await execCommand(command, parsedParams, { ...globals });
|
|
56
56
|
});
|
|
57
57
|
// ---------------------------------------------------------------------------
|
|
58
58
|
// list
|
|
@@ -62,7 +62,7 @@ program
|
|
|
62
62
|
.description('List available tools, optionally filtered by domain')
|
|
63
63
|
.action(async (domain) => {
|
|
64
64
|
const globals = program.opts();
|
|
65
|
-
await listCommand(domain, { ...globals
|
|
65
|
+
await listCommand(domain, { ...globals });
|
|
66
66
|
});
|
|
67
67
|
// ---------------------------------------------------------------------------
|
|
68
68
|
// search
|
|
@@ -72,7 +72,7 @@ program
|
|
|
72
72
|
.description('Search tools by keyword')
|
|
73
73
|
.action(async (keyword) => {
|
|
74
74
|
const globals = program.opts();
|
|
75
|
-
await searchCommand(keyword, { ...globals
|
|
75
|
+
await searchCommand(keyword, { ...globals });
|
|
76
76
|
});
|
|
77
77
|
// ---------------------------------------------------------------------------
|
|
78
78
|
// status
|
|
@@ -83,7 +83,7 @@ program
|
|
|
83
83
|
.option('--wait <seconds>', 'wait up to N seconds for editor to be ready', parseInt)
|
|
84
84
|
.action(async (cmdOpts) => {
|
|
85
85
|
const globals = program.opts();
|
|
86
|
-
await statusCommand({ ...globals, wait: cmdOpts.wait
|
|
86
|
+
await statusCommand({ ...globals, wait: cmdOpts.wait });
|
|
87
87
|
});
|
|
88
88
|
// ---------------------------------------------------------------------------
|
|
89
89
|
// use
|
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(
|
|
23
|
+
listTools(category?: string): Promise<SmithUEToolSchema[]>;
|
|
24
24
|
getReady(): Promise<{
|
|
25
25
|
ready: boolean;
|
|
26
26
|
version?: string;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -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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,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(
|
|
88
|
-
const res = await this.execute('list_tools',
|
|
89
|
-
|
|
90
|
-
|
|
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');
|
package/dist/commands/exec.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { type DiscoverOpts } from '../portfile.js';
|
|
2
|
-
export
|
|
3
|
-
cliVersion?: string;
|
|
4
|
-
}
|
|
2
|
+
export type ExecOpts = DiscoverOpts;
|
|
5
3
|
export declare function execCommand(command: string, params: Record<string, unknown>, opts?: ExecOpts): Promise<void>;
|
|
6
4
|
//# sourceMappingURL=exec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../src/commands/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../src/commands/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAIjE,MAAM,MAAM,QAAQ,GAAG,YAAY,CAAC;AAEpC,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,IAAI,GAAE,QAAa,GAClB,OAAO,CAAC,IAAI,CAAC,CASf"}
|
package/dist/commands/exec.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { discoverPort } from '../portfile.js';
|
|
2
2
|
import { SmithUEClient } from '../client.js';
|
|
3
3
|
import { printResult, printError } from '../output.js';
|
|
4
|
-
import { checkVersionCompat } from '../version-check.js';
|
|
5
4
|
export async function execCommand(command, params, opts = {}) {
|
|
6
5
|
try {
|
|
7
|
-
const
|
|
8
|
-
if (opts.cliVersion)
|
|
9
|
-
checkVersionCompat(opts.cliVersion, discovered.plugin_version);
|
|
10
|
-
const { port } = discovered;
|
|
6
|
+
const { port } = await discoverPort(opts);
|
|
11
7
|
const client = new SmithUEClient({ host: '127.0.0.1', port });
|
|
12
8
|
const result = await client.executeCommand(command, params);
|
|
13
9
|
printResult(result);
|
package/dist/commands/list.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,QAAQ;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAS3F"}
|
package/dist/commands/list.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { discoverPort } from '../portfile.js';
|
|
2
2
|
import { SmithUEClient } from '../client.js';
|
|
3
3
|
import { printResult, printError } from '../output.js';
|
|
4
|
-
import { checkVersionCompat } from '../version-check.js';
|
|
5
4
|
export async function listCommand(domain, opts) {
|
|
6
5
|
try {
|
|
7
|
-
const
|
|
8
|
-
if (opts.cliVersion)
|
|
9
|
-
checkVersionCompat(opts.cliVersion, discovered.plugin_version);
|
|
10
|
-
const { port } = discovered;
|
|
6
|
+
const { port } = await discoverPort(opts);
|
|
11
7
|
const client = new SmithUEClient({ host: '127.0.0.1', port });
|
|
12
8
|
const result = await client.listTools(domain);
|
|
13
9
|
printResult(result);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/commands/search.ts"],"names":[],"mappings":"
|
|
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"}
|
package/dist/commands/search.js
CHANGED
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
import { discoverPort } from '../portfile.js';
|
|
2
2
|
import { SmithUEClient } from '../client.js';
|
|
3
3
|
import { printResult, printError } from '../output.js';
|
|
4
|
-
import { checkVersionCompat } from '../version-check.js';
|
|
5
4
|
export async function searchCommand(keyword, opts) {
|
|
6
5
|
try {
|
|
7
|
-
const
|
|
8
|
-
if (opts.cliVersion)
|
|
9
|
-
checkVersionCompat(opts.cliVersion, discovered.plugin_version);
|
|
10
|
-
const { port } = discovered;
|
|
6
|
+
const { port } = await discoverPort(opts);
|
|
11
7
|
const client = new SmithUEClient({ host: '127.0.0.1', port });
|
|
12
|
-
const
|
|
8
|
+
const tools = await client.listTools();
|
|
13
9
|
const kw = keyword.toLowerCase();
|
|
14
10
|
const matches = [];
|
|
15
|
-
for (const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const description = tool.description ?? '';
|
|
21
|
-
if (name.toLowerCase().includes(kw) || description.toLowerCase().includes(kw)) {
|
|
22
|
-
matches.push({ domain: domainName, name, description });
|
|
23
|
-
}
|
|
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 });
|
|
24
16
|
}
|
|
25
17
|
}
|
|
26
18
|
printResult(matches);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.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;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAMD,wBAAsB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA+CnE"}
|
package/dist/commands/status.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { SmithUEClient } from '../client.js';
|
|
2
2
|
import { discoverPort, SmithUEError } from '../portfile.js';
|
|
3
3
|
import { printResult, printError } from '../output.js';
|
|
4
|
-
import { checkVersionCompat } from '../version-check.js';
|
|
5
4
|
async function sleep(ms) {
|
|
6
5
|
await new Promise((resolve) => setTimeout(resolve, ms));
|
|
7
6
|
}
|
|
8
7
|
export async function statusCommand(opts) {
|
|
9
8
|
try {
|
|
10
9
|
const discovered = await discoverPort(opts);
|
|
11
|
-
if (opts.cliVersion)
|
|
12
|
-
checkVersionCompat(opts.cliVersion, discovered.plugin_version);
|
|
13
10
|
const client = new SmithUEClient({ host: '127.0.0.1', port: discovered.port });
|
|
14
11
|
if (opts.wait !== undefined && opts.wait > 0) {
|
|
15
12
|
const timeoutMs = opts.wait * 1000;
|