oh-my-opencode-cohub 1.12.12 → 1.12.13

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/cli/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  // package.json
3
- var version = "1.12.12";
3
+ var version = "1.12.13";
4
4
 
5
5
  // src/cli/config-io.ts
6
6
  import * as fs from "node:fs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAyHlD,QAAA,MAAM,WAAW,EAAE,MAyflB,CAAC;AAEF,eAAO,MAAM,MAAM,QAAc,CAAC;AAClC,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAyHlD,QAAA,MAAM,WAAW,EAAE,MA4flB,CAAC;AAEF,eAAO,MAAM,MAAM,QAAc,CAAC;AAClC,eAAe,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -2012,13 +2012,17 @@ var CoHubPlugin = async (input, options) => {
2012
2012
  if (output.messages) {
2013
2013
  for (let d = 0;d < output.messages.length; d++) {
2014
2014
  const msg = output.messages[d];
2015
+ if (msg.info?.role !== "user")
2016
+ continue;
2015
2017
  const parts = msg.parts;
2016
2018
  if (!parts || !Array.isArray(parts) || parts.length === 0) {
2017
- appendLog("messages.transform", `⚠️ 消息[${d}] role=${msg.info?.role ?? "?"} parts为空`);
2019
+ msg.parts = [{ type: "text", text: " " }];
2020
+ appendLog("messages.transform", `⚠️ 消息[${d}] role=user parts为空,已推入占位text part`);
2018
2021
  } else {
2019
2022
  const hasTextPart = parts.some((p) => p.type === "text");
2020
- if (!hasTextPart && msg.info?.role === "user") {
2021
- appendLog("messages.transform", `⚠️ 消息[${d}] role=user parts无text类型, types=[${parts.map((p) => p.type).join(",")}]`);
2023
+ if (!hasTextPart) {
2024
+ msg.parts.push({ type: "text", text: " " });
2025
+ appendLog("messages.transform", `⚠️ 消息[${d}] role=user parts无text类型(types=[${parts.map((p) => p.type).join(",")}]),已推入占位text part`);
2022
2026
  }
2023
2027
  }
2024
2028
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode-cohub",
3
- "version": "1.12.12",
3
+ "version": "1.12.13",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Mr-cjf/oh-my-opencode-cohub.git"