@hienlh/ppm 0.2.10 → 0.2.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hienlh/ppm",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "Personal Project Manager — mobile-first web IDE with AI assistance",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
@@ -84,15 +84,21 @@ export const chatWebSocket = {
84
84
 
85
85
  try {
86
86
  console.log(`[chat] session=${sessionId} sending message to provider=${providerId}`);
87
+ let eventCount = 0;
87
88
  for await (const event of chatService.sendMessage(
88
89
  providerId,
89
90
  sessionId,
90
91
  parsed.content,
91
92
  )) {
92
93
  if (abortController.signal.aborted) break;
94
+ eventCount++;
95
+ const evType = (event as any).type ?? "unknown";
96
+ if (evType === "error" || evType === "result") {
97
+ console.log(`[chat] session=${sessionId} event#${eventCount}: ${evType}`, JSON.stringify(event).slice(0, 300));
98
+ }
93
99
  ws.send(JSON.stringify(event));
94
100
  }
95
- console.log(`[chat] session=${sessionId} stream completed`);
101
+ console.log(`[chat] session=${sessionId} stream completed (${eventCount} events)`);
96
102
  } catch (e) {
97
103
  console.error(`[chat] session=${sessionId} error:`, (e as Error).message);
98
104
  if (!abortController.signal.aborted) {