@wengine-ai/ccr-provider-qoder 0.3.0 → 0.3.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/card.js +37 -7
- package/dist/plugin.js +5 -1
- package/dist/plugin.json +1 -1
- package/package.json +1 -1
package/dist/card.js
CHANGED
|
@@ -16,6 +16,8 @@ var qoderLocales = {
|
|
|
16
16
|
patPlaceholder: "pt-\u2026",
|
|
17
17
|
connect: "Connect",
|
|
18
18
|
checkin: "Check in",
|
|
19
|
+
checkin_action: "Check in",
|
|
20
|
+
checkin_pending: "Checking in\u2026",
|
|
19
21
|
checkin_claimed: "Credits claimed",
|
|
20
22
|
checkin_done: "Already claimed today",
|
|
21
23
|
checkin_inactive: "No campaign today",
|
|
@@ -51,6 +53,8 @@ var qoderLocales = {
|
|
|
51
53
|
patPlaceholder: "pt-\u2026",
|
|
52
54
|
connect: "\u8FDE\u63A5",
|
|
53
55
|
checkin: "\u7B7E\u5230",
|
|
56
|
+
checkin_action: "\u7B7E\u5230",
|
|
57
|
+
checkin_pending: "\u7B7E\u5230\u4E2D\u2026",
|
|
54
58
|
checkin_claimed: "\u9886\u53D6\u6210\u529F",
|
|
55
59
|
checkin_done: "\u4ECA\u65E5\u5DF2\u9886",
|
|
56
60
|
checkin_inactive: "\u4ECA\u65E5\u65E0\u6D3B\u52A8",
|
|
@@ -208,6 +212,29 @@ function mount(el, props) {
|
|
|
208
212
|
button.onclick = fn;
|
|
209
213
|
return button;
|
|
210
214
|
};
|
|
215
|
+
const checkinButton = (section) => {
|
|
216
|
+
const pending = !!section.checkinPending;
|
|
217
|
+
const button = node("button", pending ? words.checkin_pending : words.checkin_action, "inline-flex h-8 w-full items-center justify-center gap-2 whitespace-nowrap rounded-xl border border-input bg-input/50 text-xs font-semibold shadow-sm hover:bg-input/80 disabled:pointer-events-none disabled:opacity-50");
|
|
218
|
+
button.type = "button";
|
|
219
|
+
button.disabled = disposed || props.disabled || sections.some((s) => s.busy) || section.status?.status !== "connected";
|
|
220
|
+
button.setAttribute("aria-busy", String(pending));
|
|
221
|
+
button.onclick = () => {
|
|
222
|
+
section.checkinPending = true;
|
|
223
|
+
void run(section, async () => {
|
|
224
|
+
try {
|
|
225
|
+
section.checkin = void 0;
|
|
226
|
+
try {
|
|
227
|
+
section.checkin = await call(section, "/checkin", {});
|
|
228
|
+
} catch {
|
|
229
|
+
section.checkin = { outcome: "failed" };
|
|
230
|
+
}
|
|
231
|
+
} finally {
|
|
232
|
+
section.checkinPending = false;
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
return button;
|
|
237
|
+
};
|
|
211
238
|
const renderSection = (section) => {
|
|
212
239
|
const panel = node("div", "", "space-y-3 border-t border-border pt-4 first:border-t-0 first:pt-0");
|
|
213
240
|
panel.append(
|
|
@@ -241,14 +268,17 @@ function mount(el, props) {
|
|
|
241
268
|
await reconcile(section);
|
|
242
269
|
await refresh(section);
|
|
243
270
|
})));
|
|
244
|
-
if (section.site.id === "qoder-cn")
|
|
245
|
-
section
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
271
|
+
if (section.site.id === "qoder-cn") {
|
|
272
|
+
panel.append(checkinButton(section));
|
|
273
|
+
if (section.checkin) {
|
|
274
|
+
const result = section.checkin;
|
|
275
|
+
const amount = result.credit;
|
|
276
|
+
const detail = result.outcome === "claimed" && typeof amount === "number" && Number.isFinite(amount) && amount > 0 ? lang === "zh" ? `+${amount} \u79EF\u5206` : `+${amount} credits` : words[`checkin_${result.outcome}`] ?? words.checkin_failed;
|
|
277
|
+
const note = node("p", detail + (result.outcome === "failed" && result.message ? `: ${result.message}` : ""), result.outcome === "failed" ? "text-destructive" : "text-xs text-muted-foreground");
|
|
278
|
+
note.setAttribute("role", "status");
|
|
279
|
+
panel.append(note);
|
|
250
280
|
}
|
|
251
|
-
}
|
|
281
|
+
}
|
|
252
282
|
buttons.append(action(section, "usage", () => void run(section, async () => {
|
|
253
283
|
section.usage = await call(section, "/usage", {});
|
|
254
284
|
})));
|
package/dist/plugin.js
CHANGED
|
@@ -2552,6 +2552,8 @@ var qoderLocales = {
|
|
|
2552
2552
|
patPlaceholder: "pt-\u2026",
|
|
2553
2553
|
connect: "Connect",
|
|
2554
2554
|
checkin: "Check in",
|
|
2555
|
+
checkin_action: "Check in",
|
|
2556
|
+
checkin_pending: "Checking in\u2026",
|
|
2555
2557
|
checkin_claimed: "Credits claimed",
|
|
2556
2558
|
checkin_done: "Already claimed today",
|
|
2557
2559
|
checkin_inactive: "No campaign today",
|
|
@@ -2587,6 +2589,8 @@ var qoderLocales = {
|
|
|
2587
2589
|
patPlaceholder: "pt-\u2026",
|
|
2588
2590
|
connect: "\u8FDE\u63A5",
|
|
2589
2591
|
checkin: "\u7B7E\u5230",
|
|
2592
|
+
checkin_action: "\u7B7E\u5230",
|
|
2593
|
+
checkin_pending: "\u7B7E\u5230\u4E2D\u2026",
|
|
2590
2594
|
checkin_claimed: "\u9886\u53D6\u6210\u529F",
|
|
2591
2595
|
checkin_done: "\u4ECA\u65E5\u5DF2\u9886",
|
|
2592
2596
|
checkin_inactive: "\u4ECA\u65E5\u65E0\u6D3B\u52A8",
|
|
@@ -2609,7 +2613,7 @@ var qoderLocales = {
|
|
|
2609
2613
|
};
|
|
2610
2614
|
|
|
2611
2615
|
// src/plugin.ts
|
|
2612
|
-
var manifest = { name: "qoder", version: "0.3.
|
|
2616
|
+
var manifest = { name: "qoder", version: "0.3.1", coreApi: "1", description: "Qoder (qoder.com / qoder.cn) subscription provider with PAT sign-in, model management and usage." };
|
|
2613
2617
|
function activatedTransformer(site, service) {
|
|
2614
2618
|
return class ActivatedQoderTransformer extends QoderTransformer {
|
|
2615
2619
|
static TransformerName = site;
|
package/dist/plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wengine-ai/ccr-provider-qoder",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Qoder subscription provider (qoder.com and qoder.cn): Personal Access Token sign-in, fixed agent_chat_generation upstream, model management and usage.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/plugin.js",
|