easyclaw-link 1.4.1 → 1.4.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/index.js +14 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4198,6 +4198,14 @@ async function saasRunAction(serviceId, inputJson, options = {}) {
|
|
|
4198
4198
|
}
|
|
4199
4199
|
const data = await res.json();
|
|
4200
4200
|
const taskId = data.task?.id;
|
|
4201
|
+
if (!taskId) {
|
|
4202
|
+
if (options.json) {
|
|
4203
|
+
console.log(JSON.stringify(data, null, 2));
|
|
4204
|
+
return;
|
|
4205
|
+
}
|
|
4206
|
+
console.error("\u274C \u63D0\u4EA4\u6210\u529F\u4F46\u672A\u8FD4\u56DE task ID\uFF0C\u8BF7\u7A0D\u540E\u7528 `tasks-history` \u67E5\u770B");
|
|
4207
|
+
process.exit(1);
|
|
4208
|
+
}
|
|
4201
4209
|
if (!options.wait) {
|
|
4202
4210
|
if (options.json) {
|
|
4203
4211
|
console.log(JSON.stringify(data, null, 2));
|
|
@@ -4222,7 +4230,11 @@ async function saasRunAction(serviceId, inputJson, options = {}) {
|
|
|
4222
4230
|
process.exit(1);
|
|
4223
4231
|
}
|
|
4224
4232
|
const pollData = await pollRes.json();
|
|
4225
|
-
const task = pollData.task ?? pollData;
|
|
4233
|
+
const task = pollData.task ?? (typeof pollData === "object" && "status" in pollData ? pollData : void 0);
|
|
4234
|
+
if (!task) {
|
|
4235
|
+
console.error("\u274C \u8F6E\u8BE2\u54CD\u5E94\u683C\u5F0F\u5F02\u5E38");
|
|
4236
|
+
process.exit(1);
|
|
4237
|
+
}
|
|
4226
4238
|
if (TERMINAL_STATUSES.includes(String(task.status))) {
|
|
4227
4239
|
if (options.json) {
|
|
4228
4240
|
console.log(JSON.stringify(pollData, null, 2));
|
|
@@ -4730,7 +4742,7 @@ async function radioUploadAction(stationId, filePath, options) {
|
|
|
4730
4742
|
|
|
4731
4743
|
// src/index.ts
|
|
4732
4744
|
var program2 = new Command();
|
|
4733
|
-
program2.name("easyclaw-link").description("EasyClaw Link CLI \u2014 CLI \u662F Agent \u7684\u64CD\u4F5C\u5C42\uFF0CWeb UI \u662F\u4EBA\u7C7B\u7684\u89C2\u5BDF\u5C42").version("1.4.
|
|
4745
|
+
program2.name("easyclaw-link").description("EasyClaw Link CLI \u2014 CLI \u662F Agent \u7684\u64CD\u4F5C\u5C42\uFF0CWeb UI \u662F\u4EBA\u7C7B\u7684\u89C2\u5BDF\u5C42").version("1.4.2");
|
|
4734
4746
|
program2.command("login").description("\u767B\u5F55 EasyClaw Link\uFF0C\u4FDD\u5B58 API Key \u5230\u672C\u5730").action(loginAction);
|
|
4735
4747
|
program2.command("logout").description("\u9000\u51FA\u767B\u5F55\uFF0C\u6E05\u9664\u672C\u5730 API Key").action(logoutAction);
|
|
4736
4748
|
program2.command("whoami").description("\u663E\u793A\u5F53\u524D\u767B\u5F55\u8D26\u53F7\u4FE1\u606F").option("--json", "JSON \u8F93\u51FA").action(() => whoamiAction());
|