sharkbait 1.0.13 → 1.0.14

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 +41 -15
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -6428,7 +6428,7 @@ import React3 from "react";
6428
6428
  import { render } from "ink";
6429
6429
 
6430
6430
  // src/ui/app.tsx
6431
- import React2, { useState as useState2, useRef } from "react";
6431
+ import React2, { useState as useState2, useEffect as useEffect2, useCallback, useRef } from "react";
6432
6432
  import { Box as Box12, Text as Text12, useInput, useApp } from "ink";
6433
6433
 
6434
6434
  // src/ui/message.tsx
@@ -6705,7 +6705,7 @@ function Spinner({
6705
6705
  useEffect(() => {
6706
6706
  const timer = setInterval(() => {
6707
6707
  setFrameIndex((prev) => (prev + 1) % frames.length);
6708
- }, 100);
6708
+ }, 200);
6709
6709
  return () => clearInterval(timer);
6710
6710
  }, [frames.length]);
6711
6711
  return /* @__PURE__ */ jsxDEV3(Box3, {
@@ -8267,8 +8267,28 @@ function App({ contextFiles: initialContextFiles, enableBeads: initialBeadsEnabl
8267
8267
  return config.azure.deployment;
8268
8268
  });
8269
8269
  const abortControllerRef = useRef(null);
8270
+ const pendingOutputRef = useRef("");
8271
+ const outputTimerRef = useRef(null);
8270
8272
  const { exit } = useApp();
8271
8273
  const workingDir = currentDir;
8274
+ const flushOutput = useCallback(() => {
8275
+ if (pendingOutputRef.current) {
8276
+ setCurrentOutput(pendingOutputRef.current);
8277
+ }
8278
+ outputTimerRef.current = null;
8279
+ }, []);
8280
+ const throttledSetOutput = useCallback((content) => {
8281
+ pendingOutputRef.current = content;
8282
+ if (!outputTimerRef.current) {
8283
+ outputTimerRef.current = setTimeout(flushOutput, 50);
8284
+ }
8285
+ }, [flushOutput]);
8286
+ useEffect2(() => {
8287
+ return () => {
8288
+ if (outputTimerRef.current)
8289
+ clearTimeout(outputTimerRef.current);
8290
+ };
8291
+ }, []);
8272
8292
  const agent = React2.useMemo(() => new Agent({
8273
8293
  contextFiles,
8274
8294
  enableBeads: beadsEnabled
@@ -8432,7 +8452,7 @@ function App({ contextFiles: initialContextFiles, enableBeads: initialBeadsEnabl
8432
8452
  switch (event.type) {
8433
8453
  case "text":
8434
8454
  assistantContent += event.content;
8435
- setCurrentOutput(assistantContent);
8455
+ throttledSetOutput(assistantContent);
8436
8456
  const chunkTokens = estimateTokens(event.content);
8437
8457
  setTokenCount((prev) => prev + chunkTokens);
8438
8458
  setSessionCost((prev) => prev + chunkTokens * 0.00003);
@@ -8502,18 +8522,18 @@ ${event.consolidated}`,
8502
8522
  }
8503
8523
  case "tool_result": {
8504
8524
  const duration = event.duration;
8505
- setActiveToolCalls((prev) => prev.map((tc) => tc.name === event.name && tc.status === "running" ? {
8506
- ...tc,
8507
- status: "success",
8508
- duration,
8509
- result: typeof event.result === "string" ? event.result.slice(0, 100) : JSON.stringify(event.result).slice(0, 100)
8510
- } : tc));
8511
8525
  setActiveToolCalls((prev) => {
8512
- const completed = prev.find((tc) => tc.name === event.name && tc.status === "success");
8526
+ const updated = prev.map((tc) => tc.name === event.name && tc.status === "running" ? {
8527
+ ...tc,
8528
+ status: "success",
8529
+ duration,
8530
+ result: typeof event.result === "string" ? event.result.slice(0, 100) : JSON.stringify(event.result).slice(0, 100)
8531
+ } : tc);
8532
+ const completed = updated.find((tc) => tc.name === event.name && tc.status === "success");
8513
8533
  if (completed) {
8514
8534
  completedToolCalls.push(completed);
8515
8535
  }
8516
- return prev.filter((tc) => !(tc.name === event.name && tc.status === "success"));
8536
+ return updated.filter((tc) => !(tc.name === event.name && tc.status === "success"));
8517
8537
  });
8518
8538
  break;
8519
8539
  }
@@ -8531,6 +8551,11 @@ ${event.consolidated}`,
8531
8551
  setTokenCount(event.totalTokens);
8532
8552
  break;
8533
8553
  case "done":
8554
+ if (outputTimerRef.current) {
8555
+ clearTimeout(outputTimerRef.current);
8556
+ outputTimerRef.current = null;
8557
+ }
8558
+ pendingOutputRef.current = "";
8534
8559
  if (assistantContent.trim()) {
8535
8560
  setMessages((prev) => [...prev, {
8536
8561
  role: "assistant",
@@ -8641,7 +8666,8 @@ ${event.consolidated}`,
8641
8666
  }, undefined, false, undefined, this),
8642
8667
  currentOutput && /* @__PURE__ */ jsxDEV12(MessageView, {
8643
8668
  role: "assistant",
8644
- content: currentOutput
8669
+ content: currentOutput,
8670
+ enableHighlighting: false
8645
8671
  }, undefined, false, undefined, this)
8646
8672
  ]
8647
8673
  }, undefined, true, undefined, this),
@@ -8704,7 +8730,7 @@ ${event.consolidated}`,
8704
8730
  }
8705
8731
 
8706
8732
  // src/version.ts
8707
- var VERSION = "1.0.13";
8733
+ var VERSION = "1.0.14";
8708
8734
 
8709
8735
  // src/agent/start-chat.ts
8710
8736
  async function startChat(options = {}) {
@@ -8719,7 +8745,7 @@ async function startChat(options = {}) {
8719
8745
  enableBeads: options.beads ?? true,
8720
8746
  version: VERSION,
8721
8747
  workingDir
8722
- }));
8748
+ }), { patchConsole: true });
8723
8749
  await waitUntilExit();
8724
8750
  }
8725
8751
  // src/commands/init.ts
@@ -9881,7 +9907,7 @@ ${"━".repeat(60)}`);
9881
9907
  }
9882
9908
 
9883
9909
  // src/version.ts
9884
- var VERSION2 = "1.0.13";
9910
+ var VERSION2 = "1.0.14";
9885
9911
 
9886
9912
  // src/ui/logo.tsx
9887
9913
  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.13",
3
+ "version": "1.0.14",
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",