easyclaw-link 1.9.2 → 1.9.3
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 +12 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4538,7 +4538,7 @@ async function agentCallAction(username, intent, dataJson, options = {}) {
|
|
|
4538
4538
|
console.error("\u274C `dataJson` \u548C `--data-file` \u4E0D\u80FD\u540C\u65F6\u4F7F\u7528\uFF0C\u8BF7\u9009\u5176\u4E00");
|
|
4539
4539
|
process.exit(1);
|
|
4540
4540
|
}
|
|
4541
|
-
const
|
|
4541
|
+
const params = { "x-easyclaw-intent": intent };
|
|
4542
4542
|
if (options.dataFile) {
|
|
4543
4543
|
if (!fs8.existsSync(options.dataFile)) {
|
|
4544
4544
|
console.error(`\u274C \u6587\u4EF6\u4E0D\u5B58\u5728: ${options.dataFile}`);
|
|
@@ -4552,17 +4552,23 @@ async function agentCallAction(username, intent, dataJson, options = {}) {
|
|
|
4552
4552
|
}
|
|
4553
4553
|
const raw = fs8.readFileSync(options.dataFile, "utf-8");
|
|
4554
4554
|
try {
|
|
4555
|
-
|
|
4555
|
+
params.data = JSON.parse(raw);
|
|
4556
4556
|
} catch {
|
|
4557
|
-
|
|
4557
|
+
params.data = { text: raw };
|
|
4558
4558
|
}
|
|
4559
4559
|
} else if (dataJson) {
|
|
4560
4560
|
try {
|
|
4561
|
-
|
|
4561
|
+
params.data = JSON.parse(dataJson);
|
|
4562
4562
|
} catch {
|
|
4563
|
-
|
|
4563
|
+
params.data = { text: dataJson };
|
|
4564
4564
|
}
|
|
4565
4565
|
}
|
|
4566
|
+
const body = {
|
|
4567
|
+
jsonrpc: "2.0",
|
|
4568
|
+
id: Date.now(),
|
|
4569
|
+
method: intent,
|
|
4570
|
+
params
|
|
4571
|
+
};
|
|
4566
4572
|
console.log(`\u23F3 \u8C03\u7528 @${username} (intent: ${intent})...`);
|
|
4567
4573
|
const res = await fetchWithRetry(`${BASE_URL}/api/a2a/${username}`, {
|
|
4568
4574
|
method: "POST",
|
|
@@ -4870,7 +4876,7 @@ async function radioUploadAction(stationId, filePath, options) {
|
|
|
4870
4876
|
|
|
4871
4877
|
// src/index.ts
|
|
4872
4878
|
var program2 = new Command();
|
|
4873
|
-
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.9.
|
|
4879
|
+
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.9.3");
|
|
4874
4880
|
program2.command("login").description("\u767B\u5F55 EasyClaw Link\uFF0C\u4FDD\u5B58 API Key \u5230\u672C\u5730").action(loginAction);
|
|
4875
4881
|
program2.command("logout").description("\u9000\u51FA\u767B\u5F55\uFF0C\u6E05\u9664\u672C\u5730 API Key").action(logoutAction);
|
|
4876
4882
|
program2.command("whoami").description("\u663E\u793A\u5F53\u524D\u767B\u5F55\u8D26\u53F7\u4FE1\u606F").option("--json", "JSON \u8F93\u51FA").action(() => whoamiAction());
|