oh-my-opencode-cohub 1.9.1 → 1.9.2
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/index.d.ts.map +1 -1
- package/dist/index.js +13 -0
- package/package.json +1 -1
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;AA0IlD,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;AA0IlD,QAAA,MAAM,WAAW,EAAE,MA8dlB,CAAC;AAEF,eAAO,MAAM,MAAM,QAAc,CAAC;AAClC,eAAe,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2340,6 +2340,18 @@ var CoHubPlugin = async (input, options) => {
|
|
|
2340
2340
|
return m[2];
|
|
2341
2341
|
return;
|
|
2342
2342
|
}
|
|
2343
|
+
function filterEmptyMessages(messages) {
|
|
2344
|
+
return messages.filter((msg) => {
|
|
2345
|
+
const parts = msg.parts;
|
|
2346
|
+
if (!parts || parts.length === 0)
|
|
2347
|
+
return false;
|
|
2348
|
+
return parts.some((p) => {
|
|
2349
|
+
if (p.type === "text")
|
|
2350
|
+
return (p.text ?? "").trim().length > 0;
|
|
2351
|
+
return true;
|
|
2352
|
+
});
|
|
2353
|
+
});
|
|
2354
|
+
}
|
|
2343
2355
|
function extractSessionIdFromEvent(props) {
|
|
2344
2356
|
if (!props || typeof props !== "object")
|
|
2345
2357
|
return;
|
|
@@ -2497,6 +2509,7 @@ var CoHubPlugin = async (input, options) => {
|
|
|
2497
2509
|
try {
|
|
2498
2510
|
if (!output.messages || !Array.isArray(output.messages))
|
|
2499
2511
|
return;
|
|
2512
|
+
output.messages = filterEmptyMessages(output.messages);
|
|
2500
2513
|
let lastUserMsg;
|
|
2501
2514
|
let sessionID;
|
|
2502
2515
|
for (let i = output.messages.length - 1;i >= 0; i--) {
|