easyclaw-link 2.2.3 → 2.2.4
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 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2977,14 +2977,14 @@ async function loginAction(options = {}) {
|
|
|
2977
2977
|
}
|
|
2978
2978
|
let welcomeInfo = { username: "", credits: 0, reputation: 0, level_num: 1 };
|
|
2979
2979
|
try {
|
|
2980
|
-
const infoRes = await fetch(`${BASE_URL}/api/me`, { headers: { Authorization: `Bearer ${apiKey}` } });
|
|
2980
|
+
const infoRes = await fetch(`${BASE_URL}/api/auth/me`, { headers: { Authorization: `Bearer ${apiKey}` } });
|
|
2981
2981
|
if (infoRes.ok) {
|
|
2982
2982
|
const me = await infoRes.json();
|
|
2983
2983
|
welcomeInfo = {
|
|
2984
|
-
username: me.username || "",
|
|
2985
|
-
credits: me.credits || 0,
|
|
2986
|
-
reputation: me.reputation || 0,
|
|
2987
|
-
level_num: me.level_num || 1
|
|
2984
|
+
username: me.user?.username || "",
|
|
2985
|
+
credits: me.user?.credits || 0,
|
|
2986
|
+
reputation: me.user?.reputation || 0,
|
|
2987
|
+
level_num: me.user?.level_num || 1
|
|
2988
2988
|
};
|
|
2989
2989
|
}
|
|
2990
2990
|
} catch {
|
|
@@ -4041,8 +4041,8 @@ async function skillViewAction(id, options) {
|
|
|
4041
4041
|
console.log(`\u72B6\u6001: ${asset.status}`);
|
|
4042
4042
|
console.log(`\u5206\u7C7B: ${asset.category || "-"}`);
|
|
4043
4043
|
console.log(`\u4F5C\u8005: ${asset.author_username || "-"}`);
|
|
4044
|
-
console.log(`\u2B50 \u70B9\u8D5E: ${asset.
|
|
4045
|
-
console.log(`\u{1F4DE} \u8C03\u7528: ${asset.
|
|
4044
|
+
console.log(`\u2B50 \u70B9\u8D5E: ${asset.stars ?? 0}`);
|
|
4045
|
+
console.log(`\u{1F4DE} \u8C03\u7528: ${asset.calls ?? 0}`);
|
|
4046
4046
|
if (asset.tags?.length)
|
|
4047
4047
|
console.log(`\u6807\u7B7E: ${asset.tags.join(", ")}`);
|
|
4048
4048
|
if (asset.description)
|
|
@@ -4758,7 +4758,9 @@ async function doctorMsgAction(id, text, options) {
|
|
|
4758
4758
|
// src/commands/saas.ts
|
|
4759
4759
|
async function saasServicesAction(options) {
|
|
4760
4760
|
const apiKey = requireApiKey();
|
|
4761
|
-
const
|
|
4761
|
+
const parsed = parseInt(options.limit || "20", 10);
|
|
4762
|
+
const limit = isNaN(parsed) || parsed <= 0 ? 20 : Math.min(parsed, 50);
|
|
4763
|
+
const res = await fetchWithRetry(`${BASE_URL}/api/saas/services?limit=${limit}`, {
|
|
4762
4764
|
headers: { Authorization: `Bearer ${apiKey}` }
|
|
4763
4765
|
});
|
|
4764
4766
|
await assertOk(res);
|
|
@@ -4768,7 +4770,7 @@ async function saasServicesAction(options) {
|
|
|
4768
4770
|
return;
|
|
4769
4771
|
}
|
|
4770
4772
|
const services = data.services ?? [];
|
|
4771
|
-
console.log(`\u{1F6E0}\uFE0F SaaS \u6280\u80FD\u670D\u52A1 (${services.length} \u4E2A)
|
|
4773
|
+
console.log(`\u{1F6E0}\uFE0F SaaS \u6280\u80FD\u670D\u52A1 (${services.length} \u4E2A\uFF0C\u5F53\u524D\u663E\u793A --limit ${limit}\uFF0C\u6700\u5927 50)
|
|
4772
4774
|
`);
|
|
4773
4775
|
for (const s of services) {
|
|
4774
4776
|
const price = s.price_per_unit ? `${s.price_per_unit}\u{1F99E}/${s.unit_label || "\u6B21"}` : "\u514D\u8D39";
|
|
@@ -5497,7 +5499,7 @@ doctorCmd.command("view <id>").description("\u67E5\u770B\u75C5\u4F8B\u8BE6\u60C5
|
|
|
5497
5499
|
doctorCmd.command("accept <id>").description("\u63A5\u8BCA\uFF08\u533B\u751F\u64CD\u4F5C\uFF09").option("--json", "JSON \u8F93\u51FA").action((id, o) => doctorAcceptAction(id, o));
|
|
5498
5500
|
doctorCmd.command("resolve <id>").description("\u7ED3\u6848").option("--json", "JSON \u8F93\u51FA").action((id, o) => doctorResolveAction(id, o));
|
|
5499
5501
|
doctorCmd.command("msg <id> <text>").description("\u5728\u75C5\u4F8B\u4E2D\u53D1\u6D88\u606F").option("--json", "JSON \u8F93\u51FA").action((id, t, o) => doctorMsgAction(id, t, o));
|
|
5500
|
-
program2.command("services").description("\u67E5\u770B\u6240\u6709 SaaS \u6280\u80FD\u670D\u52A1").option("--json", "JSON \u8F93\u51FA").action((o) => saasServicesAction(o));
|
|
5502
|
+
program2.command("services").description("\u67E5\u770B\u6240\u6709 SaaS \u6280\u80FD\u670D\u52A1").option("--json", "JSON \u8F93\u51FA").option("--limit <n>", "\u8FD4\u56DE\u6570\u91CF\uFF08\u9ED8\u8BA4 20\uFF0C\u6700\u5927 50\uFF09", "20").action((o) => saasServicesAction(o));
|
|
5501
5503
|
program2.command("run <serviceId> [input]").description("\u8C03\u7528 SaaS \u6280\u80FD\uFF0C\u63D0\u4EA4\u4EFB\u52A1").option("--units <n>", "\u5355\u4F4D\u6570\u91CF").option("--wait", "\u7B49\u5F85\u4EFB\u52A1\u5B8C\u6210\u540E\u8F93\u51FA\u7ED3\u679C\uFF08\u8F6E\u8BE2\uFF09").option("--timeout <\u79D2>", "--wait \u6A21\u5F0F\u6700\u957F\u7B49\u5F85\u79D2\u6570", "120").option("--json", "JSON \u8F93\u51FA").action((id, input, o) => saasRunAction(id, input, o));
|
|
5502
5504
|
program2.command("tasks-history").description("\u67E5\u770B SaaS \u4EFB\u52A1\u8BB0\u5F55").option("--limit <n>", "\u6761\u6570\u9650\u5236", "20").option("--json", "JSON \u8F93\u51FA").action((o) => saasTasksAction(o));
|
|
5503
5505
|
program2.command("task <taskId>").description("\u67E5\u770B SaaS \u4EFB\u52A1\u7ED3\u679C").option("--json", "JSON \u8F93\u51FA").action((id, o) => saasTaskViewAction(id, o));
|