pi-provider-qoder-cn 0.2.27 → 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 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 |
package/dist/index.js CHANGED
@@ -3233,7 +3233,14 @@ function transformTools(tools) {
3233
3233
  function transformMessagesForQoder(messages) {
3234
3234
  const normalizedMessages = [];
3235
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
+ };
3236
3242
  for (const msg of messages) {
3243
+ if (msg.role !== "toolResult") flushToolImages();
3237
3244
  if (msg.role === "assistant" && (msg.stopReason === "error" || msg.stopReason === "aborted")) {
3238
3245
  const am = msg;
3239
3246
  if (Array.isArray(am.content)) {
@@ -3325,7 +3332,7 @@ function transformMessagesForQoder(messages) {
3325
3332
  });
3326
3333
  const images = getContentImages(tr);
3327
3334
  if (images.length > 0) {
3328
- normalizedMessages.push({
3335
+ pendingToolImages.push({
3329
3336
  role: "user",
3330
3337
  content: [
3331
3338
  {
@@ -3343,6 +3350,7 @@ function transformMessagesForQoder(messages) {
3343
3350
  }
3344
3351
  }
3345
3352
  }
3353
+ flushToolImages();
3346
3354
  return normalizedMessages;
3347
3355
  }
3348
3356
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-provider-qoder-cn",
3
- "version": "0.2.27",
3
+ "version": "0.2.28",
4
4
  "description": "Pi extension for Qoder CN — PAT/OAuth auth, /qoder-cn.usage quota command, and enterprise VPC endpoint support",
5
5
  "type": "module",
6
6
  "license": "MIT",