@diegopetrucci/pi-brrr 0.1.4 → 0.1.5

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
- 0.79.10
1
+ 0.80.3
package/index.ts CHANGED
@@ -159,8 +159,9 @@ function extractTextContent(content: unknown): string {
159
159
  }
160
160
  if (typeof part !== "object" || part === null) continue;
161
161
 
162
- const maybeText = (part as { text?: unknown }).text;
163
- if (typeof maybeText === "string") parts.push(maybeText);
162
+ const typedPart = part as { type?: unknown; text?: unknown };
163
+ if (typedPart.type !== undefined && typedPart.type !== "text") continue;
164
+ if (typeof typedPart.text === "string") parts.push(typedPart.text);
164
165
  }
165
166
 
166
167
  return parts.join("\n");
@@ -173,7 +174,7 @@ function lastAssistantMessage(messages: readonly unknown[]): string | undefined
173
174
  if ((message as { role?: unknown }).role !== "assistant") continue;
174
175
 
175
176
  const text = extractTextContent((message as { content?: unknown }).content).trim();
176
- if (text) return text;
177
+ return text || undefined;
177
178
  }
178
179
 
179
180
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diegopetrucci/pi-brrr",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "A pi extension that sends brrr push notifications when pi is ready for input.",
5
5
  "keywords": [
6
6
  "pi-package",