pi-provider-qoder-cn 0.2.26 → 0.2.28
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/README.md +15 -0
- package/dist/index.js +15 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,6 +14,16 @@ load order (last wins), so keep this package listed last or uninstall upstream.
|
|
|
14
14
|
pi install npm:pi-provider-qoder-cn
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
+
If your npm registry is a mirror (for example `registry.npmmirror.com`), it may
|
|
18
|
+
lag behind the official registry by hours. A release that shows as green on
|
|
19
|
+
GitHub but is missing from `npm view` is usually this, not a failed publish.
|
|
20
|
+
Check the official source directly and install with an explicit registry:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm view pi-provider-qoder-cn version --registry=https://registry.npmjs.org/
|
|
24
|
+
npm install pi-provider-qoder-cn@latest --registry=https://registry.npmjs.org/
|
|
25
|
+
```
|
|
26
|
+
|
|
17
27
|
## What this fork adds
|
|
18
28
|
|
|
19
29
|
| Feature | Upstream | This fork |
|
|
@@ -183,6 +193,11 @@ The provider list is re-registered in the running session, so the change is usab
|
|
|
183
193
|
in `/model` immediately — no restart. Append `list` to print the models pi currently
|
|
184
194
|
has cached, without touching the network.
|
|
185
195
|
|
|
196
|
+
Models offered only in the `app` group are included too. QoDuck (`lmodel`), for
|
|
197
|
+
example, is a selectable free model in both regions that the `chat` group omits;
|
|
198
|
+
entries already present in `chat` are not duplicated, and UI-only tiers from other
|
|
199
|
+
groups (`Performance`, `Premium`, ...) stay out of the picker.
|
|
200
|
+
|
|
186
201
|
The catalog key is a slot, not a model: upstream has served Kimi-K2.6 through
|
|
187
202
|
Kimi-K3.1-Pro under `kmodel_latest`. Ids are therefore slugs of the display name, so
|
|
188
203
|
an upgrade arrives as a new id (`kimi-k3` -> `kimi-k3.1-pro`) and a model upstream
|
package/dist/index.js
CHANGED
|
@@ -617,9 +617,14 @@ async function updateQoderModelsCache(authToken, userID, name, email, mode) {
|
|
|
617
617
|
const resData = await response.json();
|
|
618
618
|
const chatModels = resData.chat || [];
|
|
619
619
|
if (chatModels.length === 0) return null;
|
|
620
|
+
const chatKeys = new Set(chatModels.map((entry) => entry.key));
|
|
621
|
+
const appOnlyModels = (resData.app || []).filter(
|
|
622
|
+
(entry) => entry.key && !chatKeys.has(entry.key) && entry.enable && entry.display_name
|
|
623
|
+
);
|
|
624
|
+
const catalogModels = [...chatModels, ...appOnlyModels];
|
|
620
625
|
const newModels = [];
|
|
621
626
|
const configs = {};
|
|
622
|
-
for (const entry of
|
|
627
|
+
for (const entry of catalogModels) {
|
|
623
628
|
const key = entry.key;
|
|
624
629
|
if (!key || !entry.enable || !entry.display_name) continue;
|
|
625
630
|
const display = entry.display_name;
|
|
@@ -3228,7 +3233,14 @@ function transformTools(tools) {
|
|
|
3228
3233
|
function transformMessagesForQoder(messages) {
|
|
3229
3234
|
const normalizedMessages = [];
|
|
3230
3235
|
const droppedToolCallIds = /* @__PURE__ */ new Set();
|
|
3236
|
+
const pendingToolImages = [];
|
|
3237
|
+
const flushToolImages = () => {
|
|
3238
|
+
if (pendingToolImages.length === 0) return;
|
|
3239
|
+
normalizedMessages.push(...pendingToolImages);
|
|
3240
|
+
pendingToolImages.length = 0;
|
|
3241
|
+
};
|
|
3231
3242
|
for (const msg of messages) {
|
|
3243
|
+
if (msg.role !== "toolResult") flushToolImages();
|
|
3232
3244
|
if (msg.role === "assistant" && (msg.stopReason === "error" || msg.stopReason === "aborted")) {
|
|
3233
3245
|
const am = msg;
|
|
3234
3246
|
if (Array.isArray(am.content)) {
|
|
@@ -3320,7 +3332,7 @@ function transformMessagesForQoder(messages) {
|
|
|
3320
3332
|
});
|
|
3321
3333
|
const images = getContentImages(tr);
|
|
3322
3334
|
if (images.length > 0) {
|
|
3323
|
-
|
|
3335
|
+
pendingToolImages.push({
|
|
3324
3336
|
role: "user",
|
|
3325
3337
|
content: [
|
|
3326
3338
|
{
|
|
@@ -3338,6 +3350,7 @@ function transformMessagesForQoder(messages) {
|
|
|
3338
3350
|
}
|
|
3339
3351
|
}
|
|
3340
3352
|
}
|
|
3353
|
+
flushToolImages();
|
|
3341
3354
|
return normalizedMessages;
|
|
3342
3355
|
}
|
|
3343
3356
|
|
package/package.json
CHANGED