@zeulewan/glueclaw-provider 1.2.2 → 1.3.0

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": "@zeulewan/glueclaw-provider",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "GlueClaw - Claude CLI subprocess provider for Max subscription",
5
5
  "type": "module",
6
6
  "engines": {
@@ -56,6 +56,7 @@ export async function runHealthcheck(opts: {
56
56
  "-p",
57
57
  "--output-format",
58
58
  "stream-json",
59
+ "--verbose",
59
60
  "--system-prompt",
60
61
  prompt,
61
62
  "--model",
package/src/stream.ts CHANGED
@@ -356,14 +356,46 @@ export function createClaudeCliStreamFn(opts: {
356
356
  continue;
357
357
  }
358
358
 
359
- // Complete assistant message - only use if we didn't get streaming deltas
359
+ // Assistant message may contain tool_use and/or text content blocks
360
360
  if (type === "assistant") {
361
- if (!started) {
362
- const content = data.message?.content;
363
- if (content) {
361
+ const content = data.message?.content;
362
+ if (content) {
363
+ // Emit tool call events for any tool_use blocks
364
+ for (const block of content) {
365
+ if (block.type === "tool_use") {
366
+ const b = block as {
367
+ type: string;
368
+ id: string;
369
+ name: string;
370
+ input: Record<string, unknown>;
371
+ };
372
+ startStream();
373
+ const toolCall = {
374
+ type: "toolCall" as const,
375
+ id: b.id,
376
+ name: b.name,
377
+ arguments: (b.input ?? {}) as Record<string, any>,
378
+ };
379
+ stream.push({
380
+ type: "toolcall_start",
381
+ contentIndex: 0,
382
+ toolName: b.name,
383
+ partial: buildMsg(info, text, buildUsage()),
384
+ } as any);
385
+ stream.push({
386
+ type: "toolcall_end",
387
+ contentIndex: 0,
388
+ toolCall,
389
+ partial: buildMsg(info, text, buildUsage()),
390
+ });
391
+ }
392
+ }
393
+
394
+ // Handle text blocks (only if we haven't streamed via deltas)
395
+ if (!streamed) {
364
396
  const textBlocks = content
365
- .filter((b) => b.type === "text" && b.text)
366
- .map((b) => b.text ?? "");
397
+ .filter((b: any) => b.type === "text" && b.text)
398
+ .map((b: any) => b.text ?? "");
367
399
  if (textBlocks.length > 0) {
368
400
  const fullText = textBlocks.join("\n");
369
401
  startStream();