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 +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -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,
|
|
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
|
-
|
|
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
|
|
2021
|
-
|
|
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
|
}
|