stpr 1.0.1 → 1.0.2
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 +22 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -87,6 +87,13 @@ var StepperClient = class {
|
|
|
87
87
|
}
|
|
88
88
|
return res.result;
|
|
89
89
|
}
|
|
90
|
+
async pollStatus(statusId) {
|
|
91
|
+
const res = await this.rpc("tools/poll-status", { statusId });
|
|
92
|
+
if (res.error) {
|
|
93
|
+
throw new Error(`tools/poll-status failed: ${res.error.message}`);
|
|
94
|
+
}
|
|
95
|
+
return res.result;
|
|
96
|
+
}
|
|
90
97
|
async getToolParams(toolName, args) {
|
|
91
98
|
const res = await this.rpc("tools/params", {
|
|
92
99
|
name: toolName,
|
|
@@ -243,7 +250,7 @@ async function registerClient(baseUrl, redirectUri) {
|
|
|
243
250
|
method: "POST",
|
|
244
251
|
headers: { "Content-Type": "application/json" },
|
|
245
252
|
body: JSON.stringify({
|
|
246
|
-
client_name: "
|
|
253
|
+
client_name: "stpr CLI",
|
|
247
254
|
redirect_uris: [redirectUri],
|
|
248
255
|
grant_types: ["authorization_code", "refresh_token"],
|
|
249
256
|
token_endpoint_auth_method: "none",
|
|
@@ -541,6 +548,8 @@ Commands:
|
|
|
541
548
|
use <name> Switch active skillset
|
|
542
549
|
whoami Show active skillset and server info
|
|
543
550
|
list [<service>] List available skills (optionally for a service). Use --verbose for inputSchema.
|
|
551
|
+
status <statusId> Poll the status of a component tool run
|
|
552
|
+
|
|
544
553
|
<service> List available skills for that service. Use --verbose for inputSchema.
|
|
545
554
|
|
|
546
555
|
<service> <action> (-i <json> | stdin)
|
|
@@ -751,6 +760,18 @@ async function main() {
|
|
|
751
760
|
}
|
|
752
761
|
const client = new StepperClient(token, resolvedBaseUrl);
|
|
753
762
|
await client.initialize();
|
|
763
|
+
if (subcommand === "status") {
|
|
764
|
+
const statusId = args[0];
|
|
765
|
+
if (!statusId) {
|
|
766
|
+
die("Usage: stpr status <statusId>");
|
|
767
|
+
}
|
|
768
|
+
const result2 = await client.pollStatus(statusId);
|
|
769
|
+
if (result2.isError) {
|
|
770
|
+
die(result2.content.map((c) => c.text).join("\n"));
|
|
771
|
+
}
|
|
772
|
+
console.log(result2.content.map((c) => c.text).join("\n"));
|
|
773
|
+
return;
|
|
774
|
+
}
|
|
754
775
|
if (subcommand === "list") {
|
|
755
776
|
const service2 = args[0];
|
|
756
777
|
const tools = await client.listTools({ service: service2 ?? void 0 });
|