sharkbait 1.0.14 → 1.0.15

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.
Files changed (2) hide show
  1. package/dist/cli.js +16 -5
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -468,6 +468,7 @@ class AzureOpenAIClient {
468
468
  let currentToolCallId = "";
469
469
  let currentToolCallName = "";
470
470
  let currentToolCallArgs = "";
471
+ let toolCallIndex = 0;
471
472
  let streamedTextLength = 0;
472
473
  try {
473
474
  for await (const event of stream) {
@@ -505,7 +506,7 @@ class AzureOpenAIClient {
505
506
  name: currentToolCallName,
506
507
  arguments: currentToolCallArgs || doneItem.arguments || ""
507
508
  },
508
- index: 0
509
+ index: toolCallIndex++
509
510
  }],
510
511
  finishReason: "tool_calls"
511
512
  };
@@ -3315,7 +3316,12 @@ Revise your approach based on what we've learned.`
3315
3316
  tool_calls: toolCalls
3316
3317
  });
3317
3318
  const toolResults = await Promise.allSettled(toolCalls.map(async (call) => {
3318
- const args = JSON.parse(call.function.arguments);
3319
+ let args;
3320
+ try {
3321
+ args = JSON.parse(call.function.arguments);
3322
+ } catch (parseErr) {
3323
+ throw new Error(`Invalid tool arguments for ${call.function.name}: ${parseErr instanceof Error ? parseErr.message : String(parseErr)}`);
3324
+ }
3319
3325
  return {
3320
3326
  call,
3321
3327
  args,
@@ -3628,7 +3634,12 @@ ${modePrompt}`;
3628
3634
  tool_calls: toolCalls
3629
3635
  });
3630
3636
  const toolResults = await Promise.allSettled(toolCalls.map(async (call) => {
3631
- const args = JSON.parse(call.function.arguments);
3637
+ let args;
3638
+ try {
3639
+ args = JSON.parse(call.function.arguments);
3640
+ } catch (parseErr) {
3641
+ throw new Error(`Invalid tool arguments for ${call.function.name}: ${parseErr instanceof Error ? parseErr.message : String(parseErr)}`);
3642
+ }
3632
3643
  return {
3633
3644
  call,
3634
3645
  result: await this.toolRegistry.execute(call.function.name, args, this.role)
@@ -8730,7 +8741,7 @@ ${event.consolidated}`,
8730
8741
  }
8731
8742
 
8732
8743
  // src/version.ts
8733
- var VERSION = "1.0.14";
8744
+ var VERSION = "1.0.15";
8734
8745
 
8735
8746
  // src/agent/start-chat.ts
8736
8747
  async function startChat(options = {}) {
@@ -9907,7 +9918,7 @@ ${"━".repeat(60)}`);
9907
9918
  }
9908
9919
 
9909
9920
  // src/version.ts
9910
- var VERSION2 = "1.0.14";
9921
+ var VERSION2 = "1.0.15";
9911
9922
 
9912
9923
  // src/ui/logo.tsx
9913
9924
  import { Box as Box14, Text as Text14 } from "ink";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sharkbait",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "AI-powered coding assistant for the command line. Uses OpenAI Responses API (not Chat). Autonomous agents, parallel code reviews, 36 tools.",
5
5
  "type": "module",
6
6
  "main": "./dist/cli.js",