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.
@@ -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,MA2clB,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;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--) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-opencode-cohub",
3
- "version": "1.9.1",
3
+ "version": "1.9.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Mr-cjf/oh-my-opencode-cohub.git"